From 1946843aee1309a80d19f8e9f8de83c09020ff5a Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Thu, 10 Apr 2025 11:30:09 +0200 Subject: [PATCH 01/87] Improvements to Changelog and pyproject --- CHANGELOG.md | 13 ++++++++++--- pyproject.toml | 9 +++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9515089..e1da6ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,16 @@ -# Change Log - -## Python Constraint +# Python Constraint Changelog 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.2.0 + +- Released: 2025-03-25 +- Issues / Enhancements: + - Automatic performance benchmarking and validation with real-world cases and automatic reporting (see [#93](https://github.com/python-constraint/python-constraint/pull/93)). + - Preparations for free-threading (no GIL) capabilities (see [#94](https://github.com/python-constraint/python-constraint/pull/94)). + - Removed NumPy dependency in micro benchmarks, updated dependencies, and optimized test interfaces. + - Changed development status from Beta to Production / Stable. + ### Version 2.1.0 - Released: 2025-02-11 diff --git a/pyproject.toml b/pyproject.toml index dc4df6f..3f821e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,8 +14,6 @@ authors = [ license = "BSD-2-Clause" readme = "README.rst" maintainers = [{name = "Floris-Jan Willemsen", email = "fjwillemsen97@gmail.com"}] -repository = "https://github.com/python-constraint/python-constraint" -documentation = "http://python-constraint.github.io/python-constraint/" keywords = [ "CSP", "constraint solving problems", @@ -45,6 +43,13 @@ classifiers = [ # 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 +[project.urls] +Homepage = "http://python-constraint.github.io/python-constraint/" +Repository = "https://github.com/python-constraint/python-constraint" +Documentation = "http://python-constraint.github.io/python-constraint/" +Issues = "https://github.com/python-constraint/python-constraint/issues" +Changelog = "https://github.com/python-constraint/python-constraint/blob/main/CHANGELOG.md" + [tool.poetry] include = [{ path = "constraint/*.so", format = "wheel" }] packages = [ From 53d75ee7b9532c3ec260e767b06529095f567088 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Thu, 10 Apr 2025 11:30:59 +0200 Subject: [PATCH 02/87] Added Ubuntu 22.04 to publish to attempt building wheels for older manylinux versions --- .github/workflows/publish-package.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 1e626ee..bb16ad8 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: # important: if this matrix is changed, also change EXPECTED_WHEELS_COUNT in `build_and_publish_as_package` below - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-22.04, ubuntu-latest, macos-latest, windows-latest] pyversion: ["3.9", "3.10", "3.11", "3.12", "3.13"] exclude: - os: ubuntu-latest diff --git a/pyproject.toml b/pyproject.toml index 3f821e3..8878bf3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ 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.2.2" # adhere to PEP440 versioning: https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#id55 +version = "2.2.3b1" # 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"}, From 4550cdaf9eecc6345ba0fd9a7cb2495d55b2f0a9 Mon Sep 17 00:00:00 2001 From: fjwillemsen Date: Thu, 10 Apr 2025 11:49:18 +0200 Subject: [PATCH 03/87] Updated docs requirements --- docs/requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 687ef51..c317153 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -9,7 +9,7 @@ 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.5 ; python_version >= "3.9" +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" @@ -28,6 +28,6 @@ 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.12.2 ; 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" From 6569206dffe6758e4384b6001762686d6b4369ef Mon Sep 17 00:00:00 2001 From: fjwillemsen Date: Thu, 10 Apr 2025 11:49:38 +0200 Subject: [PATCH 04/87] Updated docs requirements --- poetry.lock | 186 ++++++++++++++++++++++++++-------------------------- 1 file changed, 93 insertions(+), 93 deletions(-) diff --git a/poetry.lock b/poetry.lock index a3f4f66..4f38cb0 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.0.1 and should not be changed by hand. [[package]] name = "alabaster" @@ -14,14 +14,14 @@ files = [ [[package]] name = "argcomplete" -version = "3.6.1" +version = "3.6.2" description = "Bash tab completion for argparse" optional = false python-versions = ">=3.8" groups = ["test"] files = [ - {file = "argcomplete-3.6.1-py3-none-any.whl", hash = "sha256:cef54d7f752560570291214f0f1c48c3b8ef09aca63d65de7747612666725dbc"}, - {file = "argcomplete-3.6.1.tar.gz", hash = "sha256:927531c2fbaa004979f18c2316f6ffadcfc5cc2de15ae2624dfe65deaf60e14f"}, + {file = "argcomplete-3.6.2-py3-none-any.whl", hash = "sha256:65b3133a29ad53fb42c48cf5114752c7ab66c1c38544fdf6460f450c09b42591"}, + {file = "argcomplete-3.6.2.tar.gz", hash = "sha256:d0519b1bc867f5f4f4713c41ad0aba73a4a5f007449716b16f385f2166dc6adf"}, ] [package.extras] @@ -40,12 +40,12 @@ files = [ ] [package.extras] -benchmark = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-xdist[psutil]"] -cov = ["cloudpickle ; platform_python_implementation == \"CPython\"", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-xdist[psutil]"] -dev = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pre-commit-uv", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-xdist[psutil]"] +benchmark = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +cov = ["cloudpickle", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +dev = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pre-commit-uv", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] docs = ["cogapp", "furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier"] -tests = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-xdist[psutil]"] -tests-mypy = ["mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\""] +tests = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +tests-mypy = ["mypy (>=1.11.1)", "pytest-mypy-plugins"] [[package]] name = "babel" @@ -60,7 +60,7 @@ files = [ ] [package.extras] -dev = ["backports.zoneinfo ; python_version < \"3.9\"", "freezegun (>=1.0,<2.0)", "jinja2 (>=3.0)", "pytest (>=6.0)", "pytest-cov", "pytz", "setuptools", "tzdata ; sys_platform == \"win32\""] +dev = ["backports.zoneinfo", "freezegun (>=1.0,<2.0)", "jinja2 (>=3.0)", "pytest (>=6.0)", "pytest-cov", "pytz", "setuptools", "tzdata"] [[package]] name = "certifi" @@ -209,82 +209,82 @@ development = ["black", "flake8", "mypy", "pytest", "types-colorama"] [[package]] name = "coverage" -version = "7.7.1" +version = "7.8.0" description = "Code coverage measurement for Python" optional = false python-versions = ">=3.9" groups = ["test"] files = [ - {file = "coverage-7.7.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:553ba93f8e3c70e1b0031e4dfea36aba4e2b51fe5770db35e99af8dc5c5a9dfe"}, - {file = "coverage-7.7.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:44683f2556a56c9a6e673b583763096b8efbd2df022b02995609cf8e64fc8ae0"}, - {file = "coverage-7.7.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:02fad4f8faa4153db76f9246bc95c1d99f054f4e0a884175bff9155cf4f856cb"}, - {file = "coverage-7.7.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4c181ceba2e6808ede1e964f7bdc77bd8c7eb62f202c63a48cc541e5ffffccb6"}, - {file = "coverage-7.7.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80b5b207a8b08c6a934b214e364cab2fa82663d4af18981a6c0a9e95f8df7602"}, - {file = "coverage-7.7.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:25fe40967717bad0ce628a0223f08a10d54c9d739e88c9cbb0f77b5959367542"}, - {file = "coverage-7.7.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:881cae0f9cbd928c9c001487bb3dcbfd0b0af3ef53ae92180878591053be0cb3"}, - {file = "coverage-7.7.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:c90e9141e9221dd6fbc16a2727a5703c19443a8d9bf7d634c792fa0287cee1ab"}, - {file = "coverage-7.7.1-cp310-cp310-win32.whl", hash = "sha256:ae13ed5bf5542d7d4a0a42ff5160e07e84adc44eda65ddaa635c484ff8e55917"}, - {file = "coverage-7.7.1-cp310-cp310-win_amd64.whl", hash = "sha256:171e9977c6a5d2b2be9efc7df1126fd525ce7cad0eb9904fe692da007ba90d81"}, - {file = "coverage-7.7.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1165490be0069e34e4f99d08e9c5209c463de11b471709dfae31e2a98cbd49fd"}, - {file = "coverage-7.7.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:44af11c00fd3b19b8809487630f8a0039130d32363239dfd15238e6d37e41a48"}, - {file = "coverage-7.7.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fbba59022e7c20124d2f520842b75904c7b9f16c854233fa46575c69949fb5b9"}, - {file = "coverage-7.7.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:af94fb80e4f159f4d93fb411800448ad87b6039b0500849a403b73a0d36bb5ae"}, - {file = "coverage-7.7.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eae79f8e3501133aa0e220bbc29573910d096795882a70e6f6e6637b09522133"}, - {file = "coverage-7.7.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:e33426a5e1dc7743dd54dfd11d3a6c02c5d127abfaa2edd80a6e352b58347d1a"}, - {file = "coverage-7.7.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:b559adc22486937786731dac69e57296cb9aede7e2687dfc0d2696dbd3b1eb6b"}, - {file = "coverage-7.7.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:b838a91e84e1773c3436f6cc6996e000ed3ca5721799e7789be18830fad009a2"}, - {file = "coverage-7.7.1-cp311-cp311-win32.whl", hash = "sha256:2c492401bdb3a85824669d6a03f57b3dfadef0941b8541f035f83bbfc39d4282"}, - {file = "coverage-7.7.1-cp311-cp311-win_amd64.whl", hash = "sha256:1e6f867379fd033a0eeabb1be0cffa2bd660582b8b0c9478895c509d875a9d9e"}, - {file = "coverage-7.7.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:eff187177d8016ff6addf789dcc421c3db0d014e4946c1cc3fbf697f7852459d"}, - {file = "coverage-7.7.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2444fbe1ba1889e0b29eb4d11931afa88f92dc507b7248f45be372775b3cef4f"}, - {file = "coverage-7.7.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:177d837339883c541f8524683e227adcaea581eca6bb33823a2a1fdae4c988e1"}, - {file = "coverage-7.7.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:15d54ecef1582b1d3ec6049b20d3c1a07d5e7f85335d8a3b617c9960b4f807e0"}, - {file = "coverage-7.7.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:75c82b27c56478d5e1391f2e7b2e7f588d093157fa40d53fd9453a471b1191f2"}, - {file = "coverage-7.7.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:315ff74b585110ac3b7ab631e89e769d294f303c6d21302a816b3554ed4c81af"}, - {file = "coverage-7.7.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:4dd532dac197d68c478480edde74fd4476c6823355987fd31d01ad9aa1e5fb59"}, - {file = "coverage-7.7.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:385618003e3d608001676bb35dc67ae3ad44c75c0395d8de5780af7bb35be6b2"}, - {file = "coverage-7.7.1-cp312-cp312-win32.whl", hash = "sha256:63306486fcb5a827449464f6211d2991f01dfa2965976018c9bab9d5e45a35c8"}, - {file = "coverage-7.7.1-cp312-cp312-win_amd64.whl", hash = "sha256:37351dc8123c154fa05b7579fdb126b9f8b1cf42fd6f79ddf19121b7bdd4aa04"}, - {file = "coverage-7.7.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:eebd927b86761a7068a06d3699fd6c20129becf15bb44282db085921ea0f1585"}, - {file = "coverage-7.7.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2a79c4a09765d18311c35975ad2eb1ac613c0401afdd9cb1ca4110aeb5dd3c4c"}, - {file = "coverage-7.7.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8b1c65a739447c5ddce5b96c0a388fd82e4bbdff7251396a70182b1d83631019"}, - {file = "coverage-7.7.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:392cc8fd2b1b010ca36840735e2a526fcbd76795a5d44006065e79868cc76ccf"}, - {file = "coverage-7.7.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9bb47cc9f07a59a451361a850cb06d20633e77a9118d05fd0f77b1864439461b"}, - {file = "coverage-7.7.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:b4c144c129343416a49378e05c9451c34aae5ccf00221e4fa4f487db0816ee2f"}, - {file = "coverage-7.7.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:bc96441c9d9ca12a790b5ae17d2fa6654da4b3962ea15e0eabb1b1caed094777"}, - {file = "coverage-7.7.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:3d03287eb03186256999539d98818c425c33546ab4901028c8fa933b62c35c3a"}, - {file = "coverage-7.7.1-cp313-cp313-win32.whl", hash = "sha256:8fed429c26b99641dc1f3a79179860122b22745dd9af36f29b141e178925070a"}, - {file = "coverage-7.7.1-cp313-cp313-win_amd64.whl", hash = "sha256:092b134129a8bb940c08b2d9ceb4459af5fb3faea77888af63182e17d89e1cf1"}, - {file = "coverage-7.7.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:d3154b369141c3169b8133973ac00f63fcf8d6dbcc297d788d36afbb7811e511"}, - {file = "coverage-7.7.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:264ff2bcce27a7f455b64ac0dfe097680b65d9a1a293ef902675fa8158d20b24"}, - {file = "coverage-7.7.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ba8480ebe401c2f094d10a8c4209b800a9b77215b6c796d16b6ecdf665048950"}, - {file = "coverage-7.7.1-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:520af84febb6bb54453e7fbb730afa58c7178fd018c398a8fcd8e269a79bf96d"}, - {file = "coverage-7.7.1-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:88d96127ae01ff571d465d4b0be25c123789cef88ba0879194d673fdea52f54e"}, - {file = "coverage-7.7.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:0ce92c5a9d7007d838456f4b77ea159cb628187a137e1895331e530973dcf862"}, - {file = "coverage-7.7.1-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:0dab4ef76d7b14f432057fdb7a0477e8bffca0ad39ace308be6e74864e632271"}, - {file = "coverage-7.7.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:7e688010581dbac9cab72800e9076e16f7cccd0d89af5785b70daa11174e94de"}, - {file = "coverage-7.7.1-cp313-cp313t-win32.whl", hash = "sha256:e52eb31ae3afacdacfe50705a15b75ded67935770c460d88c215a9c0c40d0e9c"}, - {file = "coverage-7.7.1-cp313-cp313t-win_amd64.whl", hash = "sha256:a6b6b3bd121ee2ec4bd35039319f3423d0be282b9752a5ae9f18724bc93ebe7c"}, - {file = "coverage-7.7.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:34a3bf6b92e6621fc4dcdaab353e173ccb0ca9e4bfbcf7e49a0134c86c9cd303"}, - {file = "coverage-7.7.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:d6874929d624d3a670f676efafbbc747f519a6121b581dd41d012109e70a5ebd"}, - {file = "coverage-7.7.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ba5ff236c87a7b7aa1441a216caf44baee14cbfbd2256d306f926d16b026578"}, - {file = "coverage-7.7.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:452735fafe8ff5918236d5fe1feac322b359e57692269c75151f9b4ee4b7e1bc"}, - {file = "coverage-7.7.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f5f99a93cecf799738e211f9746dc83749b5693538fbfac279a61682ba309387"}, - {file = "coverage-7.7.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:11dd6f52c2a7ce8bf0a5f3b6e4a8eb60e157ffedc3c4b4314a41c1dfbd26ce58"}, - {file = "coverage-7.7.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:b52edb940d087e2a96e73c1523284a2e94a4e66fa2ea1e2e64dddc67173bad94"}, - {file = "coverage-7.7.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:d2e73e2ac468536197e6b3ab79bc4a5c9da0f078cd78cfcc7fe27cf5d1195ef0"}, - {file = "coverage-7.7.1-cp39-cp39-win32.whl", hash = "sha256:18f544356bceef17cc55fcf859e5664f06946c1b68efcea6acdc50f8f6a6e776"}, - {file = "coverage-7.7.1-cp39-cp39-win_amd64.whl", hash = "sha256:d66ff48ab3bb6f762a153e29c0fc1eb5a62a260217bc64470d7ba602f5886d20"}, - {file = "coverage-7.7.1-pp39.pp310.pp311-none-any.whl", hash = "sha256:5b7b02e50d54be6114cc4f6a3222fec83164f7c42772ba03b520138859b5fde1"}, - {file = "coverage-7.7.1-py3-none-any.whl", hash = "sha256:822fa99dd1ac686061e1219b67868e25d9757989cf2259f735a4802497d6da31"}, - {file = "coverage-7.7.1.tar.gz", hash = "sha256:199a1272e642266b90c9f40dec7fd3d307b51bf639fa0d15980dc0b3246c1393"}, + {file = "coverage-7.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2931f66991175369859b5fd58529cd4b73582461877ecfd859b6549869287ffe"}, + {file = "coverage-7.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:52a523153c568d2c0ef8826f6cc23031dc86cffb8c6aeab92c4ff776e7951b28"}, + {file = "coverage-7.8.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c8a5c139aae4c35cbd7cadca1df02ea8cf28a911534fc1b0456acb0b14234f3"}, + {file = "coverage-7.8.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5a26c0c795c3e0b63ec7da6efded5f0bc856d7c0b24b2ac84b4d1d7bc578d676"}, + {file = "coverage-7.8.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:821f7bcbaa84318287115d54becb1915eece6918136c6f91045bb84e2f88739d"}, + {file = "coverage-7.8.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:a321c61477ff8ee705b8a5fed370b5710c56b3a52d17b983d9215861e37b642a"}, + {file = "coverage-7.8.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:ed2144b8a78f9d94d9515963ed273d620e07846acd5d4b0a642d4849e8d91a0c"}, + {file = "coverage-7.8.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:042e7841a26498fff7a37d6fda770d17519982f5b7d8bf5278d140b67b61095f"}, + {file = "coverage-7.8.0-cp310-cp310-win32.whl", hash = "sha256:f9983d01d7705b2d1f7a95e10bbe4091fabc03a46881a256c2787637b087003f"}, + {file = "coverage-7.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:5a570cd9bd20b85d1a0d7b009aaf6c110b52b5755c17be6962f8ccd65d1dbd23"}, + {file = "coverage-7.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e7ac22a0bb2c7c49f441f7a6d46c9c80d96e56f5a8bc6972529ed43c8b694e27"}, + {file = "coverage-7.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:bf13d564d310c156d1c8e53877baf2993fb3073b2fc9f69790ca6a732eb4bfea"}, + {file = "coverage-7.8.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5761c70c017c1b0d21b0815a920ffb94a670c8d5d409d9b38857874c21f70d7"}, + {file = "coverage-7.8.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e5ff52d790c7e1628241ffbcaeb33e07d14b007b6eb00a19320c7b8a7024c040"}, + {file = "coverage-7.8.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d39fc4817fd67b3915256af5dda75fd4ee10621a3d484524487e33416c6f3543"}, + {file = "coverage-7.8.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:b44674870709017e4b4036e3d0d6c17f06a0e6d4436422e0ad29b882c40697d2"}, + {file = "coverage-7.8.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8f99eb72bf27cbb167b636eb1726f590c00e1ad375002230607a844d9e9a2318"}, + {file = "coverage-7.8.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:b571bf5341ba8c6bc02e0baeaf3b061ab993bf372d982ae509807e7f112554e9"}, + {file = "coverage-7.8.0-cp311-cp311-win32.whl", hash = "sha256:e75a2ad7b647fd8046d58c3132d7eaf31b12d8a53c0e4b21fa9c4d23d6ee6d3c"}, + {file = "coverage-7.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:3043ba1c88b2139126fc72cb48574b90e2e0546d4c78b5299317f61b7f718b78"}, + {file = "coverage-7.8.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:bbb5cc845a0292e0c520656d19d7ce40e18d0e19b22cb3e0409135a575bf79fc"}, + {file = "coverage-7.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4dfd9a93db9e78666d178d4f08a5408aa3f2474ad4d0e0378ed5f2ef71640cb6"}, + {file = "coverage-7.8.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f017a61399f13aa6d1039f75cd467be388d157cd81f1a119b9d9a68ba6f2830d"}, + {file = "coverage-7.8.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0915742f4c82208ebf47a2b154a5334155ed9ef9fe6190674b8a46c2fb89cb05"}, + {file = "coverage-7.8.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a40fcf208e021eb14b0fac6bdb045c0e0cab53105f93ba0d03fd934c956143a"}, + {file = "coverage-7.8.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a1f406a8e0995d654b2ad87c62caf6befa767885301f3b8f6f73e6f3c31ec3a6"}, + {file = "coverage-7.8.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:77af0f6447a582fdc7de5e06fa3757a3ef87769fbb0fdbdeba78c23049140a47"}, + {file = "coverage-7.8.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:f2d32f95922927186c6dbc8bc60df0d186b6edb828d299ab10898ef3f40052fe"}, + {file = "coverage-7.8.0-cp312-cp312-win32.whl", hash = "sha256:769773614e676f9d8e8a0980dd7740f09a6ea386d0f383db6821df07d0f08545"}, + {file = "coverage-7.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:e5d2b9be5b0693cf21eb4ce0ec8d211efb43966f6657807f6859aab3814f946b"}, + {file = "coverage-7.8.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5ac46d0c2dd5820ce93943a501ac5f6548ea81594777ca585bf002aa8854cacd"}, + {file = "coverage-7.8.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:771eb7587a0563ca5bb6f622b9ed7f9d07bd08900f7589b4febff05f469bea00"}, + {file = "coverage-7.8.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42421e04069fb2cbcbca5a696c4050b84a43b05392679d4068acbe65449b5c64"}, + {file = "coverage-7.8.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:554fec1199d93ab30adaa751db68acec2b41c5602ac944bb19187cb9a41a8067"}, + {file = "coverage-7.8.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5aaeb00761f985007b38cf463b1d160a14a22c34eb3f6a39d9ad6fc27cb73008"}, + {file = "coverage-7.8.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:581a40c7b94921fffd6457ffe532259813fc68eb2bdda60fa8cc343414ce3733"}, + {file = "coverage-7.8.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:f319bae0321bc838e205bf9e5bc28f0a3165f30c203b610f17ab5552cff90323"}, + {file = "coverage-7.8.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:04bfec25a8ef1c5f41f5e7e5c842f6b615599ca8ba8391ec33a9290d9d2db3a3"}, + {file = "coverage-7.8.0-cp313-cp313-win32.whl", hash = "sha256:dd19608788b50eed889e13a5d71d832edc34fc9dfce606f66e8f9f917eef910d"}, + {file = "coverage-7.8.0-cp313-cp313-win_amd64.whl", hash = "sha256:a9abbccd778d98e9c7e85038e35e91e67f5b520776781d9a1e2ee9d400869487"}, + {file = "coverage-7.8.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:18c5ae6d061ad5b3e7eef4363fb27a0576012a7447af48be6c75b88494c6cf25"}, + {file = "coverage-7.8.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:95aa6ae391a22bbbce1b77ddac846c98c5473de0372ba5c463480043a07bff42"}, + {file = "coverage-7.8.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e013b07ba1c748dacc2a80e69a46286ff145935f260eb8c72df7185bf048f502"}, + {file = "coverage-7.8.0-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d766a4f0e5aa1ba056ec3496243150698dc0481902e2b8559314368717be82b1"}, + {file = "coverage-7.8.0-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad80e6b4a0c3cb6f10f29ae4c60e991f424e6b14219d46f1e7d442b938ee68a4"}, + {file = "coverage-7.8.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:b87eb6fc9e1bb8f98892a2458781348fa37e6925f35bb6ceb9d4afd54ba36c73"}, + {file = "coverage-7.8.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:d1ba00ae33be84066cfbe7361d4e04dec78445b2b88bdb734d0d1cbab916025a"}, + {file = "coverage-7.8.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:f3c38e4e5ccbdc9198aecc766cedbb134b2d89bf64533973678dfcf07effd883"}, + {file = "coverage-7.8.0-cp313-cp313t-win32.whl", hash = "sha256:379fe315e206b14e21db5240f89dc0774bdd3e25c3c58c2c733c99eca96f1ada"}, + {file = "coverage-7.8.0-cp313-cp313t-win_amd64.whl", hash = "sha256:2e4b6b87bb0c846a9315e3ab4be2d52fac905100565f4b92f02c445c8799e257"}, + {file = "coverage-7.8.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:fa260de59dfb143af06dcf30c2be0b200bed2a73737a8a59248fcb9fa601ef0f"}, + {file = "coverage-7.8.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:96121edfa4c2dfdda409877ea8608dd01de816a4dc4a0523356067b305e4e17a"}, + {file = "coverage-7.8.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b8af63b9afa1031c0ef05b217faa598f3069148eeee6bb24b79da9012423b82"}, + {file = "coverage-7.8.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:89b1f4af0d4afe495cd4787a68e00f30f1d15939f550e869de90a86efa7e0814"}, + {file = "coverage-7.8.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94ec0be97723ae72d63d3aa41961a0b9a6f5a53ff599813c324548d18e3b9e8c"}, + {file = "coverage-7.8.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:8a1d96e780bdb2d0cbb297325711701f7c0b6f89199a57f2049e90064c29f6bd"}, + {file = "coverage-7.8.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:f1d8a2a57b47142b10374902777e798784abf400a004b14f1b0b9eaf1e528ba4"}, + {file = "coverage-7.8.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:cf60dd2696b457b710dd40bf17ad269d5f5457b96442f7f85722bdb16fa6c899"}, + {file = "coverage-7.8.0-cp39-cp39-win32.whl", hash = "sha256:be945402e03de47ba1872cd5236395e0f4ad635526185a930735f66710e1bd3f"}, + {file = "coverage-7.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:90e7fbc6216ecaffa5a880cdc9c77b7418c1dcb166166b78dbc630d07f278cc3"}, + {file = "coverage-7.8.0-pp39.pp310.pp311-none-any.whl", hash = "sha256:b8194fb8e50d556d5849753de991d390c5a1edeeba50f68e3a9253fbd8bf8ccd"}, + {file = "coverage-7.8.0-py3-none-any.whl", hash = "sha256:dbf364b4c5e7bae9250528167dfe40219b62e2d573c854d74be213e1e52069f7"}, + {file = "coverage-7.8.0.tar.gz", hash = "sha256:7a3d62b3b03b4b6fd41a085f3574874cf946cb4604d2b4d3e8dca8cd570ca501"}, ] [package.dependencies] tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.11.0a6\" and extra == \"toml\""} [package.extras] -toml = ["tomli ; python_full_version <= \"3.11.0a6\""] +toml = ["tomli"] [[package]] name = "cython" @@ -377,7 +377,7 @@ packaging = "*" tomli = {version = "*", markers = "python_version < \"3.11\""} [package.extras] -cli = ["tomli ; python_version < \"3.11\""] +cli = ["tomli"] [[package]] name = "distlib" @@ -470,7 +470,7 @@ files = [ [package.extras] docs = ["furo (>=2024.8.6)", "sphinx (>=8.1.3)", "sphinx-autodoc-typehints (>=3)"] testing = ["covdefaults (>=2.3)", "coverage (>=7.6.10)", "diff-cover (>=9.2.1)", "pytest (>=8.3.4)", "pytest-asyncio (>=0.25.2)", "pytest-cov (>=6)", "pytest-mock (>=3.14)", "pytest-timeout (>=2.3.1)", "virtualenv (>=20.28.1)"] -typing = ["typing-extensions (>=4.12.2) ; python_version < \"3.11\""] +typing = ["typing-extensions (>=4.12.2)"] [[package]] name = "idna" @@ -516,12 +516,12 @@ files = [ zipp = ">=3.20" [package.extras] -check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\""] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] enabler = ["pytest-enabler (>=2.2)"] perf = ["ipython"] -test = ["flufl.flake8", "importlib_resources (>=1.3) ; python_version < \"3.9\"", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-perf (>=0.9.2)"] +test = ["flufl.flake8", "importlib_resources (>=1.3)", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-perf (>=0.9.2)"] type = ["pytest-mypy"] [[package]] @@ -663,7 +663,7 @@ tomli = {version = ">=1", markers = "python_version < \"3.11\""} virtualenv = ">=20.14.1" [package.extras] -tox-to-nox = ["importlib-resources ; python_version < \"3.9\"", "jinja2", "tox (>=4)"] +tox-to-nox = ["importlib-resources", "jinja2", "tox (>=4)"] uv = ["uv (>=0.1.6)"] [[package]] @@ -800,14 +800,14 @@ histogram = ["pygal", "pygaljs", "setuptools"] [[package]] name = "pytest-cov" -version = "6.0.0" +version = "6.1.1" description = "Pytest plugin for measuring coverage." optional = false python-versions = ">=3.9" groups = ["test"] files = [ - {file = "pytest-cov-6.0.0.tar.gz", hash = "sha256:fde0b595ca248bb8e2d76f020b465f3b107c9632e6a1d1705f17834c89dcadc0"}, - {file = "pytest_cov-6.0.0-py3-none-any.whl", hash = "sha256:eee6f1b9e61008bd34975a4d5bab25801eb31898b032dd55addc93e96fcaaa35"}, + {file = "pytest_cov-6.1.1-py3-none-any.whl", hash = "sha256:bddf29ed2d0ab6f4df17b4c55b0a657287db8684af9c42ea546b21b1041b3dde"}, + {file = "pytest_cov-6.1.1.tar.gz", hash = "sha256:46935f7aaefba760e716c2ebfbe1c216240b9592966e7da99ea8292d4d3e2a0a"}, ] [package.dependencies] @@ -1131,14 +1131,14 @@ files = [ [[package]] name = "typing-extensions" -version = "4.13.0" +version = "4.13.1" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" groups = ["docs"] files = [ - {file = "typing_extensions-4.13.0-py3-none-any.whl", hash = "sha256:c8dd92cc0d6425a97c18fbb9d1954e5ff92c1ca881a309c45f06ebc0b79058e5"}, - {file = "typing_extensions-4.13.0.tar.gz", hash = "sha256:0a4ac55a5820789d87e297727d229866c9650f6521b64206413c4fbada24d95b"}, + {file = "typing_extensions-4.13.1-py3-none-any.whl", hash = "sha256:4b6cf02909eb5495cfbc3f6e8fd49217e6cc7944e145cdda8caa3734777f9e69"}, + {file = "typing_extensions-4.13.1.tar.gz", hash = "sha256:98795af00fb9640edec5b8e31fc647597b4691f099ad75f469a2616be1a76dff"}, ] [[package]] @@ -1154,21 +1154,21 @@ files = [ ] [package.extras] -brotli = ["brotli (>=1.0.9) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=0.8.0) ; platform_python_implementation != \"CPython\""] +brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] h2 = ["h2 (>=4,<5)"] socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] zstd = ["zstandard (>=0.18.0)"] [[package]] name = "virtualenv" -version = "20.29.3" +version = "20.30.0" description = "Virtual Python Environment builder" optional = false python-versions = ">=3.8" groups = ["test"] files = [ - {file = "virtualenv-20.29.3-py3-none-any.whl", hash = "sha256:3e3d00f5807e83b234dfb6122bf37cfadf4be216c53a49ac059d02414f819170"}, - {file = "virtualenv-20.29.3.tar.gz", hash = "sha256:95e39403fcf3940ac45bc717597dba16110b74506131845d9b687d5e73d947ac"}, + {file = "virtualenv-20.30.0-py3-none-any.whl", hash = "sha256:e34302959180fca3af42d1800df014b35019490b119eba981af27f2fa486e5d6"}, + {file = "virtualenv-20.30.0.tar.gz", hash = "sha256:800863162bcaa5450a6e4d721049730e7f2dae07720e0902b0e4040bd6f9ada8"}, ] [package.dependencies] @@ -1178,7 +1178,7 @@ platformdirs = ">=3.9.1,<5" [package.extras] docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2,!=7.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] -test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8) ; platform_python_implementation == \"PyPy\" or platform_python_implementation == \"CPython\" and sys_platform == \"win32\" and python_version >= \"3.13\"", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10) ; platform_python_implementation == \"CPython\""] +test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"] [[package]] name = "zipp" @@ -1194,11 +1194,11 @@ files = [ ] [package.extras] -check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\""] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] enabler = ["pytest-enabler (>=2.2)"] -test = ["big-O", "importlib-resources ; python_version < \"3.9\"", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-ignore-flaky"] +test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-ignore-flaky"] type = ["pytest-mypy"] [metadata] From c36a0d77a275a0ac67684fbefbb10d73930bc945 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Thu, 10 Apr 2025 11:53:08 +0200 Subject: [PATCH 05/87] Updated dependencies, adjusted number of wheels expected, bumped version --- .github/workflows/publish-package.yml | 4 +-- poetry.lock | 38 +++++++++++++-------------- pyproject.toml | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index bb16ad8..cfb7a6c 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -23,7 +23,7 @@ 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] + 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"] exclude: - os: ubuntu-latest @@ -96,7 +96,7 @@ jobs: exit 1; fi - EXPECTED_WHEELS_COUNT=15 + EXPECTED_WHEELS_COUNT=20 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/poetry.lock b/poetry.lock index 4f38cb0..c9492e5 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.0.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.2 and should not be changed by hand. [[package]] name = "alabaster" @@ -40,12 +40,12 @@ files = [ ] [package.extras] -benchmark = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins", "pytest-xdist[psutil]"] -cov = ["cloudpickle", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] -dev = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pre-commit-uv", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +benchmark = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-xdist[psutil]"] +cov = ["cloudpickle ; platform_python_implementation == \"CPython\"", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-xdist[psutil]"] +dev = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pre-commit-uv", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-xdist[psutil]"] docs = ["cogapp", "furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier"] -tests = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] -tests-mypy = ["mypy (>=1.11.1)", "pytest-mypy-plugins"] +tests = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-xdist[psutil]"] +tests-mypy = ["mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\""] [[package]] name = "babel" @@ -60,7 +60,7 @@ files = [ ] [package.extras] -dev = ["backports.zoneinfo", "freezegun (>=1.0,<2.0)", "jinja2 (>=3.0)", "pytest (>=6.0)", "pytest-cov", "pytz", "setuptools", "tzdata"] +dev = ["backports.zoneinfo ; python_version < \"3.9\"", "freezegun (>=1.0,<2.0)", "jinja2 (>=3.0)", "pytest (>=6.0)", "pytest-cov", "pytz", "setuptools", "tzdata ; sys_platform == \"win32\""] [[package]] name = "certifi" @@ -284,7 +284,7 @@ files = [ tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.11.0a6\" and extra == \"toml\""} [package.extras] -toml = ["tomli"] +toml = ["tomli ; python_full_version <= \"3.11.0a6\""] [[package]] name = "cython" @@ -377,7 +377,7 @@ packaging = "*" tomli = {version = "*", markers = "python_version < \"3.11\""} [package.extras] -cli = ["tomli"] +cli = ["tomli ; python_version < \"3.11\""] [[package]] name = "distlib" @@ -470,7 +470,7 @@ files = [ [package.extras] docs = ["furo (>=2024.8.6)", "sphinx (>=8.1.3)", "sphinx-autodoc-typehints (>=3)"] testing = ["covdefaults (>=2.3)", "coverage (>=7.6.10)", "diff-cover (>=9.2.1)", "pytest (>=8.3.4)", "pytest-asyncio (>=0.25.2)", "pytest-cov (>=6)", "pytest-mock (>=3.14)", "pytest-timeout (>=2.3.1)", "virtualenv (>=20.28.1)"] -typing = ["typing-extensions (>=4.12.2)"] +typing = ["typing-extensions (>=4.12.2) ; python_version < \"3.11\""] [[package]] name = "idna" @@ -506,7 +506,7 @@ description = "Read metadata from Python packages" optional = false python-versions = ">=3.9" groups = ["docs"] -markers = "python_version < \"3.10\"" +markers = "python_version == \"3.9\"" files = [ {file = "importlib_metadata-8.6.1-py3-none-any.whl", hash = "sha256:02a89390c1e15fdfdc0d7c6b25cb3e62650d0494005c97d6f148bf5b9787525e"}, {file = "importlib_metadata-8.6.1.tar.gz", hash = "sha256:310b41d755445d74569f993ccfc22838295d9fe005425094fad953d7f15c8580"}, @@ -516,12 +516,12 @@ files = [ zipp = ">=3.20" [package.extras] -check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\""] cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] enabler = ["pytest-enabler (>=2.2)"] perf = ["ipython"] -test = ["flufl.flake8", "importlib_resources (>=1.3)", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-perf (>=0.9.2)"] +test = ["flufl.flake8", "importlib_resources (>=1.3) ; python_version < \"3.9\"", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-perf (>=0.9.2)"] type = ["pytest-mypy"] [[package]] @@ -663,7 +663,7 @@ tomli = {version = ">=1", markers = "python_version < \"3.11\""} virtualenv = ">=20.14.1" [package.extras] -tox-to-nox = ["importlib-resources", "jinja2", "tox (>=4)"] +tox-to-nox = ["importlib-resources ; python_version < \"3.9\"", "jinja2", "tox (>=4)"] uv = ["uv (>=0.1.6)"] [[package]] @@ -1154,7 +1154,7 @@ files = [ ] [package.extras] -brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] +brotli = ["brotli (>=1.0.9) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=0.8.0) ; platform_python_implementation != \"CPython\""] h2 = ["h2 (>=4,<5)"] socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] zstd = ["zstandard (>=0.18.0)"] @@ -1178,7 +1178,7 @@ platformdirs = ">=3.9.1,<5" [package.extras] docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2,!=7.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] -test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"] +test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8) ; platform_python_implementation == \"PyPy\" or platform_python_implementation == \"GraalVM\" or platform_python_implementation == \"CPython\" and sys_platform == \"win32\" and python_version >= \"3.13\"", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10) ; platform_python_implementation == \"CPython\""] [[package]] name = "zipp" @@ -1187,18 +1187,18 @@ description = "Backport of pathlib-compatible object wrapper for zip files" optional = false python-versions = ">=3.9" groups = ["docs"] -markers = "python_version < \"3.10\"" +markers = "python_version == \"3.9\"" files = [ {file = "zipp-3.21.0-py3-none-any.whl", hash = "sha256:ac1bbe05fd2991f160ebce24ffbac5f6d11d83dc90891255885223d42b3cd931"}, {file = "zipp-3.21.0.tar.gz", hash = "sha256:2c9958f6430a2040341a52eb608ed6dd93ef4392e02ffe219417c1b28b5dd1f4"}, ] [package.extras] -check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\""] cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] enabler = ["pytest-enabler (>=2.2)"] -test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-ignore-flaky"] +test = ["big-O", "importlib-resources ; python_version < \"3.9\"", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-ignore-flaky"] type = ["pytest-mypy"] [metadata] diff --git a/pyproject.toml b/pyproject.toml index 8878bf3..fc735aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ 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.2.3b1" # adhere to PEP440 versioning: https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#id55 +version = "2.2.3" # 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"}, From 07684d97849c8ad7277ccb00c6ec1800b71869e0 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Fri, 30 May 2025 12:59:37 +0200 Subject: [PATCH 06/87] Fixed an issue where XOR was not processed as boolean statement --- constraint/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/constraint/parser.py b/constraint/parser.py index 06efabb..c7dfebd 100644 --- a/constraint/parser.py +++ b/constraint/parser.py @@ -181,7 +181,7 @@ def to_equality_constraint( equalities_found = re.findall("==", restriction) 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 (len(equalities_found) > 0 ^ len(inequalities_found) > 0): + 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] From 527b273cd026abb78f33d70b748c076257bd9d96 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Fri, 30 May 2025 19:29:07 +0200 Subject: [PATCH 07/87] Implemented the VariableExactSumConstraint, the first constraint in python-constraint where both sides of a constraint comparison can be variables --- constraint/constraints.py | 103 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/constraint/constraints.py b/constraint/constraints.py index 253b1ee..c864cd4 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -461,6 +461,109 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar else: return sum == exactsum +class VariableExactSumConstraint(Constraint): + """Constraint enforcing that the sum of variables equals the value of another variable. + + Example: + >>> problem = Problem() + >>> problem.addVariables(["a", "b", "c"], [1, 2, 3]) + >>> 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)]] + """ + + def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): + """Initialization method. + + Args: + target_var (Variable): The target variable to sum to. + sum_vars (sequence of Variables): The variables to sum up. + multipliers (sequence of numbers): If given, variable values + (except the last) will be multiplied by the given factors before being + summed to match the last variable. + """ + self.target_var = target_var + self.sum_vars = sum_vars + 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." + 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) + + multipliers = self._multipliers + + 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]): + domain.remove(value) + 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) + 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]): + domain.remove(value) + + def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + multipliers = self._multipliers + + if self.target_var not in assignments: + return True # can't evaluate without target, defer to later + + target_value = assignments[self.target_var] + sum_value = 0 + missing = False + + if multipliers: + for var, multiplier in zip(self.sum_vars, multipliers): + if var in assignments: + sum_value += assignments[var] * multiplier + else: + missing = True + else: + 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 + missing = True + + if isinstance(sum_value, float): + sum_value = round(sum_value, 10) + + if missing: + # Partial assignments: only check feasibility + if sum_value > target_value: + return False + if forwardcheck: + for var in self.sum_vars: + 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)]) + if temp_sum > target_value: + domain.hideValue(value) + else: + for value in domain[:]: + temp_sum = sum_value + value + if temp_sum > target_value: + domain.hideValue(value) + if not domain: + return False + return True + else: + return sum_value == target_value + class MinSumConstraint(Constraint): """Constraint enforcing that values of given variables sum at least to a given amount. From 5d421da4d4eefb371439770b353a234858bdee15 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Fri, 30 May 2025 19:29:41 +0200 Subject: [PATCH 08/87] Implemented the usage of VariableExactSumConstraint in the parser --- constraint/parser.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/constraint/parser.py b/constraint/parser.py index c7dfebd..be6269d 100644 --- a/constraint/parser.py +++ b/constraint/parser.py @@ -13,6 +13,7 @@ MinSumConstraint, FunctionConstraint, CompilableFunctionConstraint, + VariableExactSumConstraint, # TODO implement parsing for these constraints: # InSetConstraint, # NotInSetConstraint, @@ -97,8 +98,22 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: 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, use the VariableConstraints + variable_supported_operators = ['+'] + variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] + if all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): + variables_on_left = len(right) == 1 + if comparator == "==": + # if both sides are parameters, use the VariableExactSumConstraint + if variables_on_left: + return VariableExactSumConstraint(variables[-1], variables[:-1]) + else: + return VariableExactSumConstraint(variables[0], variables[1:]) + # left_num and right_num can't be both None or both a constant return None + + # 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) ) From e2d4003399f78b57aad347a60c61b2aa0cf3be83 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Fri, 30 May 2025 19:30:48 +0200 Subject: [PATCH 09/87] Recythonized after major changes --- constraint/constraints.c | 33213 ++++++++++++++++++++----------------- constraint/domain.c | 6778 ++++---- constraint/parser.c | 15000 +++++++++-------- constraint/problem.c | 12675 +++++++------- constraint/solvers.c | 21043 +++++++++++------------ 5 files changed, 45364 insertions(+), 43345 deletions(-) diff --git a/constraint/constraints.c b/constraint/constraints.c index 83adcf2..82eca75 100644 --- a/constraint/constraints.c +++ b/constraint/constraints.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.0.12 */ +/* Generated by Cython 3.1.1 */ /* BEGIN: Cython Metadata { @@ -18,32 +18,21 @@ END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ -#if defined(CYTHON_LIMITED_API) && 0 - #ifndef Py_LIMITED_API - #if CYTHON_LIMITED_API+0 > 0x03030000 - #define Py_LIMITED_API CYTHON_LIMITED_API - #else - #define Py_LIMITED_API 0x03030000 - #endif - #endif +/* InitLimitedAPI */ +#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API) + #define CYTHON_LIMITED_API 1 #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) - #error Cython requires Python 2.7+ or Python 3.3+. -#else -#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API -#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#elif PY_VERSION_HEX < 0x03080000 + #error Cython requires Python 3.8+. #else -#define __PYX_EXTRA_ABI_MODULE_NAME "" -#endif -#define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME -#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI -#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x03000CF0 +#define __PYX_ABI_VERSION "3_1_1" +#define CYTHON_HEX_VERSION 0x030101F0 #define CYTHON_FUTURE_DIVISION 1 +/* CModulePreamble */ #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -83,19 +72,13 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -106,8 +89,12 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #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 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -119,18 +106,22 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 + #define CYTHON_USE_EXC_INFO_STACK 1 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif @@ -141,20 +132,14 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 + #define CYTHON_USE_TYPE_SLOTS 1 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -165,8 +150,13 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #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 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -178,7 +168,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT @@ -188,14 +178,19 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00) + #endif + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100) #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 @@ -208,7 +203,7 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS @@ -217,8 +212,6 @@ END: Cython Metadata */ #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -231,8 +224,13 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -240,71 +238,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 1 - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif - #undef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 -#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 1 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #ifndef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #ifndef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 1 - #endif + #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS @@ -316,26 +250,37 @@ END: Cython Metadata */ #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 + #define CYTHON_USE_TP_FINALIZE 0 + #endif + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000) #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 - #endif - #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif + #undef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #ifndef CYTHON_USE_TYPE_SLOTS + #ifdef Py_GIL_DISABLED + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1 + #else + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 + #endif + #if PY_VERSION_HEX < 0x030A0000 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #elif !defined(CYTHON_USE_TYPE_SLOTS) #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS @@ -344,22 +289,19 @@ END: Cython Metadata */ #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif - #if PY_MAJOR_VERSION < 3 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif - #ifndef CYTHON_USE_PYLIST_INTERNALS + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLIST_INTERNALS) #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif - #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) @@ -368,20 +310,32 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 + #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS) + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif - #ifndef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #elif !defined(CYTHON_FAST_GIL) + #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #define CYTHON_METH_FASTCALL 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 @@ -389,51 +343,49 @@ END: Cython Metadata */ #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif - #if PY_VERSION_HEX < 0x030400a1 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #elif !defined(CYTHON_USE_TP_FINALIZE) + #ifndef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1) + #endif + #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif - #if PY_VERSION_HEX < 0x030600B1 + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 1 + #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE) #endif - #if PY_VERSION_HEX < 0x030700A3 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 1 + #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif #endif -#if !defined(CYTHON_FAST_PYCCALL) -#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#ifndef CYTHON_FAST_PYCCALL +#define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL #endif -#if !defined(CYTHON_VECTORCALL) +#ifndef CYTHON_VECTORCALL +#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) #endif +#endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS - #if PY_MAJOR_VERSION < 3 - #include "longintrepr.h" - #endif #undef SHIFT #undef BASE #undef MASK @@ -568,6 +520,9 @@ END: Cython Metadata */ #endif #endif #endif +#ifndef Py_UNREACHABLE + #define Py_UNREACHABLE() assert(0); abort() +#endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; @@ -582,6 +537,7 @@ END: Cython Metadata */ #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) +/* CInitCode */ #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) @@ -596,109 +552,42 @@ END: Cython Metadata */ #endif #endif +/* PythonCompatibility */ #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_DefaultClassType PyClass_Type - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_DefaultClassType PyType_Type +#define __Pyx_BUILTIN_MODULE_NAME "builtins" +#define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API - static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyObject *exception_table = NULL; - PyObject *types_module=NULL, *code_type=NULL, *result=NULL; - #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; - PyObject *py_minor_version = NULL; - #endif - long minor_version = 0; - PyObject *type, *value, *traceback; - PyErr_Fetch(&type, &value, &traceback); - #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; - #else - if (!(version_info = PySys_GetObject("version_info"))) goto end; - if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; - minor_version = PyLong_AsLong(py_minor_version); - Py_DECREF(py_minor_version); - if (minor_version == -1 && PyErr_Occurred()) goto end; - #endif - if (!(types_module = PyImport_ImportModule("types"))) goto end; - if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; - if (minor_version <= 7) { - (void)p; - result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else if (minor_version <= 10) { - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else { - if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); - } - end: - Py_XDECREF(code_type); - Py_XDECREF(exception_table); - Py_XDECREF(types_module); - if (type) { - PyErr_Restore(type, value, traceback); - } - return result; - } #ifndef CO_OPTIMIZED - #define CO_OPTIMIZED 0x0001 + static int CO_OPTIMIZED; #endif #ifndef CO_NEWLOCALS - #define CO_NEWLOCALS 0x0002 + static int CO_NEWLOCALS; #endif #ifndef CO_VARARGS - #define CO_VARARGS 0x0004 + static int CO_VARARGS; #endif #ifndef CO_VARKEYWORDS - #define CO_VARKEYWORDS 0x0008 + static int CO_VARKEYWORDS; #endif #ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x0200 + static int CO_ASYNC_GENERATOR; #endif #ifndef CO_GENERATOR - #define CO_GENERATOR 0x0020 + static int CO_GENERATOR; #endif #ifndef CO_COROUTINE - #define CO_COROUTINE 0x0080 + static int CO_COROUTINE; #endif -#elif PY_VERSION_HEX >= 0x030B0000 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); - if (!empty_bytes) return NULL; - result = - #if PY_VERSION_HEX >= 0x030C0000 - PyUnstable_Code_NewWithPosOnlyArgs - #else - PyCode_NewWithPosOnlyArgs - #endif - (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); - Py_DECREF(empty_bytes); - return result; - } -#elif PY_VERSION_HEX >= 0x030800B2 && !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 - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 + #endif #endif +static int __Pyx_init_co_variables(void); #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else @@ -730,12 +619,6 @@ END: Cython Metadata */ #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif -#ifndef CO_COROUTINE - #define CO_COROUTINE 0x80 -#endif -#ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x200 -#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -757,7 +640,7 @@ END: Cython Metadata */ #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif -#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) +#ifndef METH_FASTCALL #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif @@ -795,7 +678,7 @@ END: Cython Metadata */ #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif -#if PY_MAJOR_VERSION >= 0x030900B1 +#if PY_VERSION_HEX >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) @@ -812,7 +695,7 @@ static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif -static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { +static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else @@ -820,7 +703,7 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) -#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 +#if __PYX_LIMITED_VERSION_HEX < 0x03090000 #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 @@ -836,8 +719,10 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_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)) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) @@ -848,15 +733,11 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() -#elif PY_VERSION_HEX >= 0x03060000 - #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() -#elif PY_VERSION_HEX >= 0x03000000 - #define __Pyx_PyThreadState_Current PyThreadState_GET() #else - #define __Pyx_PyThreadState_Current _PyThreadState_Current + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #endif -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +#if CYTHON_USE_MODULE_STATE +static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); @@ -864,85 +745,43 @@ static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) Py_FatalError("Couldn't find the module state"); return result; } -#endif -#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o) #else - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) -#endif -#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) -#include "pythread.h" -#define Py_tss_NEEDS_INIT 0 -typedef int Py_tss_t; -static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { - *key = PyThread_create_key(); - return 0; -} -static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { - Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); - *key = Py_tss_NEEDS_INIT; - return key; -} -static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { - PyObject_Free(key); -} -static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { - return *key != Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { - PyThread_delete_key(*key); - *key = Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { - return PyThread_set_key_value(*key, value); -} -static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { - return PyThread_get_key_value(*key); -} -#endif -#if PY_MAJOR_VERSION < 3 - #if CYTHON_COMPILING_IN_PYPY - #if PYPY_VERSION_NUM < 0x07030600 - #if defined(__cplusplus) && __cplusplus >= 201402L - [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] - #elif defined(__GNUC__) || defined(__clang__) - __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) - #elif defined(_MSC_VER) - __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) - #endif - static CYTHON_INLINE int PyGILState_Check(void) { - return 0; - } - #else // PYPY_VERSION_NUM < 0x07030600 - #endif // PYPY_VERSION_NUM < 0x07030600 - #else - static CYTHON_INLINE int PyGILState_Check(void) { - PyThreadState * tstate = _PyThreadState_Current; - return tstate && (tstate == PyGILState_GetThisThreadState()); - } - #endif +#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global) #endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype) +#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype) +#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype) +#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype) +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype) + #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL) + #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\ + ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\ + (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\ + __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL) + #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype) + #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype) +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif -#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) +#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } -#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000 #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else @@ -966,17 +805,11 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) - #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) - #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) -#else - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif +#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ @@ -988,24 +821,20 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) -#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 +#else #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) @@ -1021,20 +850,6 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif -#else - #define CYTHON_PEP393_ENABLED 0 - #define PyUnicode_1BYTE_KIND 1 - #define PyUnicode_2BYTE_KIND 2 - #define PyUnicode_4BYTE_KIND 4 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) @@ -1048,8 +863,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif - #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) - #undef PyUnicode_Contains + #if !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) @@ -1059,33 +873,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #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 PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#ifndef PyObject_Unicode - #define PyObject_Unicode PyObject_Str -#endif -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) @@ -1102,28 +890,75 @@ 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_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS + #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) + #else + #define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i) + #endif +#else + #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) +#endif +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 +#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) +#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyObject_GetItem(dict, key); + if (*result == NULL) { + if (PyErr_ExceptionMatches(PyExc_KeyError)) { + PyErr_Clear(); + return 0; + } + return -1; + } + return 1; +} +#else +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyDict_GetItemWithError(dict, key); + if (*result == NULL) { + return PyErr_Occurred() ? -1 : 0; + } + Py_INCREF(*result); + return 1; +} +#endif +#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST + #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj) +#else + #define __Pyx_VISIT_CONST(obj) +#endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i) +#endif +#if CYTHON_ASSUME_SAFE_SIZE #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o) #else - #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) - #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) - #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) - #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) #endif -#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 +#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) { @@ -1132,85 +967,138 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, return module; } #endif -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define __Pyx_Py3Int_Check(op) PyLong_Check(op) - #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#else - #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) - #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t -#endif -#if CYTHON_USE_ASYNC_SLOTS - #if PY_VERSION_HEX >= 0x030500B1 - #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods - #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) - #else - #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) - #endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) +#endif +#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t +#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t +#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 + #define __Pyx_PySendResult PySendResult +#else + typedef enum { + PYGEN_RETURN = 0, + PYGEN_ERROR = -1, + PYGEN_NEXT = 1, + } __Pyx_PySendResult; +#endif +#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3 + typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result); +#else + #define __Pyx_pyiter_sendfunc sendfunc +#endif +#if !CYTHON_USE_AM_SEND +#define __PYX_HAS_PY_AM_SEND 0 +#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000 +#define __PYX_HAS_PY_AM_SEND 1 #else - #define __Pyx_PyType_AsAsync(obj) NULL +#define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation #endif -#ifndef __Pyx_PyAsyncMethodsStruct +#if __PYX_HAS_PY_AM_SEND < 2 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods +#else typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; + __Pyx_pyiter_sendfunc am_send; } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s)) #endif - -#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) - #if !defined(_USE_MATH_DEFINES) - #define _USE_MATH_DEFINES - #endif -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) +#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0 + #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21) #else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} + #define __Pyx_TPFLAGS_HAVE_AM_SEND (0) #endif -#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) -#define __Pyx_truncl trunc +#if PY_VERSION_HEX >= 0x03090000 +#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get() +#else +#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp +#endif +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000 +#ifdef __cplusplus +extern "C" +#endif +PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize); +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) { + int value; + PyObject *py_value = PyObject_GetAttrString(inspect, name); + if (!py_value) return 0; + value = (int) PyLong_AsLong(py_value); + Py_DECREF(py_value); + *write_to = value; + return value != -1 || !PyErr_Occurred(); +} +static int __Pyx_init_co_variables(void) { + PyObject *inspect; + int result; + inspect = PyImport_ImportModule("inspect"); + result = +#if !defined(CO_OPTIMIZED) + __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) && +#endif +#if !defined(CO_NEWLOCALS) + __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) && +#endif +#if !defined(CO_VARARGS) + __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) && +#endif +#if !defined(CO_VARKEYWORDS) + __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) && +#endif +#if !defined(CO_ASYNC_GENERATOR) + __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) && +#endif +#if !defined(CO_GENERATOR) + __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) && +#endif +#if !defined(CO_COROUTINE) + __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) && +#endif + 1; + Py_DECREF(inspect); + return result ? 0 : -1; +} +#else +static int __Pyx_init_co_variables(void) { + return 0; // It's a limited API-only feature +} +#endif + +/* MathInitCode */ +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #ifndef _USE_MATH_DEFINES + #define _USE_MATH_DEFINES + #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 #define __Pyx_truncl truncl #endif -#define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0 +#endif +#ifndef CYTHON_CLINE_IN_TRACEBACK +#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#endif +#if CYTHON_CLINE_IN_TRACEBACK +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; } +#else +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; } +#endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } @@ -1242,12 +1130,8 @@ static CYTHON_INLINE float __PYX_NAN() { #define CYTHON_WITHOUT_ASSERTIONS #endif -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -1290,19 +1174,23 @@ static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s) +#else + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s) +#endif #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) @@ -1311,32 +1199,44 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef) + return Py_NewRef(obj); +#else + Py_INCREF(obj); + return obj; +#endif +} +static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef) + return Py_XNewRef(obj); +#else + Py_XINCREF(obj); + return obj; +#endif +} +static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b); static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x) #else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x) #endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x)) #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK @@ -1383,81 +1283,12 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -#include -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = (char) c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL) #else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#include -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #endif @@ -1469,25 +1300,193 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) { #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ +/* PretendToInitialize */ +#ifdef __cplusplus +#include +template +static void __Pyx_pretend_to_initialize(T* ptr) { +#if __cplusplus > 201103L + if ((std::is_trivially_default_constructible::value)) +#endif + *ptr = T(); + (void)ptr; +} +#else static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } +#endif + #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; -static const char * __pyx_cfilenm = __FILE__; +static const char * const __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ -static const char *__pyx_f[] = { +static const char* const __pyx_f[] = { "constraint/constraints.py", }; /* #### Code section: utility_code_proto_before_types ### */ -/* ForceInitThreads.proto */ -#ifndef __PYX_FORCE_INIT_THREADS - #define __PYX_FORCE_INIT_THREADS 0 +/* Atomics.proto */ +#include +#ifndef CYTHON_ATOMICS + #define CYTHON_ATOMICS 1 +#endif +#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS +#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __pyx_atomic_int_type int +#define __pyx_nonatomic_int_type int +#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ + (__STDC_VERSION__ >= 201112L) &&\ + !defined(__STDC_NO_ATOMICS__)) + #include +#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ + (__cplusplus >= 201103L) ||\ + (defined(_MSC_VER) && _MSC_VER >= 1700))) + #include +#endif +#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ + (__STDC_VERSION__ >= 201112L) &&\ + !defined(__STDC_NO_ATOMICS__) &&\ + ATOMIC_INT_LOCK_FREE == 2) + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type atomic_int + #define __pyx_atomic_ptr_type atomic_uintptr_t + #define __pyx_nonatomic_ptr_type uintptr_t + #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed) + #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel) + #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel) + #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg) + #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired) + #define __pyx_atomic_load(value) atomic_load(value) + #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value) + #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) + #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) + #pragma message ("Using standard C atomics") + #elif defined(__PYX_DEBUG_ATOMICS) + #warning "Using standard C atomics" + #endif +#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ + (__cplusplus >= 201103L) ||\ +\ + (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\ + ATOMIC_INT_LOCK_FREE == 2) + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type std::atomic_int + #define __pyx_atomic_ptr_type std::atomic_uintptr_t + #define __pyx_nonatomic_ptr_type uintptr_t + #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed) + #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel) + #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel) + #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg) + #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired) + #define __pyx_atomic_load(value) std::atomic_load(value) + #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value) + #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) + #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) + #pragma message ("Using standard C++ atomics") + #elif defined(__PYX_DEBUG_ATOMICS) + #warning "Using standard C++ atomics" + #endif +#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\ + (__GNUC_MINOR__ > 1 ||\ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2)))) + #define __pyx_atomic_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) + #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg) + static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { + __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired); + int result = old == *expected; + *expected = old; + return result; + } + #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0) + #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value) + #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) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using GNU atomics" + #endif +#elif CYTHON_ATOMICS && defined(_MSC_VER) + #include + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type long + #define __pyx_atomic_ptr_type void* + #undef __pyx_nonatomic_int_type + #define __pyx_nonatomic_int_type long + #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) + #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1) + #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg) + static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { + __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected); + int result = old == *expected; + *expected = old; + return result; + } + #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0) + #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value) + #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) + #ifdef __PYX_DEBUG_ATOMICS + #pragma message ("Using MSVC atomics") + #endif +#else + #undef CYTHON_ATOMICS + #define CYTHON_ATOMICS 0 + #ifdef __PYX_DEBUG_ATOMICS + #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 */ +#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) +#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 +#endif +#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_BEGIN_CRITICAL_SECTION(o) { +#define __Pyx_END_CRITICAL_SECTION() } +#else +#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION +#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION #endif /* #### Code section: numeric_typedefs ### */ @@ -1495,41 +1494,34 @@ static const char *__pyx_f[] = { /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ +struct __pyx_defaults; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr; -struct __pyx_defaults; -typedef struct __pyx_defaults __pyx_defaults; -struct __pyx_defaults1; -typedef struct __pyx_defaults1 __pyx_defaults1; -struct __pyx_defaults2; -typedef struct __pyx_defaults2 __pyx_defaults2; -struct __pyx_defaults3; -typedef struct __pyx_defaults3 __pyx_defaults3; -struct __pyx_defaults4; -typedef struct __pyx_defaults4 __pyx_defaults4; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr; + +/* "constraint/constraints.py":63 + * vconstraints[variable].remove((self, variables)) + * + * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): # <<<<<<<<<<<<<< + * """Helper method for generic forward checking. + * +*/ struct __pyx_defaults { - PyObject *__pyx_arg__unassigned; -}; -struct __pyx_defaults1 { - PyObject *__pyx_arg__unassigned; -}; -struct __pyx_defaults2 { - PyObject *__pyx_arg__unassigned; -}; -struct __pyx_defaults3 { - PyObject *__pyx_arg__unassigned; -}; -struct __pyx_defaults4 { - PyObject *__pyx_arg__unassigned; + PyObject_HEAD + PyObject *arg0; }; + /* "constraint/constraints.py":307 * 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__genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; @@ -1537,14 +1529,78 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr { }; -/* "constraint/constraints.py":527 +/* "constraint/constraints.py":491 + * 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_1_genexpr { + PyObject_HEAD + PyObject *__pyx_genexpr_arg_0; + PyObject *__pyx_v_m; +}; + + +/* "constraint/constraints.py":494 + * 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_2_preProcess { + PyObject_HEAD + PyObject *__pyx_v_domains; + PyObject *__pyx_v_var; +}; + + +/* "constraint/constraints.py":508 + * 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[:]: +*/ +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr { + PyObject_HEAD + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *__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 *); +}; + + +/* "constraint/constraints.py":509 + * 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]): +*/ +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr { + PyObject_HEAD + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *__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 *); +}; + + +/* "constraint/constraints.py":630 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< * variable_contains_lt1.append(contains_lt1) * if contains_lt1 is True: - */ -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr { +*/ +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_value; @@ -1569,7 +1625,6 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr { static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ @@ -1583,11 +1638,6 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr { __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) - #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() -#endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ @@ -1699,6 +1749,8 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +#endif +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif @@ -1713,117 +1765,68 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i) #elif CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) -#else - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) -#endif -#if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) - #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i)) #else - #define __Pyx_Arg_NewRef_VARARGS(arg) arg - #define __Pyx_Arg_XDECREF_VARARGS(arg) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i)) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL - #define __Pyx_Arg_FASTCALL(args, i) args[i] - #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i]) + #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif - #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs - to have the same reference counting */ - #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else - #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS + #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS - #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) - #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS -#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) -#else #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) +#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) #endif -/* 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); - /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, - const char* function_name); - -/* 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)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ - (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)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (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)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (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); -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); - -/* DictGetItem.proto */ -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); -#define __Pyx_PyObject_Dict_GetItem(obj, name)\ - (likely(PyDict_CheckExact(obj)) ?\ - __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) -#else -#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) -#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) -#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); +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 */ +#define __Pyx_CallCFunction(cfunc, self, args)\ + ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args) +#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\ + ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs) +#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\ + ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs) +#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 **args, Py_ssize_t nargs, PyObject *kwargs); +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) @@ -1833,12 +1836,6 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" -#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else @@ -1867,86 +1864,178 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject /* PyObjectFastCall.proto */ #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 **args, size_t nargs, PyObject *kwargs); +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs); /* UnpackUnboundCMethod.proto */ typedef struct { PyObject *type; PyObject **method_name; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS + __pyx_atomic_int_type initialized; +#endif PyCFunction func; PyObject *method; int flag; } __Pyx_CachedCFunction; - -/* CallUnboundCMethod1.proto */ -static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) { +#if !CYTHON_ATOMICS + return 1; #else -#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) + __pyx_nonatomic_int_type expected = 0; + if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) { + return 0; + } + return expected; #endif - -/* PyDictContains.proto */ -static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { - int result = PyDict_Contains(dict, item); - return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } - -/* PyObjectSetAttrStr.proto */ -#if CYTHON_USE_TYPE_SLOTS -#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) -static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); -#else -#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) -#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) { +#if CYTHON_ATOMICS + __pyx_atomic_store(&cfunc->initialized, 2); #endif - -/* ListAppend.proto */ -#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS -static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { - PyListObject* L = (PyListObject*) list; - Py_ssize_t len = Py_SIZE(list); - if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { - Py_INCREF(x); - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 - L->ob_item[len] = x; - #else - PyList_SET_ITEM(list, len, x); - #endif - __Pyx_SET_SIZE(list, len + 1); - return 0; - } - return PyList_Append(list, x); } #else -#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2 +#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc) #endif -/* PyIntBinop.proto */ -#if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +/* CallUnboundCMethod2.proto */ +CYTHON_UNUSED +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); #else -#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ - (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) +#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) #endif -/* PyIntCompare.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); +/* 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); -/* RaiseException.proto */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); +/* 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); -/* dict_getitem_default.proto */ -static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (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)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (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)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (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); +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); -/* CallUnboundCMethod2.proto */ -static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 -static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); +/* DictGetItem.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); +#define __Pyx_PyObject_Dict_GetItem(obj, name)\ + (likely(PyDict_CheckExact(obj)) ?\ + __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) #else -#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) +#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) +#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); + +/* PyObjectFastCallMethod.proto */ +#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000 +#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL) +#else +static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf); +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* CallUnboundCMethod1.proto */ +CYTHON_UNUSED +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#else +#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) +#endif + +/* PyDictContains.proto */ +static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { + int result = PyDict_Contains(dict, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* PyObjectDelAttr.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 +#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL) +#else +#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n) +#endif + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + L->ob_item[len] = x; + #else + PyList_SET_ITEM(list, len, x); + #endif + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#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); +#else +#define __Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif +/* PyLongCompare.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyLong_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); + +/* RaiseException.proto */ +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 */ static CYTHON_INLINE int __Pyx_IterFinish(void); @@ -1978,12 +2067,8 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto */ -#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ - (likely(is_tuple || PyTuple_Check(tuple)) ?\ - (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ - __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ - (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ - __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) +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( PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); static int __Pyx_unpack_tuple2_generic( @@ -2002,7 +2087,7 @@ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* s } /* RaiseUnboundLocalError.proto */ -static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); +static void __Pyx_RaiseUnboundLocalError(const char *varname); /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE @@ -2046,7 +2131,7 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ - (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) @@ -2062,17 +2147,57 @@ static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_ve static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif -/* PyIntCompare.proto */ -static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); +/* 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 + +/* PyLongCompare.proto */ +static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); -/* IncludeStructmemberH.proto */ -#include +/* RaiseClosureNameError.proto */ +static void __Pyx_RaiseClosureNameError(const char *varname); -/* FixUpExtensionType.proto */ -#if CYTHON_USE_TYPE_SPECS -static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); +/* 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 + +/* 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 +#else +static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg); #endif +/* FixUpExtensionType.proto */ +static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); + /* 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); @@ -2081,12 +2206,8 @@ 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); -/* PyObject_GenericGetAttrNoDict.proto */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr -#endif +/* ListPack.proto */ +static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); @@ -2097,42 +2218,17 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); +/* dict_setdefault.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type); + /* FetchCommonType.proto */ -#if !CYTHON_USE_TYPE_SPECS -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); -#else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); -#endif /* PyMethodNew.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - typesModule = PyImport_ImportModule("types"); - if (!typesModule) return NULL; - methodType = PyObject_GetAttrString(typesModule, "MethodType"); - Py_DECREF(typesModule); - if (!methodType) return NULL; - result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); - Py_DECREF(methodType); - return result; -} -#elif PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - return PyMethod_New(func, self); -} -#else - #define __Pyx_PyMethod_New PyMethod_New -#endif +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); /* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif @@ -2166,10 +2262,11 @@ typedef struct { #else PyCMethodObject func; #endif -#if CYTHON_BACKPORT_VECTORCALL +#if CYTHON_BACKPORT_VECTORCALL ||\ + (CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL) __pyx_vectorcallfunc func_vectorcall; #endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; @@ -2182,9 +2279,7 @@ typedef struct { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif - void *defaults; - int defaults_pyobjects; - size_t defaults_size; + PyObject *defaults; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -2193,10 +2288,10 @@ typedef struct { PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check -#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) -#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) -#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType) +#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType) +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, @@ -2205,9 +2300,8 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef * PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, - size_t size, - int pyobjects); +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, + PyTypeObject *defaults_type); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, @@ -2220,7 +2314,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 +#if CYTHON_BACKPORT_VECTORCALL || 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) @@ -2235,7 +2329,7 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, PyObject* code); /* SetNameInClass.proto */ -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON @@ -2248,9 +2342,6 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); -/* PyObjectCall2Args.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); - /* 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) @@ -2271,28 +2362,33 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CLineInTraceback.proto */ -#ifdef CYTHON_CLINE_IN_TRACEBACK -#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) -#else +#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 */ -#if !CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject __Pyx_CachedCodeObjectType; +#else +typedef PyCodeObject __Pyx_CachedCodeObjectType; +#endif typedef struct { - PyCodeObject* code_object; + __Pyx_CachedCodeObjectType* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_int_type accessor_count; + #endif }; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); -#endif +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -2303,27 +2399,49 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #define __Pyx_HAS_GCC_DIAGNOSTIC #endif +/* PyObjectVectorCallKwBuilder.proto */ +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 +#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall +#endif +#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n) +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict +#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n) +#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value) +#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value) +#endif + /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" -static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 +#define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName #else +static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp); +#endif +#else // !LIMITED_API typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" -#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON @@ -2337,10 +2455,17 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) -#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) { + return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2); +} #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) +#ifdef PyExceptionInstance_Check + #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj) +#else + #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException) +#endif /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE @@ -2366,9 +2491,18 @@ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject * static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif +/* IterNextPlain.proto */ +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 */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); +/* ReturnWithStopIteration.proto */ +static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext); + /* CoroutineBase.proto */ struct __pyx_CoroutineObject; typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); @@ -2389,11 +2523,16 @@ typedef struct __pyx_CoroutineObject { PyObject *gi_weakreflist; PyObject *classobj; PyObject *yieldfrom; + __Pyx_pyiter_sendfunc yieldfrom_am_send; PyObject *gi_name; PyObject *gi_qualname; PyObject *gi_modulename; PyObject *gi_code; PyObject *gi_frame; +#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE) + PyMonitoringState __pyx_pymonitoring_state[__Pyx_MonitoringEventTypes_CyGen_count]; + uint64_t __pyx_pymonitoring_version; +#endif int resume_label; char is_running; } __pyx_CoroutineObject; @@ -2405,8 +2544,9 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( PyObject *name, PyObject *qualname, PyObject *module_name); static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); static int __Pyx_Coroutine_clear(PyObject *self); +static __Pyx_PySendResult __Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval); static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); -static PyObject *__Pyx_Coroutine_Close(PyObject *self); +static __Pyx_PySendResult __Pyx_Coroutine_Close(PyObject *self, PyObject **retval); static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); #if CYTHON_USE_EXC_INFO_STACK #define __Pyx_Coroutine_SwapException(self) @@ -2430,29 +2570,76 @@ static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); #endif static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); - -/* PatchModuleWithCoroutine.proto */ -static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); - -/* PatchGeneratorABC.proto */ -static int __Pyx_patch_abc(void); +static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen); +static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen); +static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen); +static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure); +#if __PYX_HAS_PY_AM_SEND == 2 +static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send); +#endif /* Generator.proto */ #define __Pyx_Generator_USED -#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_GeneratorType) +#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_GeneratorType) #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ - __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) + __Pyx__Coroutine_New(__pyx_mstate_global->__pyx_GeneratorType, body, code, closure, name, qualname, module_name) static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(PyObject *module); +static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self); -/* CheckBinaryVersion.proto */ +/* 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); -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); +/* MultiPhaseInitModuleState.proto */ +#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE +static PyObject *__Pyx_State_FindModule(void*); +static int __Pyx_State_AddModule(PyObject* module, void*); +static int __Pyx_State_RemoveModule(void*); +#elif CYTHON_USE_MODULE_STATE +#define __Pyx_State_FindModule PyState_FindModule +#define __Pyx_State_AddModule PyState_AddModule +#define __Pyx_State_RemoveModule PyState_RemoveModule +#endif /* #### Code section: module_declarations ### */ +/* CythonABIVersion.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API + #if CYTHON_METH_FASTCALL + #define __PYX_FASTCALL_ABI_SUFFIX "_fastcall" + #else + #define __PYX_FASTCALL_ABI_SUFFIX + #endif + #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX +#else + #define __PYX_LIMITED_ABI_SUFFIX +#endif +#if __PYX_HAS_PY_AM_SEND == 1 + #define __PYX_AM_SEND_ABI_SUFFIX +#elif __PYX_HAS_PY_AM_SEND == 2 + #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport" +#else + #define __PYX_AM_SEND_ABI_SUFFIX "noamsend" +#endif +#ifndef __PYX_MONITORING_ABI_SUFFIX + #define __PYX_MONITORING_ABI_SUFFIX +#endif +#if CYTHON_USE_TP_FINALIZE + #define __PYX_TP_FINALIZE_ABI_SUFFIX +#else + #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize" +#endif +#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED) + #define __PYX_FREELISTS_ABI_SUFFIX +#else + #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists" +#endif +#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." + /* Module declarations from "constraint.constraints" */ /* #### Code section: typeinfo ### */ @@ -2466,21 +2653,36 @@ int __pyx_module_is_main_constraint__constraints = 0; static PyObject *__pyx_builtin_NotImplementedError; static PyObject *__pyx_builtin_zip; static PyObject *__pyx_builtin_round; +static PyObject *__pyx_builtin_AssertionError; +static PyObject *__pyx_builtin_max; +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_Q[] = "\240Q"; +static const char __pyx_k_m[] = "m"; static const char __pyx_k_n[] = "n"; +static const char __pyx_k_v[] = "v"; static const char __pyx_k_x[] = "x"; -static const char __pyx_k__4[] = "."; +static const char __pyx_k__2[] = "?"; +static const char __pyx_k__3[] = "\250!"; +static const char __pyx_k__4[] = "\240\021"; static const char __pyx_k_gc[] = "gc"; -static const char __pyx_k__68[] = "?"; static const char __pyx_k_doc[] = "__doc__"; 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_var[] = "var"; static const char __pyx_k_zip[] = "zip"; -static const char __pyx_k_args[] = "args"; +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"; @@ -2488,31 +2690,36 @@ 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_round[] = "round"; static const char __pyx_k_set_2[] = "_set"; -static const char __pyx_k_super[] = "super"; static const char __pyx_k_throw[] = "throw"; static const char __pyx_k_value[] = "value"; -static const char __pyx_k_dict_2[] = "__dict__"; +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_domain[] = "domain"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_func_2[] = "_func"; -static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_func_3[] = "__func__"; static const char __pyx_k_maxsum[] = "maxsum"; static const char __pyx_k_minsum[] = "minsum"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_remove[] = "remove"; static const char __pyx_k_typing[] = "typing"; +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"; @@ -2521,21 +2728,27 @@ 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_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_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_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_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_hideValue[] = "hideValue"; static const char __pyx_k_isenabled[] = "isenabled"; 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_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"; @@ -2543,7 +2756,10 @@ static const char __pyx_k_assigned_2[] = "_assigned"; static const char __pyx_k_exactsum_2[] = "_exactsum"; static const char __pyx_k_list_tuple[] = "list[tuple]"; 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_var[] = "target_var"; static const char __pyx_k_unassigned[] = "_unassigned"; static const char __pyx_k_assignments[] = "assignments"; static const char __pyx_k_constraints[] = "constraints"; @@ -2556,9 +2772,11 @@ 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_target_value[] = "target_value"; static const char __pyx_k_vconstraints[] = "vconstraints"; -static const char __pyx_k_init_subclass[] = "__init_subclass__"; +static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_multipliers_2[] = "_multipliers"; +static const char __pyx_k_AssertionError[] = "AssertionError"; 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"; @@ -2597,19 +2815,24 @@ 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_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_M_N_L_A_1_3a_Cs_Rs_J_b_3c[] = "\320\004#\240?\260*\270M\310\021\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_NotInSetConstraint___call[] = "NotInSetConstraint.__call__"; static const char __pyx_k_NotInSetConstraint___init[] = "NotInSetConstraint.__init__"; static const char __pyx_k_constraint_constraints_py[] = "constraint/constraints.py"; 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_CompilableFunctionConstraint[] = "CompilableFunctionConstraint"; static const char __pyx_k_MaxProdConstraint_preProcess[] = "MaxProdConstraint.preProcess"; static const char __pyx_k_MinProdConstraint_preProcess[] = "MinProdConstraint.preProcess"; @@ -2618,16 +2841,41 @@ static const char __pyx_k_ExactSumConstraint_preProcess[] = "ExactSumConstraint. 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_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_L_y_1_1A_QfA_5_q_5_1[] = "\320\004\"\320\"5\3205H\310\006\310a\330\010\022\220$\220a\330\010\017\210q\330\010\014\210L\230\001\330\014\017\210y\230\003\2301\330\020\030\230\013\2401\240A\330\010\013\210:\220Q\220f\230A\330\014\023\2205\230\001\230\026\230q\330\010\013\2105\220\002\220!\330\014\023\2201\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\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_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_1_A_L_gQ_Cq_WA_A[] = "\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\360\006\000\t1\260\001\330\010\034\230A\330\010\014\210L\230\001\330\014\036\230g\240Q\330\014!\240\027\250\001\250\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_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_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_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_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_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_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_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_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_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 "; @@ -2638,6 +2886,8 @@ static const char __pyx_k_Constraint_enforcing_that_values_6[] = "Constraint enf 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."; static const char __pyx_k_Constraint_enforcing_that_values_8[] = "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_Constraint_enforcing_that_values_9[] = "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 "; +static const char __pyx_k_VariableExactSumConstraint___ini_2[] = "VariableExactSumConstraint.__init__"; +static const char __pyx_k_VariableExactSumConstraint_prePr_2[] = "VariableExactSumConstraint.preProcess"; /* #### 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 */ @@ -2660,6 +2910,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ 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 */ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_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_26VariableExactSumConstraint_8__init___genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstraint___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_26VariableExactSumConstraint_10preProcess_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_3genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ +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_17MaxProdConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_maxprod); /* proto */ @@ -2679,12 +2935,26 @@ 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_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_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, 0, 0, 0, 0}; -static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_remove = {0, 0, 0, 0, 0}; +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_preProcess(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ +/* SmallCodeConfig */ +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; @@ -2710,279 +2980,296 @@ typedef struct { #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif - #if CYTHON_USE_MODULE_STATE + 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_genexpr; - #endif + PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_2_preProcess; + PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr; + PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr; + PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_5_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_genexpr; - PyObject *__pyx_kp_s_Abstract_base_class_for_constrai; - PyObject *__pyx_n_s_AllDifferentConstraint; - PyObject *__pyx_n_s_AllDifferentConstraint___call; - PyObject *__pyx_n_s_AllEqualConstraint; - PyObject *__pyx_n_s_AllEqualConstraint___call; - PyObject *__pyx_n_s_Callable; - PyObject *__pyx_kp_u_Can_t_happen; - PyObject *__pyx_n_s_CompilableFunctionConstraint; - PyObject *__pyx_n_s_CompilableFunctionConstraint___c; - PyObject *__pyx_n_s_CompilableFunctionConstraint___i; - PyObject *__pyx_kp_u_CompilableFunctionConstraint_can; - PyObject *__pyx_n_s_Constraint; - PyObject *__pyx_n_s_Constraint___call; - PyObject *__pyx_kp_s_Constraint_enforcing_that_at_lea; - PyObject *__pyx_kp_s_Constraint_enforcing_that_at_lea_2; - PyObject *__pyx_kp_s_Constraint_enforcing_that_values; - PyObject *__pyx_kp_s_Constraint_enforcing_that_values_2; - PyObject *__pyx_kp_s_Constraint_enforcing_that_values_3; - PyObject *__pyx_kp_s_Constraint_enforcing_that_values_4; - PyObject *__pyx_kp_s_Constraint_enforcing_that_values_5; - PyObject *__pyx_kp_s_Constraint_enforcing_that_values_6; - PyObject *__pyx_kp_s_Constraint_enforcing_that_values_7; - PyObject *__pyx_kp_s_Constraint_enforcing_that_values_8; - PyObject *__pyx_kp_s_Constraint_enforcing_that_values_9; - PyObject *__pyx_n_s_Constraint_forwardCheck; - PyObject *__pyx_n_s_Constraint_preProcess; - PyObject *__pyx_kp_s_Constraint_which_wraps_a_functio; - PyObject *__pyx_n_s_ExactSumConstraint; - PyObject *__pyx_n_s_ExactSumConstraint___call; - PyObject *__pyx_n_s_ExactSumConstraint___init; - PyObject *__pyx_n_s_ExactSumConstraint_preProcess; - PyObject *__pyx_n_s_FunctionConstraint; - PyObject *__pyx_n_s_FunctionConstraint___call; - PyObject *__pyx_n_s_FunctionConstraint___init; - PyObject *__pyx_n_s_InSetConstraint; - PyObject *__pyx_n_s_InSetConstraint___call; - PyObject *__pyx_n_s_InSetConstraint___init; - PyObject *__pyx_n_s_InSetConstraint_preProcess; - PyObject *__pyx_n_s_MaxProdConstraint; - PyObject *__pyx_n_s_MaxProdConstraint___call; - PyObject *__pyx_n_s_MaxProdConstraint___init; - PyObject *__pyx_n_s_MaxProdConstraint_preProcess; - PyObject *__pyx_n_s_MaxProdConstraint_preProcess_loc; - PyObject *__pyx_n_s_MaxSumConstraint; - PyObject *__pyx_n_s_MaxSumConstraint___call; - PyObject *__pyx_n_s_MaxSumConstraint___init; - PyObject *__pyx_n_s_MaxSumConstraint_preProcess; - PyObject *__pyx_n_s_MaxSumConstraint_preProcess_loca; - PyObject *__pyx_n_s_MinProdConstraint; - PyObject *__pyx_n_s_MinProdConstraint___call; - PyObject *__pyx_n_s_MinProdConstraint___init; - PyObject *__pyx_n_s_MinProdConstraint_preProcess; - PyObject *__pyx_n_s_MinSumConstraint; - PyObject *__pyx_n_s_MinSumConstraint___call; - PyObject *__pyx_n_s_MinSumConstraint___init; - PyObject *__pyx_n_s_NotImplementedError; - PyObject *__pyx_n_s_NotInSetConstraint; - PyObject *__pyx_n_s_NotInSetConstraint___call; - PyObject *__pyx_n_s_NotInSetConstraint___init; - PyObject *__pyx_n_s_NotInSetConstraint_preProcess; - PyObject *__pyx_n_s_Optional; - PyObject *__pyx_kp_s_Optional_Sequence; - PyObject *__pyx_n_s_RuntimeError; - PyObject *__pyx_n_s_Sequence; - PyObject *__pyx_n_s_SomeInSetConstraint; - PyObject *__pyx_n_s_SomeInSetConstraint___call; - PyObject *__pyx_n_s_SomeInSetConstraint___init; - PyObject *__pyx_n_s_SomeNotInSetConstraint; - PyObject *__pyx_n_s_SomeNotInSetConstraint___call; - PyObject *__pyx_n_s_SomeNotInSetConstraint___init; - PyObject *__pyx_n_s_Unassigned; - PyObject *__pyx_n_s_Union; - PyObject *__pyx_kp_s_Union_int_float; - PyObject *__pyx_kp_s_Wrapper_function_for_picklable_s; - PyObject *__pyx_kp_u__4; - PyObject *__pyx_n_s__68; - PyObject *__pyx_n_s_args; - PyObject *__pyx_n_s_assigned; - PyObject *__pyx_n_s_assigned_2; - PyObject *__pyx_n_s_assignments; - PyObject *__pyx_n_s_asyncio_coroutines; - PyObject *__pyx_n_s_bool; - PyObject *__pyx_n_s_call; - PyObject *__pyx_n_s_cline_in_traceback; - PyObject *__pyx_n_s_close; - PyObject *__pyx_n_s_collections_abc; - PyObject *__pyx_n_s_constraint_constraints; - PyObject *__pyx_kp_s_constraint_constraints_py; - PyObject *__pyx_n_s_constraint_domain; - PyObject *__pyx_n_s_constraints; - PyObject *__pyx_n_s_contains_lt1; - PyObject *__pyx_n_s_contains_negative; - PyObject *__pyx_n_s_dict; - PyObject *__pyx_n_s_dict_2; - PyObject *__pyx_kp_u_disable; - PyObject *__pyx_n_s_doc; - PyObject *__pyx_n_s_domain; - PyObject *__pyx_n_s_domains; - PyObject *__pyx_kp_u_enable; - PyObject *__pyx_n_s_exact; - PyObject *__pyx_n_s_exact_2; - PyObject *__pyx_n_s_exactsum; - PyObject *__pyx_n_s_exactsum_2; - PyObject *__pyx_n_s_forwardCheck; - PyObject *__pyx_n_s_forwardcheck; - PyObject *__pyx_n_s_found; - PyObject *__pyx_n_s_func; - PyObject *__pyx_n_s_func_2; - PyObject *__pyx_kp_u_gc; - PyObject *__pyx_n_s_genexpr; - PyObject *__pyx_n_s_get; - PyObject *__pyx_n_s_hideValue; - PyObject *__pyx_n_s_import; - PyObject *__pyx_n_s_init; - PyObject *__pyx_n_s_init_subclass; - PyObject *__pyx_n_s_is_coroutine; - PyObject *__pyx_kp_u_isenabled; - PyObject *__pyx_kp_s_list_tuple; - PyObject *__pyx_n_s_main; - PyObject *__pyx_n_s_maxprod; - PyObject *__pyx_n_s_maxprod_2; - PyObject *__pyx_n_s_maxsum; - PyObject *__pyx_n_s_maxsum_2; - PyObject *__pyx_n_s_metaclass; - PyObject *__pyx_n_s_minprod; - PyObject *__pyx_n_s_minprod_2; - PyObject *__pyx_n_s_minsum; - PyObject *__pyx_n_s_minsum_2; - PyObject *__pyx_n_s_missing; - PyObject *__pyx_n_s_module; - PyObject *__pyx_n_s_mro_entries; - PyObject *__pyx_n_s_multiplier; - PyObject *__pyx_n_s_multipliers; - PyObject *__pyx_n_s_multipliers_2; - PyObject *__pyx_n_s_n; - PyObject *__pyx_n_s_n_2; - PyObject *__pyx_n_s_name; - PyObject *__pyx_n_s_parms; - PyObject *__pyx_n_s_preProcess; - PyObject *__pyx_n_s_prepare; - PyObject *__pyx_n_s_prod; - PyObject *__pyx_n_s_qualname; - PyObject *__pyx_n_s_remove; - PyObject *__pyx_n_s_round; - PyObject *__pyx_n_s_seen; - PyObject *__pyx_n_s_self; - PyObject *__pyx_n_s_send; - PyObject *__pyx_n_s_set; - PyObject *__pyx_n_s_set_2; - PyObject *__pyx_n_s_set_name; - PyObject *__pyx_n_s_singlevalue; - PyObject *__pyx_n_s_str; - PyObject *__pyx_n_s_sum; - PyObject *__pyx_n_s_super; - PyObject *__pyx_n_s_test; - PyObject *__pyx_n_s_throw; - PyObject *__pyx_n_s_typing; - PyObject *__pyx_n_s_unassigned; - PyObject *__pyx_n_s_unassignedvariable; - PyObject *__pyx_n_s_value; - PyObject *__pyx_n_s_variable; - PyObject *__pyx_n_s_variable_contains_lt1; - PyObject *__pyx_n_s_variable_contains_negative; - PyObject *__pyx_n_s_variable_with_lt1; - PyObject *__pyx_n_s_variable_with_negative; - PyObject *__pyx_n_s_variables; - PyObject *__pyx_n_s_vconstraints; - PyObject *__pyx_n_s_x; - PyObject *__pyx_n_s_zip; + PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_preProcess; + PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr; + PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr; + PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_genexpr; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; + __Pyx_CachedCFunction __pyx_umethod_PyList_Type__remove; + PyObject *__pyx_slice[1]; + PyObject *__pyx_tuple[4]; + PyObject *__pyx_codeobj_tab[41]; + PyObject *__pyx_string_tab[193]; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_10; - PyObject *__pyx_slice_; - PyObject *__pyx_tuple__2; - PyObject *__pyx_tuple__3; - PyObject *__pyx_tuple__5; - PyObject *__pyx_tuple__7; - PyObject *__pyx_tuple__8; - PyObject *__pyx_tuple__10; - PyObject *__pyx_tuple__12; - PyObject *__pyx_tuple__14; - PyObject *__pyx_tuple__15; - PyObject *__pyx_tuple__18; - PyObject *__pyx_tuple__20; - PyObject *__pyx_tuple__22; - PyObject *__pyx_tuple__24; - PyObject *__pyx_tuple__26; - PyObject *__pyx_tuple__27; - PyObject *__pyx_tuple__29; - PyObject *__pyx_tuple__31; - PyObject *__pyx_tuple__33; - PyObject *__pyx_tuple__35; - PyObject *__pyx_tuple__37; - PyObject *__pyx_tuple__39; - PyObject *__pyx_tuple__41; - PyObject *__pyx_tuple__43; - PyObject *__pyx_tuple__45; - PyObject *__pyx_tuple__47; - PyObject *__pyx_tuple__49; - PyObject *__pyx_tuple__51; - PyObject *__pyx_tuple__53; - PyObject *__pyx_tuple__56; - PyObject *__pyx_tuple__61; - PyObject *__pyx_tuple__63; - PyObject *__pyx_tuple__64; - PyObject *__pyx_codeobj__6; - PyObject *__pyx_codeobj__9; - PyObject *__pyx_codeobj__11; - PyObject *__pyx_codeobj__13; - PyObject *__pyx_codeobj__16; - PyObject *__pyx_codeobj__17; - PyObject *__pyx_codeobj__19; - PyObject *__pyx_codeobj__21; - PyObject *__pyx_codeobj__23; - PyObject *__pyx_codeobj__25; - PyObject *__pyx_codeobj__28; - PyObject *__pyx_codeobj__30; - PyObject *__pyx_codeobj__32; - PyObject *__pyx_codeobj__34; - PyObject *__pyx_codeobj__36; - PyObject *__pyx_codeobj__38; - PyObject *__pyx_codeobj__40; - PyObject *__pyx_codeobj__42; - PyObject *__pyx_codeobj__44; - PyObject *__pyx_codeobj__46; - PyObject *__pyx_codeobj__48; - PyObject *__pyx_codeobj__50; - PyObject *__pyx_codeobj__52; - PyObject *__pyx_codeobj__54; - PyObject *__pyx_codeobj__55; - PyObject *__pyx_codeobj__57; - PyObject *__pyx_codeobj__58; - PyObject *__pyx_codeobj__59; - PyObject *__pyx_codeobj__60; - PyObject *__pyx_codeobj__62; - PyObject *__pyx_codeobj__65; - PyObject *__pyx_codeobj__66; - PyObject *__pyx_codeobj__67; -} __pyx_mstate; +/* #### Code section: module_state_contents ### */ + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct__genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_1_genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_2_preProcess[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_2_preProcess; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_3_genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_3_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_4_genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_4_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_5_genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_5_genexpr; +#endif +/* CachedMethodType.module_state_decls */ +#if CYTHON_COMPILING_IN_LIMITED_API +PyObject *__Pyx_CachedMethodType; +#endif + +/* CodeObjectCache.module_state_decls */ +struct __Pyx_CodeObjectCache __pyx_code_cache; + +/* IterNextPlain.module_state_decls */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 +PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache; +#endif + +/* #### Code section: module_state_end ### */ +} __pyx_mstatetype; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { - extern struct PyModuleDef __pyx_moduledef; +extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif -#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) +#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef))) -#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) - -#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) +#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef)) #else -static __pyx_mstate __pyx_mstate_global_static = +static __pyx_mstatetype __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif -static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; -#endif +static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### 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_su __pyx_string_tab[17] +#define __pyx_kp_u_Constraint_enforcing_that_values __pyx_string_tab[18] +#define __pyx_kp_u_Constraint_enforcing_that_values_2 __pyx_string_tab[19] +#define __pyx_kp_u_Constraint_enforcing_that_values_3 __pyx_string_tab[20] +#define __pyx_kp_u_Constraint_enforcing_that_values_4 __pyx_string_tab[21] +#define __pyx_kp_u_Constraint_enforcing_that_values_5 __pyx_string_tab[22] +#define __pyx_kp_u_Constraint_enforcing_that_values_6 __pyx_string_tab[23] +#define __pyx_kp_u_Constraint_enforcing_that_values_7 __pyx_string_tab[24] +#define __pyx_kp_u_Constraint_enforcing_that_values_8 __pyx_string_tab[25] +#define __pyx_kp_u_Constraint_enforcing_that_values_9 __pyx_string_tab[26] +#define __pyx_n_u_Constraint_forwardCheck __pyx_string_tab[27] +#define __pyx_n_u_Constraint_preProcess __pyx_string_tab[28] +#define __pyx_kp_u_Constraint_which_wraps_a_functio __pyx_string_tab[29] +#define __pyx_n_u_ExactSumConstraint __pyx_string_tab[30] +#define __pyx_n_u_ExactSumConstraint___call __pyx_string_tab[31] +#define __pyx_n_u_ExactSumConstraint___init __pyx_string_tab[32] +#define __pyx_n_u_ExactSumConstraint_preProcess __pyx_string_tab[33] +#define __pyx_n_u_FunctionConstraint __pyx_string_tab[34] +#define __pyx_n_u_FunctionConstraint___call __pyx_string_tab[35] +#define __pyx_n_u_FunctionConstraint___init __pyx_string_tab[36] +#define __pyx_n_u_InSetConstraint __pyx_string_tab[37] +#define __pyx_n_u_InSetConstraint___call __pyx_string_tab[38] +#define __pyx_n_u_InSetConstraint___init __pyx_string_tab[39] +#define __pyx_n_u_InSetConstraint_preProcess __pyx_string_tab[40] +#define __pyx_kp_u_Last_multiplier_must_be_1_as_it __pyx_string_tab[41] +#define __pyx_n_u_MaxProdConstraint __pyx_string_tab[42] +#define __pyx_n_u_MaxProdConstraint___call __pyx_string_tab[43] +#define __pyx_n_u_MaxProdConstraint___init __pyx_string_tab[44] +#define __pyx_n_u_MaxProdConstraint_preProcess __pyx_string_tab[45] +#define __pyx_n_u_MaxProdConstraint_preProcess_loc __pyx_string_tab[46] +#define __pyx_n_u_MaxSumConstraint __pyx_string_tab[47] +#define __pyx_n_u_MaxSumConstraint___call __pyx_string_tab[48] +#define __pyx_n_u_MaxSumConstraint___init __pyx_string_tab[49] +#define __pyx_n_u_MaxSumConstraint_preProcess __pyx_string_tab[50] +#define __pyx_n_u_MaxSumConstraint_preProcess_loca __pyx_string_tab[51] +#define __pyx_n_u_MinProdConstraint __pyx_string_tab[52] +#define __pyx_n_u_MinProdConstraint___call __pyx_string_tab[53] +#define __pyx_n_u_MinProdConstraint___init __pyx_string_tab[54] +#define __pyx_n_u_MinProdConstraint_preProcess __pyx_string_tab[55] +#define __pyx_n_u_MinSumConstraint __pyx_string_tab[56] +#define __pyx_n_u_MinSumConstraint___call __pyx_string_tab[57] +#define __pyx_n_u_MinSumConstraint___init __pyx_string_tab[58] +#define __pyx_kp_u_Multipliers_must_be_numbers __pyx_string_tab[59] +#define __pyx_kp_u_Multipliers_must_match_sum_varia __pyx_string_tab[60] +#define __pyx_n_u_NotImplementedError __pyx_string_tab[61] +#define __pyx_n_u_NotInSetConstraint __pyx_string_tab[62] +#define __pyx_n_u_NotInSetConstraint___call __pyx_string_tab[63] +#define __pyx_n_u_NotInSetConstraint___init __pyx_string_tab[64] +#define __pyx_n_u_NotInSetConstraint_preProcess __pyx_string_tab[65] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[66] +#define __pyx_n_u_Optional __pyx_string_tab[67] +#define __pyx_kp_u_Optional_Sequence __pyx_string_tab[68] +#define __pyx_n_u_RuntimeError __pyx_string_tab[69] +#define __pyx_n_u_Sequence __pyx_string_tab[70] +#define __pyx_n_u_SomeInSetConstraint __pyx_string_tab[71] +#define __pyx_n_u_SomeInSetConstraint___call __pyx_string_tab[72] +#define __pyx_n_u_SomeInSetConstraint___init __pyx_string_tab[73] +#define __pyx_n_u_SomeNotInSetConstraint __pyx_string_tab[74] +#define __pyx_n_u_SomeNotInSetConstraint___call __pyx_string_tab[75] +#define __pyx_n_u_SomeNotInSetConstraint___init __pyx_string_tab[76] +#define __pyx_n_u_Unassigned __pyx_string_tab[77] +#define __pyx_n_u_Union __pyx_string_tab[78] +#define __pyx_kp_u_Union_int_float __pyx_string_tab[79] +#define __pyx_n_u_VariableExactSumConstraint __pyx_string_tab[80] +#define __pyx_n_u_VariableExactSumConstraint___cal __pyx_string_tab[81] +#define __pyx_n_u_VariableExactSumConstraint___ini __pyx_string_tab[82] +#define __pyx_n_u_VariableExactSumConstraint___ini_2 __pyx_string_tab[83] +#define __pyx_n_u_VariableExactSumConstraint_prePr __pyx_string_tab[84] +#define __pyx_n_u_VariableExactSumConstraint_prePr_2 __pyx_string_tab[85] +#define __pyx_kp_u_Wrapper_function_for_picklable_s __pyx_string_tab[86] +#define __pyx_kp_u__2 __pyx_string_tab[87] +#define __pyx_kp_u_add_note __pyx_string_tab[88] +#define __pyx_n_u_assigned __pyx_string_tab[89] +#define __pyx_n_u_assigned_2 __pyx_string_tab[90] +#define __pyx_n_u_assignments __pyx_string_tab[91] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[92] +#define __pyx_n_u_bool __pyx_string_tab[93] +#define __pyx_n_u_call __pyx_string_tab[94] +#define __pyx_n_u_class_getitem __pyx_string_tab[95] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[96] +#define __pyx_n_u_close __pyx_string_tab[97] +#define __pyx_n_u_collections_abc __pyx_string_tab[98] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[99] +#define __pyx_kp_u_constraint_constraints_py __pyx_string_tab[100] +#define __pyx_n_u_constraint_domain __pyx_string_tab[101] +#define __pyx_n_u_constraints __pyx_string_tab[102] +#define __pyx_n_u_contains_lt1 __pyx_string_tab[103] +#define __pyx_n_u_contains_negative __pyx_string_tab[104] +#define __pyx_n_u_dict __pyx_string_tab[105] +#define __pyx_kp_u_disable __pyx_string_tab[106] +#define __pyx_n_u_doc __pyx_string_tab[107] +#define __pyx_n_u_domain __pyx_string_tab[108] +#define __pyx_n_u_domains __pyx_string_tab[109] +#define __pyx_kp_u_enable __pyx_string_tab[110] +#define __pyx_n_u_exact __pyx_string_tab[111] +#define __pyx_n_u_exact_2 __pyx_string_tab[112] +#define __pyx_n_u_exactsum __pyx_string_tab[113] +#define __pyx_n_u_exactsum_2 __pyx_string_tab[114] +#define __pyx_n_u_forwardCheck __pyx_string_tab[115] +#define __pyx_n_u_forwardcheck __pyx_string_tab[116] +#define __pyx_n_u_found __pyx_string_tab[117] +#define __pyx_n_u_func __pyx_string_tab[118] +#define __pyx_n_u_func_2 __pyx_string_tab[119] +#define __pyx_n_u_func_3 __pyx_string_tab[120] +#define __pyx_kp_u_gc __pyx_string_tab[121] +#define __pyx_n_u_genexpr __pyx_string_tab[122] +#define __pyx_n_u_get __pyx_string_tab[123] +#define __pyx_n_u_hideValue __pyx_string_tab[124] +#define __pyx_n_u_index __pyx_string_tab[125] +#define __pyx_n_u_init __pyx_string_tab[126] +#define __pyx_n_u_is_coroutine __pyx_string_tab[127] +#define __pyx_kp_u_isenabled __pyx_string_tab[128] +#define __pyx_kp_u_list_tuple __pyx_string_tab[129] +#define __pyx_n_u_m __pyx_string_tab[130] +#define __pyx_n_u_main __pyx_string_tab[131] +#define __pyx_n_u_max __pyx_string_tab[132] +#define __pyx_n_u_maxprod __pyx_string_tab[133] +#define __pyx_n_u_maxprod_2 __pyx_string_tab[134] +#define __pyx_n_u_maxsum __pyx_string_tab[135] +#define __pyx_n_u_maxsum_2 __pyx_string_tab[136] +#define __pyx_n_u_metaclass __pyx_string_tab[137] +#define __pyx_n_u_min __pyx_string_tab[138] +#define __pyx_n_u_minprod __pyx_string_tab[139] +#define __pyx_n_u_minprod_2 __pyx_string_tab[140] +#define __pyx_n_u_minsum __pyx_string_tab[141] +#define __pyx_n_u_minsum_2 __pyx_string_tab[142] +#define __pyx_n_u_missing __pyx_string_tab[143] +#define __pyx_n_u_module __pyx_string_tab[144] +#define __pyx_n_u_mro_entries __pyx_string_tab[145] +#define __pyx_n_u_multiplier __pyx_string_tab[146] +#define __pyx_n_u_multipliers __pyx_string_tab[147] +#define __pyx_n_u_multipliers_2 __pyx_string_tab[148] +#define __pyx_n_u_n __pyx_string_tab[149] +#define __pyx_n_u_n_2 __pyx_string_tab[150] +#define __pyx_n_u_name __pyx_string_tab[151] +#define __pyx_n_u_next __pyx_string_tab[152] +#define __pyx_n_u_others_max __pyx_string_tab[153] +#define __pyx_n_u_others_min __pyx_string_tab[154] +#define __pyx_n_u_parms __pyx_string_tab[155] +#define __pyx_n_u_pop __pyx_string_tab[156] +#define __pyx_n_u_preProcess __pyx_string_tab[157] +#define __pyx_n_u_prepare __pyx_string_tab[158] +#define __pyx_n_u_prod __pyx_string_tab[159] +#define __pyx_n_u_qualname __pyx_string_tab[160] +#define __pyx_n_u_remove __pyx_string_tab[161] +#define __pyx_n_u_round __pyx_string_tab[162] +#define __pyx_n_u_seen __pyx_string_tab[163] +#define __pyx_n_u_self __pyx_string_tab[164] +#define __pyx_n_u_send __pyx_string_tab[165] +#define __pyx_n_u_set __pyx_string_tab[166] +#define __pyx_n_u_set_2 __pyx_string_tab[167] +#define __pyx_n_u_singlevalue __pyx_string_tab[168] +#define __pyx_n_u_str __pyx_string_tab[169] +#define __pyx_n_u_sum __pyx_string_tab[170] +#define __pyx_n_u_sum_value __pyx_string_tab[171] +#define __pyx_n_u_sum_vars __pyx_string_tab[172] +#define __pyx_n_u_target_value __pyx_string_tab[173] +#define __pyx_n_u_target_var __pyx_string_tab[174] +#define __pyx_n_u_temp_sum __pyx_string_tab[175] +#define __pyx_n_u_test __pyx_string_tab[176] +#define __pyx_n_u_throw __pyx_string_tab[177] +#define __pyx_n_u_typing __pyx_string_tab[178] +#define __pyx_n_u_unassigned __pyx_string_tab[179] +#define __pyx_n_u_unassignedvariable __pyx_string_tab[180] +#define __pyx_n_u_v __pyx_string_tab[181] +#define __pyx_n_u_value __pyx_string_tab[182] +#define __pyx_n_u_var __pyx_string_tab[183] +#define __pyx_n_u_variable __pyx_string_tab[184] +#define __pyx_n_u_variable_contains_lt1 __pyx_string_tab[185] +#define __pyx_n_u_variable_contains_negative __pyx_string_tab[186] +#define __pyx_n_u_variable_with_lt1 __pyx_string_tab[187] +#define __pyx_n_u_variable_with_negative __pyx_string_tab[188] +#define __pyx_n_u_variables __pyx_string_tab[189] +#define __pyx_n_u_vconstraints __pyx_string_tab[190] +#define __pyx_n_u_x __pyx_string_tab[191] +#define __pyx_n_u_zip __pyx_string_tab[192] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE -static int __pyx_m_clear(PyObject *m) { - __pyx_mstate *clear_module_state = __pyx_mstate(m); +static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { + __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); @@ -2996,782 +3283,74 @@ static int __pyx_m_clear(PyObject *m) { #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif + #if CYTHON_PEP489_MULTI_PHASE_INIT + __Pyx_State_RemoveModule(NULL); + #endif + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_defaults); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_defaults); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr); - Py_CLEAR(clear_module_state->__pyx_kp_s_Abstract_base_class_for_constrai); - Py_CLEAR(clear_module_state->__pyx_n_s_AllDifferentConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_AllDifferentConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_AllEqualConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_AllEqualConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_Callable); - Py_CLEAR(clear_module_state->__pyx_kp_u_Can_t_happen); - Py_CLEAR(clear_module_state->__pyx_n_s_CompilableFunctionConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_CompilableFunctionConstraint___c); - Py_CLEAR(clear_module_state->__pyx_n_s_CompilableFunctionConstraint___i); - Py_CLEAR(clear_module_state->__pyx_kp_u_CompilableFunctionConstraint_can); - Py_CLEAR(clear_module_state->__pyx_n_s_Constraint); - Py_CLEAR(clear_module_state->__pyx_n_s_Constraint___call); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_at_lea); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_at_lea_2); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_values); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_values_2); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_values_3); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_values_4); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_values_5); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_values_6); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_values_7); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_values_8); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_values_9); - Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_forwardCheck); - Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_preProcess); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_which_wraps_a_functio); - Py_CLEAR(clear_module_state->__pyx_n_s_ExactSumConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_ExactSumConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_ExactSumConstraint___init); - Py_CLEAR(clear_module_state->__pyx_n_s_ExactSumConstraint_preProcess); - Py_CLEAR(clear_module_state->__pyx_n_s_FunctionConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_FunctionConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_FunctionConstraint___init); - Py_CLEAR(clear_module_state->__pyx_n_s_InSetConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_InSetConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_InSetConstraint___init); - Py_CLEAR(clear_module_state->__pyx_n_s_InSetConstraint_preProcess); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxProdConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxProdConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxProdConstraint___init); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxProdConstraint_preProcess); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxProdConstraint_preProcess_loc); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxSumConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxSumConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxSumConstraint___init); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxSumConstraint_preProcess); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxSumConstraint_preProcess_loca); - Py_CLEAR(clear_module_state->__pyx_n_s_MinProdConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_MinProdConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_MinProdConstraint___init); - Py_CLEAR(clear_module_state->__pyx_n_s_MinProdConstraint_preProcess); - Py_CLEAR(clear_module_state->__pyx_n_s_MinSumConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_MinSumConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_MinSumConstraint___init); - Py_CLEAR(clear_module_state->__pyx_n_s_NotImplementedError); - Py_CLEAR(clear_module_state->__pyx_n_s_NotInSetConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_NotInSetConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_NotInSetConstraint___init); - Py_CLEAR(clear_module_state->__pyx_n_s_NotInSetConstraint_preProcess); - Py_CLEAR(clear_module_state->__pyx_n_s_Optional); - Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_Sequence); - Py_CLEAR(clear_module_state->__pyx_n_s_RuntimeError); - Py_CLEAR(clear_module_state->__pyx_n_s_Sequence); - Py_CLEAR(clear_module_state->__pyx_n_s_SomeInSetConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_SomeInSetConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_SomeInSetConstraint___init); - Py_CLEAR(clear_module_state->__pyx_n_s_SomeNotInSetConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_SomeNotInSetConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_SomeNotInSetConstraint___init); - Py_CLEAR(clear_module_state->__pyx_n_s_Unassigned); - Py_CLEAR(clear_module_state->__pyx_n_s_Union); - Py_CLEAR(clear_module_state->__pyx_kp_s_Union_int_float); - Py_CLEAR(clear_module_state->__pyx_kp_s_Wrapper_function_for_picklable_s); - Py_CLEAR(clear_module_state->__pyx_kp_u__4); - Py_CLEAR(clear_module_state->__pyx_n_s__68); - Py_CLEAR(clear_module_state->__pyx_n_s_args); - Py_CLEAR(clear_module_state->__pyx_n_s_assigned); - Py_CLEAR(clear_module_state->__pyx_n_s_assigned_2); - Py_CLEAR(clear_module_state->__pyx_n_s_assignments); - Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); - Py_CLEAR(clear_module_state->__pyx_n_s_bool); - Py_CLEAR(clear_module_state->__pyx_n_s_call); - Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); - Py_CLEAR(clear_module_state->__pyx_n_s_close); - Py_CLEAR(clear_module_state->__pyx_n_s_collections_abc); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_constraints); - Py_CLEAR(clear_module_state->__pyx_kp_s_constraint_constraints_py); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_domain); - Py_CLEAR(clear_module_state->__pyx_n_s_constraints); - Py_CLEAR(clear_module_state->__pyx_n_s_contains_lt1); - Py_CLEAR(clear_module_state->__pyx_n_s_contains_negative); - Py_CLEAR(clear_module_state->__pyx_n_s_dict); - Py_CLEAR(clear_module_state->__pyx_n_s_dict_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_disable); - Py_CLEAR(clear_module_state->__pyx_n_s_doc); - Py_CLEAR(clear_module_state->__pyx_n_s_domain); - Py_CLEAR(clear_module_state->__pyx_n_s_domains); - Py_CLEAR(clear_module_state->__pyx_kp_u_enable); - Py_CLEAR(clear_module_state->__pyx_n_s_exact); - Py_CLEAR(clear_module_state->__pyx_n_s_exact_2); - Py_CLEAR(clear_module_state->__pyx_n_s_exactsum); - Py_CLEAR(clear_module_state->__pyx_n_s_exactsum_2); - Py_CLEAR(clear_module_state->__pyx_n_s_forwardCheck); - Py_CLEAR(clear_module_state->__pyx_n_s_forwardcheck); - Py_CLEAR(clear_module_state->__pyx_n_s_found); - Py_CLEAR(clear_module_state->__pyx_n_s_func); - Py_CLEAR(clear_module_state->__pyx_n_s_func_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_gc); - Py_CLEAR(clear_module_state->__pyx_n_s_genexpr); - Py_CLEAR(clear_module_state->__pyx_n_s_get); - Py_CLEAR(clear_module_state->__pyx_n_s_hideValue); - Py_CLEAR(clear_module_state->__pyx_n_s_import); - Py_CLEAR(clear_module_state->__pyx_n_s_init); - Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); - Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); - Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); - Py_CLEAR(clear_module_state->__pyx_kp_s_list_tuple); - Py_CLEAR(clear_module_state->__pyx_n_s_main); - Py_CLEAR(clear_module_state->__pyx_n_s_maxprod); - Py_CLEAR(clear_module_state->__pyx_n_s_maxprod_2); - Py_CLEAR(clear_module_state->__pyx_n_s_maxsum); - Py_CLEAR(clear_module_state->__pyx_n_s_maxsum_2); - Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); - Py_CLEAR(clear_module_state->__pyx_n_s_minprod); - Py_CLEAR(clear_module_state->__pyx_n_s_minprod_2); - Py_CLEAR(clear_module_state->__pyx_n_s_minsum); - Py_CLEAR(clear_module_state->__pyx_n_s_minsum_2); - Py_CLEAR(clear_module_state->__pyx_n_s_missing); - Py_CLEAR(clear_module_state->__pyx_n_s_module); - Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); - Py_CLEAR(clear_module_state->__pyx_n_s_multiplier); - Py_CLEAR(clear_module_state->__pyx_n_s_multipliers); - Py_CLEAR(clear_module_state->__pyx_n_s_multipliers_2); - Py_CLEAR(clear_module_state->__pyx_n_s_n); - Py_CLEAR(clear_module_state->__pyx_n_s_n_2); - Py_CLEAR(clear_module_state->__pyx_n_s_name); - Py_CLEAR(clear_module_state->__pyx_n_s_parms); - Py_CLEAR(clear_module_state->__pyx_n_s_preProcess); - Py_CLEAR(clear_module_state->__pyx_n_s_prepare); - Py_CLEAR(clear_module_state->__pyx_n_s_prod); - Py_CLEAR(clear_module_state->__pyx_n_s_qualname); - Py_CLEAR(clear_module_state->__pyx_n_s_remove); - Py_CLEAR(clear_module_state->__pyx_n_s_round); - Py_CLEAR(clear_module_state->__pyx_n_s_seen); - Py_CLEAR(clear_module_state->__pyx_n_s_self); - Py_CLEAR(clear_module_state->__pyx_n_s_send); - Py_CLEAR(clear_module_state->__pyx_n_s_set); - Py_CLEAR(clear_module_state->__pyx_n_s_set_2); - Py_CLEAR(clear_module_state->__pyx_n_s_set_name); - Py_CLEAR(clear_module_state->__pyx_n_s_singlevalue); - Py_CLEAR(clear_module_state->__pyx_n_s_str); - Py_CLEAR(clear_module_state->__pyx_n_s_sum); - Py_CLEAR(clear_module_state->__pyx_n_s_super); - Py_CLEAR(clear_module_state->__pyx_n_s_test); - Py_CLEAR(clear_module_state->__pyx_n_s_throw); - Py_CLEAR(clear_module_state->__pyx_n_s_typing); - Py_CLEAR(clear_module_state->__pyx_n_s_unassigned); - Py_CLEAR(clear_module_state->__pyx_n_s_unassignedvariable); - Py_CLEAR(clear_module_state->__pyx_n_s_value); - Py_CLEAR(clear_module_state->__pyx_n_s_variable); - Py_CLEAR(clear_module_state->__pyx_n_s_variable_contains_lt1); - Py_CLEAR(clear_module_state->__pyx_n_s_variable_contains_negative); - Py_CLEAR(clear_module_state->__pyx_n_s_variable_with_lt1); - Py_CLEAR(clear_module_state->__pyx_n_s_variable_with_negative); - Py_CLEAR(clear_module_state->__pyx_n_s_variables); - Py_CLEAR(clear_module_state->__pyx_n_s_vconstraints); - Py_CLEAR(clear_module_state->__pyx_n_s_x); - Py_CLEAR(clear_module_state->__pyx_n_s_zip); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_preProcess); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_2_preProcess); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_5_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<41; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<193; ++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); - Py_CLEAR(clear_module_state->__pyx_slice_); - Py_CLEAR(clear_module_state->__pyx_tuple__2); - Py_CLEAR(clear_module_state->__pyx_tuple__3); - Py_CLEAR(clear_module_state->__pyx_tuple__5); - Py_CLEAR(clear_module_state->__pyx_tuple__7); - Py_CLEAR(clear_module_state->__pyx_tuple__8); - Py_CLEAR(clear_module_state->__pyx_tuple__10); - Py_CLEAR(clear_module_state->__pyx_tuple__12); - Py_CLEAR(clear_module_state->__pyx_tuple__14); - Py_CLEAR(clear_module_state->__pyx_tuple__15); - Py_CLEAR(clear_module_state->__pyx_tuple__18); - Py_CLEAR(clear_module_state->__pyx_tuple__20); - Py_CLEAR(clear_module_state->__pyx_tuple__22); - Py_CLEAR(clear_module_state->__pyx_tuple__24); - Py_CLEAR(clear_module_state->__pyx_tuple__26); - Py_CLEAR(clear_module_state->__pyx_tuple__27); - Py_CLEAR(clear_module_state->__pyx_tuple__29); - Py_CLEAR(clear_module_state->__pyx_tuple__31); - Py_CLEAR(clear_module_state->__pyx_tuple__33); - Py_CLEAR(clear_module_state->__pyx_tuple__35); - Py_CLEAR(clear_module_state->__pyx_tuple__37); - Py_CLEAR(clear_module_state->__pyx_tuple__39); - Py_CLEAR(clear_module_state->__pyx_tuple__41); - Py_CLEAR(clear_module_state->__pyx_tuple__43); - Py_CLEAR(clear_module_state->__pyx_tuple__45); - Py_CLEAR(clear_module_state->__pyx_tuple__47); - Py_CLEAR(clear_module_state->__pyx_tuple__49); - Py_CLEAR(clear_module_state->__pyx_tuple__51); - Py_CLEAR(clear_module_state->__pyx_tuple__53); - Py_CLEAR(clear_module_state->__pyx_tuple__56); - Py_CLEAR(clear_module_state->__pyx_tuple__61); - Py_CLEAR(clear_module_state->__pyx_tuple__63); - Py_CLEAR(clear_module_state->__pyx_tuple__64); - Py_CLEAR(clear_module_state->__pyx_codeobj__6); - Py_CLEAR(clear_module_state->__pyx_codeobj__9); - Py_CLEAR(clear_module_state->__pyx_codeobj__11); - Py_CLEAR(clear_module_state->__pyx_codeobj__13); - Py_CLEAR(clear_module_state->__pyx_codeobj__16); - Py_CLEAR(clear_module_state->__pyx_codeobj__17); - Py_CLEAR(clear_module_state->__pyx_codeobj__19); - Py_CLEAR(clear_module_state->__pyx_codeobj__21); - Py_CLEAR(clear_module_state->__pyx_codeobj__23); - Py_CLEAR(clear_module_state->__pyx_codeobj__25); - Py_CLEAR(clear_module_state->__pyx_codeobj__28); - Py_CLEAR(clear_module_state->__pyx_codeobj__30); - Py_CLEAR(clear_module_state->__pyx_codeobj__32); - Py_CLEAR(clear_module_state->__pyx_codeobj__34); - Py_CLEAR(clear_module_state->__pyx_codeobj__36); - Py_CLEAR(clear_module_state->__pyx_codeobj__38); - Py_CLEAR(clear_module_state->__pyx_codeobj__40); - Py_CLEAR(clear_module_state->__pyx_codeobj__42); - Py_CLEAR(clear_module_state->__pyx_codeobj__44); - Py_CLEAR(clear_module_state->__pyx_codeobj__46); - Py_CLEAR(clear_module_state->__pyx_codeobj__48); - Py_CLEAR(clear_module_state->__pyx_codeobj__50); - Py_CLEAR(clear_module_state->__pyx_codeobj__52); - Py_CLEAR(clear_module_state->__pyx_codeobj__54); - Py_CLEAR(clear_module_state->__pyx_codeobj__55); - Py_CLEAR(clear_module_state->__pyx_codeobj__57); - Py_CLEAR(clear_module_state->__pyx_codeobj__58); - Py_CLEAR(clear_module_state->__pyx_codeobj__59); - Py_CLEAR(clear_module_state->__pyx_codeobj__60); - Py_CLEAR(clear_module_state->__pyx_codeobj__62); - Py_CLEAR(clear_module_state->__pyx_codeobj__65); - Py_CLEAR(clear_module_state->__pyx_codeobj__66); - Py_CLEAR(clear_module_state->__pyx_codeobj__67); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE -static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { - __pyx_mstate *traverse_module_state = __pyx_mstate(m); +static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); - Py_VISIT(traverse_module_state->__pyx_empty_tuple); - Py_VISIT(traverse_module_state->__pyx_empty_bytes); - Py_VISIT(traverse_module_state->__pyx_empty_unicode); + __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); Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr); - Py_VISIT(traverse_module_state->__pyx_kp_s_Abstract_base_class_for_constrai); - Py_VISIT(traverse_module_state->__pyx_n_s_AllDifferentConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_AllDifferentConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_AllEqualConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_AllEqualConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_Callable); - Py_VISIT(traverse_module_state->__pyx_kp_u_Can_t_happen); - Py_VISIT(traverse_module_state->__pyx_n_s_CompilableFunctionConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_CompilableFunctionConstraint___c); - Py_VISIT(traverse_module_state->__pyx_n_s_CompilableFunctionConstraint___i); - Py_VISIT(traverse_module_state->__pyx_kp_u_CompilableFunctionConstraint_can); - Py_VISIT(traverse_module_state->__pyx_n_s_Constraint); - Py_VISIT(traverse_module_state->__pyx_n_s_Constraint___call); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_at_lea); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_at_lea_2); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_values); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_values_2); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_values_3); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_values_4); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_values_5); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_values_6); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_values_7); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_values_8); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_values_9); - Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_forwardCheck); - Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_preProcess); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_which_wraps_a_functio); - Py_VISIT(traverse_module_state->__pyx_n_s_ExactSumConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_ExactSumConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_ExactSumConstraint___init); - Py_VISIT(traverse_module_state->__pyx_n_s_ExactSumConstraint_preProcess); - Py_VISIT(traverse_module_state->__pyx_n_s_FunctionConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_FunctionConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_FunctionConstraint___init); - Py_VISIT(traverse_module_state->__pyx_n_s_InSetConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_InSetConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_InSetConstraint___init); - Py_VISIT(traverse_module_state->__pyx_n_s_InSetConstraint_preProcess); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxProdConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxProdConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxProdConstraint___init); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxProdConstraint_preProcess); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxProdConstraint_preProcess_loc); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxSumConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxSumConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxSumConstraint___init); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxSumConstraint_preProcess); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxSumConstraint_preProcess_loca); - Py_VISIT(traverse_module_state->__pyx_n_s_MinProdConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_MinProdConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_MinProdConstraint___init); - Py_VISIT(traverse_module_state->__pyx_n_s_MinProdConstraint_preProcess); - Py_VISIT(traverse_module_state->__pyx_n_s_MinSumConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_MinSumConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_MinSumConstraint___init); - Py_VISIT(traverse_module_state->__pyx_n_s_NotImplementedError); - Py_VISIT(traverse_module_state->__pyx_n_s_NotInSetConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_NotInSetConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_NotInSetConstraint___init); - Py_VISIT(traverse_module_state->__pyx_n_s_NotInSetConstraint_preProcess); - Py_VISIT(traverse_module_state->__pyx_n_s_Optional); - Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_Sequence); - Py_VISIT(traverse_module_state->__pyx_n_s_RuntimeError); - Py_VISIT(traverse_module_state->__pyx_n_s_Sequence); - Py_VISIT(traverse_module_state->__pyx_n_s_SomeInSetConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_SomeInSetConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_SomeInSetConstraint___init); - Py_VISIT(traverse_module_state->__pyx_n_s_SomeNotInSetConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_SomeNotInSetConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_SomeNotInSetConstraint___init); - Py_VISIT(traverse_module_state->__pyx_n_s_Unassigned); - Py_VISIT(traverse_module_state->__pyx_n_s_Union); - Py_VISIT(traverse_module_state->__pyx_kp_s_Union_int_float); - Py_VISIT(traverse_module_state->__pyx_kp_s_Wrapper_function_for_picklable_s); - Py_VISIT(traverse_module_state->__pyx_kp_u__4); - Py_VISIT(traverse_module_state->__pyx_n_s__68); - Py_VISIT(traverse_module_state->__pyx_n_s_args); - Py_VISIT(traverse_module_state->__pyx_n_s_assigned); - Py_VISIT(traverse_module_state->__pyx_n_s_assigned_2); - Py_VISIT(traverse_module_state->__pyx_n_s_assignments); - Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); - Py_VISIT(traverse_module_state->__pyx_n_s_bool); - Py_VISIT(traverse_module_state->__pyx_n_s_call); - Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); - Py_VISIT(traverse_module_state->__pyx_n_s_close); - Py_VISIT(traverse_module_state->__pyx_n_s_collections_abc); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_constraints); - Py_VISIT(traverse_module_state->__pyx_kp_s_constraint_constraints_py); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_domain); - Py_VISIT(traverse_module_state->__pyx_n_s_constraints); - Py_VISIT(traverse_module_state->__pyx_n_s_contains_lt1); - Py_VISIT(traverse_module_state->__pyx_n_s_contains_negative); - Py_VISIT(traverse_module_state->__pyx_n_s_dict); - Py_VISIT(traverse_module_state->__pyx_n_s_dict_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_disable); - Py_VISIT(traverse_module_state->__pyx_n_s_doc); - Py_VISIT(traverse_module_state->__pyx_n_s_domain); - Py_VISIT(traverse_module_state->__pyx_n_s_domains); - Py_VISIT(traverse_module_state->__pyx_kp_u_enable); - Py_VISIT(traverse_module_state->__pyx_n_s_exact); - Py_VISIT(traverse_module_state->__pyx_n_s_exact_2); - Py_VISIT(traverse_module_state->__pyx_n_s_exactsum); - Py_VISIT(traverse_module_state->__pyx_n_s_exactsum_2); - Py_VISIT(traverse_module_state->__pyx_n_s_forwardCheck); - Py_VISIT(traverse_module_state->__pyx_n_s_forwardcheck); - Py_VISIT(traverse_module_state->__pyx_n_s_found); - Py_VISIT(traverse_module_state->__pyx_n_s_func); - Py_VISIT(traverse_module_state->__pyx_n_s_func_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_gc); - Py_VISIT(traverse_module_state->__pyx_n_s_genexpr); - Py_VISIT(traverse_module_state->__pyx_n_s_get); - Py_VISIT(traverse_module_state->__pyx_n_s_hideValue); - Py_VISIT(traverse_module_state->__pyx_n_s_import); - Py_VISIT(traverse_module_state->__pyx_n_s_init); - Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); - Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); - Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); - Py_VISIT(traverse_module_state->__pyx_kp_s_list_tuple); - Py_VISIT(traverse_module_state->__pyx_n_s_main); - Py_VISIT(traverse_module_state->__pyx_n_s_maxprod); - Py_VISIT(traverse_module_state->__pyx_n_s_maxprod_2); - Py_VISIT(traverse_module_state->__pyx_n_s_maxsum); - Py_VISIT(traverse_module_state->__pyx_n_s_maxsum_2); - Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); - Py_VISIT(traverse_module_state->__pyx_n_s_minprod); - Py_VISIT(traverse_module_state->__pyx_n_s_minprod_2); - Py_VISIT(traverse_module_state->__pyx_n_s_minsum); - Py_VISIT(traverse_module_state->__pyx_n_s_minsum_2); - Py_VISIT(traverse_module_state->__pyx_n_s_missing); - Py_VISIT(traverse_module_state->__pyx_n_s_module); - Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); - Py_VISIT(traverse_module_state->__pyx_n_s_multiplier); - Py_VISIT(traverse_module_state->__pyx_n_s_multipliers); - Py_VISIT(traverse_module_state->__pyx_n_s_multipliers_2); - Py_VISIT(traverse_module_state->__pyx_n_s_n); - Py_VISIT(traverse_module_state->__pyx_n_s_n_2); - Py_VISIT(traverse_module_state->__pyx_n_s_name); - Py_VISIT(traverse_module_state->__pyx_n_s_parms); - Py_VISIT(traverse_module_state->__pyx_n_s_preProcess); - Py_VISIT(traverse_module_state->__pyx_n_s_prepare); - Py_VISIT(traverse_module_state->__pyx_n_s_prod); - Py_VISIT(traverse_module_state->__pyx_n_s_qualname); - Py_VISIT(traverse_module_state->__pyx_n_s_remove); - Py_VISIT(traverse_module_state->__pyx_n_s_round); - Py_VISIT(traverse_module_state->__pyx_n_s_seen); - Py_VISIT(traverse_module_state->__pyx_n_s_self); - Py_VISIT(traverse_module_state->__pyx_n_s_send); - Py_VISIT(traverse_module_state->__pyx_n_s_set); - Py_VISIT(traverse_module_state->__pyx_n_s_set_2); - Py_VISIT(traverse_module_state->__pyx_n_s_set_name); - Py_VISIT(traverse_module_state->__pyx_n_s_singlevalue); - Py_VISIT(traverse_module_state->__pyx_n_s_str); - Py_VISIT(traverse_module_state->__pyx_n_s_sum); - Py_VISIT(traverse_module_state->__pyx_n_s_super); - Py_VISIT(traverse_module_state->__pyx_n_s_test); - Py_VISIT(traverse_module_state->__pyx_n_s_throw); - Py_VISIT(traverse_module_state->__pyx_n_s_typing); - Py_VISIT(traverse_module_state->__pyx_n_s_unassigned); - Py_VISIT(traverse_module_state->__pyx_n_s_unassignedvariable); - Py_VISIT(traverse_module_state->__pyx_n_s_value); - Py_VISIT(traverse_module_state->__pyx_n_s_variable); - Py_VISIT(traverse_module_state->__pyx_n_s_variable_contains_lt1); - Py_VISIT(traverse_module_state->__pyx_n_s_variable_contains_negative); - Py_VISIT(traverse_module_state->__pyx_n_s_variable_with_lt1); - Py_VISIT(traverse_module_state->__pyx_n_s_variable_with_negative); - Py_VISIT(traverse_module_state->__pyx_n_s_variables); - Py_VISIT(traverse_module_state->__pyx_n_s_vconstraints); - Py_VISIT(traverse_module_state->__pyx_n_s_x); - Py_VISIT(traverse_module_state->__pyx_n_s_zip); - Py_VISIT(traverse_module_state->__pyx_int_0); - Py_VISIT(traverse_module_state->__pyx_int_1); - Py_VISIT(traverse_module_state->__pyx_int_10); - Py_VISIT(traverse_module_state->__pyx_slice_); - Py_VISIT(traverse_module_state->__pyx_tuple__2); - Py_VISIT(traverse_module_state->__pyx_tuple__3); - Py_VISIT(traverse_module_state->__pyx_tuple__5); - Py_VISIT(traverse_module_state->__pyx_tuple__7); - Py_VISIT(traverse_module_state->__pyx_tuple__8); - Py_VISIT(traverse_module_state->__pyx_tuple__10); - Py_VISIT(traverse_module_state->__pyx_tuple__12); - Py_VISIT(traverse_module_state->__pyx_tuple__14); - Py_VISIT(traverse_module_state->__pyx_tuple__15); - Py_VISIT(traverse_module_state->__pyx_tuple__18); - Py_VISIT(traverse_module_state->__pyx_tuple__20); - Py_VISIT(traverse_module_state->__pyx_tuple__22); - Py_VISIT(traverse_module_state->__pyx_tuple__24); - Py_VISIT(traverse_module_state->__pyx_tuple__26); - Py_VISIT(traverse_module_state->__pyx_tuple__27); - Py_VISIT(traverse_module_state->__pyx_tuple__29); - Py_VISIT(traverse_module_state->__pyx_tuple__31); - Py_VISIT(traverse_module_state->__pyx_tuple__33); - Py_VISIT(traverse_module_state->__pyx_tuple__35); - Py_VISIT(traverse_module_state->__pyx_tuple__37); - Py_VISIT(traverse_module_state->__pyx_tuple__39); - Py_VISIT(traverse_module_state->__pyx_tuple__41); - Py_VISIT(traverse_module_state->__pyx_tuple__43); - Py_VISIT(traverse_module_state->__pyx_tuple__45); - Py_VISIT(traverse_module_state->__pyx_tuple__47); - Py_VISIT(traverse_module_state->__pyx_tuple__49); - Py_VISIT(traverse_module_state->__pyx_tuple__51); - Py_VISIT(traverse_module_state->__pyx_tuple__53); - Py_VISIT(traverse_module_state->__pyx_tuple__56); - Py_VISIT(traverse_module_state->__pyx_tuple__61); - Py_VISIT(traverse_module_state->__pyx_tuple__63); - Py_VISIT(traverse_module_state->__pyx_tuple__64); - Py_VISIT(traverse_module_state->__pyx_codeobj__6); - Py_VISIT(traverse_module_state->__pyx_codeobj__9); - Py_VISIT(traverse_module_state->__pyx_codeobj__11); - Py_VISIT(traverse_module_state->__pyx_codeobj__13); - Py_VISIT(traverse_module_state->__pyx_codeobj__16); - Py_VISIT(traverse_module_state->__pyx_codeobj__17); - Py_VISIT(traverse_module_state->__pyx_codeobj__19); - Py_VISIT(traverse_module_state->__pyx_codeobj__21); - Py_VISIT(traverse_module_state->__pyx_codeobj__23); - Py_VISIT(traverse_module_state->__pyx_codeobj__25); - Py_VISIT(traverse_module_state->__pyx_codeobj__28); - Py_VISIT(traverse_module_state->__pyx_codeobj__30); - Py_VISIT(traverse_module_state->__pyx_codeobj__32); - Py_VISIT(traverse_module_state->__pyx_codeobj__34); - Py_VISIT(traverse_module_state->__pyx_codeobj__36); - Py_VISIT(traverse_module_state->__pyx_codeobj__38); - Py_VISIT(traverse_module_state->__pyx_codeobj__40); - Py_VISIT(traverse_module_state->__pyx_codeobj__42); - Py_VISIT(traverse_module_state->__pyx_codeobj__44); - Py_VISIT(traverse_module_state->__pyx_codeobj__46); - Py_VISIT(traverse_module_state->__pyx_codeobj__48); - Py_VISIT(traverse_module_state->__pyx_codeobj__50); - Py_VISIT(traverse_module_state->__pyx_codeobj__52); - Py_VISIT(traverse_module_state->__pyx_codeobj__54); - Py_VISIT(traverse_module_state->__pyx_codeobj__55); - Py_VISIT(traverse_module_state->__pyx_codeobj__57); - Py_VISIT(traverse_module_state->__pyx_codeobj__58); - Py_VISIT(traverse_module_state->__pyx_codeobj__59); - Py_VISIT(traverse_module_state->__pyx_codeobj__60); - Py_VISIT(traverse_module_state->__pyx_codeobj__62); - Py_VISIT(traverse_module_state->__pyx_codeobj__65); - Py_VISIT(traverse_module_state->__pyx_codeobj__66); - Py_VISIT(traverse_module_state->__pyx_codeobj__67); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_preProcess); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_2_preProcess); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_5_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<41; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<193; ++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; } #endif -/* #### Code section: module_state_defines ### */ -#define __pyx_d __pyx_mstate_global->__pyx_d -#define __pyx_b __pyx_mstate_global->__pyx_b -#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime -#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple -#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes -#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode -#ifdef __Pyx_CyFunction_USED -#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType -#endif -#ifdef __Pyx_FusedFunction_USED -#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType -#endif -#ifdef __Pyx_Generator_USED -#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType -#endif -#ifdef __Pyx_IterableCoroutine_USED -#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType -#endif -#if CYTHON_USE_MODULE_STATE -#define __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr -#define __pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr -#endif -#define __pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr -#define __pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr -#define __pyx_kp_s_Abstract_base_class_for_constrai __pyx_mstate_global->__pyx_kp_s_Abstract_base_class_for_constrai -#define __pyx_n_s_AllDifferentConstraint __pyx_mstate_global->__pyx_n_s_AllDifferentConstraint -#define __pyx_n_s_AllDifferentConstraint___call __pyx_mstate_global->__pyx_n_s_AllDifferentConstraint___call -#define __pyx_n_s_AllEqualConstraint __pyx_mstate_global->__pyx_n_s_AllEqualConstraint -#define __pyx_n_s_AllEqualConstraint___call __pyx_mstate_global->__pyx_n_s_AllEqualConstraint___call -#define __pyx_n_s_Callable __pyx_mstate_global->__pyx_n_s_Callable -#define __pyx_kp_u_Can_t_happen __pyx_mstate_global->__pyx_kp_u_Can_t_happen -#define __pyx_n_s_CompilableFunctionConstraint __pyx_mstate_global->__pyx_n_s_CompilableFunctionConstraint -#define __pyx_n_s_CompilableFunctionConstraint___c __pyx_mstate_global->__pyx_n_s_CompilableFunctionConstraint___c -#define __pyx_n_s_CompilableFunctionConstraint___i __pyx_mstate_global->__pyx_n_s_CompilableFunctionConstraint___i -#define __pyx_kp_u_CompilableFunctionConstraint_can __pyx_mstate_global->__pyx_kp_u_CompilableFunctionConstraint_can -#define __pyx_n_s_Constraint __pyx_mstate_global->__pyx_n_s_Constraint -#define __pyx_n_s_Constraint___call __pyx_mstate_global->__pyx_n_s_Constraint___call -#define __pyx_kp_s_Constraint_enforcing_that_at_lea __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_at_lea -#define __pyx_kp_s_Constraint_enforcing_that_at_lea_2 __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_at_lea_2 -#define __pyx_kp_s_Constraint_enforcing_that_values __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_values -#define __pyx_kp_s_Constraint_enforcing_that_values_2 __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_values_2 -#define __pyx_kp_s_Constraint_enforcing_that_values_3 __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_values_3 -#define __pyx_kp_s_Constraint_enforcing_that_values_4 __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_values_4 -#define __pyx_kp_s_Constraint_enforcing_that_values_5 __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_values_5 -#define __pyx_kp_s_Constraint_enforcing_that_values_6 __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_values_6 -#define __pyx_kp_s_Constraint_enforcing_that_values_7 __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_values_7 -#define __pyx_kp_s_Constraint_enforcing_that_values_8 __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_values_8 -#define __pyx_kp_s_Constraint_enforcing_that_values_9 __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_values_9 -#define __pyx_n_s_Constraint_forwardCheck __pyx_mstate_global->__pyx_n_s_Constraint_forwardCheck -#define __pyx_n_s_Constraint_preProcess __pyx_mstate_global->__pyx_n_s_Constraint_preProcess -#define __pyx_kp_s_Constraint_which_wraps_a_functio __pyx_mstate_global->__pyx_kp_s_Constraint_which_wraps_a_functio -#define __pyx_n_s_ExactSumConstraint __pyx_mstate_global->__pyx_n_s_ExactSumConstraint -#define __pyx_n_s_ExactSumConstraint___call __pyx_mstate_global->__pyx_n_s_ExactSumConstraint___call -#define __pyx_n_s_ExactSumConstraint___init __pyx_mstate_global->__pyx_n_s_ExactSumConstraint___init -#define __pyx_n_s_ExactSumConstraint_preProcess __pyx_mstate_global->__pyx_n_s_ExactSumConstraint_preProcess -#define __pyx_n_s_FunctionConstraint __pyx_mstate_global->__pyx_n_s_FunctionConstraint -#define __pyx_n_s_FunctionConstraint___call __pyx_mstate_global->__pyx_n_s_FunctionConstraint___call -#define __pyx_n_s_FunctionConstraint___init __pyx_mstate_global->__pyx_n_s_FunctionConstraint___init -#define __pyx_n_s_InSetConstraint __pyx_mstate_global->__pyx_n_s_InSetConstraint -#define __pyx_n_s_InSetConstraint___call __pyx_mstate_global->__pyx_n_s_InSetConstraint___call -#define __pyx_n_s_InSetConstraint___init __pyx_mstate_global->__pyx_n_s_InSetConstraint___init -#define __pyx_n_s_InSetConstraint_preProcess __pyx_mstate_global->__pyx_n_s_InSetConstraint_preProcess -#define __pyx_n_s_MaxProdConstraint __pyx_mstate_global->__pyx_n_s_MaxProdConstraint -#define __pyx_n_s_MaxProdConstraint___call __pyx_mstate_global->__pyx_n_s_MaxProdConstraint___call -#define __pyx_n_s_MaxProdConstraint___init __pyx_mstate_global->__pyx_n_s_MaxProdConstraint___init -#define __pyx_n_s_MaxProdConstraint_preProcess __pyx_mstate_global->__pyx_n_s_MaxProdConstraint_preProcess -#define __pyx_n_s_MaxProdConstraint_preProcess_loc __pyx_mstate_global->__pyx_n_s_MaxProdConstraint_preProcess_loc -#define __pyx_n_s_MaxSumConstraint __pyx_mstate_global->__pyx_n_s_MaxSumConstraint -#define __pyx_n_s_MaxSumConstraint___call __pyx_mstate_global->__pyx_n_s_MaxSumConstraint___call -#define __pyx_n_s_MaxSumConstraint___init __pyx_mstate_global->__pyx_n_s_MaxSumConstraint___init -#define __pyx_n_s_MaxSumConstraint_preProcess __pyx_mstate_global->__pyx_n_s_MaxSumConstraint_preProcess -#define __pyx_n_s_MaxSumConstraint_preProcess_loca __pyx_mstate_global->__pyx_n_s_MaxSumConstraint_preProcess_loca -#define __pyx_n_s_MinProdConstraint __pyx_mstate_global->__pyx_n_s_MinProdConstraint -#define __pyx_n_s_MinProdConstraint___call __pyx_mstate_global->__pyx_n_s_MinProdConstraint___call -#define __pyx_n_s_MinProdConstraint___init __pyx_mstate_global->__pyx_n_s_MinProdConstraint___init -#define __pyx_n_s_MinProdConstraint_preProcess __pyx_mstate_global->__pyx_n_s_MinProdConstraint_preProcess -#define __pyx_n_s_MinSumConstraint __pyx_mstate_global->__pyx_n_s_MinSumConstraint -#define __pyx_n_s_MinSumConstraint___call __pyx_mstate_global->__pyx_n_s_MinSumConstraint___call -#define __pyx_n_s_MinSumConstraint___init __pyx_mstate_global->__pyx_n_s_MinSumConstraint___init -#define __pyx_n_s_NotImplementedError __pyx_mstate_global->__pyx_n_s_NotImplementedError -#define __pyx_n_s_NotInSetConstraint __pyx_mstate_global->__pyx_n_s_NotInSetConstraint -#define __pyx_n_s_NotInSetConstraint___call __pyx_mstate_global->__pyx_n_s_NotInSetConstraint___call -#define __pyx_n_s_NotInSetConstraint___init __pyx_mstate_global->__pyx_n_s_NotInSetConstraint___init -#define __pyx_n_s_NotInSetConstraint_preProcess __pyx_mstate_global->__pyx_n_s_NotInSetConstraint_preProcess -#define __pyx_n_s_Optional __pyx_mstate_global->__pyx_n_s_Optional -#define __pyx_kp_s_Optional_Sequence __pyx_mstate_global->__pyx_kp_s_Optional_Sequence -#define __pyx_n_s_RuntimeError __pyx_mstate_global->__pyx_n_s_RuntimeError -#define __pyx_n_s_Sequence __pyx_mstate_global->__pyx_n_s_Sequence -#define __pyx_n_s_SomeInSetConstraint __pyx_mstate_global->__pyx_n_s_SomeInSetConstraint -#define __pyx_n_s_SomeInSetConstraint___call __pyx_mstate_global->__pyx_n_s_SomeInSetConstraint___call -#define __pyx_n_s_SomeInSetConstraint___init __pyx_mstate_global->__pyx_n_s_SomeInSetConstraint___init -#define __pyx_n_s_SomeNotInSetConstraint __pyx_mstate_global->__pyx_n_s_SomeNotInSetConstraint -#define __pyx_n_s_SomeNotInSetConstraint___call __pyx_mstate_global->__pyx_n_s_SomeNotInSetConstraint___call -#define __pyx_n_s_SomeNotInSetConstraint___init __pyx_mstate_global->__pyx_n_s_SomeNotInSetConstraint___init -#define __pyx_n_s_Unassigned __pyx_mstate_global->__pyx_n_s_Unassigned -#define __pyx_n_s_Union __pyx_mstate_global->__pyx_n_s_Union -#define __pyx_kp_s_Union_int_float __pyx_mstate_global->__pyx_kp_s_Union_int_float -#define __pyx_kp_s_Wrapper_function_for_picklable_s __pyx_mstate_global->__pyx_kp_s_Wrapper_function_for_picklable_s -#define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 -#define __pyx_n_s__68 __pyx_mstate_global->__pyx_n_s__68 -#define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args -#define __pyx_n_s_assigned __pyx_mstate_global->__pyx_n_s_assigned -#define __pyx_n_s_assigned_2 __pyx_mstate_global->__pyx_n_s_assigned_2 -#define __pyx_n_s_assignments __pyx_mstate_global->__pyx_n_s_assignments -#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines -#define __pyx_n_s_bool __pyx_mstate_global->__pyx_n_s_bool -#define __pyx_n_s_call __pyx_mstate_global->__pyx_n_s_call -#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback -#define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close -#define __pyx_n_s_collections_abc __pyx_mstate_global->__pyx_n_s_collections_abc -#define __pyx_n_s_constraint_constraints __pyx_mstate_global->__pyx_n_s_constraint_constraints -#define __pyx_kp_s_constraint_constraints_py __pyx_mstate_global->__pyx_kp_s_constraint_constraints_py -#define __pyx_n_s_constraint_domain __pyx_mstate_global->__pyx_n_s_constraint_domain -#define __pyx_n_s_constraints __pyx_mstate_global->__pyx_n_s_constraints -#define __pyx_n_s_contains_lt1 __pyx_mstate_global->__pyx_n_s_contains_lt1 -#define __pyx_n_s_contains_negative __pyx_mstate_global->__pyx_n_s_contains_negative -#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict -#define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2 -#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable -#define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc -#define __pyx_n_s_domain __pyx_mstate_global->__pyx_n_s_domain -#define __pyx_n_s_domains __pyx_mstate_global->__pyx_n_s_domains -#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable -#define __pyx_n_s_exact __pyx_mstate_global->__pyx_n_s_exact -#define __pyx_n_s_exact_2 __pyx_mstate_global->__pyx_n_s_exact_2 -#define __pyx_n_s_exactsum __pyx_mstate_global->__pyx_n_s_exactsum -#define __pyx_n_s_exactsum_2 __pyx_mstate_global->__pyx_n_s_exactsum_2 -#define __pyx_n_s_forwardCheck __pyx_mstate_global->__pyx_n_s_forwardCheck -#define __pyx_n_s_forwardcheck __pyx_mstate_global->__pyx_n_s_forwardcheck -#define __pyx_n_s_found __pyx_mstate_global->__pyx_n_s_found -#define __pyx_n_s_func __pyx_mstate_global->__pyx_n_s_func -#define __pyx_n_s_func_2 __pyx_mstate_global->__pyx_n_s_func_2 -#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc -#define __pyx_n_s_genexpr __pyx_mstate_global->__pyx_n_s_genexpr -#define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get -#define __pyx_n_s_hideValue __pyx_mstate_global->__pyx_n_s_hideValue -#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import -#define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init -#define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass -#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine -#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled -#define __pyx_kp_s_list_tuple __pyx_mstate_global->__pyx_kp_s_list_tuple -#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main -#define __pyx_n_s_maxprod __pyx_mstate_global->__pyx_n_s_maxprod -#define __pyx_n_s_maxprod_2 __pyx_mstate_global->__pyx_n_s_maxprod_2 -#define __pyx_n_s_maxsum __pyx_mstate_global->__pyx_n_s_maxsum -#define __pyx_n_s_maxsum_2 __pyx_mstate_global->__pyx_n_s_maxsum_2 -#define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass -#define __pyx_n_s_minprod __pyx_mstate_global->__pyx_n_s_minprod -#define __pyx_n_s_minprod_2 __pyx_mstate_global->__pyx_n_s_minprod_2 -#define __pyx_n_s_minsum __pyx_mstate_global->__pyx_n_s_minsum -#define __pyx_n_s_minsum_2 __pyx_mstate_global->__pyx_n_s_minsum_2 -#define __pyx_n_s_missing __pyx_mstate_global->__pyx_n_s_missing -#define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module -#define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries -#define __pyx_n_s_multiplier __pyx_mstate_global->__pyx_n_s_multiplier -#define __pyx_n_s_multipliers __pyx_mstate_global->__pyx_n_s_multipliers -#define __pyx_n_s_multipliers_2 __pyx_mstate_global->__pyx_n_s_multipliers_2 -#define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n -#define __pyx_n_s_n_2 __pyx_mstate_global->__pyx_n_s_n_2 -#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name -#define __pyx_n_s_parms __pyx_mstate_global->__pyx_n_s_parms -#define __pyx_n_s_preProcess __pyx_mstate_global->__pyx_n_s_preProcess -#define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare -#define __pyx_n_s_prod __pyx_mstate_global->__pyx_n_s_prod -#define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname -#define __pyx_n_s_remove __pyx_mstate_global->__pyx_n_s_remove -#define __pyx_n_s_round __pyx_mstate_global->__pyx_n_s_round -#define __pyx_n_s_seen __pyx_mstate_global->__pyx_n_s_seen -#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self -#define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send -#define __pyx_n_s_set __pyx_mstate_global->__pyx_n_s_set -#define __pyx_n_s_set_2 __pyx_mstate_global->__pyx_n_s_set_2 -#define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name -#define __pyx_n_s_singlevalue __pyx_mstate_global->__pyx_n_s_singlevalue -#define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str -#define __pyx_n_s_sum __pyx_mstate_global->__pyx_n_s_sum -#define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super -#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test -#define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw -#define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing -#define __pyx_n_s_unassigned __pyx_mstate_global->__pyx_n_s_unassigned -#define __pyx_n_s_unassignedvariable __pyx_mstate_global->__pyx_n_s_unassignedvariable -#define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value -#define __pyx_n_s_variable __pyx_mstate_global->__pyx_n_s_variable -#define __pyx_n_s_variable_contains_lt1 __pyx_mstate_global->__pyx_n_s_variable_contains_lt1 -#define __pyx_n_s_variable_contains_negative __pyx_mstate_global->__pyx_n_s_variable_contains_negative -#define __pyx_n_s_variable_with_lt1 __pyx_mstate_global->__pyx_n_s_variable_with_lt1 -#define __pyx_n_s_variable_with_negative __pyx_mstate_global->__pyx_n_s_variable_with_negative -#define __pyx_n_s_variables __pyx_mstate_global->__pyx_n_s_variables -#define __pyx_n_s_vconstraints __pyx_mstate_global->__pyx_n_s_vconstraints -#define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x -#define __pyx_n_s_zip __pyx_mstate_global->__pyx_n_s_zip -#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 -#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 -#define __pyx_int_10 __pyx_mstate_global->__pyx_int_10 -#define __pyx_slice_ __pyx_mstate_global->__pyx_slice_ -#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 -#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 -#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 -#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 -#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 -#define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 -#define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 -#define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 -#define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 -#define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 -#define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 -#define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 -#define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 -#define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 -#define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 -#define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 -#define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 -#define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33 -#define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35 -#define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 -#define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39 -#define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41 -#define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43 -#define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 -#define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47 -#define __pyx_tuple__49 __pyx_mstate_global->__pyx_tuple__49 -#define __pyx_tuple__51 __pyx_mstate_global->__pyx_tuple__51 -#define __pyx_tuple__53 __pyx_mstate_global->__pyx_tuple__53 -#define __pyx_tuple__56 __pyx_mstate_global->__pyx_tuple__56 -#define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61 -#define __pyx_tuple__63 __pyx_mstate_global->__pyx_tuple__63 -#define __pyx_tuple__64 __pyx_mstate_global->__pyx_tuple__64 -#define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 -#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 -#define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 -#define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 -#define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 -#define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 -#define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 -#define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 -#define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 -#define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 -#define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 -#define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 -#define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 -#define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 -#define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 -#define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 -#define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40 -#define __pyx_codeobj__42 __pyx_mstate_global->__pyx_codeobj__42 -#define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 -#define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 -#define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 -#define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50 -#define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52 -#define __pyx_codeobj__54 __pyx_mstate_global->__pyx_codeobj__54 -#define __pyx_codeobj__55 __pyx_mstate_global->__pyx_codeobj__55 -#define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57 -#define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58 -#define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59 -#define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60 -#define __pyx_codeobj__62 __pyx_mstate_global->__pyx_codeobj__62 -#define __pyx_codeobj__65 __pyx_mstate_global->__pyx_codeobj__65 -#define __pyx_codeobj__66 __pyx_mstate_global->__pyx_codeobj__66 -#define __pyx_codeobj__67 __pyx_mstate_global->__pyx_codeobj__67 /* #### Code section: module_code ### */ /* "constraint/constraints.py":10 @@ -3780,7 +3359,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # <<<<<<<<<<<<<< * """Perform the constraint checking. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_10Constraint_1__call__(PyObject *__pyx_self, @@ -3791,7 +3370,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_10Constraint___call__, "Perform the constraint checking.\n\n If the forwardcheck parameter is not false, besides telling if\n the constraint is currently broken or not, the constraint\n implementation may choose to hide values from the domains of\n unassigned variables to prevent them from being used, and thus\n prune the search space.\n\n Args:\n variables (sequence): :py:class:`Variables` affected by that constraint,\n in the same order provided by the user\n domains (dict): Dictionary mapping variables to their\n domains\n assignments (dict): Dictionary mapping assigned variables to\n their current assumed value\n forwardcheck: Boolean value stating whether forward checking\n should be performed or not\n\n Returns:\n bool: Boolean value stating if this constraint is currently\n broken or not\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_10Constraint_1__call__ = {"__call__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_10Constraint_1__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_10Constraint___call__}; +static PyMethodDef __pyx_mdef_10constraint_11constraints_10Constraint_1__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_10Constraint_1__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_10Constraint___call__}; static PyObject *__pyx_pw_10constraint_11constraints_10Constraint_1__call__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3816,7 +3395,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -3824,86 +3403,59 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,0}; - values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 10, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 10, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 10, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 10, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 10, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 10, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 10, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 10, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 1); __PYX_ERR(0, 10, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 10, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 2); __PYX_ERR(0, 10, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 10, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 3); __PYX_ERR(0, 10, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 10, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(0, 10, __pyx_L3_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, 10, __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, 10, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 10, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 10, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 10, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 10, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 10, __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]; @@ -3917,31 +3469,30 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.Constraint.__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", 1))) __PYX_ERR(0, 10, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 10, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 10, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 10, __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 */ 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -3949,7 +3500,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds 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) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("__call__", 0); /* "constraint/constraints.py":33 * broken or not @@ -3957,7 +3508,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint___call__(CYTHO * return True # <<<<<<<<<<<<<< * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; @@ -3969,7 +3520,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint___call__(CYTHO * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # <<<<<<<<<<<<<< * """Perform the constraint checking. * - */ +*/ /* function exit code */ __pyx_L0:; @@ -3984,7 +3535,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint___call__(CYTHO * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Preprocess variable domains. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_10Constraint_3preProcess(PyObject *__pyx_self, @@ -3995,7 +3546,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_10Constraint_2preProcess, "Preprocess variable domains.\n\n This method is called before starting to look for solutions,\n and is used to prune domains with specific constraint logic\n when possible. For instance, any constraints with a single\n variable may be applied on all possible values and removed,\n since they may act on individual values even without further\n knowledge about other assignments.\n\n Args:\n variables (sequence): Variables affected by that constraint,\n in the same order provided by the user\n domains (dict): Dictionary mapping variables to their\n domains\n constraints (list): List of pairs of (constraint, variables)\n vconstraints (dict): Dictionary mapping variables to a list\n of constraints affecting the given variables.\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_10Constraint_3preProcess = {"preProcess", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_10Constraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_10Constraint_2preProcess}; +static PyMethodDef __pyx_mdef_10constraint_11constraints_10Constraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_10Constraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_10Constraint_2preProcess}; static PyObject *__pyx_pw_10constraint_11constraints_10Constraint_3preProcess(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4020,7 +3571,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("preProcess (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -4028,85 +3579,52 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 35, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 35, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 35, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 35, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 35, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 35, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 1); __PYX_ERR(0, 35, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 2); __PYX_ERR(0, 35, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 3); __PYX_ERR(0, 35, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 4); __PYX_ERR(0, 35, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "preProcess") < 0)) __PYX_ERR(0, 35, __pyx_L3_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, 35, __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, 35, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 35, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 35, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 35, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 35, __pyx_L3_error) + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 35, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -4120,32 +3638,31 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.Constraint.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", 1))) __PYX_ERR(0, 35, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 35, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 35, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 35, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 35, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 35, __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 */ 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -4164,12 +3681,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; - unsigned int __pyx_t_9; + size_t __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("preProcess", 1); + __Pyx_RefNannySetupContext("preProcess", 0); /* "constraint/constraints.py":54 * of constraints affecting the given variables. @@ -4177,7 +3694,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * 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, 54, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 1); if (__pyx_t_2) { @@ -4188,8 +3705,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * variable = variables[0] # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_variable = __pyx_t_3; __pyx_t_3 = 0; @@ -4200,7 +3717,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * 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, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_domain = __pyx_t_3; @@ -4212,8 +3729,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * 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_slice_, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __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, 57, __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); @@ -4222,7 +3739,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY } else { __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __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, 57, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -4230,44 +3747,41 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY if (likely(PyList_CheckExact(__pyx_t_4))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 57, __pyx_L1_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 57, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_1); + ++__pyx_t_1; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 57, __pyx_L1_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); #endif + ++__pyx_t_1; } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 57, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 57, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_3); } + __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); __pyx_t_3 = 0; @@ -4277,33 +3791,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * if not self(variables, domains, {variable: value}): # <<<<<<<<<<<<<< * domain.remove(value) * constraints.remove((self, variables)) - */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_v_variable, __pyx_v_value) < 0) __PYX_ERR(0, 58, __pyx_L1_error) +*/ + __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_self); - __pyx_t_7 = __pyx_v_self; __pyx_t_8 = NULL; - __pyx_t_9 = 0; + __pyx_t_7 = __pyx_v_self; + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_t_8, __pyx_v_variable, __pyx_v_value) < 0) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_9 = 1; - } + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); + assert(__pyx_t_6); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_v_variables, __pyx_v_domains, __pyx_t_6}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + 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_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, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4316,30 +3830,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * domain.remove(value) # <<<<<<<<<<<<<< * constraints.remove((self, variables)) * vconstraints[variable].remove((self, variables)) - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_remove); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = NULL; +*/ + __pyx_t_7 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_7); __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_9 = 1; - } - } - #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_value}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 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_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4349,7 +3849,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * if not self(variables, domains, {variable: value}): # <<<<<<<<<<<<<< * domain.remove(value) * constraints.remove((self, variables)) - */ +*/ } /* "constraint/constraints.py":57 @@ -4358,7 +3858,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * for value in domain[:]: # <<<<<<<<<<<<<< * if not self(variables, domains, {variable: value}): * domain.remove(value) - */ +*/ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -4368,16 +3868,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * constraints.remove((self, variables)) # <<<<<<<<<<<<<< * vconstraints[variable].remove((self, variables)) * - */ +*/ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 60, __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)) __PYX_ERR(0, 60, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 60, __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)) __PYX_ERR(0, 60, __pyx_L1_error); - __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_remove, __pyx_v_constraints, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 60, __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, 60, __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; @@ -4388,42 +3888,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * vconstraints[variable].remove((self, variables)) # <<<<<<<<<<<<<< * * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): - */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_remove); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L1_error) +*/ + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __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, 61, __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_4, 0, __pyx_v_self)) __PYX_ERR(0, 61, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 61, __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)) __PYX_ERR(0, 61, __pyx_L1_error); - __pyx_t_6 = NULL; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 61, __pyx_L1_error); __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_9 = 1; - } - } - #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_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, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4433,7 +3919,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * if len(variables) == 1: # <<<<<<<<<<<<<< * variable = variables[0] * domain = domains[variable] - */ +*/ } /* "constraint/constraints.py":35 @@ -4442,7 +3928,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Preprocess variable domains. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -4470,7 +3956,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): # <<<<<<<<<<<<<< * """Helper method for generic forward checking. * - */ +*/ static PyObject *__pyx_pf_10constraint_11constraints___defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; @@ -4480,20 +3966,20 @@ static PyObject *__pyx_pf_10constraint_11constraints___defaults__(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__defaults__", 1); + __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg__unassigned); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg__unassigned); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg__unassigned)) __PYX_ERR(0, 63, __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, 0, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(0, 63, __pyx_L1_error); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __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)) __PYX_ERR(0, 63, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 63, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 63, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 63, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -4520,7 +4006,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_10Constraint_4forwardCheck, "Helper method for generic forward checking.\n\n Currently, this method acts only when there's a single\n unassigned variable.\n\n Args:\n variables (sequence): Variables affected by that constraint,\n in the same order provided by the user\n domains (dict): Dictionary mapping variables to their\n domains\n assignments (dict): Dictionary mapping assigned variables to\n their current assumed value\n\n Returns:\n bool: Boolean value stating if this constraint is currently\n broken or not\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_10Constraint_5forwardCheck = {"forwardCheck", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_10Constraint_5forwardCheck, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_10Constraint_4forwardCheck}; +static PyMethodDef __pyx_mdef_10constraint_11constraints_10Constraint_5forwardCheck = {"forwardCheck", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_10Constraint_5forwardCheck, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_10Constraint_4forwardCheck}; static PyObject *__pyx_pw_10constraint_11constraints_10Constraint_5forwardCheck(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4545,7 +4031,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("forwardCheck (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -4553,87 +4039,60 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_unassigned,0}; - __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self); - values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg__unassigned); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 63, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 63, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 63, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 63, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 63, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 63, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("forwardCheck", 0, 4, 5, 1); __PYX_ERR(0, 63, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("forwardCheck", 0, 4, 5, 2); __PYX_ERR(0, 63, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("forwardCheck", 0, 4, 5, 3); __PYX_ERR(0, 63, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unassigned); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "forwardCheck") < 0)) __PYX_ERR(0, 63, __pyx_L3_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, 63, __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, 63, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 63, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 63, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 63, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 63, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 63, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } + if (!values[4]) values[4] = __Pyx_NewRef(__pyx_dynamic_args->arg0); } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -4647,31 +4106,30 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.Constraint.forwardCheck", __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", 1))) __PYX_ERR(0, 63, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 63, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 63, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 63, __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 */ 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -4690,12 +4148,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; - unsigned int __pyx_t_8; + size_t __pyx_t_8; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("forwardCheck", 1); + __Pyx_RefNannySetupContext("forwardCheck", 0); /* "constraint/constraints.py":81 * broken or not @@ -4703,7 +4161,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * unassignedvariable = _unassigned # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: - */ +*/ __Pyx_INCREF(__pyx_v__unassigned); __pyx_v_unassignedvariable = __pyx_v__unassigned; @@ -4713,7 +4171,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * if unassignedvariable is _unassigned: - */ +*/ 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; @@ -4721,51 +4179,48 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __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, 82, __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 82, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 82, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 82, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 82, __pyx_L1_error) + __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); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif + ++__pyx_t_2; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 82, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 82, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_4); } + __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; @@ -4775,7 +4230,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * 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, 83, __pyx_L1_error) if (__pyx_t_5) { @@ -4785,7 +4240,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * if unassignedvariable is _unassigned: # <<<<<<<<<<<<<< * unassignedvariable = variable * else: - */ +*/ __pyx_t_5 = (__pyx_v_unassignedvariable == __pyx_v__unassigned); if (__pyx_t_5) { @@ -4795,7 +4250,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * unassignedvariable = variable # <<<<<<<<<<<<<< * else: * break - */ +*/ __Pyx_INCREF(__pyx_v_variable); __Pyx_DECREF_SET(__pyx_v_unassignedvariable, __pyx_v_variable); @@ -4805,7 +4260,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * if unassignedvariable is _unassigned: # <<<<<<<<<<<<<< * unassignedvariable = variable * else: - */ +*/ goto __pyx_L6; } @@ -4815,7 +4270,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * break # <<<<<<<<<<<<<< * else: * if unassignedvariable is not _unassigned: - */ +*/ /*else*/ { goto __pyx_L4_break; } @@ -4827,7 +4282,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * if variable not in assignments: # <<<<<<<<<<<<<< * if unassignedvariable is _unassigned: * unassignedvariable = variable - */ +*/ } /* "constraint/constraints.py":82 @@ -4836,7 +4291,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * if unassignedvariable is _unassigned: - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L7_for_else; @@ -4852,7 +4307,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * if unassignedvariable is not _unassigned: # <<<<<<<<<<<<<< * # Remove from the unassigned variable domain's all * # values which break our variable's constraints. - */ +*/ __pyx_t_5 = (__pyx_v_unassignedvariable != __pyx_v__unassigned); if (__pyx_t_5) { @@ -4862,7 +4317,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * 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, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_domain = __pyx_t_1; @@ -4874,7 +4329,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * 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, 93, __pyx_L1_error) if (__pyx_t_5) { @@ -4884,8 +4339,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * 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_slice_, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __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, 94, __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); @@ -4894,7 +4349,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( } else { __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __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, 94, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -4902,44 +4357,41 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( if (likely(PyList_CheckExact(__pyx_t_4))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 94, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 94, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_2); + ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 94, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_2); #endif + ++__pyx_t_2; } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 94, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 94, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_1); } + __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; @@ -4949,7 +4401,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * 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, 95, __pyx_L1_error) /* "constraint/constraints.py":96 @@ -4958,29 +4410,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * if not self(variables, domains, assignments): # <<<<<<<<<<<<<< * domain.hideValue(value) * del assignments[unassignedvariable] - */ +*/ + __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_self); - __pyx_t_6 = __pyx_v_self; __pyx_t_7 = NULL; - __pyx_t_8 = 0; + __pyx_t_7 = __pyx_v_self; + __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_8 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); + assert(__pyx_t_6); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __pyx_t_8 = 0; } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + 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_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, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4993,30 +4445,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * domain.hideValue(value) # <<<<<<<<<<<<<< * del assignments[unassignedvariable] * if not domain: - */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = NULL; +*/ + __pyx_t_7 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_8 = 1; - } - } - #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_value}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __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_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5026,7 +4464,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * if not self(variables, domains, assignments): # <<<<<<<<<<<<<< * domain.hideValue(value) * del assignments[unassignedvariable] - */ +*/ } /* "constraint/constraints.py":94 @@ -5035,7 +4473,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * for value in domain[:]: # <<<<<<<<<<<<<< * assignments[unassignedvariable] = value * if not self(variables, domains, assignments): - */ +*/ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5045,7 +4483,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * del assignments[unassignedvariable] # <<<<<<<<<<<<<< * if not domain: * return False - */ +*/ if (unlikely((PyDict_DelItem(__pyx_v_assignments, __pyx_v_unassignedvariable) < 0))) __PYX_ERR(0, 98, __pyx_L1_error) /* "constraint/constraints.py":93 @@ -5054,7 +4492,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * if domain: # <<<<<<<<<<<<<< * for value in domain[:]: * assignments[unassignedvariable] = value - */ +*/ } /* "constraint/constraints.py":99 @@ -5063,7 +4501,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * 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, 99, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_9); if (__pyx_t_5) { @@ -5074,7 +4512,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * return False # <<<<<<<<<<<<<< * return True * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -5086,7 +4524,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * if not domain: # <<<<<<<<<<<<<< * return False * return True - */ +*/ } /* "constraint/constraints.py":89 @@ -5095,7 +4533,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * if unassignedvariable is not _unassigned: # <<<<<<<<<<<<<< * # Remove from the unassigned variable domain's all * # values which break our variable's constraints. - */ +*/ } } __pyx_L8_for_end:; @@ -5106,7 +4544,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * return True # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; @@ -5118,7 +4556,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): # <<<<<<<<<<<<<< * """Helper method for generic forward checking. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -5144,7 +4582,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_18FunctionConstraint_1__init__(PyObject *__pyx_self, @@ -5155,7 +4593,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_18FunctionConstraint___init__, "Initialization method.\n\n Args:\n func (callable object): Function wrapped and queried for\n constraint logic\n assigned (bool): Whether the function may receive unassigned\n variables or not\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_18FunctionConstraint_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18FunctionConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_18FunctionConstraint___init__}; +static PyMethodDef __pyx_mdef_10constraint_11constraints_18FunctionConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18FunctionConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_18FunctionConstraint___init__}; static PyObject *__pyx_pw_10constraint_11constraints_18FunctionConstraint_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -5178,7 +4616,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -5186,60 +4624,47 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_func,&__pyx_n_s_assigned,0}; - values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 125, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 125, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 125, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 125, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_func)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 125, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assigned); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 125, __pyx_L3_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, 125, __pyx_L3_error) + if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); + for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 125, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 125, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 125, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 125, __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]; @@ -5251,11 +4676,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.FunctionConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5264,11 +4686,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_11constraints_18FunctionConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_func, __pyx_v_assigned); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -5280,7 +4699,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/constraints.py":134 * variables or not @@ -5288,8 +4707,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init * self._func = func # <<<<<<<<<<<<<< * self._assigned = assigned * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_func_2, __pyx_v_func) < 0) __PYX_ERR(0, 134, __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, 134, __pyx_L1_error) /* "constraint/constraints.py":135 * """ @@ -5297,8 +4716,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init * self._assigned = assigned # <<<<<<<<<<<<<< * * def __call__( # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_assigned_2, __pyx_v_assigned) < 0) __PYX_ERR(0, 135, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_assigned_2, __pyx_v_assigned) < 0) __PYX_ERR(0, 135, __pyx_L1_error) /* "constraint/constraints.py":125 * """ @@ -5306,7 +4725,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -5326,7 +4745,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ static PyObject *__pyx_pf_10constraint_11constraints_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; @@ -5336,7 +4755,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_2__defaults__(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__defaults__", 1); + __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); /* "constraint/constraints.py":142 @@ -5345,15 +4764,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_2__defaults__(CYTHON_UNUSED * forwardcheck=False, # <<<<<<<<<<<<<< * _unassigned=Unassigned, * ): - */ +*/ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __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))) __PYX_ERR(0, 137, __pyx_L1_error); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg__unassigned); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg__unassigned); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg__unassigned)) __PYX_ERR(0, 137, __pyx_L1_error); + __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, 137, __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, 137, __pyx_L1_error); /* "constraint/constraints.py":137 * self._assigned = assigned @@ -5361,14 +4780,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_2__defaults__(CYTHON_UNUSED * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __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)) __PYX_ERR(0, 137, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 137, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 137, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 137, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -5394,7 +4813,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_11constraints_18FunctionConstraint_3__call__ = {"__call__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18FunctionConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_11constraints_18FunctionConstraint_3__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18FunctionConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_11constraints_18FunctionConstraint_3__call__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -5420,7 +4839,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -5428,99 +4847,70 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,&__pyx_n_s_unassigned,0}; - __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self); - values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg__unassigned); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 137, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + case 6: + values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 137, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 137, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 137, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 137, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 137, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 137, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + 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, 137, __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, 137, __pyx_L3_error) } + } + } else { switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, 1); __PYX_ERR(0, 137, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, 2); __PYX_ERR(0, 137, __pyx_L3_error) - } + case 6: + values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 137, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, 3); __PYX_ERR(0, 137, __pyx_L3_error) - } + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 137, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unassigned); - if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(0, 137, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 137, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 137, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 137, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 137, __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]; @@ -5535,31 +4925,30 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.FunctionConstraint.__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", 1))) __PYX_ERR(0, 140, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 141, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 140, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 141, __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 */ 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -5579,11 +4968,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; - unsigned int __pyx_t_10; + size_t __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("__call__", 0); /* "constraint/constraints.py":174 * @@ -5591,7 +4980,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * parms = list() # <<<<<<<<<<<<<< * missing = 0 * for x in variables: - */ +*/ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_parms = ((PyObject*)__pyx_t_1); @@ -5603,9 +4992,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * missing = 0 # <<<<<<<<<<<<<< * for x in variables: * if x in assignments: - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_missing = __pyx_int_0; +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_missing = __pyx_mstate_global->__pyx_int_0; /* "constraint/constraints.py":176 * parms = list() @@ -5613,7 +5002,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * for x in variables: # <<<<<<<<<<<<<< * if x in assignments: * parms.append(assignments[x]) - */ +*/ 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; @@ -5621,51 +5010,48 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __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, 176, __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 176, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 176, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 176, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 176, __pyx_L1_error) + __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); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif + ++__pyx_t_2; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 176, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 176, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_4); } + __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4); __pyx_t_4 = 0; @@ -5675,7 +5061,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * 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, 177, __pyx_L1_error) if (__pyx_t_5) { @@ -5685,7 +5071,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * 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, 178, __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, 178, __pyx_L1_error) @@ -5697,7 +5083,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * if x in assignments: # <<<<<<<<<<<<<< * parms.append(assignments[x]) * else: - */ +*/ goto __pyx_L5; } @@ -5707,7 +5093,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * parms.append(_unassigned) # <<<<<<<<<<<<<< * missing += 1 * - */ +*/ /*else*/ { __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parms, __pyx_v__unassigned); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 180, __pyx_L1_error) @@ -5717,8 +5103,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * missing += 1 # <<<<<<<<<<<<<< * * # if there are unassigned variables, do a forward check before executing the restriction function - */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_missing, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __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, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_missing, __pyx_t_4); __pyx_t_4 = 0; @@ -5731,7 +5117,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * for x in variables: # <<<<<<<<<<<<<< * if x in assignments: * parms.append(assignments[x]) - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5741,8 +5127,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * 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_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __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, 184, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { @@ -5753,9 +5139,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * return (self._assigned or self._func(*parms)) and ( # <<<<<<<<<<<<<< * not forwardcheck or missing != 1 or self.forwardCheck(variables, domains, assignments) * ) - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_assigned_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __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, 185, __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, 185, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5763,7 +5149,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal } else { goto __pyx_L9_next_and; } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_func_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __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, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PySequence_Tuple(__pyx_v_parms); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); @@ -5788,7 +5174,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * 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, 186, __pyx_L1_error) __pyx_t_9 = (!__pyx_t_5); if (!__pyx_t_9) { @@ -5799,7 +5185,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal __pyx_t_8 = 0; goto __pyx_L8_bool_binop_done; } - __pyx_t_8 = __Pyx_PyInt_NeObjC(__pyx_v_missing, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 186, __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, 186, __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, 186, __pyx_L1_error) if (!__pyx_t_9) { @@ -5810,29 +5196,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L8_bool_binop_done; } - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_forwardCheck); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = NULL; + __pyx_t_7 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_7); __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_10 = 1; - } - } - #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_10, 3+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_INCREF(__pyx_t_8); __pyx_t_1 = __pyx_t_8; @@ -5848,7 +5220,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * if missing > 0: # <<<<<<<<<<<<<< * return (self._assigned or self._func(*parms)) and ( * not forwardcheck or missing != 1 or self.forwardCheck(variables, domains, assignments) - */ +*/ } /* "constraint/constraints.py":188 @@ -5857,9 +5229,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * return self._func(*parms) # <<<<<<<<<<<<<< * * class CompilableFunctionConstraint(Constraint): - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_func_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __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, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = PySequence_Tuple(__pyx_v_parms); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -5877,7 +5249,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -5902,7 +5274,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * def __init__(self, func: str, assigned: bool = True): # noqa: D102, D107 # <<<<<<<<<<<<<< * self._func = func * self._assigned = assigned - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_28CompilableFunctionConstraint_1__init__(PyObject *__pyx_self, @@ -5912,7 +5284,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_11constraints_28CompilableFunctionConstraint_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_28CompilableFunctionConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_11constraints_28CompilableFunctionConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_28CompilableFunctionConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_11constraints_28CompilableFunctionConstraint_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -5935,7 +5307,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -5943,60 +5315,47 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_func,&__pyx_n_s_assigned,0}; - values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 193, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 193, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 193, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 193, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_func)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 193, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assigned); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 193, __pyx_L3_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, 193, __pyx_L3_error) + if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); + for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 193, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 193, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 193, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 193, __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]); @@ -6008,30 +5367,29 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_func), (&PyUnicode_Type), 0, "func", 1))) __PYX_ERR(0, 193, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_func), (&PyUnicode_Type), 0, "func", 2))) __PYX_ERR(0, 193, __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 */ 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -6042,7 +5400,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/constraints.py":194 * @@ -6050,8 +5408,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra * self._func = func # <<<<<<<<<<<<<< * self._assigned = assigned * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_func_2, __pyx_v_func) < 0) __PYX_ERR(0, 194, __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, 194, __pyx_L1_error) /* "constraint/constraints.py":195 * def __init__(self, func: str, assigned: bool = True): # noqa: D102, D107 @@ -6059,8 +5417,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra * self._assigned = assigned # <<<<<<<<<<<<<< * * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_assigned_2, __pyx_v_assigned) < 0) __PYX_ERR(0, 195, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_assigned_2, __pyx_v_assigned) < 0) __PYX_ERR(0, 195, __pyx_L1_error) /* "constraint/constraints.py":193 * """Wrapper function for picklable string constraints that must be compiled into a FunctionConstraint later on.""" @@ -6068,7 +5426,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra * def __init__(self, func: str, assigned: bool = True): # noqa: D102, D107 # <<<<<<<<<<<<<< * self._func = func * self._assigned = assigned - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -6088,7 +5446,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra * 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; @@ -6098,23 +5456,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_4__defaults__(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__defaults__", 1); + __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __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))) __PYX_ERR(0, 197, __pyx_L1_error); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg__unassigned); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg__unassigned); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg__unassigned)) __PYX_ERR(0, 197, __pyx_L1_error); + __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, 197, __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, 197, __pyx_L1_error); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __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)) __PYX_ERR(0, 197, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 197, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 197, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 197, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -6140,7 +5498,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_11constraints_28CompilableFunctionConstraint_3__call__ = {"__call__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_28CompilableFunctionConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +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 @@ -6166,7 +5524,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -6174,99 +5532,70 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,&__pyx_n_s_unassigned,0}; - __pyx_defaults2 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self); - values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg__unassigned); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 197, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + case 6: + values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 197, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 197, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 197, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 197, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 197, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, 1); __PYX_ERR(0, 197, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, 2); __PYX_ERR(0, 197, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, 3); __PYX_ERR(0, 197, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unassigned); - if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(0, 197, __pyx_L3_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, 197, __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, 197, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + case 6: + values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 197, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 197, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 197, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 197, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 197, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 197, __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]; @@ -6281,11 +5610,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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(); @@ -6294,11 +5620,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __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 */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -6308,10 +5631,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra 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__", 1); + __Pyx_RefNannySetupContext("__call__", 0); /* "constraint/constraints.py":198 * @@ -6319,9 +5645,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra * raise NotImplementedError("CompilableFunctionConstraint can not be called directly") # <<<<<<<<<<<<<< * * - */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); +*/ + __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, 198, __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, 198, __pyx_L1_error) @@ -6332,11 +5668,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra * 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_XDECREF(__pyx_t_3); __Pyx_AddTraceback("constraint.constraints.CompilableFunctionConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); @@ -6350,7 +5688,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ static PyObject *__pyx_pf_10constraint_11constraints_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; @@ -6360,7 +5698,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_6__defaults__(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__defaults__", 1); + __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); /* "constraint/constraints.py":217 @@ -6369,15 +5707,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_6__defaults__(CYTHON_UNUSED * forwardcheck=False, # <<<<<<<<<<<<<< * _unassigned=Unassigned, * ): - */ +*/ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __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))) __PYX_ERR(0, 212, __pyx_L1_error); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__unassigned); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__unassigned); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__unassigned)) __PYX_ERR(0, 212, __pyx_L1_error); + __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, 212, __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, 212, __pyx_L1_error); /* "constraint/constraints.py":212 * """ @@ -6385,14 +5723,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_6__defaults__(CYTHON_UNUSED * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __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)) __PYX_ERR(0, 212, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 212, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 212, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 212, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -6418,7 +5756,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_11constraints_22AllDifferentConstraint_1__call__ = {"__call__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_22AllDifferentConstraint_1__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_11constraints_22AllDifferentConstraint_1__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_22AllDifferentConstraint_1__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_11constraints_22AllDifferentConstraint_1__call__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -6444,7 +5782,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -6452,99 +5790,70 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,&__pyx_n_s_unassigned,0}; - __pyx_defaults3 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self); - values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg__unassigned); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 212, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + case 6: + values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 212, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 212, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 212, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 212, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 212, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 212, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, 1); __PYX_ERR(0, 212, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, 2); __PYX_ERR(0, 212, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, 3); __PYX_ERR(0, 212, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unassigned); - if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(0, 212, __pyx_L3_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, 212, __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, 212, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + case 6: + values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 212, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 212, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 212, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 212, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 212, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 212, __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]; @@ -6559,31 +5868,30 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.AllDifferentConstraint.__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", 1))) __PYX_ERR(0, 215, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 216, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 215, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 216, __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 */ 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -6606,13 +5914,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; - unsigned int __pyx_t_13; - int __pyx_t_14; + size_t __pyx_t_12; + int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("__call__", 0); /* "constraint/constraints.py":220 * _unassigned=Unassigned, @@ -6620,7 +5927,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * 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, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_seen = ((PyObject*)__pyx_t_1); @@ -6632,7 +5939,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * for variable in variables: # <<<<<<<<<<<<<< * value = assignments.get(variable, _unassigned) * if value is not _unassigned: - */ +*/ 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; @@ -6640,51 +5947,48 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __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, 221, __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 221, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 221, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 221, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 221, __pyx_L1_error) + __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); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif + ++__pyx_t_2; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 221, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 221, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_4); } + __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; @@ -6694,7 +5998,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * 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, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); @@ -6706,7 +6010,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * if value is not _unassigned: # <<<<<<<<<<<<<< * if value in seen: * return False - */ +*/ __pyx_t_5 = (__pyx_v_value != __pyx_v__unassigned); if (__pyx_t_5) { @@ -6716,7 +6020,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * 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, 224, __pyx_L1_error) if (__pyx_t_5) { @@ -6726,7 +6030,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * return False # <<<<<<<<<<<<<< * seen[value] = True * if forwardcheck: - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -6739,7 +6043,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * if value in seen: # <<<<<<<<<<<<<< * return False * seen[value] = True - */ +*/ } /* "constraint/constraints.py":226 @@ -6748,7 +6052,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * 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, 226, __pyx_L1_error) /* "constraint/constraints.py":223 @@ -6757,7 +6061,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * if value is not _unassigned: # <<<<<<<<<<<<<< * if value in seen: * return False - */ +*/ } /* "constraint/constraints.py":221 @@ -6766,7 +6070,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * for variable in variables: # <<<<<<<<<<<<<< * value = assignments.get(variable, _unassigned) * if value is not _unassigned: - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -6776,7 +6080,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * 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, 227, __pyx_L1_error) if (__pyx_t_5) { @@ -6786,7 +6090,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * 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_2 = 0; @@ -6794,51 +6098,48 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __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, 228, __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 228, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 228, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 228, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 228, __pyx_L1_error) + __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); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif + ++__pyx_t_2; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 228, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 228, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_4); } + __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; @@ -6848,7 +6149,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * 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, 229, __pyx_L1_error) if (__pyx_t_5) { @@ -6858,7 +6159,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * 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, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); @@ -6870,7 +6171,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * for value in seen: # <<<<<<<<<<<<<< * if value in domain: * 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, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -6891,7 +6192,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * 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, 232, __pyx_L1_error) if (__pyx_t_5) { @@ -6901,30 +6202,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False - */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = NULL; - __pyx_t_13 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - __pyx_t_13 = 1; - } - } - #endif +*/ + __pyx_t_11 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_11); + __pyx_t_12 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_value}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13); - __Pyx_XDECREF(__pyx_t_12); __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_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -6934,10 +6221,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * 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, 234, __pyx_L1_error) - __pyx_t_14 = (!__pyx_t_5); - if (__pyx_t_14) { + __pyx_t_13 = (!__pyx_t_5); + if (__pyx_t_13) { /* "constraint/constraints.py":235 * domain.hideValue(value) @@ -6945,7 +6232,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * return False # <<<<<<<<<<<<<< * return True * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -6959,7 +6246,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * if not domain: # <<<<<<<<<<<<<< * return False * return True - */ +*/ } /* "constraint/constraints.py":232 @@ -6968,7 +6255,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * if value in domain: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ +*/ } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -6979,7 +6266,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in seen: - */ +*/ } /* "constraint/constraints.py":228 @@ -6988,7 +6275,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -6998,7 +6285,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * if forwardcheck: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: - */ +*/ } /* "constraint/constraints.py":236 @@ -7007,7 +6294,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * return True # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; @@ -7019,7 +6306,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -7027,7 +6314,6 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); - __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("constraint.constraints.AllDifferentConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -7046,7 +6332,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ static PyObject *__pyx_pf_10constraint_11constraints_8__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; @@ -7056,7 +6342,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_8__defaults__(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__defaults__", 1); + __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); /* "constraint/constraints.py":255 @@ -7065,15 +6351,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_8__defaults__(CYTHON_UNUSED * forwardcheck=False, # <<<<<<<<<<<<<< * _unassigned=Unassigned, * ): - */ +*/ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __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))) __PYX_ERR(0, 250, __pyx_L1_error); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg__unassigned); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg__unassigned); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg__unassigned)) __PYX_ERR(0, 250, __pyx_L1_error); + __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, 250, __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, 250, __pyx_L1_error); /* "constraint/constraints.py":250 * """ @@ -7081,14 +6367,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_8__defaults__(CYTHON_UNUSED * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __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)) __PYX_ERR(0, 250, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 250, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 250, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 250, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -7114,7 +6400,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_11constraints_18AllEqualConstraint_1__call__ = {"__call__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18AllEqualConstraint_1__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_11constraints_18AllEqualConstraint_1__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18AllEqualConstraint_1__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_11constraints_18AllEqualConstraint_1__call__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -7140,7 +6426,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -7148,99 +6434,70 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,&__pyx_n_s_unassigned,0}; - __pyx_defaults4 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self); - values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg__unassigned); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 250, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + case 6: + values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 250, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 250, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 250, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 250, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 250, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 250, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, 1); __PYX_ERR(0, 250, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, 2); __PYX_ERR(0, 250, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, 3); __PYX_ERR(0, 250, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unassigned); - if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(0, 250, __pyx_L3_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, 250, __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, 250, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + case 6: + values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 250, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 250, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 250, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 250, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 250, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 250, __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]; @@ -7255,31 +6512,30 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.AllEqualConstraint.__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", 1))) __PYX_ERR(0, 253, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 254, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 253, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 254, __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 */ 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -7301,12 +6557,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - unsigned int __pyx_t_12; + size_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("__call__", 0); /* "constraint/constraints.py":258 * _unassigned=Unassigned, @@ -7314,7 +6569,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * singlevalue = _unassigned # <<<<<<<<<<<<<< * for variable in variables: * value = assignments.get(variable, _unassigned) - */ +*/ __Pyx_INCREF(__pyx_v__unassigned); __pyx_v_singlevalue = __pyx_v__unassigned; @@ -7324,7 +6579,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * for variable in variables: # <<<<<<<<<<<<<< * value = assignments.get(variable, _unassigned) * if singlevalue is _unassigned: - */ +*/ 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; @@ -7332,51 +6587,48 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __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, 259, __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 259, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 259, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 259, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 259, __pyx_L1_error) + __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); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif + ++__pyx_t_2; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 259, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 259, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_4); } + __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; @@ -7386,7 +6638,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * 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, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); @@ -7398,7 +6650,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * if singlevalue is _unassigned: # <<<<<<<<<<<<<< * singlevalue = value * elif value is not _unassigned and value != singlevalue: - */ +*/ __pyx_t_5 = (__pyx_v_singlevalue == __pyx_v__unassigned); if (__pyx_t_5) { @@ -7408,7 +6660,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * singlevalue = value # <<<<<<<<<<<<<< * elif value is not _unassigned and value != singlevalue: * return False - */ +*/ __Pyx_INCREF(__pyx_v_value); __Pyx_DECREF_SET(__pyx_v_singlevalue, __pyx_v_value); @@ -7418,7 +6670,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * if singlevalue is _unassigned: # <<<<<<<<<<<<<< * singlevalue = value * elif value is not _unassigned and value != singlevalue: - */ +*/ goto __pyx_L5; } @@ -7428,7 +6680,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * elif value is not _unassigned and value != singlevalue: # <<<<<<<<<<<<<< * return False * if forwardcheck and singlevalue is not _unassigned: - */ +*/ __pyx_t_6 = (__pyx_v_value != __pyx_v__unassigned); if (__pyx_t_6) { } else { @@ -7448,7 +6700,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * return False # <<<<<<<<<<<<<< * if forwardcheck and singlevalue is not _unassigned: * for variable in variables: - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -7461,7 +6713,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * elif value is not _unassigned and value != singlevalue: # <<<<<<<<<<<<<< * return False * if forwardcheck and singlevalue is not _unassigned: - */ +*/ } __pyx_L5:; @@ -7471,7 +6723,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * for variable in variables: # <<<<<<<<<<<<<< * value = assignments.get(variable, _unassigned) * if singlevalue is _unassigned: - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -7481,7 +6733,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * 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, 265, __pyx_L1_error) if (__pyx_t_6) { } else { @@ -7499,7 +6751,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * 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_2 = 0; @@ -7507,51 +6759,48 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __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, 266, __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 266, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 266, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 266, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 266, __pyx_L1_error) + __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); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif + ++__pyx_t_2; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 266, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 266, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_4); } + __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; @@ -7561,7 +6810,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * 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, 267, __pyx_L1_error) if (__pyx_t_5) { @@ -7571,7 +6820,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * 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, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); @@ -7583,7 +6832,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * 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, 269, __pyx_L1_error) if (__pyx_t_5) { @@ -7593,7 +6842,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * return False # <<<<<<<<<<<<<< * for value in domain[:]: * if value != singlevalue: - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -7606,7 +6855,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * if singlevalue not in domain: # <<<<<<<<<<<<<< * return False * for value in domain[:]: - */ +*/ } /* "constraint/constraints.py":271 @@ -7615,8 +6864,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * for value in domain[:]: # <<<<<<<<<<<<<< * if value != singlevalue: * domain.hideValue(value) - */ - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __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, 271, __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); @@ -7625,7 +6874,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } else { __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 271, __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, 271, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -7633,44 +6882,41 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call if (likely(PyList_CheckExact(__pyx_t_7))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 271, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 271, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_8); + ++__pyx_t_8; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 271, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8); #endif + ++__pyx_t_8; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 271, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 271, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_4); } + __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; @@ -7680,7 +6926,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * 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, 272, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -7692,30 +6938,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * domain.hideValue(value) # <<<<<<<<<<<<<< * return True * - */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = NULL; - __pyx_t_12 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_12 = 1; - } - } - #endif +*/ + __pyx_t_10 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_10); + __pyx_t_11 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); - __Pyx_XDECREF(__pyx_t_11); __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_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -7725,7 +6957,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * if value != singlevalue: # <<<<<<<<<<<<<< * domain.hideValue(value) * return True - */ +*/ } /* "constraint/constraints.py":271 @@ -7734,7 +6966,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * for value in domain[:]: # <<<<<<<<<<<<<< * if value != singlevalue: * domain.hideValue(value) - */ +*/ } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -7744,7 +6976,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * if singlevalue not in domain: - */ +*/ } /* "constraint/constraints.py":266 @@ -7753,7 +6985,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -7763,7 +6995,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * if forwardcheck and singlevalue is not _unassigned: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: - */ +*/ } /* "constraint/constraints.py":274 @@ -7772,7 +7004,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * return True # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; @@ -7784,7 +7016,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -7792,7 +7024,6 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("constraint.constraints.AllEqualConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -7811,7 +7042,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_16MaxSumConstraint_1__init__(PyObject *__pyx_self, @@ -7822,7 +7053,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_16MaxSumConstraint___init__, "Initialization method.\n\n Args:\n maxsum (number): Value to be considered as the maximum sum\n multipliers (sequence of numbers): If given, variable values\n will be multiplied by the given factors before being\n summed to be checked\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_16MaxSumConstraint_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_16MaxSumConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_16MaxSumConstraint___init__}; +static PyMethodDef __pyx_mdef_10constraint_11constraints_16MaxSumConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_16MaxSumConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_16MaxSumConstraint___init__}; static PyObject *__pyx_pw_10constraint_11constraints_16MaxSumConstraint_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -7845,7 +7076,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -7853,60 +7084,47 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_maxsum,&__pyx_n_s_multipliers,0}; - values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 288, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 288, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 288, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 288, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_maxsum)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 288, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_multipliers); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 288, __pyx_L3_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, 288, __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, 288, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 288, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 288, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 288, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } + if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); } __pyx_v_self = values[0]; __pyx_v_maxsum = values[1]; @@ -7918,11 +7136,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.MaxSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -7931,11 +7146,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_maxsum, __pyx_v_multipliers); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -7947,7 +7159,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/constraints.py":297 * summed to be checked @@ -7955,8 +7167,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ * self._maxsum = maxsum # <<<<<<<<<<<<<< * self._multipliers = multipliers * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_maxsum_2, __pyx_v_maxsum) < 0) __PYX_ERR(0, 297, __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, 297, __pyx_L1_error) /* "constraint/constraints.py":298 * """ @@ -7964,8 +7176,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ * self._multipliers = multipliers # <<<<<<<<<<<<<< * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_multipliers_2, __pyx_v_multipliers) < 0) __PYX_ERR(0, 298, __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, 298, __pyx_L1_error) /* "constraint/constraints.py":288 * """ @@ -7973,7 +7185,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -7993,7 +7205,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_16MaxSumConstraint_3preProcess(PyObject *__pyx_self, @@ -8003,7 +7215,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_11constraints_16MaxSumConstraint_3preProcess = {"preProcess", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_16MaxSumConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_11constraints_16MaxSumConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_16MaxSumConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_11constraints_16MaxSumConstraint_3preProcess(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -8028,7 +7240,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("preProcess (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -8036,85 +7248,52 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 300, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 300, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 300, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 300, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 300, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 300, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 300, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 300, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 1); __PYX_ERR(0, 300, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 300, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 2); __PYX_ERR(0, 300, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 300, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 3); __PYX_ERR(0, 300, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 300, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 4); __PYX_ERR(0, 300, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "preProcess") < 0)) __PYX_ERR(0, 300, __pyx_L3_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, 300, __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, 300, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 300, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 300, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 300, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 300, __pyx_L3_error) + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 300, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -8128,32 +7307,31 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.MaxSumConstraint.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", 1))) __PYX_ERR(0, 300, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 300, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 300, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 300, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 300, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 300, __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 */ 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -8165,7 +7343,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10prePro * 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__genexpr *__pyx_cur_scope; @@ -8175,7 +7353,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_10prePro const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct__genexpr(__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct__genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *)Py_None); __Pyx_INCREF(Py_None); @@ -8187,7 +7365,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_10prePro __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_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_MaxSumConstraint_preProcess_loca, __pyx_n_s_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 307, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_16MaxSumConstraint_10preProcess_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_MaxSumConstraint_preProcess_loca, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -8233,56 +7411,53 @@ static PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10prePro } 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, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __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, 307, __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 307, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 307, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 307, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 307, __pyx_L1_error) + __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); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif + ++__pyx_t_2; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 307, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 307, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_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_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error) + __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, 307, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { @@ -8305,10 +7480,12 @@ static PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10prePro /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + 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 @@ -8326,7 +7503,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10prePro * 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; @@ -8344,12 +7521,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; - Py_ssize_t __pyx_t_5; - PyObject *(*__pyx_t_6)(PyObject *); - int __pyx_t_7; + 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; - PyObject *__pyx_t_9 = NULL; + int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_t_12; @@ -8358,7 +7535,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("preProcess", 1); + __Pyx_RefNannySetupContext("preProcess", 0); /* "constraint/constraints.py":301 * @@ -8366,33 +7543,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< * * # check if there are any negative values in the associated variables - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_preProcess); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +*/ __pyx_t_2 = NULL; - __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __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, 301, __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_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } + 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(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 5+__pyx_t_4); + __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_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, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8402,7 +7578,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * 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, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_variable_contains_negative = ((PyObject*)__pyx_t_1); @@ -8414,7 +7590,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * variable_with_negative = None # <<<<<<<<<<<<<< * for variable in variables: * contains_negative = any(value < 0 for value in domains[variable]) - */ +*/ __Pyx_INCREF(Py_None); __pyx_v_variable_with_negative = Py_None; @@ -8424,61 +7600,58 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * for variable in variables: # <<<<<<<<<<<<<< * contains_negative = any(value < 0 for value in domains[variable]) * variable_contains_negative.append(contains_negative) - */ +*/ 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_5 = 0; - __pyx_t_6 = NULL; + __pyx_t_6 = 0; + __pyx_t_7 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __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, 306, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_6)) { + 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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 306, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 306, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 306, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); #endif + ++__pyx_t_6; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_6(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { + __pyx_t_4 = __pyx_t_7(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 306, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 306, __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_4); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); + __pyx_t_4 = 0; /* "constraint/constraints.py":307 * variable_with_negative = None @@ -8486,17 +7659,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * contains_negative = any(value < 0 for value in domains[variable]) # <<<<<<<<<<<<<< * variable_contains_negative.append(contains_negative) * if contains_negative: - */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __pyx_pf_10constraint_11constraints_16MaxSumConstraint_10preProcess_genexpr(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __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, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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, 307, __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_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_contains_negative, __pyx_t_4); + __pyx_t_4 = 0; /* "constraint/constraints.py":308 * for variable in variables: @@ -8504,8 +7677,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * variable_contains_negative.append(contains_negative) # <<<<<<<<<<<<<< * if contains_negative: * if variable_with_negative is not None: - */ - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_variable_contains_negative, __pyx_v_contains_negative); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 308, __pyx_L1_error) +*/ + __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, 308, __pyx_L1_error) /* "constraint/constraints.py":309 * contains_negative = any(value < 0 for value in domains[variable]) @@ -8513,9 +7686,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if contains_negative: # <<<<<<<<<<<<<< * if variable_with_negative is not None: * # if more than one associated variables contain negative, we can't prune - */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_contains_negative); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 309, __pyx_L1_error) - if (__pyx_t_8) { +*/ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_contains_negative); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 309, __pyx_L1_error) + if (__pyx_t_9) { /* "constraint/constraints.py":310 * variable_contains_negative.append(contains_negative) @@ -8523,9 +7696,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if variable_with_negative is not None: # <<<<<<<<<<<<<< * # if more than one associated variables contain negative, we can't prune * return - */ - __pyx_t_8 = (__pyx_v_variable_with_negative != Py_None); - if (__pyx_t_8) { +*/ + __pyx_t_9 = (__pyx_v_variable_with_negative != Py_None); + if (__pyx_t_9) { /* "constraint/constraints.py":312 * if variable_with_negative is not None: @@ -8533,7 +7706,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * return # <<<<<<<<<<<<<< * variable_with_negative = variable * - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8545,7 +7718,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if variable_with_negative is not None: # <<<<<<<<<<<<<< * # if more than one associated variables contain negative, we can't prune * return - */ +*/ } /* "constraint/constraints.py":313 @@ -8554,7 +7727,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * variable_with_negative = variable # <<<<<<<<<<<<<< * * # prune the associated variables of values > maxsum - */ +*/ __Pyx_INCREF(__pyx_v_variable); __Pyx_DECREF_SET(__pyx_v_variable_with_negative, __pyx_v_variable); @@ -8564,7 +7737,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * 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":306 @@ -8573,7 +7746,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * for variable in variables: # <<<<<<<<<<<<<< * contains_negative = any(value < 0 for value in domains[variable]) * variable_contains_negative.append(contains_negative) - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8583,8 +7756,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * multipliers = self._multipliers # <<<<<<<<<<<<<< * maxsum = self._maxsum * if multipliers: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __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, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; @@ -8595,8 +7768,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * maxsum = self._maxsum # <<<<<<<<<<<<<< * if multipliers: * for variable, multiplier in zip(variables, multipliers): - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_maxsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __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, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_maxsum = __pyx_t_1; __pyx_t_1 = 0; @@ -8607,9 +7780,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable_with_negative is not None and variable_with_negative != variable: - */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 318, __pyx_L1_error) - if (__pyx_t_8) { +*/ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 318, __pyx_L1_error) + if (__pyx_t_9) { /* "constraint/constraints.py":319 * maxsum = self._maxsum @@ -8617,73 +7790,71 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable_with_negative is not None and variable_with_negative != variable: * continue - */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_variables); - __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_variables)) __PYX_ERR(0, 319, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_multipliers); - __Pyx_GIVEREF(__pyx_v_multipliers); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_multipliers)) __PYX_ERR(0, 319, __pyx_L1_error); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - 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_6 = NULL; - } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error) +*/ + __pyx_t_4 = NULL; + __Pyx_INCREF(__pyx_builtin_zip); + __pyx_t_2 = __pyx_builtin_zip; + __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, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 319, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + 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; + } else { + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __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, 319, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_6)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 319, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 319, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6); + ++__pyx_t_6; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 319, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); #endif + ++__pyx_t_6; } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_6(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { + __pyx_t_1 = __pyx_t_7(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 319, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 319, __pyx_L1_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; + __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); @@ -8692,31 +7863,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_9 = 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_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_9 = PyList_GET_ITEM(sequence, 1); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_9); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 319, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); #endif - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); - index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L11_unpacking_failed; - __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_10); + index = 0; __pyx_t_4 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L11_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, 319, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -8728,10 +7903,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __PYX_ERR(0, 319, __pyx_L1_error) __pyx_L12_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_2); - __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_9); - __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_3); + __pyx_t_3 = 0; /* "constraint/constraints.py":320 * if multipliers: @@ -8739,19 +7914,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * 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_8 = __pyx_t_12; + __pyx_t_9 = __pyx_t_12; goto __pyx_L14_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, 320, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 320, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = __pyx_t_12; + __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, 320, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 320, __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_8) { + if (__pyx_t_9) { /* "constraint/constraints.py":321 * for variable, multiplier in zip(variables, multipliers): @@ -8759,7 +7934,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * continue # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ goto __pyx_L9_continue; /* "constraint/constraints.py":320 @@ -8768,7 +7943,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if variable_with_negative is not None and variable_with_negative != variable: # <<<<<<<<<<<<<< * continue * domain = domains[variable] - */ +*/ } /* "constraint/constraints.py":322 @@ -8777,11 +7952,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if value * multiplier > maxsum: - */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); - __pyx_t_3 = 0; +*/ + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; /* "constraint/constraints.py":323 * continue @@ -8789,64 +7964,61 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * for value in domain[:]: # <<<<<<<<<<<<<< * if value * multiplier > maxsum: * domain.remove(value) - */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_9 = __pyx_t_3; __Pyx_INCREF(__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, 323, __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_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 323, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __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, 323, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_9))) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 323, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 323, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif + __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_9); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 323, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_13); #endif + ++__pyx_t_13; } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_14(__pyx_t_9); - if (unlikely(!__pyx_t_3)) { + __pyx_t_1 = __pyx_t_14(__pyx_t_3); + if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 323, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 323, __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_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; /* "constraint/constraints.py":324 * domain = domains[variable] @@ -8854,14 +8026,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if value * multiplier > maxsum: # <<<<<<<<<<<<<< * domain.remove(value) * else: - */ - __pyx_t_3 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 324, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_8) { +*/ + __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __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, 324, __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, 324, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_9) { /* "constraint/constraints.py":325 * for value in domain[:]: @@ -8869,32 +8041,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * domain.remove(value) # <<<<<<<<<<<<<< * else: * for variable in variables: - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + __pyx_t_1 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_value}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":324 * domain = domains[variable] @@ -8902,7 +8060,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if value * multiplier > maxsum: # <<<<<<<<<<<<<< * domain.remove(value) * else: - */ +*/ } /* "constraint/constraints.py":323 @@ -8911,9 +8069,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * for value in domain[:]: # <<<<<<<<<<<<<< * if value * multiplier > maxsum: * domain.remove(value) - */ +*/ } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/constraints.py":319 * maxsum = self._maxsum @@ -8921,10 +8079,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * 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_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/constraints.py":318 * multipliers = self._multipliers @@ -8932,7 +8090,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable_with_negative is not None and variable_with_negative != variable: - */ +*/ goto __pyx_L8; } @@ -8942,62 +8100,59 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * for variable in variables: # <<<<<<<<<<<<<< * if variable_with_negative is not None and variable_with_negative != variable: * continue - */ +*/ /*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_5 = 0; - __pyx_t_6 = NULL; + __pyx_t_2 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_2); + __pyx_t_6 = 0; + __pyx_t_7 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __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, 327, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_6)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 327, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 327, __pyx_L1_error) - #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 327, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - #endif + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6); + ++__pyx_t_6; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 327, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6)); #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 327, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); #endif + ++__pyx_t_6; } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 327, __pyx_L1_error) } else { - __pyx_t_9 = __pyx_t_6(__pyx_t_1); - if (unlikely(!__pyx_t_9)) { + __pyx_t_3 = __pyx_t_7(__pyx_t_2); + if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 327, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 327, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_9); } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_9); - __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); + __pyx_t_3 = 0; /* "constraint/constraints.py":328 * else: @@ -9005,19 +8160,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * 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_8 = __pyx_t_12; + __pyx_t_9 = __pyx_t_12; goto __pyx_L24_bool_binop_done; } - __pyx_t_9 = PyObject_RichCompare(__pyx_v_variable_with_negative, __pyx_v_variable, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 328, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 328, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_8 = __pyx_t_12; + __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, 328, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 328, __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_8) { + if (__pyx_t_9) { /* "constraint/constraints.py":329 * for variable in variables: @@ -9025,7 +8180,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * continue # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ goto __pyx_L21_continue; /* "constraint/constraints.py":328 @@ -9034,7 +8189,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if variable_with_negative is not None and variable_with_negative != variable: # <<<<<<<<<<<<<< * continue * domain = domains[variable] - */ +*/ } /* "constraint/constraints.py":330 @@ -9043,11 +8198,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if value > maxsum: - */ - __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_9); - __pyx_t_9 = 0; +*/ + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); + __pyx_t_3 = 0; /* "constraint/constraints.py":331 * continue @@ -9055,64 +8210,61 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * for value in domain[:]: # <<<<<<<<<<<<<< * if value > maxsum: * domain.remove(value) - */ - __pyx_t_9 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) { - __pyx_t_2 = __pyx_t_9; __Pyx_INCREF(__pyx_t_2); +*/ + __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, 331, __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_13 = 0; __pyx_t_14 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __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, 331, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 331, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 331, __pyx_L1_error) - #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - #endif + __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_2); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 331, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13)); #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); #endif + ++__pyx_t_13; } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error) } else { - __pyx_t_9 = __pyx_t_14(__pyx_t_2); - if (unlikely(!__pyx_t_9)) { + __pyx_t_3 = __pyx_t_14(__pyx_t_4); + if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 331, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 331, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_9); } - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_9); - __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); + __pyx_t_3 = 0; /* "constraint/constraints.py":332 * domain = domains[variable] @@ -9120,11 +8272,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if value > maxsum: # <<<<<<<<<<<<<< * domain.remove(value) * - */ - __pyx_t_9 = PyObject_RichCompare(__pyx_v_value, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 332, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (__pyx_t_8) { +*/ + __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, 332, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_9) { /* "constraint/constraints.py":333 * for value in domain[:]: @@ -9132,32 +8284,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * domain.remove(value) # <<<<<<<<<<<<<< * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + __pyx_t_1 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_value}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/constraints.py":332 * domain = domains[variable] @@ -9165,7 +8303,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if value > maxsum: # <<<<<<<<<<<<<< * domain.remove(value) * - */ +*/ } /* "constraint/constraints.py":331 @@ -9174,9 +8312,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * for value in domain[:]: # <<<<<<<<<<<<<< * if value > maxsum: * domain.remove(value) - */ +*/ } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":327 * domain.remove(value) @@ -9184,10 +8322,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * for variable in variables: # <<<<<<<<<<<<<< * if variable_with_negative is not None and variable_with_negative != variable: * continue - */ +*/ __pyx_L21_continue:; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L8:; @@ -9197,7 +8335,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -9206,7 +8344,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("constraint.constraints.MaxSumConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; @@ -9232,7 +8370,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers * maxsum = self._maxsum - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_16MaxSumConstraint_5__call__(PyObject *__pyx_self, @@ -9242,7 +8380,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_11constraints_16MaxSumConstraint_5__call__ = {"__call__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_16MaxSumConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_11constraints_16MaxSumConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_16MaxSumConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_11constraints_16MaxSumConstraint_5__call__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -9267,7 +8405,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -9275,86 +8413,59 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,0}; - values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 335, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 335, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 335, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 335, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 335, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 335, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 335, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 335, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 1); __PYX_ERR(0, 335, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 335, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 2); __PYX_ERR(0, 335, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 335, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 3); __PYX_ERR(0, 335, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 335, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(0, 335, __pyx_L3_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, 335, __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, 335, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 335, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 335, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 335, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 335, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 335, __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]; @@ -9368,31 +8479,30 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.MaxSumConstraint.__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", 1))) __PYX_ERR(0, 335, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 335, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 335, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 335, __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 */ 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -9410,20 +8520,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *(*__pyx_t_5)(PyObject *); - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_4 = NULL; + 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)(PyObject *); - Py_ssize_t __pyx_t_10; - PyObject *(*__pyx_t_11)(PyObject *); - unsigned int __pyx_t_12; + 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_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("__call__", 0); /* "constraint/constraints.py":336 * @@ -9431,8 +8541,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * multipliers = self._multipliers # <<<<<<<<<<<<<< * maxsum = self._maxsum * sum = 0 - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __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, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; @@ -9443,8 +8553,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * maxsum = self._maxsum # <<<<<<<<<<<<<< * sum = 0 * if multipliers: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_maxsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __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, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_maxsum = __pyx_t_1; __pyx_t_1 = 0; @@ -9455,9 +8565,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * sum = 0 # <<<<<<<<<<<<<< * if multipliers: * for variable, multiplier in zip(variables, multipliers): - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_sum = __pyx_int_0; +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; /* "constraint/constraints.py":339 * maxsum = self._maxsum @@ -9465,7 +8575,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * 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, 339, __pyx_L1_error) if (__pyx_t_2) { @@ -9475,73 +8585,71 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable in assignments: * sum += assignments[variable] * multiplier - */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_variables); - __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_variables)) __PYX_ERR(0, 340, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_multipliers); - __Pyx_GIVEREF(__pyx_v_multipliers); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_multipliers)) __PYX_ERR(0, 340, __pyx_L1_error); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - 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, 340, __pyx_L1_error) +*/ + __pyx_t_3 = NULL; + __Pyx_INCREF(__pyx_builtin_zip); + __pyx_t_4 = __pyx_builtin_zip; + __pyx_t_5 = 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_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, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + 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; + } else { + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __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, 340, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 340, __pyx_L1_error) #endif - if (__pyx_t_4 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 340, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_6); + ++__pyx_t_6; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 340, __pyx_L1_error) #endif - if (__pyx_t_4 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); #endif + ++__pyx_t_6; } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_5(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { + __pyx_t_1 = __pyx_t_7(__pyx_t_4); + if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 340, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 340, __pyx_L1_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; + __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); @@ -9550,46 +8658,50 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_6 = PyList_GET_ITEM(sequence, 0); - __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); } - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 340, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); #endif - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 340, __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_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); - index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_6); - index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 340, __pyx_L1_error) - __pyx_t_9 = NULL; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 340, __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_8); __pyx_t_8 = 0; - __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 340, __pyx_L1_error) __pyx_L7_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_6); - __pyx_t_6 = 0; - __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_7); - __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); + __pyx_t_8 = 0; /* "constraint/constraints.py":341 * if multipliers: @@ -9597,7 +8709,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * multiplier * if isinstance(sum, float): - */ +*/ __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 341, __pyx_L1_error) if (__pyx_t_2) { @@ -9607,25 +8719,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< * if isinstance(sum, float): * sum = round(sum, 10) - */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyNumber_Multiply(__pyx_t_3, __pyx_v_multiplier); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __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":341 - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): +*/ + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __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, 342, __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, 342, __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":341 + * if multipliers: + * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * multiplier * if isinstance(sum, float): - */ +*/ } /* "constraint/constraints.py":340 @@ -9634,9 +8746,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable in assignments: * sum += assignments[variable] * multiplier - */ +*/ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":343 * if variable in assignments: @@ -9644,7 +8756,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) * if sum > maxsum: - */ +*/ __pyx_t_2 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_2) { @@ -9654,20 +8766,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * sum = round(sum, 10) # <<<<<<<<<<<<<< * if sum > maxsum: * return False - */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_sum); - __Pyx_GIVEREF(__pyx_v_sum); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sum)) __PYX_ERR(0, 344, __pyx_L1_error); - __Pyx_INCREF(__pyx_int_10); - __Pyx_GIVEREF(__pyx_int_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_10)) __PYX_ERR(0, 344, __pyx_L1_error); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_3); - __pyx_t_3 = 0; +*/ + __pyx_t_1 = NULL; + __Pyx_INCREF(__pyx_builtin_round); + __pyx_t_8 = __pyx_builtin_round; + __pyx_t_5 = 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, 344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_4); + __pyx_t_4 = 0; /* "constraint/constraints.py":343 * if variable in assignments: @@ -9675,7 +8788,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) * if sum > maxsum: - */ +*/ } /* "constraint/constraints.py":345 @@ -9684,10 +8797,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if sum > maxsum: # <<<<<<<<<<<<<< * return False * if forwardcheck: - */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_sum, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 345, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +*/ + __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, 345, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 345, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "constraint/constraints.py":346 @@ -9696,7 +8809,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * return False # <<<<<<<<<<<<<< * if forwardcheck: * for variable, multiplier in zip(variables, multipliers): - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -9708,7 +8821,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if sum > maxsum: # <<<<<<<<<<<<<< * return False * if forwardcheck: - */ +*/ } /* "constraint/constraints.py":347 @@ -9717,7 +8830,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if forwardcheck: # <<<<<<<<<<<<<< * 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, 347, __pyx_L1_error) if (__pyx_t_2) { @@ -9727,73 +8840,71 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_variables); - __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variables)) __PYX_ERR(0, 348, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_multipliers); - __Pyx_GIVEREF(__pyx_v_multipliers); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_multipliers)) __PYX_ERR(0, 348, __pyx_L1_error); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - 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_4 = 0; - __pyx_t_5 = NULL; +*/ + __pyx_t_8 = NULL; + __Pyx_INCREF(__pyx_builtin_zip); + __pyx_t_1 = __pyx_builtin_zip; + __pyx_t_5 = 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, 348, __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_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __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, 348, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 348, __pyx_L1_error) #endif - if (__pyx_t_4 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 348, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + ++__pyx_t_6; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 348, __pyx_L1_error) #endif - if (__pyx_t_4 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); #endif + ++__pyx_t_6; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 348, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_5(__pyx_t_3); - if (unlikely(!__pyx_t_1)) { + __pyx_t_4 = __pyx_t_7(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 348, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 348, __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; + __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); @@ -9802,46 +8913,50 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + __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); } else { - __pyx_t_7 = PyList_GET_ITEM(sequence, 0); - __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); } - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 348, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); #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_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); - index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L15_unpacking_failed; - __Pyx_GOTREF(__pyx_t_7); - index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L15_unpacking_failed; - __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 348, __pyx_L1_error) - __pyx_t_9 = NULL; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + 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, 348, __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:; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 348, __pyx_L1_error) __pyx_L16_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_7); - __pyx_t_7 = 0; - __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_6); - __pyx_t_6 = 0; + __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; /* "constraint/constraints.py":349 * if forwardcheck: @@ -9849,7 +8964,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * 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, 349, __pyx_L1_error) if (__pyx_t_2) { @@ -9859,11 +8974,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if sum + value * multiplier > maxsum: - */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); - __pyx_t_1 = 0; +*/ + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); + __pyx_t_4 = 0; /* "constraint/constraints.py":351 * if variable not in assignments: @@ -9871,64 +8986,61 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for value in domain[:]: # <<<<<<<<<<<<<< * if sum + value * multiplier > maxsum: * domain.hideValue(value) - */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __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_10 = 0; - __pyx_t_11 = NULL; +*/ + __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, 351, __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; } else { - __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __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, 351, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { - if (likely(!__pyx_t_11)) { - if (likely(PyList_CheckExact(__pyx_t_6))) { + if (likely(!__pyx_t_12)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 351, __pyx_L1_error) #endif - if (__pyx_t_10 >= __pyx_temp) break; + if (__pyx_t_11 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 351, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_11); + ++__pyx_t_11; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 351, __pyx_L1_error) #endif - if (__pyx_t_10 >= __pyx_temp) break; + if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); #endif + ++__pyx_t_11; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_11(__pyx_t_6); - if (unlikely(!__pyx_t_1)) { + __pyx_t_4 = __pyx_t_12(__pyx_t_3); + if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 351, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 351, __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_4); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); + __pyx_t_4 = 0; /* "constraint/constraints.py":352 * domain = domains[variable] @@ -9936,16 +9048,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if sum + value * multiplier > maxsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ - __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyNumber_Add(__pyx_v_sum, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 352, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +*/ + __pyx_t_4 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __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, 352, __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, 352, __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, 352, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "constraint/constraints.py":353 @@ -9954,32 +9066,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = NULL; - __pyx_t_12 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_12 = 1; - } - } - #endif +*/ + __pyx_t_8 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_value}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); + __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_1)) __PYX_ERR(0, 353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":352 * domain = domains[variable] @@ -9987,7 +9085,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if sum + value * multiplier > maxsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ +*/ } /* "constraint/constraints.py":351 @@ -9996,9 +9094,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for value in domain[:]: # <<<<<<<<<<<<<< * if sum + value * multiplier > maxsum: * domain.hideValue(value) - */ +*/ } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/constraints.py":354 * if sum + value * multiplier > maxsum: @@ -10006,7 +9104,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if not domain: # <<<<<<<<<<<<<< * return False * else: - */ +*/ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 354, __pyx_L1_error) __pyx_t_13 = (!__pyx_t_2); if (__pyx_t_13) { @@ -10017,11 +9115,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * return False # <<<<<<<<<<<<<< * else: * for variable in variables: - */ +*/ __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_1); __pyx_t_1 = 0; goto __pyx_L0; /* "constraint/constraints.py":354 @@ -10030,7 +9128,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if not domain: # <<<<<<<<<<<<<< * return False * else: - */ +*/ } /* "constraint/constraints.py":349 @@ -10039,7 +9137,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ } /* "constraint/constraints.py":348 @@ -10048,9 +9146,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/constraints.py":347 * if sum > maxsum: @@ -10058,7 +9156,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if forwardcheck: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: - */ +*/ } /* "constraint/constraints.py":339 @@ -10067,7 +9165,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: - */ +*/ goto __pyx_L3; } @@ -10077,62 +9175,59 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for variable in variables: # <<<<<<<<<<<<<< * if variable in assignments: * sum += assignments[variable] - */ +*/ /*else*/ { 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_4 = 0; - __pyx_t_5 = NULL; + __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); + __pyx_t_6 = 0; + __pyx_t_7 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __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, 357, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 357, __pyx_L1_error) #endif - if (__pyx_t_4 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 357, __pyx_L1_error) - #else - __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - #endif + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + ++__pyx_t_6; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 357, __pyx_L1_error) #endif - if (__pyx_t_4 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); #else - __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); #endif + ++__pyx_t_6; } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) } else { - __pyx_t_6 = __pyx_t_5(__pyx_t_3); - if (unlikely(!__pyx_t_6)) { + __pyx_t_3 = __pyx_t_7(__pyx_t_1); + if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 357, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 357, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_6); } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_6); - __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); + __pyx_t_3 = 0; /* "constraint/constraints.py":358 * else: @@ -10140,7 +9235,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * if isinstance(sum, float): - */ +*/ __pyx_t_13 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 358, __pyx_L1_error) if (__pyx_t_13) { @@ -10150,14 +9245,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * sum += assignments[variable] # <<<<<<<<<<<<<< * if isinstance(sum, float): * sum = round(sum, 10) - */ - __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_1); - __pyx_t_1 = 0; +*/ + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __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, 359, __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; /* "constraint/constraints.py":358 * else: @@ -10165,7 +9260,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * if isinstance(sum, float): - */ +*/ } /* "constraint/constraints.py":357 @@ -10174,9 +9269,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for variable in variables: # <<<<<<<<<<<<<< * if variable in assignments: * sum += assignments[variable] - */ +*/ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/constraints.py":360 * if variable in assignments: @@ -10184,7 +9279,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) * if sum > maxsum: - */ +*/ __pyx_t_13 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_13) { @@ -10194,18 +9289,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * sum = round(sum, 10) # <<<<<<<<<<<<<< * if sum > maxsum: * return False - */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_sum); - __Pyx_GIVEREF(__pyx_v_sum); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_sum)) __PYX_ERR(0, 361, __pyx_L1_error); - __Pyx_INCREF(__pyx_int_10); - __Pyx_GIVEREF(__pyx_int_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_10)) __PYX_ERR(0, 361, __pyx_L1_error); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +*/ + __pyx_t_4 = NULL; + __Pyx_INCREF(__pyx_builtin_round); + __pyx_t_3 = __pyx_builtin_round; + __pyx_t_5 = 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, 361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_1); __pyx_t_1 = 0; @@ -10215,7 +9311,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) * if sum > maxsum: - */ +*/ } /* "constraint/constraints.py":362 @@ -10224,7 +9320,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if sum > maxsum: # <<<<<<<<<<<<<< * return False * if forwardcheck: - */ +*/ __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, 362, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10236,7 +9332,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * return False # <<<<<<<<<<<<<< * if forwardcheck: * for variable in variables: - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -10248,7 +9344,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if sum > maxsum: # <<<<<<<<<<<<<< * return False * if forwardcheck: - */ +*/ } /* "constraint/constraints.py":364 @@ -10257,7 +9353,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if forwardcheck: # <<<<<<<<<<<<<< * 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, 364, __pyx_L1_error) if (__pyx_t_13) { @@ -10267,59 +9363,56 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * 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_4 = 0; - __pyx_t_5 = NULL; + __pyx_t_6 = 0; + __pyx_t_7 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 365, __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, 365, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_5)) { + 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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 365, __pyx_L1_error) #endif - if (__pyx_t_4 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 365, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 365, __pyx_L1_error) #endif - if (__pyx_t_4 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 365, __pyx_L1_error) + __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_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); #endif + ++__pyx_t_6; } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_5(__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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 365, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 365, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_3); } + __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); __pyx_t_3 = 0; @@ -10329,7 +9422,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * 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, 366, __pyx_L1_error) if (__pyx_t_13) { @@ -10339,7 +9432,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * 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, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); @@ -10351,62 +9444,59 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * 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_slice_, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __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, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); - __pyx_t_10 = 0; - __pyx_t_11 = NULL; + __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); + __pyx_t_11 = 0; + __pyx_t_12 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __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, 368, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { - if (likely(!__pyx_t_11)) { - if (likely(PyList_CheckExact(__pyx_t_6))) { + if (likely(!__pyx_t_12)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 368, __pyx_L1_error) #endif - if (__pyx_t_10 >= __pyx_temp) break; + if (__pyx_t_11 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 368, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif + __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_6); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 368, __pyx_L1_error) #endif - if (__pyx_t_10 >= __pyx_temp) break; + if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); #endif + ++__pyx_t_11; } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_11(__pyx_t_6); + __pyx_t_3 = __pyx_t_12(__pyx_t_4); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 368, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 368, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_3); } + __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); __pyx_t_3 = 0; @@ -10416,13 +9506,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * 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, 369, __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, 369, __pyx_L1_error) + __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, 369, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 369, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_13) { /* "constraint/constraints.py":370 @@ -10431,32 +9521,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = NULL; - __pyx_t_12 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_12 = 1; - } - } - #endif +*/ + __pyx_t_3 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_value}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 370, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "constraint/constraints.py":369 * domain = domains[variable] @@ -10464,7 +9540,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if sum + value > maxsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ +*/ } /* "constraint/constraints.py":368 @@ -10473,9 +9549,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for value in domain[:]: # <<<<<<<<<<<<<< * if sum + value > maxsum: * domain.hideValue(value) - */ +*/ } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":371 * if sum + value > maxsum: @@ -10483,7 +9559,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * 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, 371, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_13); if (__pyx_t_2) { @@ -10494,7 +9570,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * return False # <<<<<<<<<<<<<< * return True * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -10507,7 +9583,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if not domain: # <<<<<<<<<<<<<< * return False * return True - */ +*/ } /* "constraint/constraints.py":366 @@ -10516,7 +9592,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ } /* "constraint/constraints.py":365 @@ -10525,7 +9601,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10535,7 +9611,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if forwardcheck: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: - */ +*/ } } __pyx_L3:; @@ -10546,7 +9622,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * return True # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; @@ -10558,15 +9634,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers * maxsum = self._maxsum - */ +*/ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("constraint.constraints.MaxSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -10588,7 +9664,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_18ExactSumConstraint_1__init__(PyObject *__pyx_self, @@ -10599,7 +9675,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_18ExactSumConstraint___init__, "Initialization method.\n\n Args:\n exactsum (number): Value to be considered as the exact sum\n multipliers (sequence of numbers): If given, variable values\n will be multiplied by the given factors before being\n summed to be checked\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_18ExactSumConstraint_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18ExactSumConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_18ExactSumConstraint___init__}; +static PyMethodDef __pyx_mdef_10constraint_11constraints_18ExactSumConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18ExactSumConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_18ExactSumConstraint___init__}; static PyObject *__pyx_pw_10constraint_11constraints_18ExactSumConstraint_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -10622,7 +9698,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -10630,60 +9706,47 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_exactsum,&__pyx_n_s_multipliers,0}; - values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 387, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 387, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 387, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 387, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exactsum)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 387, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_multipliers); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 387, __pyx_L3_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, 387, __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, 387, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 387, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 387, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 387, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } + if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); } __pyx_v_self = values[0]; __pyx_v_exactsum = values[1]; @@ -10695,11 +9758,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.ExactSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -10708,11 +9768,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_11constraints_18ExactSumConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_exactsum, __pyx_v_multipliers); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -10724,7 +9781,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint___init int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/constraints.py":396 * summed to be checked @@ -10732,8 +9789,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint___init * self._exactsum = exactsum # <<<<<<<<<<<<<< * self._multipliers = multipliers * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_exactsum_2, __pyx_v_exactsum) < 0) __PYX_ERR(0, 396, __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, 396, __pyx_L1_error) /* "constraint/constraints.py":397 * """ @@ -10741,8 +9798,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint___init * self._multipliers = multipliers # <<<<<<<<<<<<<< * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_multipliers_2, __pyx_v_multipliers) < 0) __PYX_ERR(0, 397, __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, 397, __pyx_L1_error) /* "constraint/constraints.py":387 * """ @@ -10750,7 +9807,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint___init * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -10770,7 +9827,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint___init * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * multipliers = self._multipliers - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_18ExactSumConstraint_3preProcess(PyObject *__pyx_self, @@ -10780,7 +9837,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_11constraints_18ExactSumConstraint_3preProcess = {"preProcess", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18ExactSumConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_11constraints_18ExactSumConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18ExactSumConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_11constraints_18ExactSumConstraint_3preProcess(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -10805,7 +9862,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("preProcess (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -10813,85 +9870,52 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 399, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 399, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 399, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 399, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 399, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 399, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 399, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 399, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 1); __PYX_ERR(0, 399, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 399, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 2); __PYX_ERR(0, 399, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 399, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 3); __PYX_ERR(0, 399, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 399, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 4); __PYX_ERR(0, 399, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "preProcess") < 0)) __PYX_ERR(0, 399, __pyx_L3_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, 399, __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, 399, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 399, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 399, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 399, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 399, __pyx_L3_error) + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 399, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -10905,32 +9929,31 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.ExactSumConstraint.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", 1))) __PYX_ERR(0, 399, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 399, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 399, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 399, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 399, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 399, __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 */ 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -10947,11 +9970,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; - int __pyx_t_5; - Py_ssize_t __pyx_t_6; - PyObject *(*__pyx_t_7)(PyObject *); - PyObject *__pyx_t_8 = 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)(PyObject *); Py_ssize_t __pyx_t_11; @@ -10959,7 +9982,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("preProcess", 1); + __Pyx_RefNannySetupContext("preProcess", 0); /* "constraint/constraints.py":400 * @@ -10967,33 +9990,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< * multipliers = self._multipliers * exactsum = self._exactsum - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_preProcess); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +*/ __pyx_t_2 = NULL; - __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __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, 400, __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_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } + 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(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 5+__pyx_t_4); + __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_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, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11003,8 +10025,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * multipliers = self._multipliers # <<<<<<<<<<<<<< * exactsum = self._exactsum * if multipliers: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __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, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; @@ -11015,8 +10037,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * exactsum = self._exactsum # <<<<<<<<<<<<<< * if multipliers: * for variable, multiplier in zip(variables, multipliers): - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_exactsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __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, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_exactsum = __pyx_t_1; __pyx_t_1 = 0; @@ -11027,9 +10049,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * domain = domains[variable] - */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 403, __pyx_L1_error) - if (__pyx_t_5) { +*/ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 403, __pyx_L1_error) + if (__pyx_t_6) { /* "constraint/constraints.py":404 * exactsum = self._exactsum @@ -11037,73 +10059,71 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_variables); - __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_variables)) __PYX_ERR(0, 404, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_multipliers); - __Pyx_GIVEREF(__pyx_v_multipliers); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_multipliers)) __PYX_ERR(0, 404, __pyx_L1_error); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - 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_6 = 0; - __pyx_t_7 = NULL; - } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) +*/ + __pyx_t_4 = NULL; + __Pyx_INCREF(__pyx_builtin_zip); + __pyx_t_2 = __pyx_builtin_zip; + __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, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 404, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + 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, 404, __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, 404, __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); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 404, __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_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 404, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_7); + ++__pyx_t_7; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 404, __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_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); #endif + ++__pyx_t_7; } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_7(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { + __pyx_t_1 = __pyx_t_8(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 404, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 404, __pyx_L1_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; + __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); @@ -11112,31 +10132,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_8 = 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_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_8 = PyList_GET_ITEM(sequence, 1); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 404, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_8); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 404, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); #endif - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); - index = 0; __pyx_t_2 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - 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); + __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_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 404, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -11148,10 +10172,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __PYX_ERR(0, 404, __pyx_L1_error) __pyx_L7_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_2); - __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); - __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_3); + __pyx_t_3 = 0; /* "constraint/constraints.py":405 * if multipliers: @@ -11159,11 +10183,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if value * multiplier > exactsum: - */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); - __pyx_t_3 = 0; +*/ + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; /* "constraint/constraints.py":406 * for variable, multiplier in zip(variables, multipliers): @@ -11171,64 +10195,61 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * for value in domain[:]: # <<<<<<<<<<<<<< * if value * multiplier > exactsum: * domain.remove(value) - */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __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_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, 406, __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_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 406, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __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, 406, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_8))) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 406, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 406, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif + __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_8); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 406, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); #endif + ++__pyx_t_11; } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_12(__pyx_t_8); - if (unlikely(!__pyx_t_3)) { + __pyx_t_1 = __pyx_t_12(__pyx_t_3); + if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 406, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 406, __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_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; /* "constraint/constraints.py":407 * domain = domains[variable] @@ -11236,14 +10257,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * if value * multiplier > exactsum: # <<<<<<<<<<<<<< * domain.remove(value) * else: - */ - __pyx_t_3 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 407, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_5) { +*/ + __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __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, 407, __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, 407, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { /* "constraint/constraints.py":408 * for value in domain[:]: @@ -11251,32 +10272,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * domain.remove(value) # <<<<<<<<<<<<<< * else: * for variable in variables: - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 408, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + __pyx_t_1 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_value}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":407 * domain = domains[variable] @@ -11284,7 +10291,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * if value * multiplier > exactsum: # <<<<<<<<<<<<<< * domain.remove(value) * else: - */ +*/ } /* "constraint/constraints.py":406 @@ -11293,9 +10300,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * for value in domain[:]: # <<<<<<<<<<<<<< * if value * multiplier > exactsum: * domain.remove(value) - */ +*/ } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/constraints.py":404 * exactsum = self._exactsum @@ -11303,9 +10310,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/constraints.py":403 * multipliers = self._multipliers @@ -11313,7 +10320,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * domain = domains[variable] - */ +*/ goto __pyx_L3; } @@ -11323,62 +10330,59 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * for variable in variables: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ /*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_2 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + __pyx_t_8 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __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, 410, __pyx_L1_error) } 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); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 410, __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_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 410, __pyx_L1_error) - #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 410, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - #endif + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_7); + ++__pyx_t_7; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 410, __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_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7)); #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 410, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); #endif + ++__pyx_t_7; } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L1_error) } else { - __pyx_t_8 = __pyx_t_7(__pyx_t_1); - if (unlikely(!__pyx_t_8)) { + __pyx_t_3 = __pyx_t_8(__pyx_t_2); + if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 410, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 410, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_8); } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_8); - __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); + __pyx_t_3 = 0; /* "constraint/constraints.py":411 * else: @@ -11386,11 +10390,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if value > exactsum: - */ - __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_8); - __pyx_t_8 = 0; +*/ + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); + __pyx_t_3 = 0; /* "constraint/constraints.py":412 * for variable in variables: @@ -11398,64 +10402,61 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * for value in domain[:]: # <<<<<<<<<<<<<< * if value > exactsum: * domain.remove(value) - */ - __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { - __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2); - __pyx_t_11 = 0; +*/ + __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, 412, __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; } else { - __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __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, 412, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + 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) #endif if (__pyx_t_11 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 412, __pyx_L1_error) - #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - #endif + __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_2); - #if !CYTHON_ASSUME_SAFE_MACROS + 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) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11)); #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); #endif + ++__pyx_t_11; } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 412, __pyx_L1_error) } else { - __pyx_t_8 = __pyx_t_12(__pyx_t_2); - if (unlikely(!__pyx_t_8)) { + __pyx_t_3 = __pyx_t_12(__pyx_t_4); + if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 412, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 412, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_8); } - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8); - __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); + __pyx_t_3 = 0; /* "constraint/constraints.py":413 * domain = domains[variable] @@ -11463,11 +10464,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * if value > exactsum: # <<<<<<<<<<<<<< * domain.remove(value) * - */ - __pyx_t_8 = PyObject_RichCompare(__pyx_v_value, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 413, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 413, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__pyx_t_5) { +*/ + __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, 413, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 413, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { /* "constraint/constraints.py":414 * for value in domain[:]: @@ -11475,32 +10476,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * domain.remove(value) # <<<<<<<<<<<<<< * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + __pyx_t_1 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_value}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 414, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/constraints.py":413 * domain = domains[variable] @@ -11508,7 +10495,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * if value > exactsum: # <<<<<<<<<<<<<< * domain.remove(value) * - */ +*/ } /* "constraint/constraints.py":412 @@ -11517,9 +10504,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * for value in domain[:]: # <<<<<<<<<<<<<< * if value > exactsum: * domain.remove(value) - */ +*/ } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":410 * domain.remove(value) @@ -11527,9 +10514,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * for variable in variables: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L3:; @@ -11539,7 +10526,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * multipliers = self._multipliers - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -11548,7 +10535,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_8); + __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; @@ -11570,7 +10557,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers * exactsum = self._exactsum - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_18ExactSumConstraint_5__call__(PyObject *__pyx_self, @@ -11580,7 +10567,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_11constraints_18ExactSumConstraint_5__call__ = {"__call__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18ExactSumConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_11constraints_18ExactSumConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18ExactSumConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_11constraints_18ExactSumConstraint_5__call__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -11605,7 +10592,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -11613,86 +10600,59 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,0}; - values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 416, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 416, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 416, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 416, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 416, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 1); __PYX_ERR(0, 416, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 2); __PYX_ERR(0, 416, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 3); __PYX_ERR(0, 416, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(0, 416, __pyx_L3_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, 416, __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, 416, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 416, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 416, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 416, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 416, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 416, __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]; @@ -11706,31 +10666,30 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.ExactSumConstraint.__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", 1))) __PYX_ERR(0, 416, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 416, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 416, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 416, __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 */ 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -11749,20 +10708,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *(*__pyx_t_5)(PyObject *); - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_4 = NULL; + 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)(PyObject *); - int __pyx_t_10; - Py_ssize_t __pyx_t_11; - PyObject *(*__pyx_t_12)(PyObject *); - unsigned int __pyx_t_13; + PyObject *__pyx_t_9 = NULL; + PyObject *(*__pyx_t_10)(PyObject *); + 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__", 1); + __Pyx_RefNannySetupContext("__call__", 0); /* "constraint/constraints.py":417 * @@ -11770,8 +10729,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * multipliers = self._multipliers # <<<<<<<<<<<<<< * exactsum = self._exactsum * sum = 0 - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __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, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; @@ -11782,8 +10741,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * exactsum = self._exactsum # <<<<<<<<<<<<<< * sum = 0 * missing = False - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_exactsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __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, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_exactsum = __pyx_t_1; __pyx_t_1 = 0; @@ -11794,9 +10753,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * sum = 0 # <<<<<<<<<<<<<< * missing = False * if multipliers: - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_sum = __pyx_int_0; +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; /* "constraint/constraints.py":420 * exactsum = self._exactsum @@ -11804,7 +10763,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * missing = False # <<<<<<<<<<<<<< * if multipliers: * for variable, multiplier in zip(variables, multipliers): - */ +*/ __pyx_v_missing = 0; /* "constraint/constraints.py":421 @@ -11813,7 +10772,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * 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, 421, __pyx_L1_error) if (__pyx_t_2) { @@ -11823,73 +10782,71 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable in assignments: * sum += assignments[variable] * multiplier - */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_variables); - __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_variables)) __PYX_ERR(0, 422, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_multipliers); - __Pyx_GIVEREF(__pyx_v_multipliers); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_multipliers)) __PYX_ERR(0, 422, __pyx_L1_error); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - 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, 422, __pyx_L1_error) +*/ + __pyx_t_3 = NULL; + __Pyx_INCREF(__pyx_builtin_zip); + __pyx_t_4 = __pyx_builtin_zip; + __pyx_t_5 = 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_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, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 422, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + 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; + } else { + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __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, 422, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 422, __pyx_L1_error) #endif - if (__pyx_t_4 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 422, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_6); + ++__pyx_t_6; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 422, __pyx_L1_error) #endif - if (__pyx_t_4 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); #endif + ++__pyx_t_6; } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_5(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { + __pyx_t_1 = __pyx_t_7(__pyx_t_4); + if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 422, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 422, __pyx_L1_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; + __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); @@ -11898,46 +10855,50 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_6 = PyList_GET_ITEM(sequence, 0); - __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); } - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); #endif - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 422, __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_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); - index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_6); - index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 422, __pyx_L1_error) - __pyx_t_9 = NULL; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 422, __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_8); __pyx_t_8 = 0; - __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 422, __pyx_L1_error) __pyx_L7_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_6); - __pyx_t_6 = 0; - __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_7); - __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); + __pyx_t_8 = 0; /* "constraint/constraints.py":423 * if multipliers: @@ -11945,7 +10906,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * 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, 423, __pyx_L1_error) if (__pyx_t_2) { @@ -11955,17 +10916,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< * else: * missing = True - */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyNumber_Multiply(__pyx_t_3, __pyx_v_multiplier); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 424, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_3); - __pyx_t_3 = 0; +*/ + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __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, 424, __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, 424, __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":423 * if multipliers: @@ -11973,7 +10934,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * multiplier * else: - */ +*/ goto __pyx_L8; } @@ -11983,7 +10944,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * missing = True # <<<<<<<<<<<<<< * if isinstance(sum, float): * sum = round(sum, 10) - */ +*/ /*else*/ { __pyx_v_missing = 1; } @@ -11995,9 +10956,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable in assignments: * sum += assignments[variable] * multiplier - */ +*/ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":427 * else: @@ -12005,7 +10966,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) * if sum > exactsum: - */ +*/ __pyx_t_2 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_2) { @@ -12015,20 +10976,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * sum = round(sum, 10) # <<<<<<<<<<<<<< * if sum > exactsum: * return False - */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_sum); - __Pyx_GIVEREF(__pyx_v_sum); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sum)) __PYX_ERR(0, 428, __pyx_L1_error); - __Pyx_INCREF(__pyx_int_10); - __Pyx_GIVEREF(__pyx_int_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_10)) __PYX_ERR(0, 428, __pyx_L1_error); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_3); - __pyx_t_3 = 0; +*/ + __pyx_t_1 = NULL; + __Pyx_INCREF(__pyx_builtin_round); + __pyx_t_8 = __pyx_builtin_round; + __pyx_t_5 = 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, 428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_4); + __pyx_t_4 = 0; /* "constraint/constraints.py":427 * else: @@ -12036,7 +10998,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) * if sum > exactsum: - */ +*/ } /* "constraint/constraints.py":429 @@ -12045,10 +11007,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if sum > exactsum: # <<<<<<<<<<<<<< * return False * if forwardcheck and missing: - */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_sum, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 429, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +*/ + __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, 429, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 429, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "constraint/constraints.py":430 @@ -12057,7 +11019,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * return False # <<<<<<<<<<<<<< * if forwardcheck and missing: * for variable, multiplier in zip(variables, multipliers): - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -12069,7 +11031,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if sum > exactsum: # <<<<<<<<<<<<<< * return False * if forwardcheck and missing: - */ +*/ } /* "constraint/constraints.py":431 @@ -12078,11 +11040,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if forwardcheck and missing: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: - */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 431, __pyx_L1_error) - if (__pyx_t_10) { +*/ + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 431, __pyx_L1_error) + if (__pyx_t_11) { } else { - __pyx_t_2 = __pyx_t_10; + __pyx_t_2 = __pyx_t_11; goto __pyx_L13_bool_binop_done; } __pyx_t_2 = __pyx_v_missing; @@ -12095,73 +11057,71 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_variables); - __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variables)) __PYX_ERR(0, 432, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_multipliers); - __Pyx_GIVEREF(__pyx_v_multipliers); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_multipliers)) __PYX_ERR(0, 432, __pyx_L1_error); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - 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_4 = 0; - __pyx_t_5 = NULL; +*/ + __pyx_t_8 = NULL; + __Pyx_INCREF(__pyx_builtin_zip); + __pyx_t_1 = __pyx_builtin_zip; + __pyx_t_5 = 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, 432, __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_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __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, 432, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 432, __pyx_L1_error) #endif - if (__pyx_t_4 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 432, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + ++__pyx_t_6; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 432, __pyx_L1_error) #endif - if (__pyx_t_4 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); #endif + ++__pyx_t_6; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_5(__pyx_t_3); - if (unlikely(!__pyx_t_1)) { + __pyx_t_4 = __pyx_t_7(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 432, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 432, __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; + __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); @@ -12170,46 +11130,50 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + __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); } else { - __pyx_t_7 = PyList_GET_ITEM(sequence, 0); - __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); } - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 432, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); #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_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); - index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L17_unpacking_failed; - __Pyx_GOTREF(__pyx_t_7); - index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L17_unpacking_failed; - __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 432, __pyx_L1_error) - __pyx_t_9 = NULL; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + 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, 432, __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:; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 432, __pyx_L1_error) __pyx_L18_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_7); - __pyx_t_7 = 0; - __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_6); - __pyx_t_6 = 0; + __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; /* "constraint/constraints.py":433 * if forwardcheck and missing: @@ -12217,7 +11181,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * 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, 433, __pyx_L1_error) if (__pyx_t_2) { @@ -12227,11 +11191,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if sum + value * multiplier > exactsum: - */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); - __pyx_t_1 = 0; +*/ + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); + __pyx_t_4 = 0; /* "constraint/constraints.py":435 * if variable not in assignments: @@ -12239,64 +11203,61 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for value in domain[:]: # <<<<<<<<<<<<<< * if sum + value * multiplier > exactsum: * domain.hideValue(value) - */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __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_11 = 0; - __pyx_t_12 = NULL; +*/ + __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, 435, __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_12 = 0; + __pyx_t_13 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 435, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 435, __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, 435, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { - if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_6))) { + if (likely(!__pyx_t_13)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + 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) #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_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 435, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12); + ++__pyx_t_12; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + 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) #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_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); #endif + ++__pyx_t_12; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_12(__pyx_t_6); - if (unlikely(!__pyx_t_1)) { + __pyx_t_4 = __pyx_t_13(__pyx_t_3); + if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 435, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 435, __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_4); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); + __pyx_t_4 = 0; /* "constraint/constraints.py":436 * domain = domains[variable] @@ -12304,16 +11265,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if sum + value * multiplier > exactsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ - __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyNumber_Add(__pyx_v_sum, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __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, 436, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 436, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +*/ + __pyx_t_4 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __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, 436, __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, 436, __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, 436, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "constraint/constraints.py":437 @@ -12322,32 +11283,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 437, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = NULL; - __pyx_t_13 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_13 = 1; - } - } - #endif +*/ + __pyx_t_8 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_value}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13); + __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_1)) __PYX_ERR(0, 437, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":436 * domain = domains[variable] @@ -12355,7 +11302,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if sum + value * multiplier > exactsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ +*/ } /* "constraint/constraints.py":435 @@ -12364,9 +11311,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for value in domain[:]: # <<<<<<<<<<<<<< * if sum + value * multiplier > exactsum: * domain.hideValue(value) - */ +*/ } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/constraints.py":438 * if sum + value * multiplier > exactsum: @@ -12374,10 +11321,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if not domain: # <<<<<<<<<<<<<< * return False * else: - */ +*/ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 438, __pyx_L1_error) - __pyx_t_10 = (!__pyx_t_2); - if (__pyx_t_10) { + __pyx_t_11 = (!__pyx_t_2); + if (__pyx_t_11) { /* "constraint/constraints.py":439 * domain.hideValue(value) @@ -12385,11 +11332,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * return False # <<<<<<<<<<<<<< * else: * for variable in variables: - */ +*/ __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_1); __pyx_t_1 = 0; goto __pyx_L0; /* "constraint/constraints.py":438 @@ -12398,7 +11345,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if not domain: # <<<<<<<<<<<<<< * return False * else: - */ +*/ } /* "constraint/constraints.py":433 @@ -12407,7 +11354,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ } /* "constraint/constraints.py":432 @@ -12416,9 +11363,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/constraints.py":431 * if sum > exactsum: @@ -12426,7 +11373,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if forwardcheck and missing: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: - */ +*/ } /* "constraint/constraints.py":421 @@ -12435,7 +11382,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: - */ +*/ goto __pyx_L3; } @@ -12445,62 +11392,59 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for variable in variables: # <<<<<<<<<<<<<< * if variable in assignments: * sum += assignments[variable] - */ +*/ /*else*/ { 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_4 = 0; - __pyx_t_5 = NULL; + __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); + __pyx_t_6 = 0; + __pyx_t_7 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __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, 441, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 441, __pyx_L1_error) #endif - if (__pyx_t_4 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 441, __pyx_L1_error) - #else - __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - #endif + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + ++__pyx_t_6; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 441, __pyx_L1_error) #endif - if (__pyx_t_4 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); #else - __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); #endif + ++__pyx_t_6; } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error) } else { - __pyx_t_6 = __pyx_t_5(__pyx_t_3); - if (unlikely(!__pyx_t_6)) { + __pyx_t_3 = __pyx_t_7(__pyx_t_1); + if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 441, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 441, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_6); } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_6); - __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); + __pyx_t_3 = 0; /* "constraint/constraints.py":442 * else: @@ -12508,9 +11452,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if variable in assignments: # <<<<<<<<<<<<<< * sum += 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, 442, __pyx_L1_error) - if (__pyx_t_10) { +*/ + __pyx_t_11 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 442, __pyx_L1_error) + if (__pyx_t_11) { /* "constraint/constraints.py":443 * for variable in variables: @@ -12518,14 +11462,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * sum += assignments[variable] # <<<<<<<<<<<<<< * else: * missing = True - */ - __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 443, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_1); - __pyx_t_1 = 0; +*/ + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __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, 443, __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; /* "constraint/constraints.py":442 * else: @@ -12533,7 +11477,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * else: - */ +*/ goto __pyx_L28; } @@ -12543,7 +11487,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * missing = True # <<<<<<<<<<<<<< * if isinstance(sum, float): * sum = round(sum, 10) - */ +*/ /*else*/ { __pyx_v_missing = 1; } @@ -12555,9 +11499,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for variable in variables: # <<<<<<<<<<<<<< * if variable in assignments: * sum += assignments[variable] - */ +*/ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/constraints.py":446 * else: @@ -12565,9 +11509,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) * if sum > exactsum: - */ - __pyx_t_10 = PyFloat_Check(__pyx_v_sum); - if (__pyx_t_10) { +*/ + __pyx_t_11 = PyFloat_Check(__pyx_v_sum); + if (__pyx_t_11) { /* "constraint/constraints.py":447 * missing = True @@ -12575,18 +11519,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * sum = round(sum, 10) # <<<<<<<<<<<<<< * if sum > exactsum: * return False - */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_sum); - __Pyx_GIVEREF(__pyx_v_sum); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_sum)) __PYX_ERR(0, 447, __pyx_L1_error); - __Pyx_INCREF(__pyx_int_10); - __Pyx_GIVEREF(__pyx_int_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_10)) __PYX_ERR(0, 447, __pyx_L1_error); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +*/ + __pyx_t_4 = NULL; + __Pyx_INCREF(__pyx_builtin_round); + __pyx_t_3 = __pyx_builtin_round; + __pyx_t_5 = 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, 447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_1); __pyx_t_1 = 0; @@ -12596,7 +11541,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) * if sum > exactsum: - */ +*/ } /* "constraint/constraints.py":448 @@ -12605,11 +11550,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if sum > exactsum: # <<<<<<<<<<<<<< * return False * if forwardcheck and missing: - */ +*/ __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, 448, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_10) { + if (__pyx_t_11) { /* "constraint/constraints.py":449 * sum = round(sum, 10) @@ -12617,7 +11562,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * return False # <<<<<<<<<<<<<< * if forwardcheck and missing: * for variable in variables: - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -12629,7 +11574,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if sum > exactsum: # <<<<<<<<<<<<<< * return False * if forwardcheck and missing: - */ +*/ } /* "constraint/constraints.py":450 @@ -12638,16 +11583,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if forwardcheck and missing: # <<<<<<<<<<<<<< * 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, 450, __pyx_L1_error) if (__pyx_t_2) { } else { - __pyx_t_10 = __pyx_t_2; + __pyx_t_11 = __pyx_t_2; goto __pyx_L33_bool_binop_done; } - __pyx_t_10 = __pyx_v_missing; + __pyx_t_11 = __pyx_v_missing; __pyx_L33_bool_binop_done:; - if (__pyx_t_10) { + if (__pyx_t_11) { /* "constraint/constraints.py":451 * return False @@ -12655,59 +11600,56 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * 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_4 = 0; - __pyx_t_5 = NULL; + __pyx_t_6 = 0; + __pyx_t_7 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 451, __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, 451, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_5)) { + 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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 451, __pyx_L1_error) #endif - if (__pyx_t_4 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 451, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 451, __pyx_L1_error) #endif - if (__pyx_t_4 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 451, __pyx_L1_error) + __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_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); #endif + ++__pyx_t_6; } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_5(__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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 451, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 451, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_3); } + __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); __pyx_t_3 = 0; @@ -12717,9 +11659,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ - __pyx_t_10 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 452, __pyx_L1_error) - if (__pyx_t_10) { +*/ + __pyx_t_11 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 452, __pyx_L1_error) + if (__pyx_t_11) { /* "constraint/constraints.py":453 * for variable in variables: @@ -12727,7 +11669,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * 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, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); @@ -12739,62 +11681,59 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * 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_slice_, 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, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); - __pyx_t_11 = 0; - __pyx_t_12 = NULL; + __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); + __pyx_t_12 = 0; + __pyx_t_13 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 454, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 454, __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, 454, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { - if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_6))) { + if (likely(!__pyx_t_13)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 454, __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 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 454, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_12); + ++__pyx_t_12; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 454, __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 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12); #endif + ++__pyx_t_12; } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_12(__pyx_t_6); + __pyx_t_3 = __pyx_t_13(__pyx_t_4); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 454, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 454, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_3); } + __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); __pyx_t_3 = 0; @@ -12804,14 +11743,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * 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, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 455, __pyx_L1_error) + __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, 455, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 455, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_10) { + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 455, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_11) { /* "constraint/constraints.py":456 * for value in domain[:]: @@ -12819,32 +11758,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = NULL; - __pyx_t_13 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_13 = 1; - } - } - #endif +*/ + __pyx_t_3 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_value}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "constraint/constraints.py":455 * domain = domains[variable] @@ -12852,7 +11777,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if sum + value > exactsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ +*/ } /* "constraint/constraints.py":454 @@ -12861,9 +11786,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for value in domain[:]: # <<<<<<<<<<<<<< * if sum + value > exactsum: * domain.hideValue(value) - */ +*/ } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":457 * if sum + value > exactsum: @@ -12871,9 +11796,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if not domain: # <<<<<<<<<<<<<< * return False * if missing: - */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 457, __pyx_L1_error) - __pyx_t_2 = (!__pyx_t_10); +*/ + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_2 = (!__pyx_t_11); if (__pyx_t_2) { /* "constraint/constraints.py":458 @@ -12882,7 +11807,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * return False # <<<<<<<<<<<<<< * if missing: * return sum <= exactsum - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -12895,7 +11820,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if not domain: # <<<<<<<<<<<<<< * return False * if missing: - */ +*/ } /* "constraint/constraints.py":452 @@ -12904,7 +11829,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ } /* "constraint/constraints.py":451 @@ -12913,7 +11838,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -12923,7 +11848,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if forwardcheck and missing: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: - */ +*/ } } __pyx_L3:; @@ -12934,7 +11859,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if missing: # <<<<<<<<<<<<<< * return sum <= exactsum * else: - */ +*/ if (__pyx_v_missing) { /* "constraint/constraints.py":460 @@ -12943,7 +11868,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * return sum <= 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, 460, __pyx_L1_error) __pyx_r = __pyx_t_1; @@ -12956,7 +11881,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if missing: # <<<<<<<<<<<<<< * return sum <= exactsum * else: - */ +*/ } /* "constraint/constraints.py":462 @@ -12964,8 +11889,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * else: * return sum == exactsum # <<<<<<<<<<<<<< * - * - */ + * class VariableExactSumConstraint(Constraint): +*/ /*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, 462, __pyx_L1_error) @@ -12980,15 +11905,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers * exactsum = self._exactsum - */ +*/ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("constraint.constraints.ExactSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -13004,25 +11929,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal return __pyx_r; } -/* "constraint/constraints.py":476 +/* "constraint/constraints.py":475 * """ * - * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_16MinSumConstraint_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_1__init__(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_16MinSumConstraint___init__, "Initialization method.\n\n Args:\n minsum (number): Value to be considered as the minimum sum\n multipliers (sequence of numbers): If given, variable values\n will be multiplied by the given factors before being\n summed to be checked\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_16MinSumConstraint_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_16MinSumConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_16MinSumConstraint___init__}; -static PyObject *__pyx_pw_10constraint_11constraints_16MinSumConstraint_1__init__(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_26VariableExactSumConstraint___init__, "Initialization method.\n\n Args:\n target_var (Variable): The target variable to sum to.\n sum_vars (sequence of Variables): The variables to sum up.\n multipliers (sequence of numbers): If given, variable values\n (except the last) will be multiplied by the given factors before being\n summed to match the last variable.\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_26VariableExactSumConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_26VariableExactSumConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -13030,13 +11955,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_minsum = 0; + PyObject *__pyx_v_target_var = 0; + PyObject *__pyx_v_sum_vars = 0; PyObject *__pyx_v_multipliers = 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}; + PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -13044,7 +11970,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -13052,158 +11978,438 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_minsum,&__pyx_n_s_multipliers,0}; - values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 475, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 475, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 475, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 476, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 475, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_minsum)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 476, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 476, __pyx_L3_error) - } + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 475, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_multipliers); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 476, __pyx_L3_error) - } + case 0: break; + default: goto __pyx_L5_argtuple_error; } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 476, __pyx_L3_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, 475, __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, 475, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 475, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 475, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 475, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 475, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } + if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None)); } __pyx_v_self = values[0]; - __pyx_v_minsum = values[1]; - __pyx_v_multipliers = values[2]; + __pyx_v_target_var = ((PyObject*)values[1]); + __pyx_v_sum_vars = values[2]; + __pyx_v_multipliers = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 476, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 475, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_16MinSumConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_minsum, __pyx_v_multipliers); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 475, __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 */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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_26VariableExactSumConstraint_8__init___2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* 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) { +/* "constraint/constraints.py":491 + * 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." + * +*/ + +static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_8__init___genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_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("__init__", 1); + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 491, __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_26VariableExactSumConstraint_8__init___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___ini, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 491, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } - /* "constraint/constraints.py":485 - * summed to be checked - * """ - * self._minsum = minsum # <<<<<<<<<<<<<< - * self._multipliers = multipliers - * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_minsum_2, __pyx_v_minsum) < 0) __PYX_ERR(0, 485, __pyx_L1_error) + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.__init__.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_26VariableExactSumConstraint_8__init___2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_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_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, 491, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 491, __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, 491, __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, 491, __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, 491, __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, 491, __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, 491, __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, 491, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_m); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_m, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_6 = PyLong_Check(__pyx_cur_scope->__pyx_v_m); + if (!__pyx_t_6) { + } else { + __pyx_t_5 = __pyx_t_6; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_6 = PyFloat_Check(__pyx_cur_scope->__pyx_v_m); + __pyx_t_5 = __pyx_t_6; + __pyx_L7_bool_binop_done:; + __pyx_t_6 = (!__pyx_t_5); + if (__pyx_t_6) { + __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_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":475 + * """ + * + * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + +static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstraint___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_26VariableExactSumConstraint_8__init___2generator1 = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "constraint/constraints.py":485 + * 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, 485, __pyx_L1_error) /* "constraint/constraints.py":486 * """ - * self._minsum = minsum + * 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, 486, __pyx_L1_error) + + /* "constraint/constraints.py":487 + * self.target_var = target_var + * self.sum_vars = sum_vars * self._multipliers = multipliers # <<<<<<<<<<<<<< * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_multipliers_2, __pyx_v_multipliers) < 0) __PYX_ERR(0, 486, __pyx_L1_error) + * if multipliers: +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2, __pyx_v_multipliers) < 0) __PYX_ERR(0, 487, __pyx_L1_error) - /* "constraint/constraints.py":476 + /* "constraint/constraints.py":489 + * 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, 489, __pyx_L1_error) + if (__pyx_t_1) { + + /* "constraint/constraints.py":490 + * + * 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." +*/ + #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, 490, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 490, __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, 490, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 490, __pyx_L1_error) + #endif + + /* "constraint/constraints.py":491 + * 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." + * +*/ + #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, 491, __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, 491, __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, 491, __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, 491, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 491, __pyx_L1_error) + #endif + + /* "constraint/constraints.py":492 + * 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." # <<<<<<<<<<<<<< + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 +*/ + #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); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 492, __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, 492, __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, 492, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 492, __pyx_L1_error) + #endif + + /* "constraint/constraints.py":489 + * 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." +*/ + } + + /* "constraint/constraints.py":475 * """ * - * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.MinSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_8__init___2generator1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":488 - * self._multipliers = multipliers +/* "constraint/constraints.py":494 + * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." * - * 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) + * +*/ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_16MinSumConstraint_3__call__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_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_3__call__ = {"__call__", (PyCFunction)(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_26VariableExactSumConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_3preProcess(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -13212,9 +12418,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_variables = 0; - CYTHON_UNUSED PyObject *__pyx_v_domains = 0; - PyObject *__pyx_v_assignments = 0; - CYTHON_UNUSED PyObject *__pyx_v_forwardcheck = 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 @@ -13225,9 +12431,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + __Pyx_RefNannySetupContext("preProcess (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -13235,804 +12441,1303 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,0}; - values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 494, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 494, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 494, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 494, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 494, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 494, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 488, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 488, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 1); __PYX_ERR(0, 488, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 488, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 2); __PYX_ERR(0, 488, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 488, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 3); __PYX_ERR(0, 488, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 488, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(0, 488, __pyx_L3_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, 494, __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, 494, __pyx_L3_error) } } + } else if (unlikely(__pyx_nargs != 5)) { + goto __pyx_L5_argtuple_error; } else { - switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 494, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 494, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 494, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 494, __pyx_L3_error) + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 494, __pyx_L3_error) } __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_v_constraints = ((PyObject*)values[3]); + __pyx_v_vconstraints = ((PyObject*)values[4]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 488, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 494, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.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", 1))) __PYX_ERR(0, 488, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 488, __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, 494, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 494, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 494, __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 */ 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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_26VariableExactSumConstraint_10preProcess_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* 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) { - PyObject *__pyx_v_variable = NULL; - PyObject *__pyx_v_multipliers = NULL; - PyObject *__pyx_v_minsum = NULL; - PyObject *__pyx_v_sum = NULL; - PyObject *__pyx_v_multiplier = NULL; +/* "constraint/constraints.py":508 + * 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[:]: +*/ + +static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr *__pyx_cur_scope; 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; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *(*__pyx_t_9)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); - - /* "constraint/constraints.py":490 - * 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; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + 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, 508, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_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_26VariableExactSumConstraint_10preProcess_2generator2, ((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, 508, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.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_26VariableExactSumConstraint_10preProcess_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_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; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + size_t __pyx_t_9; + 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, 508, __pyx_L1_error) + } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 508, __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_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 490, __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, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 490, __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, 508, __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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 490, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 508, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 490, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 490, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 490, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 508, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 490, __pyx_L1_error) + __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); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 490, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif + ++__pyx_t_2; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 508, __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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 490, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 508, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_4); } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); + __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; - - /* "constraint/constraints.py":491 - * # 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, 491, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_var)) { __Pyx_RaiseClosureNameError("var"); __PYX_ERR(0, 508, __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, 508, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 508, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - - /* "constraint/constraints.py":492 - * 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":491 - * # check if each variable is in the assignments - * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< - * return True - * - */ + __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, 508, __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, 508, __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, 508, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = 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)); + __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, 508, __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, 508, __pyx_L1_error) } - - /* "constraint/constraints.py":490 - * 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; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "constraint/constraints.py":495 - * - * # with each variable assigned, sum the values - * multipliers = self._multipliers # <<<<<<<<<<<<<< - * minsum = self._minsum - * sum = 0 - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_multipliers = __pyx_t_1; - __pyx_t_1 = 0; + /* 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); + __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); + } + __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_11constraints_26VariableExactSumConstraint_10preProcess_5generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - /* "constraint/constraints.py":496 - * # with each variable assigned, sum the values - * multipliers = self._multipliers - * minsum = self._minsum # <<<<<<<<<<<<<< - * sum = 0 - * if multipliers: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_minsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_minsum = __pyx_t_1; - __pyx_t_1 = 0; +/* "constraint/constraints.py":509 + * 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]): +*/ - /* "constraint/constraints.py":497 - * multipliers = self._multipliers - * minsum = self._minsum - * sum = 0 # <<<<<<<<<<<<<< - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_sum = __pyx_int_0; +static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_3genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_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_4_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + 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, 509, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_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_26VariableExactSumConstraint_10preProcess_5generator3, ((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_VariableExactSumConstraint_prePr, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 509, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } - /* "constraint/constraints.py":498 - * minsum = self._minsum - * sum = 0 - * if multipliers: # <<<<<<<<<<<<<< - * for variable, multiplier in zip(variables, multipliers): - * sum += assignments[variable] * multiplier - */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 498, __pyx_L1_error) - if (__pyx_t_5) { + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.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; +} - /* "constraint/constraints.py":499 - * sum = 0 - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< - * sum += assignments[variable] * multiplier - * else: - */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error) +static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_5generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_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; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + size_t __pyx_t_9; + 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, 509, __pyx_L1_error) + } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 509, __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, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_variables); - __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_variables)) __PYX_ERR(0, 499, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_multipliers); - __Pyx_GIVEREF(__pyx_v_multipliers); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_multipliers)) __PYX_ERR(0, 499, __pyx_L1_error); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - 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 = 0; - __pyx_t_3 = NULL; + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __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, 509, __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, 509, __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, 509, __pyx_L1_error) } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_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, 509, __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_var)) { __Pyx_RaiseClosureNameError("var"); __PYX_ERR(0, 509, __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, 509, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 509, __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, 509, __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, 509, __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, 509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = 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)); + __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, 509, __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, 509, __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); + __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); + } + __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":494 + * 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) + * +*/ + +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) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *__pyx_cur_scope; + PyObject *__pyx_v_multipliers = NULL; + PyObject *__pyx_v_multiplier = NULL; + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_others_min = NULL; + PyObject *__pyx_v_others_max = NULL; + PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_2generator2 = 0; + PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_5generator3 = 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; + int __pyx_t_6; + 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_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_2_preProcess *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_preProcess(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_preProcess, __pyx_mstate_global->__pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 494, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_v_domains = __pyx_v_domains; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_domains); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_domains); + + /* "constraint/constraints.py":495 + * + * 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_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __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, 495, __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_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_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, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":497 + * 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, 497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_multipliers = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":499 + * 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, 499, __pyx_L1_error) + if (__pyx_t_6) { + + /* "constraint/constraints.py":500 + * + * if multipliers: + * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< + * domain = domains[var] + * 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, 500, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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)); + __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, 500, __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, 500, __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, 500, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_3)) { - 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); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 499, __pyx_L1_error) + 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, 500, __pyx_L1_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (__pyx_t_7 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 499, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_7); + ++__pyx_t_7; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 499, __pyx_L1_error) + 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, 500, __pyx_L1_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 499, __pyx_L1_error) + __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_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); #endif + ++__pyx_t_7; } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { + __pyx_t_1 = __pyx_t_8(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 499, __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_4); } - if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { - PyObject* sequence = __pyx_t_4; + __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, 499, __pyx_L1_error) + __PYX_ERR(0, 500, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __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_6 = PyList_GET_ITEM(sequence, 0); - __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 500, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); } - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 500, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); #endif - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); - index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L10_unpacking_failed; - __Pyx_GOTREF(__pyx_t_6); - index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L10_unpacking_failed; - __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 499, __pyx_L1_error) - __pyx_t_9 = NULL; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L11_unpacking_done; - __pyx_L10_unpacking_failed:; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_9 = NULL; + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 500, __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; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 500, __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; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 499, __pyx_L1_error) - __pyx_L11_unpacking_done:; + __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_L7_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_6); - __pyx_t_6 = 0; - __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_7); - __pyx_t_7 = 0; - - /* "constraint/constraints.py":500 - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): - * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< - * else: - * for variable in variables: - */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_v_multiplier); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 500, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_4); + __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_t_4 = 0; - /* "constraint/constraints.py":499 - * sum = 0 + /* "constraint/constraints.py":501 * if multipliers: - * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< - * sum += assignments[variable] * multiplier - * else: - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "constraint/constraints.py":498 - * minsum = self._minsum - * sum = 0 - * if multipliers: # <<<<<<<<<<<<<< - * for variable, multiplier in zip(variables, multipliers): - * sum += assignments[variable] * multiplier - */ - goto __pyx_L7; - } + * 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, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":502 - * sum += assignments[variable] * multiplier - * else: - * for variable in variables: # <<<<<<<<<<<<<< - * sum += assignments[variable] - * if isinstance(sum, float): - */ - /*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_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, 502, __pyx_L1_error) + /* "constraint/constraints.py":502 + * 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, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 502, __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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 502, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 502, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 502, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 502, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } + 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_11 = 0; + __pyx_t_12 = NULL; } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 502, __pyx_L1_error) - } - break; - } + __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __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, 502, __pyx_L1_error) } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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, 502, __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_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, 502, __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)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); + #endif + ++__pyx_t_11; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_12(__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, 502, __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":503 + /* "constraint/constraints.py":503 + * domain = domains[var] + * for value in domain[:]: + * if value * multiplier > max(domains[self.target_var]): # <<<<<<<<<<<<<< + * domain.remove(value) * else: - * for variable in variables: - * sum += assignments[variable] # <<<<<<<<<<<<<< - * if isinstance(sum, float): - * sum = round(sum, 10) - */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_7); - __pyx_t_7 = 0; +*/ + __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __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, 503, __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, 503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 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)); + __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, 503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } + __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, 503, __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, 503, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_6) { - /* "constraint/constraints.py":502 - * sum += assignments[variable] * multiplier + /* "constraint/constraints.py":504 + * for value in domain[:]: + * if value * multiplier > max(domains[self.target_var]): + * domain.remove(value) # <<<<<<<<<<<<<< * else: - * for variable in variables: # <<<<<<<<<<<<<< - * sum += assignments[variable] - * if isinstance(sum, float): - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L7:; + * for var in self.sum_vars: +*/ + __pyx_t_3 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_3); + __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, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + } + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "constraint/constraints.py":504 - * for variable in variables: - * sum += assignments[variable] - * if isinstance(sum, float): # <<<<<<<<<<<<<< - * sum = round(sum, 10) - * return sum >= minsum - */ - __pyx_t_5 = PyFloat_Check(__pyx_v_sum); - if (__pyx_t_5) { + /* "constraint/constraints.py":503 + * domain = domains[var] + * for value in domain[:]: + * if value * multiplier > max(domains[self.target_var]): # <<<<<<<<<<<<<< + * domain.remove(value) + * else: +*/ + } - /* "constraint/constraints.py":505 - * sum += assignments[variable] - * if isinstance(sum, float): - * sum = round(sum, 10) # <<<<<<<<<<<<<< - * return sum >= minsum + /* "constraint/constraints.py":502 + * 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_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":500 * - */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_sum); - __Pyx_GIVEREF(__pyx_v_sum); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sum)) __PYX_ERR(0, 505, __pyx_L1_error); - __Pyx_INCREF(__pyx_int_10); - __Pyx_GIVEREF(__pyx_int_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_10)) __PYX_ERR(0, 505, __pyx_L1_error); - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_7); - __pyx_t_7 = 0; + * if multipliers: + * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< + * domain = domains[var] + * for value in domain[:]: +*/ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":504 - * for variable in variables: - * sum += assignments[variable] - * if isinstance(sum, float): # <<<<<<<<<<<<<< - * sum = round(sum, 10) - * return sum >= minsum - */ + /* "constraint/constraints.py":499 + * multipliers = self._multipliers + * + * if multipliers: # <<<<<<<<<<<<<< + * for var, multiplier in zip(self.sum_vars, multipliers): + * domain = domains[var] +*/ + goto __pyx_L3; } /* "constraint/constraints.py":506 - * if isinstance(sum, float): - * sum = round(sum, 10) - * return sum >= minsum # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_sum, __pyx_v_minsum, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 506, __pyx_L1_error) - __pyx_r = __pyx_t_7; - __pyx_t_7 = 0; - goto __pyx_L0; - - /* "constraint/constraints.py":488 - * self._multipliers = multipliers - * - * 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: - */ + * domain.remove(value) + * 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) +*/ + /*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, 506, __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_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, 506, __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, 506, __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))) { + { + 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, 506, __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_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, 506, __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)); + #else + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); + #endif + ++__pyx_t_7; + } + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 506, __pyx_L1_error) + } else { + __pyx_t_2 = __pyx_t_8(__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, 506, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_var); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_var, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; - /* 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_7); - __Pyx_XDECREF(__pyx_t_8); - __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_multiplier); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "constraint/constraints.py":507 + * 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, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_2); + __pyx_t_2 = 0; -/* "constraint/constraints.py":512 - * """Constraint enforcing that values of given variables create a product up to at most a given amount.""" - * - * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< - * """Instantiate a MaxProdConstraint. - * - */ + /* "constraint/constraints.py":508 + * 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, 508, __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, 508, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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, 508, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_others_min, __pyx_t_2); + __pyx_t_2 = 0; -/* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_1__init__(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_17MaxProdConstraint___init__, "Instantiate a MaxProdConstraint.\n\n Args:\n maxprod: Value to be considered as the maximum product\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_17MaxProdConstraint_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MaxProdConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_17MaxProdConstraint___init__}; -static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_1__init__(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_maxprod = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __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 **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_maxprod,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; + /* "constraint/constraints.py":509 + * 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, 509, __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, 509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 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, 509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_maxprod)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 512, __pyx_L3_error) - } + __Pyx_XDECREF_SET(__pyx_v_others_max, __pyx_t_2); + __pyx_t_2 = 0; + + /* "constraint/constraints.py":510 + * 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, 510, __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_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, 510, __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, 510, __pyx_L1_error) } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 2)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - } - __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, 512, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_17MaxProdConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_maxprod); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (likely(!__pyx_t_12)) { + if (likely(PyList_CheckExact(__pyx_t_15))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_15); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 510, __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_11; + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_15); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 510, __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)); + #else + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_15, __pyx_t_11); + #endif + ++__pyx_t_11; + } + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error) + } else { + __pyx_t_2 = __pyx_t_12(__pyx_t_15); + 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, 510, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_2); + __pyx_t_2 = 0; - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "constraint/constraints.py":511 + * 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, 511, __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, 511, __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, 511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __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; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __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, 511, __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, 511, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_6) { -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 - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + /* "constraint/constraints.py":512 + * 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]): + * domain.remove(value) +*/ + __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_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_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + } + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "constraint/constraints.py":518 - * maxprod: Value to be considered as the maximum product - * """ - * self._maxprod = maxprod # <<<<<<<<<<<<<< + /* "constraint/constraints.py":511 + * 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]): +*/ + } + + /* "constraint/constraints.py":513 + * if value + others_min > max(domains[self.target_var]): + * domain.remove(value) + * if value + others_max < min(domains[self.target_var]): # <<<<<<<<<<<<<< + * domain.remove(value) * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_maxprod_2, __pyx_v_maxprod) < 0) __PYX_ERR(0, 518, __pyx_L1_error) +*/ + __pyx_t_13 = PyNumber_Add(__pyx_v_value, __pyx_v_others_max); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 513, __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, 513, __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, 513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_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, 513, __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, 513, __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, 513, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_6) { - /* "constraint/constraints.py":512 - * """Constraint enforcing that values of given variables create a product up to at most a given amount.""" + /* "constraint/constraints.py":514 + * domain.remove(value) + * if value + others_max < min(domains[self.target_var]): + * domain.remove(value) # <<<<<<<<<<<<<< * - * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< - * """Instantiate a MaxProdConstraint. + * 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_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_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 514, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + } + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + + /* "constraint/constraints.py":513 + * if value + others_min > max(domains[self.target_var]): + * domain.remove(value) + * if value + others_max < min(domains[self.target_var]): # <<<<<<<<<<<<<< + * domain.remove(value) * - */ +*/ + } + + /* "constraint/constraints.py":510 + * 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_DECREF(__pyx_t_15); __pyx_t_15 = 0; + + /* "constraint/constraints.py":506 + * domain.remove(value) + * 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) +*/ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "constraint/constraints.py":494 + * 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) + * +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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_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:; + __Pyx_XDECREF(__pyx_v_multipliers); + __Pyx_XDECREF(__pyx_v_multiplier); + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_others_min); + __Pyx_XDECREF(__pyx_v_others_max); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_2generator2); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_5generator3); + __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":520 - * self._maxprod = maxprod +/* "constraint/constraints.py":516 + * domain.remove(value) * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * multipliers = self._multipliers * - */ +*/ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_3preProcess(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_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_17MaxProdConstraint_3preProcess = {"preProcess", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MaxProdConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_3preProcess(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_26VariableExactSumConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_5__call__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -14040,10 +13745,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_variables = 0; + CYTHON_UNUSED PyObject *__pyx_v_variables = 0; PyObject *__pyx_v_domains = 0; - PyObject *__pyx_v_constraints = 0; - PyObject *__pyx_v_vconstraints = 0; + PyObject *__pyx_v_assignments = 0; + PyObject *__pyx_v_forwardcheck = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -14054,9 +13759,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("preProcess (wrapper)", 0); + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -14064,1648 +13769,1182 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 516, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 516, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 516, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 516, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 516, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 516, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + 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, 516, __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, 516, __pyx_L3_error) } + } + } else { switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 520, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 520, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 1); __PYX_ERR(0, 520, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 520, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 2); __PYX_ERR(0, 520, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 520, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 3); __PYX_ERR(0, 520, __pyx_L3_error) - } + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 516, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 520, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 4); __PYX_ERR(0, 520, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "preProcess") < 0)) __PYX_ERR(0, 520, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 516, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 516, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 516, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 516, __pyx_L3_error) + break; + default: goto __pyx_L5_argtuple_error; } - } else if (unlikely(__pyx_nargs != 5)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + 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_constraints = ((PyObject*)values[3]); - __pyx_v_vconstraints = ((PyObject*)values[4]); + __pyx_v_assignments = ((PyObject*)values[3]); + __pyx_v_forwardcheck = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 520, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 516, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.MaxProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.__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", 1))) __PYX_ERR(0, 520, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 520, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 520, __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); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 516, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 516, __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 */ 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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_17MaxProdConstraint_10preProcess_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "constraint/constraints.py":527 - * variable_with_lt1 = None - * for variable in variables: - * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< - * variable_contains_lt1.append(contains_lt1) - * if contains_lt1 is True: - */ -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_1_genexpr *__pyx_cur_scope; +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) { + PyObject *__pyx_v_multipliers = NULL; + PyObject *__pyx_v_target_value = NULL; + PyObject *__pyx_v_sum_value = NULL; + int __pyx_v_missing; + PyObject *__pyx_v_var = NULL; + PyObject *__pyx_v_multiplier = NULL; + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_temp_sum = NULL; 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_1_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_genexpr(__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 527, __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_10preProcess_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_MaxProdConstraint_preProcess_loc, __pyx_n_s_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.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_17MaxProdConstraint_10preProcess_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *)__pyx_generator->closure); - PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *(*__pyx_t_3)(PyObject *); + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; + PyObject *__pyx_t_5 = NULL; + size_t __pyx_t_6; + 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 *); + int __pyx_t_13; 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, 527, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 527, __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, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 527, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 527, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 527, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 527, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 527, __pyx_L1_error) - } - 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_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 527, __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); + __Pyx_RefNannySetupContext("__call__", 0); - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __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":517 + * + * 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, 517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_multipliers = __pyx_t_1; + __pyx_t_1 = 0; -/* "constraint/constraints.py":520 - * self._maxprod = maxprod + /* "constraint/constraints.py":519 + * multipliers = self._multipliers * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * 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, 519, __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, 519, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { -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) { - PyObject *__pyx_v_variable_contains_lt1 = 0; - PyObject *__pyx_v_variable_with_lt1 = NULL; - PyObject *__pyx_v_variable = NULL; - PyObject *__pyx_v_contains_lt1 = NULL; - PyObject *__pyx_v_maxprod = NULL; - PyObject *__pyx_v_domain = NULL; - PyObject *__pyx_v_value = NULL; - PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator1 = 0; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; - Py_ssize_t __pyx_t_5; - PyObject *(*__pyx_t_6)(PyObject *); - int __pyx_t_7; - int __pyx_t_8; - int __pyx_t_9; - Py_ssize_t __pyx_t_10; - PyObject *(*__pyx_t_11)(PyObject *); - PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("preProcess", 1); + /* "constraint/constraints.py":520 + * + * if self.target_var not in assignments: + * return True # can't evaluate without target, defer to later # <<<<<<<<<<<<<< + * + * target_value = assignments[self.target_var] +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; - /* "constraint/constraints.py":521 + /* "constraint/constraints.py":519 + * multipliers = self._multipliers * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< + * if self.target_var not in assignments: # <<<<<<<<<<<<<< + * return True # can't evaluate without target, defer to later * - * # check if there are any values less than 1 in the associated variables - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 521, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_preProcess); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 521, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } - } - #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_3, __pyx_callargs+1-__pyx_t_4, 5+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 521, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +*/ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":524 + /* "constraint/constraints.py":522 + * return True # can't evaluate without target, defer to later * - * # check if there are any values less than 1 in the associated variables - * 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, 524, __pyx_L1_error) + * 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, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_variable_contains_lt1 = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 522, __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":525 - * # check if there are any values less than 1 in the associated variables - * variable_contains_lt1: list[bool] = list() - * variable_with_lt1 = None # <<<<<<<<<<<<<< - * for variable in variables: - * contains_lt1 = any(value < 1 for value in domains[variable]) - */ - __Pyx_INCREF(Py_None); - __pyx_v_variable_with_lt1 = Py_None; + /* "constraint/constraints.py":523 + * + * target_value = assignments[self.target_var] + * sum_value = 0 # <<<<<<<<<<<<<< + * missing = False + * +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_sum_value = __pyx_mstate_global->__pyx_int_0; + + /* "constraint/constraints.py":524 + * target_value = assignments[self.target_var] + * sum_value = 0 + * missing = False # <<<<<<<<<<<<<< + * + * if multipliers: +*/ + __pyx_v_missing = 0; /* "constraint/constraints.py":526 - * variable_contains_lt1: list[bool] = list() - * variable_with_lt1 = None - * for variable in variables: # <<<<<<<<<<<<<< - * contains_lt1 = any(value < 1 for value in domains[variable]) - * variable_contains_lt1.append(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_5 = 0; - __pyx_t_6 = NULL; - } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 526, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_6)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 526, __pyx_L1_error) + * 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, 526, __pyx_L1_error) + if (__pyx_t_2) { + + /* "constraint/constraints.py":527 + * + * if multipliers: + * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< + * if var in assignments: + * 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, 527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = 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)); + __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, 527, __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; + } else { + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __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, 527, __pyx_L1_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, 527, __pyx_L1_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_7); + ++__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, 527, __pyx_L1_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 - if (__pyx_t_5 >= __pyx_temp) break; + ++__pyx_t_7; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 526, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 526, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 526, __pyx_L1_error) - #endif - if (__pyx_t_5 >= __pyx_temp) break; + __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, 527, __pyx_L1_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, 527, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 526, __pyx_L1_error) + 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_INCREF(__pyx_t_1); + } else { + __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_1); + } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 526, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); #endif - } - } else { - __pyx_t_3 = __pyx_t_6(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 526, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":527 - * variable_with_lt1 = None - * for variable in variables: - * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< - * variable_contains_lt1.append(contains_lt1) - * if contains_lt1 is True: - */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __pyx_pf_10constraint_11constraints_17MaxProdConstraint_10preProcess_genexpr(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_3); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":528 - * for variable in variables: - * contains_lt1 = any(value < 1 for value in domains[variable]) - * variable_contains_lt1.append(contains_lt1) # <<<<<<<<<<<<<< - * if contains_lt1 is True: - * if variable_with_lt1 is not None: - */ - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_variable_contains_lt1, __pyx_v_contains_lt1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 528, __pyx_L1_error) - - /* "constraint/constraints.py":529 - * contains_lt1 = any(value < 1 for value in domains[variable]) - * variable_contains_lt1.append(contains_lt1) - * if contains_lt1 is True: # <<<<<<<<<<<<<< - * if variable_with_lt1 is not None: - * # if more than one associated variables contain less than 1, we can't prune - */ - __pyx_t_8 = (__pyx_v_contains_lt1 == Py_True); - if (__pyx_t_8) { + __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, 527, __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; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_10 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L8_unpacking_done; + __pyx_L7_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, 527, __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_t_1 = 0; - /* "constraint/constraints.py":530 - * variable_contains_lt1.append(contains_lt1) - * if contains_lt1 is True: - * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< - * # if more than one associated variables contain less than 1, we can't prune - * return - */ - __pyx_t_8 = (__pyx_v_variable_with_lt1 != Py_None); - if (__pyx_t_8) { + /* "constraint/constraints.py":528 + * 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, 528, __pyx_L1_error) + if (__pyx_t_2) { - /* "constraint/constraints.py":532 - * if variable_with_lt1 is not None: - * # if more than one associated variables contain less than 1, we can't prune - * return # <<<<<<<<<<<<<< - * variable_with_lt1 = variable - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* "constraint/constraints.py":529 + * 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, 529, __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, 529, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __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, 529, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; + __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":530 - * variable_contains_lt1.append(contains_lt1) - * if contains_lt1 is True: - * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< - * # if more than one associated variables contain less than 1, we can't prune - * return - */ + /* "constraint/constraints.py":528 + * if multipliers: + * for var, multiplier in zip(self.sum_vars, multipliers): + * if var in assignments: # <<<<<<<<<<<<<< + * sum_value += assignments[var] * multiplier + * else: +*/ + goto __pyx_L9; } - /* "constraint/constraints.py":533 - * # if more than one associated variables contain less than 1, we can't prune - * return - * variable_with_lt1 = variable # <<<<<<<<<<<<<< - * - * # prune the associated variables of values > maxprod - */ - __Pyx_INCREF(__pyx_v_variable); - __Pyx_DECREF_SET(__pyx_v_variable_with_lt1, __pyx_v_variable); + /* "constraint/constraints.py":531 + * sum_value += assignments[var] * multiplier + * else: + * missing = True # <<<<<<<<<<<<<< + * else: + * for var in self.sum_vars: +*/ + /*else*/ { + __pyx_v_missing = 1; + } + __pyx_L9:; - /* "constraint/constraints.py":529 - * contains_lt1 = any(value < 1 for value in domains[variable]) - * variable_contains_lt1.append(contains_lt1) - * if contains_lt1 is True: # <<<<<<<<<<<<<< - * if variable_with_lt1 is not None: - * # if more than one associated variables contain less than 1, we can't prune - */ + /* "constraint/constraints.py":527 + * + * if multipliers: + * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< + * if var in assignments: + * sum_value += assignments[var] * multiplier +*/ } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":526 - * variable_contains_lt1: list[bool] = list() - * variable_with_lt1 = None - * for variable in variables: # <<<<<<<<<<<<<< - * contains_lt1 = any(value < 1 for value in domains[variable]) - * variable_contains_lt1.append(contains_lt1) - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "constraint/constraints.py":536 + * missing = False * - * # 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_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_maxprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_maxprod = __pyx_t_1; - __pyx_t_1 = 0; - - /* "constraint/constraints.py":537 - * # 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: - * continue - */ - 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_5 = 0; - __pyx_t_6 = NULL; - } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 537, __pyx_L1_error) + * if multipliers: # <<<<<<<<<<<<<< + * for var, multiplier in zip(self.sum_vars, multipliers): + * if var in assignments: +*/ + goto __pyx_L4; } - for (;;) { - if (likely(!__pyx_t_6)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 537, __pyx_L1_error) - #endif - if (__pyx_t_5 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 537, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 537, __pyx_L1_error) - #endif - if (__pyx_t_5 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 537, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - } - } else { - __pyx_t_3 = __pyx_t_6(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 537, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":538 - * maxprod = self._maxprod - * for variable in variables: - * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< - * continue - * domain = domains[variable] - */ - __pyx_t_9 = (__pyx_v_variable_with_lt1 != Py_None); - if (__pyx_t_9) { - } else { - __pyx_t_8 = __pyx_t_9; - goto __pyx_L11_bool_binop_done; - } - __pyx_t_3 = PyObject_RichCompare(__pyx_v_variable_with_lt1, __pyx_v_variable, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 538, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = __pyx_t_9; - __pyx_L11_bool_binop_done:; - if (__pyx_t_8) { - - /* "constraint/constraints.py":539 - * for variable in variables: - * if variable_with_lt1 is not None and variable_with_lt1 != variable: - * continue # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: - */ - goto __pyx_L8_continue; - - /* "constraint/constraints.py":538 - * maxprod = self._maxprod - * for variable in variables: - * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< - * continue - * domain = domains[variable] - */ - } - /* "constraint/constraints.py":540 - * 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_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":541 - * continue - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value > maxprod: - * domain.remove(value) - */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); - __pyx_t_10 = 0; - __pyx_t_11 = NULL; + /* "constraint/constraints.py":533 + * missing = True + * else: + * for var in self.sum_vars: # <<<<<<<<<<<<<< + * if var in assignments: + * 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, 533, __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; } else { - __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __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, 533, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { - if (likely(!__pyx_t_11)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 541, __pyx_L1_error) + 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, 533, __pyx_L1_error) #endif - if (__pyx_t_10 >= __pyx_temp) break; + if (__pyx_t_7 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 541, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_7); + ++__pyx_t_7; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 541, __pyx_L1_error) + 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, 533, __pyx_L1_error) #endif - if (__pyx_t_10 >= __pyx_temp) break; + if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); #endif + ++__pyx_t_7; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 533, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_11(__pyx_t_2); - if (unlikely(!__pyx_t_3)) { + __pyx_t_4 = __pyx_t_8(__pyx_t_3); + if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 541, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 533, __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_4); + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":542 - * domain = domains[variable] - * for value in domain[:]: - * if value > maxprod: # <<<<<<<<<<<<<< - * domain.remove(value) - * elif value == 0 and maxprod < 0: - */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_value, __pyx_v_maxprod, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 542, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_8) { + /* "constraint/constraints.py":534 + * 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, 534, __pyx_L1_error) + if (__pyx_t_2) { - /* "constraint/constraints.py":543 - * for value in domain[:]: - * if value > maxprod: - * domain.remove(value) # <<<<<<<<<<<<<< - * elif value == 0 and maxprod < 0: - * domain.remove(value) - */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_remove); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 543, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); - if (likely(__pyx_t_13)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_13); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_12, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_v_value}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 543, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "constraint/constraints.py":542 - * domain = domains[variable] - * for value in domain[:]: - * if value > maxprod: # <<<<<<<<<<<<<< - * domain.remove(value) - * elif value == 0 and maxprod < 0: - */ - goto __pyx_L15; - } + /* "constraint/constraints.py":535 + * 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, 535, __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, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":544 - * if value > maxprod: - * domain.remove(value) - * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< - * domain.remove(value) - * - */ - __pyx_t_9 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_value, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 544, __pyx_L1_error) - if (__pyx_t_9) { - } else { - __pyx_t_8 = __pyx_t_9; - goto __pyx_L16_bool_binop_done; + /* "constraint/constraints.py":534 + * else: + * for var in self.sum_vars: + * if var in assignments: # <<<<<<<<<<<<<< + * sum_value += assignments[var] + * else: +*/ + goto __pyx_L13; } - __pyx_t_3 = PyObject_RichCompare(__pyx_v_maxprod, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 544, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = __pyx_t_9; - __pyx_L16_bool_binop_done:; - if (__pyx_t_8) { - /* "constraint/constraints.py":545 - * domain.remove(value) - * elif value == 0 and maxprod < 0: - * domain.remove(value) # <<<<<<<<<<<<<< + /* "constraint/constraints.py":537 + * sum_value += assignments[var] + * else: + * sum_value += min(domains[var]) # use min value if not assigned # <<<<<<<<<<<<<< + * missing = True * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_remove); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); - if (likely(__pyx_t_13)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_13); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_12, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + /*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, 537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_6 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_v_value}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + 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)); + __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, 537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 537, __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; - /* "constraint/constraints.py":544 - * if value > maxprod: - * domain.remove(value) - * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< - * domain.remove(value) + /* "constraint/constraints.py":538 + * else: + * sum_value += min(domains[var]) # use min value if not assigned + * missing = True # <<<<<<<<<<<<<< * - */ + * if isinstance(sum_value, float): +*/ + __pyx_v_missing = 1; } - __pyx_L15:; + __pyx_L13:; - /* "constraint/constraints.py":541 - * continue - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value > maxprod: - * domain.remove(value) - */ + /* "constraint/constraints.py":533 + * missing = True + * else: + * for var in self.sum_vars: # <<<<<<<<<<<<<< + * if var in assignments: + * sum_value += assignments[var] +*/ } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "constraint/constraints.py":537 - * # 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: - * continue - */ - __pyx_L8_continue:; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_L4:; - /* "constraint/constraints.py":520 - * self._maxprod = maxprod + /* "constraint/constraints.py":540 + * missing = True * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * if isinstance(sum_value, float): # <<<<<<<<<<<<<< + * sum_value = round(sum_value, 10) * - */ - - /* 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_12); - __Pyx_XDECREF(__pyx_t_13); - __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_variable_contains_lt1); - __Pyx_XDECREF(__pyx_v_variable_with_lt1); - __Pyx_XDECREF(__pyx_v_variable); - __Pyx_XDECREF(__pyx_v_contains_lt1); - __Pyx_XDECREF(__pyx_v_maxprod); - __Pyx_XDECREF(__pyx_v_domain); - __Pyx_XDECREF(__pyx_v_value); - __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator1); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} +*/ + __pyx_t_2 = PyFloat_Check(__pyx_v_sum_value); + if (__pyx_t_2) { -/* "constraint/constraints.py":547 - * domain.remove(value) + /* "constraint/constraints.py":541 * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * maxprod = self._maxprod - * prod = 1 - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_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_17MaxProdConstraint_5__call__ = {"__call__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MaxProdConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_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 -) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_variables = 0; - PyObject *__pyx_v_domains = 0; - PyObject *__pyx_v_assignments = 0; - PyObject *__pyx_v_forwardcheck = 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("__call__ (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __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 **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,0}; - values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 1); __PYX_ERR(0, 547, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 2); __PYX_ERR(0, 547, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 3); __PYX_ERR(0, 547, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(0, 547, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __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, 547, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + * 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; + { + 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, 541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - } - __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__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", 1))) __PYX_ERR(0, 547, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 547, __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); + __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); + __pyx_t_3 = 0; - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + /* "constraint/constraints.py":540 + * missing = True + * + * if isinstance(sum_value, float): # <<<<<<<<<<<<<< + * sum_value = round(sum_value, 10) + * +*/ } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -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; - PyObject *__pyx_v_prod = NULL; - PyObject *__pyx_v_variable = NULL; - PyObject *__pyx_v_domain = NULL; - PyObject *__pyx_v_value = 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; - Py_ssize_t __pyx_t_7; - PyObject *(*__pyx_t_8)(PyObject *); - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - unsigned int __pyx_t_11; - int __pyx_t_12; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); - - /* "constraint/constraints.py":548 + /* "constraint/constraints.py":543 + * sum_value = round(sum_value, 10) * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - * maxprod = self._maxprod # <<<<<<<<<<<<<< - * prod = 1 - * for variable in variables: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_maxprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_maxprod = __pyx_t_1; - __pyx_t_1 = 0; + * if missing: # <<<<<<<<<<<<<< + * # Partial assignments: only check feasibility + * if sum_value > target_value: +*/ + if (__pyx_v_missing) { - /* "constraint/constraints.py":549 - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - * maxprod = self._maxprod - * prod = 1 # <<<<<<<<<<<<<< - * for variable in variables: - * if variable in assignments: - */ - __Pyx_INCREF(__pyx_int_1); - __pyx_v_prod = __pyx_int_1; + /* "constraint/constraints.py":545 + * 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, 545, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { - /* "constraint/constraints.py":550 - * maxprod = self._maxprod - * prod = 1 - * for variable in variables: # <<<<<<<<<<<<<< - * if variable in assignments: - * prod *= assignments[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_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, 550, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 550, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 550, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + /* "constraint/constraints.py":546 + * # Partial assignments: only check feasibility + * if sum_value > target_value: + * return False # <<<<<<<<<<<<<< + * if forwardcheck: + * for var in self.sum_vars: +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "constraint/constraints.py":545 + * if missing: + * # Partial assignments: only check feasibility + * if sum_value > target_value: # <<<<<<<<<<<<<< + * return False + * if forwardcheck: +*/ + } + + /* "constraint/constraints.py":547 + * 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, 547, __pyx_L1_error) + if (__pyx_t_2) { + + /* "constraint/constraints.py":548 + * 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, 548, __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; } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 550, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 550, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __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, 548, __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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 550, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 548, __pyx_L1_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_7); + ++__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, 548, __pyx_L1_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_1, __pyx_t_7)); + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); + #endif + ++__pyx_t_7; + } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 548, __pyx_L1_error) + } else { + __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, 548, __pyx_L1_error) + PyErr_Clear(); + } + break; + } } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); - __pyx_t_4 = 0; - - /* "constraint/constraints.py":551 - * prod = 1 - * for variable in variables: - * if variable in assignments: # <<<<<<<<<<<<<< - * prod *= assignments[variable] - * if isinstance(prod, float): - */ - __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 551, __pyx_L1_error) - if (__pyx_t_5) { + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":552 - * for variable in variables: - * if variable in assignments: - * 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, 552, __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, 552, __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":549 + * 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, 549, __pyx_L1_error) + if (__pyx_t_2) { - /* "constraint/constraints.py":551 - * prod = 1 - * for variable in variables: - * if variable in assignments: # <<<<<<<<<<<<<< - * prod *= assignments[variable] - * if isinstance(prod, float): - */ - } + /* "constraint/constraints.py":550 + * 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, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":550 - * maxprod = self._maxprod - * prod = 1 - * for variable in variables: # <<<<<<<<<<<<<< - * if variable in assignments: - * prod *= assignments[variable] - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* "constraint/constraints.py":551 + * 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, 551, __pyx_L1_error) + if (__pyx_t_2) { - /* "constraint/constraints.py":553 - * if variable in assignments: - * prod *= assignments[variable] - * if isinstance(prod, float): # <<<<<<<<<<<<<< - * prod = round(prod, 10) - * if prod > maxprod: - */ - __pyx_t_5 = PyFloat_Check(__pyx_v_prod); - if (__pyx_t_5) { + /* "constraint/constraints.py":552 + * 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, 552, __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_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, 552, __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, 552, __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))) { + { + 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, 552, __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_11; + } 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, 552, __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)); + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_11); + #endif + ++__pyx_t_11; + } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __pyx_L1_error) + } else { + __pyx_t_3 = __pyx_t_12(__pyx_t_5); + 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, 552, __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":553 + * 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, 553, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __pyx_t_4; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_6 = 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, 553, __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, 553, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __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, 553, __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, 553, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_temp_sum, __pyx_t_4); + __pyx_t_4 = 0; + + /* "constraint/constraints.py":554 + * 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, 554, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_2) { + + /* "constraint/constraints.py":555 + * temp_sum = sum_value + (value * multipliers[self.sum_vars.index(var)]) + * if temp_sum > target_value: + * domain.hideValue(value) # <<<<<<<<<<<<<< + * else: + * for value in domain[:]: +*/ + __pyx_t_3 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_6 = 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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":554 + * for value in domain[:]: + * temp_sum = sum_value + (value * multipliers[self.sum_vars.index(var)]) + * if temp_sum > target_value: # <<<<<<<<<<<<<< + * domain.hideValue(value) + * else: +*/ + } - /* "constraint/constraints.py":554 - * prod *= assignments[variable] - * if isinstance(prod, float): - * prod = round(prod, 10) # <<<<<<<<<<<<<< - * if prod > maxprod: - * return False - */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_prod); - __Pyx_GIVEREF(__pyx_v_prod); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_prod)) __PYX_ERR(0, 554, __pyx_L1_error); - __Pyx_INCREF(__pyx_int_10); - __Pyx_GIVEREF(__pyx_int_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_10)) __PYX_ERR(0, 554, __pyx_L1_error); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_6); - __pyx_t_6 = 0; + /* "constraint/constraints.py":552 + * 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "constraint/constraints.py":551 + * 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)]) +*/ + goto __pyx_L22; + } - /* "constraint/constraints.py":553 - * if variable in assignments: - * prod *= assignments[variable] - * if isinstance(prod, float): # <<<<<<<<<<<<<< - * prod = round(prod, 10) - * if prod > maxprod: - */ - } + /* "constraint/constraints.py":557 + * domain.hideValue(value) + * else: + * for value in domain[:]: # <<<<<<<<<<<<<< + * temp_sum = sum_value + value + * if temp_sum > 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, 557, __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_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, 557, __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, 557, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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, 557, __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_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, 557, __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)); + #else + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); + #endif + ++__pyx_t_11; + } + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 557, __pyx_L1_error) + } else { + __pyx_t_5 = __pyx_t_12(__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, 557, __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":558 + * 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, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_temp_sum, __pyx_t_5); + __pyx_t_5 = 0; + + /* "constraint/constraints.py":559 + * for value in domain[:]: + * temp_sum = sum_value + value + * if temp_sum > 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, 559, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 559, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_2) { + + /* "constraint/constraints.py":560 + * temp_sum = sum_value + value + * if temp_sum > 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; + { + 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, 560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":555 - * if isinstance(prod, float): - * prod = round(prod, 10) - * if prod > maxprod: # <<<<<<<<<<<<<< - * return False - * if forwardcheck: - */ - __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, 555, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 555, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__pyx_t_5) { + /* "constraint/constraints.py":559 + * for value in domain[:]: + * temp_sum = sum_value + value + * if temp_sum > target_value: # <<<<<<<<<<<<<< + * domain.hideValue(value) + * if not domain: +*/ + } - /* "constraint/constraints.py":556 - * prod = round(prod, 10) - * if prod > maxprod: - * return False # <<<<<<<<<<<<<< - * if forwardcheck: - * for variable in variables: - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - - /* "constraint/constraints.py":555 - * if isinstance(prod, float): - * prod = round(prod, 10) - * if prod > maxprod: # <<<<<<<<<<<<<< - * return False - * if forwardcheck: - */ - } - - /* "constraint/constraints.py":557 - * if prod > maxprod: - * return False - * 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, 557, __pyx_L1_error) - if (__pyx_t_5) { - - /* "constraint/constraints.py":558 - * return False - * if forwardcheck: - * 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_6 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_6); - __pyx_t_2 = 0; - __pyx_t_3 = NULL; - } else { - __pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 558, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_6))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 558, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 558, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 558, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 558, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_3(__pyx_t_6); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 558, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); - __pyx_t_1 = 0; - - /* "constraint/constraints.py":559 - * if forwardcheck: - * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value 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, 559, __pyx_L1_error) - if (__pyx_t_5) { - - /* "constraint/constraints.py":560 - * for variable in variables: - * if variable not in assignments: - * 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, 560, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); - __pyx_t_1 = 0; - - /* "constraint/constraints.py":561 - * if variable not in assignments: - * 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_slice_, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __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_7 = 0; - __pyx_t_8 = NULL; - } else { - __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 561, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 561, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 561, __pyx_L1_error) - #endif - if (__pyx_t_7 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 561, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 561, __pyx_L1_error) - #endif - if (__pyx_t_7 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 561, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_8(__pyx_t_4); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 561, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); - __pyx_t_1 = 0; - - /* "constraint/constraints.py":562 - * 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, 562, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyObject_RichCompare(__pyx_t_1, __pyx_v_maxprod, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 562, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 562, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (__pyx_t_5) { - - /* "constraint/constraints.py":563 - * for value in domain[:]: - * if prod * value > maxprod: - * domain.hideValue(value) # <<<<<<<<<<<<<< - * if not domain: - * return False - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = NULL; - __pyx_t_11 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_11 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_value}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "constraint/constraints.py":562 - * domain = domains[variable] - * for value in domain[:]: - * if prod * value > maxprod: # <<<<<<<<<<<<<< - * domain.hideValue(value) - * if not domain: - */ - } + /* "constraint/constraints.py":557 + * domain.hideValue(value) + * else: + * for value in domain[:]: # <<<<<<<<<<<<<< + * temp_sum = sum_value + value + * if temp_sum > target_value: +*/ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_L22:; /* "constraint/constraints.py":561 - * if variable not in assignments: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if prod * value > maxprod: - * domain.hideValue(value) - */ - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + * if temp_sum > 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, 561, __pyx_L1_error) + __pyx_t_13 = (!__pyx_t_2); + if (__pyx_t_13) { - /* "constraint/constraints.py":564 - * if prod * value > maxprod: - * 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, 564, __pyx_L1_error) - __pyx_t_12 = (!__pyx_t_5); - if (__pyx_t_12) { + /* "constraint/constraints.py":562 + * domain.hideValue(value) + * if not domain: + * return False # <<<<<<<<<<<<<< + * return True + * else: +*/ + __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":565 - * 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_6); __pyx_t_6 = 0; - goto __pyx_L0; + /* "constraint/constraints.py":561 + * if temp_sum > target_value: + * domain.hideValue(value) + * if not domain: # <<<<<<<<<<<<<< + * return False + * return True +*/ + } - /* "constraint/constraints.py":564 - * if prod * value > maxprod: - * domain.hideValue(value) - * if not domain: # <<<<<<<<<<<<<< - * return False - * return True - */ + /* "constraint/constraints.py":549 + * if forwardcheck: + * for var in self.sum_vars: + * if var not in assignments: # <<<<<<<<<<<<<< + * domain = domains[var] + * if multipliers: +*/ } - /* "constraint/constraints.py":559 - * if forwardcheck: - * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: - */ + /* "constraint/constraints.py":548 + * return False + * if forwardcheck: + * for var in self.sum_vars: # <<<<<<<<<<<<<< + * if var not in assignments: + * domain = domains[var] +*/ } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":558 - * return False - * if forwardcheck: - * for variable in variables: # <<<<<<<<<<<<<< - * if variable not in assignments: - * domain = domains[variable] - */ + /* "constraint/constraints.py":547 + * if sum_value > target_value: + * return False + * if forwardcheck: # <<<<<<<<<<<<<< + * for var in self.sum_vars: + * if var not in assignments: +*/ } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":557 - * if prod > maxprod: - * return False - * if forwardcheck: # <<<<<<<<<<<<<< - * for variable in variables: - * if variable not in assignments: - */ - } + /* "constraint/constraints.py":563 + * if not domain: + * return False + * return True # <<<<<<<<<<<<<< + * else: + * return sum_value == target_value +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; - /* "constraint/constraints.py":566 - * if not domain: - * return False - * return True # <<<<<<<<<<<<<< - * + /* "constraint/constraints.py":543 + * sum_value = round(sum_value, 10) * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; + * if missing: # <<<<<<<<<<<<<< + * # Partial assignments: only check feasibility + * if sum_value > target_value: +*/ + } - /* "constraint/constraints.py":547 - * domain.remove(value) + /* "constraint/constraints.py":565 + * return True + * else: + * return sum_value == target_value # <<<<<<<<<<<<<< * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * maxprod = self._maxprod - * prod = 1 - */ + * +*/ + /*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, 565, __pyx_L1_error) + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "constraint/constraints.py":516 + * domain.remove(value) + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * multipliers = self._multipliers + * +*/ /* function exit code */ __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_5); __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_maxprod); - __Pyx_XDECREF(__pyx_v_prod); - __Pyx_XDECREF(__pyx_v_variable); + __Pyx_XDECREF(__pyx_v_multipliers); + __Pyx_XDECREF(__pyx_v_target_value); + __Pyx_XDECREF(__pyx_v_sum_value); + __Pyx_XDECREF(__pyx_v_var); + __Pyx_XDECREF(__pyx_v_multiplier); __Pyx_XDECREF(__pyx_v_domain); __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_temp_sum); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":572 - * """Constraint enforcing that values of given variables create a product up to at least a given amount.""" +/* "constraint/constraints.py":579 + * """ * - * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< - * """Instantiate a MinProdConstraint. + * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * """Initialization method. * - */ +*/ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_16MinSumConstraint_1__init__(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_17MinProdConstraint___init__, "Instantiate a MinProdConstraint.\n\n Args:\n minprod: Value to be considered as the maximum product\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_17MinProdConstraint_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MinProdConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_17MinProdConstraint___init__}; -static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_1__init__(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_16MinSumConstraint___init__, "Initialization method.\n\n Args:\n minsum (number): Value to be considered as the minimum sum\n multipliers (sequence of numbers): If given, variable values\n will be multiplied by the given factors before being\n summed to be checked\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_16MinSumConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_16MinSumConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_16MinSumConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_16MinSumConstraint_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -15713,12 +14952,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_minprod = 0; + PyObject *__pyx_v_minsum = 0; + PyObject *__pyx_v_multipliers = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; + PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -15726,7 +14966,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -15734,109 +14974,114 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_minprod,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 579, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 579, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 579, __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, 579, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + 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, 579, __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, 579, __pyx_L3_error) } + } + } else { switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 572, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 579, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_minprod)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 572, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 572, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 572, __pyx_L3_error) + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 579, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 579, __pyx_L3_error) + break; + default: goto __pyx_L5_argtuple_error; } - } else if (unlikely(__pyx_nargs != 2)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); } __pyx_v_self = values[0]; - __pyx_v_minprod = values[1]; + __pyx_v_minsum = values[1]; + __pyx_v_multipliers = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 572, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 579, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.MinProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MinSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_17MinProdConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_minprod); + __pyx_r = __pyx_pf_10constraint_11constraints_16MinSumConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_minsum, __pyx_v_multipliers); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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_17MinProdConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_minprod) { +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 int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":578 - * minprod: Value to be considered as the maximum product + /* "constraint/constraints.py":588 + * summed to be checked * """ - * self._minprod = minprod # <<<<<<<<<<<<<< + * self._minsum = minsum # <<<<<<<<<<<<<< + * self._multipliers = multipliers * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_minprod_2, __pyx_v_minprod) < 0) __PYX_ERR(0, 578, __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, 588, __pyx_L1_error) - /* "constraint/constraints.py":572 - * """Constraint enforcing that values of given variables create a product up to at least a given amount.""" + /* "constraint/constraints.py":589 + * """ + * self._minsum = minsum + * self._multipliers = multipliers # <<<<<<<<<<<<<< * - * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< - * """Instantiate a MinProdConstraint. + * 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, 589, __pyx_L1_error) + + /* "constraint/constraints.py":579 + * """ * - */ + * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MinSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -15844,24 +15089,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ return __pyx_r; } -/* "constraint/constraints.py":580 - * self._minprod = minprod - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) +/* "constraint/constraints.py":591 + * self._multipliers = multipliers * - */ + * 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: +*/ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_3preProcess(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_16MinSumConstraint_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_17MinProdConstraint_3preProcess = {"preProcess", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MinProdConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_3preProcess(PyObject *__pyx_self, +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, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -15870,9 +15115,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ) { 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; + CYTHON_UNUSED PyObject *__pyx_v_domains = 0; + PyObject *__pyx_v_assignments = 0; + CYTHON_UNUSED PyObject *__pyx_v_forwardcheck = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -15883,9 +15128,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("preProcess (wrapper)", 0); + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -15893,468 +15138,618 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 591, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 591, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 591, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 591, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 591, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 591, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + 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, 591, __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, 591, __pyx_L3_error) } + } + } else { switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 1); __PYX_ERR(0, 580, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 2); __PYX_ERR(0, 580, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 3); __PYX_ERR(0, 580, __pyx_L3_error) - } + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 591, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 4); __PYX_ERR(0, 580, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "preProcess") < 0)) __PYX_ERR(0, 580, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 591, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 591, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 591, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 591, __pyx_L3_error) + break; + default: goto __pyx_L5_argtuple_error; } - } else if (unlikely(__pyx_nargs != 5)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + 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_constraints = ((PyObject*)values[3]); - __pyx_v_vconstraints = ((PyObject*)values[4]); + __pyx_v_assignments = ((PyObject*)values[3]); + __pyx_v_forwardcheck = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 580, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 591, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.MinProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MinSumConstraint.__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", 1))) __PYX_ERR(0, 580, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 580, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 580, __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); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 591, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 591, __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); /* 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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_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) { - PyObject *__pyx_v_minprod = NULL; +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; - PyObject *__pyx_v_domain = NULL; - PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_multipliers = NULL; + PyObject *__pyx_v_minsum = NULL; + PyObject *__pyx_v_sum = NULL; + PyObject *__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; - unsigned int __pyx_t_4; - Py_ssize_t __pyx_t_5; - PyObject *(*__pyx_t_6)(PyObject *); - Py_ssize_t __pyx_t_7; - PyObject *(*__pyx_t_8)(PyObject *); - int __pyx_t_9; - int __pyx_t_10; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = 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; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *(*__pyx_t_10)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("preProcess", 1); - - /* "constraint/constraints.py":581 - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< - * - * # prune the associated variables of values > maxprod - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_preProcess); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } - } - #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_3, __pyx_callargs+1-__pyx_t_4, 5+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "constraint/constraints.py":584 - * - * # prune the associated variables of values > maxprod - * minprod = self._minprod # <<<<<<<<<<<<<< - * for variable in variables: - * domain = domains[variable] - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_minprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_minprod = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":585 - * # prune the associated variables of values > maxprod - * minprod = self._minprod + /* "constraint/constraints.py":593 + * 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: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: - */ + * 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_5 = 0; - __pyx_t_6 = NULL; + __pyx_t_2 = 0; + __pyx_t_3 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 585, __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, 593, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_6)) { + 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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 585, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 593, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 585, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif + __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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 585, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 593, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif + ++__pyx_t_2; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_6(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 585, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 593, __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_4); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":586 - * minprod = self._minprod - * for variable in variables: - * domain = domains[variable] # <<<<<<<<<<<<<< - * for value in domain[:]: - * if value == 0 and minprod > 0: - */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); - __pyx_t_3 = 0; + /* "constraint/constraints.py":594 + * # 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, 594, __pyx_L1_error) + if (__pyx_t_5) { - /* "constraint/constraints.py":587 + /* "constraint/constraints.py":595 * for variable in variables: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value == 0 and minprod > 0: - * domain.remove(value) - */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; - __pyx_t_8 = NULL; + * 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":594 + * # check if each variable is in the assignments + * for variable in variables: + * if variable not in assignments: # <<<<<<<<<<<<<< + * return True + * +*/ + } + + /* "constraint/constraints.py":593 + * 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":598 + * + * # with each variable assigned, sum the values + * 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, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_multipliers = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":599 + * # with each variable assigned, sum the values + * multipliers = self._multipliers + * minsum = self._minsum # <<<<<<<<<<<<<< + * sum = 0 + * if multipliers: +*/ + __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, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_minsum = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":600 + * multipliers = self._multipliers + * minsum = self._minsum + * sum = 0 # <<<<<<<<<<<<<< + * if multipliers: + * for variable, multiplier in zip(variables, multipliers): +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; + + /* "constraint/constraints.py":601 + * minsum = self._minsum + * sum = 0 + * if multipliers: # <<<<<<<<<<<<<< + * for variable, multiplier in zip(variables, multipliers): + * sum += assignments[variable] * multiplier +*/ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 601, __pyx_L1_error) + if (__pyx_t_5) { + + /* "constraint/constraints.py":602 + * sum = 0 + * if multipliers: + * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< + * sum += assignments[variable] * multiplier + * else: +*/ + __pyx_t_4 = NULL; + __Pyx_INCREF(__pyx_builtin_zip); + __pyx_t_6 = __pyx_builtin_zip; + __pyx_t_7 = 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, 602, __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; } else { - __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 602, __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, 602, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_6))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 587, __pyx_L1_error) + 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, 602, __pyx_L1_error) #endif - if (__pyx_t_7 >= __pyx_temp) break; + if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 587, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_2); + ++__pyx_t_2; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 587, __pyx_L1_error) + 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, 602, __pyx_L1_error) #endif - if (__pyx_t_7 >= __pyx_temp) break; + if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_2)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_2); #endif + ++__pyx_t_2; } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_8(__pyx_t_2); - if (unlikely(!__pyx_t_3)) { + __pyx_t_1 = __pyx_t_3(__pyx_t_6); + if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 587, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 602, __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":588 - * domain = domains[variable] - * for value in domain[:]: - * if value == 0 and minprod > 0: # <<<<<<<<<<<<<< - * domain.remove(value) - * - */ - __pyx_t_10 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_value, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 588, __pyx_L1_error) - if (__pyx_t_10) { - } else { - __pyx_t_9 = __pyx_t_10; - goto __pyx_L8_bool_binop_done; } - __pyx_t_3 = PyObject_RichCompare(__pyx_v_minprod, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 588, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __pyx_t_10; - __pyx_L8_bool_binop_done:; - if (__pyx_t_9) { - - /* "constraint/constraints.py":589 - * for value in domain[:]: - * if value == 0 and minprod > 0: - * domain.remove(value) # <<<<<<<<<<<<<< - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_remove); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - __pyx_t_4 = 1; - } + __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, 602, __pyx_L1_error) } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_value}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + #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_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, 602, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "constraint/constraints.py":588 - * domain = domains[variable] - * for value in domain[:]: - * if value == 0 and minprod > 0: # <<<<<<<<<<<<<< - * domain.remove(value) - * - */ + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __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, 602, __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; + __Pyx_GOTREF(__pyx_t_8); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 602, __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:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_L11_unpacking_done:; } + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":587 - * for variable in variables: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value == 0 and minprod > 0: - * domain.remove(value) - */ + /* "constraint/constraints.py":603 + * if multipliers: + * for variable, multiplier in zip(variables, multipliers): + * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< + * 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, 603, __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, 603, __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, 603, __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":602 + * sum = 0 + * if multipliers: + * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< + * sum += assignments[variable] * multiplier + * else: +*/ } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":585 - * # prune the associated variables of values > maxprod - * minprod = self._minprod - * for variable in variables: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: - */ + /* "constraint/constraints.py":601 + * minsum = self._minsum + * sum = 0 + * if multipliers: # <<<<<<<<<<<<<< + * for variable, multiplier in zip(variables, multipliers): + * sum += assignments[variable] * multiplier +*/ + goto __pyx_L7; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "constraint/constraints.py":580 - * self._minprod = minprod - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * - */ - /* 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_11); - __Pyx_XDECREF(__pyx_t_12); - __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_minprod); + /* "constraint/constraints.py":605 + * sum += assignments[variable] * multiplier + * else: + * for variable in variables: # <<<<<<<<<<<<<< + * sum += assignments[variable] + * if isinstance(sum, float): +*/ + /*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; + } else { + __pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 605, __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, 605, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_6))) { + { + 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, 605, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_2); + ++__pyx_t_2; + } 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, 605, __pyx_L1_error) + #endif + 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_6, __pyx_t_2)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_2); + #endif + ++__pyx_t_2; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_3(__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, 605, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":606 + * else: + * for variable in variables: + * sum += assignments[variable] # <<<<<<<<<<<<<< + * 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, 606, __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, 606, __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":605 + * sum += assignments[variable] * multiplier + * else: + * for variable in variables: # <<<<<<<<<<<<<< + * sum += assignments[variable] + * if isinstance(sum, float): +*/ + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_L7:; + + /* "constraint/constraints.py":607 + * for variable in variables: + * sum += assignments[variable] + * if isinstance(sum, float): # <<<<<<<<<<<<<< + * sum = round(sum, 10) + * return sum >= minsum +*/ + __pyx_t_5 = PyFloat_Check(__pyx_v_sum); + if (__pyx_t_5) { + + /* "constraint/constraints.py":608 + * sum += assignments[variable] + * if isinstance(sum, float): + * sum = round(sum, 10) # <<<<<<<<<<<<<< + * return sum >= minsum + * +*/ + __pyx_t_8 = NULL; + __Pyx_INCREF(__pyx_builtin_round); + __pyx_t_1 = __pyx_builtin_round; + __pyx_t_7 = 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_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, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_6); + __pyx_t_6 = 0; + + /* "constraint/constraints.py":607 + * for variable in variables: + * sum += assignments[variable] + * if isinstance(sum, float): # <<<<<<<<<<<<<< + * sum = round(sum, 10) + * return sum >= minsum +*/ + } + + /* "constraint/constraints.py":609 + * if isinstance(sum, float): + * sum = round(sum, 10) + * return sum >= minsum # <<<<<<<<<<<<<< + * + * +*/ + __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, 609, __pyx_L1_error) + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "constraint/constraints.py":591 + * self._multipliers = multipliers + * + * 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: +*/ + + /* 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_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_domain); - __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_multipliers); + __Pyx_XDECREF(__pyx_v_minsum); + __Pyx_XDECREF(__pyx_v_sum); + __Pyx_XDECREF(__pyx_v_multiplier); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":591 - * domain.remove(value) +/* "constraint/constraints.py":615 + * """Constraint enforcing that values of given variables create a product up to at most a given amount.""" * - * 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 __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< + * """Instantiate a MaxProdConstraint. + * +*/ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_5__call__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_1__init__(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_17MinProdConstraint_5__call__ = {"__call__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MinProdConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_5__call__(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_17MaxProdConstraint___init__, "Instantiate a MaxProdConstraint.\n\n Args:\n maxprod: Value to be considered as the maximum product\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_17MaxProdConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MaxProdConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_17MaxProdConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -16362,23 +15757,20 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_variables = 0; - CYTHON_UNUSED PyObject *__pyx_v_domains = 0; - PyObject *__pyx_v_assignments = 0; - CYTHON_UNUSED PyObject *__pyx_v_forwardcheck = 0; + PyObject *__pyx_v_maxprod = 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}; + PyObject* values[2] = {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); + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -16386,454 +15778,116 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,0}; - values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 615, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 615, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 615, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 1); __PYX_ERR(0, 591, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 2); __PYX_ERR(0, 591, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 3); __PYX_ERR(0, 591, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(0, 591, __pyx_L3_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, 615, __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, 615, __pyx_L3_error) } } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; } else { - switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 615, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 615, __pyx_L3_error) } __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_v_maxprod = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 591, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 615, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.MinProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__init__", __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", 1))) __PYX_ERR(0, 591, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 591, __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); + __pyx_r = __pyx_pf_10constraint_11constraints_17MaxProdConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_maxprod); /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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_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) { - PyObject *__pyx_v_variable = NULL; - PyObject *__pyx_v_minprod = NULL; - PyObject *__pyx_v_prod = NULL; +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; - 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; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":593 - * 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, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 593, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 593, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 593, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 593, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 593, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); - __pyx_t_4 = 0; - - /* "constraint/constraints.py":594 - * # 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, 594, __pyx_L1_error) - if (__pyx_t_5) { - - /* "constraint/constraints.py":595 - * 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":594 - * # check if each variable is in the assignments - * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< - * return True - * - */ - } - - /* "constraint/constraints.py":593 - * 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":598 - * - * # 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_n_s_minprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_minprod = __pyx_t_1; - __pyx_t_1 = 0; - - /* "constraint/constraints.py":599 - * # with each variable assigned, sum the values - * minprod = self._minprod - * prod = 1 # <<<<<<<<<<<<<< - * for variable in variables: - * prod *= assignments[variable] - */ - __Pyx_INCREF(__pyx_int_1); - __pyx_v_prod = __pyx_int_1; - - /* "constraint/constraints.py":600 - * minprod = self._minprod - * prod = 1 - * for variable in variables: # <<<<<<<<<<<<<< - * prod *= assignments[variable] - * if isinstance(prod, float): - */ - 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, 600, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 600, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 600, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 600, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 600, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 600, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); - __pyx_t_4 = 0; - - /* "constraint/constraints.py":601 - * 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, 601, __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, 601, __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":600 - * minprod = self._minprod - * prod = 1 - * for variable in variables: # <<<<<<<<<<<<<< - * prod *= assignments[variable] - * if isinstance(prod, float): - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "constraint/constraints.py":602 - * for variable in variables: - * prod *= assignments[variable] - * if isinstance(prod, float): # <<<<<<<<<<<<<< - * prod = round(prod, 10) - * return prod >= minprod - */ - __pyx_t_5 = PyFloat_Check(__pyx_v_prod); - if (__pyx_t_5) { - - /* "constraint/constraints.py":603 - * prod *= assignments[variable] - * if isinstance(prod, float): - * prod = round(prod, 10) # <<<<<<<<<<<<<< - * return prod >= minprod + /* "constraint/constraints.py":621 + * maxprod: Value to be considered as the maximum product + * """ + * self._maxprod = maxprod # <<<<<<<<<<<<<< * - */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_prod); - __Pyx_GIVEREF(__pyx_v_prod); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_prod)) __PYX_ERR(0, 603, __pyx_L1_error); - __Pyx_INCREF(__pyx_int_10); - __Pyx_GIVEREF(__pyx_int_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_10)) __PYX_ERR(0, 603, __pyx_L1_error); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_6); - __pyx_t_6 = 0; - - /* "constraint/constraints.py":602 - * for variable in variables: - * prod *= assignments[variable] - * if isinstance(prod, float): # <<<<<<<<<<<<<< - * prod = round(prod, 10) - * return prod >= 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_maxprod_2, __pyx_v_maxprod) < 0) __PYX_ERR(0, 621, __pyx_L1_error) - /* "constraint/constraints.py":604 - * if isinstance(prod, float): - * prod = round(prod, 10) - * return prod >= minprod # <<<<<<<<<<<<<< - * + /* "constraint/constraints.py":615 + * """Constraint enforcing that values of given variables create a product up to at most a given amount.""" * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = PyObject_RichCompare(__pyx_v_prod, __pyx_v_minprod, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 604, __pyx_L1_error) - __pyx_r = __pyx_t_6; - __pyx_t_6 = 0; - goto __pyx_L0; - - /* "constraint/constraints.py":591 - * domain.remove(value) + * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< + * """Instantiate a MaxProdConstraint. * - * 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: - */ +*/ /* 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); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_variable); - __Pyx_XDECREF(__pyx_v_minprod); - __Pyx_XDECREF(__pyx_v_prod); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":618 - * """ +/* "constraint/constraints.py":623 + * self._maxprod = maxprod * - * def __init__(self, set): # <<<<<<<<<<<<<< - * """Initialization method. + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * - */ +*/ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_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*/ -PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_15InSetConstraint___init__, "Initialization method.\n\n Args:\n set (set): Set of allowed values\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_15InSetConstraint_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_15InSetConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_15InSetConstraint___init__}; -static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_1__init__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_17MaxProdConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MaxProdConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_3preProcess(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -16841,20 +15895,23 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_set = 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[2] = {0,0}; + 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("__init__ (wrapper)", 0); + __Pyx_RefNannySetupContext("preProcess (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -16862,851 +15919,848 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_set,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 623, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 623, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 623, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 618, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 623, __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, 623, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_set)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 618, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 618, __pyx_L3_error) - } + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 623, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 618, __pyx_L3_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, 623, __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, 623, __pyx_L3_error) } } - } else if (unlikely(__pyx_nargs != 2)) { + } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 623, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 623, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 623, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 623, __pyx_L3_error) + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 623, __pyx_L3_error) } __pyx_v_self = values[0]; - __pyx_v_set = values[1]; + __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("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 618, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 623, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.InSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_15InSetConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_set); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 623, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 623, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 623, __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 */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); + 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_17MaxProdConstraint_10preProcess_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set) { +/* "constraint/constraints.py":630 + * variable_with_lt1 = None + * for variable in variables: + * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< + * variable_contains_lt1.append(contains_lt1) + * if contains_lt1 is True: +*/ + +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_5_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("__init__", 1); - - /* "constraint/constraints.py":624 - * 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_n_s_set_2, __pyx_v_set) < 0) __PYX_ERR(0, 624, __pyx_L1_error) - - /* "constraint/constraints.py":618 - * """ - * - * def __init__(self, set): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 630, __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_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_MaxProdConstraint_preProcess_loc, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 630, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.InSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.preProcess.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; + __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":626 - * self._set = set - * - * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * # preProcess() will remove it. - * raise RuntimeError("Can't happen") - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_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_15InSetConstraint_3__call__ = {"__call__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_15InSetConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_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; - #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}; +static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_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; - PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __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 **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,0}; - values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 626, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 626, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 1); __PYX_ERR(0, 626, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 626, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 2); __PYX_ERR(0, 626, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 626, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 3); __PYX_ERR(0, 626, __pyx_L3_error) + __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, 630, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 630, __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, 630, __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, 630, __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, 630, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; } - CYTHON_FALLTHROUGH; - case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 626, __pyx_L3_error) + __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, 630, __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(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(0, 626, __pyx_L3_error) - } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 630, __pyx_L1_error) } else { - switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + __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, 630, __pyx_L1_error) + PyErr_Clear(); + } break; - default: goto __pyx_L5_argtuple_error; } } - __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]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 626, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + __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, 630, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 630, __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_AddTraceback("constraint.constraints.InSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); + __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 */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } -static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_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) { +/* "constraint/constraints.py":623 + * self._maxprod = maxprod + * + * 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_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) { + PyObject *__pyx_v_variable_contains_lt1 = 0; + PyObject *__pyx_v_variable_with_lt1 = NULL; + PyObject *__pyx_v_variable = NULL; + PyObject *__pyx_v_contains_lt1 = NULL; + PyObject *__pyx_v_maxprod = NULL; + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator4 = 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 *); + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + PyObject *(*__pyx_t_12)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":628 - * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 - * # preProcess() will remove it. - * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< + /* "constraint/constraints.py":624 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __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, 628, __pyx_L1_error) - - /* "constraint/constraints.py":626 - * self._set = set + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< * - * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * # preProcess() will remove it. - * raise RuntimeError("Can't happen") - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("constraint.constraints.InSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "constraint/constraints.py":630 - * 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: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_5preProcess(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_15InSetConstraint_5preProcess = {"preProcess", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_15InSetConstraint_5preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_5preProcess(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_MACROS - __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 **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 630, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 630, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 1); __PYX_ERR(0, 630, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 630, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 2); __PYX_ERR(0, 630, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 630, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 3); __PYX_ERR(0, 630, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 630, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 4); __PYX_ERR(0, 630, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "preProcess") < 0)) __PYX_ERR(0, 630, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 5)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - } - __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, 630, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + * # 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, 624, __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, 624, __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; } - __Pyx_AddTraceback("constraint.constraints.InSetConstraint.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", 1))) __PYX_ERR(0, 630, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 630, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 630, __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 */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; + #endif { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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_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, 624, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProcess(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_set = NULL; - PyObject *__pyx_v_variable = NULL; - PyObject *__pyx_v_domain = NULL; - PyObject *__pyx_v_value = 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; - PyObject *__pyx_t_5 = NULL; - Py_ssize_t __pyx_t_6; - PyObject *(*__pyx_t_7)(PyObject *); - int __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - unsigned int __pyx_t_11; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("preProcess", 1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":631 + /* "constraint/constraints.py":627 * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - * set = self._set # <<<<<<<<<<<<<< + * # check if there are any values less than 1 in the associated variables + * variable_contains_lt1: list[bool] = list() # <<<<<<<<<<<<<< + * variable_with_lt1 = None * for variable in variables: - * domain = domains[variable] - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error) +*/ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_set = __pyx_t_1; + __pyx_v_variable_contains_lt1 = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":632 - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - * set = self._set + /* "constraint/constraints.py":628 + * # check if there are any values less than 1 in the associated variables + * variable_contains_lt1: list[bool] = list() + * variable_with_lt1 = None # <<<<<<<<<<<<<< + * for variable in variables: + * contains_lt1 = any(value < 1 for value in domains[variable]) +*/ + __Pyx_INCREF(Py_None); + __pyx_v_variable_with_lt1 = Py_None; + + /* "constraint/constraints.py":629 + * variable_contains_lt1: list[bool] = list() + * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: - */ + * contains_lt1 = any(value < 1 for value in domains[variable]) + * variable_contains_lt1.append(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_2 = 0; - __pyx_t_3 = NULL; + __pyx_t_6 = 0; + __pyx_t_7 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __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, 629, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_3)) { + 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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 632, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 629, __pyx_L1_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 632, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 632, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 629, __pyx_L1_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); #endif + ++__pyx_t_6; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); + __pyx_t_4 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 629, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_4); } + __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":633 - * set = self._set + /* "constraint/constraints.py":630 + * variable_with_lt1 = None * 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, 633, __pyx_L1_error) + * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< + * variable_contains_lt1.append(contains_lt1) + * if contains_lt1 is True: +*/ + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_domain, __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, 630, __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, 630, __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":634 + /* "constraint/constraints.py":631 * 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_slice_, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __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, 634, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 634, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_5))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 634, __pyx_L1_error) - #endif - if (__pyx_t_6 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 634, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 634, __pyx_L1_error) - #endif - if (__pyx_t_6 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 634, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_7(__pyx_t_5); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 634, __pyx_L1_error) - } + * contains_lt1 = any(value < 1 for value in domains[variable]) + * variable_contains_lt1.append(contains_lt1) # <<<<<<<<<<<<<< + * if contains_lt1 is True: + * if variable_with_lt1 is not None: +*/ + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_variable_contains_lt1, __pyx_v_contains_lt1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 631, __pyx_L1_error) + + /* "constraint/constraints.py":632 + * contains_lt1 = any(value < 1 for value in domains[variable]) + * variable_contains_lt1.append(contains_lt1) + * if contains_lt1 is True: # <<<<<<<<<<<<<< + * if variable_with_lt1 is not None: + * # if more than one associated variables contain less than 1, we can't prune +*/ + __pyx_t_9 = (__pyx_v_contains_lt1 == Py_True); + if (__pyx_t_9) { + + /* "constraint/constraints.py":633 + * variable_contains_lt1.append(contains_lt1) + * if contains_lt1 is True: + * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< + * # if more than one associated variables contain less than 1, we can't prune + * return +*/ + __pyx_t_9 = (__pyx_v_variable_with_lt1 != Py_None); + if (__pyx_t_9) { + + /* "constraint/constraints.py":635 + * if variable_with_lt1 is not None: + * # if more than one associated variables contain less than 1, we can't prune + * return # <<<<<<<<<<<<<< + * variable_with_lt1 = variable + * +*/ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + + /* "constraint/constraints.py":633 + * variable_contains_lt1.append(contains_lt1) + * if contains_lt1 is True: + * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< + * # if more than one associated variables contain less than 1, we can't prune + * return +*/ + } + + /* "constraint/constraints.py":636 + * # if more than one associated variables contain less than 1, we can't prune + * return + * variable_with_lt1 = variable # <<<<<<<<<<<<<< + * + * # prune the associated variables of values > maxprod +*/ + __Pyx_INCREF(__pyx_v_variable); + __Pyx_DECREF_SET(__pyx_v_variable_with_lt1, __pyx_v_variable); + + /* "constraint/constraints.py":632 + * contains_lt1 = any(value < 1 for value in domains[variable]) + * variable_contains_lt1.append(contains_lt1) + * if contains_lt1 is True: # <<<<<<<<<<<<<< + * if variable_with_lt1 is not None: + * # if more than one associated variables contain less than 1, we can't prune +*/ + } + + /* "constraint/constraints.py":629 + * variable_contains_lt1: list[bool] = list() + * variable_with_lt1 = None + * for variable in variables: # <<<<<<<<<<<<<< + * contains_lt1 = any(value < 1 for value in domains[variable]) + * variable_contains_lt1.append(contains_lt1) +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":639 + * + * # 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_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_maxprod = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":640 + * # 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: + * continue +*/ + 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, 640, __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, 640, __pyx_L1_error) + } + for (;;) { + 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, 640, __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_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, 640, __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_1, __pyx_t_6)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 640, __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, 640, __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":641 + * maxprod = self._maxprod + * for variable in variables: + * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< + * continue + * domain = domains[variable] +*/ + __pyx_t_10 = (__pyx_v_variable_with_lt1 != Py_None); + if (__pyx_t_10) { + } else { + __pyx_t_9 = __pyx_t_10; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_4 = PyObject_RichCompare(__pyx_v_variable_with_lt1, __pyx_v_variable, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 641, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = __pyx_t_10; + __pyx_L11_bool_binop_done:; + if (__pyx_t_9) { + + /* "constraint/constraints.py":642 + * for variable in variables: + * if variable_with_lt1 is not None and variable_with_lt1 != variable: + * continue # <<<<<<<<<<<<<< + * domain = domains[variable] + * for value in domain[:]: +*/ + goto __pyx_L8_continue; + + /* "constraint/constraints.py":641 + * maxprod = self._maxprod + * for variable in variables: + * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< + * continue + * domain = domains[variable] +*/ + } + + /* "constraint/constraints.py":643 + * 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_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); + __pyx_t_4 = 0; + + /* "constraint/constraints.py":644 + * continue + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value > maxprod: + * 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, 644, __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_11 = 0; + __pyx_t_12 = NULL; + } else { + __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 644, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + for (;;) { + if (likely(!__pyx_t_12)) { + 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, 644, __pyx_L1_error) + #endif + if (__pyx_t_11 >= __pyx_temp) break; + } + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_11); + ++__pyx_t_11; + } 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, 644, __pyx_L1_error) + #endif + if (__pyx_t_11 >= __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_11)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11); + #endif + ++__pyx_t_11; + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 644, __pyx_L1_error) + } else { + __pyx_t_4 = __pyx_t_12(__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, 644, __pyx_L1_error) + PyErr_Clear(); + } break; } - __Pyx_GOTREF(__pyx_t_4); } + __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":635 + /* "constraint/constraints.py":645 * domain = domains[variable] * for value in domain[:]: - * if value not in set: # <<<<<<<<<<<<<< + * if value > maxprod: # <<<<<<<<<<<<<< * 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, 635, __pyx_L1_error) - if (__pyx_t_8) { + * elif value == 0 and maxprod < 0: +*/ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_value, __pyx_v_maxprod, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 645, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 645, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_9) { - /* "constraint/constraints.py":636 + /* "constraint/constraints.py":646 * for value in domain[:]: - * if value not in set: + * if value > maxprod: * domain.remove(value) # <<<<<<<<<<<<<< - * vconstraints[variable].remove((self, variables)) - * constraints.remove((self, variables)) - */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_remove); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = NULL; - __pyx_t_11 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_11 = 1; - } - } - #endif + * elif value == 0 and maxprod < 0: + * domain.remove(value) +*/ + __pyx_t_3 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 636, __pyx_L1_error) + 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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":635 + /* "constraint/constraints.py":645 * domain = domains[variable] * for value in domain[:]: - * if value not in set: # <<<<<<<<<<<<<< + * if value > maxprod: # <<<<<<<<<<<<<< * domain.remove(value) - * vconstraints[variable].remove((self, variables)) - */ + * elif value == 0 and maxprod < 0: +*/ + goto __pyx_L15; } - /* "constraint/constraints.py":634 - * for variable in variables: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value not in set: + /* "constraint/constraints.py":647 + * if value > maxprod: * domain.remove(value) - */ - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "constraint/constraints.py":637 - * if value not in set: + * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< * domain.remove(value) - * vconstraints[variable].remove((self, variables)) # <<<<<<<<<<<<<< - * constraints.remove((self, variables)) * - */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_remove); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __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)) __PYX_ERR(0, 637, __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)) __PYX_ERR(0, 637, __pyx_L1_error); - __pyx_t_10 = NULL; - __pyx_t_11 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_11 = 1; +*/ + __pyx_t_10 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 647, __pyx_L1_error) + if (__pyx_t_10) { + } else { + __pyx_t_9 = __pyx_t_10; + goto __pyx_L16_bool_binop_done; } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_4}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_v_maxprod, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "constraint/constraints.py":632 - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - * set = self._set - * for variable in variables: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __pyx_t_10; + __pyx_L16_bool_binop_done:; + if (__pyx_t_9) { - /* "constraint/constraints.py":638 + /* "constraint/constraints.py":648 * domain.remove(value) - * vconstraints[variable].remove((self, variables)) - * constraints.remove((self, variables)) # <<<<<<<<<<<<<< + * 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_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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 648, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":647 + * if value > maxprod: + * domain.remove(value) + * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< + * domain.remove(value) * - */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __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)) __PYX_ERR(0, 638, __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)) __PYX_ERR(0, 638, __pyx_L1_error); - __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_remove, __pyx_v_constraints, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); +*/ + } + __pyx_L15:; + + /* "constraint/constraints.py":644 + * continue + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value > maxprod: + * domain.remove(value) +*/ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":640 + * # 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: + * continue +*/ + __pyx_L8_continue:; + } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":630 - * raise RuntimeError("Can't happen") + /* "constraint/constraints.py":623 + * self._maxprod = maxprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * set = self._set - * for variable in variables: - */ + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * +*/ /* 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_5); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("constraint.constraints.InSetConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_set); + __Pyx_XDECREF(__pyx_v_variable_contains_lt1); + __Pyx_XDECREF(__pyx_v_variable_with_lt1); __Pyx_XDECREF(__pyx_v_variable); + __Pyx_XDECREF(__pyx_v_contains_lt1); + __Pyx_XDECREF(__pyx_v_maxprod); __Pyx_XDECREF(__pyx_v_domain); __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator4); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":652 - * """ - * - * def __init__(self, set): # <<<<<<<<<<<<<< - * """Initialization method. +/* "constraint/constraints.py":650 + * domain.remove(value) * - */ + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * maxprod = self._maxprod + * prod = 1 +*/ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_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*/ -PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_18NotInSetConstraint___init__, "Initialization method.\n\n Args:\n set (set): Set of disallowed values\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_18NotInSetConstraint_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18NotInSetConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_18NotInSetConstraint___init__}; -static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_1__init__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_17MaxProdConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MaxProdConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_5__call__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -17714,166 +16768,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_set = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __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 **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_set,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 652, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_set)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 652, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 652, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 652, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 2)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - } - __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, 652, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("constraint.constraints.NotInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_18NotInSetConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_set); - - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); - - /* "constraint/constraints.py":658 - * 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_n_s_set_2, __pyx_v_set) < 0) __PYX_ERR(0, 658, __pyx_L1_error) - - /* "constraint/constraints.py":652 - * """ - * - * def __init__(self, set): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.NotInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "constraint/constraints.py":660 - * self._set = set - * - * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * # preProcess() will remove it. - * raise RuntimeError("Can't happen") - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_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_18NotInSetConstraint_3__call__ = {"__call__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18NotInSetConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_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; + PyObject *__pyx_v_variables = 0; + PyObject *__pyx_v_domains = 0; + PyObject *__pyx_v_assignments = 0; + PyObject *__pyx_v_forwardcheck = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -17886,7 +16784,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -17894,665 +16792,621 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,0}; - values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 650, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 650, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 650, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 650, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 650, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 650, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 660, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 660, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 1); __PYX_ERR(0, 660, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 660, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 2); __PYX_ERR(0, 660, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 660, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 3); __PYX_ERR(0, 660, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 660, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(0, 660, __pyx_L3_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, 650, __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, 650, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 650, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 650, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 650, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 650, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 650, __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 = values[2]; - __pyx_v_assignments = values[3]; + __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, 660, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 650, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.NotInSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_18NotInSetConstraint_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, 650, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 650, __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 */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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_18NotInSetConstraint_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) { - 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("__call__", 1); - - /* "constraint/constraints.py":662 - * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 - * # preProcess() will remove it. - * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __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, 662, __pyx_L1_error) - - /* "constraint/constraints.py":660 - * self._set = set - * - * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * # preProcess() will remove it. - * raise RuntimeError("Can't happen") - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("constraint.constraints.NotInSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "constraint/constraints.py":664 - * 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: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_5preProcess(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_18NotInSetConstraint_5preProcess = {"preProcess", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18NotInSetConstraint_5preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_5preProcess(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_MACROS - __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 **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 1); __PYX_ERR(0, 664, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 2); __PYX_ERR(0, 664, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 3); __PYX_ERR(0, 664, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, 4); __PYX_ERR(0, 664, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "preProcess") < 0)) __PYX_ERR(0, 664, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 5)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - } - __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, 664, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("constraint.constraints.NotInSetConstraint.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", 1))) __PYX_ERR(0, 664, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 664, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 664, __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 */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4preProcess(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_set = NULL; - PyObject *__pyx_v_variable = NULL; - PyObject *__pyx_v_domain = NULL; - PyObject *__pyx_v_value = NULL; +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; + PyObject *__pyx_v_prod = NULL; + PyObject *__pyx_v_variable = NULL; + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_value = 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; - PyObject *__pyx_t_5 = NULL; - Py_ssize_t __pyx_t_6; - PyObject *(*__pyx_t_7)(PyObject *); - int __pyx_t_8; - PyObject *__pyx_t_9 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + size_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); PyObject *__pyx_t_10 = NULL; - unsigned int __pyx_t_11; + int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("preProcess", 1); + __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":665 + /* "constraint/constraints.py":651 * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - * set = self._set # <<<<<<<<<<<<<< + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * maxprod = self._maxprod # <<<<<<<<<<<<<< + * prod = 1 * for variable in variables: - * domain = domains[variable] - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __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, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_set = __pyx_t_1; + __pyx_v_maxprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":666 - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - * set = self._set + /* "constraint/constraints.py":652 + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * maxprod = self._maxprod + * prod = 1 # <<<<<<<<<<<<<< + * for variable in variables: + * if variable in assignments: +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); + __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; + + /* "constraint/constraints.py":653 + * maxprod = self._maxprod + * prod = 1 * for variable in variables: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: - */ + * if variable in assignments: + * prod *= assignments[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_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, 666, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __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, 653, __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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 666, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 653, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 666, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 666, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 653, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 666, __pyx_L1_error) + __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); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif + ++__pyx_t_2; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 653, __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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 666, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 653, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_4); } + __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":667 - * set = self._set + /* "constraint/constraints.py":654 + * prod = 1 * 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, 667, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); - __pyx_t_4 = 0; + * if variable in assignments: # <<<<<<<<<<<<<< + * prod *= assignments[variable] + * if isinstance(prod, float): +*/ + __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 654, __pyx_L1_error) + if (__pyx_t_5) { - /* "constraint/constraints.py":668 + /* "constraint/constraints.py":655 * 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_slice_, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __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); + * if variable in assignments: + * 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, 655, __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, 655, __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; - __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, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 668, __pyx_L1_error) + + /* "constraint/constraints.py":654 + * prod = 1 + * for variable in variables: + * if variable in assignments: # <<<<<<<<<<<<<< + * prod *= assignments[variable] + * if isinstance(prod, float): +*/ } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_5))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 668, __pyx_L1_error) - #endif - if (__pyx_t_6 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 668, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 668, __pyx_L1_error) - #endif - if (__pyx_t_6 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 668, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } + + /* "constraint/constraints.py":653 + * maxprod = self._maxprod + * prod = 1 + * for variable in variables: # <<<<<<<<<<<<<< + * if variable in assignments: + * prod *= assignments[variable] +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":656 + * if variable in assignments: + * prod *= assignments[variable] + * if isinstance(prod, float): # <<<<<<<<<<<<<< + * prod = round(prod, 10) + * if prod > maxprod: +*/ + __pyx_t_5 = PyFloat_Check(__pyx_v_prod); + if (__pyx_t_5) { + + /* "constraint/constraints.py":657 + * prod *= assignments[variable] + * if isinstance(prod, float): + * prod = round(prod, 10) # <<<<<<<<<<<<<< + * if prod > maxprod: + * return False +*/ + __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_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, 657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":656 + * if variable in assignments: + * prod *= assignments[variable] + * if isinstance(prod, float): # <<<<<<<<<<<<<< + * prod = round(prod, 10) + * if prod > maxprod: +*/ + } + + /* "constraint/constraints.py":658 + * if isinstance(prod, float): + * prod = round(prod, 10) + * if prod > maxprod: # <<<<<<<<<<<<<< + * return False + * if forwardcheck: +*/ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_prod, __pyx_v_maxprod, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "constraint/constraints.py":659 + * prod = round(prod, 10) + * if prod > maxprod: + * return False # <<<<<<<<<<<<<< + * if forwardcheck: + * for variable in variables: +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "constraint/constraints.py":658 + * if isinstance(prod, float): + * prod = round(prod, 10) + * if prod > maxprod: # <<<<<<<<<<<<<< + * return False + * if forwardcheck: +*/ + } + + /* "constraint/constraints.py":660 + * if prod > maxprod: + * return False + * 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, 660, __pyx_L1_error) + if (__pyx_t_5) { + + /* "constraint/constraints.py":661 + * return False + * if forwardcheck: + * 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_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, 661, __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, 661, __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, 661, __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, 661, __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, 661, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_7(__pyx_t_5); + __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 668, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 661, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_4); } - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":669 - * 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, 669, __pyx_L1_error) - if (__pyx_t_8) { + /* "constraint/constraints.py":662 + * if forwardcheck: + * for variable in variables: + * if variable not in assignments: # <<<<<<<<<<<<<< + * domain = domains[variable] + * for value 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, 662, __pyx_L1_error) + if (__pyx_t_5) { - /* "constraint/constraints.py":670 - * for value in domain[:]: - * if value in set: - * domain.remove(value) # <<<<<<<<<<<<<< - * vconstraints[variable].remove((self, variables)) - * constraints.remove((self, variables)) - */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_remove); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 670, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = NULL; - __pyx_t_11 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_11 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 670, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + /* "constraint/constraints.py":663 + * for variable in variables: + * if variable not in assignments: + * domain = domains[variable] # <<<<<<<<<<<<<< + * for value in domain[:]: + * if prod * value > maxprod: +*/ + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); + __pyx_t_4 = 0; + + /* "constraint/constraints.py":664 + * if variable not in assignments: + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if prod * value > maxprod: + * 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, 664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { + __pyx_t_6 = __pyx_t_4; __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_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 664, __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, 664, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + for (;;) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_6))) { + { + 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, 664, __pyx_L1_error) + #endif + if (__pyx_t_8 >= __pyx_temp) break; + } + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_8); + ++__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, 664, __pyx_L1_error) + #endif + if (__pyx_t_8 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); + #endif + ++__pyx_t_8; + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error) + } else { + __pyx_t_4 = __pyx_t_9(__pyx_t_6); + 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, 664, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":669 - * domain = domains[variable] - * for value in domain[:]: - * if value in set: # <<<<<<<<<<<<<< - * domain.remove(value) - * vconstraints[variable].remove((self, variables)) - */ - } - - /* "constraint/constraints.py":668 - * for variable in variables: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value in set: - * domain.remove(value) - */ - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* "constraint/constraints.py":665 + * domain = domains[variable] + * for value in domain[:]: + * if prod * value > maxprod: # <<<<<<<<<<<<<< + * domain.hideValue(value) + * if not domain: +*/ + __pyx_t_4 = PyNumber_Multiply(__pyx_v_prod, __pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = PyObject_RichCompare(__pyx_t_4, __pyx_v_maxprod, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_5) { - /* "constraint/constraints.py":671 - * if value in set: - * domain.remove(value) - * vconstraints[variable].remove((self, variables)) # <<<<<<<<<<<<<< - * constraints.remove((self, variables)) - * - */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_remove); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __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)) __PYX_ERR(0, 671, __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)) __PYX_ERR(0, 671, __pyx_L1_error); - __pyx_t_10 = NULL; - __pyx_t_11 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_11 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_4}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* "constraint/constraints.py":666 + * for value in domain[:]: + * if prod * value > maxprod: + * domain.hideValue(value) # <<<<<<<<<<<<<< + * if not domain: + * return False +*/ + __pyx_t_4 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_7 = 0; + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_value}; + __pyx_t_10 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 666, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "constraint/constraints.py":666 - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - * set = self._set - * for variable in variables: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* "constraint/constraints.py":665 + * domain = domains[variable] + * for value in domain[:]: + * if prod * value > maxprod: # <<<<<<<<<<<<<< + * domain.hideValue(value) + * if not domain: +*/ + } - /* "constraint/constraints.py":672 - * domain.remove(value) - * vconstraints[variable].remove((self, variables)) - * constraints.remove((self, variables)) # <<<<<<<<<<<<<< + /* "constraint/constraints.py":664 + * if variable not in assignments: + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if prod * value > maxprod: + * domain.hideValue(value) +*/ + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "constraint/constraints.py":667 + * if prod * value > maxprod: + * 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, 667, __pyx_L1_error) + __pyx_t_11 = (!__pyx_t_5); + if (__pyx_t_11) { + + /* "constraint/constraints.py":668 + * 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":667 + * if prod * value > maxprod: + * domain.hideValue(value) + * if not domain: # <<<<<<<<<<<<<< + * return False + * return True +*/ + } + + /* "constraint/constraints.py":662 + * if forwardcheck: + * for variable in variables: + * if variable not in assignments: # <<<<<<<<<<<<<< + * domain = domains[variable] + * for value in domain[:]: +*/ + } + + /* "constraint/constraints.py":661 + * return False + * if forwardcheck: + * for variable in variables: # <<<<<<<<<<<<<< + * if variable not in assignments: + * domain = domains[variable] +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":660 + * if prod > maxprod: + * return False + * if forwardcheck: # <<<<<<<<<<<<<< + * for variable in variables: + * if variable not in assignments: +*/ + } + + /* "constraint/constraints.py":669 + * if not domain: + * return False + * return True # <<<<<<<<<<<<<< * - */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __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)) __PYX_ERR(0, 672, __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)) __PYX_ERR(0, 672, __pyx_L1_error); - __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_remove, __pyx_v_constraints, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 672, __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; + * +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; - /* "constraint/constraints.py":664 - * raise RuntimeError("Can't happen") + /* "constraint/constraints.py":650 + * domain.remove(value) * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * set = self._set - * for variable in variables: - */ + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * maxprod = self._maxprod + * prod = 1 +*/ /* 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); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("constraint.constraints.NotInSetConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_set); + __Pyx_XDECREF(__pyx_v_maxprod); + __Pyx_XDECREF(__pyx_v_prod); __Pyx_XDECREF(__pyx_v_variable); __Pyx_XDECREF(__pyx_v_domain); __Pyx_XDECREF(__pyx_v_value); @@ -18561,25 +17415,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr return __pyx_r; } -/* "constraint/constraints.py":686 - * """ +/* "constraint/constraints.py":675 + * """Constraint enforcing that values of given variables create a product up to at least a given amount.""" * - * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< - * """Initialization method. + * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< + * """Instantiate a MinProdConstraint. * - */ +*/ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_1__init__(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_19SomeInSetConstraint___init__, "Initialization method.\n\n Args:\n set (set): Set of values to be checked\n n (int): Minimum number of assigned values that should be\n present in set (default is 1)\n exact (bool): Whether the number of assigned values which\n are present in set must be exactly `n`\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_19SomeInSetConstraint_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_19SomeInSetConstraint___init__}; -static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_1__init__(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_17MinProdConstraint___init__, "Instantiate a MinProdConstraint.\n\n Args:\n minprod: Value to be considered as the maximum product\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_17MinProdConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MinProdConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_17MinProdConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -18587,14 +17441,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_set = 0; - PyObject *__pyx_v_n = 0; - PyObject *__pyx_v_exact = 0; + PyObject *__pyx_v_minprod = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[4] = {0,0,0,0}; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -18602,7 +17454,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -18610,155 +17462,91 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_set,&__pyx_n_s_n,&__pyx_n_s_exact,0}; - values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1))); - values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 675, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 675, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + 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; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_set)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 686, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exact); - if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 686, __pyx_L3_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, 675, __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, 675, __pyx_L3_error) } } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; } else { - switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 675, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 675, __pyx_L3_error) } __pyx_v_self = values[0]; - __pyx_v_set = values[1]; - __pyx_v_n = values[2]; - __pyx_v_exact = values[3]; + __pyx_v_minprod = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 686, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 675, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.SomeInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_19SomeInSetConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_set, __pyx_v_n, __pyx_v_exact); + __pyx_r = __pyx_pf_10constraint_11constraints_17MinProdConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_minprod); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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_19SomeInSetConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set, PyObject *__pyx_v_n, PyObject *__pyx_v_exact) { +static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_minprod) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); - - /* "constraint/constraints.py":696 - * 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_n_s_set_2, __pyx_v_set) < 0) __PYX_ERR(0, 696, __pyx_L1_error) + __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":697 + /* "constraint/constraints.py":681 + * minprod: Value to be considered as the maximum product * """ - * self._set = set - * self._n = n # <<<<<<<<<<<<<< - * self._exact = exact - * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_n_2, __pyx_v_n) < 0) __PYX_ERR(0, 697, __pyx_L1_error) - - /* "constraint/constraints.py":698 - * self._set = set - * self._n = n - * self._exact = exact # <<<<<<<<<<<<<< + * self._minprod = minprod # <<<<<<<<<<<<<< * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_exact_2, __pyx_v_exact) < 0) __PYX_ERR(0, 698, __pyx_L1_error) + * 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, 681, __pyx_L1_error) - /* "constraint/constraints.py":686 - * """ + /* "constraint/constraints.py":675 + * """Constraint enforcing that values of given variables create a product up to at least a given amount.""" * - * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< - * """Initialization method. + * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< + * """Instantiate a MinProdConstraint. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.SomeInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -18766,24 +17554,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini return __pyx_r; } -/* "constraint/constraints.py":700 - * self._exact = exact +/* "constraint/constraints.py":683 + * self._minprod = minprod * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * set = self._set - * missing = 0 - */ + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * +*/ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_3__call__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_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_19SomeInSetConstraint_3__call__ = {"__call__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_3__call__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_17MinProdConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MinProdConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_3preProcess(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -18793,8 +17581,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds PyObject *__pyx_v_self = 0; PyObject *__pyx_v_variables = 0; PyObject *__pyx_v_domains = 0; - PyObject *__pyx_v_assignments = 0; - PyObject *__pyx_v_forwardcheck = 0; + PyObject *__pyx_v_constraints = 0; + PyObject *__pyx_v_vconstraints = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -18805,9 +17593,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + __Pyx_RefNannySetupContext("preProcess (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -18815,900 +17603,858 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,0}; - values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 683, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 683, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 683, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 683, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 683, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 683, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 700, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 700, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 1); __PYX_ERR(0, 700, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 700, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 2); __PYX_ERR(0, 700, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 700, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 3); __PYX_ERR(0, 700, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 700, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(0, 700, __pyx_L3_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, 683, __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, 683, __pyx_L3_error) } } + } else if (unlikely(__pyx_nargs != 5)) { + goto __pyx_L5_argtuple_error; } else { - switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 683, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 683, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 683, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 683, __pyx_L3_error) + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 683, __pyx_L3_error) } __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_v_constraints = ((PyObject*)values[3]); + __pyx_v_vconstraints = ((PyObject*)values[4]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 700, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 683, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.SomeInSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.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", 1))) __PYX_ERR(0, 700, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 700, __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); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 683, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 683, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 683, __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 */ 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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_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) { - PyObject *__pyx_v_set = NULL; - PyObject *__pyx_v_missing = NULL; - PyObject *__pyx_v_found = NULL; +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) { + PyObject *__pyx_v_minprod = NULL; PyObject *__pyx_v_variable = NULL; PyObject *__pyx_v_domain = NULL; PyObject *__pyx_v_value = 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_2 = NULL; + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; + size_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - unsigned int __pyx_t_12; + int __pyx_t_10; + int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":701 + /* "constraint/constraints.py":684 * - * 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_n_s_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_set = __pyx_t_1; - __pyx_t_1 = 0; - - /* "constraint/constraints.py":702 - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - * set = self._set - * missing = 0 # <<<<<<<<<<<<<< - * found = 0 - * for variable in variables: - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_missing = __pyx_int_0; + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< + * + * # prune the associated variables of values > maxprod +*/ + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 684, __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, 684, __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(__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, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":703 - * set = self._set - * missing = 0 - * found = 0 # <<<<<<<<<<<<<< + /* "constraint/constraints.py":687 + * + * # prune the associated variables of values > maxprod + * minprod = self._minprod # <<<<<<<<<<<<<< * for variable in variables: - * if variable in assignments: - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_found = __pyx_int_0; + * 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, 687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_minprod = __pyx_t_1; + __pyx_t_1 = 0; - /* "constraint/constraints.py":704 - * missing = 0 - * found = 0 + /* "constraint/constraints.py":688 + * # prune the associated variables of values > maxprod + * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< - * if variable in assignments: - * found += assignments[variable] in set - */ + * domain = domains[variable] + * for value in domain[:]: +*/ 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; + __pyx_t_6 = 0; + __pyx_t_7 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __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, 688, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_3)) { + 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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 704, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 688, __pyx_L1_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 704, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 704, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 688, __pyx_L1_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 704, __pyx_L1_error) + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); #endif + ++__pyx_t_6; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); + __pyx_t_4 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 704, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 688, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_4); } + __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":705 - * found = 0 + /* "constraint/constraints.py":689 + * minprod = self._minprod * 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, 705, __pyx_L1_error) - if (__pyx_t_5) { + * 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, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":706 + /* "constraint/constraints.py":690 * 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, 706, __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, 706, __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, 706, __pyx_L1_error) + * 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, 690, __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, 690, __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, 690, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + for (;;) { + if (likely(!__pyx_t_9)) { + 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, 690, __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_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, 690, __pyx_L1_error) + #endif + if (__pyx_t_8 >= __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_8)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); + #endif + ++__pyx_t_8; + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __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, 690, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_found, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); + __pyx_t_4 = 0; + + /* "constraint/constraints.py":691 + * 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, 691, __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, 691, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF_SET(__pyx_v_found, __pyx_t_6); - __pyx_t_6 = 0; + __pyx_t_10 = __pyx_t_11; + __pyx_L8_bool_binop_done:; + if (__pyx_t_10) { - /* "constraint/constraints.py":705 - * found = 0 - * for variable in variables: - * if variable in assignments: # <<<<<<<<<<<<<< - * found += assignments[variable] in set - * else: - */ - goto __pyx_L5; - } + /* "constraint/constraints.py":692 + * for value in domain[:]: + * if value == 0 and minprod > 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_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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":708 - * found += assignments[variable] in set - * else: - * missing += 1 # <<<<<<<<<<<<<< - * if missing: - * if self._exact: - */ - /*else*/ { - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_missing, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 708, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF_SET(__pyx_v_missing, __pyx_t_6); - __pyx_t_6 = 0; + /* "constraint/constraints.py":691 + * domain = domains[variable] + * for value in domain[:]: + * if value == 0 and minprod > 0: # <<<<<<<<<<<<<< + * domain.remove(value) + * +*/ + } + + /* "constraint/constraints.py":690 + * for variable in variables: + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value == 0 and minprod > 0: + * domain.remove(value) +*/ } - __pyx_L5:; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":704 - * missing = 0 - * found = 0 + /* "constraint/constraints.py":688 + * # prune the associated variables of values > maxprod + * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< - * if variable in assignments: - * found += assignments[variable] in set - */ + * domain = domains[variable] + * for value in domain[:]: +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":709 - * 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, 709, __pyx_L1_error) - if (__pyx_t_5) { + /* "constraint/constraints.py":683 + * self._minprod = minprod + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * +*/ - /* "constraint/constraints.py":710 - * 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_n_s_exact_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __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, 710, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { + /* 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_AddTraceback("constraint.constraints.MinProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_minprod); + __Pyx_XDECREF(__pyx_v_variable); + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "constraint/constraints.py":711 - * 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_n_s_n_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __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, 711, __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, 711, __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, 711, __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, 711, __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":712 - * if self._exact: - * if not (found <= self._n <= missing + found): - * return False # <<<<<<<<<<<<<< - * else: - * if self._n > missing + found: - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; +/* "constraint/constraints.py":694 + * 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: +*/ - /* "constraint/constraints.py":711 - * if missing: - * if self._exact: - * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< - * return False - * else: - */ +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_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_17MinProdConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MinProdConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_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 +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_variables = 0; + CYTHON_UNUSED PyObject *__pyx_v_domains = 0; + PyObject *__pyx_v_assignments = 0; + CYTHON_UNUSED PyObject *__pyx_v_forwardcheck = 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("__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,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 (__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, 694, __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, 694, __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) + 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) + 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) + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; } - - /* "constraint/constraints.py":710 - * missing += 1 - * if missing: - * if self._exact: # <<<<<<<<<<<<<< - * if not (found <= self._n <= missing + found): - * return False - */ - goto __pyx_L8; + 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, 694, __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, 694, __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, 694, __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, 694, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 694, __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) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 694, __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, 694, __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.MinProdConstraint.__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, 694, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 694, __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); - /* "constraint/constraints.py":714 - * return False - * else: - * if self._n > missing + found: # <<<<<<<<<<<<<< - * return False - * if forwardcheck and self._n - found == missing: - */ - /*else*/ { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 714, __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, 714, __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, 714, __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, 714, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_7) { + /* 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; +} - /* "constraint/constraints.py":715 - * else: - * if self._n > missing + found: - * return False # <<<<<<<<<<<<<< - * if forwardcheck and self._n - found == missing: - * # All unassigned variables must be assigned to - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; +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) { + PyObject *__pyx_v_variable = NULL; + PyObject *__pyx_v_minprod = NULL; + PyObject *__pyx_v_prod = 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_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":714 - * return False - * else: - * if self._n > missing + found: # <<<<<<<<<<<<<< - * return False - * if forwardcheck and self._n - found == missing: - */ + /* "constraint/constraints.py":696 + * 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, 696, __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, 696, __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, 696, __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, 696, __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, 696, __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, 696, __pyx_L1_error) + PyErr_Clear(); + } + break; } } - __pyx_L8:; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":716 - * 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, 716, __pyx_L1_error) + /* "constraint/constraints.py":697 + * # 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, 697, __pyx_L1_error) if (__pyx_t_5) { - } else { - __pyx_t_7 = __pyx_t_5; - goto __pyx_L12_bool_binop_done; + + /* "constraint/constraints.py":698 + * 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":697 + * # check if each variable is in the assignments + * for variable in variables: + * if variable not in assignments: # <<<<<<<<<<<<<< + * return True + * +*/ } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 716, __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, 716, __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, 716, __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, 716, __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":719 - * # All unassigned variables must be assigned to - * # values in the set. - * 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_4 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_4); - __pyx_t_2 = 0; - __pyx_t_3 = NULL; + /* "constraint/constraints.py":696 + * 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":701 + * + * # 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, 701, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_minprod = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":702 + * # with each variable assigned, sum the values + * minprod = self._minprod + * prod = 1 # <<<<<<<<<<<<<< + * for variable in variables: + * prod *= assignments[variable] +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); + __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; + + /* "constraint/constraints.py":703 + * minprod = self._minprod + * prod = 1 + * for variable in variables: # <<<<<<<<<<<<<< + * prod *= assignments[variable] + * if isinstance(prod, float): +*/ + 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, 703, __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, 703, __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, 703, __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 { - __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 719, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 719, __pyx_L1_error) + { + 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, 703, __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; } - for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 719, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 719, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 719, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 719, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_3(__pyx_t_4); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 719, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __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, 703, __pyx_L1_error) + PyErr_Clear(); } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); - __pyx_t_1 = 0; - - /* "constraint/constraints.py":720 - * # 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, 720, __pyx_L1_error) - if (__pyx_t_7) { + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":721 - * 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, 721, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); - __pyx_t_1 = 0; + /* "constraint/constraints.py":704 + * 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, 704, __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, 704, __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":722 - * 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_slice_, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __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, 722, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 722, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_9)) { - if (likely(PyList_CheckExact(__pyx_t_6))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 722, __pyx_L1_error) - #endif - if (__pyx_t_8 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 722, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 722, __pyx_L1_error) - #endif - if (__pyx_t_8 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 722, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_9(__pyx_t_6); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 722, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); - __pyx_t_1 = 0; + /* "constraint/constraints.py":703 + * minprod = self._minprod + * prod = 1 + * for variable in variables: # <<<<<<<<<<<<<< + * prod *= assignments[variable] + * if isinstance(prod, float): +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":723 - * 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, 723, __pyx_L1_error) - if (__pyx_t_7) { + /* "constraint/constraints.py":705 + * for variable in variables: + * prod *= assignments[variable] + * if isinstance(prod, float): # <<<<<<<<<<<<<< + * prod = round(prod, 10) + * return prod >= minprod +*/ + __pyx_t_5 = PyFloat_Check(__pyx_v_prod); + if (__pyx_t_5) { - /* "constraint/constraints.py":724 - * for value in domain[:]: - * if value not in set: - * domain.hideValue(value) # <<<<<<<<<<<<<< - * if not domain: - * return False - */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 724, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = NULL; - __pyx_t_12 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_12 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_value}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 724, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* "constraint/constraints.py":706 + * prod *= assignments[variable] + * if isinstance(prod, float): + * prod = round(prod, 10) # <<<<<<<<<<<<<< + * return prod >= minprod + * +*/ + __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_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, 706, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":723 - * domain = domains[variable] - * for value in domain[:]: - * if value not in set: # <<<<<<<<<<<<<< - * domain.hideValue(value) - * if not domain: - */ - } + /* "constraint/constraints.py":705 + * for variable in variables: + * prod *= assignments[variable] + * if isinstance(prod, float): # <<<<<<<<<<<<<< + * prod = round(prod, 10) + * return prod >= minprod +*/ + } - /* "constraint/constraints.py":722 - * if variable not in assignments: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value not in set: - * domain.hideValue(value) - */ - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + /* "constraint/constraints.py":707 + * if isinstance(prod, float): + * prod = round(prod, 10) + * return prod >= minprod # <<<<<<<<<<<<<< + * + * +*/ + __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, 707, __pyx_L1_error) + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "constraint/constraints.py":725 - * 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, 725, __pyx_L1_error) - __pyx_t_5 = (!__pyx_t_7); - if (__pyx_t_5) { - - /* "constraint/constraints.py":726 - * domain.hideValue(value) - * if not domain: - * return False # <<<<<<<<<<<<<< - * else: - * if self._exact: - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L0; - - /* "constraint/constraints.py":725 - * if value not in set: - * domain.hideValue(value) - * if not domain: # <<<<<<<<<<<<<< - * return False - * else: - */ - } - - /* "constraint/constraints.py":720 - * # values in the set. - * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: - */ - } - - /* "constraint/constraints.py":719 - * # All unassigned variables must be assigned to - * # values in the set. - * for variable in variables: # <<<<<<<<<<<<<< - * if variable not in assignments: - * domain = domains[variable] - */ - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "constraint/constraints.py":716 - * 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. - */ - } - - /* "constraint/constraints.py":709 - * else: - * missing += 1 - * if missing: # <<<<<<<<<<<<<< - * if self._exact: - * if not (found <= self._n <= missing + found): - */ - goto __pyx_L7; - } - - /* "constraint/constraints.py":728 - * return False - * else: - * if self._exact: # <<<<<<<<<<<<<< - * if found != self._n: - * return False - */ - /*else*/ { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_exact_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 728, __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, 728, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_5) { - - /* "constraint/constraints.py":729 - * else: - * if self._exact: - * if found != self._n: # <<<<<<<<<<<<<< - * return False - * else: - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 729, __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, 729, __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, 729, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__pyx_t_5) { - - /* "constraint/constraints.py":730 - * if self._exact: - * if found != self._n: - * return False # <<<<<<<<<<<<<< - * else: - * if found < self._n: - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - - /* "constraint/constraints.py":729 - * else: - * if self._exact: - * if found != self._n: # <<<<<<<<<<<<<< - * return False - * else: - */ - } - - /* "constraint/constraints.py":728 - * return False - * else: - * if self._exact: # <<<<<<<<<<<<<< - * if found != self._n: - * return False - */ - goto __pyx_L23; - } - - /* "constraint/constraints.py":732 - * return False - * else: - * if found < self._n: # <<<<<<<<<<<<<< - * return False - * return True - */ - /*else*/ { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 732, __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, 732, __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, 732, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_5) { - - /* "constraint/constraints.py":733 - * 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":732 - * return False - * else: - * if found < self._n: # <<<<<<<<<<<<<< - * return False - * return True - */ - } - } - __pyx_L23:; - } - __pyx_L7:; - - /* "constraint/constraints.py":734 - * 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":700 - * self._exact = exact + /* "constraint/constraints.py":694 + * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * set = self._set - * missing = 0 - */ + * # check if each variable is in the assignments + * for variable in variables: +*/ /* 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_10); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_AddTraceback("constraint.constraints.SomeInSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_set); - __Pyx_XDECREF(__pyx_v_missing); - __Pyx_XDECREF(__pyx_v_found); __Pyx_XDECREF(__pyx_v_variable); - __Pyx_XDECREF(__pyx_v_domain); - __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_minprod); + __Pyx_XDECREF(__pyx_v_prod); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":748 +/* "constraint/constraints.py":721 * """ * - * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< + * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_1__init__(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_22SomeNotInSetConstraint___init__, "Initialization method.\n\n Args:\n set (set): Set of values to be checked\n n (int): Minimum number of assigned values that should not\n be present in set (default is 1)\n exact (bool): Whether the number of assigned values which\n are not present in set must be exactly `n`\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_22SomeNotInSetConstraint_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_22SomeNotInSetConstraint___init__}; -static PyObject *__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_1__init__(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_15InSetConstraint___init__, "Initialization method.\n\n Args:\n set (set): Set of allowed values\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_15InSetConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_15InSetConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_15InSetConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -19717,13 +18463,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_set = 0; - PyObject *__pyx_v_n = 0; - PyObject *__pyx_v_exact = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[4] = {0,0,0,0}; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -19731,7 +18475,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -19739,155 +18483,91 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_set,&__pyx_n_s_n,&__pyx_n_s_exact,0}; - values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1))); - values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 721, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 721, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 721, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 748, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_set)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 748, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 748, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 748, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exact); - if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 748, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 748, __pyx_L3_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, 721, __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, 721, __pyx_L3_error) } } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; } else { - switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 721, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 721, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_set = values[1]; - __pyx_v_n = values[2]; - __pyx_v_exact = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 748, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 721, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.SomeNotInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.InSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_set, __pyx_v_n, __pyx_v_exact); + __pyx_r = __pyx_pf_10constraint_11constraints_15InSetConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_set); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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_22SomeNotInSetConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set, PyObject *__pyx_v_n, PyObject *__pyx_v_exact) { +static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":758 - * are not present in set must be exactly `n` + /* "constraint/constraints.py":727 + * set (set): Set of allowed values * """ * self._set = set # <<<<<<<<<<<<<< - * self._n = n - * self._exact = exact - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_set_2, __pyx_v_set) < 0) __PYX_ERR(0, 758, __pyx_L1_error) - - /* "constraint/constraints.py":759 - * """ - * self._set = set - * self._n = n # <<<<<<<<<<<<<< - * self._exact = exact - * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_n_2, __pyx_v_n) < 0) __PYX_ERR(0, 759, __pyx_L1_error) - - /* "constraint/constraints.py":760 - * 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_n_s_exact_2, __pyx_v_exact) < 0) __PYX_ERR(0, 760, __pyx_L1_error) + * 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, 727, __pyx_L1_error) - /* "constraint/constraints.py":748 + /* "constraint/constraints.py":721 * """ * - * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< + * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.SomeNotInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.InSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -19895,35 +18575,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ return __pyx_r; } -/* "constraint/constraints.py":762 - * self._exact = exact +/* "constraint/constraints.py":729 + * self._set = set * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * set = self._set - * missing = 0 - */ + * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * # preProcess() will remove it. + * raise RuntimeError("Can't happen") +*/ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_3__call__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_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_22SomeNotInSetConstraint_3__call__ = {"__call__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_3__call__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_15InSetConstraint_3__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_15InSetConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_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 ) { - PyObject *__pyx_v_self = 0; - 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_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; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -19936,7 +18616,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -19944,132 +18624,283 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,0}; - values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 729, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 729, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 729, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 729, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 729, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 729, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 762, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 762, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 1); __PYX_ERR(0, 762, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 762, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 2); __PYX_ERR(0, 762, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 762, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, 3); __PYX_ERR(0, 762, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 762, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(0, 762, __pyx_L3_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, 729, __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, 729, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 729, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 729, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 729, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 729, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 729, __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_domains = values[2]; + __pyx_v_assignments = 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, 762, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 729, __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.InSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); + + /* 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_15InSetConstraint_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) { + 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":731 + * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 + * # preProcess() will remove it. + * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< + * + * 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; + { + 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_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, 731, __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, 731, __pyx_L1_error) + + /* "constraint/constraints.py":729 + * self._set = set + * + * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * # preProcess() will remove it. + * raise RuntimeError("Can't happen") +*/ + + /* 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.InSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":733 + * 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: +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_5preProcess(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_15InSetConstraint_5preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_15InSetConstraint_5preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_5preProcess(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); { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + 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, 733, __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, 733, __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, 733, __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, 733, __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, 733, __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, 733, __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, 733, __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, 733, __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, 733, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 733, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 733, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 733, __pyx_L3_error) + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 733, __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]); } - __Pyx_AddTraceback("constraint.constraints.SomeNotInSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 733, __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.InSetConstraint.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", 1))) __PYX_ERR(0, 762, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 762, __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); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 733, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 733, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 733, __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 */ 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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_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) { +static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProcess(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_set = NULL; - PyObject *__pyx_v_missing = NULL; - PyObject *__pyx_v_found = NULL; PyObject *__pyx_v_variable = NULL; PyObject *__pyx_v_domain = NULL; PyObject *__pyx_v_value = NULL; @@ -20079,1806 +18910,4479 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ 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; - int __pyx_t_7; - Py_ssize_t __pyx_t_8; - PyObject *(*__pyx_t_9)(PyObject *); - PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + size_t __pyx_t_10; PyObject *__pyx_t_11 = NULL; - unsigned int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":763 + /* "constraint/constraints.py":734 * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set # <<<<<<<<<<<<<< - * missing = 0 - * found = 0 - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error) + * 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, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":764 - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - * set = self._set - * missing = 0 # <<<<<<<<<<<<<< - * found = 0 - * for variable in variables: - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_missing = __pyx_int_0; - - /* "constraint/constraints.py":765 + /* "constraint/constraints.py":735 + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set - * missing = 0 - * found = 0 # <<<<<<<<<<<<<< - * for variable in variables: - * if variable in assignments: - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_found = __pyx_int_0; - - /* "constraint/constraints.py":766 - * missing = 0 - * found = 0 * for variable in variables: # <<<<<<<<<<<<<< - * if variable in assignments: - * found += assignments[variable] not in set - */ + * domain = domains[variable] + * for value in domain[:]: +*/ 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, 766, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 766, __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, 735, __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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 766, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 735, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 766, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 766, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 766, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 735, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 766, __pyx_L1_error) + __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); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 766, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif + ++__pyx_t_2; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 766, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 735, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_4); } + __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":767 - * found = 0 + /* "constraint/constraints.py":736 + * set = self._set * 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, 767, __pyx_L1_error) - if (__pyx_t_5) { + * 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, 736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":768 + /* "constraint/constraints.py":737 * 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, 768, __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, 768, __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, 768, __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, 768, __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); + * 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, 737, __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, 737, __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, 737, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + for (;;) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_5))) { + { + 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, 737, __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_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, 737, __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_5, __pyx_t_6)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __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, 737, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":767 - * found = 0 + /* "constraint/constraints.py":738 + * 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, 738, __pyx_L1_error) + if (__pyx_t_8) { + + /* "constraint/constraints.py":739 + * for value in domain[:]: + * if value not in set: + * domain.remove(value) # <<<<<<<<<<<<<< + * vconstraints[variable].remove((self, variables)) + * constraints.remove((self, variables)) +*/ + __pyx_t_9 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_9); + __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_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":738 + * domain = domains[variable] + * for value in domain[:]: + * if value not in set: # <<<<<<<<<<<<<< + * domain.remove(value) + * vconstraints[variable].remove((self, variables)) +*/ + } + + /* "constraint/constraints.py":737 * for variable in variables: - * if variable in assignments: # <<<<<<<<<<<<<< - * found += assignments[variable] not in set - * else: - */ - goto __pyx_L5; + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value not in set: + * domain.remove(value) +*/ } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":770 - * found += assignments[variable] not in set - * else: - * missing += 1 # <<<<<<<<<<<<<< - * if missing: - * if self._exact: - */ - /*else*/ { - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_missing, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 770, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF_SET(__pyx_v_missing, __pyx_t_6); - __pyx_t_6 = 0; + /* "constraint/constraints.py":740 + * 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, 740, __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, 740, __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, 740, __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, 740, __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_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, 740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_L5:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":766 - * missing = 0 - * found = 0 + /* "constraint/constraints.py":735 + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 + * set = self._set * for variable in variables: # <<<<<<<<<<<<<< - * if variable in assignments: - * found += assignments[variable] not in set - */ + * domain = domains[variable] + * for value in domain[:]: +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":771 - * 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, 771, __pyx_L1_error) - if (__pyx_t_5) { - - /* "constraint/constraints.py":772 - * 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_n_s_exact_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __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, 772, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "constraint/constraints.py":773 - * 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_n_s_n_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 773, __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, 773, __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, 773, __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, 773, __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, 773, __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":774 - * if self._exact: - * if not (found <= self._n <= missing + found): - * return False # <<<<<<<<<<<<<< - * else: - * if self._n > missing + found: - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - - /* "constraint/constraints.py":773 - * if missing: - * if self._exact: - * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< - * return False - * else: - */ - } + /* "constraint/constraints.py":741 + * 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, 741, __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, 741, __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, 741, __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, 741, __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":772 - * missing += 1 - * if missing: - * if self._exact: # <<<<<<<<<<<<<< - * if not (found <= self._n <= missing + found): - * return False - */ - goto __pyx_L8; - } + /* "constraint/constraints.py":733 + * 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: +*/ - /* "constraint/constraints.py":776 - * return False - * else: - * if self._n > missing + found: # <<<<<<<<<<<<<< - * return False - * if forwardcheck and self._n - found == missing: - */ - /*else*/ { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 776, __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, 776, __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, 776, __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, 776, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_7) { + /* 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); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("constraint.constraints.InSetConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_set); + __Pyx_XDECREF(__pyx_v_variable); + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "constraint/constraints.py":777 - * else: - * if self._n > missing + found: - * return False # <<<<<<<<<<<<<< - * if forwardcheck and self._n - found == missing: - * # All unassigned variables must be assigned to - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; +/* "constraint/constraints.py":755 + * """ + * + * def __init__(self, set): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ - /* "constraint/constraints.py":776 - * return False - * else: - * if self._n > missing + found: # <<<<<<<<<<<<<< - * return False - * if forwardcheck and self._n - found == missing: - */ +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_1__init__(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_18NotInSetConstraint___init__, "Initialization method.\n\n Args:\n set (set): Set of disallowed values\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_18NotInSetConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18NotInSetConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_18NotInSetConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_1__init__(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_set = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (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_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, 755, __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, 755, __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, 755, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; } - } - __pyx_L8:; - - /* "constraint/constraints.py":778 - * 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, 778, __pyx_L1_error) - if (__pyx_t_5) { + 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, 755, __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, 755, __pyx_L3_error) } + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; } else { - __pyx_t_7 = __pyx_t_5; - goto __pyx_L12_bool_binop_done; + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 755, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 755, __pyx_L3_error) } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 778, __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, 778, __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, 778, __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, 778, __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) { + __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, 755, __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.NotInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10constraint_11constraints_18NotInSetConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_set); - /* "constraint/constraints.py":781 - * # All unassigned variables must be assigned to - * # values not in the set. - * 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_4 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_4); - __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, 781, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 781, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 781, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 781, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 781, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_3(__pyx_t_4); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 781, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); - __pyx_t_1 = 0; + /* 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; +} - /* "constraint/constraints.py":782 - * # 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, 782, __pyx_L1_error) - if (__pyx_t_7) { +static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":783 - * 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, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); - __pyx_t_1 = 0; + /* "constraint/constraints.py":761 + * 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, 761, __pyx_L1_error) - /* "constraint/constraints.py":784 - * 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_slice_, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __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, 784, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 784, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_9)) { - if (likely(PyList_CheckExact(__pyx_t_6))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 784, __pyx_L1_error) - #endif - if (__pyx_t_8 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 784, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 784, __pyx_L1_error) - #endif - if (__pyx_t_8 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 784, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_9(__pyx_t_6); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 784, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); - __pyx_t_1 = 0; + /* "constraint/constraints.py":755 + * """ + * + * def __init__(self, set): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ - /* "constraint/constraints.py":785 - * 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, 785, __pyx_L1_error) - if (__pyx_t_7) { + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.NotInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "constraint/constraints.py":786 - * for value in domain[:]: - * if value in set: - * domain.hideValue(value) # <<<<<<<<<<<<<< - * if not domain: - * return False - */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 786, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = NULL; - __pyx_t_12 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_12 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_value}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 786, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +/* "constraint/constraints.py":763 + * self._set = set + * + * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * # preProcess() will remove it. + * raise RuntimeError("Can't happen") +*/ - /* "constraint/constraints.py":785 - * domain = domains[variable] - * for value in domain[:]: - * if value in set: # <<<<<<<<<<<<<< - * domain.hideValue(value) - * if not domain: - */ - } - - /* "constraint/constraints.py":784 - * if variable not in assignments: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value in set: - * domain.hideValue(value) - */ - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "constraint/constraints.py":787 - * 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, 787, __pyx_L1_error) - __pyx_t_5 = (!__pyx_t_7); - if (__pyx_t_5) { - - /* "constraint/constraints.py":788 - * domain.hideValue(value) - * if not domain: - * return False # <<<<<<<<<<<<<< - * else: - * if self._exact: - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L0; - - /* "constraint/constraints.py":787 - * if value in set: - * domain.hideValue(value) - * if not domain: # <<<<<<<<<<<<<< - * return False - * else: - */ - } - - /* "constraint/constraints.py":782 - * # values not in the set. - * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: - */ - } - - /* "constraint/constraints.py":781 - * # All unassigned variables must be assigned to - * # values not in the set. - * for variable in variables: # <<<<<<<<<<<<<< - * if variable not in assignments: - * domain = domains[variable] - */ +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_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_18NotInSetConstraint_3__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18NotInSetConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_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; + #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("__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,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, 763, __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, 763, __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, 763, __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, 763, __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, 763, __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, 763, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "constraint/constraints.py":778 - * 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. - */ + 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, 763, __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, 763, __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, 763, __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, 763, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 763, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 763, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 763, __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 = values[2]; + __pyx_v_assignments = 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, 763, __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.NotInSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); - /* "constraint/constraints.py":771 - * else: - * missing += 1 - * if missing: # <<<<<<<<<<<<<< - * if self._exact: - * if not (found <= self._n <= missing + found): - */ - goto __pyx_L7; + /* 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; +} - /* "constraint/constraints.py":790 - * return False - * else: - * if self._exact: # <<<<<<<<<<<<<< - * if found != self._n: - * return False - */ - /*else*/ { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_exact_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __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, 790, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_5) { +static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_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) { + 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":791 - * else: - * if self._exact: - * if found != self._n: # <<<<<<<<<<<<<< - * return False - * else: - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 791, __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, 791, __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, 791, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__pyx_t_5) { + /* "constraint/constraints.py":765 + * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 + * # preProcess() will remove it. + * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< + * + * 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; + { + 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_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, 765, __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, 765, __pyx_L1_error) - /* "constraint/constraints.py":792 - * if self._exact: - * if found != self._n: - * return False # <<<<<<<<<<<<<< - * else: - * if found < self._n: - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; + /* "constraint/constraints.py":763 + * self._set = set + * + * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * # preProcess() will remove it. + * raise RuntimeError("Can't happen") +*/ - /* "constraint/constraints.py":791 - * else: - * if self._exact: - * if found != self._n: # <<<<<<<<<<<<<< - * return False - * else: - */ - } + /* 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.NotInSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "constraint/constraints.py":790 - * return False - * else: - * if self._exact: # <<<<<<<<<<<<<< - * if found != self._n: - * return False - */ - goto __pyx_L23; - } +/* "constraint/constraints.py":767 + * 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: +*/ - /* "constraint/constraints.py":794 - * return False - * else: - * if found < self._n: # <<<<<<<<<<<<<< - * return False - * return True - */ - /*else*/ { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 794, __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, 794, __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, 794, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_5) { - - /* "constraint/constraints.py":795 - * 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":794 - * return False - * else: - * if found < self._n: # <<<<<<<<<<<<<< - * return False - * return True - */ +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_5preProcess(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_18NotInSetConstraint_5preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18NotInSetConstraint_5preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_5preProcess(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, 767, __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, 767, __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, 767, __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, 767, __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, 767, __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, 767, __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, 767, __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, 767, __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, 767, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 767, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 767, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 767, __pyx_L3_error) + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 767, __pyx_L3_error) } - __pyx_L23:; + __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]); } - __pyx_L7:; - - /* "constraint/constraints.py":796 - * 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":762 - * self._exact = exact - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * set = self._set - * missing = 0 - */ + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 767, __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.NotInSetConstraint.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, 767, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 767, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 767, __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 */ + goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_AddTraceback("constraint.constraints.SomeNotInSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __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:; - __Pyx_XDECREF(__pyx_v_set); - __Pyx_XDECREF(__pyx_v_missing); - __Pyx_XDECREF(__pyx_v_found); - __Pyx_XDECREF(__pyx_v_variable); - __Pyx_XDECREF(__pyx_v_domain); - __Pyx_XDECREF(__pyx_v_value); - __Pyx_XGIVEREF(__pyx_r); + 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; } -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct__genexpr[8]; -static int __pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr = 0; -#endif +static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4preProcess(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_set = NULL; + PyObject *__pyx_v_variable = NULL; + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_value = 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; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + size_t __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("preProcess", 0); -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_freecount_10constraint_11constraints___pyx_scope_struct__genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr)))) { - o = (PyObject*)__pyx_freelist_10constraint_11constraints___pyx_scope_struct__genexpr[--__pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr)); - (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/constraints.py":768 + * + * 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, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_set = __pyx_t_1; + __pyx_t_1 = 0; -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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct__genexpr) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } + /* "constraint/constraints.py":769 + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 + * set = self._set + * for variable in variables: # <<<<<<<<<<<<<< + * domain = domains[variable] + * for value in domain[:]: +*/ + 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, 769, __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, 769, __pyx_L1_error) } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_value); - #if CYTHON_USE_FREELISTS - if (((int)(__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)))) { - __pyx_freelist_10constraint_11constraints___pyx_scope_struct__genexpr[__pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *)o); - } else - #endif - { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY - (*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); + 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, 769, __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, 769, __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, 769, __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, 769, __pyx_L1_error) + PyErr_Clear(); + } + break; + } } - #endif - } -} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); + __pyx_t_4 = 0; -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *)o; - 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; -} -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct__genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct__genexpr}, - {0, 0}, -}; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_spec = { - "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, - __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_slots, -}; -#else + /* "constraint/constraints.py":770 + * 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, 770, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); + __pyx_t_4 = 0; -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr = { - PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct__genexpr", /*tp_name*/ - 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*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__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__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 PY_VERSION_HEX >= 0x030400a1 - #if CYTHON_USE_TP_FINALIZE - 0, /*tp_finalize*/ - #else - NULL, /*tp_finalize*/ - #endif - #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!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 + /* "constraint/constraints.py":771 + * 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, 771, __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, 771, __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, 771, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + for (;;) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_5))) { + { + 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, 771, __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_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, 771, __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_5, __pyx_t_6)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 771, __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, 771, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); + __pyx_t_4 = 0; -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_1_genexpr[8]; -static int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr = 0; -#endif + /* "constraint/constraints.py":772 + * 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, 772, __pyx_L1_error) + if (__pyx_t_8) { -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_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_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr)))) { - o = (PyObject*)__pyx_freelist_10constraint_11constraints___pyx_scope_struct_1_genexpr[--__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr)); - (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/constraints.py":773 + * for value in domain[:]: + * if value in set: + * domain.remove(value) # <<<<<<<<<<<<<< + * vconstraints[variable].remove((self, variables)) + * constraints.remove((self, variables)) +*/ + __pyx_t_9 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_9); + __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_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_genexpr(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_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_1_genexpr) { - if (PyObject_CallFinalizerFromDealloc(o)) return; + /* "constraint/constraints.py":772 + * domain = domains[variable] + * for value in domain[:]: + * if value in set: # <<<<<<<<<<<<<< + * domain.remove(value) + * vconstraints[variable].remove((self, variables)) +*/ + } + + /* "constraint/constraints.py":771 + * for variable in variables: + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value in set: + * domain.remove(value) +*/ } - } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_value); - #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr)))) { - __pyx_freelist_10constraint_11constraints___pyx_scope_struct_1_genexpr[__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *)o); - } else - #endif - { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY - (*Py_TYPE(o)->tp_free)(o); - #else + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "constraint/constraints.py":774 + * 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, 774, __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, 774, __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, 774, __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, 774, __pyx_L1_error); + __pyx_t_10 = 0; { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); - if (tp_free) tp_free(o); + 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_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, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - #endif - } -} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *)o; - 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; + /* "constraint/constraints.py":769 + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 + * set = self._set + * for variable in variables: # <<<<<<<<<<<<<< + * domain = domains[variable] + * for value in domain[:]: +*/ } - return 0; -} -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_1_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_genexpr}, - {0, 0}, -}; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_1_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_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_1_genexpr_slots, -}; -#else - -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr = { - PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_1_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_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*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_1_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_1_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 PY_VERSION_HEX >= 0x030400a1 - #if CYTHON_USE_TP_FINALIZE - 0, /*tp_finalize*/ - #else - NULL, /*tp_finalize*/ - #endif - #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!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 PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; -#ifndef CYTHON_SMALL_CODE -#if defined(__clang__) - #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) -#else - #define CYTHON_SMALL_CODE -#endif -#endif -/* #### Code section: pystring_table ### */ - -static int __Pyx_CreateStringTabAndInitStrings(void) { - __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_Abstract_base_class_for_constrai, __pyx_k_Abstract_base_class_for_constrai, sizeof(__pyx_k_Abstract_base_class_for_constrai), 0, 0, 1, 0}, - {&__pyx_n_s_AllDifferentConstraint, __pyx_k_AllDifferentConstraint, sizeof(__pyx_k_AllDifferentConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_AllDifferentConstraint___call, __pyx_k_AllDifferentConstraint___call, sizeof(__pyx_k_AllDifferentConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_AllEqualConstraint, __pyx_k_AllEqualConstraint, sizeof(__pyx_k_AllEqualConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_AllEqualConstraint___call, __pyx_k_AllEqualConstraint___call, sizeof(__pyx_k_AllEqualConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_Callable, __pyx_k_Callable, sizeof(__pyx_k_Callable), 0, 0, 1, 1}, - {&__pyx_kp_u_Can_t_happen, __pyx_k_Can_t_happen, sizeof(__pyx_k_Can_t_happen), 0, 1, 0, 0}, - {&__pyx_n_s_CompilableFunctionConstraint, __pyx_k_CompilableFunctionConstraint, sizeof(__pyx_k_CompilableFunctionConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_CompilableFunctionConstraint___c, __pyx_k_CompilableFunctionConstraint___c, sizeof(__pyx_k_CompilableFunctionConstraint___c), 0, 0, 1, 1}, - {&__pyx_n_s_CompilableFunctionConstraint___i, __pyx_k_CompilableFunctionConstraint___i, sizeof(__pyx_k_CompilableFunctionConstraint___i), 0, 0, 1, 1}, - {&__pyx_kp_u_CompilableFunctionConstraint_can, __pyx_k_CompilableFunctionConstraint_can, sizeof(__pyx_k_CompilableFunctionConstraint_can), 0, 1, 0, 0}, - {&__pyx_n_s_Constraint, __pyx_k_Constraint, sizeof(__pyx_k_Constraint), 0, 0, 1, 1}, - {&__pyx_n_s_Constraint___call, __pyx_k_Constraint___call, sizeof(__pyx_k_Constraint___call), 0, 0, 1, 1}, - {&__pyx_kp_s_Constraint_enforcing_that_at_lea, __pyx_k_Constraint_enforcing_that_at_lea, sizeof(__pyx_k_Constraint_enforcing_that_at_lea), 0, 0, 1, 0}, - {&__pyx_kp_s_Constraint_enforcing_that_at_lea_2, __pyx_k_Constraint_enforcing_that_at_lea_2, sizeof(__pyx_k_Constraint_enforcing_that_at_lea_2), 0, 0, 1, 0}, - {&__pyx_kp_s_Constraint_enforcing_that_values, __pyx_k_Constraint_enforcing_that_values, sizeof(__pyx_k_Constraint_enforcing_that_values), 0, 0, 1, 0}, - {&__pyx_kp_s_Constraint_enforcing_that_values_2, __pyx_k_Constraint_enforcing_that_values_2, sizeof(__pyx_k_Constraint_enforcing_that_values_2), 0, 0, 1, 0}, - {&__pyx_kp_s_Constraint_enforcing_that_values_3, __pyx_k_Constraint_enforcing_that_values_3, sizeof(__pyx_k_Constraint_enforcing_that_values_3), 0, 0, 1, 0}, - {&__pyx_kp_s_Constraint_enforcing_that_values_4, __pyx_k_Constraint_enforcing_that_values_4, sizeof(__pyx_k_Constraint_enforcing_that_values_4), 0, 0, 1, 0}, - {&__pyx_kp_s_Constraint_enforcing_that_values_5, __pyx_k_Constraint_enforcing_that_values_5, sizeof(__pyx_k_Constraint_enforcing_that_values_5), 0, 0, 1, 0}, - {&__pyx_kp_s_Constraint_enforcing_that_values_6, __pyx_k_Constraint_enforcing_that_values_6, sizeof(__pyx_k_Constraint_enforcing_that_values_6), 0, 0, 1, 0}, - {&__pyx_kp_s_Constraint_enforcing_that_values_7, __pyx_k_Constraint_enforcing_that_values_7, sizeof(__pyx_k_Constraint_enforcing_that_values_7), 0, 0, 1, 0}, - {&__pyx_kp_s_Constraint_enforcing_that_values_8, __pyx_k_Constraint_enforcing_that_values_8, sizeof(__pyx_k_Constraint_enforcing_that_values_8), 0, 0, 1, 0}, - {&__pyx_kp_s_Constraint_enforcing_that_values_9, __pyx_k_Constraint_enforcing_that_values_9, sizeof(__pyx_k_Constraint_enforcing_that_values_9), 0, 0, 1, 0}, - {&__pyx_n_s_Constraint_forwardCheck, __pyx_k_Constraint_forwardCheck, sizeof(__pyx_k_Constraint_forwardCheck), 0, 0, 1, 1}, - {&__pyx_n_s_Constraint_preProcess, __pyx_k_Constraint_preProcess, sizeof(__pyx_k_Constraint_preProcess), 0, 0, 1, 1}, - {&__pyx_kp_s_Constraint_which_wraps_a_functio, __pyx_k_Constraint_which_wraps_a_functio, sizeof(__pyx_k_Constraint_which_wraps_a_functio), 0, 0, 1, 0}, - {&__pyx_n_s_ExactSumConstraint, __pyx_k_ExactSumConstraint, sizeof(__pyx_k_ExactSumConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_ExactSumConstraint___call, __pyx_k_ExactSumConstraint___call, sizeof(__pyx_k_ExactSumConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_ExactSumConstraint___init, __pyx_k_ExactSumConstraint___init, sizeof(__pyx_k_ExactSumConstraint___init), 0, 0, 1, 1}, - {&__pyx_n_s_ExactSumConstraint_preProcess, __pyx_k_ExactSumConstraint_preProcess, sizeof(__pyx_k_ExactSumConstraint_preProcess), 0, 0, 1, 1}, - {&__pyx_n_s_FunctionConstraint, __pyx_k_FunctionConstraint, sizeof(__pyx_k_FunctionConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_FunctionConstraint___call, __pyx_k_FunctionConstraint___call, sizeof(__pyx_k_FunctionConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_FunctionConstraint___init, __pyx_k_FunctionConstraint___init, sizeof(__pyx_k_FunctionConstraint___init), 0, 0, 1, 1}, - {&__pyx_n_s_InSetConstraint, __pyx_k_InSetConstraint, sizeof(__pyx_k_InSetConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_InSetConstraint___call, __pyx_k_InSetConstraint___call, sizeof(__pyx_k_InSetConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_InSetConstraint___init, __pyx_k_InSetConstraint___init, sizeof(__pyx_k_InSetConstraint___init), 0, 0, 1, 1}, - {&__pyx_n_s_InSetConstraint_preProcess, __pyx_k_InSetConstraint_preProcess, sizeof(__pyx_k_InSetConstraint_preProcess), 0, 0, 1, 1}, - {&__pyx_n_s_MaxProdConstraint, __pyx_k_MaxProdConstraint, sizeof(__pyx_k_MaxProdConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_MaxProdConstraint___call, __pyx_k_MaxProdConstraint___call, sizeof(__pyx_k_MaxProdConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_MaxProdConstraint___init, __pyx_k_MaxProdConstraint___init, sizeof(__pyx_k_MaxProdConstraint___init), 0, 0, 1, 1}, - {&__pyx_n_s_MaxProdConstraint_preProcess, __pyx_k_MaxProdConstraint_preProcess, sizeof(__pyx_k_MaxProdConstraint_preProcess), 0, 0, 1, 1}, - {&__pyx_n_s_MaxProdConstraint_preProcess_loc, __pyx_k_MaxProdConstraint_preProcess_loc, sizeof(__pyx_k_MaxProdConstraint_preProcess_loc), 0, 0, 1, 1}, - {&__pyx_n_s_MaxSumConstraint, __pyx_k_MaxSumConstraint, sizeof(__pyx_k_MaxSumConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_MaxSumConstraint___call, __pyx_k_MaxSumConstraint___call, sizeof(__pyx_k_MaxSumConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_MaxSumConstraint___init, __pyx_k_MaxSumConstraint___init, sizeof(__pyx_k_MaxSumConstraint___init), 0, 0, 1, 1}, - {&__pyx_n_s_MaxSumConstraint_preProcess, __pyx_k_MaxSumConstraint_preProcess, sizeof(__pyx_k_MaxSumConstraint_preProcess), 0, 0, 1, 1}, - {&__pyx_n_s_MaxSumConstraint_preProcess_loca, __pyx_k_MaxSumConstraint_preProcess_loca, sizeof(__pyx_k_MaxSumConstraint_preProcess_loca), 0, 0, 1, 1}, - {&__pyx_n_s_MinProdConstraint, __pyx_k_MinProdConstraint, sizeof(__pyx_k_MinProdConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_MinProdConstraint___call, __pyx_k_MinProdConstraint___call, sizeof(__pyx_k_MinProdConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_MinProdConstraint___init, __pyx_k_MinProdConstraint___init, sizeof(__pyx_k_MinProdConstraint___init), 0, 0, 1, 1}, - {&__pyx_n_s_MinProdConstraint_preProcess, __pyx_k_MinProdConstraint_preProcess, sizeof(__pyx_k_MinProdConstraint_preProcess), 0, 0, 1, 1}, - {&__pyx_n_s_MinSumConstraint, __pyx_k_MinSumConstraint, sizeof(__pyx_k_MinSumConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_MinSumConstraint___call, __pyx_k_MinSumConstraint___call, sizeof(__pyx_k_MinSumConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_MinSumConstraint___init, __pyx_k_MinSumConstraint___init, sizeof(__pyx_k_MinSumConstraint___init), 0, 0, 1, 1}, - {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, - {&__pyx_n_s_NotInSetConstraint, __pyx_k_NotInSetConstraint, sizeof(__pyx_k_NotInSetConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_NotInSetConstraint___call, __pyx_k_NotInSetConstraint___call, sizeof(__pyx_k_NotInSetConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_NotInSetConstraint___init, __pyx_k_NotInSetConstraint___init, sizeof(__pyx_k_NotInSetConstraint___init), 0, 0, 1, 1}, - {&__pyx_n_s_NotInSetConstraint_preProcess, __pyx_k_NotInSetConstraint_preProcess, sizeof(__pyx_k_NotInSetConstraint_preProcess), 0, 0, 1, 1}, - {&__pyx_n_s_Optional, __pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 0, 1, 1}, - {&__pyx_kp_s_Optional_Sequence, __pyx_k_Optional_Sequence, sizeof(__pyx_k_Optional_Sequence), 0, 0, 1, 0}, - {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_n_s_Sequence, __pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 0, 1, 1}, - {&__pyx_n_s_SomeInSetConstraint, __pyx_k_SomeInSetConstraint, sizeof(__pyx_k_SomeInSetConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_SomeInSetConstraint___call, __pyx_k_SomeInSetConstraint___call, sizeof(__pyx_k_SomeInSetConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_SomeInSetConstraint___init, __pyx_k_SomeInSetConstraint___init, sizeof(__pyx_k_SomeInSetConstraint___init), 0, 0, 1, 1}, - {&__pyx_n_s_SomeNotInSetConstraint, __pyx_k_SomeNotInSetConstraint, sizeof(__pyx_k_SomeNotInSetConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_SomeNotInSetConstraint___call, __pyx_k_SomeNotInSetConstraint___call, sizeof(__pyx_k_SomeNotInSetConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_SomeNotInSetConstraint___init, __pyx_k_SomeNotInSetConstraint___init, sizeof(__pyx_k_SomeNotInSetConstraint___init), 0, 0, 1, 1}, - {&__pyx_n_s_Unassigned, __pyx_k_Unassigned, sizeof(__pyx_k_Unassigned), 0, 0, 1, 1}, - {&__pyx_n_s_Union, __pyx_k_Union, sizeof(__pyx_k_Union), 0, 0, 1, 1}, - {&__pyx_kp_s_Union_int_float, __pyx_k_Union_int_float, sizeof(__pyx_k_Union_int_float), 0, 0, 1, 0}, - {&__pyx_kp_s_Wrapper_function_for_picklable_s, __pyx_k_Wrapper_function_for_picklable_s, sizeof(__pyx_k_Wrapper_function_for_picklable_s), 0, 0, 1, 0}, - {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, - {&__pyx_n_s__68, __pyx_k__68, sizeof(__pyx_k__68), 0, 0, 1, 1}, - {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, - {&__pyx_n_s_assigned, __pyx_k_assigned, sizeof(__pyx_k_assigned), 0, 0, 1, 1}, - {&__pyx_n_s_assigned_2, __pyx_k_assigned_2, sizeof(__pyx_k_assigned_2), 0, 0, 1, 1}, - {&__pyx_n_s_assignments, __pyx_k_assignments, sizeof(__pyx_k_assignments), 0, 0, 1, 1}, - {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, - {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, - {&__pyx_n_s_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 0, 1, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, - {&__pyx_n_s_collections_abc, __pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_constraints, __pyx_k_constraint_constraints, sizeof(__pyx_k_constraint_constraints), 0, 0, 1, 1}, - {&__pyx_kp_s_constraint_constraints_py, __pyx_k_constraint_constraints_py, sizeof(__pyx_k_constraint_constraints_py), 0, 0, 1, 0}, - {&__pyx_n_s_constraint_domain, __pyx_k_constraint_domain, sizeof(__pyx_k_constraint_domain), 0, 0, 1, 1}, - {&__pyx_n_s_constraints, __pyx_k_constraints, sizeof(__pyx_k_constraints), 0, 0, 1, 1}, - {&__pyx_n_s_contains_lt1, __pyx_k_contains_lt1, sizeof(__pyx_k_contains_lt1), 0, 0, 1, 1}, - {&__pyx_n_s_contains_negative, __pyx_k_contains_negative, sizeof(__pyx_k_contains_negative), 0, 0, 1, 1}, - {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, - {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, - {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, - {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, - {&__pyx_n_s_domain, __pyx_k_domain, sizeof(__pyx_k_domain), 0, 0, 1, 1}, - {&__pyx_n_s_domains, __pyx_k_domains, sizeof(__pyx_k_domains), 0, 0, 1, 1}, - {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, - {&__pyx_n_s_exact, __pyx_k_exact, sizeof(__pyx_k_exact), 0, 0, 1, 1}, - {&__pyx_n_s_exact_2, __pyx_k_exact_2, sizeof(__pyx_k_exact_2), 0, 0, 1, 1}, - {&__pyx_n_s_exactsum, __pyx_k_exactsum, sizeof(__pyx_k_exactsum), 0, 0, 1, 1}, - {&__pyx_n_s_exactsum_2, __pyx_k_exactsum_2, sizeof(__pyx_k_exactsum_2), 0, 0, 1, 1}, - {&__pyx_n_s_forwardCheck, __pyx_k_forwardCheck, sizeof(__pyx_k_forwardCheck), 0, 0, 1, 1}, - {&__pyx_n_s_forwardcheck, __pyx_k_forwardcheck, sizeof(__pyx_k_forwardcheck), 0, 0, 1, 1}, - {&__pyx_n_s_found, __pyx_k_found, sizeof(__pyx_k_found), 0, 0, 1, 1}, - {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, - {&__pyx_n_s_func_2, __pyx_k_func_2, sizeof(__pyx_k_func_2), 0, 0, 1, 1}, - {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, - {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, - {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, - {&__pyx_n_s_hideValue, __pyx_k_hideValue, sizeof(__pyx_k_hideValue), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, - {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, - {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, - {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, - {&__pyx_kp_s_list_tuple, __pyx_k_list_tuple, sizeof(__pyx_k_list_tuple), 0, 0, 1, 0}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_maxprod, __pyx_k_maxprod, sizeof(__pyx_k_maxprod), 0, 0, 1, 1}, - {&__pyx_n_s_maxprod_2, __pyx_k_maxprod_2, sizeof(__pyx_k_maxprod_2), 0, 0, 1, 1}, - {&__pyx_n_s_maxsum, __pyx_k_maxsum, sizeof(__pyx_k_maxsum), 0, 0, 1, 1}, - {&__pyx_n_s_maxsum_2, __pyx_k_maxsum_2, sizeof(__pyx_k_maxsum_2), 0, 0, 1, 1}, - {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, - {&__pyx_n_s_minprod, __pyx_k_minprod, sizeof(__pyx_k_minprod), 0, 0, 1, 1}, - {&__pyx_n_s_minprod_2, __pyx_k_minprod_2, sizeof(__pyx_k_minprod_2), 0, 0, 1, 1}, - {&__pyx_n_s_minsum, __pyx_k_minsum, sizeof(__pyx_k_minsum), 0, 0, 1, 1}, - {&__pyx_n_s_minsum_2, __pyx_k_minsum_2, sizeof(__pyx_k_minsum_2), 0, 0, 1, 1}, - {&__pyx_n_s_missing, __pyx_k_missing, sizeof(__pyx_k_missing), 0, 0, 1, 1}, - {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, - {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, - {&__pyx_n_s_multiplier, __pyx_k_multiplier, sizeof(__pyx_k_multiplier), 0, 0, 1, 1}, - {&__pyx_n_s_multipliers, __pyx_k_multipliers, sizeof(__pyx_k_multipliers), 0, 0, 1, 1}, - {&__pyx_n_s_multipliers_2, __pyx_k_multipliers_2, sizeof(__pyx_k_multipliers_2), 0, 0, 1, 1}, - {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, - {&__pyx_n_s_n_2, __pyx_k_n_2, sizeof(__pyx_k_n_2), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_parms, __pyx_k_parms, sizeof(__pyx_k_parms), 0, 0, 1, 1}, - {&__pyx_n_s_preProcess, __pyx_k_preProcess, sizeof(__pyx_k_preProcess), 0, 0, 1, 1}, - {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, - {&__pyx_n_s_prod, __pyx_k_prod, sizeof(__pyx_k_prod), 0, 0, 1, 1}, - {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, - {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, - {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1}, - {&__pyx_n_s_seen, __pyx_k_seen, sizeof(__pyx_k_seen), 0, 0, 1, 1}, - {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, - {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, - {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1}, - {&__pyx_n_s_set_2, __pyx_k_set_2, sizeof(__pyx_k_set_2), 0, 0, 1, 1}, - {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, - {&__pyx_n_s_singlevalue, __pyx_k_singlevalue, sizeof(__pyx_k_singlevalue), 0, 0, 1, 1}, - {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, - {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, - {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, - {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1}, - {&__pyx_n_s_unassigned, __pyx_k_unassigned, sizeof(__pyx_k_unassigned), 0, 0, 1, 1}, - {&__pyx_n_s_unassignedvariable, __pyx_k_unassignedvariable, sizeof(__pyx_k_unassignedvariable), 0, 0, 1, 1}, - {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, - {&__pyx_n_s_variable, __pyx_k_variable, sizeof(__pyx_k_variable), 0, 0, 1, 1}, - {&__pyx_n_s_variable_contains_lt1, __pyx_k_variable_contains_lt1, sizeof(__pyx_k_variable_contains_lt1), 0, 0, 1, 1}, - {&__pyx_n_s_variable_contains_negative, __pyx_k_variable_contains_negative, sizeof(__pyx_k_variable_contains_negative), 0, 0, 1, 1}, - {&__pyx_n_s_variable_with_lt1, __pyx_k_variable_with_lt1, sizeof(__pyx_k_variable_with_lt1), 0, 0, 1, 1}, - {&__pyx_n_s_variable_with_negative, __pyx_k_variable_with_negative, sizeof(__pyx_k_variable_with_negative), 0, 0, 1, 1}, - {&__pyx_n_s_variables, __pyx_k_variables, sizeof(__pyx_k_variables), 0, 0, 1, 1}, - {&__pyx_n_s_vconstraints, __pyx_k_vconstraints, sizeof(__pyx_k_vconstraints), 0, 0, 1, 1}, - {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, - {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} - }; - return __Pyx_InitStrings(__pyx_string_tab); -} -/* #### Code section: cached_builtins ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 198, __pyx_L1_error) - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 319, __pyx_L1_error) - __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) __PYX_ERR(0, 344, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 628, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: cached_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":57 - * variable = variables[0] - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if not self(variables, domains, {variable: value}): + /* "constraint/constraints.py":775 * domain.remove(value) - */ - __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice_); - __Pyx_GIVEREF(__pyx_slice_); - - /* "constraint/constraints.py":198 - * - * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 - * raise NotImplementedError("CompilableFunctionConstraint can not be called directly") # <<<<<<<<<<<<<< - * - * - */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_CompilableFunctionConstraint_can); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); - - /* "constraint/constraints.py":628 - * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 - * # preProcess() will remove it. - * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Can_t_happen); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 628, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - - /* "constraint/constraints.py":10 - * """Abstract base class for constraints.""" - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # <<<<<<<<<<<<<< - * """Perform the constraint checking. - * - */ - __pyx_tuple__5 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 10, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 10, __pyx_L1_error) - __pyx_tuple__7 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - - /* "constraint/constraints.py":35 - * return True - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< - * """Preprocess variable domains. - * - */ - __pyx_tuple__8 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_variable, __pyx_n_s_domain, __pyx_n_s_value); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 35, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_preProcess, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 35, __pyx_L1_error) - - /* "constraint/constraints.py":63 * vconstraints[variable].remove((self, variables)) + * constraints.remove((self, variables)) # <<<<<<<<<<<<<< * - * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): # <<<<<<<<<<<<<< - * """Helper method for generic forward checking. - * - */ - __pyx_tuple__10 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_unassigned, __pyx_n_s_unassignedvariable, __pyx_n_s_variable, __pyx_n_s_domain, __pyx_n_s_value); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 63, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_forwardCheck, 63, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 63, __pyx_L1_error) - - /* "constraint/constraints.py":125 - * """ - * - * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_tuple__12 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_func, __pyx_n_s_assigned); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 125, __pyx_L1_error) - __pyx_tuple__14 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - - /* "constraint/constraints.py":137 - * self._assigned = assigned - * - * def __call__( # noqa: D102 # <<<<<<<<<<<<<< - * self, - * variables: Sequence, - */ - __pyx_tuple__15 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck, __pyx_n_s_unassigned, __pyx_n_s_parms, __pyx_n_s_missing, __pyx_n_s_x); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); - __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 137, __pyx_L1_error) - - /* "constraint/constraints.py":193 - * """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_codeobj__17 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 193, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 193, __pyx_L1_error) - - /* "constraint/constraints.py":197 - * self._assigned = assigned - * - * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 # <<<<<<<<<<<<<< - * raise NotImplementedError("CompilableFunctionConstraint can not be called directly") * - */ - __pyx_tuple__18 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck, __pyx_n_s_unassigned); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); - __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 197, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 197, __pyx_L1_error) +*/ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 775, __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, 775, __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, 775, __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, 775, __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":212 - * """ + /* "constraint/constraints.py":767 + * raise RuntimeError("Can't happen") * - * def __call__( # noqa: D102 # <<<<<<<<<<<<<< - * self, - * variables: Sequence, - */ - __pyx_tuple__20 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck, __pyx_n_s_unassigned, __pyx_n_s_seen, __pyx_n_s_variable, __pyx_n_s_value, __pyx_n_s_domain); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 212, __pyx_L1_error) + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * set = self._set + * for variable in variables: +*/ - /* "constraint/constraints.py":250 - * """ - * - * def __call__( # noqa: D102 # <<<<<<<<<<<<<< - * self, - * variables: Sequence, - */ - __pyx_tuple__22 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck, __pyx_n_s_unassigned, __pyx_n_s_singlevalue, __pyx_n_s_variable, __pyx_n_s_value, __pyx_n_s_domain); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); - __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 250, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 250, __pyx_L1_error) + /* 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); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("constraint.constraints.NotInSetConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_set); + __Pyx_XDECREF(__pyx_v_variable); + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "constraint/constraints.py":288 +/* "constraint/constraints.py":789 * """ * - * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_tuple__24 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_maxsum, __pyx_n_s_multipliers); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); - __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 288, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 288, __pyx_L1_error) - __pyx_tuple__26 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); - - /* "constraint/constraints.py":300 - * self._multipliers = multipliers - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * - */ - __pyx_tuple__27 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_variable_contains_negative, __pyx_n_s_variable_with_negative, __pyx_n_s_variable, __pyx_n_s_contains_negative, __pyx_n_s_multipliers, __pyx_n_s_maxsum, __pyx_n_s_multiplier, __pyx_n_s_domain, __pyx_n_s_value, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); - __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_preProcess, 300, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 300, __pyx_L1_error) - - /* "constraint/constraints.py":335 - * domain.remove(value) - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * multipliers = self._multipliers - * maxsum = self._maxsum - */ - __pyx_tuple__29 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck, __pyx_n_s_multipliers, __pyx_n_s_maxsum, __pyx_n_s_sum, __pyx_n_s_variable, __pyx_n_s_multiplier, __pyx_n_s_domain, __pyx_n_s_value); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); - __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 335, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 335, __pyx_L1_error) +*/ - /* "constraint/constraints.py":387 - * """ - * - * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_tuple__31 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_exactsum, __pyx_n_s_multipliers); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); - __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 387, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 387, __pyx_L1_error) - - /* "constraint/constraints.py":399 - * 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_tuple__33 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_multipliers, __pyx_n_s_exactsum, __pyx_n_s_variable, __pyx_n_s_multiplier, __pyx_n_s_domain, __pyx_n_s_value); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); - __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_preProcess, 399, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 399, __pyx_L1_error) - - /* "constraint/constraints.py":416 - * domain.remove(value) - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * multipliers = self._multipliers - * exactsum = self._exactsum - */ - __pyx_tuple__35 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck, __pyx_n_s_multipliers, __pyx_n_s_exactsum, __pyx_n_s_sum, __pyx_n_s_missing, __pyx_n_s_variable, __pyx_n_s_multiplier, __pyx_n_s_domain, __pyx_n_s_value); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); - __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 416, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 416, __pyx_L1_error) - - /* "constraint/constraints.py":476 - * """ - * - * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_tuple__37 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_minsum, __pyx_n_s_multipliers); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 476, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__37); - __Pyx_GIVEREF(__pyx_tuple__37); - __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 476, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 476, __pyx_L1_error) - - /* "constraint/constraints.py":488 - * self._multipliers = multipliers - * - * 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_tuple__39 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck, __pyx_n_s_variable, __pyx_n_s_multipliers, __pyx_n_s_minsum, __pyx_n_s_sum, __pyx_n_s_multiplier); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 488, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); - __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 488, __pyx_L1_error) - - /* "constraint/constraints.py":512 - * """Constraint enforcing that values of given variables create a product up to at most a given amount.""" - * - * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< - * """Instantiate a MaxProdConstraint. - * - */ - __pyx_tuple__41 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_maxprod); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 512, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); - __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 512, __pyx_L1_error) - - /* "constraint/constraints.py":520 - * self._maxprod = maxprod - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * - */ - __pyx_tuple__43 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_variable_contains_lt1, __pyx_n_s_variable_with_lt1, __pyx_n_s_variable, __pyx_n_s_contains_lt1, __pyx_n_s_maxprod, __pyx_n_s_domain, __pyx_n_s_value, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); - __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_preProcess, 520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 520, __pyx_L1_error) - - /* "constraint/constraints.py":547 - * domain.remove(value) - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * maxprod = self._maxprod - * prod = 1 - */ - __pyx_tuple__45 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck, __pyx_n_s_maxprod, __pyx_n_s_prod, __pyx_n_s_variable, __pyx_n_s_domain, __pyx_n_s_value); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__45); - __Pyx_GIVEREF(__pyx_tuple__45); - __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 547, __pyx_L1_error) - - /* "constraint/constraints.py":572 - * """Constraint enforcing that values of given variables create a product up to at least a given amount.""" - * - * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< - * """Instantiate a MinProdConstraint. - * - */ - __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_minprod); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 572, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__47); - __Pyx_GIVEREF(__pyx_tuple__47); - __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 572, __pyx_L1_error) +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_1__init__(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_19SomeInSetConstraint___init__, "Initialization method.\n\n Args:\n set (set): Set of values to be checked\n n (int): Minimum number of assigned values that should be\n present in set (default is 1)\n exact (bool): Whether the number of assigned values which\n are present in set must be exactly `n`\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_19SomeInSetConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_19SomeInSetConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_1__init__(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_set = 0; + PyObject *__pyx_v_n = 0; + PyObject *__pyx_v_exact = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {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("__init__ (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_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, 789, __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, 789, __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, 789, __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, 789, __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, 789, __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, 789, __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, 789, __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, 789, __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, 789, __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, 789, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 789, __pyx_L3_error) + break; + default: goto __pyx_L5_argtuple_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))); + } + __pyx_v_self = values[0]; + __pyx_v_set = values[1]; + __pyx_v_n = values[2]; + __pyx_v_exact = values[3]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 789, __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.SomeInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10constraint_11constraints_19SomeInSetConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_set, __pyx_v_n, __pyx_v_exact); - /* "constraint/constraints.py":580 - * 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_tuple__49 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_minprod, __pyx_n_s_variable, __pyx_n_s_domain, __pyx_n_s_value); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__49); - __Pyx_GIVEREF(__pyx_tuple__49); - __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_preProcess, 580, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 580, __pyx_L1_error) + /* 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; +} - /* "constraint/constraints.py":591 - * 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_tuple__51 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck, __pyx_n_s_variable, __pyx_n_s_minprod, __pyx_n_s_prod); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 591, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__51); - __Pyx_GIVEREF(__pyx_tuple__51); - __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 591, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 591, __pyx_L1_error) +static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set, PyObject *__pyx_v_n, PyObject *__pyx_v_exact) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":618 - * """ - * - * def __init__(self, set): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_tuple__53 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_set); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 618, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__53); - __Pyx_GIVEREF(__pyx_tuple__53); - __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 618, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 618, __pyx_L1_error) + /* "constraint/constraints.py":799 + * 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, 799, __pyx_L1_error) - /* "constraint/constraints.py":626 + /* "constraint/constraints.py":800 + * """ * self._set = set + * self._n = n # <<<<<<<<<<<<<< + * self._exact = exact * - * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * # preProcess() will remove it. - * raise RuntimeError("Can't happen") - */ - __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 626, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 626, __pyx_L1_error) - - /* "constraint/constraints.py":630 - * 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_tuple__56 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_set, __pyx_n_s_variable, __pyx_n_s_domain, __pyx_n_s_value); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__56); - __Pyx_GIVEREF(__pyx_tuple__56); - __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_preProcess, 630, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 630, __pyx_L1_error) - - /* "constraint/constraints.py":652 - * """ - * - * def __init__(self, set): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 652, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 652, __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, 800, __pyx_L1_error) - /* "constraint/constraints.py":660 + /* "constraint/constraints.py":801 * self._set = set + * self._n = n + * self._exact = exact # <<<<<<<<<<<<<< * - * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * # preProcess() will remove it. - * raise RuntimeError("Can't happen") - */ - __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 660, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 660, __pyx_L1_error) - - /* "constraint/constraints.py":664 - * 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_codeobj__60 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_preProcess, 664, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 664, __pyx_L1_error) + * 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, 801, __pyx_L1_error) - /* "constraint/constraints.py":686 + /* "constraint/constraints.py":789 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_tuple__61 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_set, __pyx_n_s_n, __pyx_n_s_exact); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 686, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__61); - __Pyx_GIVEREF(__pyx_tuple__61); - __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 686, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 686, __pyx_L1_error) - __pyx_tuple__63 = PyTuple_Pack(2, ((PyObject *)__pyx_int_1), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 686, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__63); - __Pyx_GIVEREF(__pyx_tuple__63); - - /* "constraint/constraints.py":700 - * self._exact = exact - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * set = self._set - * missing = 0 - */ - __pyx_tuple__64 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck, __pyx_n_s_set, __pyx_n_s_missing, __pyx_n_s_found, __pyx_n_s_variable, __pyx_n_s_domain, __pyx_n_s_value); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 700, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__64); - __Pyx_GIVEREF(__pyx_tuple__64); - __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 700, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 700, __pyx_L1_error) +*/ - /* "constraint/constraints.py":748 - * """ - * - * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 748, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 748, __pyx_L1_error) + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.SomeInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "constraint/constraints.py":762 +/* "constraint/constraints.py":803 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * missing = 0 - */ - __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 762, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 762, __pyx_L1_error) - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_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_19SomeInSetConstraint_3__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_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 +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_variables = 0; + PyObject *__pyx_v_domains = 0; + PyObject *__pyx_v_assignments = 0; + PyObject *__pyx_v_forwardcheck = 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("__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,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, 803, __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, 803, __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, 803, __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, 803, __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, 803, __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, 803, __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, 803, __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, 803, __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, 803, __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, 803, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 803, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 803, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 803, __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, 803, __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.SomeInSetConstraint.__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, 803, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 803, __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 */ + 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_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) { + PyObject *__pyx_v_set = NULL; + PyObject *__pyx_v_missing = NULL; + PyObject *__pyx_v_found = NULL; + PyObject *__pyx_v_variable = NULL; + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_value = 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; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + PyObject *__pyx_t_10 = NULL; + size_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "constraint/constraints.py":804 + * + * 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, 804, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_set = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":805 + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * set = self._set + * missing = 0 # <<<<<<<<<<<<<< + * found = 0 + * for variable in variables: +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_missing = __pyx_mstate_global->__pyx_int_0; + + /* "constraint/constraints.py":806 + * set = self._set + * missing = 0 + * found = 0 # <<<<<<<<<<<<<< + * for variable in variables: + * if variable in assignments: +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_found = __pyx_mstate_global->__pyx_int_0; + + /* "constraint/constraints.py":807 + * missing = 0 + * found = 0 + * for variable in variables: # <<<<<<<<<<<<<< + * if variable in assignments: + * found += assignments[variable] in set +*/ + 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, 807, __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, 807, __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, 807, __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, 807, __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, 807, __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, 807, __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":808 + * 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, 808, __pyx_L1_error) + if (__pyx_t_5) { + + /* "constraint/constraints.py":809 + * 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, 809, __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, 809, __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, 809, __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, 809, __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":808 + * found = 0 + * for variable in variables: + * if variable in assignments: # <<<<<<<<<<<<<< + * found += assignments[variable] in set + * else: +*/ + goto __pyx_L5; + } + + /* "constraint/constraints.py":811 + * found += assignments[variable] in set + * else: + * missing += 1 # <<<<<<<<<<<<<< + * if missing: + * 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, 811, __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":807 + * missing = 0 + * found = 0 + * for variable in variables: # <<<<<<<<<<<<<< + * if variable in assignments: + * found += assignments[variable] in set +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":812 + * 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, 812, __pyx_L1_error) + if (__pyx_t_5) { + + /* "constraint/constraints.py":813 + * 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, 813, __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, 813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "constraint/constraints.py":814 + * 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, 814, __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, 814, __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, 814, __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, 814, __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, 814, __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":815 + * if self._exact: + * if not (found <= self._n <= missing + found): + * return False # <<<<<<<<<<<<<< + * else: + * if self._n > missing + found: +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "constraint/constraints.py":814 + * if missing: + * if self._exact: + * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< + * return False + * else: +*/ + } + + /* "constraint/constraints.py":813 + * missing += 1 + * if missing: + * if self._exact: # <<<<<<<<<<<<<< + * if not (found <= self._n <= missing + found): + * return False +*/ + goto __pyx_L8; + } + + /* "constraint/constraints.py":817 + * return False + * else: + * if self._n > missing + found: # <<<<<<<<<<<<<< + * return False + * 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, 817, __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, 817, __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, 817, __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, 817, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_7) { + + /* "constraint/constraints.py":818 + * else: + * if self._n > missing + found: + * return False # <<<<<<<<<<<<<< + * if forwardcheck and self._n - found == missing: + * # All unassigned variables must be assigned to +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "constraint/constraints.py":817 + * return False + * else: + * if self._n > missing + found: # <<<<<<<<<<<<<< + * return False + * if forwardcheck and self._n - found == missing: +*/ + } + } + __pyx_L8:; + + /* "constraint/constraints.py":819 + * 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, 819, __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, 819, __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, 819, __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, 819, __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, 819, __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":822 + * # All unassigned variables must be assigned to + * # values in the set. + * 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_4 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_4); + __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, 822, __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, 822, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + 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, 822, __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_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, 822, __pyx_L1_error) + #endif + 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_4, __pyx_t_2)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_2); + #endif + ++__pyx_t_2; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __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, 822, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":823 + * # 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, 823, __pyx_L1_error) + if (__pyx_t_7) { + + /* "constraint/constraints.py":824 + * 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, 824, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":825 + * 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, 825, __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, 825, __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, 825, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_6))) { + { + 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, 825, __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_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, 825, __pyx_L1_error) + #endif + if (__pyx_t_8 >= __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_8)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); + #endif + ++__pyx_t_8; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __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, 825, __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":826 + * 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, 826, __pyx_L1_error) + if (__pyx_t_7) { + + /* "constraint/constraints.py":827 + * for value in domain[:]: + * if value not in set: + * domain.hideValue(value) # <<<<<<<<<<<<<< + * if not domain: + * return False +*/ + __pyx_t_10 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_10); + __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_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":826 + * domain = domains[variable] + * for value in domain[:]: + * if value not in set: # <<<<<<<<<<<<<< + * domain.hideValue(value) + * if not domain: +*/ + } + + /* "constraint/constraints.py":825 + * if variable not in assignments: + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value not in set: + * domain.hideValue(value) +*/ + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "constraint/constraints.py":828 + * 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, 828, __pyx_L1_error) + __pyx_t_5 = (!__pyx_t_7); + if (__pyx_t_5) { + + /* "constraint/constraints.py":829 + * domain.hideValue(value) + * if not domain: + * return False # <<<<<<<<<<<<<< + * else: + * if self._exact: +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L0; + + /* "constraint/constraints.py":828 + * if value not in set: + * domain.hideValue(value) + * if not domain: # <<<<<<<<<<<<<< + * return False + * else: +*/ + } + + /* "constraint/constraints.py":823 + * # values in the set. + * for variable in variables: + * if variable not in assignments: # <<<<<<<<<<<<<< + * domain = domains[variable] + * for value in domain[:]: +*/ + } + + /* "constraint/constraints.py":822 + * # All unassigned variables must be assigned to + * # values in the set. + * for variable in variables: # <<<<<<<<<<<<<< + * if variable not in assignments: + * domain = domains[variable] +*/ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":819 + * 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. +*/ + } + + /* "constraint/constraints.py":812 + * else: + * missing += 1 + * if missing: # <<<<<<<<<<<<<< + * if self._exact: + * if not (found <= self._n <= missing + found): +*/ + goto __pyx_L7; + } + + /* "constraint/constraints.py":831 + * return False + * 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_exact_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 831, __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, 831, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + + /* "constraint/constraints.py":832 + * 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, 832, __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, 832, __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, 832, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_5) { + + /* "constraint/constraints.py":833 + * if self._exact: + * if found != self._n: + * return False # <<<<<<<<<<<<<< + * else: + * if found < self._n: +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "constraint/constraints.py":832 + * else: + * if self._exact: + * if found != self._n: # <<<<<<<<<<<<<< + * return False + * else: +*/ + } + + /* "constraint/constraints.py":831 + * return False + * else: + * if self._exact: # <<<<<<<<<<<<<< + * if found != self._n: + * return False +*/ + goto __pyx_L23; + } + + /* "constraint/constraints.py":835 + * return False + * else: + * if found < self._n: # <<<<<<<<<<<<<< + * return False + * 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, 835, __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, 835, __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, 835, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + + /* "constraint/constraints.py":836 + * 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":835 + * return False + * else: + * if found < self._n: # <<<<<<<<<<<<<< + * return False + * return True +*/ + } + } + __pyx_L23:; + } + __pyx_L7:; + + /* "constraint/constraints.py":837 + * 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":803 + * self._exact = exact + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * set = self._set + * missing = 0 +*/ + + /* 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_10); + __Pyx_AddTraceback("constraint.constraints.SomeInSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_set); + __Pyx_XDECREF(__pyx_v_missing); + __Pyx_XDECREF(__pyx_v_found); + __Pyx_XDECREF(__pyx_v_variable); + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":851 + * """ + * + * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_1__init__(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_22SomeNotInSetConstraint___init__, "Initialization method.\n\n Args:\n set (set): Set of values to be checked\n n (int): Minimum number of assigned values that should not\n be present in set (default is 1)\n exact (bool): Whether the number of assigned values which\n are not present in set must be exactly `n`\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_22SomeNotInSetConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_22SomeNotInSetConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_1__init__(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_set = 0; + PyObject *__pyx_v_n = 0; + PyObject *__pyx_v_exact = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {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("__init__ (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_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, 851, __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, 851, __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, 851, __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, 851, __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, 851, __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, 851, __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, 851, __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, 851, __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, 851, __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, 851, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 851, __pyx_L3_error) + break; + default: goto __pyx_L5_argtuple_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))); + } + __pyx_v_self = values[0]; + __pyx_v_set = values[1]; + __pyx_v_n = values[2]; + __pyx_v_exact = values[3]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 851, __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.SomeNotInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_set, __pyx_v_n, __pyx_v_exact); + + /* 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_22SomeNotInSetConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set, PyObject *__pyx_v_n, PyObject *__pyx_v_exact) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "constraint/constraints.py":861 + * 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, 861, __pyx_L1_error) + + /* "constraint/constraints.py":862 + * """ + * 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, 862, __pyx_L1_error) + + /* "constraint/constraints.py":863 + * 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, 863, __pyx_L1_error) + + /* "constraint/constraints.py":851 + * """ + * + * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.SomeNotInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":865 + * self._exact = exact + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * set = self._set + * missing = 0 +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_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_22SomeNotInSetConstraint_3__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_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 +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_variables = 0; + PyObject *__pyx_v_domains = 0; + PyObject *__pyx_v_assignments = 0; + PyObject *__pyx_v_forwardcheck = 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("__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,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, 865, __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, 865, __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, 865, __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, 865, __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, 865, __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, 865, __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, 865, __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, 865, __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, 865, __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, 865, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 865, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 865, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 865, __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, 865, __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.SomeNotInSetConstraint.__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, 865, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 865, __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 */ + 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_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) { + PyObject *__pyx_v_set = NULL; + PyObject *__pyx_v_missing = NULL; + PyObject *__pyx_v_found = NULL; + PyObject *__pyx_v_variable = NULL; + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_value = 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; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + PyObject *__pyx_t_10 = NULL; + size_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "constraint/constraints.py":866 + * + * 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, 866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_set = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":867 + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * set = self._set + * missing = 0 # <<<<<<<<<<<<<< + * found = 0 + * for variable in variables: +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_missing = __pyx_mstate_global->__pyx_int_0; + + /* "constraint/constraints.py":868 + * set = self._set + * missing = 0 + * found = 0 # <<<<<<<<<<<<<< + * for variable in variables: + * if variable in assignments: +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_found = __pyx_mstate_global->__pyx_int_0; + + /* "constraint/constraints.py":869 + * missing = 0 + * found = 0 + * for variable in variables: # <<<<<<<<<<<<<< + * if variable in assignments: + * found += assignments[variable] not in set +*/ + 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, 869, __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, 869, __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, 869, __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, 869, __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, 869, __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, 869, __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":870 + * 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, 870, __pyx_L1_error) + if (__pyx_t_5) { + + /* "constraint/constraints.py":871 + * 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, 871, __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, 871, __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, 871, __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, 871, __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":870 + * found = 0 + * for variable in variables: + * if variable in assignments: # <<<<<<<<<<<<<< + * found += assignments[variable] not in set + * else: +*/ + goto __pyx_L5; + } + + /* "constraint/constraints.py":873 + * found += assignments[variable] not in set + * else: + * missing += 1 # <<<<<<<<<<<<<< + * if missing: + * 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, 873, __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":869 + * missing = 0 + * found = 0 + * for variable in variables: # <<<<<<<<<<<<<< + * if variable in assignments: + * found += assignments[variable] not in set +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":874 + * 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, 874, __pyx_L1_error) + if (__pyx_t_5) { + + /* "constraint/constraints.py":875 + * 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, 875, __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, 875, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "constraint/constraints.py":876 + * 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, 876, __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, 876, __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, 876, __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, 876, __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, 876, __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":877 + * if self._exact: + * if not (found <= self._n <= missing + found): + * return False # <<<<<<<<<<<<<< + * else: + * if self._n > missing + found: +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "constraint/constraints.py":876 + * if missing: + * if self._exact: + * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< + * return False + * else: +*/ + } + + /* "constraint/constraints.py":875 + * missing += 1 + * if missing: + * if self._exact: # <<<<<<<<<<<<<< + * if not (found <= self._n <= missing + found): + * return False +*/ + goto __pyx_L8; + } + + /* "constraint/constraints.py":879 + * return False + * else: + * if self._n > missing + found: # <<<<<<<<<<<<<< + * return False + * 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, 879, __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, 879, __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, 879, __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, 879, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_7) { + + /* "constraint/constraints.py":880 + * else: + * if self._n > missing + found: + * return False # <<<<<<<<<<<<<< + * if forwardcheck and self._n - found == missing: + * # All unassigned variables must be assigned to +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "constraint/constraints.py":879 + * return False + * else: + * if self._n > missing + found: # <<<<<<<<<<<<<< + * return False + * if forwardcheck and self._n - found == missing: +*/ + } + } + __pyx_L8:; + + /* "constraint/constraints.py":881 + * 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, 881, __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, 881, __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, 881, __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, 881, __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, 881, __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":884 + * # All unassigned variables must be assigned to + * # values not in the set. + * 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_4 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_4); + __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, 884, __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, 884, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + 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, 884, __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_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, 884, __pyx_L1_error) + #endif + 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_4, __pyx_t_2)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_2); + #endif + ++__pyx_t_2; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __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, 884, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":885 + * # 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, 885, __pyx_L1_error) + if (__pyx_t_7) { + + /* "constraint/constraints.py":886 + * 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, 886, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":887 + * 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, 887, __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, 887, __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, 887, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_6))) { + { + 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, 887, __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_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, 887, __pyx_L1_error) + #endif + if (__pyx_t_8 >= __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_8)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); + #endif + ++__pyx_t_8; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 887, __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, 887, __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":888 + * 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, 888, __pyx_L1_error) + if (__pyx_t_7) { + + /* "constraint/constraints.py":889 + * for value in domain[:]: + * if value in set: + * domain.hideValue(value) # <<<<<<<<<<<<<< + * if not domain: + * return False +*/ + __pyx_t_10 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_10); + __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_XDECREF(__pyx_t_10); __pyx_t_10 = 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":888 + * domain = domains[variable] + * for value in domain[:]: + * if value in set: # <<<<<<<<<<<<<< + * domain.hideValue(value) + * if not domain: +*/ + } + + /* "constraint/constraints.py":887 + * if variable not in assignments: + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value in set: + * domain.hideValue(value) +*/ + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "constraint/constraints.py":890 + * 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, 890, __pyx_L1_error) + __pyx_t_5 = (!__pyx_t_7); + if (__pyx_t_5) { + + /* "constraint/constraints.py":891 + * domain.hideValue(value) + * if not domain: + * return False # <<<<<<<<<<<<<< + * else: + * if self._exact: +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L0; + + /* "constraint/constraints.py":890 + * if value in set: + * domain.hideValue(value) + * if not domain: # <<<<<<<<<<<<<< + * return False + * else: +*/ + } + + /* "constraint/constraints.py":885 + * # values not in the set. + * for variable in variables: + * if variable not in assignments: # <<<<<<<<<<<<<< + * domain = domains[variable] + * for value in domain[:]: +*/ + } + + /* "constraint/constraints.py":884 + * # All unassigned variables must be assigned to + * # values not in the set. + * for variable in variables: # <<<<<<<<<<<<<< + * if variable not in assignments: + * domain = domains[variable] +*/ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":881 + * 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. +*/ + } + + /* "constraint/constraints.py":874 + * else: + * missing += 1 + * if missing: # <<<<<<<<<<<<<< + * if self._exact: + * if not (found <= self._n <= missing + found): +*/ + goto __pyx_L7; + } + + /* "constraint/constraints.py":893 + * return False + * 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_exact_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __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, 893, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + + /* "constraint/constraints.py":894 + * 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, 894, __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, 894, __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, 894, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_5) { + + /* "constraint/constraints.py":895 + * if self._exact: + * if found != self._n: + * return False # <<<<<<<<<<<<<< + * else: + * if found < self._n: +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "constraint/constraints.py":894 + * else: + * if self._exact: + * if found != self._n: # <<<<<<<<<<<<<< + * return False + * else: +*/ + } + + /* "constraint/constraints.py":893 + * return False + * else: + * if self._exact: # <<<<<<<<<<<<<< + * if found != self._n: + * return False +*/ + goto __pyx_L23; + } + + /* "constraint/constraints.py":897 + * return False + * else: + * if found < self._n: # <<<<<<<<<<<<<< + * return False + * 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, 897, __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, 897, __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, 897, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + + /* "constraint/constraints.py":898 + * 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":897 + * return False + * else: + * if found < self._n: # <<<<<<<<<<<<<< + * return False + * return True +*/ + } + } + __pyx_L23:; + } + __pyx_L7:; + + /* "constraint/constraints.py":899 + * 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":865 + * self._exact = exact + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * set = self._set + * missing = 0 +*/ + + /* 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_10); + __Pyx_AddTraceback("constraint.constraints.SomeNotInSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_set); + __Pyx_XDECREF(__pyx_v_missing); + __Pyx_XDECREF(__pyx_v_found); + __Pyx_XDECREF(__pyx_v_variable); + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_value); + __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); + 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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_defaults) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->arg0); + #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); + } + #endif +} + +static int __pyx_tp_traverse_10constraint_11constraints___pyx_defaults(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_defaults *p = (struct __pyx_defaults *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } + if (p->arg0) { + e = (*v)(p->arg0, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_10constraint_11constraints___pyx_defaults(PyObject *o) { + PyObject* tmp; + struct __pyx_defaults *p = (struct __pyx_defaults *)o; + tmp = ((PyObject*)p->arg0); + p->arg0 = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_defaults_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_defaults}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_defaults}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_defaults}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_defaults}, + {0, 0}, +}; +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, + __pyx_type_10constraint_11constraints___pyx_defaults_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_defaults = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_defaults", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_defaults, /*tp_traverse*/ + __pyx_tp_clear_10constraint_11constraints___pyx_defaults, /*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_defaults, /*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 PY_VERSION_HEX >= 0x030800b1 && (!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__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)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct__genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr)); + (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; +} + +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct__genexpr) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + 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__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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 + { + #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); + } + #endif + } +} + +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__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_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__genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct__genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct__genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_spec = { + "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, + __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct__genexpr", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__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__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 PY_VERSION_HEX >= 0x030800b1 && (!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_1_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_1_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_1_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr)); + (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; +} + +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_genexpr(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_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_1_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 (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_1_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *)o); + } else + #endif + { + #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); + } + #endif + } +} + +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_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_1_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_1_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr_spec = { + "constraint.constraints.__pyx_scope_struct_1_genexpr", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_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_1_genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct_1_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_1_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_1_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 PY_VERSION_HEX >= 0x030800b1 && (!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_2_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_2_preProcess > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_2_preProcess[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_2_preProcess]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess)); + (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; +} + +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_preProcess(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_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_2_preProcess) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + 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_2_preProcess < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_2_preProcess[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_2_preProcess++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *)o); + } else + #endif + { + #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); + } + #endif + } +} + +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_preProcess(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *)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_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_2_preProcess(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_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_2_preProcess_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_preProcess}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_preProcess}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_2_preProcess}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_preProcess}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_2_preProcess_spec = { + "constraint.constraints.__pyx_scope_struct_2_preProcess", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_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_2_preProcess_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_preProcess = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct_2_preProcess", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_preProcess, /*tp_traverse*/ + __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_2_preProcess, /*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_2_preProcess, /*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 PY_VERSION_HEX >= 0x030800b1 && (!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_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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr)); + (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; +} + +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_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 (((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)))) { + __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 + { + #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); + } + #endif + } +} + +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_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_3_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_spec = { + "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, + __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct_3_genexpr", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_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_3_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 PY_VERSION_HEX >= 0x030800b1 && (!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_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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr)); + (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; +} + +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_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 (((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)))) { + __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 + { + #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); + } + #endif + } +} + +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_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_4_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_spec = { + "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, + __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct_4_genexpr", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_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_4_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 PY_VERSION_HEX >= 0x030800b1 && (!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_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_11constraints___pyx_scope_struct_5_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_5_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_5_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr)); + (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; +} + +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_genexpr(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_10constraint_11constraints___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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_genexpr) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + 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_5_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_5_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr *)o); + } else + #endif + { + #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); + } + #endif + } } -/* #### Code section: init_constants ### */ -static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { - __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; - __pyx_umethod_PyDict_Type_get.method_name = &__pyx_n_s_get; - __pyx_umethod_PyList_Type_remove.type = (PyObject*)&PyList_Type; - __pyx_umethod_PyList_Type_remove.method_name = &__pyx_n_s_remove; - if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error) +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_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_value) { + e = (*v)(p->__pyx_v_value, a); if (e) return e; + } return 0; - __pyx_L1_error:; - return -1; } -/* #### Code section: init_globals ### */ +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_5_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_5_genexpr_spec = { + "constraint.constraints.__pyx_scope_struct_5_genexpr", + sizeof(struct __pyx_obj_10constraint_11constraints___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, + __pyx_type_10constraint_11constraints___pyx_scope_struct_5_genexpr_slots, +}; +#else -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - return 0; -} -/* #### Code section: init_module ### */ +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct_5_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_10constraint_11constraints___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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_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_5_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 PY_VERSION_HEX >= 0x030800b1 && (!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 CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; +/* #### Code section: initfunc_declarations ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/ +/* #### Code section: init_module ### */ -static int __Pyx_modinit_global_init_code(void) { +static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_variable_export_code(void) { +static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_function_export_code(void) { +static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_type_init_code(void) { +static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __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_ptype_10constraint_11constraints___pyx_scope_struct__genexpr)) __PYX_ERR(0, 307, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_spec, __pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 307, __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, 63, __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, 63, __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, 63, __pyx_L1_error) + #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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults->tp_getattro = PyObject_GenericGetAttr; + } + #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, 307, __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, 307, __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, 307, __pyx_L1_error) + #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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr->tp_getattro = PyObject_GenericGetAttr; + } + #endif + #if CYTHON_USE_TYPE_SPECS + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 491, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 491, __pyx_L1_error) + #else + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_1_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_1_genexpr) < 0) __PYX_ERR(0, 491, __pyx_L1_error) + #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_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr->tp_getattro = PyObject_GenericGetAttr; + } + #endif + #if CYTHON_USE_TYPE_SPECS + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_preProcess = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_2_preProcess_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_preProcess)) __PYX_ERR(0, 494, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_2_preProcess_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_preProcess) < 0) __PYX_ERR(0, 494, __pyx_L1_error) #else - __pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr; + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_preProcess = &__pyx_type_10constraint_11constraints___pyx_scope_struct_2_preProcess; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 307, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_preProcess) < 0) __PYX_ERR(0, 494, __pyx_L1_error) + #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_preProcess->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_preProcess->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_preProcess->tp_getattro = PyObject_GenericGetAttr; + } + #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, 508, __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, 508, __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 PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr->tp_print = 0; + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 508, __pyx_L1_error) #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 527, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 527, __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, 509, __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, 509, __pyx_L1_error) #else - __pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr; + __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_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 527, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 509, __pyx_L1_error) + #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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr->tp_getattro = PyObject_GenericGetAttr; + } #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr->tp_print = 0; + #if CYTHON_USE_TYPE_SPECS + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_5_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_genexpr)) __PYX_ERR(0, 630, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_5_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 630, __pyx_L1_error) + #else + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_genexpr = &__pyx_type_10constraint_11constraints___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_11constraints___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 630, __pyx_L1_error) #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr->tp_dictoffset && __pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif __Pyx_RefNannyFinishContext(); @@ -21888,38 +23392,45 @@ static int __Pyx_modinit_type_init_code(void) { return -1; } -static int __Pyx_modinit_type_import_code(void) { +static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_variable_import_code(void) { +static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_function_import_code(void) { +static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } - -#if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_constraints(PyObject* module); /*proto*/ 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}, + #endif + #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE + {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED}, + #endif {0, NULL} }; #endif @@ -21934,12 +23445,10 @@ namespace { PyModuleDef_HEAD_INIT, "constraints", __pyx_k_Module_containing_the_code_for_c, /* m_doc */ - #if CYTHON_PEP489_MULTI_PHASE_INIT - 0, /* m_size */ - #elif CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstate), /* m_size */ + #if CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstatetype), /* m_size */ #else - -1, /* m_size */ + (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT @@ -21960,51 +23469,71 @@ namespace { #ifdef __cplusplus } /* anonymous namespace */ #endif -#endif +/* PyModInitFuncType */ #ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#elif PY_MAJOR_VERSION < 3 -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" void -#else -#define __Pyx_PyMODINIT_FUNC void -#endif -#else -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * + #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #else -#define __Pyx_PyMODINIT_FUNC PyObject * -#endif + #ifdef __cplusplus + #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * + #else + #define __Pyx_PyMODINIT_FUNC PyObject * + #endif #endif - -#if PY_MAJOR_VERSION < 3 -__Pyx_PyMODINIT_FUNC initconstraints(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC initconstraints(void) -#else __Pyx_PyMODINIT_FUNC PyInit_constraints(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_constraints(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } +/* ModuleCreationPEP489 */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 +static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { + { + PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think + if (!module) { + PyErr_Clear(); // just try the 3.8-3.12 version + module = PyImport_ImportModule("_xxsubinterpreters"); + if (!module) goto bad; + } + PyObject *current = PyObject_CallMethod(module, "get_current", NULL); + Py_DECREF(module); + if (!current) goto bad; + if (PyTuple_Check(current)) { + PyObject *new_current = PySequence_GetItem(current, 0); + Py_DECREF(current); + current = new_current; + if (!new_current) goto bad; + } + long long as_c_int = PyLong_AsLongLong(current); + Py_DECREF(current); + return as_c_int; + } + bad: + PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n"); + return -1; +} +#endif +#if !CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; +#if 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 + PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId(); +#else PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); +#endif + if (unlikely(current_id == -1)) { + return -1; + } if (main_interpreter_id == -1) { main_interpreter_id = current_id; - return (unlikely(current_id == -1)) ? -1 : 0; - } else if (unlikely(main_interpreter_id != current_id)) - #else - static PyInterpreterState *main_interpreter = NULL; - PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; - if (!main_interpreter) { - main_interpreter = current_interpreter; - } else if (unlikely(main_interpreter != current_interpreter)) - #endif - { + return 0; + } else if (unlikely(main_interpreter_id != current_id)) { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); @@ -22012,21 +23541,14 @@ static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { } return 0; } -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) -#else -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { -#if CYTHON_COMPILING_IN_LIMITED_API - result = PyModule_AddObject(module, to_name, value); -#else result = PyDict_SetItemString(moddict, to_name, value); -#endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { @@ -22039,8 +23561,10 @@ static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); + #if !CYTHON_USE_MODULE_STATE if (__Pyx_check_single_interpreter()) return NULL; + #endif if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); @@ -22048,12 +23572,8 @@ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDe module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; -#if CYTHON_COMPILING_IN_LIMITED_API - moddict = module; -#else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; -#endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; @@ -22067,12 +23587,12 @@ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDe static CYTHON_SMALL_CODE int __pyx_pymod_exec_constraints(PyObject *__pyx_pyinit_module) #endif -#endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif + __pyx_mstatetype *__pyx_mstate = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; @@ -22090,36 +23610,37 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_constraints(PyObject *__pyx_pyinit PyErr_SetString(PyExc_RuntimeError, "Module 'constraints' has already been imported. Re-initialisation is not supported."); return -1; } - #elif PY_MAJOR_VERSION >= 3 + #else if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_m = __pyx_pyinit_module; - Py_INCREF(__pyx_m); + __pyx_t_1 = __pyx_pyinit_module; + Py_INCREF(__pyx_t_1); #else - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("constraints", __pyx_methods, __pyx_k_Module_containing_the_code_for_c, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #if CYTHON_USE_MODULE_STATE { - int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "constraints" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_m = __pyx_t_1; #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED); #endif + __pyx_mstate = __pyx_mstate_global; CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_mstate->__pyx_d); + __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + 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) { @@ -22129,14 +23650,15 @@ if (!__Pyx_RefNanny) { Py_FatalError("failed to import 'refnanny' module"); } #endif - __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_constraints(void)", 0); + +__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(); #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __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) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif @@ -22152,48 +23674,34 @@ if (!__Pyx_RefNanny) { #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - PyEval_InitThreads(); - #endif /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants() < 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 PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif if (__pyx_module_is_main_constraint__constraints) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_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) } - #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "constraint.constraints")) { if (unlikely((PyDict_SetItemString(modules, "constraint.constraints", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } - #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 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() < 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(); - (void)__Pyx_modinit_variable_export_code(); - (void)__Pyx_modinit_function_export_code(); - if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - (void)__Pyx_modinit_type_import_code(); - (void)__Pyx_modinit_variable_import_code(); - (void)__Pyx_modinit_function_import_code(); + (void)__Pyx_modinit_global_init_code(__pyx_mstate); + (void)__Pyx_modinit_variable_export_code(__pyx_mstate); + (void)__Pyx_modinit_function_export_code(__pyx_mstate); + if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(__pyx_mstate); + (void)__Pyx_modinit_variable_import_code(__pyx_mstate); + (void)__Pyx_modinit_function_import_code(__pyx_mstate); /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /* "constraint/constraints.py":3 * """Module containing the code for constraint definitions.""" @@ -22201,18 +23709,15 @@ if (!__Pyx_RefNanny) { * from constraint.domain import Unassigned # <<<<<<<<<<<<<< * from typing import Callable, Union, Optional * from collections.abc import Sequence - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) +*/ + __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_INCREF(__pyx_n_s_Unassigned); - __Pyx_GIVEREF(__pyx_n_s_Unassigned); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Unassigned)) __PYX_ERR(0, 3, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_constraint_domain, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) + __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_n_s_Unassigned); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) + __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) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Unassigned, __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_Unassigned, __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; @@ -22222,32 +23727,23 @@ if (!__Pyx_RefNanny) { * from typing import Callable, Union, Optional # <<<<<<<<<<<<<< * from collections.abc import Sequence * - */ - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) +*/ + __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_INCREF(__pyx_n_s_Callable); - __Pyx_GIVEREF(__pyx_n_s_Callable); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Callable)) __PYX_ERR(0, 4, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_Union); - __Pyx_GIVEREF(__pyx_n_s_Union); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_Union)) __PYX_ERR(0, 4, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_Optional); - __Pyx_GIVEREF(__pyx_n_s_Optional); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_Optional)) __PYX_ERR(0, 4, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) + __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) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Callable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) + __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_d, __pyx_n_s_Callable, __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_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_n_s_Union); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) + __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_d, __pyx_n_s_Union, __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_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_n_s_Optional); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) + __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_d, __pyx_n_s_Optional, __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_Optional, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -22257,18 +23753,15 @@ if (!__Pyx_RefNanny) { * from collections.abc import Sequence # <<<<<<<<<<<<<< * * class Constraint: - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) +*/ + __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_INCREF(__pyx_n_s_Sequence); - __Pyx_GIVEREF(__pyx_n_s_Sequence); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Sequence)) __PYX_ERR(0, 5, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_collections_abc, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + __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_n_s_Sequence); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __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_d, __pyx_n_s_Sequence, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + 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; @@ -22278,8 +23771,8 @@ if (!__Pyx_RefNanny) { * class Constraint: # <<<<<<<<<<<<<< * """Abstract base class for constraints.""" * - */ - __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Constraint, __pyx_n_s_Constraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Abstract_base_class_for_constrai); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) +*/ + __pyx_t_3 = __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_3)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "constraint/constraints.py":10 @@ -22288,18 +23781,18 @@ if (!__Pyx_RefNanny) { * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # <<<<<<<<<<<<<< * """Perform the constraint checking. * - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_10Constraint_1__call__, 0, __pyx_n_s_Constraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __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, 10, __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, 10, __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, 10, __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[5])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__7); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0]); __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_n_s_call, __pyx_t_4) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":35 @@ -22308,18 +23801,18 @@ if (!__Pyx_RefNanny) { * 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, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 35, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 35, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 35, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 35, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_10Constraint_3preProcess, 0, __pyx_n_s_Constraint_preProcess, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __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, 35, __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, 35, __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, 35, __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, 35, __pyx_L1_error) + __pyx_t_2 = __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[6])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_preProcess, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/constraints.py":63 @@ -22328,24 +23821,24 @@ if (!__Pyx_RefNanny) { * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): # <<<<<<<<<<<<<< * """Helper method for generic forward checking. * - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 63, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 63, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 63, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_10Constraint_5forwardCheck, 0, __pyx_n_s_Constraint_forwardCheck, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __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, 63, __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, 63, __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, 63, __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[7])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 63, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Unassigned); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_4)->__pyx_arg__unassigned = __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_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_forwardCheck, __pyx_t_4) < 0) __PYX_ERR(0, 63, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_forwardCheck, __pyx_t_4) < 0) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":7 @@ -22354,10 +23847,10 @@ if (!__Pyx_RefNanny) { * class Constraint: # <<<<<<<<<<<<<< * """Abstract base class for constraints.""" * - */ - __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Constraint, __pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Constraint, __pyx_t_4) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_t_4) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -22367,19 +23860,17 @@ if (!__Pyx_RefNanny) { * class FunctionConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint which wraps a function defining the constraint logic. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error); - __pyx_t_3 = 0; + __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, 104, __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, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_FunctionConstraint, __pyx_n_s_FunctionConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_which_wraps_a_functio); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __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, 104, __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, 104, __pyx_L1_error) @@ -22392,17 +23883,17 @@ if (!__Pyx_RefNanny) { * 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, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_func, __pyx_n_s_Callable) < 0) __PYX_ERR(0, 125, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_assigned, __pyx_n_s_bool) < 0) __PYX_ERR(0, 125, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18FunctionConstraint_1__init__, 0, __pyx_n_s_FunctionConstraint___init, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_func, __pyx_mstate_global->__pyx_n_u_Callable) < 0) __PYX_ERR(0, 125, __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, 125, __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[8])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__14); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[1]); __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_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 125, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/constraints.py":137 @@ -22411,15 +23902,15 @@ if (!__Pyx_RefNanny) { * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 137, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 137, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 137, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18FunctionConstraint_3__call__, 0, __pyx_n_s_FunctionConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __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, 137, __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, 137, __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, 137, __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[9])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 137, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 137, __pyx_L1_error) /* "constraint/constraints.py":143 * assignments: dict, @@ -22427,16 +23918,16 @@ if (!__Pyx_RefNanny) { * _unassigned=Unassigned, # <<<<<<<<<<<<<< * ): * # # initial code: 0.94621 seconds, Cythonized: 0.92805 seconds - */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Unassigned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 143, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_4)->__pyx_arg__unassigned = __pyx_t_7; + __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_4)->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_n_s_call, __pyx_t_4) < 0) __PYX_ERR(0, 137, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":104 @@ -22445,10 +23936,10 @@ if (!__Pyx_RefNanny) { * class FunctionConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint which wraps a function defining the constraint logic. * - */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FunctionConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FunctionConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 104, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 104, __pyx_L1_error) __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; @@ -22460,19 +23951,17 @@ if (!__Pyx_RefNanny) { * class CompilableFunctionConstraint(Constraint): # <<<<<<<<<<<<<< * """Wrapper function for picklable string constraints that must be compiled into a FunctionConstraint later on.""" * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error); - __pyx_t_3 = 0; + __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, 190, __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, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_n_s_CompilableFunctionConstraint, __pyx_n_s_CompilableFunctionConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Wrapper_function_for_picklable_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __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, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_3 != __pyx_t_2) { if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 190, __pyx_L1_error) @@ -22485,17 +23974,17 @@ if (!__Pyx_RefNanny) { * def __init__(self, func: str, assigned: bool = True): # noqa: D102, D107 # <<<<<<<<<<<<<< * self._func = func * self._assigned = assigned - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_func, __pyx_n_s_str) < 0) __PYX_ERR(0, 193, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_assigned, __pyx_n_s_bool) < 0) __PYX_ERR(0, 193, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_28CompilableFunctionConstraint_1__init__, 0, __pyx_n_s_CompilableFunctionConstraint___i, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_func, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 193, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_assigned, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(0, 193, __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[10])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__14); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[1]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 193, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/constraints.py":197 @@ -22504,17 +23993,17 @@ if (!__Pyx_RefNanny) { * 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_n_s_CompilableFunctionConstraint___c, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error) +*/ + __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[11])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_6, sizeof(__pyx_defaults2), 1)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Unassigned); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_6, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_6)->__pyx_arg__unassigned = __pyx_t_2; + __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_6)->arg0 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_6, __pyx_pf_10constraint_11constraints_4__defaults__); - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_call, __pyx_t_6) < 0) __PYX_ERR(0, 197, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/constraints.py":190 @@ -22523,10 +24012,10 @@ if (!__Pyx_RefNanny) { * 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_n_s_CompilableFunctionConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) +*/ + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CompilableFunctionConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 190, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 190, __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; @@ -22538,19 +24027,17 @@ if (!__Pyx_RefNanny) { * class AllDifferentConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of all given variables are different. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error); - __pyx_t_3 = 0; + __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, 201, __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, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_n_s_AllDifferentConstraint, __pyx_n_s_AllDifferentConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_values); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __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, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3 != __pyx_t_5) { if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 201, __pyx_L1_error) @@ -22563,15 +24050,15 @@ if (!__Pyx_RefNanny) { * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 212, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 212, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 212, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_22AllDifferentConstraint_1__call__, 0, __pyx_n_s_AllDifferentConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __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, 212, __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, 212, __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, 212, __pyx_L1_error) + __pyx_t_2 = __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[12])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, sizeof(__pyx_defaults3), 1)) __PYX_ERR(0, 212, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 212, __pyx_L1_error) /* "constraint/constraints.py":218 * assignments: dict, @@ -22579,16 +24066,16 @@ if (!__Pyx_RefNanny) { * _unassigned=Unassigned, # <<<<<<<<<<<<<< * ): * seen = {} - */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Unassigned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_2)->__pyx_arg__unassigned = __pyx_t_7; + __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_2)->arg0 = __pyx_t_7; __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_2, __pyx_pf_10constraint_11constraints_6__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_call, __pyx_t_2) < 0) __PYX_ERR(0, 212, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_2) < 0) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/constraints.py":201 @@ -22597,10 +24084,10 @@ if (!__Pyx_RefNanny) { * class AllDifferentConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of all given variables are different. * - */ - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_AllDifferentConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AllDifferentConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 201, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -22612,19 +24099,17 @@ if (!__Pyx_RefNanny) { * class AllEqualConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of all given variables are equal. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error); - __pyx_t_3 = 0; + __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, 239, __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, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __pyx_n_s_AllEqualConstraint, __pyx_n_s_AllEqualConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_values_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __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_2)) __PYX_ERR(0, 239, __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, 239, __pyx_L1_error) @@ -22637,15 +24122,15 @@ if (!__Pyx_RefNanny) { * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 250, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 250, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 250, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18AllEqualConstraint_1__call__, 0, __pyx_n_s_AllEqualConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __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, 250, __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, 250, __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, 250, __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[13])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_5, sizeof(__pyx_defaults4), 1)) __PYX_ERR(0, 250, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 250, __pyx_L1_error) /* "constraint/constraints.py":256 * assignments: dict, @@ -22653,16 +24138,16 @@ if (!__Pyx_RefNanny) { * _unassigned=Unassigned, # <<<<<<<<<<<<<< * ): * singlevalue = _unassigned - */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Unassigned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_5)->__pyx_arg__unassigned = __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_2, __pyx_n_s_call, __pyx_t_5) < 0) __PYX_ERR(0, 250, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/constraints.py":239 @@ -22671,10 +24156,10 @@ if (!__Pyx_RefNanny) { * class AllEqualConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of all given variables are equal. * - */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_AllEqualConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 239, __pyx_L1_error) +*/ + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AllEqualConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_DECREF(__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; @@ -22686,19 +24171,17 @@ if (!__Pyx_RefNanny) { * class MaxSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum up to a given amount. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error); - __pyx_t_3 = 0; + __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, 277, __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, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_MaxSumConstraint, __pyx_n_s_MaxSumConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_values_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __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_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 277, __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, 277, __pyx_L1_error) @@ -22711,17 +24194,17 @@ if (!__Pyx_RefNanny) { * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_maxsum, __pyx_kp_s_Union_int_float) < 0) __PYX_ERR(0, 288, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_multipliers, __pyx_kp_s_Optional_Sequence) < 0) __PYX_ERR(0, 288, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MaxSumConstraint_1__init__, 0, __pyx_n_s_MaxSumConstraint___init, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) + 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, 288, __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, 288, __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[14])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__26); + __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_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 288, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":300 @@ -22730,18 +24213,18 @@ if (!__Pyx_RefNanny) { * 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, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 300, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 300, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 300, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 300, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MaxSumConstraint_3preProcess, 0, __pyx_n_s_MaxSumConstraint_preProcess, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __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, 300, __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, 300, __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, 300, __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, 300, __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[15])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __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_n_s_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 300, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/constraints.py":335 @@ -22750,18 +24233,18 @@ if (!__Pyx_RefNanny) { * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers * maxsum = self._maxsum - */ +*/ __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 335, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 335, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 335, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MaxSumConstraint_5__call__, 0, __pyx_n_s_MaxSumConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __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, 335, __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, 335, __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, 335, __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[16])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__7); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0]); __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_n_s_call, __pyx_t_4) < 0) __PYX_ERR(0, 335, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":277 @@ -22770,10 +24253,10 @@ if (!__Pyx_RefNanny) { * class MaxSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum up to a given amount. * - */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_MaxSumConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 277, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MaxSumConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 277, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 277, __pyx_L1_error) __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; @@ -22785,19 +24268,17 @@ if (!__Pyx_RefNanny) { * class ExactSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum exactly to a given amount. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error); - __pyx_t_3 = 0; + __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, 376, __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, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_n_s_ExactSumConstraint, __pyx_n_s_ExactSumConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_values_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __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_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_3 != __pyx_t_2) { if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 376, __pyx_L1_error) @@ -22810,17 +24291,17 @@ if (!__Pyx_RefNanny) { * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_exactsum, __pyx_kp_s_Union_int_float) < 0) __PYX_ERR(0, 387, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_multipliers, __pyx_kp_s_Optional_Sequence) < 0) __PYX_ERR(0, 387, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18ExactSumConstraint_1__init__, 0, __pyx_n_s_ExactSumConstraint___init, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exactsum, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Optional_Sequence) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_6 = __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[17])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__26); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[2]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/constraints.py":399 @@ -22829,18 +24310,18 @@ if (!__Pyx_RefNanny) { * 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_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 399, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 399, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 399, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 399, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18ExactSumConstraint_3preProcess, 0, __pyx_n_s_ExactSumConstraint_preProcess, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __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, 399, __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, 399, __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, 399, __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, 399, __pyx_L1_error) + __pyx_t_2 = __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[18])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __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_4, __pyx_n_s_preProcess, __pyx_t_2) < 0) __PYX_ERR(0, 399, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_2) < 0) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/constraints.py":416 @@ -22849,18 +24330,18 @@ if (!__Pyx_RefNanny) { * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers * exactsum = self._exactsum - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 416, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 416, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 416, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18ExactSumConstraint_5__call__, 0, __pyx_n_s_ExactSumConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 416, __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, 416, __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, 416, __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, 416, __pyx_L1_error) + __pyx_t_6 = __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[19])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__7); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[0]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_call, __pyx_t_6) < 0) __PYX_ERR(0, 416, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/constraints.py":376 @@ -22869,651 +24350,1326 @@ if (!__Pyx_RefNanny) { * class ExactSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum exactly to a given amount. * - */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_ExactSumConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error) +*/ + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ExactSumConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 376, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 376, __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_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":465 - * + /* "constraint/constraints.py":464 + * return sum == exactsum * - * class MinSumConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables sum at least to a given amount. + * class VariableExactSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that the sum of variables equals the value of another variable. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error) + __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, 464, __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, 465, __pyx_L1_error) + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_n_s_MinSumConstraint, __pyx_n_s_MinSumConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_values_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __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_6)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3 != __pyx_t_5) { - if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 465, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 464, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":476 + /* "constraint/constraints.py":475 * """ * - * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 476, __pyx_L1_error) +*/ + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_minsum, __pyx_kp_s_Union_int_float) < 0) __PYX_ERR(0, 476, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_multipliers, __pyx_kp_s_Optional_Sequence) < 0) __PYX_ERR(0, 476, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MinSumConstraint_1__init__, 0, __pyx_n_s_MinSumConstraint___init, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __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, 475, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_sum_vars, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 475, __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, 475, __pyx_L1_error) + __pyx_t_2 = __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[20])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__26); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[2]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 476, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":488 - * self._multipliers = multipliers + /* "constraint/constraints.py":494 + * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." * - * 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_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * +*/ + __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 488, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 488, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 488, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MinSumConstraint_3__call__, 0, __pyx_n_s_MinSumConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 488, __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, 494, __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, 494, __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, 494, __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, 494, __pyx_L1_error) + __pyx_t_5 = __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[21])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_call, __pyx_t_5) < 0) __PYX_ERR(0, 488, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":465 - * + /* "constraint/constraints.py":516 + * domain.remove(value) * - * class MinSumConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables sum at least to a given amount. + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * multipliers = self._multipliers * - */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_MinSumConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error) +*/ + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MinSumConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 465, __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, 516, __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, 516, __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, 516, __pyx_L1_error) + __pyx_t_2 = __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[22])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[0]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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_2) < 0) __PYX_ERR(0, 516, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":464 + * return sum == exactsum + * + * class VariableExactSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that the sum of variables equals the value of another variable. + * +*/ + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __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, 464, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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; - /* "constraint/constraints.py":509 + /* "constraint/constraints.py":568 * * - * class MaxProdConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables create a product up to at most a given amount.""" + * class MinSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of given variables sum at least to a given amount. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error) + __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, 568, __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, 509, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __pyx_n_s_MaxProdConstraint, __pyx_n_s_MaxProdConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_values_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __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_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_3 != __pyx_t_4) { - if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 509, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 568, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":512 - * """Constraint enforcing that values of given variables create a product up to at most a given amount.""" + /* "constraint/constraints.py":579 + * """ * - * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< - * """Instantiate a MaxProdConstraint. + * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * """Initialization method. * - */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_maxprod, __pyx_kp_s_Union_int_float) < 0) __PYX_ERR(0, 512, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MaxProdConstraint_1__init__, 0, __pyx_n_s_MaxProdConstraint___init, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_minsum, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 579, __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, 579, __pyx_L1_error) + __pyx_t_5 = __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[23])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[2]); + __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_init, __pyx_t_5) < 0) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "constraint/constraints.py":591 + * self._multipliers = multipliers + * + * 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_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 591, __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, 591, __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, 591, __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, 591, __pyx_L1_error) + __pyx_t_4 = __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[24])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0]); + __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_call, __pyx_t_4) < 0) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":568 + * + * + * class MinSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of given variables sum at least to a given amount. + * +*/ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":612 + * + * + * class MaxProdConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of given variables create a product up to at most a given amount.""" + * +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __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, 612, __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, 612, __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, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __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_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_3 != __pyx_t_6) { + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 612, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":520 + /* "constraint/constraints.py":615 + * """Constraint enforcing that values of given variables create a product up to at most a given amount.""" + * + * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< + * """Instantiate a MaxProdConstraint. + * +*/ + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 615, __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_Union_int_float) < 0) __PYX_ERR(0, 615, __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[25])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __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_init, __pyx_t_5) < 0) __PYX_ERR(0, 615, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "constraint/constraints.py":623 * self._maxprod = maxprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * - */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 520, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 520, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 520, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 520, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MaxProdConstraint_3preProcess, 0, __pyx_n_s_MaxProdConstraint_preProcess, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __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_5, __pyx_n_s_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 520, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +*/ + __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 623, __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, 623, __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, 623, __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, 623, __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, 623, __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[26])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 623, __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, 623, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":547 + /* "constraint/constraints.py":650 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * maxprod = self._maxprod * prod = 1 - */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 547, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 547, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 547, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MaxProdConstraint_5__call__, 0, __pyx_n_s_MaxProdConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_call, __pyx_t_2) < 0) __PYX_ERR(0, 547, __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, 650, __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, 650, __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, 650, __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, 650, __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[27])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 650, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[0]); + __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_call, __pyx_t_5) < 0) __PYX_ERR(0, 650, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":509 + /* "constraint/constraints.py":612 * * * class MaxProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product up to at most a given amount.""" * - */ - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_MaxProdConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MaxProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 509, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +*/ + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 612, __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, 612, __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; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":569 + /* "constraint/constraints.py":672 * * * class MinProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product up to at least a given amount.""" * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __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, 672, __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, 569, __pyx_L1_error) + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 672, __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_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_5)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_n_s_MinProdConstraint, __pyx_n_s_MinProdConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_values_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__pyx_t_3 != __pyx_t_6) { - if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 569, __pyx_L1_error) + if (__pyx_t_3 != __pyx_t_2) { + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 672, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":572 + /* "constraint/constraints.py":675 * """Constraint enforcing that values of given variables create a product up to at least a given amount.""" * * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MinProdConstraint. * - */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_minprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_6 = __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[28])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_minprod, __pyx_kp_s_Union_int_float) < 0) __PYX_ERR(0, 572, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MinProdConstraint_1__init__, 0, __pyx_n_s_MinProdConstraint___init, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 572, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":580 + /* "constraint/constraints.py":683 * 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_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 580, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 580, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 580, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 580, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MinProdConstraint_3preProcess, 0, __pyx_n_s_MinProdConstraint_preProcess, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 580, __pyx_L1_error) +*/ + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 683, __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_2, __pyx_n_s_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 580, __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, 683, __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, 683, __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, 683, __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, 683, __pyx_L1_error) + __pyx_t_2 = __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[29])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __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_preProcess, __pyx_t_2) < 0) __PYX_ERR(0, 683, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":591 + /* "constraint/constraints.py":694 * 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_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 591, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 694, __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, 694, __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, 694, __pyx_L1_error) + __pyx_t_6 = __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[30])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 591, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 591, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 591, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MinProdConstraint_5__call__, 0, __pyx_n_s_MinProdConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 591, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[0]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_call, __pyx_t_4) < 0) __PYX_ERR(0, 591, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":569 + /* "constraint/constraints.py":672 * * * class MinProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product up to at least a given amount.""" * - */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_MinProdConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MinProdConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 569, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +*/ + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 672, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 672, __pyx_L1_error) + __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_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":607 + /* "constraint/constraints.py":710 * * * class InSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are present in the given set. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 607, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __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, 607, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_InSetConstraint, __pyx_n_s_InSetConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_values_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 710, __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, 607, __pyx_L1_error) + __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, 710, __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, 710, __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_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_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 710, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_3 != __pyx_t_4) { + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 710, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":618 + /* "constraint/constraints.py":721 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_15InSetConstraint_1__init__, 0, __pyx_n_s_InSetConstraint___init, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 618, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 618, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; +*/ + __pyx_t_4 = __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[31])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 721, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":626 + /* "constraint/constraints.py":729 * 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_15InSetConstraint_3__call__, 0, __pyx_n_s_InSetConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__7); - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_call, __pyx_t_5) < 0) __PYX_ERR(0, 626, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; +*/ + __pyx_t_4 = __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[32])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0]); + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 729, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":630 + /* "constraint/constraints.py":733 * 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, 630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 630, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 630, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 630, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 630, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_15InSetConstraint_5preProcess, 0, __pyx_n_s_InSetConstraint_preProcess, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 630, __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_n_s_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 630, __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, 733, __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, 733, __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, 733, __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, 733, __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, 733, __pyx_L1_error) + __pyx_t_2 = __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[33])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 733, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_2) < 0) __PYX_ERR(0, 733, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":607 + /* "constraint/constraints.py":710 * * * class InSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are present in the given set. * - */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_InSetConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 607, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_InSetConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 607, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +*/ + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_DECREF(__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_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":641 + /* "constraint/constraints.py":744 * * * class NotInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are not present in the given set. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 744, __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, 744, __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, 641, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_n_s_NotInSetConstraint, __pyx_n_s_NotInSetConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_values_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 744, __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, 641, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __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_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (__pyx_t_3 != __pyx_t_5) { + if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 744, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":652 + /* "constraint/constraints.py":755 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18NotInSetConstraint_1__init__, 0, __pyx_n_s_NotInSetConstraint___init, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 652, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +*/ + __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[34])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(0, 755, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":660 + /* "constraint/constraints.py":763 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * # preProcess() will remove it. * raise RuntimeError("Can't happen") - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18NotInSetConstraint_3__call__, 0, __pyx_n_s_NotInSetConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__7); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_call, __pyx_t_2) < 0) __PYX_ERR(0, 660, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +*/ + __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[35])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[0]); + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 763, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":664 + /* "constraint/constraints.py":767 * 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_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 664, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 664, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 664, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 664, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 664, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18NotInSetConstraint_5preProcess, 0, __pyx_n_s_NotInSetConstraint_preProcess, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 664, __pyx_L1_error) +*/ + __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 767, __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_6, __pyx_n_s_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 664, __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, 767, __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, 767, __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, 767, __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, 767, __pyx_L1_error) + __pyx_t_4 = __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[36])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 767, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __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, 767, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":641 + /* "constraint/constraints.py":744 * * * class NotInSetConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables are not present in the given set. - * - */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_NotInSetConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 641, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_NotInSetConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 641, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + * """Constraint enforcing that values of given variables are not present in the given set. + * +*/ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 744, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 744, __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_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":675 + /* "constraint/constraints.py":778 * * * 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_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 778, __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, 675, __pyx_L1_error) + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __pyx_n_s_SomeInSetConstraint, __pyx_n_s_SomeInSetConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_at_lea); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 675, __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, 675, __pyx_L1_error) + __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, 778, __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, 778, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __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_4)) __PYX_ERR(0, 778, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_3 != __pyx_t_6) { + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 778, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":686 + /* "constraint/constraints.py":789 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_19SomeInSetConstraint_1__init__, 0, __pyx_n_s_SomeInSetConstraint___init, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__63); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 686, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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[37])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 789, __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_init, __pyx_t_6) < 0) __PYX_ERR(0, 789, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":700 + /* "constraint/constraints.py":803 * 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, 700, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 700, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 700, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 700, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_19SomeInSetConstraint_3__call__, 0, __pyx_n_s_SomeInSetConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 700, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_call, __pyx_t_2) < 0) __PYX_ERR(0, 700, __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, 803, __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, 803, __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, 803, __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, 803, __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[38])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[0]); + __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_call, __pyx_t_5) < 0) __PYX_ERR(0, 803, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":675 + /* "constraint/constraints.py":778 * * * class SomeInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that at least some of the values of given variables must be present in a given set. * - */ - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_SomeInSetConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SomeInSetConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +*/ + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 778, __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, 778, __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; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":737 + /* "constraint/constraints.py":840 * * * 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_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 737, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 737, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 737, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 840, __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, 840, __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, 737, __pyx_L1_error) + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __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_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, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_n_s_SomeNotInSetConstraint, __pyx_n_s_SomeNotInSetConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_at_lea_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__pyx_t_3 != __pyx_t_6) { - if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 737, __pyx_L1_error) + if (__pyx_t_3 != __pyx_t_2) { + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 840, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":748 + /* "constraint/constraints.py":851 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_22SomeNotInSetConstraint_1__init__, 0, __pyx_n_s_SomeNotInSetConstraint___init, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 748, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__63); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 748, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; +*/ + __pyx_t_2 = __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[39])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[3]); + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(0, 851, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":762 + /* "constraint/constraints.py":865 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * missing = 0 - */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 762, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 865, __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, 865, __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, 865, __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[40])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 762, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 762, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 762, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_22SomeNotInSetConstraint_3__call__, 0, __pyx_n_s_SomeNotInSetConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 762, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[0]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_call, __pyx_t_4) < 0) __PYX_ERR(0, 762, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":737 + /* "constraint/constraints.py":840 * * * 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_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_SomeNotInSetConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SomeNotInSetConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 737, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +*/ + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 840, __pyx_L1_error) + __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_3); __pyx_t_3 = 0; /* "constraint/constraints.py":1 * """Module containing the code for constraint definitions.""" # <<<<<<<<<<<<<< * * from constraint.domain import Unassigned - */ +*/ __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_d, __pyx_n_s_test, __pyx_t_3) < 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_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /*--- Wrapped vars code ---*/ + /*--- 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); + if (__pyx_m) { + if (__pyx_mstate->__pyx_d && stringtab_initialized) { + __Pyx_AddTraceback("init constraint.constraints", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + #if !CYTHON_USE_MODULE_STATE + Py_CLEAR(__pyx_m); + #else + Py_DECREF(__pyx_m); + if (pystate_addmodule_run) { + PyObject *tp, *value, *tb; + PyErr_Fetch(&tp, &value, &tb); + PyState_RemoveModule(&__pyx_moduledef); + PyErr_Restore(tp, value, tb); + } + #endif + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init constraint.constraints"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #else + return __pyx_m; + #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_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_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_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_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_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_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_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_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_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_call, sizeof(__pyx_k_call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_call */ + {__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_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_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_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_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_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_list_tuple, sizeof(__pyx_k_list_tuple), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_tuple */ + {__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_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_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_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_missing, sizeof(__pyx_k_missing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_missing */ + {__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_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_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_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_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_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_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_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_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_value, sizeof(__pyx_k_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_value */ + {__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, 198, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_round); if (!__pyx_builtin_round) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_max); if (!__pyx_builtin_max) __PYX_ERR(0, 503, __pyx_L1_error) + __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 508, __pyx_L1_error) + __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_min); if (!__pyx_builtin_min) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 731, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "constraint/constraints.py":57 + * 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, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); + + /* "constraint/constraints.py":10 + * """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[0] = PyTuple_Pack(1, ((PyObject*)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); + + /* "constraint/constraints.py":125 + * """ + * + * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(1, ((PyObject*)Py_True)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); + + /* "constraint/constraints.py":288 + * """ + * + * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); + + /* "constraint/constraints.py":789 + * """ + * + * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + __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, 789, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +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) + 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; +/* 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 *tuple_dedup_map +); + + +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), 307, 2}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_value}; + __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; + } + { + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 491, 2}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_m}; + __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__4, 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), 508, 2}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 509, 2}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_v}; + __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_A, 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), 630, 2}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_value}; + __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_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 10, 20}; + 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[5] = __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[5])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 35, 109}; + 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[6] = __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[6])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 63, 151}; + 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[7] = __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[7])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 125, 25}; + 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[8] = __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[8])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 137, 142}; + 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[9] = __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[9])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 193, 23}; + 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[10] = __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[10])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 197, 19}; + 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[11] = __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[11])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 212, 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_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[12] = __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[12])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 250, 160}; + 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[13] = __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[13])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 288, 27}; + 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[14] = __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[14])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 300, 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[15] = __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[15])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 335, 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[16] = __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[16])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 387, 27}; + 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[17] = __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[17])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 399, 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[18] = __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[18])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 416, 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[19] = __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[19])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 475, 86}; + 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[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_M_N_L_A_1_3a_Cs_Rs_J_b_3c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 494, 220}; + 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[21] = __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[21])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 516, 347}; + 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[22] = __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[22])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 579, 27}; + 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[23] = __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[23])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 591, 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[24] = __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[24])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 615, 14}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_maxprod}; + __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_k_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, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 623, 192}; + 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_lt1, __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[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_QfKy_Q_1_A_L_gQ_Cq_WA_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 650, 164}; + 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_variable, __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_k_55H_a_a_q_L_y_1_1A_QfA_5_q_5_1, 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), 675, 14}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_minprod}; + __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_k_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 683, 92}; + 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[29] = __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[29])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 694, 95}; + 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[30] = __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[30])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 721, 11}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set}; + __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_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 729, 14}; + 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[32] = __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[32])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 733, 91}; + 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[33] = __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[33])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 755, 11}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set}; + __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_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 763, 14}; + 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[35] = __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[35])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 767, 91}; + 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[36] = __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[36])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 789, 30}; + 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[37] = __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[37])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 803, 249}; + 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[38] = __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[38])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 851, 30}; + 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[39] = __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[39])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 865, 249}; + 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[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_L_y_1_AZwa_1_1_t1_5_c_W, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) goto bad; + } + Py_DECREF(tuple_dedup_map); + return 0; + bad: + Py_DECREF(tuple_dedup_map); + return -1; +} +/* #### Code section: init_globals ### */ + +static int __Pyx_InitGlobals(void) { + /* PythonCompatibility.init */ + if (likely(__Pyx_init_co_variables() == 0)); else - 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); - if (__pyx_m) { - if (__pyx_d && stringtab_initialized) { - __Pyx_AddTraceback("init constraint.constraints", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - #if !CYTHON_USE_MODULE_STATE - Py_CLEAR(__pyx_m); - #else - Py_DECREF(__pyx_m); - if (pystate_addmodule_run) { - PyObject *tp, *value, *tb; - PyErr_Fetch(&tp, &value, &tb); - PyState_RemoveModule(&__pyx_moduledef); - PyErr_Restore(tp, value, tb); +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) + + /* 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); } - #endif - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init constraint.constraints"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if CYTHON_PEP489_MULTI_PHASE_INIT - return (__pyx_m != NULL) ? 0 : -1; - #elif PY_MAJOR_VERSION >= 3 - return __pyx_m; - #else - return; - #endif +} // error handling follows +#endif + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + return 0; + __pyx_L1_error:; + return -1; } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ @@ -23555,11 +25711,9 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; itp_getattro)) return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ -#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -23677,11 +25827,11 @@ static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; -#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 +#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 && PY_VERSION_HEX >= 0x030700B1 +#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); @@ -23697,20 +25847,36 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif } return result; } /* TupleAndListFromArray */ -#if CYTHON_COMPILING_IN_CPYTHON +#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; @@ -23724,8 +25890,7 @@ __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { - Py_INCREF(__pyx_empty_tuple); - return __pyx_empty_tuple; + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; @@ -23748,7 +25913,8 @@ __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ + !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { @@ -23795,55 +25961,39 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL return PyObject_RichCompareBool(s1, s2, equals); #else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; + Py_ssize_t length, length2; int kind; void *data1, *data2; + #if !CYTHON_COMPILING_IN_LIMITED_API if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; + #endif length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length < 0)) return -1; + #endif + length2 = __Pyx_PyUnicode_GET_LENGTH(s2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length2 < 0)) return -1; + #endif + if (length != length2) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; - #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; - #else - hash1 = ((PyUnicodeObject*)s1)->hash; - hash2 = ((PyUnicodeObject*)s2)->hash; - #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } @@ -23861,9 +26011,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { @@ -23873,9 +26020,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -23883,14 +26027,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int return result; } return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ); return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_NE); #endif } @@ -23899,14 +26037,25 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { - Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(n == -1)) return NULL; + #endif for (i = 0; i < n; i++) { - if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + if (s == namei) return kwvalues[i]; } for (i = 0; i < n; i++) { - int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; @@ -23914,15 +26063,26 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO } return NULL; } -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { - Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); + Py_ssize_t i, nkwargs; PyObject *dict; +#if !CYTHON_ASSUME_SAFE_SIZE + nkwargs = PyTuple_Size(kwnames); + if (unlikely(nkwargs < 0)) return NULL; +#else + nkwargs = PyTuple_GET_SIZE(kwnames); +#endif dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif } -/* ParseKeywords */ -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); - while (1) { - Py_XDECREF(key); key = NULL; - Py_XDECREF(value); value = NULL; - if (kwds_is_tuple) { - Py_ssize_t size; -#if CYTHON_ASSUME_SAFE_MACROS - size = PyTuple_GET_SIZE(kwds); -#else - size = PyTuple_Size(kwds); - if (size < 0) goto bad; -#endif - if (pos >= size) break; -#if CYTHON_AVOID_BORROWED_REFS - key = __Pyx_PySequence_ITEM(kwds, pos); - if (!key) goto bad; -#elif CYTHON_ASSUME_SAFE_MACROS - key = PyTuple_GET_ITEM(kwds, pos); -#else - key = PyTuple_GetItem(kwds, pos); - if (!key) goto bad; -#endif - value = kwvalues[pos]; - pos++; +/* 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 (!PyDict_Next(kwds, &pos, &key, &value)) break; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); + 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 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} #endif - } - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(value); - Py_DECREF(key); + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); + self = __Pyx_CyOrPyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} #endif - key = NULL; - value = NULL; - continue; - } -#if !CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); + +/* PyObjectFastCall */ +#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; + PyObject *result = 0; + size_t i; + argstuple = PyTuple_New((Py_ssize_t)nargs); + if (unlikely(!argstuple)) return NULL; + for (i = 0; i < nargs; i++) { + Py_INCREF(args[i]); + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad; + } + result = __Pyx_PyObject_Call(func, argstuple, kwargs); + bad: + Py_DECREF(argstuple); + return result; +} #endif - Py_INCREF(value); - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; +#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API + #if PY_VERSION_HEX < 0x03090000 + #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable) + #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 (__Pyx_CyFunction_CheckExact(callable)) { + return __Pyx_CyFunction_func_vectorcall(callable); + } + #endif + if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) { + return NULL; + } + assert(PyCallable_Check(callable)); + Py_ssize_t offset = tp->tp_vectorcall_offset; + assert(offset > 0); + vectorcallfunc ptr; + memcpy(&ptr, (char *) callable + offset, sizeof(ptr)); + return ptr; +} + #else + #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable) + #endif #endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = ( - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key) - ); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) { + Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); +#if CYTHON_COMPILING_IN_CPYTHON + if (nargs == 0 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) + return __Pyx_PyObject_CallMethO(func, NULL); + } + else if (nargs == 1 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) + return __Pyx_PyObject_CallMethO(func, args[0]); + } #endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + #if PY_VERSION_HEX < 0x030800B1 + #if CYTHON_FAST_PYCCALL + if (PyCFunction_Check(func)) { + if (kwargs) { + return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { - goto invalid_keyword; + return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } - Py_XDECREF(key); - Py_XDECREF(value); - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - #if PY_MAJOR_VERSION < 3 - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - PyErr_Format(PyExc_TypeError, - "%s() got an unexpected keyword argument '%U'", - function_name, key); + if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { + return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); + } #endif -bad: - Py_XDECREF(key); - Py_XDECREF(value); - return -1; -} - -/* ArgTypeTest */ -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) -{ - __Pyx_TypeName type_name; - __Pyx_TypeName obj_type_name; - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } - else if (exact) { - #if PY_MAJOR_VERSION == 2 - if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #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); #endif } - else { - if (likely(__Pyx_TypeCheck(obj, type))) return 1; + if (nargs == 0) { + return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs); } - type_name = __Pyx_PyType_GetName(type); - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME - ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); - __Pyx_DECREF_TypeName(type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return 0; + #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API + return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); + #else + return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); + #endif } -/* GetItemInt */ -static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (unlikely(!j)) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; +/* UnpackUnboundCMethod */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; + PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); + if (unlikely(!selfless_args)) return NULL; + result = PyObject_Call(method, selfless_args, kwargs); + Py_DECREF(selfless_args); + return result; +} +#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000 +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { + return _PyObject_Vectorcall + (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames); } -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_AVOID_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyList_GET_SIZE(o); - } - 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_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else - return PySequence_GetItem(o, i); +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + return +#if PY_VERSION_HEX < 0x03090000 + _PyObject_Vectorcall +#else + PyObject_Vectorcall #endif + (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames); } -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_AVOID_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyTuple_GET_SIZE(o); - } - 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; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#endif +static PyMethodDef __Pyx_UnboundCMethod_Def = { + "CythonUnboundCMethod", + __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 + METH_VARARGS | METH_KEYWORDS, #else - return PySequence_GetItem(o, i); + METH_FASTCALL | METH_KEYWORDS, #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_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS - 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))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } - else 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; - } - } else { - PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; - PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; - if (mm && mm->mp_subscript) { - PyObject *r, *key = PyInt_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 (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { - Py_ssize_t l = sm->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - return NULL; - PyErr_Clear(); - } - } - return sm->sq_item(o, i); + NULL +}; +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method, *result=NULL; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + result = method; +#if CYTHON_COMPILING_IN_CPYTHON + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } else +#endif +#if CYTHON_COMPILING_IN_PYPY +#else + if (PyCFunction_Check(method)) +#endif + { + PyObject *self; + int self_found; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + self = PyObject_GetAttrString(method, "__self__"); + if (!self) { + PyErr_Clear(); } - } #else - if (is_list || !PyMapping_Check(o)) { - return PySequence_GetItem(o, i); + self = PyCFunction_GET_SELF(method); +#endif + self_found = (self && self != Py_None); +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + Py_XDECREF(self); +#endif + if (self_found) { + PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); + if (unlikely(!unbound_method)) return -1; + Py_DECREF(method); + result = unbound_method; + } } +#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if (unlikely(target->method)) { + Py_DECREF(result); + } else #endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + target->method = result; + return 0; } -/* DictGetItem */ -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { - PyObject *value; - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (!PyErr_Occurred()) { - if (unlikely(PyTuple_Check(key))) { - PyObject* args = PyTuple_Pack(1, key); - if (likely(args)) { - PyErr_SetObject(PyExc_KeyError, args); - Py_DECREF(args); - } - } else { - PyErr_SetObject(PyExc_KeyError, key); - } +/* CallUnboundCMethod2 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { + int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); + if (likely(was_initialized == 2 && cfunc->func)) { + PyObject *args[2] = {arg1, arg2}; + if (cfunc->flag == METH_FASTCALL) { + return __Pyx_CallCFunctionFast(cfunc, self, args, 2); } - return NULL; + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL); } - Py_INCREF(value); - return value; +#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__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2); + } +#endif + PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); + __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); + return result; } #endif +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + PyObject *result = NULL; + PyObject *args = PyTuple_New(2); + if (unlikely(!args)) return NULL; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + if (cfunc->flag & METH_KEYWORDS) + result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); + else + result = __Pyx_CallCFunction(cfunc, self, args); + Py_DECREF(args); + return result; + } +#endif + { + PyObject *args[4] = {NULL, self, arg1, arg2}; + return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + } +} -/* 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, int wraparound) { - __Pyx_TypeName obj_type_name; -#if CYTHON_USE_TYPE_SLOTS - PyMappingMethods* mp; -#if PY_MAJOR_VERSION < 3 - PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; - if (likely(ms && ms->sq_slice)) { - if (!has_cstart) { - if (_py_start && (*_py_start != Py_None)) { - cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); - if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstart = 0; +/* ParseKeywords */ +static int __Pyx_ValidateDuplicatePosArgs( + PyObject *kwds, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + const char* function_name) +{ + PyObject ** const *name = argnames; + while (name != first_kw_arg) { + PyObject *key = **name; + int found = PyDict_Contains(kwds, key); + if (unlikely(found)) { + if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; } - if (!has_cstop) { - if (_py_stop && (*_py_stop != Py_None)) { - cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); - if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstop = PY_SSIZE_T_MAX; - } - if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { - Py_ssize_t l = ms->sq_length(obj); - if (likely(l >= 0)) { - if (cstop < 0) { - cstop += l; - if (cstop < 0) cstop = 0; - } - if (cstart < 0) { - cstart += l; - if (cstart < 0) cstart = 0; - } - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - goto bad; - PyErr_Clear(); + name++; + } + return 0; +bad: + return -1; +} +#if CYTHON_USE_UNICODE_INTERNALS +static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) { + int kind; + Py_ssize_t len = PyUnicode_GET_LENGTH(s1); + if (len != PyUnicode_GET_LENGTH(s2)) return 0; + kind = PyUnicode_KIND(s1); + if (kind != PyUnicode_KIND(s2)) return 0; + const void *data1 = PyUnicode_DATA(s1); + const void *data2 = PyUnicode_DATA(s2); + return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0); +} +#endif +static int __Pyx_MatchKeywordArg_str( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + PyObject ** const *name; + #if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t key_hash = ((PyASCIIObject*)key)->hash; + if (unlikely(key_hash == -1)) { + key_hash = PyObject_Hash(key); + if (unlikely(key_hash == -1)) + goto bad; + } + #endif + name = first_kw_arg; + while (*name) { + PyObject *name_str = **name; + #if CYTHON_USE_UNICODE_INTERNALS + if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) { + *index_found = (size_t) (name - argnames); + return 1; + } + #else + #if CYTHON_ASSUME_SAFE_SIZE + if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) + #endif + { + int cmp = PyUnicode_Compare(name_str, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + *index_found = (size_t) (name - argnames); + return 1; } } - return ms->sq_slice(obj, cstart, cstop); + #endif + name++; } -#else - CYTHON_UNUSED_VAR(wraparound); -#endif - mp = Py_TYPE(obj)->tp_as_mapping; - if (likely(mp && mp->mp_subscript)) -#else - CYTHON_UNUSED_VAR(wraparound); -#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 = PyInt_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 = PyInt_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; + name = argnames; + while (name != first_kw_arg) { + PyObject *name_str = **name; + #if CYTHON_USE_UNICODE_INTERNALS + if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) { + if (__Pyx_UnicodeKeywordsEqual(name_str, key)) + goto arg_passed_twice; } -#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); + #else + #if CYTHON_ASSUME_SAFE_SIZE + if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) + #endif + { + if (unlikely(name_str == key)) goto arg_passed_twice; + int cmp = PyUnicode_Compare(name_str, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; } - return result; + #endif + name++; } - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); - __Pyx_DECREF_TypeName(obj_type_name); + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; bad: - return NULL; + return -1; } - -/* PyFunctionFastCall */ -#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **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; +static int __Pyx_MatchKeywordArg_nostr( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + PyObject ** const *name; + if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; + name = first_kw_arg; + while (*name) { + int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); + if (cmp == 1) { + *index_found = (size_t) (name - argnames); + return 1; + } + if (unlikely(cmp == -1)) goto bad; + name++; } - fastlocals = __Pyx_PyFrame_GetLocalsplus(f); - for (i = 0; i < na; i++) { - Py_INCREF(*args); - fastlocals[i] = *args++; + name = argnames; + while (name != first_kw_arg) { + int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); + if (unlikely(cmp != 0)) { + if (cmp == 1) goto arg_passed_twice; + else goto bad; + } + name++; } - result = PyEval_EvalFrameEx(f,0); - ++tstate->recursion_depth; - Py_DECREF(f); - --tstate->recursion_depth; - return result; + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +bad: + return -1; } -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **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; -#if PY_MAJOR_VERSION >= 3 - PyObject *kwdefs; -#endif - 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 PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { - return NULL; - } - #else - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { - return NULL; - } - #endif - if ( -#if PY_MAJOR_VERSION >= 3 - co->co_kwonlyargcount == 0 && -#endif - 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; +static CYTHON_INLINE int __Pyx_MatchKeywordArg( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + return likely(PyUnicode_CheckExact(key)) ? + __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) : + __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name); +} +static void __Pyx_RejectUnknownKeyword( + PyObject *kwds, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + const char *function_name) +{ + Py_ssize_t pos = 0; + PyObject *key = NULL; + __Pyx_BEGIN_CRITICAL_SECTION(kwds); + while (PyDict_Next(kwds, &pos, &key, NULL)) { + 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) { + if (cmp == 0) { + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif + break; + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif } } - if (kwargs != NULL) { - Py_ssize_t pos, i; - kwtuple = PyTuple_New(2 * nk); - if (kwtuple == NULL) { - result = NULL; - goto done; + __Pyx_END_CRITICAL_SECTION(); + assert(PyErr_Occurred()); +} +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) +{ + PyObject** const *name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + Py_ssize_t extracted = 0; +#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) + if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; +#endif + name = first_kw_arg; + while (*name && num_kwargs > extracted) { + PyObject * key = **name; + PyObject *value; + int found = 0; + #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + found = PyDict_GetItemRef(kwds, key, &value); + #else + value = PyDict_GetItemWithError(kwds, key); + if (value) { + Py_INCREF(value); + found = 1; + } else { + if (unlikely(PyErr_Occurred())) goto bad; } - 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; + #endif + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + extracted++; } - nk = i / 2; + name++; } - else { - kwtuple = NULL; - k = NULL; + if (num_kwargs > extracted) { + if (ignore_unknown_kwargs) { + if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1)) + goto bad; + } else { + __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name); + goto bad; + } } - closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 - kwdefs = PyFunction_GET_KW_DEFAULTS(func); + return 0; +bad: + return -1; +} +static int __Pyx_ParseKeywordDictToDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject** const *name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + Py_ssize_t len; +#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) + if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; +#endif + if (PyDict_Update(kwds2, kwds) < 0) goto bad; + name = first_kw_arg; + while (*name) { + PyObject *key = **name; + PyObject *value; +#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop)) + int found = PyDict_Pop(kwds2, key, &value); + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + } +#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + int found = PyDict_GetItemRef(kwds2, key, &value); + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad; + } +#else + #if CYTHON_COMPILING_IN_CPYTHON + value = _PyDict_Pop(kwds2, key, kwds2); + #else + value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2); + #endif + if (value == kwds2) { + Py_DECREF(value); + } else { + if (unlikely(!value)) goto bad; + values[name-argnames] = value; + } #endif - if (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); + name++; } - else { - d = NULL; - nd = 0; + len = PyDict_Size(kwds2); + if (len > 0) { + return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name); + } else if (unlikely(len == -1)) { + goto bad; } -#if PY_MAJOR_VERSION >= 3 - result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, kwdefs, closure); + return 0; +bad: + return -1; +} +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) +{ + PyObject *key = NULL; + PyObject** const * name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) { +#if CYTHON_AVOID_BORROWED_REFS + key = __Pyx_PySequence_ITEM(kwds, pos); #else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, closure); + key = __Pyx_PyTuple_GET_ITEM(kwds, pos); #endif - Py_XDECREF(kwtuple); -done: - Py_LeaveRecursiveCall(); - return result; -} +#if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!key)) goto bad; #endif - -/* PyObjectCall */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = Py_TYPE(func)->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) - return NULL; - #endif - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + PyObject *value = kwvalues[pos]; + values[name-argnames] = __Pyx_NewRef(value); + } else { + size_t index_found = 0; + int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); + if (cmp == 1) { + PyObject *value = kwvalues[pos]; + values[index_found] = __Pyx_NewRef(value); + } else { + if (unlikely(cmp == -1)) goto bad; + if (kwds2) { + PyObject *value = kwvalues[pos]; + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else if (!ignore_unknown_kwargs) { + goto invalid_keyword; + } + } + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + key = NULL; + #endif } - return result; + return 0; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + goto bad; +bad: + #if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(key); + #endif + return -1; +} +static 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) +{ + if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) + return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); + else if (kwds2) + return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name); + else + return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); } -#endif -/* PyObjectCallMethO */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { - PyObject *self, *result; - PyCFunction cfunc; - cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); - self = __Pyx_CyOrPyCFunction_GET_SELF(func); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) - return NULL; - #endif - result = cfunc(self, arg); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); +/* RaiseArgTupleInvalid */ +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; } - return result; + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); } -#endif -/* PyObjectFastCall */ -#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API -static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { - PyObject *argstuple; - PyObject *result = 0; - size_t i; - argstuple = PyTuple_New((Py_ssize_t)nargs); - if (unlikely(!argstuple)) return NULL; - for (i = 0; i < nargs; i++) { - Py_INCREF(args[i]); - if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + __Pyx_TypeName type_name; + __Pyx_TypeName obj_type_name; + PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode; + int from_annotation_subclass = 0; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; } - result = __Pyx_PyObject_Call(func, argstuple, kwargs); - bad: - Py_DECREF(argstuple); - return result; -} + else if (!exact) { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } else if (exact == 2) { + if (__Pyx_TypeCheck(obj, type)) { + from_annotation_subclass = 1; + extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately; + } + } + type_name = __Pyx_PyType_GetFullyQualifiedName(type); + obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME + ", got " __Pyx_FMT_TYPENAME ")" +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + "%s%U" #endif -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { - Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); -#if CYTHON_COMPILING_IN_CPYTHON - if (nargs == 0 && kwargs == NULL) { - if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) - return __Pyx_PyObject_CallMethO(func, NULL); + , name, type_name, obj_type_name +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + , (from_annotation_subclass ? ". " : ""), extra_info +#endif + ); +#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + if (exact == 2 && from_annotation_subclass) { + PyObject *res; + PyObject *vargs[2]; + vargs[0] = PyErr_GetRaisedException(); + vargs[1] = extra_info; + res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL); + Py_XDECREF(res); + PyErr_SetRaisedException(vargs[0]); } - else if (nargs == 1 && kwargs == NULL) { - if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) - return __Pyx_PyObject_CallMethO(func, args[0]); +#endif + __Pyx_DECREF_TypeName(type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (unlikely(!j)) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +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 + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + 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_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); #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); - } +} +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 + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); } - #if PY_VERSION_HEX >= 0x030700A1 - if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { - return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); + 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; } - #endif - #endif - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(func)) { - return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); +#else + 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 + 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); + } } - #endif - #endif - if (kwargs == NULL) { - #if CYTHON_VECTORCALL - #if PY_VERSION_HEX < 0x03090000 - vectorcallfunc f = _PyVectorcall_Function(func); - #else - vectorcallfunc f = PyVectorcall_Function(func); - #endif - if (f) { - return f(func, args, (size_t)nargs, NULL); + else 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; } - #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, (size_t)nargs, NULL); + } else { + PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; + PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; + if (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 (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { + Py_ssize_t l = sm->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return sm->sq_item(o, i); } - #endif } - if (nargs == 0) { - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); +#else + if (is_list || !PyMapping_Check(o)) { + return PySequence_GetItem(o, i); } - #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API - return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); - #else - return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); - #endif +#endif + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); } -/* UnpackUnboundCMethod */ -static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { - PyObject *result; - PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); - if (unlikely(!selfless_args)) return NULL; - result = PyObject_Call(method, selfless_args, kwargs); - Py_DECREF(selfless_args); - return result; +/* DictGetItem */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error + if (unlikely(PyTuple_Check(key))) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) { + PyErr_SetObject(PyExc_KeyError, args); + Py_DECREF(args); + } + } else { + PyErr_SetObject(PyExc_KeyError, key); + } + } + return value; } -static PyMethodDef __Pyx_UnboundCMethod_Def = { - "CythonUnboundCMethod", - __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), - METH_VARARGS | METH_KEYWORDS, - NULL -}; -static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { - PyObject *method; - method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); - if (unlikely(!method)) - return -1; - target->method = method; -#if CYTHON_COMPILING_IN_CPYTHON - #if PY_MAJOR_VERSION >= 3 - if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) - #else - if (likely(!__Pyx_CyOrPyCFunction_Check(method))) - #endif - { - PyMethodDescrObject *descr = (PyMethodDescrObject*) method; - target->func = descr->d_method->ml_meth; - target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); - } else #endif -#if CYTHON_COMPILING_IN_PYPY -#else - if (PyCFunction_Check(method)) + +/* 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 *self; - int self_found; -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - self = PyObject_GetAttrString(method, "__self__"); - if (!self) { - PyErr_Clear(); + 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 - self = PyCFunction_GET_SELF(method); -#endif - self_found = (self && self != Py_None); -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - Py_XDECREF(self); + result = PyObject_GetItem(obj, py_slice); #endif - if (self_found) { - PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); - if (unlikely(!unbound_method)) return -1; - Py_DECREF(method); - target->method = unbound_method; + if (!_py_slice) { + Py_DECREF(py_slice); } + return result; } - return 0; + 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; +} + +/* PyObjectFastCallMethod */ +#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000 +static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) { + PyObject *result; + PyObject *attr = PyObject_GetAttr(args[0], name); + if (unlikely(!attr)) + return NULL; + result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1); + Py_DECREF(attr); + return result; +} +#endif + +/* PyObjectCall2Args */ +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); } /* CallUnboundCMethod1 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { - if (likely(cfunc->func)) { + int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); + if (likely(was_initialized == 2 && cfunc->func)) { int flag = cfunc->flag; if (flag == METH_O) { - return (*(cfunc->func))(self, arg); - } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) { - #if PY_VERSION_HEX >= 0x030700A0 - return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); - #else - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); - #endif - } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) { - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + return __Pyx_CallCFunction(cfunc, self, arg); + } else if (flag == METH_FASTCALL) { + return __Pyx_CallCFunctionFast(cfunc, self, &arg, 1); + } else if (flag == (METH_FASTCALL | METH_KEYWORDS)) { + return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, &arg, 1, NULL); } } - return __Pyx__CallUnboundCMethod1(cfunc, self, arg); +#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__CallUnboundCMethod1(&tmp_cfunc, self, arg); + } +#endif + PyObject* result = __Pyx__CallUnboundCMethod1(cfunc, self, arg); + __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); + return result; } #endif static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ - PyObject *args, *result = NULL; + PyObject *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { - args = PyTuple_New(1); - if (unlikely(!args)) goto bad; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); if (cfunc->flag & METH_KEYWORDS) - result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); else - result = (*cfunc->func)(self, args); - } else { - args = PyTuple_New(2); - if (unlikely(!args)) goto bad; - Py_INCREF(self); - PyTuple_SET_ITEM(args, 0, self); - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 1, arg); - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); - } -#else - args = PyTuple_Pack(2, self, arg); - if (unlikely(!args)) goto bad; - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + result = __Pyx_CallCFunction(cfunc, self, args); + Py_DECREF(args); + } else #endif -bad: - Py_XDECREF(args); + { + result = __Pyx_PyObject_Call2Args(cfunc->method, self, arg); + } return result; } @@ -24751,161 +27186,146 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_setattr)) - return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); -#endif return PyObject_SetAttr(obj, attr_name, value); } #endif -/* PyIntBinop */ +/* PyLongBinop */ #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { - CYTHON_MAYBE_UNUSED_VAR(intval); +static PyObject* __Pyx_Fallback___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, int inplace) { + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#if CYTHON_USE_PYLONG_INTERNALS +static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long x; - long a = PyInt_AS_LONG(op1); - - x = (long)((unsigned long)a + (unsigned long)b); - if (likely((x^a) >= 0 || (x^b) >= 0)) - return PyInt_FromLong(x); - return PyLong_Type.tp_as_number->nb_add(op1, op2); - } - #endif - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(PyLong_CheckExact(op1))) { - const long b = intval; - long a, x; + const long b = intval; + long a, x; #ifdef HAVE_LONG_LONG - const PY_LONG_LONG llb = intval; - PY_LONG_LONG lla, llx; + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; #endif - if (unlikely(__Pyx_PyLong_IsZero(op1))) { - return __Pyx_NewRef(op2); - } - if (likely(__Pyx_PyLong_IsCompact(op1))) { - a = __Pyx_PyLong_CompactValue(op1); - } 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 - } 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 - } - 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; - 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 - } - 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 - } - CYTHON_FALLTHROUGH; - default: return PyLong_Type.tp_as_number->nb_add(op1, op2); - } + if (unlikely(__Pyx_PyLong_IsZero(op1))) { + return __Pyx_NewRef(op2); + } + if (likely(__Pyx_PyLong_IsCompact(op1))) { + a = __Pyx_PyLong_CompactValue(op1); + } 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 + } 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 + } + 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; + 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 + } + 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 + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } - x = a + b; - return PyLong_FromLong(x); + } + x = a + b; + return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG - long_long: - llx = lla + llb; - return PyLong_FromLongLong(llx); + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); #endif + return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace); + + +} +#endif +static PyObject* __Pyx_Float___Pyx_PyLong_AddObjC(PyObject *float_val, long intval, int zerodivision_check) { + CYTHON_UNUSED_VAR(zerodivision_check); + const long b = intval; + double a = __Pyx_PyFloat_AS_DOUBLE(float_val); + double result; - + result = ((double)a) + (double)b; + return PyFloat_FromDouble(result); +} +static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_UNUSED_VAR(zerodivision_check); + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + return __Pyx_Unpacked___Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check); } #endif if (PyFloat_CheckExact(op1)) { - const long b = intval; -#if CYTHON_COMPILING_IN_LIMITED_API - double a = __pyx_PyFloat_AsDouble(op1); -#else - double a = PyFloat_AS_DOUBLE(op1); -#endif - double result; - - PyFPE_START_PROTECT("add", return NULL) - result = ((double)a) + (double)b; - PyFPE_END_PROTECT(result) - return PyFloat_FromDouble(result); + return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check); } - return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); + return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace); } #endif -/* PyIntCompare */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { +/* PyLongCompare */ +static CYTHON_INLINE PyObject* __Pyx_PyLong_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { - Py_RETURN_FALSE; - } - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long a = PyInt_AS_LONG(op1); - if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE; + Py_RETURN_FALSE; } - #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; @@ -24953,11 +27373,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, #endif if (PyFloat_CheckExact(op1)) { const long b = intval; -#if CYTHON_COMPILING_IN_LIMITED_API - double a = __pyx_PyFloat_AsDouble(op1); -#else - double a = PyFloat_AS_DOUBLE(op1); -#endif + double a = __Pyx_PyFloat_AS_DOUBLE(op1); if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE; } return ( @@ -24965,58 +27381,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, } /* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - __Pyx_PyThreadState_declare - CYTHON_UNUSED_VAR(cause); - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { @@ -25101,9 +27465,9 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { - #if PY_VERSION_HEX >= 0x030C00A6 +#if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); - #elif CYTHON_FAST_THREAD_STATE +#elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -25123,68 +27487,11 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_XDECREF(owned_instance); return; } -#endif - -/* CallUnboundCMethod2 */ -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 -static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { - if (likely(cfunc->func)) { - PyObject *args[2] = {arg1, arg2}; - if (cfunc->flag == METH_FASTCALL) { - #if PY_VERSION_HEX >= 0x030700A0 - return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2); - #else - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); - #endif - } - #if PY_VERSION_HEX >= 0x030700A0 - if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); - #endif - } - return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); -} -#endif -static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ - PyObject *args, *result = NULL; - if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; -#if CYTHON_COMPILING_IN_CPYTHON - if (cfunc->func && (cfunc->flag & METH_VARARGS)) { - args = PyTuple_New(2); - if (unlikely(!args)) goto bad; - Py_INCREF(arg1); - PyTuple_SET_ITEM(args, 0, arg1); - Py_INCREF(arg2); - PyTuple_SET_ITEM(args, 1, arg2); - if (cfunc->flag & METH_KEYWORDS) - result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); - else - result = (*cfunc->func)(self, args); - } else { - args = PyTuple_New(3); - if (unlikely(!args)) goto bad; - Py_INCREF(self); - PyTuple_SET_ITEM(args, 0, self); - Py_INCREF(arg1); - PyTuple_SET_ITEM(args, 1, arg1); - Py_INCREF(arg2); - PyTuple_SET_ITEM(args, 2, arg2); - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); - } -#else - args = PyTuple_Pack(3, self, arg1, arg2); - if (unlikely(!args)) goto bad; - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); -#endif -bad: - Py_XDECREF(args); - return result; -} /* dict_getitem_default */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { PyObject* value; -#if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000 value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (unlikely(PyErr_Occurred())) @@ -25194,7 +27501,7 @@ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObjec Py_INCREF(value); if ((1)); #else - if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { + if (PyBytes_CheckExact(key) || PyUnicode_CheckExact(key) || PyLong_CheckExact(key)) { value = PyDict_GetItem(d, key); if (unlikely(!value)) { value = default_value; @@ -25204,9 +27511,9 @@ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObjec #endif else { if (default_value == Py_None) - value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key); + value = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key); else - value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value); + value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key, default_value); } return value; } @@ -25261,18 +27568,12 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) -#elif PY_MAJOR_VERSION >= 3 +#else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif -#else - #ifdef __Pyx_CyFunction_USED - if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) - #else - if (likely(PyFunction_Check(descr))) - #endif #endif { meth_found = 1; @@ -25310,15 +27611,10 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me *method = descr; return 0; } - type_name = __Pyx_PyType_GetName(tp); + type_name = __Pyx_PyType_GetFullyQualifiedName(tp); PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(name)); -#endif __Pyx_DECREF_TypeName(type_name); return 0; #else @@ -25387,20 +27683,45 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); - } else if (PyTuple_GET_SIZE(t) < index) { - __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { - __Pyx_RaiseTooManyValuesError(index); + Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(t); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(size < 0)) return; + #endif + if (size < index) { + __Pyx_RaiseNeedMoreValuesError(size); + } else { + __Pyx_RaiseTooManyValuesError(index); + } } } /* UnpackTuple2 */ +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))) { + Py_ssize_t size; + if (has_known_size) { + return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple); + } + size = __Pyx_PyTuple_GET_SIZE(tuple); + if (likely(size == 2)) { + return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple); + } + if (size >= 0) { + __Pyx_UnpackTupleError(tuple, 2); + } + return -1; + } else { + return __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple); + } +} static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { PyObject *value1 = NULL, *value2 = NULL; -#if CYTHON_COMPILING_IN_PYPY - value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; - value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; +#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS + value1 = __Pyx_PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; + value2 = __Pyx_PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); @@ -25411,7 +27732,7 @@ static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( *pvalue1 = value1; *pvalue2 = value2; return 0; -#if CYTHON_COMPILING_IN_PYPY +#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS bad: Py_XDECREF(value1); Py_XDECREF(value2); @@ -25447,7 +27768,7 @@ static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyOb } /* dict_iter */ -#if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 +#if CYTHON_COMPILING_IN_PYPY #include #endif static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, @@ -25459,7 +27780,7 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; -#elif PY_MAJOR_VERSION >= 3 +#else static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; PyObject **pp = NULL; if (method_name) { @@ -25494,53 +27815,102 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di } return PyObject_GetIter(iterable); } -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 (source_is_dict) { - PyObject *key, *value; - if (unlikely(orig_length != PyDict_Size(iter_obj))) { - PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); +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) { + PyObject *key, *value; + if (unlikely(orig_length != PyDict_Size(iter_obj))) { + PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); + return -1; + } + if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { + return 0; + } + if (pitem) { + PyObject* tuple = PyTuple_New(2); + if (unlikely(!tuple)) { return -1; } - if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { - return 0; + Py_INCREF(key); + Py_INCREF(value); + #if CYTHON_ASSUME_SAFE_MACROS + PyTuple_SET_ITEM(tuple, 0, key); + PyTuple_SET_ITEM(tuple, 1, value); + #else + if (unlikely(PyTuple_SetItem(tuple, 0, key) < 0)) { + Py_DECREF(value); + Py_DECREF(tuple); + return -1; } - if (pitem) { - PyObject* tuple = PyTuple_New(2); - if (unlikely(!tuple)) { - return -1; - } + if (unlikely(PyTuple_SetItem(tuple, 1, value) < 0)) { + Py_DECREF(tuple); + return -1; + } + #endif + *pitem = tuple; + } else { + if (pkey) { Py_INCREF(key); + *pkey = key; + } + if (pvalue) { Py_INCREF(value); - PyTuple_SET_ITEM(tuple, 0, key); - PyTuple_SET_ITEM(tuple, 1, value); - *pitem = tuple; - } else { - if (pkey) { - Py_INCREF(key); - *pkey = key; - } - if (pvalue) { - Py_INCREF(value); - *pvalue = value; - } + *pvalue = value; } - return 1; + } + return 1; +} +#endif +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 (source_is_dict) { + int result; +#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_BEGIN_CRITICAL_SECTION(iter_obj); +#endif + result = __Pyx_dict_iter_next_source_is_dict(iter_obj, orig_length, ppos, pkey, pvalue, pitem); +#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_END_CRITICAL_SECTION(); +#endif + return result; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; - if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; + Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(iter_obj); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(tuple_size < 0)) return -1; + #endif + if (unlikely(pos >= tuple_size)) return 0; *ppos = pos + 1; + #if CYTHON_ASSUME_SAFE_MACROS next_item = PyTuple_GET_ITEM(iter_obj, pos); + #else + next_item = PyTuple_GetItem(iter_obj, pos); + if (unlikely(!next_item)) return -1; + #endif Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; - if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; + Py_ssize_t list_size = __Pyx_PyList_GET_SIZE(iter_obj); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(list_size < 0)) return -1; + #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); + if (unlikely(!next_item)) return -1; + Py_INCREF(next_item); + #endif } else #endif { @@ -25563,7 +27933,7 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( } /* RaiseUnboundLocalError */ -static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { +static void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } @@ -25577,14 +27947,9 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030C00A6 + #if PY_VERSION_HEX >= 0x030C0000 local_value = tstate->current_exception; tstate->current_exception = 0; - if (likely(local_value)) { - local_type = (PyObject*) Py_TYPE(local_value); - Py_INCREF(local_type); - local_tb = PyException_GetTraceback(local_value); - } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; @@ -25593,24 +27958,30 @@ 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 + local_value = PyErr_GetRaisedException(); #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif +#if __PYX_LIMITED_VERSION_HEX > 0x030C0000 + if (likely(local_value)) { + local_type = (PyObject*) Py_TYPE(local_value); + Py_INCREF(local_type); + local_tb = PyException_GetTraceback(local_value); + } +#else PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 - if (unlikely(tstate->current_exception)) -#elif CYTHON_FAST_THREAD_STATE +#if CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; - #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } - #endif +#endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000 Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); @@ -25648,10 +28019,16 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); +#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000 + PyErr_SetHandledException(local_value); + Py_XDECREF(local_value); + Py_XDECREF(local_type); + Py_XDECREF(local_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; +#if __PYX_LIMITED_VERSION_HEX <= 0x030C0000 bad: *type = 0; *value = 0; @@ -25660,36 +28037,37 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; +#endif } /* pep479 */ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { - PyObject *exc, *val, *tb, *cur_exc; + PyObject *exc, *val, *tb, *cur_exc, *new_exc; __Pyx_PyThreadState_declare - #ifdef __Pyx_StopAsyncIteration_USED int is_async_stopiteration = 0; - #endif CYTHON_MAYBE_UNUSED_VAR(in_async_gen); - cur_exc = PyErr_Occurred(); + __Pyx_PyThreadState_assign + cur_exc = __Pyx_PyErr_CurrentExceptionType(); if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) { - #ifdef __Pyx_StopAsyncIteration_USED - if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) { + if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopAsyncIteration))) { is_async_stopiteration = 1; - } else - #endif + } else { return; + } } - __Pyx_PyThreadState_assign __Pyx_GetException(&exc, &val, &tb); Py_XDECREF(exc); - Py_XDECREF(val); Py_XDECREF(tb); - PyErr_SetString(PyExc_RuntimeError, - #ifdef __Pyx_StopAsyncIteration_USED + new_exc = PyObject_CallFunction(PyExc_RuntimeError, "s", is_async_stopiteration ? "async generator raised StopAsyncIteration" : in_async_gen ? "async generator raised StopIteration" : - #endif "generator raised StopIteration"); + if (!new_exc) { + Py_XDECREF(val); + return; + } + PyException_SetCause(new_exc, val); // steals ref to val + PyErr_SetObject(PyExc_RuntimeError, new_exc); } /* PyDictVersioning */ @@ -25726,33 +28104,26 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 - result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } else if (unlikely(PyErr_Occurred())) { - return NULL; - } -#elif CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { + if (!PyErr_Occurred()) + PyErr_SetNone(PyExc_NameError); return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } -#else - result = PyDict_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + PyErr_Clear(); +#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear(); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { - return __Pyx_NewRef(result); + return result; } -#endif #else - result = PyObject_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } @@ -25761,20 +28132,13 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) return __Pyx_GetBuiltinName(name); } -/* PyIntCompare */ -static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { +/* PyLongCompare */ +static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { return 1; } - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long a = PyInt_AS_LONG(op1); - return (a == b); - } - #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; @@ -25822,19 +28186,88 @@ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, lo #endif if (PyFloat_CheckExact(op1)) { const long b = intval; -#if CYTHON_COMPILING_IN_LIMITED_API - double a = __pyx_PyFloat_AsDouble(op1); -#else - double a = PyFloat_AS_DOUBLE(op1); -#endif + double a = __Pyx_PyFloat_AS_DOUBLE(op1); return ((double)a == (double)b); } return __Pyx_PyObject_IsTrueAndDecref( PyObject_RichCompare(op1, op2, Py_EQ)); } +/* RaiseClosureNameError */ +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 + +/* CallTypeTraverse */ +#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) { + #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 + if (__Pyx_get_runtime_version() < 0x03090000) return 0; + #endif + if (!always_call) { + PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*); + unsigned long flags = PyType_GetFlags(base); + if (flags & Py_TPFLAGS_HEAPTYPE) { + return 0; + } + } + Py_VISIT((PyObject*)Py_TYPE(o)); + return 0; +} +#endif + /* FixUpExtensionType */ -#if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); @@ -25904,20 +28337,20 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject #endif return 0; } -#endif /* ValidateBasesTuple */ #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; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); - if (n < 0) return -1; + if (unlikely(n < 0)) return -1; #endif for (i = 1; i < n; i++) { + PyTypeObject *b; #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; @@ -25926,23 +28359,11 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; -#endif - PyTypeObject *b; -#if PY_MAJOR_VERSION < 3 - if (PyClass_Check(b0)) - { - PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", - PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); -#if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); -#endif - return -1; - } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { - __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); @@ -25954,7 +28375,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; -#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY +#if CYTHON_USE_TYPE_SLOTS b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); @@ -25965,7 +28386,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #endif if (b_dictoffset) { { - __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " @@ -25974,7 +28395,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs type_name, b_name); __Pyx_DECREF_TypeName(b_name); } -#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) +#if !CYTHON_USE_TYPE_SLOTS dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS @@ -25992,8 +28413,18 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #endif /* PyType_Ready */ +CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) { + while (t) { + PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); + if (bases) { + return 1; + } + t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*); + } + return 0; +} static int __Pyx_PyType_Ready(PyTypeObject *t) { -#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) +#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; @@ -26001,10 +28432,13 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { return PyType_Ready(t); #else int r; + if (!__Pyx_PyType_HasMultipleInheritance(t)) { + return PyType_Ready(t); + } PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; -#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) +#if !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 @@ -26013,12 +28447,13 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { #else PyObject *ret, *py_status; PyObject *gc = NULL; - #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) - gc = PyImport_GetModule(__pyx_kp_u_gc); + #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\ + !CYTHON_COMPILING_IN_GRAAL + gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc); #endif - if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); + if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc); if (unlikely(!gc)) return -1; - py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); + py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; @@ -26026,7 +28461,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; @@ -26045,7 +28480,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); -#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) +#if !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) @@ -26054,7 +28489,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); @@ -26073,103 +28508,53 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { #endif } -/* PyObject_GenericGetAttrNoDict */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { - __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); - PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", - type_name, attr_name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(attr_name)); -#endif - __Pyx_DECREF_TypeName(type_name); - return NULL; -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { - PyObject *descr; - PyTypeObject *tp = Py_TYPE(obj); - if (unlikely(!PyString_Check(attr_name))) { - return PyObject_GenericGetAttr(obj, attr_name); - } - assert(!tp->tp_dictoffset); - descr = _PyType_Lookup(tp, attr_name); - if (unlikely(!descr)) { - return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); - } - Py_INCREF(descr); - #if PY_MAJOR_VERSION < 3 - if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) - #endif - { - descrgetfunc f = Py_TYPE(descr)->tp_descr_get; - if (unlikely(f)) { - PyObject *res = f(descr, obj, (PyObject *)tp); - Py_DECREF(descr); - return res; +/* 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= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, 1); - if (unlikely(!module)) { - if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_MAJOR_VERSION < 3 - PyObject *py_level = PyInt_FromLong(level); - if (unlikely(!py_level)) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); - Py_DECREF(py_level); - #else + if (level == -1) { + const char* package_sep = strchr(__Pyx_MODULE_NAME, '.'); + if (package_sep != (0)) { module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, level); - #endif + name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, 1); + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } } + level = 0; + } + if (!module) { + module = PyImport_ImportModuleLevelObject( + name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, level); } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_import); - #endif return module; } @@ -26186,11 +28571,12 @@ 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_kp_u__4); + module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u_); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } - #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ + CYTHON_COMPILING_IN_GRAAL { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) @@ -26206,31 +28592,54 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { Py_XDECREF(module_name); } if (unlikely(!value)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif + PyErr_Format(PyExc_ImportError, "cannot import name %S", name); } return value; } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); + 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); +#else + value = PyDict_SetDefault(d, key, default_value); + if (unlikely(!value)) return NULL; + Py_INCREF(value); +#endif + return value; } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, - Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { + Py_ssize_t basicsize; if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_basicsize; + py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); + if (unlikely(!py_basicsize)) return -1; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = NULL; + if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1; +#else + basicsize = ((PyTypeObject*) cached_type)->tp_basicsize; +#endif if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", @@ -26239,80 +28648,51 @@ static int __Pyx_VerifyCachedType(PyObject *cached_type, } return 0; } -#if !CYTHON_USE_TYPE_SPECS -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { - PyObject* abi_module; - const char* object_name; - PyTypeObject *cached_type = NULL; - abi_module = __Pyx_FetchSharedCythonABIModule(); - if (!abi_module) return NULL; - object_name = strrchr(type->tp_name, '.'); - object_name = object_name ? object_name+1 : type->tp_name; - cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); - if (cached_type) { - if (__Pyx_VerifyCachedType( - (PyObject *)cached_type, - object_name, - cached_type->tp_basicsize, - type->tp_basicsize) < 0) { - goto bad; - } - goto done; - } - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); - if (PyType_Ready(type) < 0) goto bad; - if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) - goto bad; - Py_INCREF(type); - cached_type = type; -done: - Py_DECREF(abi_module); - return cached_type; -bad: - Py_XDECREF(cached_type); - cached_type = NULL; - goto done; -} -#else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { - PyObject *abi_module, *cached_type = NULL; + PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name; + int get_item_ref_result; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; + py_object_name = PyUnicode_FromString(object_name); + if (!py_object_name) return NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); - if (!abi_module) return NULL; - cached_type = PyObject_GetAttrString(abi_module, object_name); - if (cached_type) { - Py_ssize_t basicsize; -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *py_basicsize; - py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); - if (unlikely(!py_basicsize)) goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; -#else - basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; -#endif + if (!abi_module) goto done; + abi_module_dict = PyModule_GetDict(abi_module); + if (!abi_module_dict) goto done; + get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type); + if (get_item_ref_result == 1) { if (__Pyx_VerifyCachedType( cached_type, object_name, - basicsize, spec->basicsize) < 0) { goto bad; } goto done; + } else if (unlikely(get_item_ref_result == -1)) { + goto bad; } - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(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; - if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; + new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type, 1); + if (unlikely(new_cached_type != cached_type)) { + if (unlikely(!new_cached_type)) goto bad; + Py_DECREF(cached_type); + cached_type = new_cached_type; + if (__Pyx_VerifyCachedType( + cached_type, + object_name, + spec->basicsize) < 0) { + goto bad; + } + goto done; + } else { + Py_DECREF(new_cached_type); + } done: - Py_DECREF(abi_module); + Py_XDECREF(abi_module); + Py_DECREF(py_object_name); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: @@ -26320,10 +28700,35 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec cached_type = NULL; goto done; } + +/* PyMethodNew */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + PyObject *result; + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + { + PyObject *args[] = {func, self}; + result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL); + } + #else + result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL); + #endif + return result; +} +#else +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} #endif /* PyVectorcallFastCallDict */ -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; @@ -26334,7 +28739,12 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector size_t j; PyObject *key, *value; unsigned long keys_are_strings; + #if !CYTHON_ASSUME_SAFE_SIZE + Py_ssize_t nkw = PyDict_Size(kw); + if (unlikely(nkw == -1)) return NULL; + #else Py_ssize_t nkw = PyDict_GET_SIZE(kw); + #endif newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); @@ -26350,10 +28760,19 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { - keys_are_strings &= Py_TYPE(key)->tp_flags; + 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 PyTuple_SET_ITEM(kwnames, i, key); + #endif kwvalues[i] = value; i++; } @@ -26371,16 +28790,29 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { - if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { + Py_ssize_t kw_size = + likely(kw == NULL) ? + 0 : +#if !CYTHON_ASSUME_SAFE_SIZE + PyDict_Size(kw); +#else + PyDict_GET_SIZE(kw); +#endif + if (kw_size == 0) { return vc(func, args, nargs, NULL); } +#if !CYTHON_ASSUME_SAFE_SIZE + else if (unlikely(kw_size == -1)) { + return NULL; + } +#endif return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { @@ -26388,8 +28820,25 @@ static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) } return 0; } +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) { + if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) { + int result; + PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func_3); + if (unlikely(!newFunc)) { + PyErr_Clear(); // It's only an optimization, so don't throw an error + return 0; + } + result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc); + Py_DECREF(newFunc); + return result; + } + return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc); +} #else -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) { + if (PyMethod_Check(func)) { + func = PyMethod_GET_FUNCTION(func); + } return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif @@ -26405,20 +28854,15 @@ static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* #endif } static PyObject * -__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) +__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op) { - CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { -#if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#else - op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#endif if (unlikely(op->func_doc == NULL)) return NULL; } else { @@ -26430,6 +28874,15 @@ __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) Py_INCREF(op->func_doc); return op->func_doc; } +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { + PyObject *result; + CYTHON_UNUSED_VAR(closure); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_doc_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { @@ -26438,20 +28891,19 @@ __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *cont value = Py_None; } Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_doc, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op) { - CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); -#elif PY_MAJOR_VERSION >= 3 - op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else - op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; @@ -26459,53 +28911,60 @@ __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) Py_INCREF(op->func_name); return op->func_name; } +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +{ + PyObject *result = NULL; + CYTHON_UNUSED_VAR(context); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_name_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_name, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); + PyObject *result; + __Pyx_BEGIN_CRITICAL_SECTION(op); Py_INCREF(op->func_qualname); - return op->func_qualname; + result = op->func_qualname; + __Pyx_END_CRITICAL_SECTION(); + return result; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_qualname, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) +__Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op) { - CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) @@ -26514,6 +28973,16 @@ __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) 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) { @@ -26529,7 +28998,9 @@ __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *con return -1; } Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_dict, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * @@ -26590,13 +29061,14 @@ __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { +__Pyx_CyFunction_get_defaults_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_tuple; - CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; @@ -26608,6 +29080,15 @@ __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { Py_INCREF(result); return result; } +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = NULL; + CYTHON_UNUSED_VAR(context); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_defaults_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); @@ -26621,13 +29102,14 @@ __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, voi PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { +__Pyx_CyFunction_get_kwdefaults_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_kwdict; - CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; @@ -26639,6 +29121,15 @@ __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { Py_INCREF(result); return result; } +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result; + CYTHON_UNUSED_VAR(context); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_kwdefaults_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); @@ -26650,13 +29141,14 @@ __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, vo return -1; } Py_XINCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_annotations, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { +__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; - CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; @@ -26666,16 +29158,19 @@ __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { return result; } static PyObject * -__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { - int is_coroutine; +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { + PyObject *result; CYTHON_UNUSED_VAR(context); - if (op->func_is_coroutine) { - return __Pyx_NewRef(op->func_is_coroutine); - } - is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; -#if PY_VERSION_HEX >= 0x03050000 + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_annotations_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} +static PyObject * +__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { + int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; if (is_coroutine) { - PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; + PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); @@ -26688,20 +29183,68 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { return NULL; } #endif - module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); + module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; - op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); + is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); - if (likely(op->func_is_coroutine)) { - return __Pyx_NewRef(op->func_is_coroutine); + if (likely(is_coroutine_value)) { + return is_coroutine_value; } ignore: PyErr_Clear(); } + return __Pyx_PyBool_FromLong(is_coroutine); +} +static PyObject * +__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { + PyObject *result; + CYTHON_UNUSED_VAR(context); + if (op->func_is_coroutine) { + return __Pyx_NewRef(op->func_is_coroutine); + } + result = __Pyx_CyFunction_get_is_coroutine_value(op); + if (unlikely(!result)) + return NULL; + __Pyx_BEGIN_CRITICAL_SECTION(op); + if (op->func_is_coroutine) { + Py_DECREF(result); + result = __Pyx_NewRef(op->func_is_coroutine); + } else { + op->func_is_coroutine = __Pyx_NewRef(result); + } + __Pyx_END_CRITICAL_SECTION(); + return result; +} +static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, message, size); + Py_DECREF(py_name); +#else + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + name, message, size); +#endif +} +static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s", + py_name, message); + Py_DECREF(py_name); +#else + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s", + name, message); #endif - op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); - return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * @@ -26716,24 +29259,24 @@ __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *c } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { - {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, - {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, - {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, + {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"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}, + {"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}, + {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {"__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}, + {"_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}, #endif @@ -26741,23 +29284,19 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, + {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif -#if CYTHON_USE_TYPE_SPECS - {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, + {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API + {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else -#if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, -#endif + {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif -#endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API + {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, + {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} @@ -26765,19 +29304,19 @@ static PyMemberDef __pyx_CyFunction_members[] = { static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { + PyObject *result = NULL; CYTHON_UNUSED_VAR(args); -#if PY_MAJOR_VERSION >= 3 + __Pyx_BEGIN_CRITICAL_SECTION(m); Py_INCREF(m->func_qualname); - return m->func_qualname; -#else - return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); -#endif + result = m->func_qualname; + __Pyx_END_CRITICAL_SECTION(); + return result; } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) @@ -26819,8 +29358,6 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef * Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; - op->defaults_pyobjects = 0; - op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; @@ -26882,14 +29419,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_XDECREF(pydefaults[i]); - PyObject_Free(m->defaults); - m->defaults = NULL; - } + Py_CLEAR(m->defaults); return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) @@ -26906,6 +29436,10 @@ static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { + { + int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg); + if (e) return e; + } Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); @@ -26913,40 +29447,33 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); - Py_VISIT(m->func_name); - Py_VISIT(m->func_qualname); + __Pyx_VISIT_CONST(m->func_name); + __Pyx_VISIT_CONST(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); - Py_VISIT(m->func_code); + __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_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_VISIT(pydefaults[i]); - } + Py_VISIT(m->defaults); return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { -#if PY_MAJOR_VERSION >= 3 - return PyUnicode_FromFormat("", + PyObject *repr; + __Pyx_BEGIN_CRITICAL_SECTION(op); + repr = PyUnicode_FromFormat("", op->func_qualname, (void *)op); -#else - return PyString_FromFormat("", - PyString_AsString(op->func_qualname), (void *)op); -#endif + __Pyx_END_CRITICAL_SECTION(); + return repr; } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; - PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); @@ -26965,10 +29492,10 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: - return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); @@ -26976,24 +29503,15 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif if (likely(size == 0)) return (*meth)(self, NULL); -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes no arguments", size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); @@ -27012,18 +29530,9 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif return result; } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes exactly one argument", size); return NULL; } break; @@ -27031,16 +29540,8 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", - py_name); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", - f->m_ml->ml_name); -#endif + __Pyx_CyFunction_raise_type_error( + (__pyx_CyFunctionObject*)func, "takes no keyword arguments"); return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { @@ -27057,10 +29558,10 @@ 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 +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; @@ -27072,11 +29573,11 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P Py_ssize_t argc; PyObject *new_args; PyObject *self; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); - if (unlikely(!argc) < 0) return NULL; + if (unlikely(argc < 0)) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) @@ -27084,14 +29585,9 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); -#if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); -#else - PyErr_SetString(PyExc_TypeError, - "unbound method needs an argument"); -#endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); @@ -27101,21 +29597,21 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P } return result; } -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { - PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", - ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + __Pyx_CyFunction_raise_type_error( + cyfunc, "needs an argument"); return -1; } ret = 1; } - if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) { + __Pyx_CyFunction_raise_type_error( + cyfunc, "takes no keyword arguments"); return -1; } return ret; @@ -27123,13 +29619,18 @@ 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; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #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); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; @@ -27137,29 +29638,38 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } if (unlikely(nargs != 0)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes no arguments", nargs); return NULL; } - return def->ml_meth(self, NULL); + return meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #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); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; @@ -27167,29 +29677,38 @@ static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } if (unlikely(nargs != 1)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes exactly one argument", nargs); return NULL; } - return def->ml_meth(self, args[0]); + return meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #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); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; @@ -27197,24 +29716,34 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } - return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); + return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; 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; + PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; @@ -27222,15 +29751,19 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } - return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); + return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, (size_t)nargs, kwnames); } #endif -#if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, @@ -27250,121 +29783,32 @@ static PyType_Spec __pyx_CyFunctionType_spec = { #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif -#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) +#if CYTHON_METH_FASTCALL +#if defined(Py_TPFLAGS_HAVE_VECTORCALL) + Py_TPFLAGS_HAVE_VECTORCALL | +#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, - __pyx_CyFunctionType_slots -}; -#else -static PyTypeObject __pyx_CyFunctionType_type = { - PyVarObject_HEAD_INIT(0, 0) - __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", - sizeof(__pyx_CyFunctionObject), - 0, - (destructor) __Pyx_CyFunction_dealloc, -#if !CYTHON_METH_FASTCALL - 0, -#elif CYTHON_BACKPORT_VECTORCALL - (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), -#else - offsetof(PyCFunctionObject, vectorcall), -#endif - 0, - 0, -#if PY_MAJOR_VERSION < 3 - 0, -#else - 0, -#endif - (reprfunc) __Pyx_CyFunction_repr, - 0, - 0, - 0, - 0, - __Pyx_CyFunction_CallAsMethod, - 0, - 0, - 0, - 0, -#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR - Py_TPFLAGS_METHOD_DESCRIPTOR | -#endif -#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL - _Py_TPFLAGS_HAVE_VECTORCALL | +#endif // CYTHON_METH_FASTCALL +#if PY_VERSION_HEX >= 0x030A0000 + Py_TPFLAGS_IMMUTABLETYPE | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, - 0, - (traverseproc) __Pyx_CyFunction_traverse, - (inquiry) __Pyx_CyFunction_clear, - 0, -#if PY_VERSION_HEX < 0x030500A0 - offsetof(__pyx_CyFunctionObject, func_weakreflist), -#else - offsetof(PyCFunctionObject, m_weakreflist), -#endif - 0, - 0, - __pyx_CyFunction_methods, - __pyx_CyFunction_members, - __pyx_CyFunction_getsets, - 0, - 0, - __Pyx_PyMethod_New, - 0, - offsetof(__pyx_CyFunctionObject, func_dict), - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, -#if PY_VERSION_HEX >= 0x030400a1 - 0, -#endif -#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, -#endif -#if __PYX_NEED_TP_PRINT_SLOT - 0, -#endif -#if PY_VERSION_HEX >= 0x030C0000 - 0, -#endif -#if PY_VERSION_HEX >= 0x030d00A4 - 0, -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, -#endif + __pyx_CyFunctionType_slots }; -#endif static int __pyx_CyFunction_init(PyObject *module) { -#if CYTHON_USE_TYPE_SPECS - __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); -#else - CYTHON_UNUSED_VAR(module); - __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); -#endif - if (unlikely(__pyx_CyFunctionType == NULL)) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); + mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); + if (unlikely(mstate->__pyx_CyFunctionType == NULL)) { return -1; } return 0; } -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults = PyObject_Malloc(size); + m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type); if (unlikely(!m->defaults)) - return PyErr_NoMemory(); - memset(m->defaults, 0, size); - m->defaults_pyobjects = pyobjects; - m->defaults_size = size; + return NULL; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { @@ -27387,7 +29831,7 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( - PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_mstate_global->__pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { @@ -27399,7 +29843,7 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qual /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); @@ -27414,10 +29858,6 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); -#if PY_MAJOR_VERSION < 3 - if (tmptype == &PyClass_Type) - continue; -#endif if (!metaclass) { metaclass = tmptype; continue; @@ -27436,31 +29876,17 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas return NULL; } if (!metaclass) { -#if PY_MAJOR_VERSION < 3 - metaclass = &PyClass_Type; -#else metaclass = &PyType_Type; -#endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } -/* PyObjectCall2Args */ -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); -} - /* PyObjectLookupSpecial */ #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; PyTypeObject *tp = Py_TYPE(obj); -#if PY_MAJOR_VERSION < 3 - if (unlikely(PyInstance_Check(obj))) - return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); -#endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; @@ -27481,7 +29907,7 @@ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { - PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); + PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_mstate_global->__pyx_n_u_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); @@ -27496,148 +29922,14 @@ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, } if (unlikely(!ns)) return NULL; - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; -#if PY_VERSION_HEX >= 0x03030000 - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; -#else - CYTHON_MAYBE_UNUSED_VAR(qualname); -#endif - if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } -#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS -static int __Pyx_SetNamesPEP487(PyObject *type_obj) { - PyTypeObject *type = (PyTypeObject*) type_obj; - PyObject *names_to_set, *key, *value, *set_name, *tmp; - Py_ssize_t i = 0; -#if CYTHON_USE_TYPE_SLOTS - names_to_set = PyDict_Copy(type->tp_dict); -#else - { - PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict_2); - names_to_set = NULL; - if (likely(d)) { - PyObject *names_to_set = PyDict_New(); - int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; - Py_DECREF(d); - if (unlikely(ret < 0)) - Py_CLEAR(names_to_set); - } - } -#endif - if (unlikely(names_to_set == NULL)) - goto bad; - while (PyDict_Next(names_to_set, &i, &key, &value)) { - set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); - if (unlikely(set_name != NULL)) { - tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); - Py_DECREF(set_name); - if (unlikely(tmp == NULL)) { - __Pyx_TypeName value_type_name = - __Pyx_PyType_GetName(Py_TYPE(value)); - __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); - PyErr_Format(PyExc_RuntimeError, -#if PY_MAJOR_VERSION >= 3 - "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", - value_type_name, key, type_name); -#else - "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", - value_type_name, - PyString_Check(key) ? PyString_AS_STRING(key) : "?", - type_name); -#endif - goto bad; - } else { - Py_DECREF(tmp); - } - } - else if (unlikely(PyErr_Occurred())) { - goto bad; - } - } - Py_DECREF(names_to_set); - return 0; -bad: - Py_XDECREF(names_to_set); - return -1; -} -static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { -#if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - PyTypeObject *type = (PyTypeObject*) type_obj; - PyObject *mro = type->tp_mro; - Py_ssize_t i, nbases; - if (unlikely(!mro)) goto done; - (void) &__Pyx_GetBuiltinName; - Py_INCREF(mro); - nbases = PyTuple_GET_SIZE(mro); - assert(PyTuple_GET_ITEM(mro, 0) == type_obj); - for (i = 1; i < nbases-1; i++) { - PyObject *base, *dict, *meth; - base = PyTuple_GET_ITEM(mro, i); - dict = ((PyTypeObject *)base)->tp_dict; - meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); - if (unlikely(meth)) { - descrgetfunc f = Py_TYPE(meth)->tp_descr_get; - PyObject *res; - Py_INCREF(meth); - if (likely(f)) { - res = f(meth, NULL, type_obj); - Py_DECREF(meth); - if (unlikely(!res)) goto bad; - meth = res; - } - res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); - Py_DECREF(meth); - if (unlikely(!res)) goto bad; - Py_DECREF(res); - goto done; - } else if (unlikely(PyErr_Occurred())) { - goto bad; - } - } -done: - Py_XDECREF(mro); - return type_obj; -bad: - Py_XDECREF(mro); - Py_DECREF(type_obj); - return NULL; -#else - PyObject *super_type, *super, *func, *res; -#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) - super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); -#else - super_type = (PyObject*) &PySuper_Type; - (void) &__Pyx_GetBuiltinName; -#endif - super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; -#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) - Py_XDECREF(super_type); -#endif - if (unlikely(!super)) { - Py_CLEAR(type_obj); - goto done; - } - func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); - Py_DECREF(super); - if (likely(!func)) { - if (unlikely(PyErr_Occurred())) - Py_CLEAR(type_obj); - goto done; - } - res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); - Py_DECREF(func); - if (unlikely(!res)) - Py_CLEAR(type_obj); - Py_XDECREF(res); -done: - return type_obj; -#endif -} -#endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { @@ -27645,7 +29937,7 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { - owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { @@ -27661,25 +29953,8 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj return NULL; owned_metaclass = metaclass; } - result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, -#if PY_VERSION_HEX < 0x030600A4 - (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw -#else - mkw -#endif - ); + result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_XDECREF(owned_metaclass); -#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS - if (likely(result) && likely(PyType_Check(result))) { - if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { - Py_CLEAR(result); - } else { - result = __Pyx_InitSubclassPEP487(result, mkw); - } - } -#else - (void) &__Pyx_GetBuiltinName; -#endif return result; } @@ -27688,10 +29963,26 @@ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; - PyObject *base, *meth, *new_base, *result, *new_bases = NULL; + PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL; +#if CYTHON_ASSUME_SAFE_SIZE size_bases = PyTuple_GET_SIZE(bases); +#else + size_bases = PyTuple_Size(bases); + if (size_bases < 0) return NULL; +#endif for (i = 0; i < size_bases; i++) { - base = PyTuple_GET_ITEM(bases, i); +#if CYTHON_AVOID_BORROWED_REFS + Py_CLEAR(base); +#endif +#if CYTHON_ASSUME_SAFE_MACROS + base = PyTuple_GET_ITEM(bases, i); +#else + base = PyTuple_GetItem(bases, i); + if (!base) goto error; +#endif +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(base); +#endif if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { @@ -27700,7 +29991,7 @@ __Pyx_PEP560_update_bases(PyObject *bases) } continue; } - meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); + meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } @@ -27728,12 +30019,25 @@ __Pyx_PEP560_update_bases(PyObject *bases) goto error; } for (j = 0; j < i; j++) { - base = PyTuple_GET_ITEM(bases, j); - PyList_SET_ITEM(new_bases, j, base); - Py_INCREF(base); + PyObject *base_from_list; +#if CYTHON_ASSUME_SAFE_MACROS + base_from_list = PyTuple_GET_ITEM(bases, j); + PyList_SET_ITEM(new_bases, j, base_from_list); + Py_INCREF(base_from_list); +#else + base_from_list = PyTuple_GetItem(bases, j); + if (!base_from_list) goto error; + Py_INCREF(base_from_list); + if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error; +#endif } } +#if CYTHON_ASSUME_SAFE_SIZE j = PyList_GET_SIZE(new_bases); +#else + j = PyList_Size(new_bases); + if (j < 0) goto error; +#endif if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } @@ -27745,14 +30049,20 @@ __Pyx_PEP560_update_bases(PyObject *bases) } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); +#if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(base); +#endif return result; error: Py_XDECREF(new_bases); +#if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(base); +#endif return NULL; } /* CLineInTraceback */ -#ifndef CYTHON_CLINE_IN_TRACEBACK +#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; @@ -27760,22 +30070,26 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); - if (unlikely(!__pyx_cython_runtime)) { + 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_cython_runtime); + cython_runtime_dict = _PyObject_GetDictPtr(__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_n_s_cline_in_traceback)) + __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_cython_runtime, __pyx_n_s_cline_in_traceback); + 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(); @@ -27784,18 +30098,18 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { } if (!use_cline) { c_line = 0; - (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + (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)) { c_line = 0; } + Py_XDECREF(use_cline); __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ -#if !CYTHON_COMPILING_IN_LIMITED_API 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) { @@ -27817,64 +30131,103 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co return mid + 1; } } -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; +static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) { + __Pyx_CachedCodeObjectType* code_object; int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + if (unlikely(!code_line) || unlikely(!code_cache->entries)) { return NULL; } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); + if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) { return NULL; } - code_object = __pyx_code_cache.entries[pos].code_object; + code_object = code_cache->entries[pos].code_object; Py_INCREF(code_object); return code_object; } -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) { +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS + (void)__pyx__find_code_object; + return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss. +#else + struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count); + if (old_count < 0) { + __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); + return NULL; + } +#endif + __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line); +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); +#endif + return result; +#endif +} +static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object) +{ int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + __Pyx_CodeObjectCacheEntry* entries = code_cache->entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; + code_cache->entries = entries; + code_cache->max_count = 64; + code_cache->count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; + pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); + if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) { + __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object; entries[pos].code_object = code_object; + Py_INCREF(code_object); Py_DECREF(tmp); return; } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; + if (code_cache->count == code_cache->max_count) { + int new_max = code_cache->max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; + code_cache->entries = entries; + code_cache->max_count = new_max; } - for (i=__pyx_code_cache.count; i>pos; i--) { + for (i=code_cache->count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; - __pyx_code_cache.count++; + code_cache->count++; Py_INCREF(code_object); } +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) { +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS + (void)__pyx__insert_code_object; + return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail. +#else + struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_nonatomic_int_type expected = 0; + if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) { + return; + } +#endif + __pyx__insert_code_object(code_cache, code_line, code_object); +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN); +#endif #endif +} /* AddTraceback */ #include "compile.h" @@ -27894,35 +30247,12 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { - PyObject *result; - result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); - #if __PYX_LIMITED_VERSION_HEX < 0x030780000 - { - PyObject *compiled = NULL, *result = NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; - compiled = Py_CompileString( - "out = type(code)(\n" - " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" - " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" - " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" - " code.co_lnotab)\n", "", Py_file_input); - if (!compiled) return NULL; - result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); - Py_DECREF(compiled); - if (!result) PyErr_Print(); - Py_DECREF(result); - result = PyDict_GetItemString(scratch_dict, "out"); - if (result) Py_INCREF(result); - return result; - } - #else return NULL; - #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { @@ -27935,20 +30265,26 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); - code_object = Py_CompileString("_getframe()", filename, Py_eval_input); - 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 (unlikely(!py_funcname)) goto bad; - dict = PyDict_New(); - if (unlikely(!dict)) goto bad; - { - PyObject *old_code_object = code_object; - code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); - Py_DECREF(old_code_object); + code_object = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!code_object) { + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + 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 (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, code_object); + } else { + dict = PyDict_New(); } - if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; @@ -27974,58 +30310,17 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; - #if PY_MAJOR_VERSION < 3 - PyObject *py_srcfile = NULL; - py_srcfile = PyString_FromString(filename); - if (!py_srcfile) goto bad; - #endif if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; - #endif } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - if (!py_funcname) goto bad; - #endif - } - #if PY_MAJOR_VERSION < 3 - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - #else py_code = PyCode_NewEmpty(filename, funcname, py_line); - #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_srcfile); - #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -28056,7 +30351,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ + __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; @@ -28068,8 +30363,40 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } #endif +/* PyObjectVectorCallKwBuilder */ +#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); + args[n] = value; + return 0; +} +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_VectorcallBuilder_AddArgStr; + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n); +} +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + PyObject *pyKey = PyUnicode_FromString(key); + if (!pyKey) return -1; + return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n); +} +#else // CYTHON_VECTORCALL +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) { + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return PyDict_SetItem(builder, key, value); +} +#endif + /* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -28081,17 +30408,17 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG +#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); @@ -28112,25 +30439,25 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + PyObject *from_bytes, *result = NULL, *kwds = NULL; + PyObject *py_bytes = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - if (!is_unsigned) { - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + { + PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; + if (!is_unsigned) { + kwds = __Pyx_MakeVectorcallBuilderKwds(1); + if (!kwds) goto limited_bad; + if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; + } + result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } - result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); - Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); @@ -28140,18 +30467,41 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { } /* FormatTypeName */ -#if CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 static __Pyx_TypeName -__Pyx_PyType_GetName(PyTypeObject* tp) +__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp) { - PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_n_s_name); - if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { - PyErr_Clear(); - Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__68); + PyObject *module = NULL, *name = NULL, *result = NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030b0000 + name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_mstate_global->__pyx_n_u_qualname); + #else + name = PyType_GetQualName(tp); + #endif + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad; + module = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_mstate_global->__pyx_n_u_module); + if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad; + if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) { + result = name; + name = NULL; + goto done; } - return name; + result = PyUnicode_FromFormat("%U.%U", module, name); + if (unlikely(result == NULL)) goto bad; + done: + Py_XDECREF(name); + Py_XDECREF(module); + return result; + bad: + PyErr_Clear(); + if (name) { + result = name; + name = NULL; + } else { + result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__2); + } + goto done; } #endif @@ -28178,7 +30528,7 @@ __Pyx_PyType_GetName(PyTypeObject* tp) } /* CIntFromPy */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -28188,24 +30538,11 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(long) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + val = __Pyx_PyLong_As_long(tmp); Py_DECREF(tmp); return val; } @@ -28445,7 +30782,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { } /* CIntFromPy */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -28455,24 +30792,11 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); + val = __Pyx_PyLong_As_int(tmp); Py_DECREF(tmp); return val; } @@ -28750,31 +31074,8 @@ static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, } return 0; } - return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); -} -#if PY_MAJOR_VERSION == 2 -static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { - PyObject *exception, *value, *tb; - int res; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&exception, &value, &tb); - res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - if (!res) { - res = PyObject_IsSubclass(err, exc_type2); - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - } - __Pyx_ErrRestore(exception, value, tb); - return res; + return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } -#else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); @@ -28782,21 +31083,15 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } -#endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; i__Pyx_GetBuiltinNext_LimitedAPI_cache)) + __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next); + return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache; +} +#endif +static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) { +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + PyObject *result; + PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI(); + if (unlikely(!next)) return NULL; + result = PyObject_CallFunctionObjArgs(next, iterator, NULL); + return result; +#else + (void)__Pyx_GetBuiltinName; // only for early limited API + iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator); + assert(iternext); + return iternext(iterator); +#endif +} + /* PyObjectCallMethod1 */ -#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) +#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); @@ -28972,7 +31290,7 @@ 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 >= 0x030C00A2 +#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; @@ -28991,7 +31309,62 @@ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name #endif } +/* ReturnWithStopIteration */ +static void __Pyx__ReturnWithStopIteration(PyObject* value, int async); +static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext) { + if (value == Py_None) { + if (async || !iternext) + PyErr_SetNone(async ? PyExc_StopAsyncIteration : PyExc_StopIteration); + return; + } + __Pyx__ReturnWithStopIteration(value, async); +} +static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) { +#if CYTHON_COMPILING_IN_CPYTHON + __Pyx_PyThreadState_declare +#endif + PyObject *exc; + PyObject *exc_type = async ? PyExc_StopAsyncIteration : PyExc_StopIteration; +#if CYTHON_COMPILING_IN_CPYTHON + if ((PY_VERSION_HEX >= (0x030C00A6)) || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) { + if (PY_VERSION_HEX >= (0x030e00A1)) { + exc = __Pyx_PyObject_CallOneArg(exc_type, value); + } else { + PyObject *args_tuple = PyTuple_New(1); + if (unlikely(!args_tuple)) return; + Py_INCREF(value); + PyTuple_SET_ITEM(args_tuple, 0, value); + exc = PyObject_Call(exc_type, args_tuple, NULL); + Py_DECREF(args_tuple); + } + if (unlikely(!exc)) return; + } else { + Py_INCREF(value); + exc = value; + } + #if CYTHON_FAST_THREAD_STATE + __Pyx_PyThreadState_assign + #if CYTHON_USE_EXC_INFO_STACK + if (!__pyx_tstate->exc_info->exc_value) + #else + if (!__pyx_tstate->exc_type) + #endif + { + Py_INCREF(exc_type); + __Pyx_ErrRestore(exc_type, exc, NULL); + return; + } + #endif +#else + exc = __Pyx_PyObject_CallOneArg(exc_type, value); + if (unlikely(!exc)) return; +#endif + PyErr_SetObject(exc_type, exc); + Py_DECREF(exc); +} + /* CoroutineBase */ +#if !CYTHON_COMPILING_IN_LIMITED_API #include #if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE @@ -28999,7 +31372,14 @@ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name #endif #include "internal/pycore_frame.h" #endif -#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +#endif // CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void +__Pyx_Coroutine_Undelegate(__pyx_CoroutineObject *gen) { +#if CYTHON_USE_AM_SEND + gen->yieldfrom_am_send = NULL; +#endif + Py_CLEAR(gen->yieldfrom); +} static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) { PyObject *et, *ev, *tb; PyObject *value = NULL; @@ -29017,20 +31397,35 @@ static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyO Py_INCREF(Py_None); value = Py_None; } -#if PY_VERSION_HEX >= 0x030300A0 else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) { + #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL + value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value); + if (unlikely(!value)) goto limited_api_failure; + #else value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); + #endif Py_DECREF(ev); } -#endif else if (unlikely(PyTuple_Check(ev))) { - if (PyTuple_GET_SIZE(ev) >= 1) { + Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(ev); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(tuple_size < 0)) { + Py_XDECREF(tb); + Py_DECREF(ev); + Py_DECREF(et); + return -1; + } + #endif + if (tuple_size >= 1) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS value = PyTuple_GET_ITEM(ev, 0); Py_INCREF(value); -#else +#elif CYTHON_ASSUME_SAFE_MACROS value = PySequence_ITEM(ev, 0); +#else + value = PySequence_GetItem(ev, 0); + if (!value) goto limited_api_failure; #endif } else { Py_INCREF(Py_None); @@ -29058,27 +31453,35 @@ static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyO } Py_XDECREF(tb); Py_DECREF(et); -#if PY_VERSION_HEX >= 0x030300A0 +#if CYTHON_COMPILING_IN_LIMITED_API + value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value); +#else value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); +#endif Py_DECREF(ev); -#else - { - PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); - Py_DECREF(ev); - if (likely(args)) { - value = PySequence_GetItem(args, 0); - Py_DECREF(args); - } - if (unlikely(!value)) { - __Pyx_ErrRestore(NULL, NULL, NULL); - Py_INCREF(Py_None); - value = Py_None; - } - } +#if CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!value)) return -1; #endif *pvalue = value; return 0; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL || !CYTHON_ASSUME_SAFE_MACROS + limited_api_failure: + Py_XDECREF(et); + Py_XDECREF(tb); + Py_XDECREF(ev); + return -1; +#endif +} +static CYTHON_INLINE +__Pyx_PySendResult __Pyx_Coroutine_status_from_result(PyObject **retval) { + if (*retval) { + return PYGEN_NEXT; + } else if (likely(__Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, retval) == 0)) { + return PYGEN_RETURN; + } else { + return PYGEN_ERROR; + } } static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { @@ -29115,26 +31518,7 @@ static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) { } PyErr_SetString(PyExc_ValueError, msg); } -#define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) -static void __Pyx__Coroutine_NotStartedError(PyObject *gen) { - const char *msg; - CYTHON_MAYBE_UNUSED_VAR(gen); - if ((0)) { - #ifdef __Pyx_Coroutine_USED - } else if (__Pyx_Coroutine_Check(gen)) { - msg = "can't send non-None value to a just-started coroutine"; - #endif - #ifdef __Pyx_AsyncGen_USED - } else if (__Pyx_AsyncGen_CheckExact(gen)) { - msg = "can't send non-None value to a just-started async generator"; - #endif - } else { - msg = "can't send non-None value to a just-started generator"; - } - PyErr_SetString(PyExc_TypeError, msg); -} -#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) -static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { +static void __Pyx_Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { CYTHON_MAYBE_UNUSED_VAR(gen); CYTHON_MAYBE_UNUSED_VAR(closing); #ifdef __Pyx_Coroutine_USED @@ -29145,26 +31529,22 @@ static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *val if (value) { #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) - PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); + PyErr_SetNone(PyExc_StopAsyncIteration); else #endif PyErr_SetNone(PyExc_StopIteration); } } static -PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { +__Pyx_PySendResult __Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, PyObject **result, int closing) { __Pyx_PyThreadState_declare PyThreadState *tstate; __Pyx_ExcInfoStruct *exc_state; PyObject *retval; - assert(!self->is_running); - if (unlikely(self->resume_label == 0)) { - if (unlikely(value && value != Py_None)) { - return __Pyx_Coroutine_NotStartedError((PyObject*)self); - } - } + assert(__Pyx_Coroutine_get_is_running(self)); // Callers should ensure is_running if (unlikely(self->resume_label == -1)) { - return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + return PYGEN_ERROR; } #if CYTHON_FAST_THREAD_STATE __Pyx_PyThreadState_assign @@ -29174,7 +31554,7 @@ PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, i #endif exc_state = &self->gi_exc_state; if (exc_state->exc_value) { - #if CYTHON_COMPILING_IN_PYPY + #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY #else PyObject *exc_tb; #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON @@ -29211,19 +31591,21 @@ PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, i __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); } #endif - self->is_running = 1; retval = self->body(self, tstate, value); - self->is_running = 0; #if CYTHON_USE_EXC_INFO_STACK exc_state = &self->gi_exc_state; tstate->exc_info = exc_state->previous_item; exc_state->previous_item = NULL; __Pyx_Coroutine_ResetFrameBackpointer(exc_state); #endif - return retval; + *result = retval; + if (self->resume_label == -1) { + return likely(retval) ? PYGEN_RETURN : PYGEN_ERROR; + } + return PYGEN_NEXT; } static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { -#if CYTHON_COMPILING_IN_PYPY +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(exc_state); #else PyObject *exc_tb; @@ -29243,24 +31625,22 @@ static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStr } #endif } -static CYTHON_INLINE -PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) { +#define __Pyx_Coroutine_MethodReturnFromResult(gen, result, retval, iternext)\ + ((result) == PYGEN_NEXT ? (retval) : __Pyx__Coroutine_MethodReturnFromResult(gen, result, retval, iternext)) +static PyObject * +__Pyx__Coroutine_MethodReturnFromResult(PyObject* gen, __Pyx_PySendResult result, PyObject *retval, int iternext) { CYTHON_MAYBE_UNUSED_VAR(gen); - if (unlikely(!retval)) { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - if (!__Pyx_PyErr_Occurred()) { - PyObject *exc = PyExc_StopIteration; - #ifdef __Pyx_AsyncGen_USED - if (__Pyx_AsyncGen_CheckExact(gen)) - exc = __Pyx_PyExc_StopAsyncIteration; - #endif - __Pyx_PyErr_SetNone(exc); - } + if (likely(result == PYGEN_RETURN)) { + int is_async = 0; + #ifdef __Pyx_AsyncGen_USED + is_async = __Pyx_AsyncGen_CheckExact(gen); + #endif + __Pyx_ReturnWithStopIteration(retval, is_async, iternext); + Py_XDECREF(retval); } - return retval; + return NULL; } -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) +#if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { #if PY_VERSION_HEX <= 0x030A00A1 @@ -29297,25 +31677,58 @@ PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { #endif } #endif -static CYTHON_INLINE -PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { - PyObject *ret; +static CYTHON_INLINE __Pyx_PySendResult +__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen, PyObject** retval) { + __Pyx_PySendResult result; PyObject *val = NULL; + assert(__Pyx_Coroutine_get_is_running(gen)); __Pyx_Coroutine_Undelegate(gen); __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); - ret = __Pyx_Coroutine_SendEx(gen, val, 0); + result = __Pyx_Coroutine_SendEx(gen, val, retval, 0); Py_XDECREF(val); - return ret; + return result; +} +#if CYTHON_USE_AM_SEND +static __Pyx_PySendResult +__Pyx_Coroutine_SendToDelegate(__pyx_CoroutineObject *gen, __Pyx_pyiter_sendfunc gen_am_send, PyObject *value, PyObject **retval) { + PyObject *ret = NULL; + __Pyx_PySendResult delegate_result, result; + assert(__Pyx_Coroutine_get_is_running(gen)); + delegate_result = gen_am_send(gen->yieldfrom, value, &ret); + if (delegate_result == PYGEN_NEXT) { + assert (ret != NULL); + *retval = ret; + return PYGEN_NEXT; + } + assert (delegate_result != PYGEN_ERROR || ret == NULL); + __Pyx_Coroutine_Undelegate(gen); + result = __Pyx_Coroutine_SendEx(gen, ret, retval, 0); + Py_XDECREF(ret); + return result; } +#endif static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { - PyObject *retval; + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_AmSend(self, value, &retval); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0); +} +static __Pyx_PySendResult +__Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval) { + __Pyx_PySendResult result; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) - return __Pyx_Coroutine_AlreadyRunningError(gen); - if (yf) { + if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { + *retval = __Pyx_Coroutine_AlreadyRunningError(gen); + return PYGEN_ERROR; + } + #if CYTHON_USE_AM_SEND + if (gen->yieldfrom_am_send) { + result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, value, retval); + } else + #endif + if (gen->yieldfrom) { + PyObject *yf = gen->yieldfrom; PyObject *ret; - gen->is_running = 1; + #if !CYTHON_USE_AM_SEND #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, value); @@ -29331,66 +31744,67 @@ static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { ret = __Pyx_async_gen_asend_send(yf, value); } else #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + #if CYTHON_COMPILING_IN_CPYTHON if (PyGen_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else - #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyCoro_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif + #endif { - if (value == Py_None) - ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + #if !CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x03080000 + if (value == Py_None && PyIter_Check(yf)) + ret = __Pyx_PyIter_Next_Plain(yf); else - ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); + #endif + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_mstate_global->__pyx_n_u_send, value); } - gen->is_running = 0; if (likely(ret)) { - return ret; + __Pyx_Coroutine_unset_is_running(gen); + *retval = ret; + return PYGEN_NEXT; } - retval = __Pyx_Coroutine_FinishDelegation(gen); + result = __Pyx_Coroutine_FinishDelegation(gen, retval); } else { - retval = __Pyx_Coroutine_SendEx(gen, value, 0); + result = __Pyx_Coroutine_SendEx(gen, value, retval, 0); } - return __Pyx_Coroutine_MethodReturn(self, retval); + __Pyx_Coroutine_unset_is_running(gen); + return result; } static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { + __Pyx_PySendResult result; PyObject *retval = NULL; - int err = 0; + CYTHON_UNUSED_VAR(gen); + assert(__Pyx_Coroutine_get_is_running(gen)); #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; + result = __Pyx_Coroutine_Close(yf, &retval); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; + result = __Pyx_Coroutine_Close(yf, &retval); } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { - retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); - if (!retval) - return -1; + result = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf); } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { retval = __Pyx_async_gen_asend_close(yf, NULL); + result = PYGEN_RETURN; } else if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { retval = __Pyx_async_gen_athrow_close(yf, NULL); + result = PYGEN_RETURN; } else #endif { PyObject *meth; - gen->is_running = 1; - meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close); + result = PYGEN_RETURN; + meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_close); if (unlikely(!meth)) { if (unlikely(PyErr_Occurred())) { PyErr_WriteUnraisable(yf); @@ -29398,57 +31812,77 @@ static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { } else { retval = __Pyx_PyObject_CallNoArg(meth); Py_DECREF(meth); - if (unlikely(!retval)) - err = -1; + if (unlikely(!retval)) { + result = PYGEN_ERROR; + } } - gen->is_running = 0; } Py_XDECREF(retval); - return err; + return result == PYGEN_ERROR ? -1 : 0; } static PyObject *__Pyx_Generator_Next(PyObject *self) { + __Pyx_PySendResult result; + PyObject *retval = NULL; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) + if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { return __Pyx_Coroutine_AlreadyRunningError(gen); - if (yf) { + } + #if CYTHON_USE_AM_SEND + if (gen->yieldfrom_am_send) { + result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, Py_None, &retval); + } else + #endif + if (gen->yieldfrom) { + PyObject *yf = gen->yieldfrom; PyObject *ret; - gen->is_running = 1; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Generator_Next(yf); } else #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) - if (PyGen_CheckExact(yf)) { - ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); - } else - #endif #ifdef __Pyx_Coroutine_USED - if (__Pyx_Coroutine_Check(yf)) { + if (__Pyx_Coroutine_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, Py_None); } else #endif - ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); - gen->is_running = 0; + #if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX < 0x030A00A3 || !CYTHON_USE_AM_SEND) + if (PyGen_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); + } else + #endif + ret = __Pyx_PyIter_Next_Plain(yf); if (likely(ret)) { + __Pyx_Coroutine_unset_is_running(gen); return ret; } - return __Pyx_Coroutine_FinishDelegation(gen); + result = __Pyx_Coroutine_FinishDelegation(gen, &retval); + } else { + result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0); } - return __Pyx_Coroutine_SendEx(gen, Py_None, 0); + __Pyx_Coroutine_unset_is_running(gen); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 1); } static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) { + PyObject *retval = NULL; + __Pyx_PySendResult result; CYTHON_UNUSED_VAR(arg); - return __Pyx_Coroutine_Close(self); + result = __Pyx_Coroutine_Close(self, &retval); + if (unlikely(result == PYGEN_ERROR)) + return NULL; + Py_XDECREF(retval); + Py_RETURN_NONE; } -static PyObject *__Pyx_Coroutine_Close(PyObject *self) { +static __Pyx_PySendResult +__Pyx_Coroutine_Close(PyObject *self, PyObject **retval) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject *retval, *raised_exception; - PyObject *yf = gen->yieldfrom; + __Pyx_PySendResult result; + PyObject *yf; int err = 0; - if (unlikely(gen->is_running)) - return __Pyx_Coroutine_AlreadyRunningError(gen); + if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { + *retval = __Pyx_Coroutine_AlreadyRunningError(gen); + return PYGEN_ERROR; + } + yf = gen->yieldfrom; if (yf) { Py_INCREF(yf); err = __Pyx_Coroutine_CloseIter(gen, yf); @@ -29457,10 +31891,25 @@ static PyObject *__Pyx_Coroutine_Close(PyObject *self) { } if (err == 0) PyErr_SetNone(PyExc_GeneratorExit); - retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); - if (unlikely(retval)) { + result = __Pyx_Coroutine_SendEx(gen, NULL, retval, 1); + if (result == PYGEN_ERROR) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_Coroutine_unset_is_running(gen); + if (!__Pyx_PyErr_Occurred()) { + return PYGEN_RETURN; + } else if (likely(__Pyx_PyErr_ExceptionMatches2(PyExc_GeneratorExit, PyExc_StopIteration))) { + __Pyx_PyErr_Clear(); + return PYGEN_RETURN; + } + return PYGEN_ERROR; + } else if (likely(result == PYGEN_RETURN && *retval == Py_None)) { + __Pyx_Coroutine_unset_is_running(gen); + return PYGEN_RETURN; + } else { const char *msg; - Py_DECREF(retval); + Py_DECREF(*retval); + *retval = NULL; if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check(self)) { @@ -29468,33 +31917,25 @@ static PyObject *__Pyx_Coroutine_Close(PyObject *self) { #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(self)) { -#if PY_VERSION_HEX < 0x03060000 - msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; -#else msg = "async generator ignored GeneratorExit"; -#endif #endif } else { msg = "generator ignored GeneratorExit"; } PyErr_SetString(PyExc_RuntimeError, msg); - return NULL; - } - raised_exception = PyErr_Occurred(); - if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { - if (raised_exception) PyErr_Clear(); - Py_INCREF(Py_None); - return Py_None; + __Pyx_Coroutine_unset_is_running(gen); + return PYGEN_ERROR; } - return NULL; } static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, PyObject *args, int close_on_genexit) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) + PyObject *yf; + if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) return __Pyx_Coroutine_AlreadyRunningError(gen); + yf = gen->yieldfrom; if (yf) { + __Pyx_PySendResult result; PyObject *ret; Py_INCREF(yf); if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { @@ -29502,10 +31943,9 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject Py_DECREF(yf); __Pyx_Coroutine_Undelegate(gen); if (err < 0) - return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); + goto propagate_exception; goto throw_here; } - gen->is_running = 1; if (0 #ifdef __Pyx_Generator_USED || __Pyx_Generator_CheckExact(yf) @@ -29520,15 +31960,14 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); #endif } else { - PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw); + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_throw); if (unlikely(!meth)) { Py_DECREF(yf); if (unlikely(PyErr_Occurred())) { - gen->is_running = 0; + __Pyx_Coroutine_unset_is_running(gen); return NULL; } __Pyx_Coroutine_Undelegate(gen); - gen->is_running = 0; goto throw_here; } if (likely(args)) { @@ -29539,22 +31978,30 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject } Py_DECREF(meth); } - gen->is_running = 0; Py_DECREF(yf); - if (!ret) { - ret = __Pyx_Coroutine_FinishDelegation(gen); + if (ret) { + __Pyx_Coroutine_unset_is_running(gen); + return ret; } - return __Pyx_Coroutine_MethodReturn(self, ret); + result = __Pyx_Coroutine_FinishDelegation(gen, &ret); + __Pyx_Coroutine_unset_is_running(gen); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, ret, 0); } throw_here: __Pyx_Raise(typ, val, tb, NULL); - return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); +propagate_exception: + { + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, NULL, &retval, 0); + __Pyx_Coroutine_unset_is_running(gen); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0); + } } static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { PyObject *typ; PyObject *val = NULL; PyObject *tb = NULL; - if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))) + if (unlikely(!PyArg_UnpackTuple(args, "throw", 1, 3, &typ, &val, &tb))) return NULL; return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); } @@ -29569,6 +32016,10 @@ static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct * return 0; } static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { + { + int e = __Pyx_call_type_traverse((PyObject*)gen, 1, visit, arg); + if (e) return e; + } Py_VISIT(gen->closure); Py_VISIT(gen->classobj); Py_VISIT(gen->yieldfrom); @@ -29578,7 +32029,7 @@ static int __Pyx_Coroutine_clear(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; Py_CLEAR(gen->closure); Py_CLEAR(gen->classobj); - Py_CLEAR(gen->yieldfrom); + __Pyx_Coroutine_Undelegate(gen); __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { @@ -29599,10 +32050,13 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) { PyObject_ClearWeakRefs(self); if (gen->resume_label >= 0) { PyObject_GC_Track(self); -#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE +#if CYTHON_USE_TP_FINALIZE if (unlikely(PyObject_CallFinalizerFromDealloc(self))) #else - Py_TYPE(gen)->tp_del(self); + { + destructor del = __Pyx_PyObject_GetSlot(gen, tp_del, destructor); + if (del) del(self); + } if (unlikely(Py_REFCNT(self) > 0)) #endif { @@ -29621,6 +32075,7 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) { __Pyx_Coroutine_clear(self); __Pyx_PyHeapTypeObject_GC_Del(gen); } +#if CYTHON_USE_TP_FINALIZE static void __Pyx_Coroutine_del(PyObject *self) { PyObject *error_type, *error_value, *error_traceback; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; @@ -29628,10 +32083,6 @@ static void __Pyx_Coroutine_del(PyObject *self) { if (gen->resume_label < 0) { return; } -#if !CYTHON_USE_TP_FINALIZE - assert(self->ob_refcnt == 0); - __Pyx_SET_REFCNT(self, 1); -#endif __Pyx_PyThreadState_assign __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); #ifdef __Pyx_AsyncGen_USED @@ -29657,66 +32108,23 @@ static void __Pyx_Coroutine_del(PyObject *self) { #endif { PyObject_GC_UnTrack(self); -#if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) PyErr_WriteUnraisable(self); -#else - {PyObject *msg; - char *cmsg; - #if CYTHON_COMPILING_IN_PYPY - msg = NULL; - cmsg = (char*) "coroutine was never awaited"; - #else - char *cname; - PyObject *qualname; - qualname = gen->gi_qualname; - cname = PyString_AS_STRING(qualname); - msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); - if (unlikely(!msg)) { - PyErr_Clear(); - cmsg = (char*) "coroutine was never awaited"; - } else { - cmsg = PyString_AS_STRING(msg); - } - #endif - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) - PyErr_WriteUnraisable(self); - Py_XDECREF(msg);} -#endif PyObject_GC_Track(self); } #endif } else { - PyObject *res = __Pyx_Coroutine_Close(self); - if (unlikely(!res)) { - if (PyErr_Occurred()) - PyErr_WriteUnraisable(self); + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_Close(self, &retval); + if (result == PYGEN_ERROR) { + PyErr_WriteUnraisable(self); } else { - Py_DECREF(res); + Py_XDECREF(retval); } } __Pyx_ErrRestore(error_type, error_value, error_traceback); -#if !CYTHON_USE_TP_FINALIZE - assert(Py_REFCNT(self) > 0); - if (likely(--self->ob_refcnt == 0)) { - return; - } - { - Py_ssize_t refcnt = Py_REFCNT(self); - _Py_NewReference(self); - __Pyx_SET_REFCNT(self, refcnt); - } -#if CYTHON_COMPILING_IN_CPYTHON - assert(PyType_IS_GC(Py_TYPE(self)) && - _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); - _Py_DEC_REFTOTAL; -#endif -#ifdef COUNT_ALLOCS - --Py_TYPE(self)->tp_frees; - --Py_TYPE(self)->tp_allocs; -#endif -#endif } +#endif static PyObject * __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context) { @@ -29730,12 +32138,7 @@ static int __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; @@ -29757,12 +32160,7 @@ static int __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; @@ -29772,26 +32170,53 @@ __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void return 0; } static PyObject * -__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) +__Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self) { - PyObject *frame = self->gi_frame; - CYTHON_UNUSED_VAR(context); +#if !CYTHON_COMPILING_IN_LIMITED_API + PyObject *frame; + #if PY_VERSION_HEX >= 0x030d0000 + Py_BEGIN_CRITICAL_SECTION(self); + #endif + frame = self->gi_frame; if (!frame) { if (unlikely(!self->gi_code)) { Py_RETURN_NONE; } + PyObject *globals = PyDict_New(); + if (unlikely(!globals)) return NULL; frame = (PyObject *) PyFrame_New( PyThreadState_Get(), /*PyThreadState *tstate,*/ (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ + globals, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); + Py_DECREF(globals); if (unlikely(!frame)) return NULL; - self->gi_frame = frame; + if (unlikely(self->gi_frame)) { + Py_DECREF(frame); + frame = self->gi_frame; + } else { + self->gi_frame = frame; + } } Py_INCREF(frame); + #if PY_VERSION_HEX >= 0x030d0000 + Py_END_CRITICAL_SECTION(); + #endif return frame; +#else + CYTHON_UNUSED_VAR(self); + Py_RETURN_NONE; +#endif +} +static PyObject * +__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) { + CYTHON_UNUSED_VAR(context); + PyObject *frame = self->gi_frame; + if (frame) + return __Pyx_NewRef(frame); + return __Pyx__Coroutine_get_frame(self); } static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, @@ -29811,7 +32236,8 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( gen->resume_label = 0; gen->classobj = NULL; gen->yieldfrom = NULL; - #if PY_VERSION_HEX >= 0x030B00a4 + gen->yieldfrom_am_send = NULL; + #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_LIMITED_API gen->gi_exc_state.exc_value = NULL; #else gen->gi_exc_state.exc_type = NULL; @@ -29834,135 +32260,85 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( PyObject_GC_Track(gen); return gen; } - -/* PatchModuleWithCoroutine */ -static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - int result; - PyObject *globals, *result_obj; - globals = PyDict_New(); if (unlikely(!globals)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_coroutine_type", - #ifdef __Pyx_Coroutine_USED - (PyObject*)__pyx_CoroutineType); - #else - Py_None); +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 - if (unlikely(result < 0)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_generator_type", - #ifdef __Pyx_Generator_USED - (PyObject*)__pyx_GeneratorType); - #else - Py_None); + result = gen->is_running; + gen->is_running = 1; + #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_END_CRITICAL_SECTION(); #endif - if (unlikely(result < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; - result_obj = PyRun_String(py_code, Py_file_input, globals, globals); - if (unlikely(!result_obj)) goto ignore; - Py_DECREF(result_obj); - Py_DECREF(globals); - return module; -ignore: - Py_XDECREF(globals); - PyErr_WriteUnraisable(module); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { - Py_DECREF(module); - module = NULL; - } -#else - py_code++; -#endif - return module; + return result; } - -/* PatchGeneratorABC */ -#ifndef CYTHON_REGISTER_ABCS -#define CYTHON_REGISTER_ABCS 1 -#endif -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) -static PyObject* __Pyx_patch_abc_module(PyObject *module); -static PyObject* __Pyx_patch_abc_module(PyObject *module) { - module = __Pyx_Coroutine_patch_module( - module, "" -"if _cython_generator_type is not None:\n" -" try: Generator = _module.Generator\n" -" except AttributeError: pass\n" -" else: Generator.register(_cython_generator_type)\n" -"if _cython_coroutine_type is not None:\n" -" try: Coroutine = _module.Coroutine\n" -" except AttributeError: pass\n" -" else: Coroutine.register(_cython_coroutine_type)\n" - ); - return module; +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 + assert(gen->is_running); + gen->is_running = 0; + #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_END_CRITICAL_SECTION(); + #endif } -#endif -static int __Pyx_patch_abc(void) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - static int abc_patched = 0; - if (CYTHON_REGISTER_ABCS && !abc_patched) { - PyObject *module; - module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); - if (unlikely(!module)) { - PyErr_WriteUnraisable(NULL); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, - ((PY_MAJOR_VERSION >= 3) ? - "Cython module failed to register with collections.abc module" : - "Cython module failed to register with collections module"), 1) < 0)) { - return -1; - } - } else { - module = __Pyx_patch_abc_module(module); - abc_patched = 1; - if (unlikely(!module)) - return -1; - Py_DECREF(module); - } - module = PyImport_ImportModule("backports_abc"); - if (module) { - module = __Pyx_patch_abc_module(module); - Py_XDECREF(module); - } - if (!module) { - PyErr_Clear(); - } +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 + result = gen->is_running; + #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_END_CRITICAL_SECTION(); + #endif + return result; +} +static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure) { + CYTHON_UNUSED_VAR(closure); + char result = __Pyx_Coroutine_get_is_running((__pyx_CoroutineObject*)gen); + if (result) Py_RETURN_TRUE; + else Py_RETURN_FALSE; +} +#if __PYX_HAS_PY_AM_SEND == 2 +static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send) { + Py_ssize_t ptr_offset = (char*)(type->tp_as_async) - (char*)type; + if (ptr_offset < 0 || ptr_offset > type->tp_basicsize) { + return; } -#else - if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); -#endif - return 0; + memcpy((void*)static_amsend_methods, (void*)(type->tp_as_async), sizeof(*type->tp_as_async)); + static_amsend_methods->am_send = am_send; + type->tp_as_async = __Pyx_SlotTpAsAsync(static_amsend_methods); } +#endif /* Generator */ static PyMethodDef __pyx_Generator_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, - (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, + PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, - (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, + PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, - (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, + PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, {0, 0, 0, 0} }; static PyMemberDef __pyx_Generator_memberlist[] = { - {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, - {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, - (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, - {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, - {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, -#if CYTHON_USE_TYPE_SPECS - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, -#endif + {"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, + 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}, + {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Generator_getsets[] = { - {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, - (char*) PyDoc_STR("name of the generator"), 0}, - {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, - (char*) PyDoc_STR("qualified name of the generator"), 0}, - {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, - (char*) PyDoc_STR("Frame of the generator"), 0}, + {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, + PyDoc_STR("name of the generator"), 0}, + {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, + PyDoc_STR("qualified name of the generator"), 0}, + {"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, + PyDoc_STR("Frame of the generator"), 0}, + {"gi_running", __Pyx_Coroutine_get_is_running_getter, NULL, NULL, NULL}, {0, 0, 0, 0, 0} }; -#if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_GeneratorType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc}, {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse}, @@ -29971,9 +32347,12 @@ static PyType_Slot __pyx_GeneratorType_slots[] = { {Py_tp_methods, (void *)__pyx_Generator_methods}, {Py_tp_members, (void *)__pyx_Generator_memberlist}, {Py_tp_getset, (void *)__pyx_Generator_getsets}, - {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict}, + {Py_tp_getattro, (void *) PyObject_GenericGetAttr}, #if CYTHON_USE_TP_FINALIZE {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, +#endif +#if __PYX_HAS_PY_AM_SEND == 1 + {Py_am_send, (void *)__Pyx_Coroutine_AmSend}, #endif {0, 0}, }; @@ -29981,124 +32360,71 @@ static PyType_Spec __pyx_GeneratorType_spec = { __PYX_TYPE_MODULE_PREFIX "generator", sizeof(__pyx_CoroutineObject), 0, - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, - __pyx_GeneratorType_slots -}; -#else -static PyTypeObject __pyx_GeneratorType_type = { - PyVarObject_HEAD_INIT(0, 0) - __PYX_TYPE_MODULE_PREFIX "generator", - sizeof(__pyx_CoroutineObject), - 0, - (destructor) __Pyx_Coroutine_dealloc, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, - 0, - (traverseproc) __Pyx_Coroutine_traverse, - 0, - 0, - offsetof(__pyx_CoroutineObject, gi_weakreflist), - 0, - (iternextfunc) __Pyx_Generator_Next, - __pyx_Generator_methods, - __pyx_Generator_memberlist, - __pyx_Generator_getsets, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, -#if CYTHON_USE_TP_FINALIZE - 0, -#else - __Pyx_Coroutine_del, -#endif - 0, -#if CYTHON_USE_TP_FINALIZE - __Pyx_Coroutine_del, -#elif PY_VERSION_HEX >= 0x030400a1 - 0, -#endif -#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, -#endif -#if __PYX_NEED_TP_PRINT_SLOT - 0, -#endif -#if PY_VERSION_HEX >= 0x030C0000 - 0, -#endif -#if PY_VERSION_HEX >= 0x030d00A4 - 0, -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, +#if PY_VERSION_HEX >= 0x030A0000 + Py_TPFLAGS_IMMUTABLETYPE | #endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE | __Pyx_TPFLAGS_HAVE_AM_SEND, + __pyx_GeneratorType_slots }; +#if __PYX_HAS_PY_AM_SEND == 2 +static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async; #endif static int __pyx_Generator_init(PyObject *module) { -#if CYTHON_USE_TYPE_SPECS - __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); -#else - CYTHON_UNUSED_VAR(module); - __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; - __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; - __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); -#endif - if (unlikely(!__pyx_GeneratorType)) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); + mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); + if (unlikely(!mstate->__pyx_GeneratorType)) { return -1; } +#if __PYX_HAS_PY_AM_SEND == 2 + __Pyx_SetBackportTypeAmSend(mstate->__pyx_GeneratorType, &__pyx_Generator_as_async, &__Pyx_Coroutine_AmSend); +#endif return 0; } +static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *retval = NULL; + if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { + return __Pyx_Coroutine_AlreadyRunningError(gen); + } + __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0); + __Pyx_Coroutine_unset_is_running(gen); + (void) result; + assert (result == PYGEN_RETURN || result == PYGEN_ERROR); + assert ((result == PYGEN_RETURN && retval != NULL) || (result == PYGEN_ERROR && retval == NULL)); + return retval; +} -/* CheckBinaryVersion */ +/* GetRuntimeVersion */ static unsigned long __Pyx_get_runtime_version(void) { -#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 +#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 return Py_Version & ~0xFFUL; #else - 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'); + 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; } - version += factor * digit; - if (rt_version[i] != '.') - break; - digit = 0; - factor >>= 8; - ++i; + __Pyx_cached_runtime_version = version; } - return 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; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) @@ -30121,45 +32447,165 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt } } -/* InitStrings */ -#if PY_MAJOR_VERSION >= 3 -static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { - if (t.is_unicode | t.is_str) { - if (t.intern) { - *str = PyUnicode_InternFromString(t.s); - } else if (t.encoding) { - *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); +/* NewCodeObj */ +#if CYTHON_COMPILING_IN_LIMITED_API + static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030b0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); } else { - *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } - } else { - *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; } - if (!*str) - return -1; - if (PyObject_Hash(*str) == -1) - return -1; - return 0; -} +#elif PY_VERSION_HEX >= 0x030B0000 + static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + 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); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !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 + #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION >= 3 - __Pyx_InitString(*t, t->p); - #else +static PyObject* __Pyx_PyCode_New( + const __Pyx_PyCode_New_function_description descr, + PyObject * const *varnames, + PyObject *filename, + PyObject *funcname, + const char *line_table, + PyObject *tuple_dedup_map +) { + PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_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; + for (Py_ssize_t i=0; i < var_count; i++) { + Py_INCREF(varnames[i]); + if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done; + } + #if CYTHON_COMPILING_IN_LIMITED_API + varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple); + if (!varnames_tuple_dedup) { + if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done; + varnames_tuple_dedup = varnames_tuple; + } + #else + varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple); + if (unlikely(!varnames_tuple_dedup)) goto done; + #endif + #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; + code_bytes = PyBytes_FromStringAndSize(NULL, code_len); + if (unlikely(!code_bytes)) goto done; + char* c_code_bytes = PyBytes_AsString(code_bytes); + if (unlikely(!c_code_bytes)) goto done; + memset(c_code_bytes, 0, (size_t) code_len); + } + code_obj = (PyObject*) __Pyx__PyCode_New( + (int) descr.argcount, + (int) descr.num_posonly_args, + (int) descr.num_kwonly_args, + (int) descr.nlocals, + 0, + (int) descr.flags, + code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + varnames_tuple_dedup, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + filename, + funcname, + (int) descr.first_line, + (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table_bytes) ? line_table_bytes : __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 + Py_DECREF(varnames_tuple); + 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) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); + 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 { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + str = PyBytes_FromStringAndSize(t->s, t->n - 1); } - if (!*t->p) + if (!str) return -1; - if (PyObject_Hash(*t->p) == -1) + *target = str; + if (PyObject_Hash(str) == -1) return -1; - #endif ++t; + ++target; } return 0; } @@ -30187,31 +32633,30 @@ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#if !CYTHON_PEP393_ENABLED -static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } + const char* result; + Py_ssize_t unicode_length; + CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 + if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL; + #else + result = PyUnicode_AsUTF8AndSize(o, length); + #endif + #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + unicode_length = PyUnicode_GetLength(o); + if (unlikely(unicode_length < 0)) return NULL; + if (unlikely(unicode_length != *length)) { + PyUnicode_AsASCIIString(o); + return NULL; } + #endif + return result; } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -} #else -static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); @@ -30223,25 +32668,25 @@ static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py #else return PyUnicode_AsUTF8AndSize(o, length); #endif -} #endif +} #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + if (PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif -#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { +#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))) *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); - } else +#else + *length = PyByteArray_Size(o); + if (*length == -1) return NULL; + return PyByteArray_AsString(o); #endif + } else { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); @@ -30264,9 +32709,8 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { Py_DECREF(x); return retval; } -static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { - __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); -#if PY_MAJOR_VERSION >= 3 +static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result)); if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " @@ -30280,74 +32724,44 @@ static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const __Pyx_DECREF_TypeName(result_type_name); return result; } -#endif PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", - type_name, type_name, result_type_name); + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")", + result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif - const char *name = NULL; PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x) || PyLong_Check(x))) -#else if (likely(PyLong_Check(x))) -#endif - return __Pyx_NewRef(x); + return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; - #if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = m->nb_int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = m->nb_long(x); - } - #else if (likely(m && m->nb_int)) { - name = "int"; - res = m->nb_int(x); + res = m->nb_int(x); } - #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { - res = PyNumber_Int(x); + res = PyNumber_Long(x); } #endif if (likely(res)) { -#if PY_MAJOR_VERSION < 3 - if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { -#else - if (unlikely(!PyLong_CheckExact(res))) { -#endif - return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); - } + if (unlikely(!PyLong_CheckExact(res))) { + return __Pyx_PyNumber_LongWrongResultType(res); + } } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); + PyErr_SetString(PyExc_TypeError, + "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(b); - } -#endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { @@ -30393,34 +32807,349 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { } x = PyNumber_Index(b); if (!x) return -1; - ival = PyInt_AsSsize_t(x); + ival = PyLong_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); -#if PY_MAJOR_VERSION < 3 - } else if (likely(PyInt_CheckExact(o))) { - return PyInt_AS_LONG(o); -#endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; - ival = PyInt_AsLong(x); + ival = PyLong_AsLong(x); Py_DECREF(x); return ival; } } +static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) { + CYTHON_UNUSED_VAR(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); } -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { + return PyLong_FromSize_t(ival); +} + + +/* MultiPhaseInitModuleState */ +#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE +#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000) + #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1 +#else + #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0 +#endif +#endif +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS +#error "Module state with PEP489 requires atomics. Currently that's one of\ + C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics" +#endif +#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +#define __Pyx_ModuleStateLookup_Lock() +#define __Pyx_ModuleStateLookup_Unlock() +#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000 +static PyMutex __Pyx_ModuleStateLookup_mutex = {0}; +#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(__cplusplus) && __cplusplus >= 201103L +#include +static std::mutex __Pyx_ModuleStateLookup_mutex; +#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock() +#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock() +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__) +#include +static mtx_t __Pyx_ModuleStateLookup_mutex; +static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT; +static void __Pyx_ModuleStateLookup_initialize_mutex(void) { + mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain); +} +#define __Pyx_ModuleStateLookup_Lock()\ + call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\ + mtx_lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(HAVE_PTHREAD_H) +#include +static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER; +#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(_WIN32) +#include // synchapi.h on its own doesn't work +static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT; +#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) +#else +#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\ + Requires C standard >= C11, or C++ standard >= C++11,\ + or pthreads, or the Windows 32 API, or Python >= 3.13." +#endif +typedef struct { + int64_t id; + PyObject *module; +} __Pyx_InterpreterIdAndModule; +typedef struct { + char interpreter_id_as_index; + Py_ssize_t count; + Py_ssize_t allocated; + __Pyx_InterpreterIdAndModule table[1]; +} __Pyx_ModuleStateLookupData; +#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32 +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0; +#endif +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0; +#else +static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL; +#endif +static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound( + __Pyx_InterpreterIdAndModule* table, + Py_ssize_t count, + int64_t interpreterId) { + __Pyx_InterpreterIdAndModule* begin = table; + __Pyx_InterpreterIdAndModule* end = begin + count; + if (begin->id == interpreterId) { + return begin; + } + while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { + __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2; + if (halfway->id == interpreterId) { + return halfway; + } + if (halfway->id < interpreterId) { + begin = halfway; + } else { + end = halfway; + } + } + for (; begin < end; ++begin) { + if (begin->id >= interpreterId) return begin; + } + return begin; +} +static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return NULL; +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); + { + __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); + if (likely(data)) { + __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data); + if (likely(data == new_data)) { + goto read_finished; + } + } + __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); + __Pyx_ModuleStateLookup_Lock(); + __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter); + data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); + __Pyx_ModuleStateLookup_Unlock(); + } + read_finished:; +#else + __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data; +#endif + __Pyx_InterpreterIdAndModule* found = NULL; + if (unlikely(!data)) goto end; + if (data->interpreter_id_as_index) { + if (interpreter_id < data->count) { + found = data->table+interpreter_id; + } + } else { + found = __Pyx_State_FindModuleStateLookupTableLowerBound( + data->table, data->count, interpreter_id); + } + end: + { + PyObject *result=NULL; + if (found && found->id == interpreter_id) { + result = found->module; + } +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); +#endif + return result; + } } - +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) { + while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0); +} +#else +#define __Pyx_ModuleStateLookup_wait_until_no_readers() +#endif +static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) { + Py_ssize_t to_allocate = (*old_data)->allocated; + while (to_allocate <= interpreter_id) { + if (to_allocate == 0) to_allocate = 1; + else to_allocate *= 2; + } + __Pyx_ModuleStateLookupData *new_data = *old_data; + if (to_allocate != (*old_data)->allocated) { + new_data = (__Pyx_ModuleStateLookupData *)realloc( + *old_data, + sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); + if (!new_data) { + PyErr_NoMemory(); + return -1; + } + for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) { + new_data->table[i].id = i; + new_data->table[i].module = NULL; + } + new_data->allocated = to_allocate; + } + new_data->table[interpreter_id].module = module; + if (new_data->count < interpreter_id+1) { + new_data->count = interpreter_id+1; + } + *old_data = new_data; + return 0; +} +static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) { + __Pyx_InterpreterIdAndModule *read = data->table; + __Pyx_InterpreterIdAndModule *write = data->table; + __Pyx_InterpreterIdAndModule *end = read + data->count; + for (; readmodule) { + write->id = read->id; + write->module = read->module; + ++write; + } + } + data->count = write - data->table; + for (; writeid = 0; + write->module = NULL; + } + data->interpreter_id_as_index = 0; +} +static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return -1; + int result = 0; + __Pyx_ModuleStateLookup_Lock(); +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *) + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); +#else + __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data; +#endif + __Pyx_ModuleStateLookupData *new_data = old_data; + if (!new_data) { + new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData)); + if (!new_data) { + result = -1; + PyErr_NoMemory(); + goto end; + } + new_data->allocated = 1; + new_data->interpreter_id_as_index = 1; + } + __Pyx_ModuleStateLookup_wait_until_no_readers(); + if (new_data->interpreter_id_as_index) { + if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { + result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id); + goto end; + } + __Pyx_State_ConvertFromInterpIdAsIndex(new_data); + } + { + Py_ssize_t insert_at = 0; + { + __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( + new_data->table, new_data->count, interpreter_id); + assert(lower_bound); + insert_at = lower_bound - new_data->table; + if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) { + lower_bound->module = module; + goto end; // already in table, nothing more to do + } + } + if (new_data->count+1 >= new_data->allocated) { + Py_ssize_t to_allocate = (new_data->count+1)*2; + new_data = + (__Pyx_ModuleStateLookupData*)realloc( + new_data, + sizeof(__Pyx_ModuleStateLookupData) + + (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); + if (!new_data) { + result = -1; + new_data = old_data; + PyErr_NoMemory(); + goto end; + } + new_data->allocated = to_allocate; + } + ++new_data->count; + int64_t last_id = interpreter_id; + PyObject *last_module = module; + for (Py_ssize_t i=insert_at; icount; ++i) { + int64_t current_id = new_data->table[i].id; + new_data->table[i].id = last_id; + last_id = current_id; + PyObject *current_module = new_data->table[i].module; + new_data->table[i].module = last_module; + last_module = current_module; + } + } + end: +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data); +#else + __Pyx_ModuleStateLookup_data = new_data; +#endif + __Pyx_ModuleStateLookup_Unlock(); + return result; +} +static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return -1; + __Pyx_ModuleStateLookup_Lock(); +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *) + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); +#else + __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data; +#endif + if (data->interpreter_id_as_index) { + if (interpreter_id < data->count) { + data->table[interpreter_id].module = NULL; + } + goto done; + } + { + __Pyx_ModuleStateLookup_wait_until_no_readers(); + __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( + data->table, data->count, interpreter_id); + if (!lower_bound) goto done; + if (lower_bound->id != interpreter_id) goto done; + __Pyx_InterpreterIdAndModule *end = data->table+data->count; + for (;lower_boundid = (lower_bound+1)->id; + lower_bound->module = (lower_bound+1)->module; + } + } + --data->count; + if (data->count == 0) { + free(data); + data = NULL; + } + done: +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data); +#else + __Pyx_ModuleStateLookup_data = data; +#endif + __Pyx_ModuleStateLookup_Unlock(); + return 0; +} +#endif /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER diff --git a/constraint/domain.c b/constraint/domain.c index db4c6ba..37d3f94 100644 --- a/constraint/domain.c +++ b/constraint/domain.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.0.12 */ +/* Generated by Cython 3.1.1 */ /* BEGIN: Cython Metadata { @@ -18,32 +18,21 @@ END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ -#if defined(CYTHON_LIMITED_API) && 0 - #ifndef Py_LIMITED_API - #if CYTHON_LIMITED_API+0 > 0x03030000 - #define Py_LIMITED_API CYTHON_LIMITED_API - #else - #define Py_LIMITED_API 0x03030000 - #endif - #endif +/* InitLimitedAPI */ +#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API) + #define CYTHON_LIMITED_API 1 #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) - #error Cython requires Python 2.7+ or Python 3.3+. -#else -#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API -#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#elif PY_VERSION_HEX < 0x03080000 + #error Cython requires Python 3.8+. #else -#define __PYX_EXTRA_ABI_MODULE_NAME "" -#endif -#define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME -#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI -#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x03000CF0 +#define __PYX_ABI_VERSION "3_1_1" +#define CYTHON_HEX_VERSION 0x030101F0 #define CYTHON_FUTURE_DIVISION 1 +/* CModulePreamble */ #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -83,19 +72,13 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -106,8 +89,12 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #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 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -119,18 +106,22 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 + #define CYTHON_USE_EXC_INFO_STACK 1 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif @@ -141,20 +132,14 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 + #define CYTHON_USE_TYPE_SLOTS 1 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -165,8 +150,13 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #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 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -178,7 +168,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT @@ -188,14 +178,19 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00) + #endif + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100) #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 @@ -208,7 +203,7 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS @@ -217,8 +212,6 @@ END: Cython Metadata */ #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -231,8 +224,13 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -240,71 +238,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 1 - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif - #undef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 -#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 1 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #ifndef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #ifndef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 1 - #endif + #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS @@ -316,26 +250,37 @@ END: Cython Metadata */ #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 + #define CYTHON_USE_TP_FINALIZE 0 + #endif + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000) #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 - #endif - #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif + #undef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #ifndef CYTHON_USE_TYPE_SLOTS + #ifdef Py_GIL_DISABLED + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1 + #else + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 + #endif + #if PY_VERSION_HEX < 0x030A0000 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #elif !defined(CYTHON_USE_TYPE_SLOTS) #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS @@ -344,22 +289,19 @@ END: Cython Metadata */ #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif - #if PY_MAJOR_VERSION < 3 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif - #ifndef CYTHON_USE_PYLIST_INTERNALS + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLIST_INTERNALS) #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif - #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) @@ -368,20 +310,32 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 + #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS) + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif - #ifndef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #elif !defined(CYTHON_FAST_GIL) + #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #define CYTHON_METH_FASTCALL 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 @@ -389,51 +343,49 @@ END: Cython Metadata */ #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif - #if PY_VERSION_HEX < 0x030400a1 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #elif !defined(CYTHON_USE_TP_FINALIZE) + #ifndef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1) + #endif + #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif - #if PY_VERSION_HEX < 0x030600B1 + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 1 + #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE) #endif - #if PY_VERSION_HEX < 0x030700A3 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 1 + #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif #endif -#if !defined(CYTHON_FAST_PYCCALL) -#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#ifndef CYTHON_FAST_PYCCALL +#define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL #endif -#if !defined(CYTHON_VECTORCALL) +#ifndef CYTHON_VECTORCALL +#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) #endif +#endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS - #if PY_MAJOR_VERSION < 3 - #include "longintrepr.h" - #endif #undef SHIFT #undef BASE #undef MASK @@ -568,6 +520,9 @@ END: Cython Metadata */ #endif #endif #endif +#ifndef Py_UNREACHABLE + #define Py_UNREACHABLE() assert(0); abort() +#endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; @@ -582,6 +537,7 @@ END: Cython Metadata */ #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) +/* CInitCode */ #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) @@ -596,109 +552,42 @@ END: Cython Metadata */ #endif #endif +/* PythonCompatibility */ #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_DefaultClassType PyClass_Type - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_DefaultClassType PyType_Type +#define __Pyx_BUILTIN_MODULE_NAME "builtins" +#define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API - static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyObject *exception_table = NULL; - PyObject *types_module=NULL, *code_type=NULL, *result=NULL; - #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; - PyObject *py_minor_version = NULL; - #endif - long minor_version = 0; - PyObject *type, *value, *traceback; - PyErr_Fetch(&type, &value, &traceback); - #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; - #else - if (!(version_info = PySys_GetObject("version_info"))) goto end; - if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; - minor_version = PyLong_AsLong(py_minor_version); - Py_DECREF(py_minor_version); - if (minor_version == -1 && PyErr_Occurred()) goto end; - #endif - if (!(types_module = PyImport_ImportModule("types"))) goto end; - if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; - if (minor_version <= 7) { - (void)p; - result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else if (minor_version <= 10) { - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else { - if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); - } - end: - Py_XDECREF(code_type); - Py_XDECREF(exception_table); - Py_XDECREF(types_module); - if (type) { - PyErr_Restore(type, value, traceback); - } - return result; - } #ifndef CO_OPTIMIZED - #define CO_OPTIMIZED 0x0001 + static int CO_OPTIMIZED; #endif #ifndef CO_NEWLOCALS - #define CO_NEWLOCALS 0x0002 + static int CO_NEWLOCALS; #endif #ifndef CO_VARARGS - #define CO_VARARGS 0x0004 + static int CO_VARARGS; #endif #ifndef CO_VARKEYWORDS - #define CO_VARKEYWORDS 0x0008 + static int CO_VARKEYWORDS; #endif #ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x0200 + static int CO_ASYNC_GENERATOR; #endif #ifndef CO_GENERATOR - #define CO_GENERATOR 0x0020 + static int CO_GENERATOR; #endif #ifndef CO_COROUTINE - #define CO_COROUTINE 0x0080 + static int CO_COROUTINE; #endif -#elif PY_VERSION_HEX >= 0x030B0000 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); - if (!empty_bytes) return NULL; - result = - #if PY_VERSION_HEX >= 0x030C0000 - PyUnstable_Code_NewWithPosOnlyArgs - #else - PyCode_NewWithPosOnlyArgs - #endif - (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); - Py_DECREF(empty_bytes); - return result; - } -#elif PY_VERSION_HEX >= 0x030800B2 && !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 - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 + #endif #endif +static int __Pyx_init_co_variables(void); #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else @@ -730,12 +619,6 @@ END: Cython Metadata */ #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif -#ifndef CO_COROUTINE - #define CO_COROUTINE 0x80 -#endif -#ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x200 -#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -757,7 +640,7 @@ END: Cython Metadata */ #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif -#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) +#ifndef METH_FASTCALL #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif @@ -795,7 +678,7 @@ END: Cython Metadata */ #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif -#if PY_MAJOR_VERSION >= 0x030900B1 +#if PY_VERSION_HEX >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) @@ -812,7 +695,7 @@ static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif -static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { +static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else @@ -820,7 +703,7 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) -#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 +#if __PYX_LIMITED_VERSION_HEX < 0x03090000 #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 @@ -836,8 +719,10 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_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)) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) @@ -848,15 +733,11 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() -#elif PY_VERSION_HEX >= 0x03060000 - #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() -#elif PY_VERSION_HEX >= 0x03000000 - #define __Pyx_PyThreadState_Current PyThreadState_GET() #else - #define __Pyx_PyThreadState_Current _PyThreadState_Current + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #endif -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +#if CYTHON_USE_MODULE_STATE +static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); @@ -864,85 +745,43 @@ static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) Py_FatalError("Couldn't find the module state"); return result; } -#endif -#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o) #else - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) -#endif -#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) -#include "pythread.h" -#define Py_tss_NEEDS_INIT 0 -typedef int Py_tss_t; -static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { - *key = PyThread_create_key(); - return 0; -} -static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { - Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); - *key = Py_tss_NEEDS_INIT; - return key; -} -static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { - PyObject_Free(key); -} -static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { - return *key != Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { - PyThread_delete_key(*key); - *key = Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { - return PyThread_set_key_value(*key, value); -} -static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { - return PyThread_get_key_value(*key); -} -#endif -#if PY_MAJOR_VERSION < 3 - #if CYTHON_COMPILING_IN_PYPY - #if PYPY_VERSION_NUM < 0x07030600 - #if defined(__cplusplus) && __cplusplus >= 201402L - [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] - #elif defined(__GNUC__) || defined(__clang__) - __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) - #elif defined(_MSC_VER) - __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) - #endif - static CYTHON_INLINE int PyGILState_Check(void) { - return 0; - } - #else // PYPY_VERSION_NUM < 0x07030600 - #endif // PYPY_VERSION_NUM < 0x07030600 - #else - static CYTHON_INLINE int PyGILState_Check(void) { - PyThreadState * tstate = _PyThreadState_Current; - return tstate && (tstate == PyGILState_GetThisThreadState()); - } - #endif +#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global) #endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype) +#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype) +#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype) +#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype) +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype) + #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL) + #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\ + ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\ + (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\ + __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL) + #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype) + #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype) +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif -#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) +#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } -#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000 #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else @@ -966,17 +805,11 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) - #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) - #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) -#else - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif +#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ @@ -988,24 +821,20 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) -#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 +#else #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) @@ -1021,20 +850,6 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif -#else - #define CYTHON_PEP393_ENABLED 0 - #define PyUnicode_1BYTE_KIND 1 - #define PyUnicode_2BYTE_KIND 2 - #define PyUnicode_4BYTE_KIND 4 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) @@ -1048,8 +863,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif - #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) - #undef PyUnicode_Contains + #if !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) @@ -1059,33 +873,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #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 PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#ifndef PyObject_Unicode - #define PyObject_Unicode PyObject_Str -#endif -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) @@ -1102,28 +890,75 @@ 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_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS + #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) + #else + #define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i) + #endif +#else + #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) +#endif +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 +#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) +#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyObject_GetItem(dict, key); + if (*result == NULL) { + if (PyErr_ExceptionMatches(PyExc_KeyError)) { + PyErr_Clear(); + return 0; + } + return -1; + } + return 1; +} +#else +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyDict_GetItemWithError(dict, key); + if (*result == NULL) { + return PyErr_Occurred() ? -1 : 0; + } + Py_INCREF(*result); + return 1; +} +#endif +#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST + #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj) +#else + #define __Pyx_VISIT_CONST(obj) +#endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i) +#endif +#if CYTHON_ASSUME_SAFE_SIZE #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o) #else - #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) - #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) - #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) - #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) #endif -#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 +#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) { @@ -1132,86 +967,139 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, return module; } #endif -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define __Pyx_Py3Int_Check(op) PyLong_Check(op) - #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#else - #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) - #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t +#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t +#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 + #define __Pyx_PySendResult PySendResult #else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t + typedef enum { + PYGEN_RETURN = 0, + PYGEN_ERROR = -1, + PYGEN_NEXT = 1, + } __Pyx_PySendResult; #endif -#if CYTHON_USE_ASYNC_SLOTS - #if PY_VERSION_HEX >= 0x030500B1 - #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods - #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) - #else - #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) - #endif +#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3 + typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result); +#else + #define __Pyx_pyiter_sendfunc sendfunc +#endif +#if !CYTHON_USE_AM_SEND +#define __PYX_HAS_PY_AM_SEND 0 +#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000 +#define __PYX_HAS_PY_AM_SEND 1 #else - #define __Pyx_PyType_AsAsync(obj) NULL +#define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation #endif -#ifndef __Pyx_PyAsyncMethodsStruct +#if __PYX_HAS_PY_AM_SEND < 2 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods +#else typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; + __Pyx_pyiter_sendfunc am_send; } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s)) #endif - -#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) - #if !defined(_USE_MATH_DEFINES) - #define _USE_MATH_DEFINES - #endif -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) +#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0 + #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21) #else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} + #define __Pyx_TPFLAGS_HAVE_AM_SEND (0) #endif -#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) -#define __Pyx_truncl trunc +#if PY_VERSION_HEX >= 0x03090000 +#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get() #else -#define __Pyx_truncl truncl +#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp #endif - -#define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } -#define __PYX_ERR(f_index, lineno, Ln_error) \ +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000 +#ifdef __cplusplus +extern "C" +#endif +PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize); +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) { + int value; + PyObject *py_value = PyObject_GetAttrString(inspect, name); + if (!py_value) return 0; + value = (int) PyLong_AsLong(py_value); + Py_DECREF(py_value); + *write_to = value; + return value != -1 || !PyErr_Occurred(); +} +static int __Pyx_init_co_variables(void) { + PyObject *inspect; + int result; + inspect = PyImport_ImportModule("inspect"); + result = +#if !defined(CO_OPTIMIZED) + __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) && +#endif +#if !defined(CO_NEWLOCALS) + __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) && +#endif +#if !defined(CO_VARARGS) + __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) && +#endif +#if !defined(CO_VARKEYWORDS) + __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) && +#endif +#if !defined(CO_ASYNC_GENERATOR) + __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) && +#endif +#if !defined(CO_GENERATOR) + __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) && +#endif +#if !defined(CO_COROUTINE) + __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) && +#endif + 1; + Py_DECREF(inspect); + return result ? 0 : -1; +} +#else +static int __Pyx_init_co_variables(void) { + return 0; // It's a limited API-only feature +} +#endif + +/* MathInitCode */ +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #ifndef _USE_MATH_DEFINES + #define _USE_MATH_DEFINES + #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 +#define __Pyx_truncl truncl +#endif + +#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0 +#endif +#ifndef CYTHON_CLINE_IN_TRACEBACK +#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#endif +#if CYTHON_CLINE_IN_TRACEBACK +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; } +#else +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; } +#endif +#define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C @@ -1242,12 +1130,8 @@ static CYTHON_INLINE float __PYX_NAN() { #define CYTHON_WITHOUT_ASSERTIONS #endif -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -1290,19 +1174,23 @@ static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s) +#else + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s) +#endif #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) @@ -1311,32 +1199,44 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef) + return Py_NewRef(obj); +#else + Py_INCREF(obj); + return obj; +#endif +} +static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef) + return Py_XNewRef(obj); +#else + Py_XINCREF(obj); + return obj; +#endif +} +static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b); static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x) #else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x) #endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x)) #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK @@ -1383,81 +1283,12 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -#include -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = (char) c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL) #else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#include -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #endif @@ -1469,25 +1300,193 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) { #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ +/* PretendToInitialize */ +#ifdef __cplusplus +#include +template +static void __Pyx_pretend_to_initialize(T* ptr) { +#if __cplusplus > 201103L + if ((std::is_trivially_default_constructible::value)) +#endif + *ptr = T(); + (void)ptr; +} +#else static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } +#endif + #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; -static const char * __pyx_cfilenm = __FILE__; +static const char * const __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ -static const char *__pyx_f[] = { +static const char* const __pyx_f[] = { "constraint/domain.py", }; /* #### Code section: utility_code_proto_before_types ### */ -/* ForceInitThreads.proto */ -#ifndef __PYX_FORCE_INIT_THREADS - #define __PYX_FORCE_INIT_THREADS 0 +/* Atomics.proto */ +#include +#ifndef CYTHON_ATOMICS + #define CYTHON_ATOMICS 1 +#endif +#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS +#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __pyx_atomic_int_type int +#define __pyx_nonatomic_int_type int +#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ + (__STDC_VERSION__ >= 201112L) &&\ + !defined(__STDC_NO_ATOMICS__)) + #include +#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ + (__cplusplus >= 201103L) ||\ + (defined(_MSC_VER) && _MSC_VER >= 1700))) + #include +#endif +#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ + (__STDC_VERSION__ >= 201112L) &&\ + !defined(__STDC_NO_ATOMICS__) &&\ + ATOMIC_INT_LOCK_FREE == 2) + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type atomic_int + #define __pyx_atomic_ptr_type atomic_uintptr_t + #define __pyx_nonatomic_ptr_type uintptr_t + #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed) + #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel) + #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel) + #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg) + #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired) + #define __pyx_atomic_load(value) atomic_load(value) + #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value) + #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) + #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) + #pragma message ("Using standard C atomics") + #elif defined(__PYX_DEBUG_ATOMICS) + #warning "Using standard C atomics" + #endif +#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ + (__cplusplus >= 201103L) ||\ +\ + (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\ + ATOMIC_INT_LOCK_FREE == 2) + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type std::atomic_int + #define __pyx_atomic_ptr_type std::atomic_uintptr_t + #define __pyx_nonatomic_ptr_type uintptr_t + #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed) + #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel) + #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel) + #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg) + #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired) + #define __pyx_atomic_load(value) std::atomic_load(value) + #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value) + #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) + #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) + #pragma message ("Using standard C++ atomics") + #elif defined(__PYX_DEBUG_ATOMICS) + #warning "Using standard C++ atomics" + #endif +#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\ + (__GNUC_MINOR__ > 1 ||\ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2)))) + #define __pyx_atomic_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) + #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg) + static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { + __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired); + int result = old == *expected; + *expected = old; + return result; + } + #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0) + #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value) + #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) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using GNU atomics" + #endif +#elif CYTHON_ATOMICS && defined(_MSC_VER) + #include + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type long + #define __pyx_atomic_ptr_type void* + #undef __pyx_nonatomic_int_type + #define __pyx_nonatomic_int_type long + #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) + #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1) + #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg) + static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { + __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected); + int result = old == *expected; + *expected = old; + return result; + } + #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0) + #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value) + #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) + #ifdef __PYX_DEBUG_ATOMICS + #pragma message ("Using MSVC atomics") + #endif +#else + #undef CYTHON_ATOMICS + #define CYTHON_ATOMICS 0 + #ifdef __PYX_DEBUG_ATOMICS + #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 */ +#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) +#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 +#endif +#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_BEGIN_CRITICAL_SECTION(o) { +#define __Pyx_END_CRITICAL_SECTION() } +#else +#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION +#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION #endif /* #### Code section: numeric_typedefs ### */ @@ -1514,7 +1513,6 @@ static const char *__pyx_f[] = { static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ @@ -1528,11 +1526,6 @@ static const char *__pyx_f[] = { __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) - #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() -#endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ @@ -1644,6 +1637,8 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +#endif +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif @@ -1658,81 +1653,68 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i) #elif CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) -#else - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) -#endif -#if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) - #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i)) #else - #define __Pyx_Arg_NewRef_VARARGS(arg) arg - #define __Pyx_Arg_XDECREF_VARARGS(arg) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i)) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL - #define __Pyx_Arg_FASTCALL(args, i) args[i] - #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i]) + #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif - #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs - to have the same reference counting */ - #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else - #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS + #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS - #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) - #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS -#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) -#else #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) +#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) #endif -/* 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); - /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, - const char* function_name); - -/* PyObjectSetAttrStr.proto */ -#if CYTHON_USE_TYPE_SLOTS -#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) -static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); -#else -#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) -#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) -#endif +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 */ +#define __Pyx_CallCFunction(cfunc, self, args)\ + ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args) +#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\ + ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs) +#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\ + ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs) +#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 **args, Py_ssize_t nargs, PyObject *kwargs); +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) @@ -1742,12 +1724,6 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" -#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else @@ -1776,7 +1752,76 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject /* PyObjectFastCall.proto */ #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 **args, size_t nargs, PyObject *kwargs); +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs); + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS + __pyx_atomic_int_type initialized; +#endif + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) { +#if !CYTHON_ATOMICS + return 1; +#else + __pyx_nonatomic_int_type expected = 0; + if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) { + return 0; + } + return expected; +#endif +} +static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) { +#if CYTHON_ATOMICS + __pyx_atomic_store(&cfunc->initialized, 2); +#endif +} +#else +#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2 +#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc) +#endif + +/* CallUnboundCMethod2.proto */ +CYTHON_UNUSED +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); +#else +#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) +#endif + +/* 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 */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 +#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL) +#else +#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n) +#endif + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* PyObjectFastCallMethod.proto */ +#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000 +#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL) +#else +static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf); +#endif /* SliceObject.proto */ #define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\ @@ -1830,7 +1875,7 @@ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name /* pop.proto */ static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L); -#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L); #define __Pyx_PyObject_Pop(L) (likely(PyList_CheckExact(L)) ?\ __Pyx_PyList_Pop(L) : __Pyx__PyObject_Pop(L)) @@ -1839,31 +1884,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L); #define __Pyx_PyObject_Pop(L) __Pyx__PyObject_Pop(L) #endif -/* UnpackUnboundCMethod.proto */ -typedef struct { - PyObject *type; - PyObject **method_name; - PyCFunction func; - PyObject *method; - int flag; -} __Pyx_CachedCFunction; - /* CallUnboundCMethod0.proto */ +CYTHON_UNUSED static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); #if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_CallUnboundCMethod0(cfunc, self)\ - (likely((cfunc)->func) ?\ - (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\ - (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\ - (PY_VERSION_HEX >= 0x030700A0 ?\ - (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\ - (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\ - (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\ - (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\ - (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\ - ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\ - __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\ - __Pyx__CallUnboundCMethod0(cfunc, self)) +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); #else #define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) #endif @@ -1874,53 +1899,30 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); -/* IncludeStructmemberH.proto */ -#include - /* FixUpExtensionType.proto */ -#if CYTHON_USE_TYPE_SPECS -static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); -#endif +static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); +/* dict_setdefault.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type); + /* FetchCommonType.proto */ -#if !CYTHON_USE_TYPE_SPECS -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); -#else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); -#endif -/* PyMethodNew.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - typesModule = PyImport_ImportModule("types"); - if (!typesModule) return NULL; - methodType = PyObject_GetAttrString(typesModule, "MethodType"); - Py_DECREF(typesModule); - if (!methodType) return NULL; - result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); - Py_DECREF(methodType); - return result; -} -#elif PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - return PyMethod_New(func, self); -} +/* 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 #else - #define __Pyx_PyMethod_New PyMethod_New +static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg); #endif +/* PyMethodNew.proto */ +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); + /* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif @@ -1954,10 +1956,11 @@ typedef struct { #else PyCMethodObject func; #endif -#if CYTHON_BACKPORT_VECTORCALL +#if CYTHON_BACKPORT_VECTORCALL ||\ + (CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL) __pyx_vectorcallfunc func_vectorcall; #endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; @@ -1970,9 +1973,7 @@ typedef struct { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif - void *defaults; - int defaults_pyobjects; - size_t defaults_size; + PyObject *defaults; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -1981,10 +1982,10 @@ typedef struct { PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check -#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) -#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) -#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType) +#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType) +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, @@ -1993,9 +1994,8 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef * PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, - size_t size, - int pyobjects); +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, + PyTypeObject *defaults_type); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, @@ -2008,7 +2008,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 +#if CYTHON_BACKPORT_VECTORCALL || 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) @@ -2023,7 +2023,7 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, PyObject* code); /* SetNameInClass.proto */ -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON @@ -2083,7 +2083,7 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ - (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) @@ -2103,28 +2103,33 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CLineInTraceback.proto */ -#ifdef CYTHON_CLINE_IN_TRACEBACK -#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) -#else +#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 */ -#if !CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject __Pyx_CachedCodeObjectType; +#else +typedef PyCodeObject __Pyx_CachedCodeObjectType; +#endif typedef struct { - PyCodeObject* code_object; + __Pyx_CachedCodeObjectType* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_int_type accessor_count; + #endif }; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); -#endif +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -2134,12 +2139,16 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" -static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 +#define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName #else +static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp); +#endif +#else // !LIMITED_API typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" -#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif @@ -2148,14 +2157,32 @@ typedef const char *__Pyx_TypeName; #define __Pyx_HAS_GCC_DIAGNOSTIC #endif +/* PyObjectVectorCallKwBuilder.proto */ +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 +#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall +#endif +#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n) +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict +#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n) +#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value) +#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value) +#endif + /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value); /* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON @@ -2169,19 +2196,71 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) -#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) { + return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2); +} #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) +#ifdef PyExceptionInstance_Check + #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj) +#else + #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException) +#endif -/* CheckBinaryVersion.proto */ +/* 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); -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); +/* MultiPhaseInitModuleState.proto */ +#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE +static PyObject *__Pyx_State_FindModule(void*); +static int __Pyx_State_AddModule(PyObject* module, void*); +static int __Pyx_State_RemoveModule(void*); +#elif CYTHON_USE_MODULE_STATE +#define __Pyx_State_FindModule PyState_FindModule +#define __Pyx_State_AddModule PyState_AddModule +#define __Pyx_State_RemoveModule PyState_RemoveModule +#endif /* #### Code section: module_declarations ### */ +/* CythonABIVersion.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API + #if CYTHON_METH_FASTCALL + #define __PYX_FASTCALL_ABI_SUFFIX "_fastcall" + #else + #define __PYX_FASTCALL_ABI_SUFFIX + #endif + #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX +#else + #define __PYX_LIMITED_ABI_SUFFIX +#endif +#if __PYX_HAS_PY_AM_SEND == 1 + #define __PYX_AM_SEND_ABI_SUFFIX +#elif __PYX_HAS_PY_AM_SEND == 2 + #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport" +#else + #define __PYX_AM_SEND_ABI_SUFFIX "noamsend" +#endif +#ifndef __PYX_MONITORING_ABI_SUFFIX + #define __PYX_MONITORING_ABI_SUFFIX +#endif +#if CYTHON_USE_TP_FINALIZE + #define __PYX_TP_FINALIZE_ABI_SUFFIX +#else + #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize" +#endif +#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED) + #define __PYX_FREELISTS_ABI_SUFFIX +#else + #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists" +#endif +#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." + /* Module declarations from "constraint.domain" */ /* #### Code section: typeinfo ### */ @@ -2193,21 +2272,23 @@ 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__16[] = "?"; +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_dict[] = "__dict__"; 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_super[] = "super"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_Domain[] = "Domain"; static const char __pyx_k_append[] = "append"; @@ -2218,21 +2299,24 @@ 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_init_subclass[] = "__init_subclass__"; 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__"; @@ -2243,7 +2327,9 @@ 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."; @@ -2256,9 +2342,19 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_2resetState(CYTHON_UNUSED static PyObject *__pyx_pf_10constraint_6domain_6Domain_4pushState(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10constraint_6domain_6Domain_8hideValue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop = {0, 0, 0, 0, 0}; /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ +/* SmallCodeConfig */ +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; @@ -2284,105 +2380,99 @@ typedef struct { #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif - #if CYTHON_USE_MODULE_STATE - #endif - PyObject *__pyx_kp_s_Class_used_to_control_possible_v; - PyObject *__pyx_n_s_Domain; - PyObject *__pyx_n_s_Domain___init; - PyObject *__pyx_n_s_Domain_hideValue; - PyObject *__pyx_n_s_Domain_popState; - PyObject *__pyx_n_s_Domain_pushState; - PyObject *__pyx_n_s_Domain_resetState; - PyObject *__pyx_kp_s_Helper_class_for_variable_defini; - PyObject *__pyx_n_s_ImportError; - PyObject *__pyx_n_s_Unassigned; - PyObject *__pyx_n_u_Unassigned; - PyObject *__pyx_n_s_Variable; - PyObject *__pyx_n_s_Variable___init; - PyObject *__pyx_n_s_Variable___repr; - PyObject *__pyx_n_s__16; - PyObject *__pyx_n_s_append; - PyObject *__pyx_n_s_asyncio_coroutines; - PyObject *__pyx_n_s_bool; - PyObject *__pyx_n_s_check_if_compiled; - PyObject *__pyx_n_s_cline_in_traceback; - PyObject *__pyx_n_s_constraint_domain; - PyObject *__pyx_kp_s_constraint_domain_py; - PyObject *__pyx_n_s_dict; - PyObject *__pyx_n_s_diff; - PyObject *__pyx_n_s_doc; - PyObject *__pyx_n_s_extend; - PyObject *__pyx_n_s_hidden; - PyObject *__pyx_n_s_hideValue; - PyObject *__pyx_n_s_init; - PyObject *__pyx_n_s_init_subclass; - PyObject *__pyx_n_s_is_coroutine; - PyObject *__pyx_n_s_main; - PyObject *__pyx_n_s_metaclass; - PyObject *__pyx_n_s_module; - PyObject *__pyx_n_s_mro_entries; - PyObject *__pyx_n_s_name; - PyObject *__pyx_n_s_name_2; - PyObject *__pyx_n_s_pop; - PyObject *__pyx_n_s_popState; - PyObject *__pyx_n_s_prepare; - PyObject *__pyx_n_s_pushState; - PyObject *__pyx_n_s_qualname; - PyObject *__pyx_n_s_remove; - PyObject *__pyx_n_s_repr; - PyObject *__pyx_n_s_resetState; - PyObject *__pyx_n_s_return; - PyObject *__pyx_n_s_self; - PyObject *__pyx_n_s_set; - PyObject *__pyx_n_s_set_name; - PyObject *__pyx_n_s_states; - PyObject *__pyx_n_s_super; - PyObject *__pyx_n_s_test; - PyObject *__pyx_n_s_value; - PyObject *__pyx_slice_; - PyObject *__pyx_tuple__3; - PyObject *__pyx_tuple__5; - PyObject *__pyx_tuple__7; - PyObject *__pyx_tuple__8; - PyObject *__pyx_tuple__12; - PyObject *__pyx_tuple__14; - PyObject *__pyx_codeobj__2; - PyObject *__pyx_codeobj__4; - PyObject *__pyx_codeobj__6; - PyObject *__pyx_codeobj__9; - PyObject *__pyx_codeobj__10; - PyObject *__pyx_codeobj__11; - PyObject *__pyx_codeobj__13; - PyObject *__pyx_codeobj__15; -} __pyx_mstate; - + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; + __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop; + PyObject *__pyx_slice[1]; + PyObject *__pyx_codeobj_tab[8]; + PyObject *__pyx_string_tab[50]; +/* #### Code section: module_state_contents ### */ +/* CachedMethodType.module_state_decls */ +#if CYTHON_COMPILING_IN_LIMITED_API +PyObject *__Pyx_CachedMethodType; +#endif + +/* CodeObjectCache.module_state_decls */ +struct __Pyx_CodeObjectCache __pyx_code_cache; + +/* #### Code section: module_state_end ### */ +} __pyx_mstatetype; + #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { - extern struct PyModuleDef __pyx_moduledef; +extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif -#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) - -#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) +#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef))) -#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) +#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef)) #else -static __pyx_mstate __pyx_mstate_global_static = +static __pyx_mstatetype __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif -static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; -#endif +static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### 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_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_diff __pyx_string_tab[22] +#define __pyx_n_u_doc __pyx_string_tab[23] +#define __pyx_n_u_extend __pyx_string_tab[24] +#define __pyx_n_u_func __pyx_string_tab[25] +#define __pyx_n_u_hidden __pyx_string_tab[26] +#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_states __pyx_string_tab[47] +#define __pyx_n_u_test __pyx_string_tab[48] +#define __pyx_n_u_value __pyx_string_tab[49] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE -static int __pyx_m_clear(PyObject *m) { - __pyx_mstate *clear_module_state = __pyx_mstate(m); +static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { + __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); @@ -2396,260 +2486,38 @@ static int __pyx_m_clear(PyObject *m) { #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif - Py_CLEAR(clear_module_state->__pyx_kp_s_Class_used_to_control_possible_v); - Py_CLEAR(clear_module_state->__pyx_n_s_Domain); - Py_CLEAR(clear_module_state->__pyx_n_s_Domain___init); - Py_CLEAR(clear_module_state->__pyx_n_s_Domain_hideValue); - Py_CLEAR(clear_module_state->__pyx_n_s_Domain_popState); - Py_CLEAR(clear_module_state->__pyx_n_s_Domain_pushState); - Py_CLEAR(clear_module_state->__pyx_n_s_Domain_resetState); - Py_CLEAR(clear_module_state->__pyx_kp_s_Helper_class_for_variable_defini); - Py_CLEAR(clear_module_state->__pyx_n_s_ImportError); - Py_CLEAR(clear_module_state->__pyx_n_s_Unassigned); - Py_CLEAR(clear_module_state->__pyx_n_u_Unassigned); - Py_CLEAR(clear_module_state->__pyx_n_s_Variable); - Py_CLEAR(clear_module_state->__pyx_n_s_Variable___init); - Py_CLEAR(clear_module_state->__pyx_n_s_Variable___repr); - Py_CLEAR(clear_module_state->__pyx_n_s__16); - Py_CLEAR(clear_module_state->__pyx_n_s_append); - Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); - Py_CLEAR(clear_module_state->__pyx_n_s_bool); - Py_CLEAR(clear_module_state->__pyx_n_s_check_if_compiled); - Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_domain); - Py_CLEAR(clear_module_state->__pyx_kp_s_constraint_domain_py); - Py_CLEAR(clear_module_state->__pyx_n_s_dict); - Py_CLEAR(clear_module_state->__pyx_n_s_diff); - Py_CLEAR(clear_module_state->__pyx_n_s_doc); - Py_CLEAR(clear_module_state->__pyx_n_s_extend); - Py_CLEAR(clear_module_state->__pyx_n_s_hidden); - Py_CLEAR(clear_module_state->__pyx_n_s_hideValue); - Py_CLEAR(clear_module_state->__pyx_n_s_init); - Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); - Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); - Py_CLEAR(clear_module_state->__pyx_n_s_main); - Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); - Py_CLEAR(clear_module_state->__pyx_n_s_module); - Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); - Py_CLEAR(clear_module_state->__pyx_n_s_name); - Py_CLEAR(clear_module_state->__pyx_n_s_name_2); - Py_CLEAR(clear_module_state->__pyx_n_s_pop); - Py_CLEAR(clear_module_state->__pyx_n_s_popState); - Py_CLEAR(clear_module_state->__pyx_n_s_prepare); - Py_CLEAR(clear_module_state->__pyx_n_s_pushState); - Py_CLEAR(clear_module_state->__pyx_n_s_qualname); - Py_CLEAR(clear_module_state->__pyx_n_s_remove); - Py_CLEAR(clear_module_state->__pyx_n_s_repr); - Py_CLEAR(clear_module_state->__pyx_n_s_resetState); - Py_CLEAR(clear_module_state->__pyx_n_s_return); - Py_CLEAR(clear_module_state->__pyx_n_s_self); - Py_CLEAR(clear_module_state->__pyx_n_s_set); - Py_CLEAR(clear_module_state->__pyx_n_s_set_name); - Py_CLEAR(clear_module_state->__pyx_n_s_states); - Py_CLEAR(clear_module_state->__pyx_n_s_super); - Py_CLEAR(clear_module_state->__pyx_n_s_test); - Py_CLEAR(clear_module_state->__pyx_n_s_value); - Py_CLEAR(clear_module_state->__pyx_slice_); - Py_CLEAR(clear_module_state->__pyx_tuple__3); - Py_CLEAR(clear_module_state->__pyx_tuple__5); - Py_CLEAR(clear_module_state->__pyx_tuple__7); - Py_CLEAR(clear_module_state->__pyx_tuple__8); - Py_CLEAR(clear_module_state->__pyx_tuple__12); - Py_CLEAR(clear_module_state->__pyx_tuple__14); - Py_CLEAR(clear_module_state->__pyx_codeobj__2); - Py_CLEAR(clear_module_state->__pyx_codeobj__4); - Py_CLEAR(clear_module_state->__pyx_codeobj__6); - Py_CLEAR(clear_module_state->__pyx_codeobj__9); - Py_CLEAR(clear_module_state->__pyx_codeobj__10); - Py_CLEAR(clear_module_state->__pyx_codeobj__11); - Py_CLEAR(clear_module_state->__pyx_codeobj__13); - Py_CLEAR(clear_module_state->__pyx_codeobj__15); + #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<50; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE -static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { - __pyx_mstate *traverse_module_state = __pyx_mstate(m); +static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); - Py_VISIT(traverse_module_state->__pyx_empty_tuple); - Py_VISIT(traverse_module_state->__pyx_empty_bytes); - Py_VISIT(traverse_module_state->__pyx_empty_unicode); + __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_kp_s_Class_used_to_control_possible_v); - Py_VISIT(traverse_module_state->__pyx_n_s_Domain); - Py_VISIT(traverse_module_state->__pyx_n_s_Domain___init); - Py_VISIT(traverse_module_state->__pyx_n_s_Domain_hideValue); - Py_VISIT(traverse_module_state->__pyx_n_s_Domain_popState); - Py_VISIT(traverse_module_state->__pyx_n_s_Domain_pushState); - Py_VISIT(traverse_module_state->__pyx_n_s_Domain_resetState); - Py_VISIT(traverse_module_state->__pyx_kp_s_Helper_class_for_variable_defini); - Py_VISIT(traverse_module_state->__pyx_n_s_ImportError); - Py_VISIT(traverse_module_state->__pyx_n_s_Unassigned); - Py_VISIT(traverse_module_state->__pyx_n_u_Unassigned); - Py_VISIT(traverse_module_state->__pyx_n_s_Variable); - Py_VISIT(traverse_module_state->__pyx_n_s_Variable___init); - Py_VISIT(traverse_module_state->__pyx_n_s_Variable___repr); - Py_VISIT(traverse_module_state->__pyx_n_s__16); - Py_VISIT(traverse_module_state->__pyx_n_s_append); - Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); - Py_VISIT(traverse_module_state->__pyx_n_s_bool); - Py_VISIT(traverse_module_state->__pyx_n_s_check_if_compiled); - Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_domain); - Py_VISIT(traverse_module_state->__pyx_kp_s_constraint_domain_py); - Py_VISIT(traverse_module_state->__pyx_n_s_dict); - Py_VISIT(traverse_module_state->__pyx_n_s_diff); - Py_VISIT(traverse_module_state->__pyx_n_s_doc); - Py_VISIT(traverse_module_state->__pyx_n_s_extend); - Py_VISIT(traverse_module_state->__pyx_n_s_hidden); - Py_VISIT(traverse_module_state->__pyx_n_s_hideValue); - Py_VISIT(traverse_module_state->__pyx_n_s_init); - Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); - Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); - Py_VISIT(traverse_module_state->__pyx_n_s_main); - Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); - Py_VISIT(traverse_module_state->__pyx_n_s_module); - Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); - Py_VISIT(traverse_module_state->__pyx_n_s_name); - Py_VISIT(traverse_module_state->__pyx_n_s_name_2); - Py_VISIT(traverse_module_state->__pyx_n_s_pop); - Py_VISIT(traverse_module_state->__pyx_n_s_popState); - Py_VISIT(traverse_module_state->__pyx_n_s_prepare); - Py_VISIT(traverse_module_state->__pyx_n_s_pushState); - Py_VISIT(traverse_module_state->__pyx_n_s_qualname); - Py_VISIT(traverse_module_state->__pyx_n_s_remove); - Py_VISIT(traverse_module_state->__pyx_n_s_repr); - Py_VISIT(traverse_module_state->__pyx_n_s_resetState); - Py_VISIT(traverse_module_state->__pyx_n_s_return); - Py_VISIT(traverse_module_state->__pyx_n_s_self); - Py_VISIT(traverse_module_state->__pyx_n_s_set); - Py_VISIT(traverse_module_state->__pyx_n_s_set_name); - Py_VISIT(traverse_module_state->__pyx_n_s_states); - Py_VISIT(traverse_module_state->__pyx_n_s_super); - Py_VISIT(traverse_module_state->__pyx_n_s_test); - Py_VISIT(traverse_module_state->__pyx_n_s_value); - Py_VISIT(traverse_module_state->__pyx_slice_); - Py_VISIT(traverse_module_state->__pyx_tuple__3); - Py_VISIT(traverse_module_state->__pyx_tuple__5); - Py_VISIT(traverse_module_state->__pyx_tuple__7); - Py_VISIT(traverse_module_state->__pyx_tuple__8); - Py_VISIT(traverse_module_state->__pyx_tuple__12); - Py_VISIT(traverse_module_state->__pyx_tuple__14); - Py_VISIT(traverse_module_state->__pyx_codeobj__2); - Py_VISIT(traverse_module_state->__pyx_codeobj__4); - Py_VISIT(traverse_module_state->__pyx_codeobj__6); - Py_VISIT(traverse_module_state->__pyx_codeobj__9); - Py_VISIT(traverse_module_state->__pyx_codeobj__10); - Py_VISIT(traverse_module_state->__pyx_codeobj__11); - Py_VISIT(traverse_module_state->__pyx_codeobj__13); - Py_VISIT(traverse_module_state->__pyx_codeobj__15); + 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<50; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } return 0; } #endif -/* #### Code section: module_state_defines ### */ -#define __pyx_d __pyx_mstate_global->__pyx_d -#define __pyx_b __pyx_mstate_global->__pyx_b -#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime -#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple -#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes -#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode -#ifdef __Pyx_CyFunction_USED -#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType -#endif -#ifdef __Pyx_FusedFunction_USED -#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType -#endif -#ifdef __Pyx_Generator_USED -#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType -#endif -#ifdef __Pyx_IterableCoroutine_USED -#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_kp_s_Class_used_to_control_possible_v __pyx_mstate_global->__pyx_kp_s_Class_used_to_control_possible_v -#define __pyx_n_s_Domain __pyx_mstate_global->__pyx_n_s_Domain -#define __pyx_n_s_Domain___init __pyx_mstate_global->__pyx_n_s_Domain___init -#define __pyx_n_s_Domain_hideValue __pyx_mstate_global->__pyx_n_s_Domain_hideValue -#define __pyx_n_s_Domain_popState __pyx_mstate_global->__pyx_n_s_Domain_popState -#define __pyx_n_s_Domain_pushState __pyx_mstate_global->__pyx_n_s_Domain_pushState -#define __pyx_n_s_Domain_resetState __pyx_mstate_global->__pyx_n_s_Domain_resetState -#define __pyx_kp_s_Helper_class_for_variable_defini __pyx_mstate_global->__pyx_kp_s_Helper_class_for_variable_defini -#define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError -#define __pyx_n_s_Unassigned __pyx_mstate_global->__pyx_n_s_Unassigned -#define __pyx_n_u_Unassigned __pyx_mstate_global->__pyx_n_u_Unassigned -#define __pyx_n_s_Variable __pyx_mstate_global->__pyx_n_s_Variable -#define __pyx_n_s_Variable___init __pyx_mstate_global->__pyx_n_s_Variable___init -#define __pyx_n_s_Variable___repr __pyx_mstate_global->__pyx_n_s_Variable___repr -#define __pyx_n_s__16 __pyx_mstate_global->__pyx_n_s__16 -#define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append -#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines -#define __pyx_n_s_bool __pyx_mstate_global->__pyx_n_s_bool -#define __pyx_n_s_check_if_compiled __pyx_mstate_global->__pyx_n_s_check_if_compiled -#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback -#define __pyx_n_s_constraint_domain __pyx_mstate_global->__pyx_n_s_constraint_domain -#define __pyx_kp_s_constraint_domain_py __pyx_mstate_global->__pyx_kp_s_constraint_domain_py -#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict -#define __pyx_n_s_diff __pyx_mstate_global->__pyx_n_s_diff -#define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc -#define __pyx_n_s_extend __pyx_mstate_global->__pyx_n_s_extend -#define __pyx_n_s_hidden __pyx_mstate_global->__pyx_n_s_hidden -#define __pyx_n_s_hideValue __pyx_mstate_global->__pyx_n_s_hideValue -#define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init -#define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass -#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine -#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main -#define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass -#define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module -#define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries -#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name -#define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 -#define __pyx_n_s_pop __pyx_mstate_global->__pyx_n_s_pop -#define __pyx_n_s_popState __pyx_mstate_global->__pyx_n_s_popState -#define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare -#define __pyx_n_s_pushState __pyx_mstate_global->__pyx_n_s_pushState -#define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname -#define __pyx_n_s_remove __pyx_mstate_global->__pyx_n_s_remove -#define __pyx_n_s_repr __pyx_mstate_global->__pyx_n_s_repr -#define __pyx_n_s_resetState __pyx_mstate_global->__pyx_n_s_resetState -#define __pyx_n_s_return __pyx_mstate_global->__pyx_n_s_return -#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self -#define __pyx_n_s_set __pyx_mstate_global->__pyx_n_s_set -#define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name -#define __pyx_n_s_states __pyx_mstate_global->__pyx_n_s_states -#define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super -#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test -#define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value -#define __pyx_slice_ __pyx_mstate_global->__pyx_slice_ -#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 -#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 -#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 -#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 -#define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 -#define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 -#define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2 -#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 -#define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 -#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 -#define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 -#define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 -#define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 -#define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 /* #### Code section: module_code ### */ /* "constraint/domain.py":4 @@ -2658,7 +2526,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { * def check_if_compiled() -> bool: # <<<<<<<<<<<<<< * """Check if this code has been compiled with Cython. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6domain_1check_if_compiled(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ @@ -2683,7 +2551,7 @@ static PyObject *__pyx_pf_10constraint_6domain_check_if_compiled(CYTHON_UNUSED P PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("check_if_compiled", 1); + __Pyx_RefNannySetupContext("check_if_compiled", 0); /* "constraint/domain.py":10 * bool: whether the code has been compiled. @@ -2691,7 +2559,7 @@ static PyObject *__pyx_pf_10constraint_6domain_check_if_compiled(CYTHON_UNUSED P * try: # <<<<<<<<<<<<<< * from cython import compiled * - */ +*/ { (void)__pyx_t_1; (void)__pyx_t_2; (void)__pyx_t_3; /* mark used */ /*try:*/ { @@ -2702,7 +2570,7 @@ static PyObject *__pyx_pf_10constraint_6domain_check_if_compiled(CYTHON_UNUSED P * return compiled # <<<<<<<<<<<<<< * except ImportError or ModuleNotFoundError: * return False - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; @@ -2714,7 +2582,7 @@ static PyObject *__pyx_pf_10constraint_6domain_check_if_compiled(CYTHON_UNUSED P * try: # <<<<<<<<<<<<<< * from cython import compiled * - */ +*/ } __pyx_L7_try_return:; goto __pyx_L0; @@ -2726,7 +2594,7 @@ static PyObject *__pyx_pf_10constraint_6domain_check_if_compiled(CYTHON_UNUSED P * def check_if_compiled() -> bool: # <<<<<<<<<<<<<< * """Check if this code has been compiled with Cython. * - */ +*/ /* function exit code */ __pyx_L0:; @@ -2741,7 +2609,7 @@ static PyObject *__pyx_pf_10constraint_6domain_check_if_compiled(CYTHON_UNUSED P * def __init__(self, name): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6domain_8Variable_1__init__(PyObject *__pyx_self, @@ -2752,7 +2620,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_6domain_8Variable___init__, "Initialization method.\n\n Args:\n name (string): Generic variable name for problem-specific\n purposes\n "); -static PyMethodDef __pyx_mdef_10constraint_6domain_8Variable_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6domain_8Variable_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6domain_8Variable___init__}; +static PyMethodDef __pyx_mdef_10constraint_6domain_8Variable_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6domain_8Variable_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6domain_8Variable___init__}; static PyObject *__pyx_pw_10constraint_6domain_8Variable_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -2774,7 +2642,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -2782,46 +2650,34 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + 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) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 30, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 30, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 30, __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) } __pyx_v_self = values[0]; __pyx_v_name = values[1]; @@ -2832,11 +2688,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.domain.Variable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2845,11 +2698,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_6domain_8Variable___init__(__pyx_self, __pyx_v_self, __pyx_v_name); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -2861,7 +2711,7 @@ static PyObject *__pyx_pf_10constraint_6domain_8Variable___init__(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/domain.py":37 * purposes @@ -2869,8 +2719,8 @@ static PyObject *__pyx_pf_10constraint_6domain_8Variable___init__(CYTHON_UNUSED * self.name = name # <<<<<<<<<<<<<< * * def __repr__(self): - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_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 * """ @@ -2878,7 +2728,7 @@ static PyObject *__pyx_pf_10constraint_6domain_8Variable___init__(CYTHON_UNUSED * def __init__(self, name): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -2898,7 +2748,7 @@ static PyObject *__pyx_pf_10constraint_6domain_8Variable___init__(CYTHON_UNUSED * def __repr__(self): # <<<<<<<<<<<<<< * """Represents itself with the name attribute.""" * return self.name - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6domain_8Variable_3__repr__(PyObject *__pyx_self, @@ -2909,7 +2759,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_6domain_8Variable_2__repr__, "Represents itself with the name attribute."); -static PyMethodDef __pyx_mdef_10constraint_6domain_8Variable_3__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6domain_8Variable_3__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6domain_8Variable_2__repr__}; +static PyMethodDef __pyx_mdef_10constraint_6domain_8Variable_3__repr__ = {"__repr__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6domain_8Variable_3__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6domain_8Variable_2__repr__}; static PyObject *__pyx_pw_10constraint_6domain_8Variable_3__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -2930,7 +2780,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -2938,33 +2788,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 39, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(0, 39, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 39, __pyx_L3_error) } __pyx_v_self = values[0]; } @@ -2974,11 +2819,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.domain.Variable.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2987,11 +2829,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_6domain_8Variable_2__repr__(__pyx_self, __pyx_v_self); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -3004,7 +2843,7 @@ static PyObject *__pyx_pf_10constraint_6domain_8Variable_2__repr__(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__repr__", 1); + __Pyx_RefNannySetupContext("__repr__", 0); /* "constraint/domain.py":41 * def __repr__(self): @@ -3012,9 +2851,9 @@ static PyObject *__pyx_pf_10constraint_6domain_8Variable_2__repr__(CYTHON_UNUSED * return self.name # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); 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_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3026,7 +2865,7 @@ static PyObject *__pyx_pf_10constraint_6domain_8Variable_2__repr__(CYTHON_UNUSED * def __repr__(self): # <<<<<<<<<<<<<< * """Represents itself with the name attribute.""" * return self.name - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -3045,7 +2884,7 @@ static PyObject *__pyx_pf_10constraint_6domain_8Variable_2__repr__(CYTHON_UNUSED * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6domain_6Domain_1__init__(PyObject *__pyx_self, @@ -3056,7 +2895,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_6domain_6Domain___init__, "Initialization method.\n\n Args:\n set: Set of values, comparable by equality, that the given variables may assume.\n "); -static PyMethodDef __pyx_mdef_10constraint_6domain_6Domain_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6domain_6Domain_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6domain_6Domain___init__}; +static PyMethodDef __pyx_mdef_10constraint_6domain_6Domain_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6domain_6Domain_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6domain_6Domain___init__}; static PyObject *__pyx_pw_10constraint_6domain_6Domain_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3078,7 +2917,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -3086,46 +2925,34 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_set,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 59, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 59, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_set)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 59, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 59, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 59, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 59, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_set = values[1]; @@ -3136,11 +2963,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.domain.Domain.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3149,11 +2973,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_6domain_6Domain___init__(__pyx_self, __pyx_v_self, __pyx_v_set); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -3164,12 +2985,11 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain___init__(CYTHON_UNUSED Py __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; + size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/domain.py":65 * set: Set of values, comparable by equality, that the given variables may assume. @@ -3177,30 +2997,16 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain___init__(CYTHON_UNUSED Py * list.__init__(self, set) # <<<<<<<<<<<<<< * self._hidden = [] * self._states = [] - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyList_Type)), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + __pyx_t_2 = ((PyObject *)(&PyList_Type)); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_self, __pyx_v_set}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __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_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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3210,10 +3016,10 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain___init__(CYTHON_UNUSED Py * self._hidden = [] # <<<<<<<<<<<<<< * self._states = [] * - */ +*/ __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_n_s_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 @@ -3222,10 +3028,10 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain___init__(CYTHON_UNUSED Py * self._states = [] # <<<<<<<<<<<<<< * * def resetState(self): - */ +*/ __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_n_s_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 @@ -3234,7 +3040,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain___init__(CYTHON_UNUSED Py * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -3242,7 +3048,6 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain___init__(CYTHON_UNUSED Py __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("constraint.domain.Domain.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -3257,7 +3062,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain___init__(CYTHON_UNUSED Py * def resetState(self): # <<<<<<<<<<<<<< * """Reset to the original domain state, including all possible values.""" * self.extend(self._hidden) - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6domain_6Domain_3resetState(PyObject *__pyx_self, @@ -3268,7 +3073,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_6domain_6Domain_2resetState, "Reset to the original domain state, including all possible values."); -static PyMethodDef __pyx_mdef_10constraint_6domain_6Domain_3resetState = {"resetState", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6domain_6Domain_3resetState, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6domain_6Domain_2resetState}; +static PyMethodDef __pyx_mdef_10constraint_6domain_6Domain_3resetState = {"resetState", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6domain_6Domain_3resetState, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6domain_6Domain_2resetState}; static PyObject *__pyx_pw_10constraint_6domain_6Domain_3resetState(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3289,7 +3094,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("resetState (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -3297,33 +3102,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 69, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "resetState") < 0)) __PYX_ERR(0, 69, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 69, __pyx_L3_error) } __pyx_v_self = values[0]; } @@ -3333,11 +3133,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.domain.Domain.resetState", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3346,11 +3143,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_6domain_6Domain_2resetState(__pyx_self, __pyx_v_self); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -3362,12 +3156,11 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_2resetState(CYTHON_UNUSED PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - unsigned int __pyx_t_5; + size_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("resetState", 1); + __Pyx_RefNannySetupContext("resetState", 0); /* "constraint/domain.py":71 * def resetState(self): @@ -3375,33 +3168,19 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_2resetState(CYTHON_UNUSED * self.extend(self._hidden) # <<<<<<<<<<<<<< * del self._hidden[:] * del self._states[:] - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hidden); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error) +*/ + __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_hidden); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } - } - #endif + __pyx_t_4 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __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_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) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3411,10 +3190,10 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_2resetState(CYTHON_UNUSED * del self._hidden[:] # <<<<<<<<<<<<<< * del self._states[:] * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hidden); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) +*/ + __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_slice_, 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 @@ -3423,10 +3202,10 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_2resetState(CYTHON_UNUSED * del self._states[:] # <<<<<<<<<<<<<< * * def pushState(self): - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) +*/ + __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_slice_, 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 @@ -3435,7 +3214,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_2resetState(CYTHON_UNUSED * def resetState(self): # <<<<<<<<<<<<<< * """Reset to the original domain state, including all possible values.""" * self.extend(self._hidden) - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -3444,7 +3223,6 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_2resetState(CYTHON_UNUSED __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("constraint.domain.Domain.resetState", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -3459,7 +3237,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_2resetState(CYTHON_UNUSED * def pushState(self): # <<<<<<<<<<<<<< * """Save current domain state. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6domain_6Domain_5pushState(PyObject *__pyx_self, @@ -3470,7 +3248,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_6domain_6Domain_4pushState, "Save current domain state.\n\n Variables hidden after that call are restored when that state is popped from the stack.\n "); -static PyMethodDef __pyx_mdef_10constraint_6domain_6Domain_5pushState = {"pushState", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6domain_6Domain_5pushState, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6domain_6Domain_4pushState}; +static PyMethodDef __pyx_mdef_10constraint_6domain_6Domain_5pushState = {"pushState", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6domain_6Domain_5pushState, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6domain_6Domain_4pushState}; static PyObject *__pyx_pw_10constraint_6domain_6Domain_5pushState(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3491,7 +3269,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pushState (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -3499,33 +3277,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 75, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "pushState") < 0)) __PYX_ERR(0, 75, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 75, __pyx_L3_error) } __pyx_v_self = values[0]; } @@ -3535,11 +3308,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.domain.Domain.pushState", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3548,11 +3318,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_6domain_6Domain_4pushState(__pyx_self, __pyx_v_self); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -3568,7 +3335,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_4pushState(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("pushState", 1); + __Pyx_RefNannySetupContext("pushState", 0); /* "constraint/domain.py":80 * Variables hidden after that call are restored when that state is popped from the stack. @@ -3576,11 +3343,11 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_4pushState(CYTHON_UNUSED * self._states.append(len(self)) # <<<<<<<<<<<<<< * * def popState(self): - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 80, __pyx_L1_error) - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_3 = PyLong_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3592,7 +3359,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_4pushState(CYTHON_UNUSED * def pushState(self): # <<<<<<<<<<<<<< * """Save current domain state. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -3614,7 +3381,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_4pushState(CYTHON_UNUSED * def popState(self): # <<<<<<<<<<<<<< * """Restore domain state from the top of the stack. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6domain_6Domain_7popState(PyObject *__pyx_self, @@ -3625,7 +3392,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_6domain_6Domain_6popState, "Restore domain state from the top of the stack.\n\n Variables hidden since the last popped state are then available again.\n "); -static PyMethodDef __pyx_mdef_10constraint_6domain_6Domain_7popState = {"popState", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6domain_6Domain_7popState, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6domain_6Domain_6popState}; +static PyMethodDef __pyx_mdef_10constraint_6domain_6Domain_7popState = {"popState", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6domain_6Domain_7popState, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6domain_6Domain_6popState}; static PyObject *__pyx_pw_10constraint_6domain_6Domain_7popState(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3646,7 +3413,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("popState (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -3654,33 +3421,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 82, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "popState") < 0)) __PYX_ERR(0, 82, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 82, __pyx_L3_error) } __pyx_v_self = values[0]; } @@ -3690,11 +3452,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.domain.Domain.popState", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3703,11 +3462,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_6domain_6Domain_6popState(__pyx_self, __pyx_v_self); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -3724,11 +3480,11 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED P int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; - unsigned int __pyx_t_8; + size_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("popState", 1); + __Pyx_RefNannySetupContext("popState", 0); /* "constraint/domain.py":87 * Variables hidden since the last popped state are then available again. @@ -3736,14 +3492,14 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED P * diff = self._states.pop() - len(self) # <<<<<<<<<<<<<< * if diff: * self.extend(self._hidden[-diff:]) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Pop(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 87, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -3758,7 +3514,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED P * if diff: # <<<<<<<<<<<<<< * self.extend(self._hidden[-diff:]) * del self._hidden[-diff:] - */ +*/ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_diff); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 88, __pyx_L1_error) if (__pyx_t_5) { @@ -3768,10 +3524,10 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED P * self.extend(self._hidden[-diff:]) # <<<<<<<<<<<<<< * del self._hidden[-diff:] * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extend); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hidden); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) +*/ + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_hidden); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyNumber_Negative(__pyx_v_diff); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); @@ -3779,28 +3535,14 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED P __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = NULL; __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_8 = 1; - } - } - #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 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_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) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -3810,14 +3552,14 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED P * del self._hidden[-diff:] # <<<<<<<<<<<<<< * * def hideValue(self, value): - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hidden); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_hidden); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_Negative(__pyx_v_diff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_DelSlice(__pyx_t_4, 0, 0, &__pyx_t_1, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 90, __pyx_L1_error) + __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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "constraint/domain.py":88 * """ @@ -3825,7 +3567,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED P * if diff: # <<<<<<<<<<<<<< * self.extend(self._hidden[-diff:]) * del self._hidden[-diff:] - */ +*/ } /* "constraint/domain.py":82 @@ -3834,7 +3576,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED P * def popState(self): # <<<<<<<<<<<<<< * """Restore domain state from the top of the stack. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -3860,7 +3602,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED P * def hideValue(self, value): # <<<<<<<<<<<<<< * """Hide the given value from the domain. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6domain_6Domain_9hideValue(PyObject *__pyx_self, @@ -3871,7 +3613,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_6domain_6Domain_8hideValue, "Hide the given value from the domain.\n\n After that call the given value won't be seen as a possible value on that domain anymore.\n The hidden value will be restored when the previous saved state is popped.\n\n Args:\n value: Object currently available in the domain\n "); -static PyMethodDef __pyx_mdef_10constraint_6domain_6Domain_9hideValue = {"hideValue", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6domain_6Domain_9hideValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6domain_6Domain_8hideValue}; +static PyMethodDef __pyx_mdef_10constraint_6domain_6Domain_9hideValue = {"hideValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6domain_6Domain_9hideValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6domain_6Domain_8hideValue}; static PyObject *__pyx_pw_10constraint_6domain_6Domain_9hideValue(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3893,7 +3635,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hideValue (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -3901,46 +3643,34 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 92, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 92, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("hideValue", 1, 2, 2, 1); __PYX_ERR(0, 92, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "hideValue") < 0)) __PYX_ERR(0, 92, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 92, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 92, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_value = values[1]; @@ -3951,11 +3681,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.domain.Domain.hideValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3964,11 +3691,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_6domain_6Domain_8hideValue(__pyx_self, __pyx_v_self, __pyx_v_value); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -3979,43 +3703,28 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_8hideValue(CYTHON_UNUSED __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; - int __pyx_t_5; + size_t __pyx_t_3; + int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("hideValue", 1); + __Pyx_RefNannySetupContext("hideValue", 0); /* "constraint/domain.py":101 * value: Object currently available in the domain * """ * list.remove(self, value) # <<<<<<<<<<<<<< * self._hidden.append(value) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyList_Type)), __pyx_n_s_remove); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + __pyx_t_2 = ((PyObject *)(&PyList_Type)); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_self, __pyx_v_value}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __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_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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4023,10 +3732,10 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_8hideValue(CYTHON_UNUSED * """ * list.remove(self, value) * self._hidden.append(value) # <<<<<<<<<<<<<< - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hidden); 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_hidden); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_value); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_value); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/domain.py":92 @@ -4035,7 +3744,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_8hideValue(CYTHON_UNUSED * def hideValue(self, value): # <<<<<<<<<<<<<< * """Hide the given value from the domain. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -4043,7 +3752,6 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_8hideValue(CYTHON_UNUSED __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("constraint.domain.Domain.hideValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -4051,299 +3759,104 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_8hideValue(CYTHON_UNUSED __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* #### Code section: module_exttypes ### */ static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; -#ifndef CYTHON_SMALL_CODE -#if defined(__clang__) - #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) -#else - #define CYTHON_SMALL_CODE -#endif -#endif -/* #### Code section: pystring_table ### */ +/* #### Code section: initfunc_declarations ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/ +/* #### Code section: init_module ### */ -static int __Pyx_CreateStringTabAndInitStrings(void) { - __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_Class_used_to_control_possible_v, __pyx_k_Class_used_to_control_possible_v, sizeof(__pyx_k_Class_used_to_control_possible_v), 0, 0, 1, 0}, - {&__pyx_n_s_Domain, __pyx_k_Domain, sizeof(__pyx_k_Domain), 0, 0, 1, 1}, - {&__pyx_n_s_Domain___init, __pyx_k_Domain___init, sizeof(__pyx_k_Domain___init), 0, 0, 1, 1}, - {&__pyx_n_s_Domain_hideValue, __pyx_k_Domain_hideValue, sizeof(__pyx_k_Domain_hideValue), 0, 0, 1, 1}, - {&__pyx_n_s_Domain_popState, __pyx_k_Domain_popState, sizeof(__pyx_k_Domain_popState), 0, 0, 1, 1}, - {&__pyx_n_s_Domain_pushState, __pyx_k_Domain_pushState, sizeof(__pyx_k_Domain_pushState), 0, 0, 1, 1}, - {&__pyx_n_s_Domain_resetState, __pyx_k_Domain_resetState, sizeof(__pyx_k_Domain_resetState), 0, 0, 1, 1}, - {&__pyx_kp_s_Helper_class_for_variable_defini, __pyx_k_Helper_class_for_variable_defini, sizeof(__pyx_k_Helper_class_for_variable_defini), 0, 0, 1, 0}, - {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, - {&__pyx_n_s_Unassigned, __pyx_k_Unassigned, sizeof(__pyx_k_Unassigned), 0, 0, 1, 1}, - {&__pyx_n_u_Unassigned, __pyx_k_Unassigned, sizeof(__pyx_k_Unassigned), 0, 1, 0, 1}, - {&__pyx_n_s_Variable, __pyx_k_Variable, sizeof(__pyx_k_Variable), 0, 0, 1, 1}, - {&__pyx_n_s_Variable___init, __pyx_k_Variable___init, sizeof(__pyx_k_Variable___init), 0, 0, 1, 1}, - {&__pyx_n_s_Variable___repr, __pyx_k_Variable___repr, sizeof(__pyx_k_Variable___repr), 0, 0, 1, 1}, - {&__pyx_n_s__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 1, 1}, - {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, - {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, - {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, - {&__pyx_n_s_check_if_compiled, __pyx_k_check_if_compiled, sizeof(__pyx_k_check_if_compiled), 0, 0, 1, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_domain, __pyx_k_constraint_domain, sizeof(__pyx_k_constraint_domain), 0, 0, 1, 1}, - {&__pyx_kp_s_constraint_domain_py, __pyx_k_constraint_domain_py, sizeof(__pyx_k_constraint_domain_py), 0, 0, 1, 0}, - {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, - {&__pyx_n_s_diff, __pyx_k_diff, sizeof(__pyx_k_diff), 0, 0, 1, 1}, - {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, - {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1}, - {&__pyx_n_s_hidden, __pyx_k_hidden, sizeof(__pyx_k_hidden), 0, 0, 1, 1}, - {&__pyx_n_s_hideValue, __pyx_k_hideValue, sizeof(__pyx_k_hideValue), 0, 0, 1, 1}, - {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, - {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, - {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, - {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, - {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, - {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, - {&__pyx_n_s_popState, __pyx_k_popState, sizeof(__pyx_k_popState), 0, 0, 1, 1}, - {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, - {&__pyx_n_s_pushState, __pyx_k_pushState, sizeof(__pyx_k_pushState), 0, 0, 1, 1}, - {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, - {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, - {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, - {&__pyx_n_s_resetState, __pyx_k_resetState, sizeof(__pyx_k_resetState), 0, 0, 1, 1}, - {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1}, - {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, - {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1}, - {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, - {&__pyx_n_s_states, __pyx_k_states, sizeof(__pyx_k_states), 0, 0, 1, 1}, - {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} - }; - return __Pyx_InitStrings(__pyx_string_tab); +static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; } -/* #### Code section: cached_builtins ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 14, __pyx_L1_error) + +static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); return 0; - __pyx_L1_error:; - return -1; } -/* #### Code section: cached_constants ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { +static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} - /* "constraint/domain.py":72 - * """Reset to the original domain state, including all possible values.""" - * self.extend(self._hidden) - * del self._hidden[:] # <<<<<<<<<<<<<< - * del self._states[:] - * - */ - __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 72, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice_); - __Pyx_GIVEREF(__pyx_slice_); +static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} - /* "constraint/domain.py":4 - * - * - * def check_if_compiled() -> bool: # <<<<<<<<<<<<<< - * """Check if this code has been compiled with Cython. - * - */ - __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_domain_py, __pyx_n_s_check_if_compiled, 4, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 4, __pyx_L1_error) +static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} - /* "constraint/domain.py":30 - * """ - * - * def __init__(self, name): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_domain_py, __pyx_n_s_init, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 30, __pyx_L1_error) +static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} - /* "constraint/domain.py":39 - * self.name = name - * - * def __repr__(self): # <<<<<<<<<<<<<< - * """Represents itself with the name attribute.""" - * return self.name - */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_domain_py, __pyx_n_s_repr, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 39, __pyx_L1_error) +static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} - /* "constraint/domain.py":44 - * - * - * Unassigned = Variable("Unassigned") #: Helper object instance representing unassigned values # <<<<<<<<<<<<<< - * - * - */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_u_Unassigned); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - - /* "constraint/domain.py":59 - * """ - * - * def __init__(self, set): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_set); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_domain_py, __pyx_n_s_init, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 59, __pyx_L1_error) - - /* "constraint/domain.py":69 - * self._states = [] - * - * def resetState(self): # <<<<<<<<<<<<<< - * """Reset to the original domain state, including all possible values.""" - * self.extend(self._hidden) - */ - __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_domain_py, __pyx_n_s_resetState, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 69, __pyx_L1_error) - - /* "constraint/domain.py":75 - * del self._states[:] - * - * def pushState(self): # <<<<<<<<<<<<<< - * """Save current domain state. - * - */ - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_domain_py, __pyx_n_s_pushState, 75, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 75, __pyx_L1_error) - - /* "constraint/domain.py":82 - * self._states.append(len(self)) - * - * def popState(self): # <<<<<<<<<<<<<< - * """Restore domain state from the top of the stack. - * - */ - __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_diff); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 82, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_domain_py, __pyx_n_s_popState, 82, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 82, __pyx_L1_error) - - /* "constraint/domain.py":92 - * del self._hidden[-diff:] - * - * def hideValue(self, value): # <<<<<<<<<<<<<< - * """Hide the given value from the domain. - * - */ - __pyx_tuple__14 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 92, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_domain_py, __pyx_n_s_hideValue, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 92, __pyx_L1_error) - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} -/* #### Code section: init_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { - __pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type; - __pyx_umethod_PyList_Type_pop.method_name = &__pyx_n_s_pop; - if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_globals ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - return 0; -} -/* #### Code section: init_module ### */ - -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ - -static int __Pyx_modinit_global_init_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); - /*--- Global init code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_variable_export_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); - /*--- Variable export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_function_export_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); - /*--- Function export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_type_init_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); - /*--- Type init code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_type_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); - /*--- Type import code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_variable_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); - /*--- Variable import code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_function_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); - /*--- Function import code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - - -#if PY_MAJOR_VERSION >= 3 -#if CYTHON_PEP489_MULTI_PHASE_INIT -static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ -static int __pyx_pymod_exec_domain(PyObject* module); /*proto*/ -static PyModuleDef_Slot __pyx_moduledef_slots[] = { - {Py_mod_create, (void*)__pyx_pymod_create}, - {Py_mod_exec, (void*)__pyx_pymod_exec_domain}, - {0, NULL} -}; -#endif +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_domain(PyObject* module); /*proto*/ +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}, + #endif + #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE + {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED}, + #endif + {0, NULL} +}; +#endif #ifdef __cplusplus namespace { @@ -4355,12 +3868,10 @@ namespace { PyModuleDef_HEAD_INIT, "domain", __pyx_k_Module_containing_the_code_for_t, /* m_doc */ - #if CYTHON_PEP489_MULTI_PHASE_INIT - 0, /* m_size */ - #elif CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstate), /* m_size */ + #if CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstatetype), /* m_size */ #else - -1, /* m_size */ + (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT @@ -4381,51 +3892,71 @@ namespace { #ifdef __cplusplus } /* anonymous namespace */ #endif -#endif +/* PyModInitFuncType */ #ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#elif PY_MAJOR_VERSION < 3 -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" void + #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #else -#define __Pyx_PyMODINIT_FUNC void -#endif -#else -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * -#else -#define __Pyx_PyMODINIT_FUNC PyObject * -#endif + #ifdef __cplusplus + #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * + #else + #define __Pyx_PyMODINIT_FUNC PyObject * + #endif #endif - -#if PY_MAJOR_VERSION < 3 -__Pyx_PyMODINIT_FUNC initdomain(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC initdomain(void) -#else __Pyx_PyMODINIT_FUNC PyInit_domain(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_domain(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } +/* ModuleCreationPEP489 */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 +static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { + { + PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think + if (!module) { + PyErr_Clear(); // just try the 3.8-3.12 version + module = PyImport_ImportModule("_xxsubinterpreters"); + if (!module) goto bad; + } + PyObject *current = PyObject_CallMethod(module, "get_current", NULL); + Py_DECREF(module); + if (!current) goto bad; + if (PyTuple_Check(current)) { + PyObject *new_current = PySequence_GetItem(current, 0); + Py_DECREF(current); + current = new_current; + if (!new_current) goto bad; + } + long long as_c_int = PyLong_AsLongLong(current); + Py_DECREF(current); + return as_c_int; + } + bad: + PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n"); + return -1; +} +#endif +#if !CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; +#if 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 + PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId(); +#else PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); +#endif + if (unlikely(current_id == -1)) { + return -1; + } if (main_interpreter_id == -1) { main_interpreter_id = current_id; - return (unlikely(current_id == -1)) ? -1 : 0; - } else if (unlikely(main_interpreter_id != current_id)) - #else - static PyInterpreterState *main_interpreter = NULL; - PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; - if (!main_interpreter) { - main_interpreter = current_interpreter; - } else if (unlikely(main_interpreter != current_interpreter)) - #endif - { + return 0; + } else if (unlikely(main_interpreter_id != current_id)) { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); @@ -4433,21 +3964,14 @@ static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { } return 0; } -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) -#else -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { -#if CYTHON_COMPILING_IN_LIMITED_API - result = PyModule_AddObject(module, to_name, value); -#else result = PyDict_SetItemString(moddict, to_name, value); -#endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { @@ -4460,8 +3984,10 @@ static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); + #if !CYTHON_USE_MODULE_STATE if (__Pyx_check_single_interpreter()) return NULL; + #endif if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); @@ -4469,12 +3995,8 @@ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDe module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; -#if CYTHON_COMPILING_IN_LIMITED_API - moddict = module; -#else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; -#endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; @@ -4488,17 +4010,18 @@ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDe static CYTHON_SMALL_CODE int __pyx_pymod_exec_domain(PyObject *__pyx_pyinit_module) #endif -#endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif + __pyx_mstatetype *__pyx_mstate = NULL; 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_5; + PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -4509,36 +4032,37 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_domain(PyObject *__pyx_pyinit_modu PyErr_SetString(PyExc_RuntimeError, "Module 'domain' has already been imported. Re-initialisation is not supported."); return -1; } - #elif PY_MAJOR_VERSION >= 3 + #else if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_m = __pyx_pyinit_module; - Py_INCREF(__pyx_m); + __pyx_t_1 = __pyx_pyinit_module; + Py_INCREF(__pyx_t_1); #else - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("domain", __pyx_methods, __pyx_k_Module_containing_the_code_for_t, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #if CYTHON_USE_MODULE_STATE { - int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "domain" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_m = __pyx_t_1; #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED); #endif + __pyx_mstate = __pyx_mstate_global; CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_mstate->__pyx_d); + __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + 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) { @@ -4548,14 +4072,15 @@ if (!__Pyx_RefNanny) { Py_FatalError("failed to import 'refnanny' module"); } #endif - __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_domain(void)", 0); + +__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(); #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __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) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif @@ -4571,48 +4096,34 @@ if (!__Pyx_RefNanny) { #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - PyEval_InitThreads(); - #endif /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants() < 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 PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif if (__pyx_module_is_main_constraint__domain) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_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) } - #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "constraint.domain")) { if (unlikely((PyDict_SetItemString(modules, "constraint.domain", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } - #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 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() < 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(); - (void)__Pyx_modinit_variable_export_code(); - (void)__Pyx_modinit_function_export_code(); - (void)__Pyx_modinit_type_init_code(); - (void)__Pyx_modinit_type_import_code(); - (void)__Pyx_modinit_variable_import_code(); - (void)__Pyx_modinit_function_import_code(); + (void)__Pyx_modinit_global_init_code(__pyx_mstate); + (void)__Pyx_modinit_variable_export_code(__pyx_mstate); + (void)__Pyx_modinit_function_export_code(__pyx_mstate); + (void)__Pyx_modinit_type_init_code(__pyx_mstate); + (void)__Pyx_modinit_type_import_code(__pyx_mstate); + (void)__Pyx_modinit_variable_import_code(__pyx_mstate); + (void)__Pyx_modinit_function_import_code(__pyx_mstate); /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /* "constraint/domain.py":4 * @@ -4620,15 +4131,15 @@ if (!__Pyx_RefNanny) { * def check_if_compiled() -> bool: # <<<<<<<<<<<<<< * """Check if this code has been compiled with Cython. * - */ +*/ __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_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 4, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_1check_if_compiled, 0, __pyx_n_s_check_if_compiled, NULL, __pyx_n_s_constraint_domain, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_3)) __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); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_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 @@ -4637,8 +4148,8 @@ if (!__Pyx_RefNanny) { * class Variable: # <<<<<<<<<<<<<< * """Helper class for variable definition. * - */ - __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Variable, __pyx_n_s_Variable, (PyObject *) NULL, __pyx_n_s_constraint_domain, __pyx_kp_s_Helper_class_for_variable_defini); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_Variable, __pyx_mstate_global->__pyx_n_u_Variable, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_mstate_global->__pyx_kp_u_Helper_class_for_variable_defini); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "constraint/domain.py":30 @@ -4647,10 +4158,10 @@ if (!__Pyx_RefNanny) { * def __init__(self, name): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_8Variable_1__init__, 0, __pyx_n_s_Variable___init, NULL, __pyx_n_s_constraint_domain, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) +*/ + __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_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + 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 @@ -4659,10 +4170,10 @@ if (!__Pyx_RefNanny) { * def __repr__(self): # <<<<<<<<<<<<<< * """Represents itself with the name attribute.""" * return self.name - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_8Variable_3__repr__, 0, __pyx_n_s_Variable___repr, NULL, __pyx_n_s_constraint_domain, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) +*/ + __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_n_s_repr, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + 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 @@ -4671,10 +4182,10 @@ if (!__Pyx_RefNanny) { * class Variable: # <<<<<<<<<<<<<< * """Helper class for variable definition. * - */ - __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Variable, __pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) +*/ + __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_d, __pyx_n_s_Variable, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + 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; @@ -4684,14 +4195,21 @@ if (!__Pyx_RefNanny) { * Unassigned = Variable("Unassigned") #: Helper object instance representing unassigned values # <<<<<<<<<<<<<< * * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); +*/ + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __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_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) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Unassigned, __pyx_t_2) < 0) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/domain.py":52 * @@ -4699,22 +4217,19 @@ if (!__Pyx_RefNanny) { * class Domain(list): # <<<<<<<<<<<<<< * """Class used to control possible values for variables. * - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF((PyObject *)(&PyList_Type)); - __Pyx_GIVEREF((PyObject *)(&PyList_Type)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyList_Type)))) __PYX_ERR(0, 52, __pyx_L1_error); - __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) +*/ + __pyx_t_3 = PyTuple_Pack(1, ((PyObject *)(&PyList_Type))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __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, 52, __pyx_L1_error) + __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_n_s_Domain, __pyx_n_s_Domain, (PyObject *) NULL, __pyx_n_s_constraint_domain, __pyx_kp_s_Class_used_to_control_possible_v); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3 != __pyx_t_2) { - if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_Domain, __pyx_mstate_global->__pyx_n_u_Domain, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_mstate_global->__pyx_kp_u_Class_used_to_control_possible_v); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4 != __pyx_t_3) { + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 52, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/domain.py":59 * """ @@ -4722,11 +4237,11 @@ if (!__Pyx_RefNanny) { * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_6Domain_1__init__, 0, __pyx_n_s_Domain___init, NULL, __pyx_n_s_constraint_domain, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 59, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/domain.py":69 * self._states = [] @@ -4734,11 +4249,11 @@ if (!__Pyx_RefNanny) { * def resetState(self): # <<<<<<<<<<<<<< * """Reset to the original domain state, including all possible values.""" * self.extend(self._hidden) - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_6Domain_3resetState, 0, __pyx_n_s_Domain_resetState, NULL, __pyx_n_s_constraint_domain, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_resetState, __pyx_t_2) < 0) __PYX_ERR(0, 69, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/domain.py":75 * del self._states[:] @@ -4746,11 +4261,11 @@ if (!__Pyx_RefNanny) { * def pushState(self): # <<<<<<<<<<<<<< * """Save current domain state. * - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_6Domain_5pushState, 0, __pyx_n_s_Domain_pushState, NULL, __pyx_n_s_constraint_domain, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_pushState, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/domain.py":82 * self._states.append(len(self)) @@ -4758,11 +4273,11 @@ if (!__Pyx_RefNanny) { * def popState(self): # <<<<<<<<<<<<<< * """Restore domain state from the top of the stack. * - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_6Domain_7popState, 0, __pyx_n_s_Domain_popState, NULL, __pyx_n_s_constraint_domain, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_popState, __pyx_t_2) < 0) __PYX_ERR(0, 82, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/domain.py":92 * del self._hidden[-diff:] @@ -4770,11 +4285,11 @@ if (!__Pyx_RefNanny) { * def hideValue(self, value): # <<<<<<<<<<<<<< * """Hide the given value from the domain. * - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_6Domain_9hideValue, 0, __pyx_n_s_Domain_hideValue, NULL, __pyx_n_s_constraint_domain, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_hideValue, __pyx_t_2) < 0) __PYX_ERR(0, 92, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/domain.py":52 * @@ -4782,24 +4297,24 @@ if (!__Pyx_RefNanny) { * class Domain(list): # <<<<<<<<<<<<<< * """Class used to control possible values for variables. * - */ - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_Domain, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Domain, __pyx_t_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error) +*/ + __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) + __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; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/domain.py":1 * """Module containing the code for the Variable and Domain classes.""" # <<<<<<<<<<<<<< * * - */ - __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_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /*--- Wrapped vars code ---*/ @@ -4808,9 +4323,9 @@ if (!__Pyx_RefNanny) { __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); if (__pyx_m) { - if (__pyx_d && stringtab_initialized) { + if (__pyx_mstate->__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init constraint.domain", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE @@ -4831,34 +4346,257 @@ if (!__Pyx_RefNanny) { __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; - #elif PY_MAJOR_VERSION >= 3 - return __pyx_m; #else - return; + return __pyx_m; #endif } -/* #### Code section: cleanup_globals ### */ -/* #### Code section: cleanup_module ### */ -/* #### Code section: main_method ### */ -/* #### Code section: utility_code_pragmas ### */ -#ifdef _MSC_VER -#pragma warning( push ) -/* Warning 4127: conditional expression is constant - * Cython uses constant conditional expressions to allow in inline functions to be optimized at - * compile-time, so this warning is not useful - */ -#pragma warning( disable : 4127 ) -#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_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 ### */ -/* #### Code section: utility_code_def ### */ +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) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ -/* --- Runtime support code --- */ -/* Refnanny */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; +static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "constraint/domain.py":72 + * """Reset to the original domain state, including all possible values.""" + * self.extend(self._hidden) + * del self._hidden[:] # <<<<<<<<<<<<<< + * del self._states[:] + * +*/ + __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]); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +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); + 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; +/* 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 *tuple_dedup_map +); + + +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}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 30, 11}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 39, 9}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 59, 29}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 69, 31}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 75, 19}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 82, 58}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 92, 26}; + 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; + } + Py_DECREF(tuple_dedup_map); + return 0; + bad: + Py_DECREF(tuple_dedup_map); + return -1; +} +/* #### Code section: init_globals ### */ + +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) + + /* 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 + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cleanup_globals ### */ +/* #### Code section: cleanup_module ### */ +/* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#ifdef _MSC_VER +#pragma warning( push ) +/* Warning 4127: conditional expression is constant + * Cython uses constant conditional expressions to allow in inline functions to be optimized at + * compile-time, so this warning is not useful + */ +#pragma warning( disable : 4127 ) +#endif + + + +/* #### Code section: utility_code_def ### */ + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; @@ -4877,11 +4615,9 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; itp_getattro)) return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ -#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -4999,11 +4731,11 @@ static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; -#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 +#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 && PY_VERSION_HEX >= 0x030700B1 +#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); @@ -5019,20 +4751,36 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif } return result; } /* TupleAndListFromArray */ -#if CYTHON_COMPILING_IN_CPYTHON +#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; @@ -5046,8 +4794,7 @@ __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { - Py_INCREF(__pyx_empty_tuple); - return __pyx_empty_tuple; + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; @@ -5070,7 +4817,8 @@ __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ + !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { @@ -5117,55 +4865,39 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL return PyObject_RichCompareBool(s1, s2, equals); #else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; + Py_ssize_t length, length2; int kind; void *data1, *data2; + #if !CYTHON_COMPILING_IN_LIMITED_API if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; + #endif length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length < 0)) return -1; + #endif + length2 = __Pyx_PyUnicode_GET_LENGTH(s2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length2 < 0)) return -1; + #endif + if (length != length2) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; - #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; - #else - hash1 = ((PyUnicodeObject*)s1)->hash; - hash2 = ((PyUnicodeObject*)s2)->hash; - #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } @@ -5183,9 +4915,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { @@ -5195,9 +4924,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -5205,14 +4931,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int return result; } return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ); return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_NE); #endif } @@ -5221,14 +4941,25 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { - Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(n == -1)) return NULL; + #endif for (i = 0; i < n; i++) { - if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + if (s == namei) return kwvalues[i]; } for (i = 0; i < n; i++) { - int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; @@ -5236,15 +4967,26 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO } return NULL; } -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { - Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); + Py_ssize_t i, nkwargs; PyObject *dict; +#if !CYTHON_ASSUME_SAFE_SIZE + nkwargs = PyTuple_Size(kwnames); + if (unlikely(nkwargs < 0)) return NULL; +#else + nkwargs = PyTuple_GET_SIZE(kwnames); +#endif dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif -} - -/* ParseKeywords */ -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); - while (1) { - Py_XDECREF(key); key = NULL; - Py_XDECREF(value); value = NULL; - if (kwds_is_tuple) { - Py_ssize_t size; -#if CYTHON_ASSUME_SAFE_MACROS - size = PyTuple_GET_SIZE(kwds); -#else - size = PyTuple_Size(kwds); - if (size < 0) goto bad; -#endif - if (pos >= size) break; -#if CYTHON_AVOID_BORROWED_REFS - key = __Pyx_PySequence_ITEM(kwds, pos); - if (!key) goto bad; -#elif CYTHON_ASSUME_SAFE_MACROS - key = PyTuple_GET_ITEM(kwds, pos); -#else - key = PyTuple_GetItem(kwds, pos); - if (!key) goto bad; -#endif - value = kwvalues[pos]; - pos++; - } - else - { - if (!PyDict_Next(kwds, &pos, &key, &value)) break; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); -#endif - } - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(value); - Py_DECREF(key); -#endif - key = NULL; - value = NULL; - continue; - } -#if !CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); -#endif - Py_INCREF(value); - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; -#endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = ( - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key) - ); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; -#endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - Py_XDECREF(key); - Py_XDECREF(value); - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - #if PY_MAJOR_VERSION < 3 - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - PyErr_Format(PyExc_TypeError, - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - Py_XDECREF(key); - Py_XDECREF(value); - return -1; -} - -/* PyObjectSetAttrStr */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_setattro)) - return tp->tp_setattro(obj, attr_name, value); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_setattr)) - return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); -#endif - return PyObject_SetAttr(obj, attr_name, value); } -#endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject *const *args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; @@ -5496,14 +5037,12 @@ static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args --tstate->recursion_depth; return result; } -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { +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; -#if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; -#endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; @@ -5511,19 +5050,11 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { - return NULL; - } - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } - #endif if ( -#if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && -#endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { @@ -5560,9 +5091,7 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, k = NULL; } closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); -#endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); @@ -5571,17 +5100,10 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, d = NULL; nd = 0; } -#if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); -#else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, closure); -#endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); @@ -5596,13 +5118,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -5621,13 +5138,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -5641,7 +5153,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API -static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { +static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; @@ -5649,7 +5161,7 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **arg if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); - if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: @@ -5657,10 +5169,35 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **arg return result; } #endif -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { - Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); -#if CYTHON_COMPILING_IN_CPYTHON - if (nargs == 0 && kwargs == NULL) { +#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API + #if PY_VERSION_HEX < 0x03090000 + #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable) + #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 (__Pyx_CyFunction_CheckExact(callable)) { + return __Pyx_CyFunction_func_vectorcall(callable); + } + #endif + if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) { + return NULL; + } + assert(PyCallable_Check(callable)); + Py_ssize_t offset = tp->tp_vectorcall_offset; + assert(offset > 0); + vectorcallfunc ptr; + memcpy(&ptr, (char *) callable + offset, sizeof(ptr)); + return ptr; +} + #else + #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable) + #endif +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) { + Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); +#if CYTHON_COMPILING_IN_CPYTHON + if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } @@ -5678,12 +5215,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } - #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif - #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); @@ -5691,24 +5226,22 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif #endif if (kwargs == NULL) { - #if CYTHON_VECTORCALL - #if PY_VERSION_HEX < 0x03090000 - vectorcallfunc f = _PyVectorcall_Function(func); - #else - vectorcallfunc f = PyVectorcall_Function(func); - #endif + #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API + vectorcallfunc f = __Pyx_PyVectorcall_Function(func); if (f) { - return f(func, args, (size_t)nargs, NULL); + 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, (size_t)nargs, NULL); + if (f) return f(func, args, _nargs, NULL); } + #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL + return PyObject_Vectorcall(func, args, _nargs, NULL); #endif } if (nargs == 0) { - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); @@ -5717,57 +5250,578 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif } +/* UnpackUnboundCMethod */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; + PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); + if (unlikely(!selfless_args)) return NULL; + result = PyObject_Call(method, selfless_args, kwargs); + Py_DECREF(selfless_args); + return result; +} +#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000 +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { + return _PyObject_Vectorcall + (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames); +} +#else +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + return +#if PY_VERSION_HEX < 0x03090000 + _PyObject_Vectorcall +#else + PyObject_Vectorcall +#endif + (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames); +} +#endif +static PyMethodDef __Pyx_UnboundCMethod_Def = { + "CythonUnboundCMethod", + __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 + METH_VARARGS | METH_KEYWORDS, +#else + METH_FASTCALL | METH_KEYWORDS, +#endif + NULL +}; +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method, *result=NULL; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + result = method; +#if CYTHON_COMPILING_IN_CPYTHON + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } else +#endif +#if CYTHON_COMPILING_IN_PYPY +#else + if (PyCFunction_Check(method)) +#endif + { + PyObject *self; + int self_found; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + self = PyObject_GetAttrString(method, "__self__"); + if (!self) { + PyErr_Clear(); + } +#else + self = PyCFunction_GET_SELF(method); +#endif + self_found = (self && self != Py_None); +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + Py_XDECREF(self); +#endif + if (self_found) { + PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); + if (unlikely(!unbound_method)) return -1; + Py_DECREF(method); + result = unbound_method; + } + } +#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if (unlikely(target->method)) { + Py_DECREF(result); + } else +#endif + target->method = result; + return 0; +} + +/* CallUnboundCMethod2 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { + int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); + if (likely(was_initialized == 2 && cfunc->func)) { + PyObject *args[2] = {arg1, arg2}; + if (cfunc->flag == METH_FASTCALL) { + return __Pyx_CallCFunctionFast(cfunc, self, args, 2); + } + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL); + } +#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__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2); + } +#endif + PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); + __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); + return result; +} +#endif +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + PyObject *result = NULL; + PyObject *args = PyTuple_New(2); + if (unlikely(!args)) return NULL; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + if (cfunc->flag & METH_KEYWORDS) + result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); + else + result = __Pyx_CallCFunction(cfunc, self, args); + Py_DECREF(args); + return result; + } +#endif + { + PyObject *args[4] = {NULL, self, arg1, arg2}; + return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + } +} + +/* ParseKeywords */ +static int __Pyx_ValidateDuplicatePosArgs( + PyObject *kwds, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + const char* function_name) +{ + PyObject ** const *name = argnames; + while (name != first_kw_arg) { + PyObject *key = **name; + int found = PyDict_Contains(kwds, key); + if (unlikely(found)) { + if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; + } + name++; + } + return 0; +bad: + return -1; +} +#if CYTHON_USE_UNICODE_INTERNALS +static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) { + int kind; + Py_ssize_t len = PyUnicode_GET_LENGTH(s1); + if (len != PyUnicode_GET_LENGTH(s2)) return 0; + kind = PyUnicode_KIND(s1); + if (kind != PyUnicode_KIND(s2)) return 0; + const void *data1 = PyUnicode_DATA(s1); + const void *data2 = PyUnicode_DATA(s2); + return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0); +} +#endif +static int __Pyx_MatchKeywordArg_str( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + PyObject ** const *name; + #if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t key_hash = ((PyASCIIObject*)key)->hash; + if (unlikely(key_hash == -1)) { + key_hash = PyObject_Hash(key); + if (unlikely(key_hash == -1)) + goto bad; + } + #endif + name = first_kw_arg; + while (*name) { + PyObject *name_str = **name; + #if CYTHON_USE_UNICODE_INTERNALS + if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) { + *index_found = (size_t) (name - argnames); + return 1; + } + #else + #if CYTHON_ASSUME_SAFE_SIZE + if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) + #endif + { + int cmp = PyUnicode_Compare(name_str, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + *index_found = (size_t) (name - argnames); + return 1; + } + } + #endif + name++; + } + name = argnames; + while (name != first_kw_arg) { + PyObject *name_str = **name; + #if CYTHON_USE_UNICODE_INTERNALS + if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) { + if (__Pyx_UnicodeKeywordsEqual(name_str, key)) + goto arg_passed_twice; + } + #else + #if CYTHON_ASSUME_SAFE_SIZE + if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) + #endif + { + if (unlikely(name_str == key)) goto arg_passed_twice; + int cmp = PyUnicode_Compare(name_str, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + } + #endif + name++; + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +bad: + return -1; +} +static int __Pyx_MatchKeywordArg_nostr( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + PyObject ** const *name; + if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; + name = first_kw_arg; + while (*name) { + int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); + if (cmp == 1) { + *index_found = (size_t) (name - argnames); + return 1; + } + if (unlikely(cmp == -1)) goto bad; + name++; + } + name = argnames; + while (name != first_kw_arg) { + int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); + if (unlikely(cmp != 0)) { + if (cmp == 1) goto arg_passed_twice; + else goto bad; + } + name++; + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +bad: + return -1; +} +static CYTHON_INLINE int __Pyx_MatchKeywordArg( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + return likely(PyUnicode_CheckExact(key)) ? + __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) : + __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name); +} +static void __Pyx_RejectUnknownKeyword( + PyObject *kwds, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + const char *function_name) +{ + Py_ssize_t pos = 0; + PyObject *key = NULL; + __Pyx_BEGIN_CRITICAL_SECTION(kwds); + while (PyDict_Next(kwds, &pos, &key, NULL)) { + 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) { + if (cmp == 0) { + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif + break; + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif + } + } + __Pyx_END_CRITICAL_SECTION(); + assert(PyErr_Occurred()); +} +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) +{ + PyObject** const *name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + Py_ssize_t extracted = 0; +#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) + if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; +#endif + name = first_kw_arg; + while (*name && num_kwargs > extracted) { + PyObject * key = **name; + PyObject *value; + int found = 0; + #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + found = PyDict_GetItemRef(kwds, key, &value); + #else + value = PyDict_GetItemWithError(kwds, key); + if (value) { + Py_INCREF(value); + found = 1; + } else { + if (unlikely(PyErr_Occurred())) goto bad; + } + #endif + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + extracted++; + } + name++; + } + if (num_kwargs > extracted) { + if (ignore_unknown_kwargs) { + if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1)) + goto bad; + } else { + __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name); + goto bad; + } + } + return 0; +bad: + return -1; +} +static int __Pyx_ParseKeywordDictToDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject** const *name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + Py_ssize_t len; +#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) + if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; +#endif + if (PyDict_Update(kwds2, kwds) < 0) goto bad; + name = first_kw_arg; + while (*name) { + PyObject *key = **name; + PyObject *value; +#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop)) + int found = PyDict_Pop(kwds2, key, &value); + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + } +#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + int found = PyDict_GetItemRef(kwds2, key, &value); + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad; + } +#else + #if CYTHON_COMPILING_IN_CPYTHON + value = _PyDict_Pop(kwds2, key, kwds2); + #else + value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2); + #endif + if (value == kwds2) { + Py_DECREF(value); + } else { + if (unlikely(!value)) goto bad; + values[name-argnames] = value; + } +#endif + name++; + } + len = PyDict_Size(kwds2); + if (len > 0) { + return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name); + } else if (unlikely(len == -1)) { + goto bad; + } + return 0; +bad: + return -1; +} +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) +{ + PyObject *key = NULL; + PyObject** const * name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) { +#if CYTHON_AVOID_BORROWED_REFS + key = __Pyx_PySequence_ITEM(kwds, pos); +#else + key = __Pyx_PyTuple_GET_ITEM(kwds, pos); +#endif +#if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!key)) goto bad; +#endif + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + PyObject *value = kwvalues[pos]; + values[name-argnames] = __Pyx_NewRef(value); + } else { + size_t index_found = 0; + int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); + if (cmp == 1) { + PyObject *value = kwvalues[pos]; + values[index_found] = __Pyx_NewRef(value); + } else { + if (unlikely(cmp == -1)) goto bad; + if (kwds2) { + PyObject *value = kwvalues[pos]; + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else if (!ignore_unknown_kwargs) { + goto invalid_keyword; + } + } + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + key = NULL; + #endif + } + return 0; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + goto bad; +bad: + #if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(key); + #endif + return -1; +} +static 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) +{ + if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) + return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); + else if (kwds2) + return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name); + else + return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); +} + +/* RaiseArgTupleInvalid */ +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* PyObjectFastCallMethod */ +#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000 +static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) { + PyObject *result; + PyObject *attr = PyObject_GetAttr(args[0], name); + if (unlikely(!attr)) + return NULL; + result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1); + Py_DECREF(attr); + return result; +} +#endif + /* SliceObject */ static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, 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) { + int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS - PyMappingMethods* mp; -#if PY_MAJOR_VERSION < 3 - PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; - if (likely(ms && ms->sq_ass_slice)) { - if (!has_cstart) { - if (_py_start && (*_py_start != Py_None)) { - cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); - if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstart = 0; - } - if (!has_cstop) { - if (_py_stop && (*_py_stop != Py_None)) { - cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); - if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstop = PY_SSIZE_T_MAX; - } - if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { - Py_ssize_t l = ms->sq_length(obj); - if (likely(l >= 0)) { - if (cstop < 0) { - cstop += l; - if (cstop < 0) cstop = 0; - } - if (cstart < 0) { - cstart += l; - if (cstart < 0) cstart = 0; - } - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - goto bad; - PyErr_Clear(); - } - } - return ms->sq_ass_slice(obj, cstart, cstop, value); - } -#else - CYTHON_UNUSED_VAR(wraparound); -#endif - mp = Py_TYPE(obj)->tp_as_mapping; + PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_ass_subscript)) -#else - CYTHON_UNUSED_VAR(wraparound); #endif { int result; @@ -5781,7 +5835,7 @@ static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, py_start = *_py_start; } else { if (has_cstart) { - owned_start = py_start = PyInt_FromSsize_t(cstart); + owned_start = py_start = PyLong_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; @@ -5790,7 +5844,7 @@ static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, py_stop = *_py_stop; } else { if (has_cstop) { - owned_stop = py_stop = PyInt_FromSsize_t(cstop); + owned_stop = py_stop = PyLong_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; @@ -5813,7 +5867,7 @@ static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, } return result; } - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object does not support slice %.10s", obj_type_name, value ? "assignment" : "deletion"); @@ -5857,18 +5911,12 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) -#elif PY_MAJOR_VERSION >= 3 +#else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif -#else - #ifdef __Pyx_CyFunction_USED - if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) - #else - if (likely(PyFunction_Check(descr))) - #endif #endif { meth_found = 1; @@ -5906,15 +5954,10 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me *method = descr; return 0; } - type_name = __Pyx_PyType_GetName(tp); + type_name = __Pyx_PyType_GetFullyQualifiedName(tp); PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(name)); -#endif __Pyx_DECREF_TypeName(type_name); return 0; #else @@ -5936,7 +5979,7 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me } /* PyObjectCallMethod1 */ -#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) +#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); @@ -5944,7 +5987,7 @@ 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 >= 0x030C00A2 +#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; @@ -5968,7 +6011,7 @@ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { - PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); + PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_mstate_global->__pyx_n_u_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); @@ -5998,84 +6041,44 @@ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name return result; } -/* UnpackUnboundCMethod */ -static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { - PyObject *result; - PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); - if (unlikely(!selfless_args)) return NULL; - result = PyObject_Call(method, selfless_args, kwargs); - Py_DECREF(selfless_args); +/* 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; } -static PyMethodDef __Pyx_UnboundCMethod_Def = { - "CythonUnboundCMethod", - __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), - METH_VARARGS | METH_KEYWORDS, - NULL -}; -static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { - PyObject *method; - method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); - if (unlikely(!method)) - return -1; - target->method = method; -#if CYTHON_COMPILING_IN_CPYTHON - #if PY_MAJOR_VERSION >= 3 - if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) - #else - if (likely(!__Pyx_CyOrPyCFunction_Check(method))) - #endif - { - PyMethodDescrObject *descr = (PyMethodDescrObject*) method; - target->func = descr->d_method->ml_meth; - target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); - } else -#endif -#if CYTHON_COMPILING_IN_PYPY -#else - if (PyCFunction_Check(method)) -#endif - { - PyObject *self; - int self_found; -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - self = PyObject_GetAttrString(method, "__self__"); - if (!self) { - PyErr_Clear(); - } -#else - self = PyCFunction_GET_SELF(method); -#endif - self_found = (self && self != Py_None); -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - Py_XDECREF(self); #endif - if (self_found) { - PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); - if (unlikely(!unbound_method)) return -1; - Py_DECREF(method); - target->method = unbound_method; - } - } - return 0; -} - -/* CallUnboundCMethod0 */ static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { - PyObject *args, *result = NULL; + PyObject *result; if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; -#if CYTHON_ASSUME_SAFE_MACROS - args = PyTuple_New(1); - if (unlikely(!args)) goto bad; - Py_INCREF(self); - PyTuple_SET_ITEM(args, 0, self); -#else - args = PyTuple_Pack(1, self); - if (unlikely(!args)) goto bad; -#endif - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); - Py_DECREF(args); -bad: + result = __Pyx_PyObject_CallOneArg(cfunc->method, self); return result; } @@ -6084,15 +6087,15 @@ static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) { if (__Pyx_IS_TYPE(L, &PySet_Type)) { return PySet_Pop(L); } - return __Pyx_PyObject_CallMethod0(L, __pyx_n_s_pop); + return __Pyx_PyObject_CallMethod0(L, __pyx_mstate_global->__pyx_n_u_pop); } -#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L) { if (likely(PyList_GET_SIZE(L) > (((PyListObject*)L)->allocated >> 1))) { __Pyx_SET_SIZE(L, Py_SIZE(L) - 1); return PyList_GET_ITEM(L, PyList_GET_SIZE(L)); } - return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_pop, L); + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyList_Type_pop, L); } #endif @@ -6100,53 +6103,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L) { 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) { + int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS - PyMappingMethods* mp; -#if PY_MAJOR_VERSION < 3 - PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; - if (likely(ms && ms->sq_slice)) { - if (!has_cstart) { - if (_py_start && (*_py_start != Py_None)) { - cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); - if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstart = 0; - } - if (!has_cstop) { - if (_py_stop && (*_py_stop != Py_None)) { - cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); - if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstop = PY_SSIZE_T_MAX; - } - if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { - Py_ssize_t l = ms->sq_length(obj); - if (likely(l >= 0)) { - if (cstop < 0) { - cstop += l; - if (cstop < 0) cstop = 0; - } - if (cstart < 0) { - cstart += l; - if (cstart < 0) cstart = 0; - } - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - goto bad; - PyErr_Clear(); - } - } - return ms->sq_slice(obj, cstart, cstop); - } -#else - CYTHON_UNUSED_VAR(wraparound); -#endif - mp = Py_TYPE(obj)->tp_as_mapping; + PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) -#else - CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; @@ -6160,7 +6121,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, py_start = *_py_start; } else { if (has_cstart) { - owned_start = py_start = PyInt_FromSsize_t(cstart); + owned_start = py_start = PyLong_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; @@ -6169,7 +6130,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, py_stop = *_py_stop; } else { if (has_cstop) { - owned_stop = py_stop = PyInt_FromSsize_t(cstop); + owned_stop = py_stop = PyLong_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; @@ -6192,7 +6153,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, } return result; } - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + 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); @@ -6201,7 +6162,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, } /* FixUpExtensionType */ -#if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); @@ -6271,23 +6231,50 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject #endif return 0; } -#endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); + 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); +#else + value = PyDict_SetDefault(d, key, default_value); + if (unlikely(!value)) return NULL; + Py_INCREF(value); +#endif + return value; } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, - Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { + Py_ssize_t basicsize; if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_basicsize; + py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); + if (unlikely(!py_basicsize)) return -1; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = NULL; + if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1; +#else + basicsize = ((PyTypeObject*) cached_type)->tp_basicsize; +#endif if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", @@ -6296,80 +6283,51 @@ static int __Pyx_VerifyCachedType(PyObject *cached_type, } return 0; } -#if !CYTHON_USE_TYPE_SPECS -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { - PyObject* abi_module; - const char* object_name; - PyTypeObject *cached_type = NULL; - abi_module = __Pyx_FetchSharedCythonABIModule(); - if (!abi_module) return NULL; - object_name = strrchr(type->tp_name, '.'); - object_name = object_name ? object_name+1 : type->tp_name; - cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); - if (cached_type) { - if (__Pyx_VerifyCachedType( - (PyObject *)cached_type, - object_name, - cached_type->tp_basicsize, - type->tp_basicsize) < 0) { - goto bad; - } - goto done; - } - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); - if (PyType_Ready(type) < 0) goto bad; - if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) - goto bad; - Py_INCREF(type); - cached_type = type; -done: - Py_DECREF(abi_module); - return cached_type; -bad: - Py_XDECREF(cached_type); - cached_type = NULL; - goto done; -} -#else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { - PyObject *abi_module, *cached_type = NULL; + PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name; + int get_item_ref_result; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; + py_object_name = PyUnicode_FromString(object_name); + if (!py_object_name) return NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); - if (!abi_module) return NULL; - cached_type = PyObject_GetAttrString(abi_module, object_name); - if (cached_type) { - Py_ssize_t basicsize; -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *py_basicsize; - py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); - if (unlikely(!py_basicsize)) goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; -#else - basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; -#endif + if (!abi_module) goto done; + abi_module_dict = PyModule_GetDict(abi_module); + if (!abi_module_dict) goto done; + get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type); + if (get_item_ref_result == 1) { if (__Pyx_VerifyCachedType( cached_type, object_name, - basicsize, spec->basicsize) < 0) { goto bad; } goto done; + } else if (unlikely(get_item_ref_result == -1)) { + goto bad; } - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(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; - if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; + new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type, 1); + if (unlikely(new_cached_type != cached_type)) { + if (unlikely(!new_cached_type)) goto bad; + Py_DECREF(cached_type); + cached_type = new_cached_type; + if (__Pyx_VerifyCachedType( + cached_type, + object_name, + spec->basicsize) < 0) { + goto bad; + } + goto done; + } else { + Py_DECREF(new_cached_type); + } done: - Py_DECREF(abi_module); + Py_XDECREF(abi_module); + Py_DECREF(py_object_name); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: @@ -6377,10 +6335,54 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec cached_type = NULL; goto done; } + +/* CallTypeTraverse */ +#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) { + #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 + if (__Pyx_get_runtime_version() < 0x03090000) return 0; + #endif + if (!always_call) { + PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*); + unsigned long flags = PyType_GetFlags(base); + if (flags & Py_TPFLAGS_HEAPTYPE) { + return 0; + } + } + Py_VISIT((PyObject*)Py_TYPE(o)); + return 0; +} +#endif + +/* PyMethodNew */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + PyObject *result; + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + { + PyObject *args[] = {func, self}; + result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL); + } + #else + result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL); + #endif + return result; +} +#else +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} #endif /* PyVectorcallFastCallDict */ -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; @@ -6391,7 +6393,12 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector size_t j; PyObject *key, *value; unsigned long keys_are_strings; + #if !CYTHON_ASSUME_SAFE_SIZE + Py_ssize_t nkw = PyDict_Size(kw); + if (unlikely(nkw == -1)) return NULL; + #else Py_ssize_t nkw = PyDict_GET_SIZE(kw); + #endif newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); @@ -6407,10 +6414,19 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { - keys_are_strings &= Py_TYPE(key)->tp_flags; + 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 PyTuple_SET_ITEM(kwnames, i, key); + #endif kwvalues[i] = value; i++; } @@ -6428,16 +6444,29 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { - if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { + Py_ssize_t kw_size = + likely(kw == NULL) ? + 0 : +#if !CYTHON_ASSUME_SAFE_SIZE + PyDict_Size(kw); +#else + PyDict_GET_SIZE(kw); +#endif + if (kw_size == 0) { return vc(func, args, nargs, NULL); } +#if !CYTHON_ASSUME_SAFE_SIZE + else if (unlikely(kw_size == -1)) { + return NULL; + } +#endif return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { @@ -6445,8 +6474,25 @@ static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) } return 0; } +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) { + if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) { + int result; + PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func); + if (unlikely(!newFunc)) { + PyErr_Clear(); // It's only an optimization, so don't throw an error + return 0; + } + result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc); + Py_DECREF(newFunc); + return result; + } + return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc); +} #else -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) { + if (PyMethod_Check(func)) { + func = PyMethod_GET_FUNCTION(func); + } return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif @@ -6462,20 +6508,15 @@ static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* #endif } static PyObject * -__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) +__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op) { - CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { -#if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#else - op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#endif if (unlikely(op->func_doc == NULL)) return NULL; } else { @@ -6487,6 +6528,15 @@ __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) Py_INCREF(op->func_doc); return op->func_doc; } +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { + PyObject *result; + CYTHON_UNUSED_VAR(closure); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_doc_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { @@ -6495,20 +6545,19 @@ __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *cont value = Py_None; } Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_doc, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op) { - CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); -#elif PY_MAJOR_VERSION >= 3 - op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else - op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; @@ -6516,53 +6565,60 @@ __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) Py_INCREF(op->func_name); return op->func_name; } +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +{ + PyObject *result = NULL; + CYTHON_UNUSED_VAR(context); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_name_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_name, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); + PyObject *result; + __Pyx_BEGIN_CRITICAL_SECTION(op); Py_INCREF(op->func_qualname); - return op->func_qualname; + result = op->func_qualname; + __Pyx_END_CRITICAL_SECTION(); + return result; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_qualname, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) +__Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op) { - CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) @@ -6571,6 +6627,16 @@ __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) 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) { @@ -6586,7 +6652,9 @@ __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *con return -1; } Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_dict, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * @@ -6647,13 +6715,14 @@ __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { +__Pyx_CyFunction_get_defaults_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_tuple; - CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; @@ -6665,6 +6734,15 @@ __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { Py_INCREF(result); return result; } +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = NULL; + CYTHON_UNUSED_VAR(context); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_defaults_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); @@ -6678,13 +6756,14 @@ __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, voi PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { +__Pyx_CyFunction_get_kwdefaults_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_kwdict; - CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; @@ -6696,6 +6775,15 @@ __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { Py_INCREF(result); return result; } +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result; + CYTHON_UNUSED_VAR(context); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_kwdefaults_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); @@ -6707,13 +6795,14 @@ __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, vo return -1; } Py_XINCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_annotations, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { +__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; - CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; @@ -6723,16 +6812,19 @@ __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { return result; } static PyObject * -__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { - int is_coroutine; +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { + PyObject *result; CYTHON_UNUSED_VAR(context); - if (op->func_is_coroutine) { - return __Pyx_NewRef(op->func_is_coroutine); - } - is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; -#if PY_VERSION_HEX >= 0x03050000 + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_annotations_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} +static PyObject * +__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { + int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; if (is_coroutine) { - PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; + PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); @@ -6745,20 +6837,68 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { return NULL; } #endif - module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); + module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; - op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); + is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); - if (likely(op->func_is_coroutine)) { - return __Pyx_NewRef(op->func_is_coroutine); + if (likely(is_coroutine_value)) { + return is_coroutine_value; } ignore: PyErr_Clear(); } + return __Pyx_PyBool_FromLong(is_coroutine); +} +static PyObject * +__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { + PyObject *result; + CYTHON_UNUSED_VAR(context); + if (op->func_is_coroutine) { + return __Pyx_NewRef(op->func_is_coroutine); + } + result = __Pyx_CyFunction_get_is_coroutine_value(op); + if (unlikely(!result)) + return NULL; + __Pyx_BEGIN_CRITICAL_SECTION(op); + if (op->func_is_coroutine) { + Py_DECREF(result); + result = __Pyx_NewRef(op->func_is_coroutine); + } else { + op->func_is_coroutine = __Pyx_NewRef(result); + } + __Pyx_END_CRITICAL_SECTION(); + return result; +} +static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, message, size); + Py_DECREF(py_name); +#else + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + name, message, size); +#endif +} +static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s", + py_name, message); + Py_DECREF(py_name); +#else + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s", + name, message); #endif - op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); - return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * @@ -6773,24 +6913,24 @@ __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *c } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { - {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, - {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, - {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, + {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"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}, + {"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}, + {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {"__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}, + {"_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}, #endif @@ -6798,23 +6938,19 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, + {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif -#if CYTHON_USE_TYPE_SPECS - {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, + {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API + {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else -#if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, -#endif + {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif -#endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API + {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, + {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} @@ -6822,19 +6958,19 @@ static PyMemberDef __pyx_CyFunction_members[] = { static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { + PyObject *result = NULL; CYTHON_UNUSED_VAR(args); -#if PY_MAJOR_VERSION >= 3 + __Pyx_BEGIN_CRITICAL_SECTION(m); Py_INCREF(m->func_qualname); - return m->func_qualname; -#else - return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); -#endif + result = m->func_qualname; + __Pyx_END_CRITICAL_SECTION(); + return result; } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) @@ -6876,8 +7012,6 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef * Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; - op->defaults_pyobjects = 0; - op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; @@ -6939,14 +7073,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_XDECREF(pydefaults[i]); - PyObject_Free(m->defaults); - m->defaults = NULL; - } + Py_CLEAR(m->defaults); return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) @@ -6963,6 +7090,10 @@ static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { + { + int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg); + if (e) return e; + } Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); @@ -6970,40 +7101,33 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); - Py_VISIT(m->func_name); - Py_VISIT(m->func_qualname); + __Pyx_VISIT_CONST(m->func_name); + __Pyx_VISIT_CONST(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); - Py_VISIT(m->func_code); + __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_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_VISIT(pydefaults[i]); - } + Py_VISIT(m->defaults); return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { -#if PY_MAJOR_VERSION >= 3 - return PyUnicode_FromFormat("", + PyObject *repr; + __Pyx_BEGIN_CRITICAL_SECTION(op); + repr = PyUnicode_FromFormat("", op->func_qualname, (void *)op); -#else - return PyString_FromFormat("", - PyString_AsString(op->func_qualname), (void *)op); -#endif + __Pyx_END_CRITICAL_SECTION(); + return repr; } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; - PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); @@ -7022,10 +7146,10 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: - return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); @@ -7033,24 +7157,15 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif if (likely(size == 0)) return (*meth)(self, NULL); -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes no arguments", size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); @@ -7069,18 +7184,9 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif return result; } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes exactly one argument", size); return NULL; } break; @@ -7088,16 +7194,8 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", - py_name); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", - f->m_ml->ml_name); -#endif + __Pyx_CyFunction_raise_type_error( + (__pyx_CyFunctionObject*)func, "takes no keyword arguments"); return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { @@ -7114,10 +7212,10 @@ 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 +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; @@ -7129,11 +7227,11 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P Py_ssize_t argc; PyObject *new_args; PyObject *self; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); - if (unlikely(!argc) < 0) return NULL; + if (unlikely(argc < 0)) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) @@ -7141,14 +7239,9 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); -#if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); -#else - PyErr_SetString(PyExc_TypeError, - "unbound method needs an argument"); -#endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); @@ -7158,21 +7251,21 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P } return result; } -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { - PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", - ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + __Pyx_CyFunction_raise_type_error( + cyfunc, "needs an argument"); return -1; } ret = 1; } - if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) { + __Pyx_CyFunction_raise_type_error( + cyfunc, "takes no keyword arguments"); return -1; } return ret; @@ -7180,13 +7273,18 @@ 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; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #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); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; @@ -7194,29 +7292,38 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } if (unlikely(nargs != 0)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes no arguments", nargs); return NULL; } - return def->ml_meth(self, NULL); + return meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #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); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; @@ -7224,29 +7331,38 @@ static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } if (unlikely(nargs != 1)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes exactly one argument", nargs); return NULL; } - return def->ml_meth(self, args[0]); + return meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #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); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; @@ -7254,17 +7370,21 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } - return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); + return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; @@ -7272,6 +7392,12 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; @@ -7279,15 +7405,19 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } - return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); + return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, (size_t)nargs, kwnames); } #endif -#if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, @@ -7307,121 +7437,32 @@ static PyType_Spec __pyx_CyFunctionType_spec = { #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif -#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) +#if CYTHON_METH_FASTCALL +#if defined(Py_TPFLAGS_HAVE_VECTORCALL) + Py_TPFLAGS_HAVE_VECTORCALL | +#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, - __pyx_CyFunctionType_slots -}; -#else -static PyTypeObject __pyx_CyFunctionType_type = { - PyVarObject_HEAD_INIT(0, 0) - __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", - sizeof(__pyx_CyFunctionObject), - 0, - (destructor) __Pyx_CyFunction_dealloc, -#if !CYTHON_METH_FASTCALL - 0, -#elif CYTHON_BACKPORT_VECTORCALL - (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), -#else - offsetof(PyCFunctionObject, vectorcall), -#endif - 0, - 0, -#if PY_MAJOR_VERSION < 3 - 0, -#else - 0, -#endif - (reprfunc) __Pyx_CyFunction_repr, - 0, - 0, - 0, - 0, - __Pyx_CyFunction_CallAsMethod, - 0, - 0, - 0, - 0, -#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR - Py_TPFLAGS_METHOD_DESCRIPTOR | -#endif -#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL - _Py_TPFLAGS_HAVE_VECTORCALL | +#endif // CYTHON_METH_FASTCALL +#if PY_VERSION_HEX >= 0x030A0000 + Py_TPFLAGS_IMMUTABLETYPE | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, - 0, - (traverseproc) __Pyx_CyFunction_traverse, - (inquiry) __Pyx_CyFunction_clear, - 0, -#if PY_VERSION_HEX < 0x030500A0 - offsetof(__pyx_CyFunctionObject, func_weakreflist), -#else - offsetof(PyCFunctionObject, m_weakreflist), -#endif - 0, - 0, - __pyx_CyFunction_methods, - __pyx_CyFunction_members, - __pyx_CyFunction_getsets, - 0, - 0, - __Pyx_PyMethod_New, - 0, - offsetof(__pyx_CyFunctionObject, func_dict), - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, -#if PY_VERSION_HEX >= 0x030400a1 - 0, -#endif -#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, -#endif -#if __PYX_NEED_TP_PRINT_SLOT - 0, -#endif -#if PY_VERSION_HEX >= 0x030C0000 - 0, -#endif -#if PY_VERSION_HEX >= 0x030d00A4 - 0, -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, -#endif + __pyx_CyFunctionType_slots }; -#endif static int __pyx_CyFunction_init(PyObject *module) { -#if CYTHON_USE_TYPE_SPECS - __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); -#else - CYTHON_UNUSED_VAR(module); - __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); -#endif - if (unlikely(__pyx_CyFunctionType == NULL)) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); + mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); + if (unlikely(mstate->__pyx_CyFunctionType == NULL)) { return -1; } return 0; } -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults = PyObject_Malloc(size); + m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type); if (unlikely(!m->defaults)) - return PyErr_NoMemory(); - memset(m->defaults, 0, size); - m->defaults_pyobjects = pyobjects; - m->defaults_size = size; + return NULL; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { @@ -7444,7 +7485,7 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( - PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_mstate_global->__pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { @@ -7456,7 +7497,7 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qual /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); @@ -7471,10 +7512,6 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); -#if PY_MAJOR_VERSION < 3 - if (tmptype == &PyClass_Type) - continue; -#endif if (!metaclass) { metaclass = tmptype; continue; @@ -7493,11 +7530,7 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas return NULL; } if (!metaclass) { -#if PY_MAJOR_VERSION < 3 - metaclass = &PyClass_Type; -#else metaclass = &PyType_Type; -#endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; @@ -7508,10 +7541,6 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); -#if PY_MAJOR_VERSION < 3 - if (unlikely(PyInstance_Check(obj))) - return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); -#endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; @@ -7532,7 +7561,7 @@ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { - PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); + PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_mstate_global->__pyx_n_u_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); @@ -7547,148 +7576,14 @@ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, } if (unlikely(!ns)) return NULL; - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; -#if PY_VERSION_HEX >= 0x03030000 - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; -#else - CYTHON_MAYBE_UNUSED_VAR(qualname); -#endif - if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } -#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS -static int __Pyx_SetNamesPEP487(PyObject *type_obj) { - PyTypeObject *type = (PyTypeObject*) type_obj; - PyObject *names_to_set, *key, *value, *set_name, *tmp; - Py_ssize_t i = 0; -#if CYTHON_USE_TYPE_SLOTS - names_to_set = PyDict_Copy(type->tp_dict); -#else - { - PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); - names_to_set = NULL; - if (likely(d)) { - PyObject *names_to_set = PyDict_New(); - int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; - Py_DECREF(d); - if (unlikely(ret < 0)) - Py_CLEAR(names_to_set); - } - } -#endif - if (unlikely(names_to_set == NULL)) - goto bad; - while (PyDict_Next(names_to_set, &i, &key, &value)) { - set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); - if (unlikely(set_name != NULL)) { - tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); - Py_DECREF(set_name); - if (unlikely(tmp == NULL)) { - __Pyx_TypeName value_type_name = - __Pyx_PyType_GetName(Py_TYPE(value)); - __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); - PyErr_Format(PyExc_RuntimeError, -#if PY_MAJOR_VERSION >= 3 - "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", - value_type_name, key, type_name); -#else - "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", - value_type_name, - PyString_Check(key) ? PyString_AS_STRING(key) : "?", - type_name); -#endif - goto bad; - } else { - Py_DECREF(tmp); - } - } - else if (unlikely(PyErr_Occurred())) { - goto bad; - } - } - Py_DECREF(names_to_set); - return 0; -bad: - Py_XDECREF(names_to_set); - return -1; -} -static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { -#if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - PyTypeObject *type = (PyTypeObject*) type_obj; - PyObject *mro = type->tp_mro; - Py_ssize_t i, nbases; - if (unlikely(!mro)) goto done; - (void) &__Pyx_GetBuiltinName; - Py_INCREF(mro); - nbases = PyTuple_GET_SIZE(mro); - assert(PyTuple_GET_ITEM(mro, 0) == type_obj); - for (i = 1; i < nbases-1; i++) { - PyObject *base, *dict, *meth; - base = PyTuple_GET_ITEM(mro, i); - dict = ((PyTypeObject *)base)->tp_dict; - meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); - if (unlikely(meth)) { - descrgetfunc f = Py_TYPE(meth)->tp_descr_get; - PyObject *res; - Py_INCREF(meth); - if (likely(f)) { - res = f(meth, NULL, type_obj); - Py_DECREF(meth); - if (unlikely(!res)) goto bad; - meth = res; - } - res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); - Py_DECREF(meth); - if (unlikely(!res)) goto bad; - Py_DECREF(res); - goto done; - } else if (unlikely(PyErr_Occurred())) { - goto bad; - } - } -done: - Py_XDECREF(mro); - return type_obj; -bad: - Py_XDECREF(mro); - Py_DECREF(type_obj); - return NULL; -#else - PyObject *super_type, *super, *func, *res; -#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) - super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); -#else - super_type = (PyObject*) &PySuper_Type; - (void) &__Pyx_GetBuiltinName; -#endif - super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; -#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) - Py_XDECREF(super_type); -#endif - if (unlikely(!super)) { - Py_CLEAR(type_obj); - goto done; - } - func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); - Py_DECREF(super); - if (likely(!func)) { - if (unlikely(PyErr_Occurred())) - Py_CLEAR(type_obj); - goto done; - } - res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); - Py_DECREF(func); - if (unlikely(!res)) - Py_CLEAR(type_obj); - Py_XDECREF(res); -done: - return type_obj; -#endif -} -#endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { @@ -7696,7 +7591,7 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { - owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { @@ -7712,25 +7607,8 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj return NULL; owned_metaclass = metaclass; } - result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, -#if PY_VERSION_HEX < 0x030600A4 - (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw -#else - mkw -#endif - ); + result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_XDECREF(owned_metaclass); -#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS - if (likely(result) && likely(PyType_Check(result))) { - if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { - Py_CLEAR(result); - } else { - result = __Pyx_InitSubclassPEP487(result, mkw); - } - } -#else - (void) &__Pyx_GetBuiltinName; -#endif return result; } @@ -7768,33 +7646,26 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 - result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } else if (unlikely(PyErr_Occurred())) { - return NULL; - } -#elif CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { + if (!PyErr_Occurred()) + PyErr_SetNone(PyExc_NameError); return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } -#else - result = PyDict_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + PyErr_Clear(); +#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear(); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { - return __Pyx_NewRef(result); + return result; } -#endif #else - result = PyObject_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } @@ -7808,10 +7679,26 @@ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; - PyObject *base, *meth, *new_base, *result, *new_bases = NULL; + PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL; +#if CYTHON_ASSUME_SAFE_SIZE size_bases = PyTuple_GET_SIZE(bases); +#else + size_bases = PyTuple_Size(bases); + if (size_bases < 0) return NULL; +#endif for (i = 0; i < size_bases; i++) { - base = PyTuple_GET_ITEM(bases, i); +#if CYTHON_AVOID_BORROWED_REFS + Py_CLEAR(base); +#endif +#if CYTHON_ASSUME_SAFE_MACROS + base = PyTuple_GET_ITEM(bases, i); +#else + base = PyTuple_GetItem(bases, i); + if (!base) goto error; +#endif +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(base); +#endif if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { @@ -7820,7 +7707,7 @@ __Pyx_PEP560_update_bases(PyObject *bases) } continue; } - meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); + meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } @@ -7848,12 +7735,25 @@ __Pyx_PEP560_update_bases(PyObject *bases) goto error; } for (j = 0; j < i; j++) { - base = PyTuple_GET_ITEM(bases, j); - PyList_SET_ITEM(new_bases, j, base); - Py_INCREF(base); + PyObject *base_from_list; +#if CYTHON_ASSUME_SAFE_MACROS + base_from_list = PyTuple_GET_ITEM(bases, j); + PyList_SET_ITEM(new_bases, j, base_from_list); + Py_INCREF(base_from_list); +#else + base_from_list = PyTuple_GetItem(bases, j); + if (!base_from_list) goto error; + Py_INCREF(base_from_list); + if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error; +#endif } } +#if CYTHON_ASSUME_SAFE_SIZE j = PyList_GET_SIZE(new_bases); +#else + j = PyList_Size(new_bases); + if (j < 0) goto error; +#endif if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } @@ -7865,14 +7765,20 @@ __Pyx_PEP560_update_bases(PyObject *bases) } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); +#if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(base); +#endif return result; error: Py_XDECREF(new_bases); +#if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(base); +#endif return NULL; } /* CLineInTraceback */ -#ifndef CYTHON_CLINE_IN_TRACEBACK +#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; @@ -7880,22 +7786,26 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); - if (unlikely(!__pyx_cython_runtime)) { + 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_cython_runtime); + cython_runtime_dict = _PyObject_GetDictPtr(__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_n_s_cline_in_traceback)) + __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_cython_runtime, __pyx_n_s_cline_in_traceback); + 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(); @@ -7904,18 +7814,18 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { } if (!use_cline) { c_line = 0; - (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + (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)) { c_line = 0; } + Py_XDECREF(use_cline); __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ -#if !CYTHON_COMPILING_IN_LIMITED_API 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) { @@ -7937,64 +7847,103 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co return mid + 1; } } -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; +static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) { + __Pyx_CachedCodeObjectType* code_object; int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + if (unlikely(!code_line) || unlikely(!code_cache->entries)) { return NULL; } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); + if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) { return NULL; } - code_object = __pyx_code_cache.entries[pos].code_object; + code_object = code_cache->entries[pos].code_object; Py_INCREF(code_object); return code_object; } -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) { +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS + (void)__pyx__find_code_object; + return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss. +#else + struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count); + if (old_count < 0) { + __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); + return NULL; + } +#endif + __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line); +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); +#endif + return result; +#endif +} +static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object) +{ int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + __Pyx_CodeObjectCacheEntry* entries = code_cache->entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; + code_cache->entries = entries; + code_cache->max_count = 64; + code_cache->count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; + pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); + if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) { + __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object; entries[pos].code_object = code_object; + Py_INCREF(code_object); Py_DECREF(tmp); return; } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; + if (code_cache->count == code_cache->max_count) { + int new_max = code_cache->max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; + code_cache->entries = entries; + code_cache->max_count = new_max; } - for (i=__pyx_code_cache.count; i>pos; i--) { + for (i=code_cache->count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; - __pyx_code_cache.count++; + code_cache->count++; Py_INCREF(code_object); } +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) { +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS + (void)__pyx__insert_code_object; + return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail. +#else + struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_nonatomic_int_type expected = 0; + if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) { + return; + } #endif + __pyx__insert_code_object(code_cache, code_line, code_object); +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN); +#endif +#endif +} /* AddTraceback */ #include "compile.h" @@ -8014,35 +7963,12 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { - PyObject *result; - result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); - #if __PYX_LIMITED_VERSION_HEX < 0x030780000 - { - PyObject *compiled = NULL, *result = NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; - compiled = Py_CompileString( - "out = type(code)(\n" - " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" - " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" - " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" - " code.co_lnotab)\n", "", Py_file_input); - if (!compiled) return NULL; - result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); - Py_DECREF(compiled); - if (!result) PyErr_Print(); - Py_DECREF(result); - result = PyDict_GetItemString(scratch_dict, "out"); - if (result) Py_INCREF(result); - return result; - } - #else return NULL; - #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { @@ -8055,20 +7981,26 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); - code_object = Py_CompileString("_getframe()", filename, Py_eval_input); - 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 (unlikely(!py_funcname)) goto bad; - dict = PyDict_New(); - if (unlikely(!dict)) goto bad; - { - PyObject *old_code_object = code_object; - code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); - Py_DECREF(old_code_object); + code_object = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!code_object) { + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + 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 (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, code_object); + } else { + dict = PyDict_New(); } - if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; @@ -8094,58 +8026,17 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; - #if PY_MAJOR_VERSION < 3 - PyObject *py_srcfile = NULL; - py_srcfile = PyString_FromString(filename); - if (!py_srcfile) goto bad; - #endif if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - if (!py_funcname) goto bad; - #endif } - #if PY_MAJOR_VERSION < 3 - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - #else py_code = PyCode_NewEmpty(filename, funcname, py_line); - #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_srcfile); - #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -8176,7 +8067,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ + __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; @@ -8189,23 +8080,78 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #endif /* FormatTypeName */ -#if CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 static __Pyx_TypeName -__Pyx_PyType_GetName(PyTypeObject* tp) +__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp) { - PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_n_s_name_2); - if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { - PyErr_Clear(); - Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__16); + PyObject *module = NULL, *name = NULL, *result = NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030b0000 + name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_mstate_global->__pyx_n_u_qualname); + #else + name = PyType_GetQualName(tp); + #endif + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad; + module = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_mstate_global->__pyx_n_u_module); + if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad; + if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) { + result = name; + name = NULL; + goto done; + } + result = PyUnicode_FromFormat("%U.%U", module, name); + if (unlikely(result == NULL)) goto bad; + done: + Py_XDECREF(name); + Py_XDECREF(module); + return result; + bad: + PyErr_Clear(); + if (name) { + result = name; + name = NULL; + } else { + result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_); + } + goto done; +} +#endif + +/* PyObjectVectorCallKwBuilder */ +#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); + args[n] = value; + return 0; +} +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_VectorcallBuilder_AddArgStr; + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n); +} +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + PyObject *pyKey = PyUnicode_FromString(key); + if (!pyKey) return -1; + return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n); +} +#else // CYTHON_VECTORCALL +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) { + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; } - return name; + return PyDict_SetItem(builder, key, value); } #endif /* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -8217,17 +8163,17 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG +#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); @@ -8248,25 +8194,25 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + PyObject *from_bytes, *result = NULL, *kwds = NULL; + PyObject *py_bytes = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - if (!is_unsigned) { - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + { + PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; + if (!is_unsigned) { + kwds = __Pyx_MakeVectorcallBuilderKwds(1); + if (!kwds) goto limited_bad; + if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; + } + result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } - result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); - Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); @@ -8298,7 +8244,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { } /* CIntFromPy */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -8308,24 +8254,11 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(long) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + val = __Pyx_PyLong_As_long(tmp); Py_DECREF(tmp); return val; } @@ -8565,7 +8498,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { } /* CIntFromPy */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -8575,24 +8508,11 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); + val = __Pyx_PyLong_As_int(tmp); Py_DECREF(tmp); return val; } @@ -8872,29 +8792,6 @@ static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } -#if PY_MAJOR_VERSION == 2 -static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { - PyObject *exception, *value, *tb; - int res; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&exception, &value, &tb); - res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - if (!res) { - res = PyObject_IsSubclass(err, exc_type2); - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - } - __Pyx_ErrRestore(exception, value, tb); - return res; -} -#else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); @@ -8902,21 +8799,15 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } -#endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 +#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 return Py_Version & ~0xFFUL; #else - 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'); + 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; } - version += factor * digit; - if (rt_version[i] != '.') - break; - digit = 0; - factor >>= 8; - ++i; + __Pyx_cached_runtime_version = version; } - return 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; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) @@ -8994,45 +8891,165 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt } } -/* InitStrings */ -#if PY_MAJOR_VERSION >= 3 -static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { - if (t.is_unicode | t.is_str) { - if (t.intern) { - *str = PyUnicode_InternFromString(t.s); - } else if (t.encoding) { - *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); +/* NewCodeObj */ +#if CYTHON_COMPILING_IN_LIMITED_API + static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030b0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); } else { - *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } - } else { - *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; } - if (!*str) - return -1; - if (PyObject_Hash(*str) == -1) - return -1; - return 0; -} +#elif PY_VERSION_HEX >= 0x030B0000 + static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + 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); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !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 + #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION >= 3 - __Pyx_InitString(*t, t->p); - #else +static PyObject* __Pyx_PyCode_New( + const __Pyx_PyCode_New_function_description descr, + PyObject * const *varnames, + PyObject *filename, + PyObject *funcname, + const char *line_table, + PyObject *tuple_dedup_map +) { + PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_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; + for (Py_ssize_t i=0; i < var_count; i++) { + Py_INCREF(varnames[i]); + if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done; + } + #if CYTHON_COMPILING_IN_LIMITED_API + varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple); + if (!varnames_tuple_dedup) { + if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done; + varnames_tuple_dedup = varnames_tuple; + } + #else + varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple); + if (unlikely(!varnames_tuple_dedup)) goto done; + #endif + #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; + code_bytes = PyBytes_FromStringAndSize(NULL, code_len); + if (unlikely(!code_bytes)) goto done; + char* c_code_bytes = PyBytes_AsString(code_bytes); + if (unlikely(!c_code_bytes)) goto done; + memset(c_code_bytes, 0, (size_t) code_len); + } + code_obj = (PyObject*) __Pyx__PyCode_New( + (int) descr.argcount, + (int) descr.num_posonly_args, + (int) descr.num_kwonly_args, + (int) descr.nlocals, + 0, + (int) descr.flags, + code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + varnames_tuple_dedup, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + filename, + funcname, + (int) descr.first_line, + (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table_bytes) ? line_table_bytes : __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 + Py_DECREF(varnames_tuple); + 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) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); + 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 { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + str = PyBytes_FromStringAndSize(t->s, t->n - 1); } - if (!*t->p) + if (!str) return -1; - if (PyObject_Hash(*t->p) == -1) + *target = str; + if (PyObject_Hash(str) == -1) return -1; - #endif ++t; + ++target; } return 0; } @@ -9060,31 +9077,30 @@ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#if !CYTHON_PEP393_ENABLED -static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } + const char* result; + Py_ssize_t unicode_length; + CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 + if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL; + #else + result = PyUnicode_AsUTF8AndSize(o, length); + #endif + #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + unicode_length = PyUnicode_GetLength(o); + if (unlikely(unicode_length < 0)) return NULL; + if (unlikely(unicode_length != *length)) { + PyUnicode_AsASCIIString(o); + return NULL; } + #endif + return result; } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -} #else -static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); @@ -9096,25 +9112,25 @@ static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py #else return PyUnicode_AsUTF8AndSize(o, length); #endif -} #endif +} #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + if (PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif -#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { +#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))) *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); - } else +#else + *length = PyByteArray_Size(o); + if (*length == -1) return NULL; + return PyByteArray_AsString(o); #endif + } else { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); @@ -9137,9 +9153,8 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { Py_DECREF(x); return retval; } -static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { - __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); -#if PY_MAJOR_VERSION >= 3 +static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result)); if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " @@ -9153,74 +9168,44 @@ static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const __Pyx_DECREF_TypeName(result_type_name); return result; } -#endif PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", - type_name, type_name, result_type_name); + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")", + result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif - const char *name = NULL; PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x) || PyLong_Check(x))) -#else if (likely(PyLong_Check(x))) -#endif - return __Pyx_NewRef(x); + return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; - #if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = m->nb_int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = m->nb_long(x); - } - #else if (likely(m && m->nb_int)) { - name = "int"; - res = m->nb_int(x); + res = m->nb_int(x); } - #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { - res = PyNumber_Int(x); + res = PyNumber_Long(x); } #endif if (likely(res)) { -#if PY_MAJOR_VERSION < 3 - if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { -#else - if (unlikely(!PyLong_CheckExact(res))) { -#endif - return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); - } + if (unlikely(!PyLong_CheckExact(res))) { + return __Pyx_PyNumber_LongWrongResultType(res); + } } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); + PyErr_SetString(PyExc_TypeError, + "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(b); - } -#endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { @@ -9266,34 +9251,349 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { } x = PyNumber_Index(b); if (!x) return -1; - ival = PyInt_AsSsize_t(x); + ival = PyLong_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); -#if PY_MAJOR_VERSION < 3 - } else if (likely(PyInt_CheckExact(o))) { - return PyInt_AS_LONG(o); -#endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; - ival = PyInt_AsLong(x); + ival = PyLong_AsLong(x); Py_DECREF(x); return ival; } } +static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) { + CYTHON_UNUSED_VAR(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); } -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { + return PyLong_FromSize_t(ival); +} + + +/* MultiPhaseInitModuleState */ +#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE +#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000) + #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1 +#else + #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0 +#endif +#endif +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS +#error "Module state with PEP489 requires atomics. Currently that's one of\ + C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics" +#endif +#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +#define __Pyx_ModuleStateLookup_Lock() +#define __Pyx_ModuleStateLookup_Unlock() +#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000 +static PyMutex __Pyx_ModuleStateLookup_mutex = {0}; +#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(__cplusplus) && __cplusplus >= 201103L +#include +static std::mutex __Pyx_ModuleStateLookup_mutex; +#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock() +#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock() +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__) +#include +static mtx_t __Pyx_ModuleStateLookup_mutex; +static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT; +static void __Pyx_ModuleStateLookup_initialize_mutex(void) { + mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain); +} +#define __Pyx_ModuleStateLookup_Lock()\ + call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\ + mtx_lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(HAVE_PTHREAD_H) +#include +static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER; +#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(_WIN32) +#include // synchapi.h on its own doesn't work +static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT; +#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) +#else +#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\ + Requires C standard >= C11, or C++ standard >= C++11,\ + or pthreads, or the Windows 32 API, or Python >= 3.13." +#endif +typedef struct { + int64_t id; + PyObject *module; +} __Pyx_InterpreterIdAndModule; +typedef struct { + char interpreter_id_as_index; + Py_ssize_t count; + Py_ssize_t allocated; + __Pyx_InterpreterIdAndModule table[1]; +} __Pyx_ModuleStateLookupData; +#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32 +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0; +#endif +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0; +#else +static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL; +#endif +static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound( + __Pyx_InterpreterIdAndModule* table, + Py_ssize_t count, + int64_t interpreterId) { + __Pyx_InterpreterIdAndModule* begin = table; + __Pyx_InterpreterIdAndModule* end = begin + count; + if (begin->id == interpreterId) { + return begin; + } + while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { + __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2; + if (halfway->id == interpreterId) { + return halfway; + } + if (halfway->id < interpreterId) { + begin = halfway; + } else { + end = halfway; + } + } + for (; begin < end; ++begin) { + if (begin->id >= interpreterId) return begin; + } + return begin; +} +static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return NULL; +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); + { + __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); + if (likely(data)) { + __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data); + if (likely(data == new_data)) { + goto read_finished; + } + } + __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); + __Pyx_ModuleStateLookup_Lock(); + __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter); + data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); + __Pyx_ModuleStateLookup_Unlock(); + } + read_finished:; +#else + __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data; +#endif + __Pyx_InterpreterIdAndModule* found = NULL; + if (unlikely(!data)) goto end; + if (data->interpreter_id_as_index) { + if (interpreter_id < data->count) { + found = data->table+interpreter_id; + } + } else { + found = __Pyx_State_FindModuleStateLookupTableLowerBound( + data->table, data->count, interpreter_id); + } + end: + { + PyObject *result=NULL; + if (found && found->id == interpreter_id) { + result = found->module; + } +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); +#endif + return result; + } +} +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) { + while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0); } - +#else +#define __Pyx_ModuleStateLookup_wait_until_no_readers() +#endif +static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) { + Py_ssize_t to_allocate = (*old_data)->allocated; + while (to_allocate <= interpreter_id) { + if (to_allocate == 0) to_allocate = 1; + else to_allocate *= 2; + } + __Pyx_ModuleStateLookupData *new_data = *old_data; + if (to_allocate != (*old_data)->allocated) { + new_data = (__Pyx_ModuleStateLookupData *)realloc( + *old_data, + sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); + if (!new_data) { + PyErr_NoMemory(); + return -1; + } + for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) { + new_data->table[i].id = i; + new_data->table[i].module = NULL; + } + new_data->allocated = to_allocate; + } + new_data->table[interpreter_id].module = module; + if (new_data->count < interpreter_id+1) { + new_data->count = interpreter_id+1; + } + *old_data = new_data; + return 0; +} +static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) { + __Pyx_InterpreterIdAndModule *read = data->table; + __Pyx_InterpreterIdAndModule *write = data->table; + __Pyx_InterpreterIdAndModule *end = read + data->count; + for (; readmodule) { + write->id = read->id; + write->module = read->module; + ++write; + } + } + data->count = write - data->table; + for (; writeid = 0; + write->module = NULL; + } + data->interpreter_id_as_index = 0; +} +static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return -1; + int result = 0; + __Pyx_ModuleStateLookup_Lock(); +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *) + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); +#else + __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data; +#endif + __Pyx_ModuleStateLookupData *new_data = old_data; + if (!new_data) { + new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData)); + if (!new_data) { + result = -1; + PyErr_NoMemory(); + goto end; + } + new_data->allocated = 1; + new_data->interpreter_id_as_index = 1; + } + __Pyx_ModuleStateLookup_wait_until_no_readers(); + if (new_data->interpreter_id_as_index) { + if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { + result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id); + goto end; + } + __Pyx_State_ConvertFromInterpIdAsIndex(new_data); + } + { + Py_ssize_t insert_at = 0; + { + __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( + new_data->table, new_data->count, interpreter_id); + assert(lower_bound); + insert_at = lower_bound - new_data->table; + if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) { + lower_bound->module = module; + goto end; // already in table, nothing more to do + } + } + if (new_data->count+1 >= new_data->allocated) { + Py_ssize_t to_allocate = (new_data->count+1)*2; + new_data = + (__Pyx_ModuleStateLookupData*)realloc( + new_data, + sizeof(__Pyx_ModuleStateLookupData) + + (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); + if (!new_data) { + result = -1; + new_data = old_data; + PyErr_NoMemory(); + goto end; + } + new_data->allocated = to_allocate; + } + ++new_data->count; + int64_t last_id = interpreter_id; + PyObject *last_module = module; + for (Py_ssize_t i=insert_at; icount; ++i) { + int64_t current_id = new_data->table[i].id; + new_data->table[i].id = last_id; + last_id = current_id; + PyObject *current_module = new_data->table[i].module; + new_data->table[i].module = last_module; + last_module = current_module; + } + } + end: +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data); +#else + __Pyx_ModuleStateLookup_data = new_data; +#endif + __Pyx_ModuleStateLookup_Unlock(); + return result; +} +static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return -1; + __Pyx_ModuleStateLookup_Lock(); +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *) + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); +#else + __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data; +#endif + if (data->interpreter_id_as_index) { + if (interpreter_id < data->count) { + data->table[interpreter_id].module = NULL; + } + goto done; + } + { + __Pyx_ModuleStateLookup_wait_until_no_readers(); + __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( + data->table, data->count, interpreter_id); + if (!lower_bound) goto done; + if (lower_bound->id != interpreter_id) goto done; + __Pyx_InterpreterIdAndModule *end = data->table+data->count; + for (;lower_boundid = (lower_bound+1)->id; + lower_bound->module = (lower_bound+1)->module; + } + } + --data->count; + if (data->count == 0) { + free(data); + data = NULL; + } + done: +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data); +#else + __Pyx_ModuleStateLookup_data = data; +#endif + __Pyx_ModuleStateLookup_Unlock(); + return 0; +} +#endif /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER diff --git a/constraint/parser.c b/constraint/parser.c index 30e398e..7bb7a00 100644 --- a/constraint/parser.c +++ b/constraint/parser.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.0.12 */ +/* Generated by Cython 3.1.1 */ /* BEGIN: Cython Metadata { @@ -18,32 +18,21 @@ END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ -#if defined(CYTHON_LIMITED_API) && 0 - #ifndef Py_LIMITED_API - #if CYTHON_LIMITED_API+0 > 0x03030000 - #define Py_LIMITED_API CYTHON_LIMITED_API - #else - #define Py_LIMITED_API 0x03030000 - #endif - #endif +/* InitLimitedAPI */ +#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API) + #define CYTHON_LIMITED_API 1 #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) - #error Cython requires Python 2.7+ or Python 3.3+. -#else -#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API -#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#elif PY_VERSION_HEX < 0x03080000 + #error Cython requires Python 3.8+. #else -#define __PYX_EXTRA_ABI_MODULE_NAME "" -#endif -#define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME -#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI -#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x03000CF0 +#define __PYX_ABI_VERSION "3_1_1" +#define CYTHON_HEX_VERSION 0x030101F0 #define CYTHON_FUTURE_DIVISION 1 +/* CModulePreamble */ #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -83,19 +72,13 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -106,8 +89,12 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #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 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -119,18 +106,22 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 + #define CYTHON_USE_EXC_INFO_STACK 1 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif @@ -141,20 +132,14 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 + #define CYTHON_USE_TYPE_SLOTS 1 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -165,8 +150,13 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #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 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -178,7 +168,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT @@ -188,14 +178,19 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00) + #endif + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100) #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 @@ -208,7 +203,7 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS @@ -217,8 +212,6 @@ END: Cython Metadata */ #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -231,8 +224,13 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -240,71 +238,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 1 - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif - #undef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 -#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 1 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #ifndef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #ifndef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 1 - #endif + #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS @@ -316,26 +250,37 @@ END: Cython Metadata */ #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 + #define CYTHON_USE_TP_FINALIZE 0 + #endif + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000) #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 - #endif - #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif + #undef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #ifndef CYTHON_USE_TYPE_SLOTS + #ifdef Py_GIL_DISABLED + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1 + #else + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 + #endif + #if PY_VERSION_HEX < 0x030A0000 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #elif !defined(CYTHON_USE_TYPE_SLOTS) #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS @@ -344,22 +289,19 @@ END: Cython Metadata */ #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif - #if PY_MAJOR_VERSION < 3 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif - #ifndef CYTHON_USE_PYLIST_INTERNALS + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLIST_INTERNALS) #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif - #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) @@ -368,20 +310,32 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 + #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS) + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif - #ifndef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #elif !defined(CYTHON_FAST_GIL) + #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #define CYTHON_METH_FASTCALL 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 @@ -389,51 +343,49 @@ END: Cython Metadata */ #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif - #if PY_VERSION_HEX < 0x030400a1 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #elif !defined(CYTHON_USE_TP_FINALIZE) + #ifndef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1) + #endif + #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif - #if PY_VERSION_HEX < 0x030600B1 + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 1 + #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE) #endif - #if PY_VERSION_HEX < 0x030700A3 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 1 + #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif #endif -#if !defined(CYTHON_FAST_PYCCALL) -#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#ifndef CYTHON_FAST_PYCCALL +#define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL #endif -#if !defined(CYTHON_VECTORCALL) +#ifndef CYTHON_VECTORCALL +#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) #endif +#endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS - #if PY_MAJOR_VERSION < 3 - #include "longintrepr.h" - #endif #undef SHIFT #undef BASE #undef MASK @@ -568,6 +520,9 @@ END: Cython Metadata */ #endif #endif #endif +#ifndef Py_UNREACHABLE + #define Py_UNREACHABLE() assert(0); abort() +#endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; @@ -582,6 +537,7 @@ END: Cython Metadata */ #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) +/* CInitCode */ #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) @@ -596,109 +552,42 @@ END: Cython Metadata */ #endif #endif +/* PythonCompatibility */ #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_DefaultClassType PyClass_Type - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_DefaultClassType PyType_Type +#define __Pyx_BUILTIN_MODULE_NAME "builtins" +#define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API - static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyObject *exception_table = NULL; - PyObject *types_module=NULL, *code_type=NULL, *result=NULL; - #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; - PyObject *py_minor_version = NULL; - #endif - long minor_version = 0; - PyObject *type, *value, *traceback; - PyErr_Fetch(&type, &value, &traceback); - #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; - #else - if (!(version_info = PySys_GetObject("version_info"))) goto end; - if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; - minor_version = PyLong_AsLong(py_minor_version); - Py_DECREF(py_minor_version); - if (minor_version == -1 && PyErr_Occurred()) goto end; - #endif - if (!(types_module = PyImport_ImportModule("types"))) goto end; - if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; - if (minor_version <= 7) { - (void)p; - result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else if (minor_version <= 10) { - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else { - if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); - } - end: - Py_XDECREF(code_type); - Py_XDECREF(exception_table); - Py_XDECREF(types_module); - if (type) { - PyErr_Restore(type, value, traceback); - } - return result; - } #ifndef CO_OPTIMIZED - #define CO_OPTIMIZED 0x0001 + static int CO_OPTIMIZED; #endif #ifndef CO_NEWLOCALS - #define CO_NEWLOCALS 0x0002 + static int CO_NEWLOCALS; #endif #ifndef CO_VARARGS - #define CO_VARARGS 0x0004 + static int CO_VARARGS; #endif #ifndef CO_VARKEYWORDS - #define CO_VARKEYWORDS 0x0008 + static int CO_VARKEYWORDS; #endif #ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x0200 + static int CO_ASYNC_GENERATOR; #endif #ifndef CO_GENERATOR - #define CO_GENERATOR 0x0020 + static int CO_GENERATOR; #endif #ifndef CO_COROUTINE - #define CO_COROUTINE 0x0080 + static int CO_COROUTINE; #endif -#elif PY_VERSION_HEX >= 0x030B0000 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); - if (!empty_bytes) return NULL; - result = - #if PY_VERSION_HEX >= 0x030C0000 - PyUnstable_Code_NewWithPosOnlyArgs - #else - PyCode_NewWithPosOnlyArgs - #endif - (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); - Py_DECREF(empty_bytes); - return result; - } -#elif PY_VERSION_HEX >= 0x030800B2 && !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 - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 + #endif #endif +static int __Pyx_init_co_variables(void); #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else @@ -730,12 +619,6 @@ END: Cython Metadata */ #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif -#ifndef CO_COROUTINE - #define CO_COROUTINE 0x80 -#endif -#ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x200 -#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -757,7 +640,7 @@ END: Cython Metadata */ #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif -#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) +#ifndef METH_FASTCALL #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif @@ -795,7 +678,7 @@ END: Cython Metadata */ #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif -#if PY_MAJOR_VERSION >= 0x030900B1 +#if PY_VERSION_HEX >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) @@ -812,7 +695,7 @@ static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif -static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { +static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else @@ -820,7 +703,7 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) -#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 +#if __PYX_LIMITED_VERSION_HEX < 0x03090000 #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 @@ -836,8 +719,10 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_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)) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) @@ -848,15 +733,11 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() -#elif PY_VERSION_HEX >= 0x03060000 - #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() -#elif PY_VERSION_HEX >= 0x03000000 - #define __Pyx_PyThreadState_Current PyThreadState_GET() #else - #define __Pyx_PyThreadState_Current _PyThreadState_Current + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #endif -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +#if CYTHON_USE_MODULE_STATE +static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); @@ -864,85 +745,43 @@ static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) Py_FatalError("Couldn't find the module state"); return result; } -#endif -#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o) #else - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) -#endif -#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) -#include "pythread.h" -#define Py_tss_NEEDS_INIT 0 -typedef int Py_tss_t; -static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { - *key = PyThread_create_key(); - return 0; -} -static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { - Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); - *key = Py_tss_NEEDS_INIT; - return key; -} -static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { - PyObject_Free(key); -} -static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { - return *key != Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { - PyThread_delete_key(*key); - *key = Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { - return PyThread_set_key_value(*key, value); -} -static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { - return PyThread_get_key_value(*key); -} -#endif -#if PY_MAJOR_VERSION < 3 - #if CYTHON_COMPILING_IN_PYPY - #if PYPY_VERSION_NUM < 0x07030600 - #if defined(__cplusplus) && __cplusplus >= 201402L - [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] - #elif defined(__GNUC__) || defined(__clang__) - __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) - #elif defined(_MSC_VER) - __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) - #endif - static CYTHON_INLINE int PyGILState_Check(void) { - return 0; - } - #else // PYPY_VERSION_NUM < 0x07030600 - #endif // PYPY_VERSION_NUM < 0x07030600 - #else - static CYTHON_INLINE int PyGILState_Check(void) { - PyThreadState * tstate = _PyThreadState_Current; - return tstate && (tstate == PyGILState_GetThisThreadState()); - } - #endif +#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global) #endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype) +#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype) +#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype) +#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype) +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype) + #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL) + #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\ + ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\ + (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\ + __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL) + #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype) + #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype) +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif -#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) +#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } -#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000 #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else @@ -966,17 +805,11 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) - #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) - #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) -#else - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif +#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ @@ -988,24 +821,20 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) -#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 +#else #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) @@ -1021,20 +850,6 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif -#else - #define CYTHON_PEP393_ENABLED 0 - #define PyUnicode_1BYTE_KIND 1 - #define PyUnicode_2BYTE_KIND 2 - #define PyUnicode_4BYTE_KIND 4 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) @@ -1048,8 +863,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif - #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) - #undef PyUnicode_Contains + #if !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) @@ -1059,33 +873,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #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 PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#ifndef PyObject_Unicode - #define PyObject_Unicode PyObject_Str -#endif -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) @@ -1102,28 +890,75 @@ 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_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS + #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) + #else + #define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i) + #endif +#else + #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) +#endif +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 +#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) +#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyObject_GetItem(dict, key); + if (*result == NULL) { + if (PyErr_ExceptionMatches(PyExc_KeyError)) { + PyErr_Clear(); + return 0; + } + return -1; + } + return 1; +} +#else +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyDict_GetItemWithError(dict, key); + if (*result == NULL) { + return PyErr_Occurred() ? -1 : 0; + } + Py_INCREF(*result); + return 1; +} +#endif +#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST + #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj) +#else + #define __Pyx_VISIT_CONST(obj) +#endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i) +#endif +#if CYTHON_ASSUME_SAFE_SIZE #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o) #else - #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) - #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) - #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) - #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) #endif -#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 +#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) { @@ -1132,86 +967,139 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, return module; } #endif -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define __Pyx_Py3Int_Check(op) PyLong_Check(op) - #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#else - #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) - #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t -#endif -#if CYTHON_USE_ASYNC_SLOTS - #if PY_VERSION_HEX >= 0x030500B1 - #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods - #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) - #else - #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) - #endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) +#endif +#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t +#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t +#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 + #define __Pyx_PySendResult PySendResult +#else + typedef enum { + PYGEN_RETURN = 0, + PYGEN_ERROR = -1, + PYGEN_NEXT = 1, + } __Pyx_PySendResult; +#endif +#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3 + typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result); +#else + #define __Pyx_pyiter_sendfunc sendfunc +#endif +#if !CYTHON_USE_AM_SEND +#define __PYX_HAS_PY_AM_SEND 0 +#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000 +#define __PYX_HAS_PY_AM_SEND 1 #else - #define __Pyx_PyType_AsAsync(obj) NULL +#define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation #endif -#ifndef __Pyx_PyAsyncMethodsStruct +#if __PYX_HAS_PY_AM_SEND < 2 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods +#else typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; + __Pyx_pyiter_sendfunc am_send; } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s)) #endif - -#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) - #if !defined(_USE_MATH_DEFINES) - #define _USE_MATH_DEFINES - #endif -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) +#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0 + #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21) #else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} + #define __Pyx_TPFLAGS_HAVE_AM_SEND (0) #endif -#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) -#define __Pyx_truncl trunc +#if PY_VERSION_HEX >= 0x03090000 +#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get() #else -#define __Pyx_truncl truncl +#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp #endif - -#define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } -#define __PYX_ERR(f_index, lineno, Ln_error) \ +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000 +#ifdef __cplusplus +extern "C" +#endif +PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize); +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) { + int value; + PyObject *py_value = PyObject_GetAttrString(inspect, name); + if (!py_value) return 0; + value = (int) PyLong_AsLong(py_value); + Py_DECREF(py_value); + *write_to = value; + return value != -1 || !PyErr_Occurred(); +} +static int __Pyx_init_co_variables(void) { + PyObject *inspect; + int result; + inspect = PyImport_ImportModule("inspect"); + result = +#if !defined(CO_OPTIMIZED) + __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) && +#endif +#if !defined(CO_NEWLOCALS) + __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) && +#endif +#if !defined(CO_VARARGS) + __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) && +#endif +#if !defined(CO_VARKEYWORDS) + __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) && +#endif +#if !defined(CO_ASYNC_GENERATOR) + __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) && +#endif +#if !defined(CO_GENERATOR) + __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) && +#endif +#if !defined(CO_COROUTINE) + __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) && +#endif + 1; + Py_DECREF(inspect); + return result ? 0 : -1; +} +#else +static int __Pyx_init_co_variables(void) { + return 0; // It's a limited API-only feature +} +#endif + +/* MathInitCode */ +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #ifndef _USE_MATH_DEFINES + #define _USE_MATH_DEFINES + #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 +#define __Pyx_truncl truncl +#endif + +#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0 +#endif +#ifndef CYTHON_CLINE_IN_TRACEBACK +#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#endif +#if CYTHON_CLINE_IN_TRACEBACK +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; } +#else +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; } +#endif +#define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C @@ -1242,12 +1130,8 @@ static CYTHON_INLINE float __PYX_NAN() { #define CYTHON_WITHOUT_ASSERTIONS #endif -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -1290,19 +1174,23 @@ static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s) +#else + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s) +#endif #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) @@ -1311,32 +1199,44 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef) + return Py_NewRef(obj); +#else + Py_INCREF(obj); + return obj; +#endif +} +static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef) + return Py_XNewRef(obj); +#else + Py_XINCREF(obj); + return obj; +#endif +} +static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b); static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x) #else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x) #endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x)) #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK @@ -1383,81 +1283,12 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -#include -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = (char) c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL) #else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#include -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #endif @@ -1469,25 +1300,193 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) { #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ +/* PretendToInitialize */ +#ifdef __cplusplus +#include +template +static void __Pyx_pretend_to_initialize(T* ptr) { +#if __cplusplus > 201103L + if ((std::is_trivially_default_constructible::value)) +#endif + *ptr = T(); + (void)ptr; +} +#else static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } +#endif + #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; -static const char * __pyx_cfilenm = __FILE__; +static const char * const __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ -static const char *__pyx_f[] = { +static const char* const __pyx_f[] = { "constraint/parser.py", }; /* #### Code section: utility_code_proto_before_types ### */ -/* ForceInitThreads.proto */ -#ifndef __PYX_FORCE_INIT_THREADS - #define __PYX_FORCE_INIT_THREADS 0 +/* Atomics.proto */ +#include +#ifndef CYTHON_ATOMICS + #define CYTHON_ATOMICS 1 +#endif +#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS +#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __pyx_atomic_int_type int +#define __pyx_nonatomic_int_type int +#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ + (__STDC_VERSION__ >= 201112L) &&\ + !defined(__STDC_NO_ATOMICS__)) + #include +#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ + (__cplusplus >= 201103L) ||\ + (defined(_MSC_VER) && _MSC_VER >= 1700))) + #include +#endif +#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ + (__STDC_VERSION__ >= 201112L) &&\ + !defined(__STDC_NO_ATOMICS__) &&\ + ATOMIC_INT_LOCK_FREE == 2) + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type atomic_int + #define __pyx_atomic_ptr_type atomic_uintptr_t + #define __pyx_nonatomic_ptr_type uintptr_t + #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed) + #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel) + #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel) + #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg) + #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired) + #define __pyx_atomic_load(value) atomic_load(value) + #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value) + #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) + #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) + #pragma message ("Using standard C atomics") + #elif defined(__PYX_DEBUG_ATOMICS) + #warning "Using standard C atomics" + #endif +#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ + (__cplusplus >= 201103L) ||\ +\ + (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\ + ATOMIC_INT_LOCK_FREE == 2) + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type std::atomic_int + #define __pyx_atomic_ptr_type std::atomic_uintptr_t + #define __pyx_nonatomic_ptr_type uintptr_t + #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed) + #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel) + #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel) + #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg) + #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired) + #define __pyx_atomic_load(value) std::atomic_load(value) + #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value) + #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) + #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) + #pragma message ("Using standard C++ atomics") + #elif defined(__PYX_DEBUG_ATOMICS) + #warning "Using standard C++ atomics" + #endif +#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\ + (__GNUC_MINOR__ > 1 ||\ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2)))) + #define __pyx_atomic_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) + #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg) + static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { + __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired); + int result = old == *expected; + *expected = old; + return result; + } + #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0) + #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value) + #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) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using GNU atomics" + #endif +#elif CYTHON_ATOMICS && defined(_MSC_VER) + #include + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type long + #define __pyx_atomic_ptr_type void* + #undef __pyx_nonatomic_int_type + #define __pyx_nonatomic_int_type long + #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) + #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1) + #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg) + static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { + __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected); + int result = old == *expected; + *expected = old; + return result; + } + #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0) + #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value) + #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) + #ifdef __PYX_DEBUG_ATOMICS + #pragma message ("Using MSVC atomics") + #endif +#else + #undef CYTHON_ATOMICS + #define CYTHON_ATOMICS 0 + #ifdef __PYX_DEBUG_ATOMICS + #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 */ +#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) +#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 +#endif +#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_BEGIN_CRITICAL_SECTION(o) { +#define __Pyx_END_CRITICAL_SECTION() } +#else +#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION +#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION #endif /* #### Code section: numeric_typedefs ### */ @@ -1500,17 +1499,18 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr; -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint; -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr; +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr; +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr; +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr; -/* "constraint/parser.py":23 +/* "constraint/parser.py":24 * ) * * 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 - */ +*/ struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions { PyObject_HEAD PyObject *__pyx_v_params_used; @@ -1518,13 +1518,13 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions { }; -/* "constraint/parser.py":71 +/* "constraint/parser.py":72 * return split_restrictions * * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: - */ +*/ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint { PyObject_HEAD PyObject *__pyx_v_operator; @@ -1532,13 +1532,13 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint }; -/* "constraint/parser.py":83 +/* "constraint/parser.py":84 * * # split the string on the comparison and remove leading and trailing whitespace * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< * * # find out which side is the constant number - */ +*/ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; @@ -1549,14 +1549,29 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr { }; -/* "constraint/parser.py":144 +/* "constraint/parser.py":104 + * variable_supported_operators = ['+'] + * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] + * if all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # <<<<<<<<<<<<<< + * variables_on_left = len(right) == 1 + * if comparator == "==": +*/ +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_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_s; +}; + + +/* "constraint/parser.py":159 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< * # if the operator is inconsistent (e.g. 'x + y * z == 3'), return None * return None - */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr { +*/ +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr { PyObject_HEAD struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; @@ -1564,14 +1579,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr { }; -/* "constraint/parser.py":151 +/* "constraint/parser.py":166 * 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_4_genexpr { +*/ +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr { PyObject_HEAD struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; @@ -1579,43 +1594,43 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr { }; -/* "constraint/parser.py":172 +/* "constraint/parser.py":187 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: - */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint { +*/ +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_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":191 +/* "constraint/parser.py":206 * 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_6_genexpr { +*/ +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr { PyObject_HEAD - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint *__pyx_outer_scope; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_s; }; -/* "constraint/parser.py":201 +/* "constraint/parser.py":216 * * # 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] - */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr { +*/ +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_r; @@ -1640,7 +1655,6 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr { static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ @@ -1654,11 +1668,6 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr { __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) - #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() -#endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ @@ -1770,6 +1779,8 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +#endif +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif @@ -1784,78 +1795,68 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i) #elif CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i)) #else - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) -#endif -#if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) - #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) -#else - #define __Pyx_Arg_NewRef_VARARGS(arg) arg - #define __Pyx_Arg_XDECREF_VARARGS(arg) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i)) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL - #define __Pyx_Arg_FASTCALL(args, i) args[i] - #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i]) + #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif - #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs - to have the same reference counting */ - #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else - #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS + #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS - #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) - #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS -#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) -#else #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) +#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) #endif -/* 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); - /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, - const char* function_name); - -/* 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); +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 */ +#define __Pyx_CallCFunction(cfunc, self, args)\ + ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args) +#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\ + ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs) +#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\ + ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs) +#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 **args, Py_ssize_t nargs, PyObject *kwargs); +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) @@ -1865,12 +1866,6 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" -#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else @@ -1899,10 +1894,69 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject /* PyObjectFastCall.proto */ #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 **args, size_t nargs, PyObject *kwargs); +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs); + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS + __pyx_atomic_int_type initialized; +#endif + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) { +#if !CYTHON_ATOMICS + return 1; +#else + __pyx_nonatomic_int_type expected = 0; + if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) { + return 0; + } + return expected; +#endif +} +static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) { +#if CYTHON_ATOMICS + __pyx_atomic_store(&cfunc->initialized, 2); +#endif +} +#else +#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2 +#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc) +#endif + +/* CallUnboundCMethod2.proto */ +CYTHON_UNUSED +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); +#else +#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) +#endif + +/* 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); + +/* 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 +#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL) +#else +static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf); +#endif /* RaiseClosureNameError.proto */ -static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); +static void __Pyx_RaiseClosureNameError(const char *varname); /* PyDictContains.proto */ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { @@ -1911,13 +1965,26 @@ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, } /* PyObject_Unicode.proto */ -#if PY_MAJOR_VERSION >= 3 #define __Pyx_PyObject_Unicode(obj)\ (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(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_PyObject_Unicode(obj)\ - (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj)) +#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)) /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { @@ -1977,7 +2044,7 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ - (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) @@ -2014,22 +2081,19 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); - -/* PyIntBinop.proto */ +/* PyLongBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else -#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ +#define __Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif -/* PyIntBinop.proto */ +/* PyLongBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +static CYTHON_INLINE PyObject* __Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else -#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\ +#define __Pyx_PyLong_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif @@ -2055,6 +2119,9 @@ 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); + /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); @@ -2069,10 +2136,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( int has_cstart, int has_cstop, int wraparound); /* AssertionsEnabled.proto */ -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define __Pyx_init_assertions_enabled() (0) - #define __pyx_assertions_enabled() (1) -#elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) +#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) { @@ -2118,6 +2182,9 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif +/* RaiseUnboundLocalError.proto */ +static void __Pyx_RaiseUnboundLocalError(const char *varname); + /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) @@ -2126,9 +2193,6 @@ static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif -/* RaiseUnboundLocalError.proto */ -static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); - /* pep479.proto */ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); @@ -2138,53 +2202,30 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); -/* IncludeStructmemberH.proto */ -#include - /* FixUpExtensionType.proto */ -#if CYTHON_USE_TYPE_SPECS -static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); -#endif +static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); +/* dict_setdefault.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type); + /* FetchCommonType.proto */ -#if !CYTHON_USE_TYPE_SPECS -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); -#else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); -#endif -/* PyMethodNew.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - typesModule = PyImport_ImportModule("types"); - if (!typesModule) return NULL; - methodType = PyObject_GetAttrString(typesModule, "MethodType"); - Py_DECREF(typesModule); - if (!methodType) return NULL; - result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); - Py_DECREF(methodType); - return result; -} -#elif PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - return PyMethod_New(func, self); -} +/* 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 #else - #define __Pyx_PyMethod_New PyMethod_New +static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg); #endif +/* PyMethodNew.proto */ +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); + /* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif @@ -2218,10 +2259,11 @@ typedef struct { #else PyCMethodObject func; #endif -#if CYTHON_BACKPORT_VECTORCALL +#if CYTHON_BACKPORT_VECTORCALL ||\ + (CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL) __pyx_vectorcallfunc func_vectorcall; #endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; @@ -2234,9 +2276,7 @@ typedef struct { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif - void *defaults; - int defaults_pyobjects; - size_t defaults_size; + PyObject *defaults; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -2245,10 +2285,10 @@ typedef struct { PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check -#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) -#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) -#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType) +#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType) +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, @@ -2257,9 +2297,8 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef * PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, - size_t size, - int pyobjects); +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, + PyTypeObject *defaults_type); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, @@ -2272,7 +2311,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 +#if CYTHON_BACKPORT_VECTORCALL || 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) @@ -2297,11 +2336,6 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ PyObject_Format(s, f)) -#elif PY_MAJOR_VERSION < 3 - #define __Pyx_PyObject_FormatSimple(s, f) (\ - likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ - likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ - PyObject_Format(s, f)) #elif CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ @@ -2314,16 +2348,11 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); PyObject_Format(s, f)) #endif -/* UnpackUnboundCMethod.proto */ -typedef struct { - PyObject *type; - PyObject **method_name; - PyCFunction func; - PyObject *method; - int flag; -} __Pyx_CachedCFunction; +/* PyObjectCall2Args.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* CallUnboundCMethod1.proto */ +CYTHON_UNUSED static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); @@ -2332,7 +2361,7 @@ static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* #endif /* JoinPyUnicode.proto */ -static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, +static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char); /* IterFinish.proto */ @@ -2364,48 +2393,47 @@ 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); -/* PyObject_GenericGetAttrNoDict.proto */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr -#endif - /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); -#if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); -#endif + +/* ListPack.proto */ +static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* CLineInTraceback.proto */ -#ifdef CYTHON_CLINE_IN_TRACEBACK -#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) -#else +#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 */ -#if !CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject __Pyx_CachedCodeObjectType; +#else +typedef PyCodeObject __Pyx_CachedCodeObjectType; +#endif typedef struct { - PyCodeObject* code_object; + __Pyx_CachedCodeObjectType* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_int_type accessor_count; + #endif }; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); -#endif +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -2416,27 +2444,49 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #define __Pyx_HAS_GCC_DIAGNOSTIC #endif +/* PyObjectVectorCallKwBuilder.proto */ +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 +#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall +#endif +#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n) +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict +#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n) +#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value) +#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value) +#endif + /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" -static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 +#define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName #else +static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp); +#endif +#else // !LIMITED_API typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" -#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON @@ -2450,10 +2500,17 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) -#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) { + return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2); +} #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) +#ifdef PyExceptionInstance_Check + #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj) +#else + #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException) +#endif /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE @@ -2463,12 +2520,18 @@ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject * static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif -/* PyObjectCall2Args.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); +/* IterNextPlain.proto */ +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 */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); +/* ReturnWithStopIteration.proto */ +static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext); + /* CoroutineBase.proto */ struct __pyx_CoroutineObject; typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); @@ -2489,11 +2552,16 @@ typedef struct __pyx_CoroutineObject { PyObject *gi_weakreflist; PyObject *classobj; PyObject *yieldfrom; + __Pyx_pyiter_sendfunc yieldfrom_am_send; PyObject *gi_name; PyObject *gi_qualname; PyObject *gi_modulename; PyObject *gi_code; PyObject *gi_frame; +#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE) + PyMonitoringState __pyx_pymonitoring_state[__Pyx_MonitoringEventTypes_CyGen_count]; + uint64_t __pyx_pymonitoring_version; +#endif int resume_label; char is_running; } __pyx_CoroutineObject; @@ -2505,8 +2573,9 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( PyObject *name, PyObject *qualname, PyObject *module_name); static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); static int __Pyx_Coroutine_clear(PyObject *self); +static __Pyx_PySendResult __Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval); static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); -static PyObject *__Pyx_Coroutine_Close(PyObject *self); +static __Pyx_PySendResult __Pyx_Coroutine_Close(PyObject *self, PyObject **retval); static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); #if CYTHON_USE_EXC_INFO_STACK #define __Pyx_Coroutine_SwapException(self) @@ -2530,29 +2599,76 @@ static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); #endif static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); - -/* PatchModuleWithCoroutine.proto */ -static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); - -/* PatchGeneratorABC.proto */ -static int __Pyx_patch_abc(void); +static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen); +static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen); +static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen); +static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure); +#if __PYX_HAS_PY_AM_SEND == 2 +static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send); +#endif /* Generator.proto */ #define __Pyx_Generator_USED -#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_GeneratorType) +#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_GeneratorType) #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ - __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) + __Pyx__Coroutine_New(__pyx_mstate_global->__pyx_GeneratorType, body, code, closure, name, qualname, module_name) static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(PyObject *module); +static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self); -/* CheckBinaryVersion.proto */ +/* 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); -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); +/* MultiPhaseInitModuleState.proto */ +#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE +static PyObject *__Pyx_State_FindModule(void*); +static int __Pyx_State_AddModule(PyObject* module, void*); +static int __Pyx_State_RemoveModule(void*); +#elif CYTHON_USE_MODULE_STATE +#define __Pyx_State_FindModule PyState_FindModule +#define __Pyx_State_AddModule PyState_AddModule +#define __Pyx_State_RemoveModule PyState_RemoveModule +#endif /* #### Code section: module_declarations ### */ +/* CythonABIVersion.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API + #if CYTHON_METH_FASTCALL + #define __PYX_FASTCALL_ABI_SUFFIX "_fastcall" + #else + #define __PYX_FASTCALL_ABI_SUFFIX + #endif + #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX +#else + #define __PYX_LIMITED_ABI_SUFFIX +#endif +#if __PYX_HAS_PY_AM_SEND == 1 + #define __PYX_AM_SEND_ABI_SUFFIX +#elif __PYX_HAS_PY_AM_SEND == 2 + #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport" +#else + #define __PYX_AM_SEND_ABI_SUFFIX "noamsend" +#endif +#ifndef __PYX_MONITORING_ABI_SUFFIX + #define __PYX_MONITORING_ABI_SUFFIX +#endif +#if CYTHON_USE_TP_FINALIZE + #define __PYX_TP_FINALIZE_ABI_SUFFIX +#else + #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize" +#endif +#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED) + #define __PYX_FREELISTS_ABI_SUFFIX +#else + #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists" +#endif +#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." + /* Module declarations from "constraint.parser" */ /* #### Code section: typeinfo ### */ @@ -2570,8 +2686,11 @@ static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_compile; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "']]"; +static const char __pyx_k_1[] = "\2401"; +static const char __pyx_k_Q[] = "\230Q"; 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_r[] = "r"; static const char __pyx_k_s[] = "s"; static const char __pyx_k__2[] = "<="; @@ -2580,38 +2699,41 @@ 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__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__26[] = " "; -static const char __pyx_k__27[] = ""; -static const char __pyx_k__29[] = "("; -static const char __pyx_k__30[] = ")"; -static const char __pyx_k__34[] = ", "; -static const char __pyx_k__35[] = " \n"; -static const char __pyx_k__36[] = "."; -static const char __pyx_k__42[] = "?"; +static const char __pyx_k_Q_2[] = "\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[] = " \n"; +static const char __pyx_k__21[] = "."; +static const char __pyx_k__22[] = "?"; +static const char __pyx_k__23[] = "\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_args[] = "args"; 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_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__"; @@ -2628,8 +2750,10 @@ 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_value[] = "value"; static const char __pyx_k_enable[] = "enable"; -static const char __pyx_k_import[] = "__import__"; +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_params[] = "params"; static const char __pyx_k_return[] = "return"; @@ -2642,11 +2766,13 @@ 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_splitted[] = "splitted"; static const char __pyx_k_co_consts[] = "co_consts"; @@ -2674,16 +2800,19 @@ 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_number_is_int[] = "number_is_int"; static const char __pyx_k_AssertionError[] = "AssertionError"; static const char __pyx_k_replace_params[] = "replace_params"; static const char __pyx_k_operators_found[] = "operators_found"; +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_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"; @@ -2717,14 +2846,22 @@ 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_Optional_Union_int_float[] = "Optional[Union[int, float]]"; static const char __pyx_k_to_multiple_restrictions[] = "to_multiple_restrictions"; +static const char __pyx_k_VariableExactSumConstraint[] = "VariableExactSumConstraint"; 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_variable_supported_operators[] = "variable_supported_operators"; +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, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]"; +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_Q2_U_b_U_6_Q_q_t4uA_d_4y_a[] = "\320\000%\320%=\270Y\300a\360\006\000\005\034\2301\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\360b\003\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_A_avV6_a_Bhas_q_a_3a_Q_1_aq_he81[] = "\200A\330\025\"\240!\330\t\n\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#\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\250A\330\014\030\230\001\230\021\230&\240\003\2404\240u\250D\260\001\260\025\260b\270\007\270s\300\"\300G\3101\330\014\035\320\035;\2705\300\003\3001\300F\310#\310R\310s\320RU\320UV\320V]\320]`\320`a\330\020$\240C\240q\250\007\250s\260!\330\020\023\220;\230c\240\021\340\024\027\220q\330\030\037\320\0379\270\021\270)\3002\300T\310\031\320RU\320UV\340\030\037\320\0379\270\021\270)\3001\300D\310\t\320QR\320RS\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\031\230\n\240!\2408\2501\330\010\013\2101\330\014\017\210{\230#\230Q\330\020\023\2201\340\024\036\230a\360\006\000\025\037\230a\330\021\034\230C\230q\330\020\023\2201\340\024\036\230a\360\006\000\025\037\230a\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\240D\250\013\2603\260d\270$\270a\330\020\027\320\027'\240q\250\013\3203J\320JZ\320Z[\320[\\\330\021\034\230C\230u\240D\250\013\2603\260d\270$\270a\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\025\240d\250+\260S\270\004\270D\300\001\330\024\033\320\033,\250A\250[\3208O\320O`\320`a\320ab\330\025 \240\003\2405\250\004\250K\260s\270$\270d\300!\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\004\250K\260s\270$\270d\300!\330\024\033\320\033+\2501\250K\3207N\320N^\320^_\320_`\330\025 \240\003\2405\250\004\250K\260s\270$\270d\300!\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_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"; @@ -2744,6 +2881,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_2genexpr(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_5genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* 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_6to_numeric_constraint(CYTHON_UNUSED 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 */ @@ -2755,12 +2893,23 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numer static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_index = {0, 0, 0, 0, 0}; +static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_8_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ +/* SmallCodeConfig */ +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; @@ -2786,243 +2935,296 @@ typedef struct { #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif - #if CYTHON_USE_MODULE_STATE 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; PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr; PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr; - PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint; - PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr; + PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr; + PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint; PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr; - #endif + PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_8_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; PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr; PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr; - PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint; - PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr; + PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr; + PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint; PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr; - PyObject *__pyx_kp_u_; - PyObject *__pyx_n_s_AllDifferentConstraint; - PyObject *__pyx_n_s_AllEqualConstraint; - PyObject *__pyx_n_s_AssertionError; - PyObject *__pyx_n_s_CompilableFunctionConstraint; - PyObject *__pyx_n_s_Constraint; - PyObject *__pyx_n_s_ExactSumConstraint; - PyObject *__pyx_n_s_FunctionConstraint; - PyObject *__pyx_n_s_FunctionType; - PyObject *__pyx_kp_u_Invalid_comparator; - PyObject *__pyx_kp_u_Invalid_operator; - PyObject *__pyx_n_s_MaxProdConstraint; - PyObject *__pyx_n_s_MaxSumConstraint; - PyObject *__pyx_n_s_MinProdConstraint; - PyObject *__pyx_n_s_MinSumConstraint; - PyObject *__pyx_kp_u_Not_possible_comparator_should_b; - PyObject *__pyx_n_s_Optional; - PyObject *__pyx_kp_s_Optional_Union_AllEqualConstrain; - PyObject *__pyx_kp_s_Optional_Union_MinSumConstraint; - PyObject *__pyx_kp_s_Optional_Union_int_float; - PyObject *__pyx_kp_u_Restriction; - PyObject *__pyx_n_s_Union; - PyObject *__pyx_n_s_ValueError; - PyObject *__pyx_kp_u__10; - PyObject *__pyx_kp_u__11; - PyObject *__pyx_kp_u__12; - PyObject *__pyx_kp_u__13; - PyObject *__pyx_n_s__14; - PyObject *__pyx_kp_u__14; - PyObject *__pyx_kp_u__15; - PyObject *__pyx_kp_u__16; - PyObject *__pyx_kp_u__2; - PyObject *__pyx_kp_u__26; - PyObject *__pyx_kp_u__27; - PyObject *__pyx_kp_u__29; - PyObject *__pyx_kp_u__3; - PyObject *__pyx_kp_u__30; - PyObject *__pyx_kp_u__34; - PyObject *__pyx_kp_u__35; - PyObject *__pyx_kp_u__36; - PyObject *__pyx_kp_u__4; - PyObject *__pyx_n_s__42; - PyObject *__pyx_kp_u__5; - PyObject *__pyx_kp_u__6; - PyObject *__pyx_kp_u__7; - PyObject *__pyx_kp_u_a_zA_Z__a_zA_Z__0_9; - PyObject *__pyx_kp_u_and; - PyObject *__pyx_n_s_args; - PyObject *__pyx_n_s_asyncio_coroutines; - PyObject *__pyx_n_s_class_getitem; - PyObject *__pyx_n_s_cline_in_traceback; - PyObject *__pyx_n_s_close; - PyObject *__pyx_n_s_co_consts; - PyObject *__pyx_n_s_code_object; - PyObject *__pyx_n_s_comparator; - PyObject *__pyx_n_s_comparators; - PyObject *__pyx_n_s_comparators_found; - PyObject *__pyx_n_s_comparators_indices; - PyObject *__pyx_n_s_compile; - PyObject *__pyx_n_s_compile_to_constraints; - PyObject *__pyx_n_s_compiled_constraints; - PyObject *__pyx_n_s_constraint; - PyObject *__pyx_n_s_constraint_constraints; - PyObject *__pyx_n_s_constraint_parser; - PyObject *__pyx_kp_s_constraint_parser_py; - PyObject *__pyx_n_s_constraints; - PyObject *__pyx_kp_u_def_r; - PyObject *__pyx_n_s_dict; - PyObject *__pyx_kp_u_disable; - PyObject *__pyx_n_s_domains; - PyObject *__pyx_kp_u_enable; - PyObject *__pyx_n_s_end; - PyObject *__pyx_n_s_equalities_found; - PyObject *__pyx_n_s_eval; - PyObject *__pyx_n_u_exec; - PyObject *__pyx_n_s_finalized_constraint; - PyObject *__pyx_n_s_findall; - PyObject *__pyx_n_s_finditer; - PyObject *__pyx_n_s_fromkeys; - PyObject *__pyx_n_s_func; - PyObject *__pyx_kp_u_gc; - PyObject *__pyx_n_s_genexpr; - PyObject *__pyx_n_s_group; - PyObject *__pyx_n_s_i; - PyObject *__pyx_n_s_import; - PyObject *__pyx_n_s_index; - PyObject *__pyx_n_s_inequalities_found; - PyObject *__pyx_n_s_initializing; - PyObject *__pyx_n_s_is_coroutine; - PyObject *__pyx_kp_u_is_neither_a_string_or_Constrai; - PyObject *__pyx_n_s_is_or_evals_to_number; - PyObject *__pyx_kp_u_isenabled; - PyObject *__pyx_n_s_key; - PyObject *__pyx_n_s_left; - PyObject *__pyx_n_s_left_num; - PyObject *__pyx_kp_s_list_str; - PyObject *__pyx_kp_s_list_tuple_Constraint_list_str_U; - PyObject *__pyx_kp_s_list_tuple_Union_Constraint_str; - PyObject *__pyx_n_s_m; - PyObject *__pyx_n_s_main; - PyObject *__pyx_n_s_match_object; - PyObject *__pyx_n_s_name; - PyObject *__pyx_n_s_next_stop; - PyObject *__pyx_n_s_number; - PyObject *__pyx_n_s_number_is_int; - PyObject *__pyx_n_s_operator; - PyObject *__pyx_n_s_operators; - PyObject *__pyx_n_s_operators_found; - PyObject *__pyx_kp_u_or; - PyObject *__pyx_n_s_param; - PyObject *__pyx_n_s_params; - PyObject *__pyx_kp_u_params_params_index; - PyObject *__pyx_n_s_params_used; - PyObject *__pyx_n_s_params_used_list; - PyObject *__pyx_n_s_parse_restrictions; - PyObject *__pyx_n_s_parse_restrictions_locals_genexp; - PyObject *__pyx_n_s_parse_restrictions_locals_replac; - PyObject *__pyx_n_s_parse_restrictions_locals_replac_2; - PyObject *__pyx_n_s_parse_restrictions_locals_to_equ; - PyObject *__pyx_n_s_parse_restrictions_locals_to_equ_2; - PyObject *__pyx_n_s_parse_restrictions_locals_to_mul; - PyObject *__pyx_n_s_parse_restrictions_locals_to_num; - PyObject *__pyx_n_s_parse_restrictions_locals_to_num_2; - PyObject *__pyx_n_s_parse_restrictions_locals_to_num_3; - PyObject *__pyx_n_s_parsed_restriction; - PyObject *__pyx_n_s_parsed_restrictions; - PyObject *__pyx_n_s_picklable; - PyObject *__pyx_n_s_prev_stop; - PyObject *__pyx_n_s_r; - PyObject *__pyx_n_s_range; - PyObject *__pyx_n_s_re; - PyObject *__pyx_n_s_regex_match_variable; - PyObject *__pyx_n_s_replace; - PyObject *__pyx_n_s_replace_params; - PyObject *__pyx_n_s_replace_params_split; - PyObject *__pyx_n_s_res; - PyObject *__pyx_n_s_restriction; - PyObject *__pyx_n_s_restrictions; - PyObject *__pyx_n_s_restrictions_cleaned; - PyObject *__pyx_n_s_restrictions_cleaned_unique; - PyObject *__pyx_n_s_restrictions_unique_indices; - PyObject *__pyx_n_s_return; - PyObject *__pyx_kp_u_return_2; - PyObject *__pyx_n_s_right; - PyObject *__pyx_n_s_right_num; - PyObject *__pyx_n_s_s; - PyObject *__pyx_n_s_send; - PyObject *__pyx_n_s_spec; - PyObject *__pyx_n_s_split; - PyObject *__pyx_n_s_split_restrictions; - PyObject *__pyx_n_s_splitted; - PyObject *__pyx_n_s_start; - PyObject *__pyx_n_s_str; - PyObject *__pyx_kp_u_string; - PyObject *__pyx_n_s_strip; - PyObject *__pyx_n_s_sub; - PyObject *__pyx_n_s_temp_copy; - PyObject *__pyx_n_s_test; - PyObject *__pyx_n_s_throw; - PyObject *__pyx_n_s_to_equality_constraint; - PyObject *__pyx_n_s_to_multiple_restrictions; - PyObject *__pyx_n_s_to_numeric_constraint; - PyObject *__pyx_n_s_tune_params; - PyObject *__pyx_n_s_types; - PyObject *__pyx_n_s_typing; - PyObject *__pyx_n_s_variables; - PyObject *__pyx_n_s_variables_on_left; + PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; + __Pyx_CachedCFunction __pyx_umethod_PyList_Type__index; + PyObject *__pyx_slice[4]; + PyObject *__pyx_tuple[2]; + PyObject *__pyx_codeobj_tab[14]; + PyObject *__pyx_string_tab[175]; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_neg_1; - PyObject *__pyx_tuple__8; - PyObject *__pyx_slice__31; - PyObject *__pyx_slice__32; - PyObject *__pyx_slice__33; - PyObject *__pyx_tuple__17; - PyObject *__pyx_tuple__20; - PyObject *__pyx_tuple__22; - PyObject *__pyx_tuple__24; - PyObject *__pyx_tuple__28; - PyObject *__pyx_tuple__37; - PyObject *__pyx_tuple__39; - PyObject *__pyx_tuple__41; - PyObject *__pyx_codeobj__9; - PyObject *__pyx_codeobj__18; - PyObject *__pyx_codeobj__19; - PyObject *__pyx_codeobj__21; - PyObject *__pyx_codeobj__23; - PyObject *__pyx_codeobj__25; - PyObject *__pyx_codeobj__38; - PyObject *__pyx_codeobj__40; -} __pyx_mstate; +/* #### Code section: module_state_contents ### */ +/* CachedMethodType.module_state_decls */ +#if CYTHON_COMPILING_IN_LIMITED_API +PyObject *__Pyx_CachedMethodType; +#endif + + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *__pyx_freelist_10constraint_6parser___pyx_scope_struct__parse_restrictions[8]; +int __pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *__pyx_freelist_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint[8]; +int __pyx_freecount_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_2_genexpr[8]; +int __pyx_freecount_10constraint_6parser___pyx_scope_struct_2_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_3_genexpr[8]; +int __pyx_freecount_10constraint_6parser___pyx_scope_struct_3_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_4_genexpr[8]; +int __pyx_freecount_10constraint_6parser___pyx_scope_struct_4_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_5_genexpr[8]; +int __pyx_freecount_10constraint_6parser___pyx_scope_struct_5_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint *__pyx_freelist_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint[8]; +int __pyx_freecount_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_7_genexpr[8]; +int __pyx_freecount_10constraint_6parser___pyx_scope_struct_7_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_8_genexpr[8]; +int __pyx_freecount_10constraint_6parser___pyx_scope_struct_8_genexpr; +#endif +/* CodeObjectCache.module_state_decls */ +struct __Pyx_CodeObjectCache __pyx_code_cache; + +/* IterNextPlain.module_state_decls */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 +PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache; +#endif + +/* #### Code section: module_state_end ### */ +} __pyx_mstatetype; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { - extern struct PyModuleDef __pyx_moduledef; +extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif -#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) +#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef))) -#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) - -#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) +#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef)) #else -static __pyx_mstate __pyx_mstate_global_static = +static __pyx_mstatetype __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif -static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; -#endif +static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static; +#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_ExactSumConstraint __pyx_string_tab[6] +#define __pyx_n_u_FunctionConstraint __pyx_string_tab[7] +#define __pyx_n_u_FunctionType __pyx_string_tab[8] +#define __pyx_kp_u_Invalid_comparator __pyx_string_tab[9] +#define __pyx_kp_u_Invalid_operator __pyx_string_tab[10] +#define __pyx_n_u_MaxProdConstraint __pyx_string_tab[11] +#define __pyx_n_u_MaxSumConstraint __pyx_string_tab[12] +#define __pyx_n_u_MinProdConstraint __pyx_string_tab[13] +#define __pyx_n_u_MinSumConstraint __pyx_string_tab[14] +#define __pyx_kp_u_Not_possible_comparator_should_b __pyx_string_tab[15] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[16] +#define __pyx_n_u_Optional __pyx_string_tab[17] +#define __pyx_kp_u_Optional_Union_AllEqualConstrain __pyx_string_tab[18] +#define __pyx_kp_u_Optional_Union_MinSumConstraint __pyx_string_tab[19] +#define __pyx_kp_u_Optional_Union_int_float __pyx_string_tab[20] +#define __pyx_kp_u_Restriction __pyx_string_tab[21] +#define __pyx_n_u_Union __pyx_string_tab[22] +#define __pyx_n_u_ValueError __pyx_string_tab[23] +#define __pyx_n_u_VariableExactSumConstraint __pyx_string_tab[24] +#define __pyx_kp_u__10 __pyx_string_tab[25] +#define __pyx_kp_u__11 __pyx_string_tab[26] +#define __pyx_kp_u__12 __pyx_string_tab[27] +#define __pyx_kp_u__13 __pyx_string_tab[28] +#define __pyx_kp_u__14 __pyx_string_tab[29] +#define __pyx_kp_u__15 __pyx_string_tab[30] +#define __pyx_kp_u__16 __pyx_string_tab[31] +#define __pyx_kp_u__17 __pyx_string_tab[32] +#define __pyx_kp_u__18 __pyx_string_tab[33] +#define __pyx_kp_u__19 __pyx_string_tab[34] +#define __pyx_kp_u__2 __pyx_string_tab[35] +#define __pyx_kp_u__20 __pyx_string_tab[36] +#define __pyx_kp_u__21 __pyx_string_tab[37] +#define __pyx_kp_u__22 __pyx_string_tab[38] +#define __pyx_kp_u__3 __pyx_string_tab[39] +#define __pyx_kp_u__4 __pyx_string_tab[40] +#define __pyx_kp_u__5 __pyx_string_tab[41] +#define __pyx_kp_u__6 __pyx_string_tab[42] +#define __pyx_kp_u__7 __pyx_string_tab[43] +#define __pyx_kp_u__8 __pyx_string_tab[44] +#define __pyx_kp_u__9 __pyx_string_tab[45] +#define __pyx_kp_u_a_zA_Z__a_zA_Z__0_9 __pyx_string_tab[46] +#define __pyx_kp_u_add_note __pyx_string_tab[47] +#define __pyx_kp_u_and __pyx_string_tab[48] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[49] +#define __pyx_n_u_class_getitem __pyx_string_tab[50] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[51] +#define __pyx_n_u_close __pyx_string_tab[52] +#define __pyx_n_u_co_consts __pyx_string_tab[53] +#define __pyx_n_u_code_object __pyx_string_tab[54] +#define __pyx_n_u_comparator __pyx_string_tab[55] +#define __pyx_n_u_comparators __pyx_string_tab[56] +#define __pyx_n_u_comparators_found __pyx_string_tab[57] +#define __pyx_n_u_comparators_indices __pyx_string_tab[58] +#define __pyx_n_u_compile __pyx_string_tab[59] +#define __pyx_n_u_compile_to_constraints __pyx_string_tab[60] +#define __pyx_n_u_compiled_constraints __pyx_string_tab[61] +#define __pyx_n_u_constraint __pyx_string_tab[62] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[63] +#define __pyx_n_u_constraint_parser __pyx_string_tab[64] +#define __pyx_kp_u_constraint_parser_py __pyx_string_tab[65] +#define __pyx_n_u_constraints __pyx_string_tab[66] +#define __pyx_kp_u_def_r __pyx_string_tab[67] +#define __pyx_n_u_dict __pyx_string_tab[68] +#define __pyx_kp_u_disable __pyx_string_tab[69] +#define __pyx_n_u_domains __pyx_string_tab[70] +#define __pyx_kp_u_enable __pyx_string_tab[71] +#define __pyx_n_u_end __pyx_string_tab[72] +#define __pyx_n_u_equalities_found __pyx_string_tab[73] +#define __pyx_n_u_eval __pyx_string_tab[74] +#define __pyx_n_u_exec __pyx_string_tab[75] +#define __pyx_n_u_finalized_constraint __pyx_string_tab[76] +#define __pyx_n_u_findall __pyx_string_tab[77] +#define __pyx_n_u_finditer __pyx_string_tab[78] +#define __pyx_n_u_fromkeys __pyx_string_tab[79] +#define __pyx_n_u_func __pyx_string_tab[80] +#define __pyx_n_u_func_2 __pyx_string_tab[81] +#define __pyx_kp_u_gc __pyx_string_tab[82] +#define __pyx_n_u_genexpr __pyx_string_tab[83] +#define __pyx_n_u_group __pyx_string_tab[84] +#define __pyx_n_u_i __pyx_string_tab[85] +#define __pyx_n_u_index __pyx_string_tab[86] +#define __pyx_n_u_inequalities_found __pyx_string_tab[87] +#define __pyx_n_u_initializing __pyx_string_tab[88] +#define __pyx_n_u_is_coroutine __pyx_string_tab[89] +#define __pyx_kp_u_is_neither_a_string_or_Constrai __pyx_string_tab[90] +#define __pyx_n_u_is_or_evals_to_number __pyx_string_tab[91] +#define __pyx_kp_u_isenabled __pyx_string_tab[92] +#define __pyx_n_u_key __pyx_string_tab[93] +#define __pyx_n_u_left __pyx_string_tab[94] +#define __pyx_n_u_left_num __pyx_string_tab[95] +#define __pyx_kp_u_list_str __pyx_string_tab[96] +#define __pyx_kp_u_list_tuple_Constraint_list_str_U __pyx_string_tab[97] +#define __pyx_kp_u_list_tuple_Union_Constraint_str __pyx_string_tab[98] +#define __pyx_n_u_m __pyx_string_tab[99] +#define __pyx_n_u_main __pyx_string_tab[100] +#define __pyx_n_u_match_object __pyx_string_tab[101] +#define __pyx_n_u_module __pyx_string_tab[102] +#define __pyx_n_u_name __pyx_string_tab[103] +#define __pyx_n_u_next __pyx_string_tab[104] +#define __pyx_n_u_next_stop __pyx_string_tab[105] +#define __pyx_n_u_number __pyx_string_tab[106] +#define __pyx_n_u_number_is_int __pyx_string_tab[107] +#define __pyx_n_u_o __pyx_string_tab[108] +#define __pyx_n_u_operator __pyx_string_tab[109] +#define __pyx_n_u_operators __pyx_string_tab[110] +#define __pyx_n_u_operators_found __pyx_string_tab[111] +#define __pyx_kp_u_or __pyx_string_tab[112] +#define __pyx_n_u_param __pyx_string_tab[113] +#define __pyx_n_u_params __pyx_string_tab[114] +#define __pyx_kp_u_params_params_index __pyx_string_tab[115] +#define __pyx_n_u_params_used __pyx_string_tab[116] +#define __pyx_n_u_params_used_list __pyx_string_tab[117] +#define __pyx_n_u_parse_restrictions __pyx_string_tab[118] +#define __pyx_n_u_parse_restrictions_locals_genexp __pyx_string_tab[119] +#define __pyx_n_u_parse_restrictions_locals_replac __pyx_string_tab[120] +#define __pyx_n_u_parse_restrictions_locals_replac_2 __pyx_string_tab[121] +#define __pyx_n_u_parse_restrictions_locals_to_equ __pyx_string_tab[122] +#define __pyx_n_u_parse_restrictions_locals_to_equ_2 __pyx_string_tab[123] +#define __pyx_n_u_parse_restrictions_locals_to_mul __pyx_string_tab[124] +#define __pyx_n_u_parse_restrictions_locals_to_num __pyx_string_tab[125] +#define __pyx_n_u_parse_restrictions_locals_to_num_2 __pyx_string_tab[126] +#define __pyx_n_u_parse_restrictions_locals_to_num_3 __pyx_string_tab[127] +#define __pyx_n_u_parsed_restriction __pyx_string_tab[128] +#define __pyx_n_u_parsed_restrictions __pyx_string_tab[129] +#define __pyx_n_u_picklable __pyx_string_tab[130] +#define __pyx_n_u_pop __pyx_string_tab[131] +#define __pyx_n_u_prev_stop __pyx_string_tab[132] +#define __pyx_n_u_qualname __pyx_string_tab[133] +#define __pyx_n_u_r __pyx_string_tab[134] +#define __pyx_n_u_range __pyx_string_tab[135] +#define __pyx_n_u_re __pyx_string_tab[136] +#define __pyx_n_u_regex_match_variable __pyx_string_tab[137] +#define __pyx_n_u_replace __pyx_string_tab[138] +#define __pyx_n_u_replace_params __pyx_string_tab[139] +#define __pyx_n_u_replace_params_split __pyx_string_tab[140] +#define __pyx_n_u_res __pyx_string_tab[141] +#define __pyx_n_u_restriction __pyx_string_tab[142] +#define __pyx_n_u_restrictions __pyx_string_tab[143] +#define __pyx_n_u_restrictions_cleaned __pyx_string_tab[144] +#define __pyx_n_u_restrictions_cleaned_unique __pyx_string_tab[145] +#define __pyx_n_u_restrictions_unique_indices __pyx_string_tab[146] +#define __pyx_n_u_return __pyx_string_tab[147] +#define __pyx_kp_u_return_2 __pyx_string_tab[148] +#define __pyx_n_u_right __pyx_string_tab[149] +#define __pyx_n_u_right_num __pyx_string_tab[150] +#define __pyx_n_u_s __pyx_string_tab[151] +#define __pyx_n_u_send __pyx_string_tab[152] +#define __pyx_n_u_spec __pyx_string_tab[153] +#define __pyx_n_u_split __pyx_string_tab[154] +#define __pyx_n_u_split_restrictions __pyx_string_tab[155] +#define __pyx_n_u_splitted __pyx_string_tab[156] +#define __pyx_n_u_start __pyx_string_tab[157] +#define __pyx_n_u_str __pyx_string_tab[158] +#define __pyx_kp_u_string __pyx_string_tab[159] +#define __pyx_n_u_strip __pyx_string_tab[160] +#define __pyx_n_u_sub __pyx_string_tab[161] +#define __pyx_n_u_temp_copy __pyx_string_tab[162] +#define __pyx_n_u_test __pyx_string_tab[163] +#define __pyx_n_u_throw __pyx_string_tab[164] +#define __pyx_n_u_to_equality_constraint __pyx_string_tab[165] +#define __pyx_n_u_to_multiple_restrictions __pyx_string_tab[166] +#define __pyx_n_u_to_numeric_constraint __pyx_string_tab[167] +#define __pyx_n_u_tune_params __pyx_string_tab[168] +#define __pyx_n_u_types __pyx_string_tab[169] +#define __pyx_n_u_typing __pyx_string_tab[170] +#define __pyx_n_u_value __pyx_string_tab[171] +#define __pyx_n_u_variable_supported_operators __pyx_string_tab[172] +#define __pyx_n_u_variables __pyx_string_tab[173] +#define __pyx_n_u_variables_on_left __pyx_string_tab[174] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE -static int __pyx_m_clear(PyObject *m) { - __pyx_mstate *clear_module_state = __pyx_mstate(m); +static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { + __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); @@ -3036,6 +3238,9 @@ static int __pyx_m_clear(PyObject *m) { #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif + #if CYTHON_PEP489_MULTI_PHASE_INIT + __Pyx_State_RemoveModule(NULL); + #endif Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions); Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint); @@ -3046,216 +3251,35 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint); - Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint); - Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr); - Py_CLEAR(clear_module_state->__pyx_kp_u_); - Py_CLEAR(clear_module_state->__pyx_n_s_AllDifferentConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_AllEqualConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); - Py_CLEAR(clear_module_state->__pyx_n_s_CompilableFunctionConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_Constraint); - Py_CLEAR(clear_module_state->__pyx_n_s_ExactSumConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_FunctionConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_FunctionType); - Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_comparator); - Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_operator); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxProdConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxSumConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_MinProdConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_MinSumConstraint); - Py_CLEAR(clear_module_state->__pyx_kp_u_Not_possible_comparator_should_b); - Py_CLEAR(clear_module_state->__pyx_n_s_Optional); - Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_Union_AllEqualConstrain); - Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_Union_MinSumConstraint); - Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_Union_int_float); - Py_CLEAR(clear_module_state->__pyx_kp_u_Restriction); - Py_CLEAR(clear_module_state->__pyx_n_s_Union); - Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); - Py_CLEAR(clear_module_state->__pyx_kp_u__10); - Py_CLEAR(clear_module_state->__pyx_kp_u__11); - Py_CLEAR(clear_module_state->__pyx_kp_u__12); - Py_CLEAR(clear_module_state->__pyx_kp_u__13); - Py_CLEAR(clear_module_state->__pyx_n_s__14); - Py_CLEAR(clear_module_state->__pyx_kp_u__14); - Py_CLEAR(clear_module_state->__pyx_kp_u__15); - Py_CLEAR(clear_module_state->__pyx_kp_u__16); - Py_CLEAR(clear_module_state->__pyx_kp_u__2); - Py_CLEAR(clear_module_state->__pyx_kp_u__26); - Py_CLEAR(clear_module_state->__pyx_kp_u__27); - Py_CLEAR(clear_module_state->__pyx_kp_u__29); - Py_CLEAR(clear_module_state->__pyx_kp_u__3); - Py_CLEAR(clear_module_state->__pyx_kp_u__30); - Py_CLEAR(clear_module_state->__pyx_kp_u__34); - Py_CLEAR(clear_module_state->__pyx_kp_u__35); - Py_CLEAR(clear_module_state->__pyx_kp_u__36); - Py_CLEAR(clear_module_state->__pyx_kp_u__4); - Py_CLEAR(clear_module_state->__pyx_n_s__42); - Py_CLEAR(clear_module_state->__pyx_kp_u__5); - Py_CLEAR(clear_module_state->__pyx_kp_u__6); - Py_CLEAR(clear_module_state->__pyx_kp_u__7); - Py_CLEAR(clear_module_state->__pyx_kp_u_a_zA_Z__a_zA_Z__0_9); - Py_CLEAR(clear_module_state->__pyx_kp_u_and); - Py_CLEAR(clear_module_state->__pyx_n_s_args); - Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); - Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); - Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); - Py_CLEAR(clear_module_state->__pyx_n_s_close); - Py_CLEAR(clear_module_state->__pyx_n_s_co_consts); - Py_CLEAR(clear_module_state->__pyx_n_s_code_object); - Py_CLEAR(clear_module_state->__pyx_n_s_comparator); - Py_CLEAR(clear_module_state->__pyx_n_s_comparators); - Py_CLEAR(clear_module_state->__pyx_n_s_comparators_found); - Py_CLEAR(clear_module_state->__pyx_n_s_comparators_indices); - Py_CLEAR(clear_module_state->__pyx_n_s_compile); - Py_CLEAR(clear_module_state->__pyx_n_s_compile_to_constraints); - Py_CLEAR(clear_module_state->__pyx_n_s_compiled_constraints); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_constraints); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_parser); - Py_CLEAR(clear_module_state->__pyx_kp_s_constraint_parser_py); - Py_CLEAR(clear_module_state->__pyx_n_s_constraints); - Py_CLEAR(clear_module_state->__pyx_kp_u_def_r); - Py_CLEAR(clear_module_state->__pyx_n_s_dict); - Py_CLEAR(clear_module_state->__pyx_kp_u_disable); - Py_CLEAR(clear_module_state->__pyx_n_s_domains); - Py_CLEAR(clear_module_state->__pyx_kp_u_enable); - Py_CLEAR(clear_module_state->__pyx_n_s_end); - Py_CLEAR(clear_module_state->__pyx_n_s_equalities_found); - Py_CLEAR(clear_module_state->__pyx_n_s_eval); - Py_CLEAR(clear_module_state->__pyx_n_u_exec); - Py_CLEAR(clear_module_state->__pyx_n_s_finalized_constraint); - Py_CLEAR(clear_module_state->__pyx_n_s_findall); - Py_CLEAR(clear_module_state->__pyx_n_s_finditer); - Py_CLEAR(clear_module_state->__pyx_n_s_fromkeys); - Py_CLEAR(clear_module_state->__pyx_n_s_func); - Py_CLEAR(clear_module_state->__pyx_kp_u_gc); - Py_CLEAR(clear_module_state->__pyx_n_s_genexpr); - Py_CLEAR(clear_module_state->__pyx_n_s_group); - Py_CLEAR(clear_module_state->__pyx_n_s_i); - Py_CLEAR(clear_module_state->__pyx_n_s_import); - Py_CLEAR(clear_module_state->__pyx_n_s_index); - Py_CLEAR(clear_module_state->__pyx_n_s_inequalities_found); - Py_CLEAR(clear_module_state->__pyx_n_s_initializing); - Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); - Py_CLEAR(clear_module_state->__pyx_kp_u_is_neither_a_string_or_Constrai); - Py_CLEAR(clear_module_state->__pyx_n_s_is_or_evals_to_number); - Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); - Py_CLEAR(clear_module_state->__pyx_n_s_key); - Py_CLEAR(clear_module_state->__pyx_n_s_left); - Py_CLEAR(clear_module_state->__pyx_n_s_left_num); - Py_CLEAR(clear_module_state->__pyx_kp_s_list_str); - Py_CLEAR(clear_module_state->__pyx_kp_s_list_tuple_Constraint_list_str_U); - Py_CLEAR(clear_module_state->__pyx_kp_s_list_tuple_Union_Constraint_str); - Py_CLEAR(clear_module_state->__pyx_n_s_m); - Py_CLEAR(clear_module_state->__pyx_n_s_main); - Py_CLEAR(clear_module_state->__pyx_n_s_match_object); - Py_CLEAR(clear_module_state->__pyx_n_s_name); - Py_CLEAR(clear_module_state->__pyx_n_s_next_stop); - Py_CLEAR(clear_module_state->__pyx_n_s_number); - Py_CLEAR(clear_module_state->__pyx_n_s_number_is_int); - Py_CLEAR(clear_module_state->__pyx_n_s_operator); - Py_CLEAR(clear_module_state->__pyx_n_s_operators); - Py_CLEAR(clear_module_state->__pyx_n_s_operators_found); - Py_CLEAR(clear_module_state->__pyx_kp_u_or); - Py_CLEAR(clear_module_state->__pyx_n_s_param); - Py_CLEAR(clear_module_state->__pyx_n_s_params); - Py_CLEAR(clear_module_state->__pyx_kp_u_params_params_index); - Py_CLEAR(clear_module_state->__pyx_n_s_params_used); - Py_CLEAR(clear_module_state->__pyx_n_s_params_used_list); - Py_CLEAR(clear_module_state->__pyx_n_s_parse_restrictions); - Py_CLEAR(clear_module_state->__pyx_n_s_parse_restrictions_locals_genexp); - Py_CLEAR(clear_module_state->__pyx_n_s_parse_restrictions_locals_replac); - Py_CLEAR(clear_module_state->__pyx_n_s_parse_restrictions_locals_replac_2); - Py_CLEAR(clear_module_state->__pyx_n_s_parse_restrictions_locals_to_equ); - Py_CLEAR(clear_module_state->__pyx_n_s_parse_restrictions_locals_to_equ_2); - Py_CLEAR(clear_module_state->__pyx_n_s_parse_restrictions_locals_to_mul); - Py_CLEAR(clear_module_state->__pyx_n_s_parse_restrictions_locals_to_num); - Py_CLEAR(clear_module_state->__pyx_n_s_parse_restrictions_locals_to_num_2); - Py_CLEAR(clear_module_state->__pyx_n_s_parse_restrictions_locals_to_num_3); - Py_CLEAR(clear_module_state->__pyx_n_s_parsed_restriction); - Py_CLEAR(clear_module_state->__pyx_n_s_parsed_restrictions); - Py_CLEAR(clear_module_state->__pyx_n_s_picklable); - Py_CLEAR(clear_module_state->__pyx_n_s_prev_stop); - Py_CLEAR(clear_module_state->__pyx_n_s_r); - Py_CLEAR(clear_module_state->__pyx_n_s_range); - Py_CLEAR(clear_module_state->__pyx_n_s_re); - Py_CLEAR(clear_module_state->__pyx_n_s_regex_match_variable); - Py_CLEAR(clear_module_state->__pyx_n_s_replace); - Py_CLEAR(clear_module_state->__pyx_n_s_replace_params); - Py_CLEAR(clear_module_state->__pyx_n_s_replace_params_split); - Py_CLEAR(clear_module_state->__pyx_n_s_res); - Py_CLEAR(clear_module_state->__pyx_n_s_restriction); - Py_CLEAR(clear_module_state->__pyx_n_s_restrictions); - Py_CLEAR(clear_module_state->__pyx_n_s_restrictions_cleaned); - Py_CLEAR(clear_module_state->__pyx_n_s_restrictions_cleaned_unique); - Py_CLEAR(clear_module_state->__pyx_n_s_restrictions_unique_indices); - Py_CLEAR(clear_module_state->__pyx_n_s_return); - Py_CLEAR(clear_module_state->__pyx_kp_u_return_2); - Py_CLEAR(clear_module_state->__pyx_n_s_right); - Py_CLEAR(clear_module_state->__pyx_n_s_right_num); - Py_CLEAR(clear_module_state->__pyx_n_s_s); - Py_CLEAR(clear_module_state->__pyx_n_s_send); - Py_CLEAR(clear_module_state->__pyx_n_s_spec); - Py_CLEAR(clear_module_state->__pyx_n_s_split); - Py_CLEAR(clear_module_state->__pyx_n_s_split_restrictions); - Py_CLEAR(clear_module_state->__pyx_n_s_splitted); - Py_CLEAR(clear_module_state->__pyx_n_s_start); - Py_CLEAR(clear_module_state->__pyx_n_s_str); - Py_CLEAR(clear_module_state->__pyx_kp_u_string); - Py_CLEAR(clear_module_state->__pyx_n_s_strip); - Py_CLEAR(clear_module_state->__pyx_n_s_sub); - Py_CLEAR(clear_module_state->__pyx_n_s_temp_copy); - Py_CLEAR(clear_module_state->__pyx_n_s_test); - Py_CLEAR(clear_module_state->__pyx_n_s_throw); - Py_CLEAR(clear_module_state->__pyx_n_s_to_equality_constraint); - Py_CLEAR(clear_module_state->__pyx_n_s_to_multiple_restrictions); - Py_CLEAR(clear_module_state->__pyx_n_s_to_numeric_constraint); - Py_CLEAR(clear_module_state->__pyx_n_s_tune_params); - Py_CLEAR(clear_module_state->__pyx_n_s_types); - Py_CLEAR(clear_module_state->__pyx_n_s_typing); - Py_CLEAR(clear_module_state->__pyx_n_s_variables); - Py_CLEAR(clear_module_state->__pyx_n_s_variables_on_left); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr); + for (int i=0; i<4; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); } + for (int i=0; i<2; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } + for (int i=0; i<14; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<175; ++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); - Py_CLEAR(clear_module_state->__pyx_tuple__8); - Py_CLEAR(clear_module_state->__pyx_slice__31); - Py_CLEAR(clear_module_state->__pyx_slice__32); - Py_CLEAR(clear_module_state->__pyx_slice__33); - Py_CLEAR(clear_module_state->__pyx_tuple__17); - Py_CLEAR(clear_module_state->__pyx_tuple__20); - Py_CLEAR(clear_module_state->__pyx_tuple__22); - Py_CLEAR(clear_module_state->__pyx_tuple__24); - Py_CLEAR(clear_module_state->__pyx_tuple__28); - Py_CLEAR(clear_module_state->__pyx_tuple__37); - Py_CLEAR(clear_module_state->__pyx_tuple__39); - Py_CLEAR(clear_module_state->__pyx_tuple__41); - Py_CLEAR(clear_module_state->__pyx_codeobj__9); - Py_CLEAR(clear_module_state->__pyx_codeobj__18); - Py_CLEAR(clear_module_state->__pyx_codeobj__19); - Py_CLEAR(clear_module_state->__pyx_codeobj__21); - Py_CLEAR(clear_module_state->__pyx_codeobj__23); - Py_CLEAR(clear_module_state->__pyx_codeobj__25); - Py_CLEAR(clear_module_state->__pyx_codeobj__38); - Py_CLEAR(clear_module_state->__pyx_codeobj__40); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE -static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { - __pyx_mstate *traverse_module_state = __pyx_mstate(m); +static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); - Py_VISIT(traverse_module_state->__pyx_empty_tuple); - Py_VISIT(traverse_module_state->__pyx_empty_bytes); - Py_VISIT(traverse_module_state->__pyx_empty_unicode); + __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 @@ -3272,447 +3296,33 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint); - Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint); - Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr); - Py_VISIT(traverse_module_state->__pyx_kp_u_); - Py_VISIT(traverse_module_state->__pyx_n_s_AllDifferentConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_AllEqualConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); - Py_VISIT(traverse_module_state->__pyx_n_s_CompilableFunctionConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_Constraint); - Py_VISIT(traverse_module_state->__pyx_n_s_ExactSumConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_FunctionConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_FunctionType); - Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_comparator); - Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_operator); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxProdConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxSumConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_MinProdConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_MinSumConstraint); - Py_VISIT(traverse_module_state->__pyx_kp_u_Not_possible_comparator_should_b); - Py_VISIT(traverse_module_state->__pyx_n_s_Optional); - Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_Union_AllEqualConstrain); - Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_Union_MinSumConstraint); - Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_Union_int_float); - Py_VISIT(traverse_module_state->__pyx_kp_u_Restriction); - Py_VISIT(traverse_module_state->__pyx_n_s_Union); - Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); - Py_VISIT(traverse_module_state->__pyx_kp_u__10); - Py_VISIT(traverse_module_state->__pyx_kp_u__11); - Py_VISIT(traverse_module_state->__pyx_kp_u__12); - Py_VISIT(traverse_module_state->__pyx_kp_u__13); - Py_VISIT(traverse_module_state->__pyx_n_s__14); - Py_VISIT(traverse_module_state->__pyx_kp_u__14); - Py_VISIT(traverse_module_state->__pyx_kp_u__15); - Py_VISIT(traverse_module_state->__pyx_kp_u__16); - Py_VISIT(traverse_module_state->__pyx_kp_u__2); - Py_VISIT(traverse_module_state->__pyx_kp_u__26); - Py_VISIT(traverse_module_state->__pyx_kp_u__27); - Py_VISIT(traverse_module_state->__pyx_kp_u__29); - Py_VISIT(traverse_module_state->__pyx_kp_u__3); - Py_VISIT(traverse_module_state->__pyx_kp_u__30); - Py_VISIT(traverse_module_state->__pyx_kp_u__34); - Py_VISIT(traverse_module_state->__pyx_kp_u__35); - Py_VISIT(traverse_module_state->__pyx_kp_u__36); - Py_VISIT(traverse_module_state->__pyx_kp_u__4); - Py_VISIT(traverse_module_state->__pyx_n_s__42); - Py_VISIT(traverse_module_state->__pyx_kp_u__5); - Py_VISIT(traverse_module_state->__pyx_kp_u__6); - Py_VISIT(traverse_module_state->__pyx_kp_u__7); - Py_VISIT(traverse_module_state->__pyx_kp_u_a_zA_Z__a_zA_Z__0_9); - Py_VISIT(traverse_module_state->__pyx_kp_u_and); - Py_VISIT(traverse_module_state->__pyx_n_s_args); - Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); - Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); - Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); - Py_VISIT(traverse_module_state->__pyx_n_s_close); - Py_VISIT(traverse_module_state->__pyx_n_s_co_consts); - Py_VISIT(traverse_module_state->__pyx_n_s_code_object); - Py_VISIT(traverse_module_state->__pyx_n_s_comparator); - Py_VISIT(traverse_module_state->__pyx_n_s_comparators); - Py_VISIT(traverse_module_state->__pyx_n_s_comparators_found); - Py_VISIT(traverse_module_state->__pyx_n_s_comparators_indices); - Py_VISIT(traverse_module_state->__pyx_n_s_compile); - Py_VISIT(traverse_module_state->__pyx_n_s_compile_to_constraints); - Py_VISIT(traverse_module_state->__pyx_n_s_compiled_constraints); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_constraints); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_parser); - Py_VISIT(traverse_module_state->__pyx_kp_s_constraint_parser_py); - Py_VISIT(traverse_module_state->__pyx_n_s_constraints); - Py_VISIT(traverse_module_state->__pyx_kp_u_def_r); - Py_VISIT(traverse_module_state->__pyx_n_s_dict); - Py_VISIT(traverse_module_state->__pyx_kp_u_disable); - Py_VISIT(traverse_module_state->__pyx_n_s_domains); - Py_VISIT(traverse_module_state->__pyx_kp_u_enable); - Py_VISIT(traverse_module_state->__pyx_n_s_end); - Py_VISIT(traverse_module_state->__pyx_n_s_equalities_found); - Py_VISIT(traverse_module_state->__pyx_n_s_eval); - Py_VISIT(traverse_module_state->__pyx_n_u_exec); - Py_VISIT(traverse_module_state->__pyx_n_s_finalized_constraint); - Py_VISIT(traverse_module_state->__pyx_n_s_findall); - Py_VISIT(traverse_module_state->__pyx_n_s_finditer); - Py_VISIT(traverse_module_state->__pyx_n_s_fromkeys); - Py_VISIT(traverse_module_state->__pyx_n_s_func); - Py_VISIT(traverse_module_state->__pyx_kp_u_gc); - Py_VISIT(traverse_module_state->__pyx_n_s_genexpr); - Py_VISIT(traverse_module_state->__pyx_n_s_group); - Py_VISIT(traverse_module_state->__pyx_n_s_i); - Py_VISIT(traverse_module_state->__pyx_n_s_import); - Py_VISIT(traverse_module_state->__pyx_n_s_index); - Py_VISIT(traverse_module_state->__pyx_n_s_inequalities_found); - Py_VISIT(traverse_module_state->__pyx_n_s_initializing); - Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); - Py_VISIT(traverse_module_state->__pyx_kp_u_is_neither_a_string_or_Constrai); - Py_VISIT(traverse_module_state->__pyx_n_s_is_or_evals_to_number); - Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); - Py_VISIT(traverse_module_state->__pyx_n_s_key); - Py_VISIT(traverse_module_state->__pyx_n_s_left); - Py_VISIT(traverse_module_state->__pyx_n_s_left_num); - Py_VISIT(traverse_module_state->__pyx_kp_s_list_str); - Py_VISIT(traverse_module_state->__pyx_kp_s_list_tuple_Constraint_list_str_U); - Py_VISIT(traverse_module_state->__pyx_kp_s_list_tuple_Union_Constraint_str); - Py_VISIT(traverse_module_state->__pyx_n_s_m); - Py_VISIT(traverse_module_state->__pyx_n_s_main); - Py_VISIT(traverse_module_state->__pyx_n_s_match_object); - Py_VISIT(traverse_module_state->__pyx_n_s_name); - Py_VISIT(traverse_module_state->__pyx_n_s_next_stop); - Py_VISIT(traverse_module_state->__pyx_n_s_number); - Py_VISIT(traverse_module_state->__pyx_n_s_number_is_int); - Py_VISIT(traverse_module_state->__pyx_n_s_operator); - Py_VISIT(traverse_module_state->__pyx_n_s_operators); - Py_VISIT(traverse_module_state->__pyx_n_s_operators_found); - Py_VISIT(traverse_module_state->__pyx_kp_u_or); - Py_VISIT(traverse_module_state->__pyx_n_s_param); - Py_VISIT(traverse_module_state->__pyx_n_s_params); - Py_VISIT(traverse_module_state->__pyx_kp_u_params_params_index); - Py_VISIT(traverse_module_state->__pyx_n_s_params_used); - Py_VISIT(traverse_module_state->__pyx_n_s_params_used_list); - Py_VISIT(traverse_module_state->__pyx_n_s_parse_restrictions); - Py_VISIT(traverse_module_state->__pyx_n_s_parse_restrictions_locals_genexp); - Py_VISIT(traverse_module_state->__pyx_n_s_parse_restrictions_locals_replac); - Py_VISIT(traverse_module_state->__pyx_n_s_parse_restrictions_locals_replac_2); - Py_VISIT(traverse_module_state->__pyx_n_s_parse_restrictions_locals_to_equ); - Py_VISIT(traverse_module_state->__pyx_n_s_parse_restrictions_locals_to_equ_2); - Py_VISIT(traverse_module_state->__pyx_n_s_parse_restrictions_locals_to_mul); - Py_VISIT(traverse_module_state->__pyx_n_s_parse_restrictions_locals_to_num); - Py_VISIT(traverse_module_state->__pyx_n_s_parse_restrictions_locals_to_num_2); - Py_VISIT(traverse_module_state->__pyx_n_s_parse_restrictions_locals_to_num_3); - Py_VISIT(traverse_module_state->__pyx_n_s_parsed_restriction); - Py_VISIT(traverse_module_state->__pyx_n_s_parsed_restrictions); - Py_VISIT(traverse_module_state->__pyx_n_s_picklable); - Py_VISIT(traverse_module_state->__pyx_n_s_prev_stop); - Py_VISIT(traverse_module_state->__pyx_n_s_r); - Py_VISIT(traverse_module_state->__pyx_n_s_range); - Py_VISIT(traverse_module_state->__pyx_n_s_re); - Py_VISIT(traverse_module_state->__pyx_n_s_regex_match_variable); - Py_VISIT(traverse_module_state->__pyx_n_s_replace); - Py_VISIT(traverse_module_state->__pyx_n_s_replace_params); - Py_VISIT(traverse_module_state->__pyx_n_s_replace_params_split); - Py_VISIT(traverse_module_state->__pyx_n_s_res); - Py_VISIT(traverse_module_state->__pyx_n_s_restriction); - Py_VISIT(traverse_module_state->__pyx_n_s_restrictions); - Py_VISIT(traverse_module_state->__pyx_n_s_restrictions_cleaned); - Py_VISIT(traverse_module_state->__pyx_n_s_restrictions_cleaned_unique); - Py_VISIT(traverse_module_state->__pyx_n_s_restrictions_unique_indices); - Py_VISIT(traverse_module_state->__pyx_n_s_return); - Py_VISIT(traverse_module_state->__pyx_kp_u_return_2); - Py_VISIT(traverse_module_state->__pyx_n_s_right); - Py_VISIT(traverse_module_state->__pyx_n_s_right_num); - Py_VISIT(traverse_module_state->__pyx_n_s_s); - Py_VISIT(traverse_module_state->__pyx_n_s_send); - Py_VISIT(traverse_module_state->__pyx_n_s_spec); - Py_VISIT(traverse_module_state->__pyx_n_s_split); - Py_VISIT(traverse_module_state->__pyx_n_s_split_restrictions); - Py_VISIT(traverse_module_state->__pyx_n_s_splitted); - Py_VISIT(traverse_module_state->__pyx_n_s_start); - Py_VISIT(traverse_module_state->__pyx_n_s_str); - Py_VISIT(traverse_module_state->__pyx_kp_u_string); - Py_VISIT(traverse_module_state->__pyx_n_s_strip); - Py_VISIT(traverse_module_state->__pyx_n_s_sub); - Py_VISIT(traverse_module_state->__pyx_n_s_temp_copy); - Py_VISIT(traverse_module_state->__pyx_n_s_test); - Py_VISIT(traverse_module_state->__pyx_n_s_throw); - Py_VISIT(traverse_module_state->__pyx_n_s_to_equality_constraint); - Py_VISIT(traverse_module_state->__pyx_n_s_to_multiple_restrictions); - Py_VISIT(traverse_module_state->__pyx_n_s_to_numeric_constraint); - Py_VISIT(traverse_module_state->__pyx_n_s_tune_params); - Py_VISIT(traverse_module_state->__pyx_n_s_types); - Py_VISIT(traverse_module_state->__pyx_n_s_typing); - Py_VISIT(traverse_module_state->__pyx_n_s_variables); - Py_VISIT(traverse_module_state->__pyx_n_s_variables_on_left); - Py_VISIT(traverse_module_state->__pyx_int_0); - Py_VISIT(traverse_module_state->__pyx_int_1); - Py_VISIT(traverse_module_state->__pyx_int_neg_1); - Py_VISIT(traverse_module_state->__pyx_tuple__8); - Py_VISIT(traverse_module_state->__pyx_slice__31); - Py_VISIT(traverse_module_state->__pyx_slice__32); - Py_VISIT(traverse_module_state->__pyx_slice__33); - Py_VISIT(traverse_module_state->__pyx_tuple__17); - Py_VISIT(traverse_module_state->__pyx_tuple__20); - Py_VISIT(traverse_module_state->__pyx_tuple__22); - Py_VISIT(traverse_module_state->__pyx_tuple__24); - Py_VISIT(traverse_module_state->__pyx_tuple__28); - Py_VISIT(traverse_module_state->__pyx_tuple__37); - Py_VISIT(traverse_module_state->__pyx_tuple__39); - Py_VISIT(traverse_module_state->__pyx_tuple__41); - Py_VISIT(traverse_module_state->__pyx_codeobj__9); - Py_VISIT(traverse_module_state->__pyx_codeobj__18); - Py_VISIT(traverse_module_state->__pyx_codeobj__19); - Py_VISIT(traverse_module_state->__pyx_codeobj__21); - Py_VISIT(traverse_module_state->__pyx_codeobj__23); - Py_VISIT(traverse_module_state->__pyx_codeobj__25); - Py_VISIT(traverse_module_state->__pyx_codeobj__38); - Py_VISIT(traverse_module_state->__pyx_codeobj__40); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr); + for (int i=0; i<4; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); } + for (int i=0; i<2; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } + for (int i=0; i<14; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<175; ++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; } #endif -/* #### Code section: module_state_defines ### */ -#define __pyx_d __pyx_mstate_global->__pyx_d -#define __pyx_b __pyx_mstate_global->__pyx_b -#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime -#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple -#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes -#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode -#ifdef __Pyx_CyFunction_USED -#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType -#endif -#ifdef __Pyx_FusedFunction_USED -#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType -#endif -#ifdef __Pyx_Generator_USED -#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType -#endif -#ifdef __Pyx_IterableCoroutine_USED -#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType -#endif -#if CYTHON_USE_MODULE_STATE -#define __pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions __pyx_mstate_global->__pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions -#define __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint __pyx_mstate_global->__pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint -#define __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr -#define __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr -#define __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr __pyx_mstate_global->__pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr -#define __pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint __pyx_mstate_global->__pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint -#define __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr __pyx_mstate_global->__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr -#define __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr __pyx_mstate_global->__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr -#endif -#define __pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions -#define __pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint -#define __pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr -#define __pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr -#define __pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr -#define __pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint -#define __pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr -#define __pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr -#define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ -#define __pyx_n_s_AllDifferentConstraint __pyx_mstate_global->__pyx_n_s_AllDifferentConstraint -#define __pyx_n_s_AllEqualConstraint __pyx_mstate_global->__pyx_n_s_AllEqualConstraint -#define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError -#define __pyx_n_s_CompilableFunctionConstraint __pyx_mstate_global->__pyx_n_s_CompilableFunctionConstraint -#define __pyx_n_s_Constraint __pyx_mstate_global->__pyx_n_s_Constraint -#define __pyx_n_s_ExactSumConstraint __pyx_mstate_global->__pyx_n_s_ExactSumConstraint -#define __pyx_n_s_FunctionConstraint __pyx_mstate_global->__pyx_n_s_FunctionConstraint -#define __pyx_n_s_FunctionType __pyx_mstate_global->__pyx_n_s_FunctionType -#define __pyx_kp_u_Invalid_comparator __pyx_mstate_global->__pyx_kp_u_Invalid_comparator -#define __pyx_kp_u_Invalid_operator __pyx_mstate_global->__pyx_kp_u_Invalid_operator -#define __pyx_n_s_MaxProdConstraint __pyx_mstate_global->__pyx_n_s_MaxProdConstraint -#define __pyx_n_s_MaxSumConstraint __pyx_mstate_global->__pyx_n_s_MaxSumConstraint -#define __pyx_n_s_MinProdConstraint __pyx_mstate_global->__pyx_n_s_MinProdConstraint -#define __pyx_n_s_MinSumConstraint __pyx_mstate_global->__pyx_n_s_MinSumConstraint -#define __pyx_kp_u_Not_possible_comparator_should_b __pyx_mstate_global->__pyx_kp_u_Not_possible_comparator_should_b -#define __pyx_n_s_Optional __pyx_mstate_global->__pyx_n_s_Optional -#define __pyx_kp_s_Optional_Union_AllEqualConstrain __pyx_mstate_global->__pyx_kp_s_Optional_Union_AllEqualConstrain -#define __pyx_kp_s_Optional_Union_MinSumConstraint __pyx_mstate_global->__pyx_kp_s_Optional_Union_MinSumConstraint -#define __pyx_kp_s_Optional_Union_int_float __pyx_mstate_global->__pyx_kp_s_Optional_Union_int_float -#define __pyx_kp_u_Restriction __pyx_mstate_global->__pyx_kp_u_Restriction -#define __pyx_n_s_Union __pyx_mstate_global->__pyx_n_s_Union -#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError -#define __pyx_kp_u__10 __pyx_mstate_global->__pyx_kp_u__10 -#define __pyx_kp_u__11 __pyx_mstate_global->__pyx_kp_u__11 -#define __pyx_kp_u__12 __pyx_mstate_global->__pyx_kp_u__12 -#define __pyx_kp_u__13 __pyx_mstate_global->__pyx_kp_u__13 -#define __pyx_n_s__14 __pyx_mstate_global->__pyx_n_s__14 -#define __pyx_kp_u__14 __pyx_mstate_global->__pyx_kp_u__14 -#define __pyx_kp_u__15 __pyx_mstate_global->__pyx_kp_u__15 -#define __pyx_kp_u__16 __pyx_mstate_global->__pyx_kp_u__16 -#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 -#define __pyx_kp_u__26 __pyx_mstate_global->__pyx_kp_u__26 -#define __pyx_kp_u__27 __pyx_mstate_global->__pyx_kp_u__27 -#define __pyx_kp_u__29 __pyx_mstate_global->__pyx_kp_u__29 -#define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 -#define __pyx_kp_u__30 __pyx_mstate_global->__pyx_kp_u__30 -#define __pyx_kp_u__34 __pyx_mstate_global->__pyx_kp_u__34 -#define __pyx_kp_u__35 __pyx_mstate_global->__pyx_kp_u__35 -#define __pyx_kp_u__36 __pyx_mstate_global->__pyx_kp_u__36 -#define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 -#define __pyx_n_s__42 __pyx_mstate_global->__pyx_n_s__42 -#define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 -#define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6 -#define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7 -#define __pyx_kp_u_a_zA_Z__a_zA_Z__0_9 __pyx_mstate_global->__pyx_kp_u_a_zA_Z__a_zA_Z__0_9 -#define __pyx_kp_u_and __pyx_mstate_global->__pyx_kp_u_and -#define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args -#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines -#define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem -#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback -#define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close -#define __pyx_n_s_co_consts __pyx_mstate_global->__pyx_n_s_co_consts -#define __pyx_n_s_code_object __pyx_mstate_global->__pyx_n_s_code_object -#define __pyx_n_s_comparator __pyx_mstate_global->__pyx_n_s_comparator -#define __pyx_n_s_comparators __pyx_mstate_global->__pyx_n_s_comparators -#define __pyx_n_s_comparators_found __pyx_mstate_global->__pyx_n_s_comparators_found -#define __pyx_n_s_comparators_indices __pyx_mstate_global->__pyx_n_s_comparators_indices -#define __pyx_n_s_compile __pyx_mstate_global->__pyx_n_s_compile -#define __pyx_n_s_compile_to_constraints __pyx_mstate_global->__pyx_n_s_compile_to_constraints -#define __pyx_n_s_compiled_constraints __pyx_mstate_global->__pyx_n_s_compiled_constraints -#define __pyx_n_s_constraint __pyx_mstate_global->__pyx_n_s_constraint -#define __pyx_n_s_constraint_constraints __pyx_mstate_global->__pyx_n_s_constraint_constraints -#define __pyx_n_s_constraint_parser __pyx_mstate_global->__pyx_n_s_constraint_parser -#define __pyx_kp_s_constraint_parser_py __pyx_mstate_global->__pyx_kp_s_constraint_parser_py -#define __pyx_n_s_constraints __pyx_mstate_global->__pyx_n_s_constraints -#define __pyx_kp_u_def_r __pyx_mstate_global->__pyx_kp_u_def_r -#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict -#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable -#define __pyx_n_s_domains __pyx_mstate_global->__pyx_n_s_domains -#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable -#define __pyx_n_s_end __pyx_mstate_global->__pyx_n_s_end -#define __pyx_n_s_equalities_found __pyx_mstate_global->__pyx_n_s_equalities_found -#define __pyx_n_s_eval __pyx_mstate_global->__pyx_n_s_eval -#define __pyx_n_u_exec __pyx_mstate_global->__pyx_n_u_exec -#define __pyx_n_s_finalized_constraint __pyx_mstate_global->__pyx_n_s_finalized_constraint -#define __pyx_n_s_findall __pyx_mstate_global->__pyx_n_s_findall -#define __pyx_n_s_finditer __pyx_mstate_global->__pyx_n_s_finditer -#define __pyx_n_s_fromkeys __pyx_mstate_global->__pyx_n_s_fromkeys -#define __pyx_n_s_func __pyx_mstate_global->__pyx_n_s_func -#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc -#define __pyx_n_s_genexpr __pyx_mstate_global->__pyx_n_s_genexpr -#define __pyx_n_s_group __pyx_mstate_global->__pyx_n_s_group -#define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i -#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import -#define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index -#define __pyx_n_s_inequalities_found __pyx_mstate_global->__pyx_n_s_inequalities_found -#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing -#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine -#define __pyx_kp_u_is_neither_a_string_or_Constrai __pyx_mstate_global->__pyx_kp_u_is_neither_a_string_or_Constrai -#define __pyx_n_s_is_or_evals_to_number __pyx_mstate_global->__pyx_n_s_is_or_evals_to_number -#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled -#define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key -#define __pyx_n_s_left __pyx_mstate_global->__pyx_n_s_left -#define __pyx_n_s_left_num __pyx_mstate_global->__pyx_n_s_left_num -#define __pyx_kp_s_list_str __pyx_mstate_global->__pyx_kp_s_list_str -#define __pyx_kp_s_list_tuple_Constraint_list_str_U __pyx_mstate_global->__pyx_kp_s_list_tuple_Constraint_list_str_U -#define __pyx_kp_s_list_tuple_Union_Constraint_str __pyx_mstate_global->__pyx_kp_s_list_tuple_Union_Constraint_str -#define __pyx_n_s_m __pyx_mstate_global->__pyx_n_s_m -#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main -#define __pyx_n_s_match_object __pyx_mstate_global->__pyx_n_s_match_object -#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name -#define __pyx_n_s_next_stop __pyx_mstate_global->__pyx_n_s_next_stop -#define __pyx_n_s_number __pyx_mstate_global->__pyx_n_s_number -#define __pyx_n_s_number_is_int __pyx_mstate_global->__pyx_n_s_number_is_int -#define __pyx_n_s_operator __pyx_mstate_global->__pyx_n_s_operator -#define __pyx_n_s_operators __pyx_mstate_global->__pyx_n_s_operators -#define __pyx_n_s_operators_found __pyx_mstate_global->__pyx_n_s_operators_found -#define __pyx_kp_u_or __pyx_mstate_global->__pyx_kp_u_or -#define __pyx_n_s_param __pyx_mstate_global->__pyx_n_s_param -#define __pyx_n_s_params __pyx_mstate_global->__pyx_n_s_params -#define __pyx_kp_u_params_params_index __pyx_mstate_global->__pyx_kp_u_params_params_index -#define __pyx_n_s_params_used __pyx_mstate_global->__pyx_n_s_params_used -#define __pyx_n_s_params_used_list __pyx_mstate_global->__pyx_n_s_params_used_list -#define __pyx_n_s_parse_restrictions __pyx_mstate_global->__pyx_n_s_parse_restrictions -#define __pyx_n_s_parse_restrictions_locals_genexp __pyx_mstate_global->__pyx_n_s_parse_restrictions_locals_genexp -#define __pyx_n_s_parse_restrictions_locals_replac __pyx_mstate_global->__pyx_n_s_parse_restrictions_locals_replac -#define __pyx_n_s_parse_restrictions_locals_replac_2 __pyx_mstate_global->__pyx_n_s_parse_restrictions_locals_replac_2 -#define __pyx_n_s_parse_restrictions_locals_to_equ __pyx_mstate_global->__pyx_n_s_parse_restrictions_locals_to_equ -#define __pyx_n_s_parse_restrictions_locals_to_equ_2 __pyx_mstate_global->__pyx_n_s_parse_restrictions_locals_to_equ_2 -#define __pyx_n_s_parse_restrictions_locals_to_mul __pyx_mstate_global->__pyx_n_s_parse_restrictions_locals_to_mul -#define __pyx_n_s_parse_restrictions_locals_to_num __pyx_mstate_global->__pyx_n_s_parse_restrictions_locals_to_num -#define __pyx_n_s_parse_restrictions_locals_to_num_2 __pyx_mstate_global->__pyx_n_s_parse_restrictions_locals_to_num_2 -#define __pyx_n_s_parse_restrictions_locals_to_num_3 __pyx_mstate_global->__pyx_n_s_parse_restrictions_locals_to_num_3 -#define __pyx_n_s_parsed_restriction __pyx_mstate_global->__pyx_n_s_parsed_restriction -#define __pyx_n_s_parsed_restrictions __pyx_mstate_global->__pyx_n_s_parsed_restrictions -#define __pyx_n_s_picklable __pyx_mstate_global->__pyx_n_s_picklable -#define __pyx_n_s_prev_stop __pyx_mstate_global->__pyx_n_s_prev_stop -#define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r -#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range -#define __pyx_n_s_re __pyx_mstate_global->__pyx_n_s_re -#define __pyx_n_s_regex_match_variable __pyx_mstate_global->__pyx_n_s_regex_match_variable -#define __pyx_n_s_replace __pyx_mstate_global->__pyx_n_s_replace -#define __pyx_n_s_replace_params __pyx_mstate_global->__pyx_n_s_replace_params -#define __pyx_n_s_replace_params_split __pyx_mstate_global->__pyx_n_s_replace_params_split -#define __pyx_n_s_res __pyx_mstate_global->__pyx_n_s_res -#define __pyx_n_s_restriction __pyx_mstate_global->__pyx_n_s_restriction -#define __pyx_n_s_restrictions __pyx_mstate_global->__pyx_n_s_restrictions -#define __pyx_n_s_restrictions_cleaned __pyx_mstate_global->__pyx_n_s_restrictions_cleaned -#define __pyx_n_s_restrictions_cleaned_unique __pyx_mstate_global->__pyx_n_s_restrictions_cleaned_unique -#define __pyx_n_s_restrictions_unique_indices __pyx_mstate_global->__pyx_n_s_restrictions_unique_indices -#define __pyx_n_s_return __pyx_mstate_global->__pyx_n_s_return -#define __pyx_kp_u_return_2 __pyx_mstate_global->__pyx_kp_u_return_2 -#define __pyx_n_s_right __pyx_mstate_global->__pyx_n_s_right -#define __pyx_n_s_right_num __pyx_mstate_global->__pyx_n_s_right_num -#define __pyx_n_s_s __pyx_mstate_global->__pyx_n_s_s -#define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send -#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec -#define __pyx_n_s_split __pyx_mstate_global->__pyx_n_s_split -#define __pyx_n_s_split_restrictions __pyx_mstate_global->__pyx_n_s_split_restrictions -#define __pyx_n_s_splitted __pyx_mstate_global->__pyx_n_s_splitted -#define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start -#define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str -#define __pyx_kp_u_string __pyx_mstate_global->__pyx_kp_u_string -#define __pyx_n_s_strip __pyx_mstate_global->__pyx_n_s_strip -#define __pyx_n_s_sub __pyx_mstate_global->__pyx_n_s_sub -#define __pyx_n_s_temp_copy __pyx_mstate_global->__pyx_n_s_temp_copy -#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test -#define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw -#define __pyx_n_s_to_equality_constraint __pyx_mstate_global->__pyx_n_s_to_equality_constraint -#define __pyx_n_s_to_multiple_restrictions __pyx_mstate_global->__pyx_n_s_to_multiple_restrictions -#define __pyx_n_s_to_numeric_constraint __pyx_mstate_global->__pyx_n_s_to_numeric_constraint -#define __pyx_n_s_tune_params __pyx_mstate_global->__pyx_n_s_tune_params -#define __pyx_n_s_types __pyx_mstate_global->__pyx_n_s_types -#define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing -#define __pyx_n_s_variables __pyx_mstate_global->__pyx_n_s_variables -#define __pyx_n_s_variables_on_left __pyx_mstate_global->__pyx_n_s_variables_on_left -#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 -#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 -#define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 -#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 -#define __pyx_slice__31 __pyx_mstate_global->__pyx_slice__31 -#define __pyx_slice__32 __pyx_mstate_global->__pyx_slice__32 -#define __pyx_slice__33 __pyx_mstate_global->__pyx_slice__33 -#define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 -#define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 -#define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 -#define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 -#define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 -#define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 -#define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39 -#define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41 -#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 -#define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 -#define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 -#define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 -#define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 -#define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 -#define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 -#define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40 /* #### Code section: module_code ### */ -/* "constraint/parser.py":23 +/* "constraint/parser.py":24 * ) * * 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 - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6parser_1parse_restrictions(PyObject *__pyx_self, @@ -3723,7 +3333,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_6parser_parse_restrictions, "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."); -static PyMethodDef __pyx_mdef_10constraint_6parser_1parse_restrictions = {"parse_restrictions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_1parse_restrictions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6parser_parse_restrictions}; +static PyMethodDef __pyx_mdef_10constraint_6parser_1parse_restrictions = {"parse_restrictions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_1parse_restrictions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6parser_parse_restrictions}; static PyObject *__pyx_pw_10constraint_6parser_1parse_restrictions(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3745,7 +3355,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse_restrictions (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -3753,92 +3363,79 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_restrictions,&__pyx_n_s_tune_params,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 24, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + 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) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_restrictions)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 23, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tune_params)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 23, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("parse_restrictions", 1, 2, 2, 1); __PYX_ERR(0, 23, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "parse_restrictions") < 0)) __PYX_ERR(0, 23, __pyx_L3_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, 24, __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, 24, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 24, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 24, __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, 23, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("parse_restrictions", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 24, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restrictions), (&PyList_Type), 0, "restrictions", 1))) __PYX_ERR(0, 23, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tune_params), (&PyDict_Type), 0, "tune_params", 1))) __PYX_ERR(0, 23, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restrictions), (&PyList_Type), 0, "restrictions", 2))) __PYX_ERR(0, 24, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tune_params), (&PyDict_Type), 0, "tune_params", 2))) __PYX_ERR(0, 24, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_parse_restrictions(__pyx_self, __pyx_v_restrictions, __pyx_v_tune_params); /* 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } -/* "constraint/parser.py":28 +/* "constraint/parser.py":29 * regex_match_variable = r"([a-zA-Z_$][a-zA-Z_$0-9]*)" * * def replace_params(match_object): # <<<<<<<<<<<<<< * key = match_object.group(1) * if key in tune_params: - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_1replace_params(PyObject *__pyx_self, @@ -3848,7 +3445,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_6parser_18parse_restrictions_1replace_params = {"replace_params", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_18parse_restrictions_1replace_params, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_6parser_18parse_restrictions_1replace_params = {"replace_params", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_18parse_restrictions_1replace_params, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_1replace_params(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3869,7 +3466,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("replace_params (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -3877,47 +3474,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_match_object,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 29, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 29, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_match_object)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "replace_params") < 0)) __PYX_ERR(0, 28, __pyx_L3_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, 29, __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, 29, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 29, __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, 28, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("replace_params", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 29, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.replace_params", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3926,11 +3515,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_6parser_18parse_restrictions_replace_params(__pyx_self, __pyx_v_match_object); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -3945,110 +3531,95 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; - int __pyx_t_5; + size_t __pyx_t_3; + int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("replace_params", 1); + __Pyx_RefNannySetupContext("replace_params", 0); __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":29 + /* "constraint/parser.py":30 * * def replace_params(match_object): * key = match_object.group(1) # <<<<<<<<<<<<<< * if key in tune_params: * param = str(key) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_match_object, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + __pyx_t_2 = __pyx_v_match_object; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_1}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error) + 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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_key = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":30 + /* "constraint/parser.py":31 * 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, 30, __pyx_L1_error) } +*/ + if (unlikely(!__pyx_cur_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 31, __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, 30, __pyx_L1_error) + __PYX_ERR(0, 31, __pyx_L1_error) } - __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_key, __pyx_cur_scope->__pyx_v_tune_params, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 30, __pyx_L1_error) - if (__pyx_t_5) { + __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, 31, __pyx_L1_error) + if (__pyx_t_4) { - /* "constraint/parser.py":31 + /* "constraint/parser.py":32 * 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, 31, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_param = __pyx_t_1; + __pyx_v_param = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":32 + /* "constraint/parser.py":33 * if key in tune_params: * param = str(key) * return "params[params_index['" + param + "']]" # <<<<<<<<<<<<<< * else: * return key - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyNumber_Add(__pyx_kp_u_params_params_index, __pyx_v_param); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __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, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_u_); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __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":30 + /* "constraint/parser.py":31 * def replace_params(match_object): * key = match_object.group(1) * if key in tune_params: # <<<<<<<<<<<<<< * param = str(key) * return "params[params_index['" + param + "']]" - */ +*/ } - /* "constraint/parser.py":34 + /* "constraint/parser.py":35 * return "params[params_index['" + param + "']]" * else: * return key # <<<<<<<<<<<<<< * * def replace_params_split(match_object): - */ +*/ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_key); @@ -4056,19 +3627,18 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para goto __pyx_L0; } - /* "constraint/parser.py":28 + /* "constraint/parser.py":29 * regex_match_variable = r"([a-zA-Z_$][a-zA-Z_$0-9]*)" * * def replace_params(match_object): # <<<<<<<<<<<<<< * key = match_object.group(1) * if key in tune_params: - */ +*/ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("constraint.parser.parse_restrictions.replace_params", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -4079,13 +3649,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para return __pyx_r; } -/* "constraint/parser.py":36 +/* "constraint/parser.py":37 * return key * * def replace_params_split(match_object): # <<<<<<<<<<<<<< * # careful: has side-effect of adding to set `params_used` * key = match_object.group(1) - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_3replace_params_split(PyObject *__pyx_self, @@ -4095,7 +3665,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_6parser_18parse_restrictions_3replace_params_split = {"replace_params_split", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_18parse_restrictions_3replace_params_split, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_6parser_18parse_restrictions_3replace_params_split = {"replace_params_split", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_18parse_restrictions_3replace_params_split, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_3replace_params_split(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4116,7 +3686,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("replace_params_split (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -4124,47 +3694,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_match_object,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 37, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + 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; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_match_object)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "replace_params_split") < 0)) __PYX_ERR(0, 36, __pyx_L3_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, 37, __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, 37, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 37, __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, 36, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("replace_params_split", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 37, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.replace_params_split", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4173,11 +3735,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_6parser_18parse_restrictions_2replace_params_split(__pyx_self, __pyx_v_match_object); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -4192,120 +3751,105 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; + size_t __pyx_t_3; + int __pyx_t_4; int __pyx_t_5; - int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("replace_params_split", 1); + __Pyx_RefNannySetupContext("replace_params_split", 0); __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":38 + /* "constraint/parser.py":39 * def replace_params_split(match_object): * # careful: has side-effect of adding to set `params_used` * key = match_object.group(1) # <<<<<<<<<<<<<< * if key in tune_params: * param = str(key) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_match_object, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + __pyx_t_2 = __pyx_v_match_object; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_1}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) + 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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_key = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":39 + /* "constraint/parser.py":40 * # 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, 39, __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, 39, __pyx_L1_error) + __PYX_ERR(0, 40, __pyx_L1_error) } - __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_key, __pyx_cur_scope->__pyx_v_tune_params, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 39, __pyx_L1_error) - if (__pyx_t_5) { + __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":40 + /* "constraint/parser.py":41 * 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, 40, __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 = __pyx_t_1; + __pyx_v_param = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":41 + /* "constraint/parser.py":42 * 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, 41, __pyx_L1_error) } +*/ + if (unlikely(!__pyx_cur_scope->__pyx_v_params_used)) { __Pyx_RaiseClosureNameError("params_used"); __PYX_ERR(0, 42, __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, 41, __pyx_L1_error) + __PYX_ERR(0, 42, __pyx_L1_error) } - __pyx_t_6 = PySet_Add(__pyx_cur_scope->__pyx_v_params_used, __pyx_v_param); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 41, __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, 42, __pyx_L1_error) - /* "constraint/parser.py":42 + /* "constraint/parser.py":43 * param = str(key) * params_used.add(param) * return param # <<<<<<<<<<<<<< * else: * return key - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_param); __pyx_r = __pyx_v_param; goto __pyx_L0; - /* "constraint/parser.py":39 + /* "constraint/parser.py":40 * # 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) - */ +*/ } - /* "constraint/parser.py":44 + /* "constraint/parser.py":45 * return param * else: * return key # <<<<<<<<<<<<<< * * def to_multiple_restrictions(restrictions: list[str]) -> list[str]: - */ +*/ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_key); @@ -4313,19 +3857,18 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par goto __pyx_L0; } - /* "constraint/parser.py":36 + /* "constraint/parser.py":37 * return key * * def replace_params_split(match_object): # <<<<<<<<<<<<<< * # careful: has side-effect of adding to set `params_used` * key = match_object.group(1) - */ +*/ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("constraint.parser.parse_restrictions.replace_params_split", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -4336,13 +3879,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par return __pyx_r; } -/* "constraint/parser.py":46 +/* "constraint/parser.py":47 * 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() - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_5to_multiple_restrictions(PyObject *__pyx_self, @@ -4353,7 +3896,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_6parser_18parse_restrictions_4to_multiple_restrictions, "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])])."); -static PyMethodDef __pyx_mdef_10constraint_6parser_18parse_restrictions_5to_multiple_restrictions = {"to_multiple_restrictions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_18parse_restrictions_5to_multiple_restrictions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6parser_18parse_restrictions_4to_multiple_restrictions}; +static PyMethodDef __pyx_mdef_10constraint_6parser_18parse_restrictions_5to_multiple_restrictions = {"to_multiple_restrictions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_18parse_restrictions_5to_multiple_restrictions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6parser_18parse_restrictions_4to_multiple_restrictions}; static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_5to_multiple_restrictions(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4374,7 +3917,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("to_multiple_restrictions (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -4382,66 +3925,60 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_restrictions,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 47, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 47, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_restrictions)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_multiple_restrictions") < 0)) __PYX_ERR(0, 46, __pyx_L3_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, 47, __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, 47, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 47, __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, 46, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("to_multiple_restrictions", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 47, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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_multiple_restrictions", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restrictions), (&PyList_Type), 0, "restrictions", 1))) __PYX_ERR(0, 46, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restrictions), (&PyList_Type), 0, "restrictions", 2))) __PYX_ERR(0, 47, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple_restrictions(__pyx_self, __pyx_v_restrictions); /* 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -4468,278 +4005,243 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; - unsigned int __pyx_t_11; + size_t __pyx_t_11; Py_ssize_t __pyx_t_12; PyObject *(*__pyx_t_13)(PyObject *); - PyObject *__pyx_t_14 = NULL; - Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("to_multiple_restrictions", 1); + __Pyx_RefNannySetupContext("to_multiple_restrictions", 0); - /* "constraint/parser.py":48 + /* "constraint/parser.py":49 * 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, 48, __pyx_L1_error) +*/ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_split_restrictions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":49 + /* "constraint/parser.py":50 * """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 * if " and " in res or " or " in res: - */ +*/ __pyx_t_1 = __pyx_v_restrictions; __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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 49, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 50, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 49, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + ++__pyx_t_2; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - #endif __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":51 + /* "constraint/parser.py":52 * 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_kp_u_and, __pyx_v_res, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 51, __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, 52, __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_kp_u_or, __pyx_v_res, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 51, __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, 52, __pyx_L1_error) __pyx_t_4 = __pyx_t_5; __pyx_L6_bool_binop_done:; if (__pyx_t_4) { - /* "constraint/parser.py":52 + /* "constraint/parser.py":53 * # 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, 52, __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, 53, __pyx_L1_error) - /* "constraint/parser.py":53 + /* "constraint/parser.py":54 * if " and " in res or " or " in res: * split_restrictions.append(res) * continue # <<<<<<<<<<<<<< * # find the indices of splittable comparators * comparators = ["<=", ">=", ">", "<"] - */ +*/ goto __pyx_L3_continue; - /* "constraint/parser.py":51 + /* "constraint/parser.py":52 * 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 - */ +*/ } - /* "constraint/parser.py":55 + /* "constraint/parser.py":56 * 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, 55, __pyx_L1_error) +*/ + __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_GIVEREF(__pyx_kp_u__2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u__2)) __PYX_ERR(0, 55, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u__3); - __Pyx_GIVEREF(__pyx_kp_u__3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__3)) __PYX_ERR(0, 55, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u__4); - __Pyx_GIVEREF(__pyx_kp_u__4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__4)) __PYX_ERR(0, 55, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u__5); - __Pyx_GIVEREF(__pyx_kp_u__5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_kp_u__5)) __PYX_ERR(0, 55, __pyx_L1_error); + __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, 56, __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, 56, __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, 56, __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, 56, __pyx_L1_error); __Pyx_XDECREF_SET(__pyx_v_comparators, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "constraint/parser.py":56 + /* "constraint/parser.py":57 * # 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: * # this can't be split further - */ +*/ { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L10_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_re); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 56, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_finditer); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 56, __pyx_L10_error) + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 57, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyUnicode_Join(__pyx_kp_u__6, __pyx_v_comparators); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 56, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = NULL; - __pyx_t_11 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_finditer); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 57, __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, 57, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_11 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10); + assert(__pyx_t_8); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); + __pyx_t_11 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_8, __pyx_v_res}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 2+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 56, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_7); + 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_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, 57, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_7); } if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { - __pyx_t_9 = __pyx_t_7; __Pyx_INCREF(__pyx_t_9); + __pyx_t_10 = __pyx_t_7; __Pyx_INCREF(__pyx_t_10); __pyx_t_12 = 0; __pyx_t_13 = NULL; } else { - __pyx_t_12 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 56, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 56, __pyx_L10_error) + __pyx_t_12 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 57, __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, 57, __pyx_L10_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { if (likely(!__pyx_t_13)) { - if (likely(PyList_CheckExact(__pyx_t_9))) { + if (likely(PyList_CheckExact(__pyx_t_10))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 56, __pyx_L10_error) + 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, 57, __pyx_L10_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 56, __pyx_L10_error) - #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 56, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_7); - #endif + __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_12); + ++__pyx_t_12; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 56, __pyx_L10_error) + 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, 57, __pyx_L10_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 56, __pyx_L10_error) + __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_12)); #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 56, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_12); #endif + ++__pyx_t_12; } + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 57, __pyx_L10_error) } else { - __pyx_t_7 = __pyx_t_13(__pyx_t_9); + __pyx_t_7 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 56, __pyx_L10_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 57, __pyx_L10_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_7); } + __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_m, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_7genexpr__pyx_v_m, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 56, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = NULL; + __pyx_t_9 = __pyx_7genexpr__pyx_v_m; + __Pyx_INCREF(__pyx_t_9); __pyx_t_11 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_11 = 1; - } - } - #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_int_0}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 56, __pyx_L10_error) + 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_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 57, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_7genexpr__pyx_v_m, __pyx_n_s_end); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 56, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_14 = NULL; + __pyx_t_8 = __pyx_7genexpr__pyx_v_m; + __Pyx_INCREF(__pyx_t_8); __pyx_t_11 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_11 = 1; - } - } - #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_int_0}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 56, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 57, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_9); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 56, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 57, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7)) __PYX_ERR(0, 56, __pyx_L10_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8)) __PYX_ERR(0, 56, __pyx_L10_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 57, __pyx_L10_error); + __Pyx_GIVEREF(__pyx_t_9); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 57, __pyx_L10_error); __pyx_t_7 = 0; - __pyx_t_8 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 56, __pyx_L10_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_9 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 57, __pyx_L10_error) + __Pyx_DECREF(__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; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_m); __pyx_7genexpr__pyx_v_m = 0; goto __pyx_L14_exit_scope; __pyx_L10_error:; @@ -4750,266 +4252,259 @@ 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":57 + /* "constraint/parser.py":58 * 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, 57, __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, 58, __pyx_L1_error) __pyx_t_4 = (__pyx_t_12 <= 1); if (__pyx_t_4) { - /* "constraint/parser.py":59 + /* "constraint/parser.py":60 * 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, 59, __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, 60, __pyx_L1_error) - /* "constraint/parser.py":60 + /* "constraint/parser.py":61 * # this can't be split further * split_restrictions.append(res) * continue # <<<<<<<<<<<<<< * # split the restrictions from the previous to the next comparator * for index in range(len(comparators_indices)): - */ +*/ goto __pyx_L3_continue; - /* "constraint/parser.py":57 + /* "constraint/parser.py":58 * 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) - */ +*/ } - /* "constraint/parser.py":62 + /* "constraint/parser.py":63 * continue * # split the restrictions from the previous to the next comparator * for index in range(len(comparators_indices)): # <<<<<<<<<<<<<< * temp_copy = res * prev_stop = comparators_indices[index - 1][1] + 1 if index > 0 else 0 - */ - __pyx_t_12 = __Pyx_PyList_GET_SIZE(__pyx_v_comparators_indices); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 62, __pyx_L1_error) - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 62, __pyx_L1_error) +*/ + __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, 63, __pyx_L1_error) + __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) { - __pyx_t_3 = __pyx_t_9; __Pyx_INCREF(__pyx_t_3); + __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)); + __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, 63, __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_3 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 63, __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, 63, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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_8))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 62, __pyx_L1_error) + 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, 63, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 62, __pyx_L1_error) - #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 62, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - #endif + __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_3); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 62, __pyx_L1_error) + 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, 63, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_12)); #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 62, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_12); #endif + ++__pyx_t_12; } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error) } else { - __pyx_t_9 = __pyx_t_13(__pyx_t_3); - if (unlikely(!__pyx_t_9)) { + __pyx_t_3 = __pyx_t_13(__pyx_t_8); + if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 62, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 63, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_9); } - __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9); - __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/parser.py":63 + /* "constraint/parser.py":64 * # split the restrictions from the previous to the next comparator * 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 = ( - */ +*/ __Pyx_INCREF(__pyx_v_res); __Pyx_XDECREF_SET(__pyx_v_temp_copy, __pyx_v_res); - /* "constraint/parser.py":64 + /* "constraint/parser.py":65 * 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_10 = PyObject_RichCompare(__pyx_v_index, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 64, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 64, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; +*/ + __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, 65, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_4) { - __pyx_t_10 = __Pyx_PyInt_SubtractObjC(__pyx_v_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 64, __pyx_L1_error) + __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, 65, __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, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_comparators_indices, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 64, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __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); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 64, __pyx_L1_error) + __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, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 64, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_9 = __pyx_t_8; - __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_3 = __pyx_t_10; + __pyx_t_10 = 0; } else { - __Pyx_INCREF(__pyx_int_0); - __pyx_t_9 = __pyx_int_0; + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_t_3 = __pyx_mstate_global->__pyx_int_0; } - __Pyx_XDECREF_SET(__pyx_v_prev_stop, __pyx_t_9); - __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_prev_stop, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/parser.py":66 + /* "constraint/parser.py":67 * 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_15 = __Pyx_PyList_GET_SIZE(__pyx_v_comparators_indices); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 66, __pyx_L1_error) - __pyx_t_8 = PyInt_FromSsize_t((__pyx_t_15 - 1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = PyObject_RichCompare(__pyx_v_index, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 66, __pyx_L1_error) +*/ + __pyx_t_14 = __Pyx_PyList_GET_SIZE(__pyx_v_comparators_indices); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_10 = PyLong_FromSsize_t((__pyx_t_14 - 1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 67, __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, 67, __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, 67, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_4) { - __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_v_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L1_error) + __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, 67, __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, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_comparators_indices, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __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); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_9 = __pyx_t_10; - __pyx_t_10 = 0; + __pyx_t_3 = __pyx_t_9; + __pyx_t_9 = 0; } else { - __pyx_t_15 = PyObject_Length(__pyx_v_temp_copy); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 66, __pyx_L1_error) - __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_15); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __pyx_t_10; - __pyx_t_10 = 0; + __pyx_t_14 = PyObject_Length(__pyx_v_temp_copy); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __pyx_t_9; + __pyx_t_9 = 0; } - __Pyx_XDECREF_SET(__pyx_v_next_stop, __pyx_t_9); - __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_next_stop, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/parser.py":68 + /* "constraint/parser.py":69 * 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, 68, __pyx_L1_error) +*/ + __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, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_strip); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 68, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = NULL; + __pyx_t_9 = __pyx_t_10; + __Pyx_INCREF(__pyx_t_9); __pyx_t_11 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_11 = 1; - } - } - #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 68, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_split_restrictions, __pyx_t_9); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 68, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_split_restrictions, __pyx_t_3); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":62 + /* "constraint/parser.py":63 * continue * # split the restrictions from the previous to the next comparator * for index in range(len(comparators_indices)): # <<<<<<<<<<<<<< * temp_copy = res * prev_stop = comparators_indices[index - 1][1] + 1 if index > 0 else 0 - */ +*/ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/parser.py":49 + /* "constraint/parser.py":50 * """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 * if " and " in res or " or " in res: - */ +*/ __pyx_L3_continue:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":69 + /* "constraint/parser.py":70 * ) * split_restrictions.append(temp_copy[prev_stop:next_stop].strip()) * return split_restrictions # <<<<<<<<<<<<<< * * def to_numeric_constraint( - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_split_restrictions); __pyx_r = __pyx_v_split_restrictions; goto __pyx_L0; - /* "constraint/parser.py":46 + /* "constraint/parser.py":47 * 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() - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -5019,7 +4514,6 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("constraint.parser.parse_restrictions.to_multiple_restrictions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -5037,13 +4531,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple return __pyx_r; } -/* "constraint/parser.py":71 +/* "constraint/parser.py":72 * return split_restrictions * * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_7to_numeric_constraint(PyObject *__pyx_self, @@ -5054,7 +4548,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_6parser_18parse_restrictions_6to_numeric_constraint, "Converts a restriction to a built-in numeric constraint if possible."); -static PyMethodDef __pyx_mdef_10constraint_6parser_18parse_restrictions_7to_numeric_constraint = {"to_numeric_constraint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_18parse_restrictions_7to_numeric_constraint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6parser_18parse_restrictions_6to_numeric_constraint}; +static PyMethodDef __pyx_mdef_10constraint_6parser_18parse_restrictions_7to_numeric_constraint = {"to_numeric_constraint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_18parse_restrictions_7to_numeric_constraint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6parser_18parse_restrictions_6to_numeric_constraint}; static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_7to_numeric_constraint(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -5076,7 +4570,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("to_numeric_constraint (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -5084,92 +4578,79 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_restriction,&__pyx_n_s_params,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 72, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 72, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_restriction)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("to_numeric_constraint", 1, 2, 2, 1); __PYX_ERR(0, 71, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_numeric_constraint") < 0)) __PYX_ERR(0, 71, __pyx_L3_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, 72, __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, 72, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 72, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 72, __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, 71, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("to_numeric_constraint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 72, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restriction), (&PyUnicode_Type), 0, "restriction", 1))) __PYX_ERR(0, 72, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 1))) __PYX_ERR(0, 72, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restriction), (&PyUnicode_Type), 0, "restriction", 2))) __PYX_ERR(0, 73, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 73, __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 */ 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } -/* "constraint/parser.py":86 +/* "constraint/parser.py":87 * * # 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, @@ -5179,7 +4660,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds 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*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_1is_or_evals_to_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +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 @@ -5200,7 +4681,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_or_evals_to_number (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -5208,66 +4689,60 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 87, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 87, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_s)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_or_evals_to_number") < 0)) __PYX_ERR(0, 86, __pyx_L3_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, 87, __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, 87, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 87, __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, 86, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("is_or_evals_to_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 87, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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", 1))) __PYX_ERR(0, 86, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_s), (&PyUnicode_Type), 0, "s", 2))) __PYX_ERR(0, 87, __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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -5282,21 +4757,24 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - int __pyx_t_8; - int __pyx_t_9; + 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", 1); + __Pyx_RefNannySetupContext("is_or_evals_to_number", 0); - /* "constraint/parser.py":87 + /* "constraint/parser.py":88 * # 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 @@ -5306,130 +4784,125 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "constraint/parser.py":89 + /* "constraint/parser.py":90 * 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_4 = __Pyx_Globals(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_5); +*/ + __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, 90, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 90, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_8); if (__pyx_v_number) { - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_number, __pyx_v_number) < 0) __PYX_ERR(0, 89, __pyx_L3_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_number, __pyx_v_number) < 0) __PYX_ERR(0, 90, __pyx_L3_error) } if (__pyx_v_s) { - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_s, __pyx_v_s) < 0) __PYX_ERR(0, 89, __pyx_L3_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_s, __pyx_v_s) < 0) __PYX_ERR(0, 90, __pyx_L3_error) } - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_v_s); - __Pyx_GIVEREF(__pyx_v_s); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_s)) __PYX_ERR(0, 89, __pyx_L3_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(0, 89, __pyx_L3_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5)) __PYX_ERR(0, 89, __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, 90, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_4); + } + __pyx_v_number = __pyx_t_4; __pyx_t_4 = 0; - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_eval, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_v_number = __pyx_t_5; - __pyx_t_5 = 0; - /* "constraint/parser.py":90 + /* "constraint/parser.py":91 * # 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_8 = PyInt_Check(__pyx_v_number); - if (!__pyx_t_8) { + __pyx_t_11 = PyLong_Check(__pyx_v_number); + if (!__pyx_t_11) { } else { - __pyx_t_7 = __pyx_t_8; + __pyx_t_10 = __pyx_t_11; goto __pyx_L9_bool_binop_done; } - __pyx_t_8 = PyFloat_Check(__pyx_v_number); - __pyx_t_7 = __pyx_t_8; + __pyx_t_11 = PyFloat_Check(__pyx_v_number); + __pyx_t_10 = __pyx_t_11; __pyx_L9_bool_binop_done:; - if (unlikely(!__pyx_t_7)) { + if (unlikely(!__pyx_t_10)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 90, __pyx_L3_error) + __PYX_ERR(0, 91, __pyx_L3_error) } } #else - if ((1)); else __PYX_ERR(0, 90, __pyx_L3_error) + if ((1)); else __PYX_ERR(0, 91, __pyx_L3_error) #endif - /* "constraint/parser.py":91 + /* "constraint/parser.py":92 * 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":87 + /* "constraint/parser.py":88 * # 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":92 + /* "constraint/parser.py":93 * assert isinstance(number, (int, float)) * return number * except Exception: # <<<<<<<<<<<<<< * # it's not a solvable subexpression, return None * return None - */ - __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - if (__pyx_t_9) { - __Pyx_AddTraceback("constraint.parser.parse_restrictions.to_numeric_constraint.is_or_evals_to_number", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 92, __pyx_L5_except_error) - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_4); +*/ + __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); + if (__pyx_t_12) { + __Pyx_ErrRestore(0,0,0); - /* "constraint/parser.py":94 + /* "constraint/parser.py":95 * 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 - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; - /* "constraint/parser.py":87 + /* "constraint/parser.py":88 * # 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); @@ -5450,19 +4923,21 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric goto __pyx_L0; } - /* "constraint/parser.py":86 + /* "constraint/parser.py":87 * * # 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:; @@ -5473,13 +4948,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric } 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 */ -/* "constraint/parser.py":83 +/* "constraint/parser.py":84 * * # split the string on the comparison and remove leading and trailing whitespace * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< * * # find out which side is the constant number - */ +*/ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_2genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0, PyObject *__pyx_genexpr_arg_1) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *__pyx_cur_scope; @@ -5489,11 +4964,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr(__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 83, __pyx_L1_error) + __PYX_ERR(0, 84, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5504,7 +4979,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_4generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_parse_restrictions_locals_to_num, __pyx_n_s_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 83, __pyx_L1_error) + __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[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); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5528,8 +5003,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - unsigned int __pyx_t_6; + size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -5543,10 +5017,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 83, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 83, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 83, __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, 83, __pyx_L1_error) + 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, 84, __pyx_L1_error) + } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 84, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 84, __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, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -5554,44 +5031,28 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 83, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 84, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 83, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); + ++__pyx_t_3; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - #endif __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; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_s, __pyx_n_s_strip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } - } - #endif + __pyx_t_4 = __pyx_cur_scope->__pyx_v_s; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) + 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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5609,23 +5070,24 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_2); __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 83, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 84, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ - PyErr_SetNone(PyExc_StopIteration); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + } __pyx_L0:; - __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif @@ -5636,13 +5098,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":144 - * # check which operator is applied on the variables - * operator = operators_found[0] - * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< - * # if the operator is inconsistent (e.g. 'x + y * z == 3'), return None - * return None - */ +/* "constraint/parser.py":104 + * variable_supported_operators = ['+'] + * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] + * if all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # <<<<<<<<<<<<<< + * variables_on_left = len(right) == 1 + * if comparator == "==": +*/ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_5genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *__pyx_cur_scope; @@ -5652,11 +5114,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric 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_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL); + __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, 144, __pyx_L1_error) + __PYX_ERR(0, 104, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5667,7 +5129,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_7generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_parse_restrictions_locals_to_num, __pyx_n_s_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7generator1, ((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, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5691,8 +5153,10 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_t_6; + PyObject *__pyx_t_5 = NULL; + size_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -5705,70 +5169,76 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 144, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 144, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 104, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 104, __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, 144, __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, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __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, 104, __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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 144, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 104, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 144, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 144, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 104, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 144, __pyx_L1_error) + __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); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif + ++__pyx_t_2; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 144, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 104, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_4); } - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_o); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_o, __pyx_t_4); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __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, 144, __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, 144, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 144, __pyx_L1_error) + __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_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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __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, 104, __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, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = (!__pyx_t_5); - if (__pyx_t_6) { + __pyx_t_8 = (!__pyx_t_7); + if (__pyx_t_8) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -5788,10 +5258,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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 @@ -5804,13 +5277,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":151 - * 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 == "**": - */ +/* "constraint/parser.py":159 + * # check which operator is applied on the variables + * operator = operators_found[0] + * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< + * # if the operator is inconsistent (e.g. 'x + y * z == 3'), return None + * return None +*/ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *__pyx_cur_scope; @@ -5820,11 +5293,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr(__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 151, __pyx_L1_error) + __PYX_ERR(0, 159, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5835,7 +5308,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_10generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_parse_restrictions_locals_to_num, __pyx_n_s_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator2, ((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, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5859,11 +5332,8 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - unsigned int __pyx_t_7; - int __pyx_t_8; - int __pyx_t_9; + int __pyx_t_5; + int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -5876,93 +5346,67 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 151, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 151, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 159, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 159, __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, 151, __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, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __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, 159, __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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 151, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 159, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 151, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 151, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 159, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 151, __pyx_L1_error) + __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); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif + ++__pyx_t_2; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 151, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 159, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_4); } - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_4); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_o); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_o, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_s, __pyx_n_s_strip); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 151, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_params, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 151, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_operator)) { __Pyx_RaiseClosureNameError("operator"); __PYX_ERR(0, 159, __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, 159, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = (!__pyx_t_8); - if (__pyx_t_9) { + __pyx_t_6 = (!__pyx_t_5); + if (__pyx_t_6) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -5982,12 +5426,12 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + 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 @@ -5998,14 +5442,193 @@ 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_13generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":71 - * return split_restrictions +/* "constraint/parser.py":166 + * 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 == "**": +*/ + +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_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_5_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 166, __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_13generator3, ((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, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 166, __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_13generator3(__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; + PyObject *__pyx_t_1 = NULL; + 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_t_8; + 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, 166, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 166, __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, 166, __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, 166, __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, 166, __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, 166, __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, 166, __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, 166, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __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_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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __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, 166, __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, 166, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = (!__pyx_t_7); + if (__pyx_t_8) { + __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_4); + __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; +} + +/* "constraint/parser.py":72 + * return split_restrictions * * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: - */ +*/ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_constraint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_restriction, PyObject *__pyx_v_params) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *__pyx_cur_scope; @@ -6017,36 +5640,40 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ PyObject *__pyx_v_is_or_evals_to_number = 0; PyObject *__pyx_v_left_num = NULL; PyObject *__pyx_v_right_num = NULL; - PyObject *__pyx_v_number = NULL; + PyObject *__pyx_v_variable_supported_operators = NULL; PyObject *__pyx_v_variables = NULL; PyObject *__pyx_v_variables_on_left = NULL; + PyObject *__pyx_v_number = NULL; int __pyx_v_number_is_int; 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_8genexpr2__pyx_v_s = NULL; PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7generator1 = 0; PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator2 = 0; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_13generator3 = 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; - unsigned int __pyx_t_5; + size_t __pyx_t_5; Py_ssize_t __pyx_t_6; int __pyx_t_7; int __pyx_t_8; - Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("to_numeric_constraint", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint(__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint, __pyx_mstate_global->__pyx_empty_tuple, NULL); 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, 71, __pyx_L1_error) + __PYX_ERR(0, 72, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6054,205 +5681,204 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_params); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_params); - /* "constraint/parser.py":75 + /* "constraint/parser.py":76 * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: * """Converts a restriction to a built-in numeric constraint if possible.""" * comparators = ["<=", "==", ">=", ">", "<"] # <<<<<<<<<<<<<< * comparators_found = re.findall("|".join(comparators), restriction) * # check if there is exactly one comparator, if not, return None - */ - __pyx_t_1 = PyList_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) +*/ + __pyx_t_1 = PyList_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_GIVEREF(__pyx_kp_u__2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2)) __PYX_ERR(0, 75, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u__7); - __Pyx_GIVEREF(__pyx_kp_u__7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__7)) __PYX_ERR(0, 75, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u__3); - __Pyx_GIVEREF(__pyx_kp_u__3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__3)) __PYX_ERR(0, 75, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u__4); - __Pyx_GIVEREF(__pyx_kp_u__4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__4)) __PYX_ERR(0, 75, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u__5); - __Pyx_GIVEREF(__pyx_kp_u__5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__5)) __PYX_ERR(0, 75, __pyx_L1_error); + __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_1, 0, __pyx_mstate_global->__pyx_kp_u__2) != (0)) __PYX_ERR(0, 76, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__7); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__7); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_kp_u__7) != (0)) __PYX_ERR(0, 76, __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_1, 2, __pyx_mstate_global->__pyx_kp_u__3) != (0)) __PYX_ERR(0, 76, __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_1, 3, __pyx_mstate_global->__pyx_kp_u__4) != (0)) __PYX_ERR(0, 76, __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_1, 4, __pyx_mstate_global->__pyx_kp_u__5) != (0)) __PYX_ERR(0, 76, __pyx_L1_error); __pyx_v_comparators = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":76 + /* "constraint/parser.py":77 * """Converts a restriction to a built-in numeric constraint if possible.""" * comparators = ["<=", "==", ">=", ">", "<"] * comparators_found = re.findall("|".join(comparators), restriction) # <<<<<<<<<<<<<< * # check if there is exactly one comparator, if not, return None * if len(comparators_found) != 1: - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_findall); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) +*/ + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__6, __pyx_v_comparators); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_comparators); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } + 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[3] = {__pyx_t_4, __pyx_t_2, __pyx_v_restriction}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __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, 76, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_3, __pyx_v_restriction}; + __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_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; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } __pyx_v_comparators_found = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":78 + /* "constraint/parser.py":79 * comparators_found = re.findall("|".join(comparators), restriction) * # check if there is exactly one comparator, if not, return None * if len(comparators_found) != 1: # <<<<<<<<<<<<<< * return None * comparator = comparators_found[0] - */ - __pyx_t_6 = PyObject_Length(__pyx_v_comparators_found); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 78, __pyx_L1_error) +*/ + __pyx_t_6 = PyObject_Length(__pyx_v_comparators_found); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 79, __pyx_L1_error) __pyx_t_7 = (__pyx_t_6 != 1); if (__pyx_t_7) { - /* "constraint/parser.py":79 + /* "constraint/parser.py":80 * # check if there is exactly one comparator, if not, return None * if len(comparators_found) != 1: * return None # <<<<<<<<<<<<<< * comparator = comparators_found[0] * - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":78 + /* "constraint/parser.py":79 * comparators_found = re.findall("|".join(comparators), restriction) * # check if there is exactly one comparator, if not, return None * if len(comparators_found) != 1: # <<<<<<<<<<<<<< * return None * comparator = comparators_found[0] - */ +*/ } - /* "constraint/parser.py":80 + /* "constraint/parser.py":81 * if len(comparators_found) != 1: * return None * comparator = comparators_found[0] # <<<<<<<<<<<<<< * * # split the string on the comparison and remove leading and trailing whitespace - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_comparators_found, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_comparators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_comparator = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":83 + /* "constraint/parser.py":84 * * # split the string on the comparison and remove leading and trailing whitespace * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< * * # find out which side is the constant number - */ - __pyx_t_1 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_2genexpr(NULL, __pyx_v_restriction, __pyx_v_comparator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) +*/ + __pyx_t_1 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_2genexpr(NULL, __pyx_v_restriction, __pyx_v_comparator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (1) { - PyObject* sequence = __pyx_t_3; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + PyObject* sequence = __pyx_t_4; + Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 83, __pyx_L1_error) + __PYX_ERR(0, 84, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); #endif - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_left = __pyx_t_1; __pyx_t_1 = 0; - __pyx_v_right = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_right = __pyx_t_3; + __pyx_t_3 = 0; - /* "constraint/parser.py":86 + /* "constraint/parser.py":87 * * # 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_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_s, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 87, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_Union_int_float) < 0) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_3 = __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_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_s, __pyx_n_s_str) < 0) __PYX_ERR(0, 86, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Optional_Union_int_float) < 0) __PYX_ERR(0, 86, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_1is_or_evals_to_number, 0, __pyx_n_s_parse_restrictions_locals_to_num_2, NULL, __pyx_n_s_constraint_parser, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __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; - __pyx_v_is_or_evals_to_number = __pyx_t_2; - __pyx_t_2 = 0; + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_is_or_evals_to_number = __pyx_t_3; + __pyx_t_3 = 0; - /* "constraint/parser.py":97 + /* "constraint/parser.py":98 * * # either the left or right side of the equation must evaluate to a constant number * 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("unicode", __pyx_v_left))) __PYX_ERR(0, 97, __pyx_L1_error) - __pyx_t_2 = __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_2)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_left_num = __pyx_t_2; - __pyx_t_2 = 0; +*/ + if (!(likely(PyUnicode_CheckExact(__pyx_v_left))||((__pyx_v_left) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_left))) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_3 = __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_3)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_left_num = __pyx_t_3; + __pyx_t_3 = 0; - /* "constraint/parser.py":98 + /* "constraint/parser.py":99 * # either the left or right side of the equation must evaluate to a constant number * 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): - * # left_num and right_num can't be both None or both a constant - */ - if (!(likely(PyUnicode_CheckExact(__pyx_v_right))||((__pyx_v_right) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_right))) __PYX_ERR(0, 98, __pyx_L1_error) - __pyx_t_2 = __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_2)) __PYX_ERR(0, 98, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_right_num = __pyx_t_2; - __pyx_t_2 = 0; + * # if both sides are parameters, use the VariableConstraints +*/ + if (!(likely(PyUnicode_CheckExact(__pyx_v_right))||((__pyx_v_right) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_right))) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_3 = __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_3)) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_right_num = __pyx_t_3; + __pyx_t_3 = 0; - /* "constraint/parser.py":99 + /* "constraint/parser.py":100 * 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): # <<<<<<<<<<<<<< - * # left_num and right_num can't be both None or both a constant - * return None - */ + * # if both sides are parameters, use the VariableConstraints + * variable_supported_operators = ['+'] +*/ __pyx_t_8 = (__pyx_v_left_num == Py_None); if (!__pyx_t_8) { goto __pyx_L6_next_or; @@ -6276,1399 +5902,1612 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_L5_bool_binop_done:; if (__pyx_t_7) { - /* "constraint/parser.py":101 + /* "constraint/parser.py":102 * if (left_num is None and right_num is None) or (left_num is not None and right_num is not None): - * # left_num and right_num can't be both None or both a constant - * return None # <<<<<<<<<<<<<< - * number, variables, variables_on_left = ( - * (left_num, right.strip(), False) if left_num is not None else (right_num, left.strip(), True) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - - /* "constraint/parser.py":99 - * 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): # <<<<<<<<<<<<<< - * # left_num and right_num can't be both None or both a constant - * return None - */ - } + * # if both sides are parameters, use the VariableConstraints + * variable_supported_operators = ['+'] # <<<<<<<<<<<<<< + * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] + * if all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): +*/ + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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_3, 0, __pyx_mstate_global->__pyx_kp_u__8) != (0)) __PYX_ERR(0, 102, __pyx_L1_error); + __pyx_v_variable_supported_operators = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/parser.py":103 - * return None - * number, variables, variables_on_left = ( - * (left_num, right.strip(), False) if left_num is not None else (right_num, left.strip(), True) # <<<<<<<<<<<<<< - * ) - * - */ - __pyx_t_7 = (__pyx_v_left_num != Py_None); - if (__pyx_t_7) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_right, __pyx_n_s_strip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) + /* "constraint/parser.py":103 + * # if both sides are parameters, use the VariableConstraints + * variable_supported_operators = ['+'] + * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] # <<<<<<<<<<<<<< + * if all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): + * variables_on_left = len(right) == 1 +*/ + { /* enter inner scope */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Add(__pyx_v_left, __pyx_v_right); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PySequence_ListKeepNew(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); + __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_left_num); - __Pyx_GIVEREF(__pyx_v_left_num); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_left_num)) __PYX_ERR(0, 103, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error); - __Pyx_INCREF(Py_False); - __Pyx_GIVEREF(Py_False); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_False)) __PYX_ERR(0, 103, __pyx_L1_error); + for (;;) { + { + 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, 103, __pyx_L11_error) + #endif + if (__pyx_t_6 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_6); + ++__pyx_t_6; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_s, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_8genexpr2__pyx_v_s, __pyx_v_variable_supported_operators, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 103, __pyx_L11_error) + if (__pyx_t_7) { + __pyx_t_2 = __pyx_8genexpr2__pyx_v_s; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_5 = 0; + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, 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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_1); + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 103, __pyx_L11_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_s); __pyx_8genexpr2__pyx_v_s = 0; + goto __pyx_L16_exit_scope; + __pyx_L11_error:; + __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_s); __pyx_8genexpr2__pyx_v_s = 0; + goto __pyx_L1_error; + __pyx_L16_exit_scope:; + } /* exit inner scope */ + __pyx_v_variables = __pyx_t_3; __pyx_t_3 = 0; - __pyx_t_2 = __pyx_t_1; - __pyx_t_1 = 0; - } else { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_left, __pyx_n_s_strip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) + + /* "constraint/parser.py":104 + * variable_supported_operators = ['+'] + * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] + * if all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # <<<<<<<<<<<<<< + * variables_on_left = len(right) == 1 + * if comparator == "==": +*/ + __pyx_t_3 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_5genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; + __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L18_bool_binop_done; + } + __pyx_t_6 = PyObject_Length(__pyx_v_left); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_8 = (__pyx_t_6 == 1); + if (!__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L18_bool_binop_done; + } + __pyx_t_6 = PyObject_Length(__pyx_v_right); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_8 = (__pyx_t_6 == 1); + __pyx_t_7 = __pyx_t_8; + __pyx_L18_bool_binop_done:; + if (__pyx_t_7) { + + /* "constraint/parser.py":105 + * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] + * if all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): + * variables_on_left = len(right) == 1 # <<<<<<<<<<<<<< + * if comparator == "==": + * # if both sides are parameters, use the VariableExactSumConstraint +*/ + __pyx_t_6 = PyObject_Length(__pyx_v_right); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong((__pyx_t_6 == 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_variables_on_left = __pyx_t_4; + __pyx_t_4 = 0; + + /* "constraint/parser.py":106 + * if all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): + * variables_on_left = len(right) == 1 + * if comparator == "==": # <<<<<<<<<<<<<< + * # if both sides are parameters, use the VariableExactSumConstraint + * if variables_on_left: +*/ + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 106, __pyx_L1_error) + if (__pyx_t_7) { + + /* "constraint/parser.py":108 + * if comparator == "==": + * # if both sides are parameters, use the VariableExactSumConstraint + * if variables_on_left: # <<<<<<<<<<<<<< + * return VariableExactSumConstraint(variables[-1], variables[:-1]) + * else: +*/ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 108, __pyx_L1_error) + if (__pyx_t_7) { + + /* "constraint/parser.py":109 + * # if both sides are parameters, use the VariableExactSumConstraint + * if variables_on_left: + * return VariableExactSumConstraint(variables[-1], variables[:-1]) # <<<<<<<<<<<<<< + * else: + * return VariableExactSumConstraint(variables[0], variables[1:]) +*/ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + assert(__pyx_t_3); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_2, __pyx_t_9}; + __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_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "constraint/parser.py":108 + * if comparator == "==": + * # if both sides are parameters, use the VariableExactSumConstraint + * if variables_on_left: # <<<<<<<<<<<<<< + * return VariableExactSumConstraint(variables[-1], variables[:-1]) + * else: +*/ + } + + /* "constraint/parser.py":111 + * return VariableExactSumConstraint(variables[-1], variables[:-1]) + * else: + * return VariableExactSumConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< + * + * # left_num and right_num can't be both None or both a constant +*/ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9); + assert(__pyx_t_1); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_2, __pyx_t_3}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __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_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "constraint/parser.py":106 + * if all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): + * variables_on_left = len(right) == 1 + * if comparator == "==": # <<<<<<<<<<<<<< + * # if both sides are parameters, use the VariableExactSumConstraint + * if variables_on_left: +*/ } + + /* "constraint/parser.py":104 + * variable_supported_operators = ['+'] + * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] + * if all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # <<<<<<<<<<<<<< + * variables_on_left = len(right) == 1 + * if comparator == "==": +*/ } - #endif + + /* "constraint/parser.py":114 + * + * # left_num and right_num can't be both None or both a constant + * return None # <<<<<<<<<<<<<< + * + * # if one side is a number, the other side must be a variable or expression +*/ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "constraint/parser.py":100 + * 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, use the VariableConstraints + * variable_supported_operators = ['+'] +*/ + } + + /* "constraint/parser.py":118 + * # 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_t_7 = (__pyx_v_left_num != Py_None); + if (__pyx_t_7) { + __pyx_t_3 = __pyx_v_right; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + __pyx_t_9 = __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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); } - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_left_num); + __Pyx_GIVEREF(__pyx_v_left_num); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_left_num) != (0)) __PYX_ERR(0, 118, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_9); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 118, __pyx_L1_error); + __Pyx_INCREF(Py_False); + __Pyx_GIVEREF(Py_False); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, Py_False) != (0)) __PYX_ERR(0, 118, __pyx_L1_error); + __pyx_t_9 = 0; + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_9 = __pyx_v_left; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_5 = 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_5, (1-__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, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_right_num); __Pyx_GIVEREF(__pyx_v_right_num); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_right_num)) __PYX_ERR(0, 103, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_right_num) != (0)) __PYX_ERR(0, 118, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 118, __pyx_L1_error); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, Py_True)) __PYX_ERR(0, 103, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_2 = __pyx_t_3; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, Py_True) != (0)) __PYX_ERR(0, 118, __pyx_L1_error); __pyx_t_3 = 0; + __pyx_t_4 = __pyx_t_9; + __pyx_t_9 = 0; } - if (likely(__pyx_t_2 != Py_None)) { - PyObject* sequence = __pyx_t_2; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (likely(__pyx_t_4 != Py_None)) { + PyObject* sequence = __pyx_t_4; + 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, 102, __pyx_L1_error) + __PYX_ERR(0, 117, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_9); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_2); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 117, __pyx_L1_error) } - /* "constraint/parser.py":102 - * # left_num and right_num can't be both None or both a constant - * return None + /* "constraint/parser.py":117 + * + * # 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_3; +*/ + __pyx_v_number = __pyx_t_9; + __pyx_t_9 = 0; + __pyx_v_variables = __pyx_t_3; __pyx_t_3 = 0; - __pyx_v_variables = __pyx_t_1; - __pyx_t_1 = 0; - __pyx_v_variables_on_left = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_variables_on_left = __pyx_t_2; + __pyx_t_2 = 0; - /* "constraint/parser.py":107 + /* "constraint/parser.py":122 * * # if the number is an integer, we can map '>' to '>=' and '<' to '<=' by changing the number (does not work with floating points!) # noqa: E501 * number_is_int = isinstance(number, int) # <<<<<<<<<<<<<< * if number_is_int: * if comparator == "<": - */ - __pyx_t_7 = PyInt_Check(__pyx_v_number); +*/ + __pyx_t_7 = PyLong_Check(__pyx_v_number); __pyx_v_number_is_int = __pyx_t_7; - /* "constraint/parser.py":108 + /* "constraint/parser.py":123 * # if the number is an integer, we can map '>' to '>=' and '<' to '<=' by changing the number (does not work with floating points!) # noqa: E501 * number_is_int = isinstance(number, int) * if number_is_int: # <<<<<<<<<<<<<< * if comparator == "<": * if variables_on_left: - */ +*/ if (__pyx_v_number_is_int) { - /* "constraint/parser.py":109 + /* "constraint/parser.py":124 * number_is_int = isinstance(number, int) * if number_is_int: * if comparator == "<": # <<<<<<<<<<<<<< * if variables_on_left: * # (x < 2) == (x <= 2-1) - */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 109, __pyx_L1_error) +*/ + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 124, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/parser.py":110 + /* "constraint/parser.py":125 * if number_is_int: * if comparator == "<": * if variables_on_left: # <<<<<<<<<<<<<< * # (x < 2) == (x <= 2-1) * number -= 1 - */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 110, __pyx_L1_error) +*/ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 125, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/parser.py":112 + /* "constraint/parser.py":127 * if variables_on_left: * # (x < 2) == (x <= 2-1) * number -= 1 # <<<<<<<<<<<<<< * else: * # (2 < x) == (2+1 <= x) - */ - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_number, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_2); - __pyx_t_2 = 0; +*/ + __pyx_t_4 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/parser.py":110 + /* "constraint/parser.py":125 * if number_is_int: * if comparator == "<": * if variables_on_left: # <<<<<<<<<<<<<< * # (x < 2) == (x <= 2-1) * number -= 1 - */ - goto __pyx_L11; +*/ + goto __pyx_L25; } - /* "constraint/parser.py":115 + /* "constraint/parser.py":130 * else: * # (2 < x) == (2+1 <= x) * number += 1 # <<<<<<<<<<<<<< * elif comparator == ">": * if variables_on_left: - */ +*/ /*else*/ { - __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_number, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_4); + __pyx_t_4 = 0; } - __pyx_L11:; + __pyx_L25:; - /* "constraint/parser.py":109 + /* "constraint/parser.py":124 * number_is_int = isinstance(number, int) * if number_is_int: * if comparator == "<": # <<<<<<<<<<<<<< * if variables_on_left: * # (x < 2) == (x <= 2-1) - */ - goto __pyx_L10; +*/ + goto __pyx_L24; } - /* "constraint/parser.py":116 + /* "constraint/parser.py":131 * # (2 < x) == (2+1 <= x) * number += 1 * elif comparator == ">": # <<<<<<<<<<<<<< * if variables_on_left: * # (x > 2) == (x >= 2+1) - */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 116, __pyx_L1_error) +*/ + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 131, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/parser.py":117 + /* "constraint/parser.py":132 * number += 1 * elif comparator == ">": * if variables_on_left: # <<<<<<<<<<<<<< * # (x > 2) == (x >= 2+1) * number += 1 - */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 117, __pyx_L1_error) +*/ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 132, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/parser.py":119 + /* "constraint/parser.py":134 * if variables_on_left: * # (x > 2) == (x >= 2+1) * number += 1 # <<<<<<<<<<<<<< * else: * # (2 > x) == (2-1 >= x) - */ - __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_number, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_2); - __pyx_t_2 = 0; +*/ + __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/parser.py":117 + /* "constraint/parser.py":132 * number += 1 * elif comparator == ">": * if variables_on_left: # <<<<<<<<<<<<<< * # (x > 2) == (x >= 2+1) * number += 1 - */ - goto __pyx_L12; +*/ + goto __pyx_L26; } - /* "constraint/parser.py":122 + /* "constraint/parser.py":137 * else: * # (2 > x) == (2-1 >= x) * number -= 1 # <<<<<<<<<<<<<< * * # check if an operator is applied on the variables, if not return - */ +*/ /*else*/ { - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_number, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_4); + __pyx_t_4 = 0; } - __pyx_L12:; + __pyx_L26:; - /* "constraint/parser.py":116 + /* "constraint/parser.py":131 * # (2 < x) == (2+1 <= x) * number += 1 * elif comparator == ">": # <<<<<<<<<<<<<< * if variables_on_left: * # (x > 2) == (x >= 2+1) - */ +*/ } - __pyx_L10:; + __pyx_L24:; - /* "constraint/parser.py":108 + /* "constraint/parser.py":123 * # if the number is an integer, we can map '>' to '>=' and '<' to '<=' by changing the number (does not work with floating points!) # noqa: E501 * number_is_int = isinstance(number, int) * if number_is_int: # <<<<<<<<<<<<<< * if comparator == "<": * if variables_on_left: - */ +*/ } - /* "constraint/parser.py":125 + /* "constraint/parser.py":140 * * # 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_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_kp_u__10); - __Pyx_GIVEREF(__pyx_kp_u__10); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u__10)) __PYX_ERR(0, 125, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u__11); - __Pyx_GIVEREF(__pyx_kp_u__11); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u__11)) __PYX_ERR(0, 125, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u__12); - __Pyx_GIVEREF(__pyx_kp_u__12); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__12)) __PYX_ERR(0, 125, __pyx_L1_error); - __pyx_v_operators = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; +*/ + __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __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_4, 0, __pyx_mstate_global->__pyx_kp_u__9) != (0)) __PYX_ERR(0, 140, __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_4, 1, __pyx_mstate_global->__pyx_kp_u__10) != (0)) __PYX_ERR(0, 140, __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_4, 2, __pyx_mstate_global->__pyx_kp_u__11) != (0)) __PYX_ERR(0, 140, __pyx_L1_error); + __pyx_v_operators = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/parser.py":126 + /* "constraint/parser.py":141 * # 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_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_re); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_findall); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__6, __pyx_v_operators); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; - __pyx_t_5 = 0; +*/ + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_operators); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_5 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); + __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_4, __pyx_v_variables}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_3, __pyx_v_variables}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __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_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); } - __pyx_v_operators_found = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_operators_found = __pyx_t_4; + __pyx_t_4 = 0; - /* "constraint/parser.py":127 + /* "constraint/parser.py":142 * 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_6 = PyObject_Length(__pyx_v_operators_found); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 127, __pyx_L1_error) +*/ + __pyx_t_6 = PyObject_Length(__pyx_v_operators_found); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 142, __pyx_L1_error) __pyx_t_7 = (__pyx_t_6 == 0); if (__pyx_t_7) { - /* "constraint/parser.py":129 + /* "constraint/parser.py":144 * 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_2 = __pyx_cur_scope->__pyx_v_params; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 129, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +*/ + __pyx_t_4 = __pyx_cur_scope->__pyx_v_params; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_t_4); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = (__pyx_t_6 != 1); if (!__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; - goto __pyx_L15_bool_binop_done; + goto __pyx_L29_bool_binop_done; } - __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_variables, __pyx_cur_scope->__pyx_v_params, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_variables, __pyx_cur_scope->__pyx_v_params, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 144, __pyx_L1_error) __pyx_t_7 = __pyx_t_8; - __pyx_L15_bool_binop_done:; + __pyx_L29_bool_binop_done:; if (__pyx_t_7) { - /* "constraint/parser.py":131 + /* "constraint/parser.py":146 * if len(params) != 1 or variables not in params: * # there were more than one variable but no operator * return None # <<<<<<<<<<<<<< * # map to a Constraint * # if there are restrictions with a single variable, it will be used to prune the domain at the start - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":129 + /* "constraint/parser.py":144 * 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 - */ +*/ } - /* "constraint/parser.py":134 + /* "constraint/parser.py":149 * # 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 == "<" and number_is_int): - */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 134, __pyx_L1_error) +*/ + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 149, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/parser.py":135 + /* "constraint/parser.py":150 * # 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 == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - */ +*/ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ExactSumConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; + __pyx_t_9 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_5 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); + assert(__pyx_t_9); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); + __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_number}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_number}; + __pyx_t_4 = __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_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "constraint/parser.py":134 + /* "constraint/parser.py":149 * # 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 == "<" and number_is_int): - */ +*/ } - /* "constraint/parser.py":136 + /* "constraint/parser.py":151 * elif comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): - */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 136, __pyx_L1_error) +*/ + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 151, __pyx_L1_error) if (!__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; - goto __pyx_L17_bool_binop_done; + goto __pyx_L31_bool_binop_done; } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 151, __pyx_L1_error) if (__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; - goto __pyx_L17_bool_binop_done; + goto __pyx_L31_bool_binop_done; } __pyx_t_7 = __pyx_v_number_is_int; - __pyx_L17_bool_binop_done:; + __pyx_L31_bool_binop_done:; if (__pyx_t_7) { - /* "constraint/parser.py":137 + /* "constraint/parser.py":152 * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 152, __pyx_L1_error) if (__pyx_t_7) { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MaxSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; - __pyx_t_5 = 0; + __pyx_t_9 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_9); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_number}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_number}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __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_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_2 = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; } else { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MinSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; - __pyx_t_5 = 0; + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 152, __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_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); + __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_number}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_number}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __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; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_2 = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "constraint/parser.py":136 + /* "constraint/parser.py":151 * elif comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): - */ +*/ } - /* "constraint/parser.py":138 + /* "constraint/parser.py":153 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * raise ValueError(f"Invalid comparator {comparator}") - */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 138, __pyx_L1_error) +*/ + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 153, __pyx_L1_error) if (!__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; - goto __pyx_L20_bool_binop_done; + goto __pyx_L34_bool_binop_done; } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 153, __pyx_L1_error) if (__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; - goto __pyx_L20_bool_binop_done; + goto __pyx_L34_bool_binop_done; } __pyx_t_7 = __pyx_v_number_is_int; - __pyx_L20_bool_binop_done:; + __pyx_L34_bool_binop_done:; if (__pyx_t_7) { - /* "constraint/parser.py":139 + /* "constraint/parser.py":154 * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) # <<<<<<<<<<<<<< * raise ValueError(f"Invalid comparator {comparator}") * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 154, __pyx_L1_error) if (__pyx_t_7) { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MinSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; - __pyx_t_5 = 0; + __pyx_t_9 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_9); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_number}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_number}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __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_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_2 = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; } else { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MaxSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; - __pyx_t_5 = 0; + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 154, __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_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); + __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_number}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_number}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __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; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_2 = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = 0; } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "constraint/parser.py":138 + /* "constraint/parser.py":153 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * raise ValueError(f"Invalid comparator {comparator}") - */ +*/ } - /* "constraint/parser.py":140 + /* "constraint/parser.py":155 * elif comparator == ">=" or (comparator == ">" and number_is_int): * 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_2 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) +*/ + __pyx_t_3 = NULL; + __Pyx_INCREF(__pyx_builtin_ValueError); + __pyx_t_9 = __pyx_builtin_ValueError; + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_comparator, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_comparator, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_1}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __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_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 155, __pyx_L1_error) - /* "constraint/parser.py":127 + /* "constraint/parser.py":142 * 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: - */ +*/ } - /* "constraint/parser.py":143 + /* "constraint/parser.py":158 * * # check which operator is applied on the variables * operator = operators_found[0] # <<<<<<<<<<<<<< * if not all(o == operator for o in operators_found): * # if the operator is inconsistent (e.g. 'x + y * z == 3'), return None - */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_operators_found, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_cur_scope->__pyx_v_operator = __pyx_t_2; - __pyx_t_2 = 0; +*/ + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_operators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_cur_scope->__pyx_v_operator = __pyx_t_4; + __pyx_t_4 = 0; - /* "constraint/parser.py":144 + /* "constraint/parser.py":159 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< * # if the operator is inconsistent (e.g. 'x + y * z == 3'), return None * return None - */ - __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_5genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_operators_found); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +*/ + __pyx_t_4 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_operators_found); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_8 = (!__pyx_t_7); if (__pyx_t_8) { - /* "constraint/parser.py":146 + /* "constraint/parser.py":161 * if not all(o == operator for o in operators_found): * # if the operator is inconsistent (e.g. 'x + y * z == 3'), return None * return None # <<<<<<<<<<<<<< * * # split the string on the comparison - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":144 + /* "constraint/parser.py":159 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< * # if the operator is inconsistent (e.g. 'x + y * z == 3'), return None * return None - */ +*/ } - /* "constraint/parser.py":149 + /* "constraint/parser.py":164 * * # 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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_variables, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; +*/ + __pyx_t_4 = __pyx_v_variables; + __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } - } - #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_operator}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_split, __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, 149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); } - __pyx_v_splitted = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_splitted = __pyx_t_9; + __pyx_t_9 = 0; - /* "constraint/parser.py":151 + /* "constraint/parser.py":166 * 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_6 = PyObject_Length(__pyx_v_splitted); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 151, __pyx_L1_error) - __pyx_t_1 = __pyx_cur_scope->__pyx_v_params; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = (__pyx_t_6 == __pyx_t_9); +*/ + __pyx_t_6 = PyObject_Length(__pyx_v_splitted); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_9 = __pyx_cur_scope->__pyx_v_params; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyList_GET_SIZE(__pyx_t_9); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_7 = (__pyx_t_6 == __pyx_t_10); if (__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; - goto __pyx_L25_bool_binop_done; + goto __pyx_L39_bool_binop_done; } - __pyx_t_1 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_splitted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_splitted); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = __pyx_t_7; - __pyx_L25_bool_binop_done:; + __pyx_L39_bool_binop_done:; if (__pyx_t_8) { - /* "constraint/parser.py":153 + /* "constraint/parser.py":168 * 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_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 153, __pyx_L1_error) +*/ + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 168, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/parser.py":155 + /* "constraint/parser.py":170 * if operator == "**": * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None # <<<<<<<<<<<<<< * elif operator == "*": * if comparator == "<=" or (comparator == "<" and number_is_int): - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":153 + /* "constraint/parser.py":168 * 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 - */ +*/ } - /* "constraint/parser.py":156 + /* "constraint/parser.py":171 * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None * elif operator == "*": # <<<<<<<<<<<<<< * if comparator == "<=" or (comparator == "<" and number_is_int): * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) - */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 156, __pyx_L1_error) +*/ + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 171, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/parser.py":157 + /* "constraint/parser.py":172 * return None * elif operator == "*": * if comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): - */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 157, __pyx_L1_error) +*/ + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 172, __pyx_L1_error) if (!__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; - goto __pyx_L29_bool_binop_done; + goto __pyx_L43_bool_binop_done; } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 172, __pyx_L1_error) if (__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; - goto __pyx_L29_bool_binop_done; + goto __pyx_L43_bool_binop_done; } __pyx_t_8 = __pyx_v_number_is_int; - __pyx_L29_bool_binop_done:; + __pyx_L43_bool_binop_done:; if (__pyx_t_8) { - /* "constraint/parser.py":158 + /* "constraint/parser.py":173 * elif operator == "*": * if comparator == "<=" or (comparator == "<" and number_is_int): * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) # <<<<<<<<<<<<<< * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 173, __pyx_L1_error) if (__pyx_t_8) { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MaxProdConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; - __pyx_t_5 = 0; + __pyx_t_1 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + assert(__pyx_t_1); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); + __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_number}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_number}; + __pyx_t_9 = __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_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); } - __pyx_t_2 = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_9; + __pyx_t_9 = 0; } else { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MinProdConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; - __pyx_t_5 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + assert(__pyx_t_3); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); + __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_number}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __pyx_t_9 = __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); } - __pyx_t_2 = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_9; + __pyx_t_9 = 0; } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "constraint/parser.py":157 + /* "constraint/parser.py":172 * return None * elif operator == "*": * if comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): - */ +*/ } - /* "constraint/parser.py":159 + /* "constraint/parser.py":174 * if comparator == "<=" or (comparator == "<" and number_is_int): * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": - */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 159, __pyx_L1_error) +*/ + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 174, __pyx_L1_error) if (!__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; - goto __pyx_L32_bool_binop_done; + goto __pyx_L46_bool_binop_done; } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 174, __pyx_L1_error) if (__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; - goto __pyx_L32_bool_binop_done; + goto __pyx_L46_bool_binop_done; } __pyx_t_8 = __pyx_v_number_is_int; - __pyx_L32_bool_binop_done:; + __pyx_L46_bool_binop_done:; if (__pyx_t_8) { - /* "constraint/parser.py":160 + /* "constraint/parser.py":175 * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) # <<<<<<<<<<<<<< * elif operator == "+": * if comparator == "==": - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 175, __pyx_L1_error) if (__pyx_t_8) { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MinProdConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; - __pyx_t_5 = 0; + __pyx_t_1 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + assert(__pyx_t_1); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); + __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_number}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_number}; + __pyx_t_9 = __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_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); } - __pyx_t_2 = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_9; + __pyx_t_9 = 0; } else { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MaxProdConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; - __pyx_t_5 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + assert(__pyx_t_3); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); + __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_number}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __pyx_t_9 = __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); } - __pyx_t_2 = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_9; + __pyx_t_9 = 0; } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "constraint/parser.py":159 + /* "constraint/parser.py":174 * if comparator == "<=" or (comparator == "<" and number_is_int): * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": - */ +*/ } - /* "constraint/parser.py":156 + /* "constraint/parser.py":171 * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None * elif operator == "*": # <<<<<<<<<<<<<< * if comparator == "<=" or (comparator == "<" and number_is_int): * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) - */ - goto __pyx_L27; +*/ + goto __pyx_L41; } - /* "constraint/parser.py":161 + /* "constraint/parser.py":176 * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": # <<<<<<<<<<<<<< * if comparator == "==": * return ExactSumConstraint(number) - */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 161, __pyx_L1_error) +*/ + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_kp_u__8, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 176, __pyx_L1_error) if (likely(__pyx_t_8)) { - /* "constraint/parser.py":162 + /* "constraint/parser.py":177 * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": * if comparator == "==": # <<<<<<<<<<<<<< * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): - */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 162, __pyx_L1_error) +*/ + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 177, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/parser.py":163 + /* "constraint/parser.py":178 * elif operator == "+": * if comparator == "==": * return ExactSumConstraint(number) # <<<<<<<<<<<<<< * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - */ +*/ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ExactSumConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_9 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; + __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_5 = 1; - } + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); + assert(__pyx_t_9); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); + __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_number}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_number}; + __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_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "constraint/parser.py":162 + /* "constraint/parser.py":177 * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": * if comparator == "==": # <<<<<<<<<<<<<< * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): - */ +*/ } - /* "constraint/parser.py":164 + /* "constraint/parser.py":179 * if comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): - */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 164, __pyx_L1_error) +*/ + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 179, __pyx_L1_error) if (!__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; - goto __pyx_L36_bool_binop_done; + goto __pyx_L50_bool_binop_done; } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 179, __pyx_L1_error) if (__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; - goto __pyx_L36_bool_binop_done; + goto __pyx_L50_bool_binop_done; } __pyx_t_8 = __pyx_v_number_is_int; - __pyx_L36_bool_binop_done:; + __pyx_L50_bool_binop_done:; if (__pyx_t_8) { - /* "constraint/parser.py":165 + /* "constraint/parser.py":180 * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 180, __pyx_L1_error) if (__pyx_t_8) { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MaxSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; - __pyx_t_5 = 0; + __pyx_t_9 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); + assert(__pyx_t_9); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); + __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_number}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_number}; + __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)); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_2 = __pyx_t_1; + __pyx_t_4 = __pyx_t_1; __pyx_t_1 = 0; } else { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MinSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; - __pyx_t_5 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 180, __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_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9); + assert(__pyx_t_3); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); + __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_number}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __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; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_2 = __pyx_t_1; + __pyx_t_4 = __pyx_t_1; __pyx_t_1 = 0; } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "constraint/parser.py":164 + /* "constraint/parser.py":179 * if comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): - */ +*/ } - /* "constraint/parser.py":166 + /* "constraint/parser.py":181 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * else: - */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 166, __pyx_L1_error) +*/ + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) if (!__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; - goto __pyx_L39_bool_binop_done; + goto __pyx_L53_bool_binop_done; } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) if (__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; - goto __pyx_L39_bool_binop_done; + goto __pyx_L53_bool_binop_done; } __pyx_t_8 = __pyx_v_number_is_int; - __pyx_L39_bool_binop_done:; + __pyx_L53_bool_binop_done:; if (__pyx_t_8) { - /* "constraint/parser.py":167 + /* "constraint/parser.py":182 * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) # <<<<<<<<<<<<<< * else: * raise ValueError(f"Invalid operator {operator}") - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 182, __pyx_L1_error) if (__pyx_t_8) { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MinSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; - __pyx_t_5 = 0; + __pyx_t_9 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); + assert(__pyx_t_9); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); + __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_number}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_number}; + __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)); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_2 = __pyx_t_1; + __pyx_t_4 = __pyx_t_1; __pyx_t_1 = 0; } else { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MaxSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; - __pyx_t_5 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 182, __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_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9); + assert(__pyx_t_3); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); + __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_number}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __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; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_2 = __pyx_t_1; + __pyx_t_4 = __pyx_t_1; __pyx_t_1 = 0; } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "constraint/parser.py":166 + /* "constraint/parser.py":181 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * else: - */ +*/ } - /* "constraint/parser.py":161 + /* "constraint/parser.py":176 * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": # <<<<<<<<<<<<<< * if comparator == "==": * return ExactSumConstraint(number) - */ - goto __pyx_L27; +*/ + goto __pyx_L41; } - /* "constraint/parser.py":169 + /* "constraint/parser.py":184 * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * else: * raise ValueError(f"Invalid operator {operator}") # <<<<<<<<<<<<<< * return None * - */ +*/ /*else*/ { - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_operator, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_operator, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_1 = NULL; + __Pyx_INCREF(__pyx_builtin_ValueError); + __pyx_t_9 = __pyx_builtin_ValueError; + __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_operator, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_2}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __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; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 184, __pyx_L1_error) } - __pyx_L27:; + __pyx_L41:; - /* "constraint/parser.py":151 + /* "constraint/parser.py":166 * 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 == "**": - */ +*/ } - /* "constraint/parser.py":170 + /* "constraint/parser.py":185 * else: * raise ValueError(f"Invalid operator {operator}") * return None # <<<<<<<<<<<<<< * * def to_equality_constraint( - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":71 + /* "constraint/parser.py":72 * return split_restrictions * * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -7676,6 +7515,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("constraint.parser.parse_restrictions.to_numeric_constraint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -7687,28 +7527,31 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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_number); + __Pyx_XDECREF(__pyx_v_variable_supported_operators); __Pyx_XDECREF(__pyx_v_variables); __Pyx_XDECREF(__pyx_v_variables_on_left); + __Pyx_XDECREF(__pyx_v_number); __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_8genexpr2__pyx_v_s); __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7generator1); __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator2); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_13generator3); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/parser.py":172 +/* "constraint/parser.py":187 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_9to_equality_constraint(PyObject *__pyx_self, @@ -7719,7 +7562,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_6parser_18parse_restrictions_8to_equality_constraint, "Converts a restriction to either an equality or inequality constraint on all the parameters if possible."); -static PyMethodDef __pyx_mdef_10constraint_6parser_18parse_restrictions_9to_equality_constraint = {"to_equality_constraint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_18parse_restrictions_9to_equality_constraint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6parser_18parse_restrictions_8to_equality_constraint}; +static PyMethodDef __pyx_mdef_10constraint_6parser_18parse_restrictions_9to_equality_constraint = {"to_equality_constraint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_18parse_restrictions_9to_equality_constraint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6parser_18parse_restrictions_8to_equality_constraint}; static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_9to_equality_constraint(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -7741,7 +7584,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("to_equality_constraint (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -7749,118 +7592,105 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_restriction,&__pyx_n_s_params,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 187, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 187, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 187, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_restriction)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("to_equality_constraint", 1, 2, 2, 1); __PYX_ERR(0, 172, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_equality_constraint") < 0)) __PYX_ERR(0, 172, __pyx_L3_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, 187, __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, 187, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 187, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 187, __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, 172, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("to_equality_constraint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 187, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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_equality_constraint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restriction), (&PyUnicode_Type), 0, "restriction", 1))) __PYX_ERR(0, 173, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 1))) __PYX_ERR(0, 173, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restriction), (&PyUnicode_Type), 0, "restriction", 2))) __PYX_ERR(0, 188, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 188, __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 */ 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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_6parser_18parse_restrictions_22to_equality_constraint_2generator3(__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_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":191 +/* "constraint/parser.py":206 * 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 == "==": - */ +*/ 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_6_genexpr *__pyx_cur_scope; + struct __pyx_obj_10constraint_6parser___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_6parser___pyx_scope_struct_6_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr(__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 191, __pyx_L1_error) + __PYX_ERR(0, 206, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint *) __pyx_self; + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_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_2generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_parse_restrictions_locals_to_equ, __pyx_n_s_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator4, ((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_equ, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -7876,19 +7706,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_22to_equalit return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator3(__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_2generator4(__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); + 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; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; - PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - unsigned int __pyx_t_7; - int __pyx_t_8; - int __pyx_t_9; + size_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -7901,93 +7729,41 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 191, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 191, __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, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error) - } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 206, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 206, __pyx_L1_error) } + __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 191, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 191, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 191, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 191, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 191, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_4); + { + 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, 206, __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, 206, __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_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_s, __pyx_n_s_strip); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_7 = 1; - } - } - #endif + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_4 = __pyx_cur_scope->__pyx_v_s; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __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, 191, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_params, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = (!__pyx_t_8); - if (__pyx_t_9) { + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 206, __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, 206, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = (!__pyx_t_6); + if (__pyx_t_7) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -8007,12 +7783,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + 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 @@ -8024,21 +7801,21 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit return __pyx_r; } -/* "constraint/parser.py":172 +/* "constraint/parser.py":187 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: - */ +*/ 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_5_to_equality_constraint *__pyx_cur_scope; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_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_2generator3 = 0; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator4 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -8047,18 +7824,19 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - unsigned int __pyx_t_7; - Py_ssize_t __pyx_t_8; + 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_5_to_equality_constraint *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint(__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_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_5_to_equality_constraint *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 172, __pyx_L1_error) + __PYX_ERR(0, 187, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -8069,387 +7847,402 @@ 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":177 + /* "constraint/parser.py":192 * """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): # <<<<<<<<<<<<<< * return None * - */ +*/ __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, 177, __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, 192, __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, 177, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 192, __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, 177, __pyx_L1_error) + __PYX_ERR(0, 192, __pyx_L1_error) } - __pyx_t_3 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 177, __pyx_L1_error) + __pyx_t_3 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 192, __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":178 + /* "constraint/parser.py":193 * # check if all parameters are involved * if len(params) != len(tune_params): * return None # <<<<<<<<<<<<<< * * # find whether (in)equalities appear in this restriction - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":177 + /* "constraint/parser.py":192 * """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): # <<<<<<<<<<<<<< * return None * - */ +*/ } - /* "constraint/parser.py":181 + /* "constraint/parser.py":196 * * # find whether (in)equalities appear in this restriction * equalities_found = re.findall("==", restriction) # <<<<<<<<<<<<<< * inequalities_found = re.findall("!=", restriction) * # check if one of the two have been found, if none or both have been found, return None - */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_findall); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; +*/ __pyx_t_5 = NULL; - __pyx_t_7 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 196, __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, 196, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_7 = 1; - } + 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_8 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_kp_u__7, __pyx_v_restriction}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + 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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_equalities_found = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":182 + /* "constraint/parser.py":197 * # find whether (in)equalities appear in this restriction * equalities_found = re.findall("==", restriction) * 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 (len(equalities_found) > 0 ^ len(inequalities_found) > 0): - */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_findall); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 182, __pyx_L1_error) + * 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, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = NULL; - __pyx_t_7 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_7 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + assert(__pyx_t_7); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); + __pyx_t_8 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_kp_u__16, __pyx_v_restriction}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u__14, __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_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, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_inequalities_found = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":184 + /* "constraint/parser.py":199 * 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 (len(equalities_found) > 0 ^ len(inequalities_found) > 0): # <<<<<<<<<<<<<< + * 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, 184, __pyx_L1_error) - __pyx_t_2 = PyObject_Length(__pyx_v_inequalities_found); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 184, __pyx_L1_error) - __pyx_t_8 = (0 ^ __pyx_t_2); - __pyx_t_4 = (__pyx_t_3 > __pyx_t_8); - if (__pyx_t_4) { - __pyx_t_4 = (__pyx_t_8 > 0); - } +*/ + __pyx_t_3 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 199, __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, 199, __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, 199, __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, 199, __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, 199, __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, 199, __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":185 + /* "constraint/parser.py":200 * # check if one of the two have been found, if none or both have been found, return None - * if not (len(equalities_found) > 0 ^ len(inequalities_found) > 0): + * 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_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":184 + /* "constraint/parser.py":199 * 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 (len(equalities_found) > 0 ^ len(inequalities_found) > 0): # <<<<<<<<<<<<<< + * 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] - */ +*/ } - /* "constraint/parser.py":186 - * if not (len(equalities_found) > 0 ^ len(inequalities_found) > 0): + /* "constraint/parser.py":201 + * 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_8 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 186, __pyx_L1_error) - __pyx_t_9 = (__pyx_t_8 > 0); +*/ + __pyx_t_3 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_9 = (__pyx_t_3 > 0); if (__pyx_t_9) { - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_equalities_found, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_equalities_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __pyx_t_6; + __pyx_t_6 = 0; } else { - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_inequalities_found, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_inequalities_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __pyx_t_6; + __pyx_t_6 = 0; } - __pyx_v_comparator = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_comparator = __pyx_t_7; + __pyx_t_7 = 0; - /* "constraint/parser.py":189 + /* "constraint/parser.py":204 * * # 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_1 = PyUnicode_Split(__pyx_v_restriction, __Pyx_NoneAsNull(__pyx_v_comparator), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_splitted = __pyx_t_1; - __pyx_t_1 = 0; +*/ + __pyx_t_7 = PyUnicode_Split(__pyx_v_restriction, __Pyx_NoneAsNull(__pyx_v_comparator), -1L); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_v_splitted = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/parser.py":191 + /* "constraint/parser.py":206 * 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_8 = PyObject_Length(__pyx_v_splitted); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 191, __pyx_L1_error) - __pyx_t_1 = __pyx_cur_scope->__pyx_v_params; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = (__pyx_t_8 == __pyx_t_3); +*/ + __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_splitted); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 206, __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, 206, __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) { } else { __pyx_t_9 = __pyx_t_4; goto __pyx_L6_bool_binop_done; } - __pyx_t_1 = __pyx_pf_10constraint_6parser_18parse_restrictions_22to_equality_constraint_genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_splitted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __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, 206, __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, 206, __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, 206, __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":193 + /* "constraint/parser.py":208 * 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_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 193, __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, 208, __pyx_L1_error) if (__pyx_t_9) { - /* "constraint/parser.py":194 + /* "constraint/parser.py":209 * # map to a Constraint * if comparator == "==": * return AllEqualConstraint() # <<<<<<<<<<<<<< * elif comparator == "!=": * return AllDifferentConstraint() - */ +*/ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AllEqualConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_t_7 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; + __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_7 = 1; - } + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); + assert(__pyx_t_7); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); + __pyx_t_8 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + 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_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, 209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/parser.py":193 + /* "constraint/parser.py":208 * 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 == "!=": - */ +*/ } - /* "constraint/parser.py":195 + /* "constraint/parser.py":210 * 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_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 195, __pyx_L1_error) +*/ + __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 210, __pyx_L1_error) if (__pyx_t_9) { - /* "constraint/parser.py":196 + /* "constraint/parser.py":211 * return AllEqualConstraint() * elif comparator == "!=": * return AllDifferentConstraint() # <<<<<<<<<<<<<< * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") * return None - */ +*/ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AllDifferentConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; + __pyx_t_1 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_7 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); + assert(__pyx_t_1); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __pyx_t_8 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 196, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + 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_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, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/parser.py":195 + /* "constraint/parser.py":210 * if comparator == "==": * return AllEqualConstraint() * elif comparator == "!=": # <<<<<<<<<<<<<< * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") - */ +*/ } - /* "constraint/parser.py":197 + /* "constraint/parser.py":212 * elif comparator == "!=": * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") # <<<<<<<<<<<<<< * return None * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) + __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, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Not_possible_comparator_should_b, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __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, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 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)); + __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, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + } + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/parser.py":191 + /* "constraint/parser.py":206 * 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 == "==": - */ +*/ } - /* "constraint/parser.py":198 + /* "constraint/parser.py":213 * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") * return None # <<<<<<<<<<<<<< * * # remove functionally duplicate restrictions (preserves order and whitespace) - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":172 + /* "constraint/parser.py":187 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: - */ +*/ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __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:; @@ -8457,35 +8250,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_2generator3); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator4); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":201 +/* "constraint/parser.py":216 * * # 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] - */ +*/ 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_7_genexpr *__pyx_cur_scope; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_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_7_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr(__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_8_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 201, __pyx_L1_error) + __PYX_ERR(0, 216, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -8493,7 +8286,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_12generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_parse_restrictions_locals_genexp, __pyx_n_s_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_12generator5, ((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_genexp, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -8509,9 +8302,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(CY return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator5(__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); + 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; Py_ssize_t __pyx_t_2; @@ -8530,24 +8323,22 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator4 return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 201, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 201, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 216, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 216, __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_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 201, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 216, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 201, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + ++__pyx_t_2; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_r); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_r, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -8574,10 +8365,12 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator4 /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + 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 @@ -8589,13 +8382,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator4 return __pyx_r; } -/* "constraint/parser.py":23 +/* "constraint/parser.py":24 * ) * * 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 - */ +*/ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_restrictions, PyObject *__pyx_v_tune_params) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *__pyx_cur_scope; @@ -8613,10 +8406,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_12generator4 = 0; - PyObject *__pyx_8genexpr6__pyx_v_r = NULL; - PyObject *__pyx_8genexpr7__pyx_v_r = NULL; - PyObject *__pyx_8genexpr8__pyx_v_i = NULL; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator5 = 0; + PyObject *__pyx_8genexpr8__pyx_v_r = NULL; + PyObject *__pyx_8genexpr9__pyx_v_r = NULL; + PyObject *__pyx_9genexpr10__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -8625,21 +8418,22 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - unsigned int __pyx_t_7; + size_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - Py_ssize_t __pyx_t_10; - Py_UCS4 __pyx_t_11; - int __pyx_t_12; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + PyObject *__pyx_t_12[5]; + int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("parse_restrictions", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct__parse_restrictions(__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct__parse_restrictions(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions, __pyx_mstate_global->__pyx_empty_tuple, NULL); 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, 23, __pyx_L1_error) + __PYX_ERR(0, 24, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -8648,715 +8442,659 @@ 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":26 + /* "constraint/parser.py":27 * """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]*)" # <<<<<<<<<<<<<< * * def replace_params(match_object): - */ - __Pyx_INCREF(__pyx_kp_u_a_zA_Z__a_zA_Z__0_9); - __pyx_v_regex_match_variable = __pyx_kp_u_a_zA_Z__a_zA_Z__0_9; +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_a_zA_Z__a_zA_Z__0_9); + __pyx_v_regex_match_variable = __pyx_mstate_global->__pyx_kp_u_a_zA_Z__a_zA_Z__0_9; - /* "constraint/parser.py":28 + /* "constraint/parser.py":29 * regex_match_variable = r"([a-zA-Z_$][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_n_s_parse_restrictions_locals_replac, ((PyObject*)__pyx_cur_scope), __pyx_n_s_constraint_parser, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __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[7])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_replace_params = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":36 + /* "constraint/parser.py":37 * 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_n_s_parse_restrictions_locals_replac_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_constraint_parser, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __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[8])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_replace_params_split = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":46 + /* "constraint/parser.py":47 * 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, 46, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_restrictions, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_return, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_5to_multiple_restrictions, 0, __pyx_n_s_parse_restrictions_locals_to_mul, NULL, __pyx_n_s_constraint_parser, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __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, 47, __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, 47, __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[9])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __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":71 + /* "constraint/parser.py":72 * return split_restrictions * * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: - */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_restriction, __pyx_n_s_str) < 0) __PYX_ERR(0, 71, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_params, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 71, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_kp_s_Optional_Union_MinSumConstraint) < 0) __PYX_ERR(0, 71, __pyx_L1_error) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_7to_numeric_constraint, 0, __pyx_n_s_parse_restrictions_locals_to_num_3, NULL, __pyx_n_s_constraint_parser, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __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, 72, __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, 72, __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, 72, __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, NULL, __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __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":172 + /* "constraint/parser.py":187 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: - */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_restriction, __pyx_n_s_str) < 0) __PYX_ERR(0, 172, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_params, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 172, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_return, __pyx_kp_s_Optional_Union_AllEqualConstrain) < 0) __PYX_ERR(0, 172, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_9to_equality_constraint, 0, __pyx_n_s_parse_restrictions_locals_to_equ_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_constraint_parser, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __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, 187, __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, 187, __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, 187, __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[11])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __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":201 + /* "constraint/parser.py":216 * * # 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] - */ - __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(NULL, __pyx_v_restrictions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __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, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_1 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __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, 201, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "constraint/parser.py":203 + /* "constraint/parser.py":218 * 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 * # 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, 203, __pyx_L6_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_v_restrictions; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 203, __pyx_L6_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 218, __pyx_L6_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 203, __pyx_L6_error) - #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L6_error) + __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_4); + ++__pyx_t_4; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); - #endif - __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_r, __pyx_t_5); + __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_r, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr6__pyx_v_r, __pyx_n_s_replace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L6_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr8__pyx_v_r, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 203, __pyx_L6_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 218, __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, 203, __pyx_L6_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 218, __pyx_L6_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_r); __pyx_8genexpr6__pyx_v_r = 0; + __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_r); __pyx_8genexpr8__pyx_v_r = 0; goto __pyx_L10_exit_scope; __pyx_L6_error:; - __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_r); __pyx_8genexpr6__pyx_v_r = 0; + __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_r); __pyx_8genexpr8__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":204 + /* "constraint/parser.py":219 * # 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 # <<<<<<<<<<<<<< * # 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] - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyDict_Type)), __pyx_n_s_fromkeys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = NULL; +*/ + __pyx_t_2 = ((PyObject *)(&PyDict_Type)); + __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_7 = 1; - } - } - #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_restrictions_cleaned}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) + 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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __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":206 + /* "constraint/parser.py":221 * 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, 206, __pyx_L13_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __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; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 206, __pyx_L13_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 221, __pyx_L13_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 206, __pyx_L13_error) - #else - __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L13_error) + __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + ++__pyx_t_4; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 221, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); - #endif - __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_r, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_r, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_index, __pyx_v_restrictions_cleaned, __pyx_8genexpr7__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L13_error) + __pyx_t_6 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyList_Type__index, __pyx_v_restrictions_cleaned, __pyx_8genexpr9__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 221, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 206, __pyx_L13_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 221, __pyx_L13_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_r); __pyx_8genexpr7__pyx_v_r = 0; + __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_r); __pyx_8genexpr9__pyx_v_r = 0; goto __pyx_L17_exit_scope; __pyx_L13_error:; - __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_r); __pyx_8genexpr7__pyx_v_r = 0; + __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_r); __pyx_8genexpr9__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":207 + /* "constraint/parser.py":222 * # 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] # <<<<<<<<<<<<<< * * # 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, 207, __pyx_L20_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __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; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 207, __pyx_L20_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 222, __pyx_L20_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 207, __pyx_L20_error) - #else - __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L20_error) + __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + ++__pyx_t_4; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 222, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_6); - #endif - __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_i, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_i, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_restrictions, __pyx_8genexpr8__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L20_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_restrictions, __pyx_9genexpr10__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 222, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 207, __pyx_L20_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 222, __pyx_L20_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_i); __pyx_8genexpr8__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_i); __pyx_9genexpr10__pyx_v_i = 0; goto __pyx_L24_exit_scope; __pyx_L20_error:; - __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_i); __pyx_8genexpr8__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_i); __pyx_9genexpr10__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":201 + /* "constraint/parser.py":216 * * # 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] - */ +*/ } - /* "constraint/parser.py":210 + /* "constraint/parser.py":225 * * # 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, 210, __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, 225, __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, 210, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_restrictions, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "constraint/parser.py":212 + /* "constraint/parser.py":227 * 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, 212, __pyx_L1_error) +*/ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_parsed_restrictions = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":213 + /* "constraint/parser.py":228 * # split into functions that only take their relevant parameters * parsed_restrictions = list() * for res in restrictions: # <<<<<<<<<<<<<< * params_used: set[str] = set() * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() - */ +*/ if (unlikely(__pyx_v_restrictions == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 213, __pyx_L1_error) + __PYX_ERR(0, 228, __pyx_L1_error) } __pyx_t_2 = __pyx_v_restrictions; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 213, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 228, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 213, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_4); + ++__pyx_t_4; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - #endif __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":214 + /* "constraint/parser.py":229 * 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, 214, __pyx_L1_error) +*/ + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __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":215 + /* "constraint/parser.py":230 * 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) * finalized_constraint = None - */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sub); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = NULL; - __pyx_t_7 = 0; +*/ + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 230, __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, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_7 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10); + assert(__pyx_t_8); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); + __pyx_t_7 = 0; } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_regex_match_variable, __pyx_v_replace_params_split, __pyx_v_res}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + PyObject *__pyx_callargs[4] = {__pyx_t_8, __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_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, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_strip); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = NULL; + __pyx_t_6 = __pyx_t_5; + __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_7 = 1; - } - } - #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); + __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_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_XDECREF_SET(__pyx_v_parsed_restriction, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":216 + /* "constraint/parser.py":231 * 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, 216, __pyx_L1_error) +*/ + __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_v_params_used); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __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":217 + /* "constraint/parser.py":232 * 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: * # if applicable, strip the outermost round brackets - */ +*/ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_finalized_constraint, Py_None); - /* "constraint/parser.py":218 + /* "constraint/parser.py":233 * 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_9 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u_or, __pyx_v_res, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 218, __pyx_L1_error) - if (__pyx_t_9) { +*/ + __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, 233, __pyx_L1_error) + if (__pyx_t_11) { } else { - __pyx_t_3 = __pyx_t_9; + __pyx_t_3 = __pyx_t_11; goto __pyx_L28_bool_binop_done; } - __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u_and, __pyx_v_res, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 218, __pyx_L1_error) - __pyx_t_3 = __pyx_t_9; + __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, 233, __pyx_L1_error) + __pyx_t_3 = __pyx_t_11; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - /* "constraint/parser.py":220 + /* "constraint/parser.py":235 * if " or " not in res and " and " not in res: * # if applicable, strip the outermost round brackets * while ( # <<<<<<<<<<<<<< * parsed_restriction[0] == "(" * and parsed_restriction[-1] == ")" - */ +*/ while (1) { - /* "constraint/parser.py":221 + /* "constraint/parser.py":236 * # 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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parsed_restriction, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__29, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_9) { + if (__pyx_t_11) { } else { - __pyx_t_3 = __pyx_t_9; + __pyx_t_3 = __pyx_t_11; goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":222 + /* "constraint/parser.py":237 * 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_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parsed_restriction, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__30, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_9) { + if (__pyx_t_11) { } else { - __pyx_t_3 = __pyx_t_9; + __pyx_t_3 = __pyx_t_11; goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":223 + /* "constraint/parser.py":238 * 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_slice__31, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __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, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__29, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u__17, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_9) { + if (__pyx_t_11) { } else { - __pyx_t_3 = __pyx_t_9; + __pyx_t_3 = __pyx_t_11; goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":224 + /* "constraint/parser.py":239 * 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_slice__32, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __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, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__30, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u__18, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __pyx_t_9; + __pyx_t_3 = __pyx_t_11; __pyx_L32_bool_binop_done:; if (!__pyx_t_3) break; - /* "constraint/parser.py":226 + /* "constraint/parser.py":241 * 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_slice__33, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __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, 241, __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":228 + /* "constraint/parser.py":243 * 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("unicode", __pyx_v_parsed_restriction))) __PYX_ERR(0, 228, __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, 228, __pyx_L1_error) +*/ + if (!(likely(PyUnicode_CheckExact(__pyx_v_parsed_restriction))||((__pyx_v_parsed_restriction) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_parsed_restriction))) __PYX_ERR(0, 243, __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, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":229 + /* "constraint/parser.py":244 * # 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 * finalized_constraint = to_equality_constraint(parsed_restriction, params_used_list) - */ +*/ __pyx_t_3 = (__pyx_v_finalized_constraint == Py_None); if (__pyx_t_3) { - /* "constraint/parser.py":231 + /* "constraint/parser.py":246 * 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("unicode", __pyx_v_parsed_restriction))) __PYX_ERR(0, 231, __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, 231, __pyx_L1_error) +*/ + if (!(likely(PyUnicode_CheckExact(__pyx_v_parsed_restriction))||((__pyx_v_parsed_restriction) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_parsed_restriction))) __PYX_ERR(0, 246, __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, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":229 + /* "constraint/parser.py":244 * # 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 * finalized_constraint = to_equality_constraint(parsed_restriction, params_used_list) - */ +*/ } - /* "constraint/parser.py":218 + /* "constraint/parser.py":233 * 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 ( - */ +*/ } - /* "constraint/parser.py":232 + /* "constraint/parser.py":247 * # 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 * finalized_constraint = f"def r({', '.join(params_used_list)}): return {parsed_restriction} \n" - */ +*/ __pyx_t_3 = (__pyx_v_finalized_constraint == Py_None); if (__pyx_t_3) { - /* "constraint/parser.py":234 + /* "constraint/parser.py":249 * 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 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) +*/ + __pyx_t_1 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__19, __pyx_v_params_used_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = 0; - __pyx_t_11 = 127; - __Pyx_INCREF(__pyx_kp_u_def_r); - __pyx_t_10 += 6; - __Pyx_GIVEREF(__pyx_kp_u_def_r); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_def_r); - __pyx_t_8 = PyUnicode_Join(__pyx_kp_u__34, __pyx_v_params_used_list); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_11; - __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8); - __pyx_t_8 = 0; - __Pyx_INCREF(__pyx_kp_u_return_2); - __pyx_t_10 += 10; - __Pyx_GIVEREF(__pyx_kp_u_return_2); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_return_2); - __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_parsed_restriction, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_11; - __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_8); - __pyx_t_8 = 0; - __Pyx_INCREF(__pyx_kp_u__35); - __pyx_t_10 += 2; - __Pyx_GIVEREF(__pyx_kp_u__35); - PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__35); - __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_parsed_restriction, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 249, __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; + __pyx_t_12[2] = __pyx_mstate_global->__pyx_kp_u_return_2; + __pyx_t_12[3] = __pyx_t_5; + __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u__20; + __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, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_8); - __pyx_t_8 = 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":232 + /* "constraint/parser.py":247 * # 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 * finalized_constraint = f"def r({', '.join(params_used_list)}): return {parsed_restriction} \n" - */ +*/ } - /* "constraint/parser.py":235 + /* "constraint/parser.py":250 * # 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_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); +*/ + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __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_8, 0, __pyx_v_finalized_constraint)) __PYX_ERR(0, 235, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_finalized_constraint) != (0)) __PYX_ERR(0, 250, __pyx_L1_error); __Pyx_INCREF(__pyx_v_params_used_list); __Pyx_GIVEREF(__pyx_v_params_used_list); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_params_used_list)) __PYX_ERR(0, 235, __pyx_L1_error); - __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_parsed_restrictions, __pyx_t_8); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 235, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_params_used_list) != (0)) __PYX_ERR(0, 250, __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, 250, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/parser.py":213 + /* "constraint/parser.py":228 * # split into functions that only take their relevant parameters * parsed_restrictions = list() * for res in restrictions: # <<<<<<<<<<<<<< * params_used: set[str] = set() * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() - */ +*/ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":237 + /* "constraint/parser.py":252 * 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":23 + /* "constraint/parser.py":24 * ) * * 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 - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -9365,6 +9103,8 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("constraint.parser.parse_restrictions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -9382,10 +9122,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_12generator4); - __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_r); - __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_r); - __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_i); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_12generator5); + __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_r); + __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_r); + __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_i); __Pyx_XDECREF(__pyx_v_restrictions); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); @@ -9393,13 +9133,13 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED return __pyx_r; } -/* "constraint/parser.py":239 +/* "constraint/parser.py":254 * return parsed_restrictions * * 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. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6parser_3compile_to_constraints(PyObject *__pyx_self, @@ -9410,7 +9150,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_6parser_2compile_to_constraints, "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.\n\n Args:\n constraints (list[str]): list of constraints in string format to compile.\n domains (dict): the domains to use.\n picklable (bool, optional): whether to keep constraints such that they can be pickled for parallel solvers. Defaults to False.\n\n Returns:\n 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.\n "); -static PyMethodDef __pyx_mdef_10constraint_6parser_3compile_to_constraints = {"compile_to_constraints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_3compile_to_constraints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6parser_2compile_to_constraints}; +static PyMethodDef __pyx_mdef_10constraint_6parser_3compile_to_constraints = {"compile_to_constraints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_3compile_to_constraints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6parser_2compile_to_constraints}; static PyObject *__pyx_pw_10constraint_6parser_3compile_to_constraints(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -9433,7 +9173,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("compile_to_constraints (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -9441,60 +9181,47 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_constraints,&__pyx_n_s_domains,&__pyx_n_s_picklable,0}; - values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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, 254, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 254, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 254, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 254, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + 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, 254, __pyx_L3_error) + 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, 254, __pyx_L3_error) } + } + } else { switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("compile_to_constraints", 0, 2, 3, 1); __PYX_ERR(0, 239, __pyx_L3_error) - } + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 254, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_picklable); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "compile_to_constraints") < 0)) __PYX_ERR(0, 239, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 254, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 254, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } + if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); } __pyx_v_constraints = ((PyObject*)values[0]); __pyx_v_domains = ((PyObject*)values[1]); @@ -9502,35 +9229,34 @@ 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, 239, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compile_to_constraints", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 254, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.compile_to_constraints", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 239, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 239, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 254, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 254, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_2compile_to_constraints(__pyx_self, __pyx_v_constraints, __pyx_v_domains, __pyx_v_picklable); /* 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -9548,7 +9274,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; + size_t __pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; @@ -9557,154 +9283,154 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; - Py_ssize_t __pyx_t_13; - Py_UCS4 __pyx_t_14; + 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", 1); + __Pyx_RefNannySetupContext("compile_to_constraints", 0); - /* "constraint/parser.py":250 + /* "constraint/parser.py":265 * 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 * parsed_restrictions = parse_restrictions(constraints, domains) # <<<<<<<<<<<<<< * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_restrictions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; +*/ + __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, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); + __pyx_t_4 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_constraints, __pyx_v_domains}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) + 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_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, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_parsed_restrictions = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":251 + /* "constraint/parser.py":266 * """ # noqa: E501 * parsed_restrictions = parse_restrictions(constraints, domains) * compiled_constraints: list[tuple[Constraint, list[str], Union[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, 251, __pyx_L1_error) +*/ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_compiled_constraints = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":252 + /* "constraint/parser.py":267 * parsed_restrictions = parse_restrictions(constraints, domains) * compiled_constraints: list[tuple[Constraint, list[str], Union[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 - */ +*/ if (likely(PyList_CheckExact(__pyx_v_parsed_restrictions)) || PyTuple_CheckExact(__pyx_v_parsed_restrictions)) { __pyx_t_1 = __pyx_v_parsed_restrictions; __Pyx_INCREF(__pyx_t_1); __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, 252, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parsed_restrictions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __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, 267, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 252, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 267, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 252, __pyx_L1_error) - #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_5); + ++__pyx_t_5; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 252, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 267, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5)); #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); #endif + ++__pyx_t_5; } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error) } else { - __pyx_t_2 = __pyx_t_6(__pyx_t_1); - if (unlikely(!__pyx_t_2)) { + __pyx_t_3 = __pyx_t_6(__pyx_t_1); + if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 252, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 267, __pyx_L1_error) + PyErr_Clear(); } 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_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, 252, __pyx_L1_error) + __PYX_ERR(0, 267, __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_t_7 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_7); } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __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); + __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); + index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; + __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, 252, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 267, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -9712,330 +9438,319 @@ 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, 252, __pyx_L1_error) + __PYX_ERR(0, 267, __pyx_L1_error) __pyx_L6_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_restriction, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_restriction, __pyx_t_2); + __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_params_used, __pyx_t_7); __pyx_t_7 = 0; - /* "constraint/parser.py":253 + /* "constraint/parser.py":268 * compiled_constraints: list[tuple[Constraint, list[str], Union[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 * if picklable: - */ +*/ __pyx_t_10 = PyUnicode_Check(__pyx_v_restriction); if (__pyx_t_10) { - /* "constraint/parser.py":255 + /* "constraint/parser.py":270 * 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, 255, __pyx_L1_error) +*/ + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_picklable); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 270, __pyx_L1_error) if (__pyx_t_10) { - /* "constraint/parser.py":256 + /* "constraint/parser.py":271 * # if it's a string, wrap it in a (compilable or compiled) function constraint * if picklable: * constraint = CompilableFunctionConstraint(restriction) # <<<<<<<<<<<<<< * else: * code_object = compile(restriction, "", "exec") - */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_CompilableFunctionConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; +*/ + __pyx_t_7 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_4 = 1; - } + 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); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __pyx_t_4 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_restriction}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + 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_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, 271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/parser.py":255 + /* "constraint/parser.py":270 * if isinstance(restriction, str): * # if it's a string, wrap it in a (compilable or compiled) function constraint * if picklable: # <<<<<<<<<<<<<< * constraint = CompilableFunctionConstraint(restriction) * else: - */ +*/ goto __pyx_L8; } - /* "constraint/parser.py":258 + /* "constraint/parser.py":273 * constraint = CompilableFunctionConstraint(restriction) * else: * code_object = compile(restriction, "", "exec") # <<<<<<<<<<<<<< * func = FunctionType(code_object.co_consts[0], globals()) * constraint = FunctionConstraint(func) - */ +*/ /*else*/ { - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_restriction); - __Pyx_GIVEREF(__pyx_v_restriction); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_restriction)) __PYX_ERR(0, 258, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u_string); - __Pyx_GIVEREF(__pyx_kp_u_string); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u_string)) __PYX_ERR(0, 258, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_exec); - __Pyx_GIVEREF(__pyx_n_u_exec); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_n_u_exec)) __PYX_ERR(0, 258, __pyx_L1_error); - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_compile, __pyx_t_2, NULL); 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_XDECREF_SET(__pyx_v_code_object, __pyx_t_7); - __pyx_t_7 = 0; + __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_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, 273, __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":259 + /* "constraint/parser.py":274 * 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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) +*/ + __pyx_t_7 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_code_object, __pyx_n_s_co_consts); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 259, __pyx_L1_error) + __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, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_Globals(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = NULL; - __pyx_t_4 = 0; + __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 274, __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, 274, __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_11 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } + __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); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __pyx_t_4 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_8, __pyx_t_3}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + 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; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - 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; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_7); - __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/parser.py":260 + /* "constraint/parser.py":275 * 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_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; +*/ + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 275, __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_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } + 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); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __pyx_t_4 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_func}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + 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; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_7); - __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_3); + __pyx_t_3 = 0; } __pyx_L8:; - /* "constraint/parser.py":261 + /* "constraint/parser.py":276 * 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_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 261, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); +*/ + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __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_7, 0, __pyx_v_constraint)) __PYX_ERR(0, 261, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 276, __pyx_L1_error); __Pyx_INCREF(__pyx_v_params_used); __Pyx_GIVEREF(__pyx_v_params_used); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_params_used)) __PYX_ERR(0, 261, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_params_used) != (0)) __PYX_ERR(0, 276, __pyx_L1_error); __Pyx_INCREF(__pyx_v_restriction); __Pyx_GIVEREF(__pyx_v_restriction); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_restriction)) __PYX_ERR(0, 261, __pyx_L1_error); - __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_compiled_constraints, __pyx_t_7); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 261, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_restriction) != (0)) __PYX_ERR(0, 276, __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, 276, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":253 + /* "constraint/parser.py":268 * compiled_constraints: list[tuple[Constraint, list[str], Union[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 * if picklable: - */ +*/ goto __pyx_L7; } - /* "constraint/parser.py":262 + /* "constraint/parser.py":277 * 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_7, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = PyObject_IsInstance(__pyx_v_restriction, __pyx_t_7); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 262, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __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, 277, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(__pyx_t_10)) { - /* "constraint/parser.py":264 + /* "constraint/parser.py":279 * 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_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 264, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); +*/ + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __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_7, 0, __pyx_v_restriction)) __PYX_ERR(0, 264, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_restriction) != (0)) __PYX_ERR(0, 279, __pyx_L1_error); __Pyx_INCREF(__pyx_v_params_used); __Pyx_GIVEREF(__pyx_v_params_used); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_params_used)) __PYX_ERR(0, 264, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_params_used) != (0)) __PYX_ERR(0, 279, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, Py_None)) __PYX_ERR(0, 264, __pyx_L1_error); - __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_compiled_constraints, __pyx_t_7); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 264, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None) != (0)) __PYX_ERR(0, 279, __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, 279, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":262 + /* "constraint/parser.py":277 * 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)) - */ +*/ goto __pyx_L7; } - /* "constraint/parser.py":266 + /* "constraint/parser.py":281 * compiled_constraints.append((restriction, params_used, None)) * else: * raise ValueError(f"Restriction {restriction} is neither a string or Constraint {type(restriction)}") # <<<<<<<<<<<<<< * * # return the restrictions and used parameters - */ +*/ /*else*/ { - __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 266, __pyx_L1_error) + __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, 281, __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, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_13 = 0; - __pyx_t_14 = 127; - __Pyx_INCREF(__pyx_kp_u_Restriction); - __pyx_t_13 += 12; - __Pyx_GIVEREF(__pyx_kp_u_Restriction); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_u_Restriction); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_restriction, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_14; - __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2); - __pyx_t_2 = 0; - __Pyx_INCREF(__pyx_kp_u_is_neither_a_string_or_Constrai); - __pyx_t_13 += 35; - __Pyx_GIVEREF(__pyx_kp_u_is_neither_a_string_or_Constrai); - PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_u_is_neither_a_string_or_Constrai); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_restriction)), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_14; - __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_7, 4, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_Restriction; + __pyx_t_13[1] = __pyx_t_11; + __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, 281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 266, __pyx_L1_error) + __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)); + __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, 281, __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, 281, __pyx_L1_error) } __pyx_L7:; - /* "constraint/parser.py":252 + /* "constraint/parser.py":267 * parsed_restrictions = parse_restrictions(constraints, domains) * compiled_constraints: list[tuple[Constraint, list[str], Union[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 - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":269 + /* "constraint/parser.py":284 * * # 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":239 + /* "constraint/parser.py":254 * return parsed_restrictions * * 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. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -10045,6 +9760,7 @@ 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:; @@ -10059,11 +9775,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __Pyx_RefNannyFinishContext(); return __pyx_r; } - -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *__pyx_freelist_10constraint_6parser___pyx_scope_struct__parse_restrictions[8]; -static int __pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions = 0; -#endif +/* #### 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; @@ -10072,8 +9784,8 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct__parse_res o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__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_freelist_10constraint_6parser___pyx_scope_struct__parse_restrictions[--__pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions]; + 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); @@ -10100,12 +9812,12 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct__parse_rest Py_CLEAR(p->__pyx_v_params_used); Py_CLEAR(p->__pyx_v_tune_params); #if CYTHON_USE_FREELISTS - if (((int)(__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_freelist_10constraint_6parser___pyx_scope_struct__parse_restrictions[__pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *)o); + 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 #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -10119,6 +9831,10 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct__parse_rest 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; } @@ -10170,12 +9886,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct__parse_re #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -10216,13 +9927,11 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct__parse_re 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -10241,11 +9950,6 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct__parse_re }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *__pyx_freelist_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint[8]; -static int __pyx_freecount_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint = 0; -#endif - 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 @@ -10253,8 +9957,8 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numer o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__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)))) { - o = (PyObject*)__pyx_freelist_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint[--__pyx_freecount_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) & (int)(t->tp_basicsize == 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]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -10281,12 +9985,12 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_1_to_numeri Py_CLEAR(p->__pyx_v_operator); Py_CLEAR(p->__pyx_v_params); #if CYTHON_USE_FREELISTS - if (((int)(__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)))) { - __pyx_freelist_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint[__pyx_freecount_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *)o); + 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)))) { + __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 { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -10300,6 +10004,10 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_1_to_numeri static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint(PyObject *o, visitproc v, void *a) { int e; 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; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_v_operator) { e = (*v)(p->__pyx_v_operator, a); if (e) return e; } @@ -10351,12 +10059,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_nume #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -10397,13 +10100,11 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_nume 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -10422,11 +10123,6 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_nume }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_2_genexpr[8]; -static int __pyx_freecount_10constraint_6parser___pyx_scope_struct_2_genexpr = 0; -#endif - 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 @@ -10434,8 +10130,8 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr( o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__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)))) { - o = (PyObject*)__pyx_freelist_10constraint_6parser___pyx_scope_struct_2_genexpr[--__pyx_freecount_10constraint_6parser___pyx_scope_struct_2_genexpr]; + 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)))) { + 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]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -10464,12 +10160,12 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_genexpr(P Py_CLEAR(p->__pyx_v_s); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__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)))) { - __pyx_freelist_10constraint_6parser___pyx_scope_struct_2_genexpr[__pyx_freecount_10constraint_6parser___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *)o); + 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)))) { + __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 { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -10483,6 +10179,10 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_genexpr(P static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_genexpr_arg_1) { e = (*v)(p->__pyx_genexpr_arg_1, a); if (e) return e; } @@ -10524,12 +10224,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -10570,13 +10265,11 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -10595,11 +10288,6 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_3_genexpr[8]; -static int __pyx_freecount_10constraint_6parser___pyx_scope_struct_3_genexpr = 0; -#endif - 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 @@ -10607,8 +10295,8 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_3_genexpr( o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__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)))) { - o = (PyObject*)__pyx_freelist_10constraint_6parser___pyx_scope_struct_3_genexpr[--__pyx_freecount_10constraint_6parser___pyx_scope_struct_3_genexpr]; + 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)))) { + 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]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -10634,14 +10322,14 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_3_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_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)))) { - __pyx_freelist_10constraint_6parser___pyx_scope_struct_3_genexpr[__pyx_freecount_10constraint_6parser___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *)o); + 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)))) { + __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 { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -10655,14 +10343,18 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_3_genexpr(P static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_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_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; } @@ -10696,12 +10388,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -10742,13 +10429,11 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -10767,11 +10452,6 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_4_genexpr[8]; -static int __pyx_freecount_10constraint_6parser___pyx_scope_struct_4_genexpr = 0; -#endif - 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 @@ -10779,8 +10459,8 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr( o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__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)))) { - o = (PyObject*)__pyx_freelist_10constraint_6parser___pyx_scope_struct_4_genexpr[--__pyx_freecount_10constraint_6parser___pyx_scope_struct_4_genexpr]; + 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)))) { + 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]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -10806,14 +10486,14 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_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_o); #if CYTHON_USE_FREELISTS - if (((int)(__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)))) { - __pyx_freelist_10constraint_6parser___pyx_scope_struct_4_genexpr[__pyx_freecount_10constraint_6parser___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *)o); + 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)))) { + __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 { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -10827,14 +10507,18 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr(P static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_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; + if (p->__pyx_v_o) { + e = (*v)(p->__pyx_v_o, a); if (e) return e; } return 0; } @@ -10868,12 +10552,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -10914,13 +10593,11 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -10939,21 +10616,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint *__pyx_freelist_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint[8]; -static int __pyx_freecount_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint = 0; -#endif - -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_freecount_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint)))) { - o = (PyObject*)__pyx_freelist_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint[--__pyx_freecount_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint)); + 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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -10966,25 +10638,26 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_to_equal return o; } -static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint(PyObject *o) { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint *)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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_params); + Py_CLEAR(p->__pyx_genexpr_arg_0); + Py_CLEAR(p->__pyx_v_s); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint)))) { - __pyx_freelist_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint[__pyx_freecount_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint *)o); + 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)))) { + __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 { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -10995,52 +10668,46 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_to_equali } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint *)o; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_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_v_params) { - e = (*v)(p->__pyx_v_params, 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; -} - -static int __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_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); - tmp = ((PyObject*)p->__pyx_v_params); - p->__pyx_v_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_5_to_equality_constraint_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint}, - {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint_spec = { - "constraint.parser.__pyx_scope_struct_5_to_equality_constraint", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint), +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr_spec = { + "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, - __pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_5_to_equality_constraint", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint), /*tp_basicsize*/ + "constraint.parser.""__pyx_scope_struct_5_genexpr", /*tp_name*/ + 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_to_equality_constraint, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -11049,12 +10716,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equa #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -11067,8 +10729,8 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equa 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint, /*tp_traverse*/ - __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint, /*tp_clear*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -11085,7 +10747,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equa #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -11095,13 +10757,11 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equa 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -11120,21 +10780,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equa }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_6_genexpr[8]; -static int __pyx_freecount_10constraint_6parser___pyx_scope_struct_6_genexpr = 0; -#endif - -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_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_freecount_10constraint_6parser___pyx_scope_struct_6_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr)))) { - o = (PyObject*)__pyx_freelist_10constraint_6parser___pyx_scope_struct_6_genexpr[--__pyx_freecount_10constraint_6parser___pyx_scope_struct_6_genexpr]; - memset(o, 0, 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_to_equality_constraint > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -11147,26 +10802,25 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr( 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; +static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint(PyObject *o) { + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_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_6_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint) { 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); + Py_CLEAR(p->__pyx_v_params); #if CYTHON_USE_FREELISTS - if (((int)(__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)))) { - __pyx_freelist_10constraint_6parser___pyx_scope_struct_6_genexpr[__pyx_freecount_10constraint_6parser___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -11177,42 +10831,56 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_genexpr(P } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *)o; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint *)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; + if (p->__pyx_v_params) { + e = (*v)(p->__pyx_v_params, a); if (e) return e; } return 0; } + +static int __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_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); + tmp = ((PyObject*)p->__pyx_v_params); + p->__pyx_v_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_6_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr_spec = { - "constraint.parser.__pyx_scope_struct_6_genexpr", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr), +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint_spec = { + "constraint.parser.__pyx_scope_struct_6_to_equality_constraint", + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_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_6_genexpr_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_6_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr), /*tp_basicsize*/ + "constraint.parser.""__pyx_scope_struct_6_to_equality_constraint", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -11221,12 +10889,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -11239,8 +10902,8 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_genexpr, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint, /*tp_traverse*/ + __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -11257,7 +10920,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -11267,13 +10930,11 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -11292,11 +10953,6 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_7_genexpr[8]; -static int __pyx_freecount_10constraint_6parser___pyx_scope_struct_7_genexpr = 0; -#endif - 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 @@ -11304,8 +10960,8 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr( o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__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)))) { - o = (PyObject*)__pyx_freelist_10constraint_6parser___pyx_scope_struct_7_genexpr[--__pyx_freecount_10constraint_6parser___pyx_scope_struct_7_genexpr]; + 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)))) { + 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]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -11329,15 +10985,16 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_7_genexpr(P } #endif PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_r); + Py_CLEAR(p->__pyx_v_s); #if CYTHON_USE_FREELISTS - if (((int)(__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)))) { - __pyx_freelist_10constraint_6parser___pyx_scope_struct_7_genexpr[__pyx_freecount_10constraint_6parser___pyx_scope_struct_7_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *)o); + 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)))) { + __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 { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -11351,11 +11008,18 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_7_genexpr(P static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_7_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_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_r) { - e = (*v)(p->__pyx_v_r, a); if (e) return e; + if (p->__pyx_v_s) { + e = (*v)(p->__pyx_v_s, a); if (e) return e; } return 0; } @@ -11389,12 +11053,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -11435,13 +11094,11 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -11460,612 +11117,409 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr }; #endif -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; -#ifndef CYTHON_SMALL_CODE -#if defined(__clang__) - #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) -#else - #define CYTHON_SMALL_CODE -#endif -#endif -/* #### Code section: pystring_table ### */ - -static int __Pyx_CreateStringTabAndInitStrings(void) { - __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, - {&__pyx_n_s_AllDifferentConstraint, __pyx_k_AllDifferentConstraint, sizeof(__pyx_k_AllDifferentConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_AllEqualConstraint, __pyx_k_AllEqualConstraint, sizeof(__pyx_k_AllEqualConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, - {&__pyx_n_s_CompilableFunctionConstraint, __pyx_k_CompilableFunctionConstraint, sizeof(__pyx_k_CompilableFunctionConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_Constraint, __pyx_k_Constraint, sizeof(__pyx_k_Constraint), 0, 0, 1, 1}, - {&__pyx_n_s_ExactSumConstraint, __pyx_k_ExactSumConstraint, sizeof(__pyx_k_ExactSumConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_FunctionConstraint, __pyx_k_FunctionConstraint, sizeof(__pyx_k_FunctionConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_FunctionType, __pyx_k_FunctionType, sizeof(__pyx_k_FunctionType), 0, 0, 1, 1}, - {&__pyx_kp_u_Invalid_comparator, __pyx_k_Invalid_comparator, sizeof(__pyx_k_Invalid_comparator), 0, 1, 0, 0}, - {&__pyx_kp_u_Invalid_operator, __pyx_k_Invalid_operator, sizeof(__pyx_k_Invalid_operator), 0, 1, 0, 0}, - {&__pyx_n_s_MaxProdConstraint, __pyx_k_MaxProdConstraint, sizeof(__pyx_k_MaxProdConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_MaxSumConstraint, __pyx_k_MaxSumConstraint, sizeof(__pyx_k_MaxSumConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_MinProdConstraint, __pyx_k_MinProdConstraint, sizeof(__pyx_k_MinProdConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_MinSumConstraint, __pyx_k_MinSumConstraint, sizeof(__pyx_k_MinSumConstraint), 0, 0, 1, 1}, - {&__pyx_kp_u_Not_possible_comparator_should_b, __pyx_k_Not_possible_comparator_should_b, sizeof(__pyx_k_Not_possible_comparator_should_b), 0, 1, 0, 0}, - {&__pyx_n_s_Optional, __pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 0, 1, 1}, - {&__pyx_kp_s_Optional_Union_AllEqualConstrain, __pyx_k_Optional_Union_AllEqualConstrain, sizeof(__pyx_k_Optional_Union_AllEqualConstrain), 0, 0, 1, 0}, - {&__pyx_kp_s_Optional_Union_MinSumConstraint, __pyx_k_Optional_Union_MinSumConstraint, sizeof(__pyx_k_Optional_Union_MinSumConstraint), 0, 0, 1, 0}, - {&__pyx_kp_s_Optional_Union_int_float, __pyx_k_Optional_Union_int_float, sizeof(__pyx_k_Optional_Union_int_float), 0, 0, 1, 0}, - {&__pyx_kp_u_Restriction, __pyx_k_Restriction, sizeof(__pyx_k_Restriction), 0, 1, 0, 0}, - {&__pyx_n_s_Union, __pyx_k_Union, sizeof(__pyx_k_Union), 0, 0, 1, 1}, - {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0}, - {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0}, - {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0}, - {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0}, - {&__pyx_n_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 1}, - {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0}, - {&__pyx_kp_u__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 1, 0, 0}, - {&__pyx_kp_u__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 1, 0, 0}, - {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, - {&__pyx_kp_u__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 1, 0, 0}, - {&__pyx_kp_u__27, __pyx_k__27, sizeof(__pyx_k__27), 0, 1, 0, 0}, - {&__pyx_kp_u__29, __pyx_k__29, sizeof(__pyx_k__29), 0, 1, 0, 0}, - {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, - {&__pyx_kp_u__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 1, 0, 0}, - {&__pyx_kp_u__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 1, 0, 0}, - {&__pyx_kp_u__35, __pyx_k__35, sizeof(__pyx_k__35), 0, 1, 0, 0}, - {&__pyx_kp_u__36, __pyx_k__36, sizeof(__pyx_k__36), 0, 1, 0, 0}, - {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, - {&__pyx_n_s__42, __pyx_k__42, sizeof(__pyx_k__42), 0, 0, 1, 1}, - {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, - {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0}, - {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, - {&__pyx_kp_u_a_zA_Z__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, 0}, - {&__pyx_kp_u_and, __pyx_k_and, sizeof(__pyx_k_and), 0, 1, 0, 0}, - {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, - {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, - {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, - {&__pyx_n_s_co_consts, __pyx_k_co_consts, sizeof(__pyx_k_co_consts), 0, 0, 1, 1}, - {&__pyx_n_s_code_object, __pyx_k_code_object, sizeof(__pyx_k_code_object), 0, 0, 1, 1}, - {&__pyx_n_s_comparator, __pyx_k_comparator, sizeof(__pyx_k_comparator), 0, 0, 1, 1}, - {&__pyx_n_s_comparators, __pyx_k_comparators, sizeof(__pyx_k_comparators), 0, 0, 1, 1}, - {&__pyx_n_s_comparators_found, __pyx_k_comparators_found, sizeof(__pyx_k_comparators_found), 0, 0, 1, 1}, - {&__pyx_n_s_comparators_indices, __pyx_k_comparators_indices, sizeof(__pyx_k_comparators_indices), 0, 0, 1, 1}, - {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1}, - {&__pyx_n_s_compile_to_constraints, __pyx_k_compile_to_constraints, sizeof(__pyx_k_compile_to_constraints), 0, 0, 1, 1}, - {&__pyx_n_s_compiled_constraints, __pyx_k_compiled_constraints, sizeof(__pyx_k_compiled_constraints), 0, 0, 1, 1}, - {&__pyx_n_s_constraint, __pyx_k_constraint, sizeof(__pyx_k_constraint), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_constraints, __pyx_k_constraint_constraints, sizeof(__pyx_k_constraint_constraints), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_parser, __pyx_k_constraint_parser, sizeof(__pyx_k_constraint_parser), 0, 0, 1, 1}, - {&__pyx_kp_s_constraint_parser_py, __pyx_k_constraint_parser_py, sizeof(__pyx_k_constraint_parser_py), 0, 0, 1, 0}, - {&__pyx_n_s_constraints, __pyx_k_constraints, sizeof(__pyx_k_constraints), 0, 0, 1, 1}, - {&__pyx_kp_u_def_r, __pyx_k_def_r, sizeof(__pyx_k_def_r), 0, 1, 0, 0}, - {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, - {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, - {&__pyx_n_s_domains, __pyx_k_domains, sizeof(__pyx_k_domains), 0, 0, 1, 1}, - {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, - {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, - {&__pyx_n_s_equalities_found, __pyx_k_equalities_found, sizeof(__pyx_k_equalities_found), 0, 0, 1, 1}, - {&__pyx_n_s_eval, __pyx_k_eval, sizeof(__pyx_k_eval), 0, 0, 1, 1}, - {&__pyx_n_u_exec, __pyx_k_exec, sizeof(__pyx_k_exec), 0, 1, 0, 1}, - {&__pyx_n_s_finalized_constraint, __pyx_k_finalized_constraint, sizeof(__pyx_k_finalized_constraint), 0, 0, 1, 1}, - {&__pyx_n_s_findall, __pyx_k_findall, sizeof(__pyx_k_findall), 0, 0, 1, 1}, - {&__pyx_n_s_finditer, __pyx_k_finditer, sizeof(__pyx_k_finditer), 0, 0, 1, 1}, - {&__pyx_n_s_fromkeys, __pyx_k_fromkeys, sizeof(__pyx_k_fromkeys), 0, 0, 1, 1}, - {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, - {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, - {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, - {&__pyx_n_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 1}, - {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, - {&__pyx_n_s_inequalities_found, __pyx_k_inequalities_found, sizeof(__pyx_k_inequalities_found), 0, 0, 1, 1}, - {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, - {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, - {&__pyx_kp_u_is_neither_a_string_or_Constrai, __pyx_k_is_neither_a_string_or_Constrai, sizeof(__pyx_k_is_neither_a_string_or_Constrai), 0, 1, 0, 0}, - {&__pyx_n_s_is_or_evals_to_number, __pyx_k_is_or_evals_to_number, sizeof(__pyx_k_is_or_evals_to_number), 0, 0, 1, 1}, - {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, - {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, - {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1}, - {&__pyx_n_s_left_num, __pyx_k_left_num, sizeof(__pyx_k_left_num), 0, 0, 1, 1}, - {&__pyx_kp_s_list_str, __pyx_k_list_str, sizeof(__pyx_k_list_str), 0, 0, 1, 0}, - {&__pyx_kp_s_list_tuple_Constraint_list_str_U, __pyx_k_list_tuple_Constraint_list_str_U, sizeof(__pyx_k_list_tuple_Constraint_list_str_U), 0, 0, 1, 0}, - {&__pyx_kp_s_list_tuple_Union_Constraint_str, __pyx_k_list_tuple_Union_Constraint_str, sizeof(__pyx_k_list_tuple_Union_Constraint_str), 0, 0, 1, 0}, - {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_match_object, __pyx_k_match_object, sizeof(__pyx_k_match_object), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_next_stop, __pyx_k_next_stop, sizeof(__pyx_k_next_stop), 0, 0, 1, 1}, - {&__pyx_n_s_number, __pyx_k_number, sizeof(__pyx_k_number), 0, 0, 1, 1}, - {&__pyx_n_s_number_is_int, __pyx_k_number_is_int, sizeof(__pyx_k_number_is_int), 0, 0, 1, 1}, - {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1}, - {&__pyx_n_s_operators, __pyx_k_operators, sizeof(__pyx_k_operators), 0, 0, 1, 1}, - {&__pyx_n_s_operators_found, __pyx_k_operators_found, sizeof(__pyx_k_operators_found), 0, 0, 1, 1}, - {&__pyx_kp_u_or, __pyx_k_or, sizeof(__pyx_k_or), 0, 1, 0, 0}, - {&__pyx_n_s_param, __pyx_k_param, sizeof(__pyx_k_param), 0, 0, 1, 1}, - {&__pyx_n_s_params, __pyx_k_params, sizeof(__pyx_k_params), 0, 0, 1, 1}, - {&__pyx_kp_u_params_params_index, __pyx_k_params_params_index, sizeof(__pyx_k_params_params_index), 0, 1, 0, 0}, - {&__pyx_n_s_params_used, __pyx_k_params_used, sizeof(__pyx_k_params_used), 0, 0, 1, 1}, - {&__pyx_n_s_params_used_list, __pyx_k_params_used_list, sizeof(__pyx_k_params_used_list), 0, 0, 1, 1}, - {&__pyx_n_s_parse_restrictions, __pyx_k_parse_restrictions, sizeof(__pyx_k_parse_restrictions), 0, 0, 1, 1}, - {&__pyx_n_s_parse_restrictions_locals_genexp, __pyx_k_parse_restrictions_locals_genexp, sizeof(__pyx_k_parse_restrictions_locals_genexp), 0, 0, 1, 1}, - {&__pyx_n_s_parse_restrictions_locals_replac, __pyx_k_parse_restrictions_locals_replac, sizeof(__pyx_k_parse_restrictions_locals_replac), 0, 0, 1, 1}, - {&__pyx_n_s_parse_restrictions_locals_replac_2, __pyx_k_parse_restrictions_locals_replac_2, sizeof(__pyx_k_parse_restrictions_locals_replac_2), 0, 0, 1, 1}, - {&__pyx_n_s_parse_restrictions_locals_to_equ, __pyx_k_parse_restrictions_locals_to_equ, sizeof(__pyx_k_parse_restrictions_locals_to_equ), 0, 0, 1, 1}, - {&__pyx_n_s_parse_restrictions_locals_to_equ_2, __pyx_k_parse_restrictions_locals_to_equ_2, sizeof(__pyx_k_parse_restrictions_locals_to_equ_2), 0, 0, 1, 1}, - {&__pyx_n_s_parse_restrictions_locals_to_mul, __pyx_k_parse_restrictions_locals_to_mul, sizeof(__pyx_k_parse_restrictions_locals_to_mul), 0, 0, 1, 1}, - {&__pyx_n_s_parse_restrictions_locals_to_num, __pyx_k_parse_restrictions_locals_to_num, sizeof(__pyx_k_parse_restrictions_locals_to_num), 0, 0, 1, 1}, - {&__pyx_n_s_parse_restrictions_locals_to_num_2, __pyx_k_parse_restrictions_locals_to_num_2, sizeof(__pyx_k_parse_restrictions_locals_to_num_2), 0, 0, 1, 1}, - {&__pyx_n_s_parse_restrictions_locals_to_num_3, __pyx_k_parse_restrictions_locals_to_num_3, sizeof(__pyx_k_parse_restrictions_locals_to_num_3), 0, 0, 1, 1}, - {&__pyx_n_s_parsed_restriction, __pyx_k_parsed_restriction, sizeof(__pyx_k_parsed_restriction), 0, 0, 1, 1}, - {&__pyx_n_s_parsed_restrictions, __pyx_k_parsed_restrictions, sizeof(__pyx_k_parsed_restrictions), 0, 0, 1, 1}, - {&__pyx_n_s_picklable, __pyx_k_picklable, sizeof(__pyx_k_picklable), 0, 0, 1, 1}, - {&__pyx_n_s_prev_stop, __pyx_k_prev_stop, sizeof(__pyx_k_prev_stop), 0, 0, 1, 1}, - {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1}, - {&__pyx_n_s_regex_match_variable, __pyx_k_regex_match_variable, sizeof(__pyx_k_regex_match_variable), 0, 0, 1, 1}, - {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, - {&__pyx_n_s_replace_params, __pyx_k_replace_params, sizeof(__pyx_k_replace_params), 0, 0, 1, 1}, - {&__pyx_n_s_replace_params_split, __pyx_k_replace_params_split, sizeof(__pyx_k_replace_params_split), 0, 0, 1, 1}, - {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1}, - {&__pyx_n_s_restriction, __pyx_k_restriction, sizeof(__pyx_k_restriction), 0, 0, 1, 1}, - {&__pyx_n_s_restrictions, __pyx_k_restrictions, sizeof(__pyx_k_restrictions), 0, 0, 1, 1}, - {&__pyx_n_s_restrictions_cleaned, __pyx_k_restrictions_cleaned, sizeof(__pyx_k_restrictions_cleaned), 0, 0, 1, 1}, - {&__pyx_n_s_restrictions_cleaned_unique, __pyx_k_restrictions_cleaned_unique, sizeof(__pyx_k_restrictions_cleaned_unique), 0, 0, 1, 1}, - {&__pyx_n_s_restrictions_unique_indices, __pyx_k_restrictions_unique_indices, sizeof(__pyx_k_restrictions_unique_indices), 0, 0, 1, 1}, - {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1}, - {&__pyx_kp_u_return_2, __pyx_k_return_2, sizeof(__pyx_k_return_2), 0, 1, 0, 0}, - {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1}, - {&__pyx_n_s_right_num, __pyx_k_right_num, sizeof(__pyx_k_right_num), 0, 0, 1, 1}, - {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, - {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, - {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, - {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, - {&__pyx_n_s_split_restrictions, __pyx_k_split_restrictions, sizeof(__pyx_k_split_restrictions), 0, 0, 1, 1}, - {&__pyx_n_s_splitted, __pyx_k_splitted, sizeof(__pyx_k_splitted), 0, 0, 1, 1}, - {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, - {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, - {&__pyx_kp_u_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 1, 0, 0}, - {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, - {&__pyx_n_s_sub, __pyx_k_sub, sizeof(__pyx_k_sub), 0, 0, 1, 1}, - {&__pyx_n_s_temp_copy, __pyx_k_temp_copy, sizeof(__pyx_k_temp_copy), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, - {&__pyx_n_s_to_equality_constraint, __pyx_k_to_equality_constraint, sizeof(__pyx_k_to_equality_constraint), 0, 0, 1, 1}, - {&__pyx_n_s_to_multiple_restrictions, __pyx_k_to_multiple_restrictions, sizeof(__pyx_k_to_multiple_restrictions), 0, 0, 1, 1}, - {&__pyx_n_s_to_numeric_constraint, __pyx_k_to_numeric_constraint, sizeof(__pyx_k_to_numeric_constraint), 0, 0, 1, 1}, - {&__pyx_n_s_tune_params, __pyx_k_tune_params, sizeof(__pyx_k_tune_params), 0, 0, 1, 1}, - {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1}, - {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1}, - {&__pyx_n_s_variables, __pyx_k_variables, sizeof(__pyx_k_variables), 0, 0, 1, 1}, - {&__pyx_n_s_variables_on_left, __pyx_k_variables_on_left, sizeof(__pyx_k_variables_on_left), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} - }; - return __Pyx_InitStrings(__pyx_string_tab); -} -/* #### Code section: cached_builtins ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 62, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 140, __pyx_L1_error) - __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_n_s_eval); if (!__pyx_builtin_eval) __PYX_ERR(0, 89, __pyx_L1_error) - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 90, __pyx_L1_error) - __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_n_s_compile); if (!__pyx_builtin_compile) __PYX_ERR(0, 258, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; +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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr)); + (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; } -/* #### Code section: cached_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "constraint/parser.py":86 - * - * # 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_tuple__8 = PyTuple_Pack(2, __pyx_n_s_s, __pyx_n_s_number); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 86, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_parser_py, __pyx_n_s_is_or_evals_to_number, 86, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 86, __pyx_L1_error) - - /* "constraint/parser.py":28 - * regex_match_variable = r"([a-zA-Z_$][a-zA-Z_$0-9]*)" - * - * def replace_params(match_object): # <<<<<<<<<<<<<< - * key = match_object.group(1) - * if key in tune_params: - */ - __pyx_tuple__17 = PyTuple_Pack(3, __pyx_n_s_match_object, __pyx_n_s_key, __pyx_n_s_param); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 28, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); - __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_parser_py, __pyx_n_s_replace_params, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 28, __pyx_L1_error) - - /* "constraint/parser.py":36 - * return key - * - * def replace_params_split(match_object): # <<<<<<<<<<<<<< - * # careful: has side-effect of adding to set `params_used` - * key = match_object.group(1) - */ - __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_parser_py, __pyx_n_s_replace_params_split, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 36, __pyx_L1_error) - - /* "constraint/parser.py":46 - * 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_tuple__20 = PyTuple_Pack(10, __pyx_n_s_restrictions, __pyx_n_s_split_restrictions, __pyx_n_s_res, __pyx_n_s_comparators, __pyx_n_s_comparators_indices, __pyx_n_s_index, __pyx_n_s_temp_copy, __pyx_n_s_prev_stop, __pyx_n_s_next_stop, __pyx_n_s_m); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_parser_py, __pyx_n_s_to_multiple_restrictions, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 46, __pyx_L1_error) - - /* "constraint/parser.py":71 - * return split_restrictions - * - * def to_numeric_constraint( # <<<<<<<<<<<<<< - * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: - */ - __pyx_tuple__22 = PyTuple_Pack(23, __pyx_n_s_restriction, __pyx_n_s_params, __pyx_n_s_comparators, __pyx_n_s_comparators_found, __pyx_n_s_comparator, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_is_or_evals_to_number, __pyx_n_s_is_or_evals_to_number, __pyx_n_s_left_num, __pyx_n_s_right_num, __pyx_n_s_number, __pyx_n_s_variables, __pyx_n_s_variables_on_left, __pyx_n_s_number_is_int, __pyx_n_s_operators, __pyx_n_s_operators_found, __pyx_n_s_operator, __pyx_n_s_splitted, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 71, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); - __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 23, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_parser_py, __pyx_n_s_to_numeric_constraint, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 71, __pyx_L1_error) - - /* "constraint/parser.py":172 - * return None - * - * def to_equality_constraint( # <<<<<<<<<<<<<< - * restriction: str, params: list[str] - * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: - */ - __pyx_tuple__24 = PyTuple_Pack(8, __pyx_n_s_restriction, __pyx_n_s_params, __pyx_n_s_equalities_found, __pyx_n_s_inequalities_found, __pyx_n_s_comparator, __pyx_n_s_splitted, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 172, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); - __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_parser_py, __pyx_n_s_to_equality_constraint, 172, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 172, __pyx_L1_error) - - /* "constraint/parser.py":203 - * 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 - * # get the indices of the unique restrictions, use these to build a new list of restrictions - */ - __pyx_tuple__28 = PyTuple_Pack(2, __pyx_kp_u__26, __pyx_kp_u__27); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); - - /* "constraint/parser.py":223 - * parsed_restriction[0] == "(" - * and parsed_restriction[-1] == ")" - * and "(" not in parsed_restriction[1:] # <<<<<<<<<<<<<< - * and ")" not in parsed_restriction[:1] - * ): - */ - __pyx_slice__31 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__31)) __PYX_ERR(0, 223, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__31); - __Pyx_GIVEREF(__pyx_slice__31); - - /* "constraint/parser.py":224 - * and parsed_restriction[-1] == ")" - * and "(" not in parsed_restriction[1:] - * and ")" not in parsed_restriction[:1] # <<<<<<<<<<<<<< - * ): - * parsed_restriction = parsed_restriction[1:-1] - */ - __pyx_slice__32 = PySlice_New(Py_None, __pyx_int_1, Py_None); if (unlikely(!__pyx_slice__32)) __PYX_ERR(0, 224, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__32); - __Pyx_GIVEREF(__pyx_slice__32); - /* "constraint/parser.py":226 - * 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_slice__33 = PySlice_New(__pyx_int_1, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__33)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__33); - __Pyx_GIVEREF(__pyx_slice__33); - - /* "constraint/parser.py":23 - * ) - * - * 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 - */ - __pyx_tuple__37 = PyTuple_Pack(27, __pyx_n_s_restrictions, __pyx_n_s_tune_params, __pyx_n_s_regex_match_variable, __pyx_n_s_replace_params, __pyx_n_s_replace_params, __pyx_n_s_replace_params_split, __pyx_n_s_replace_params_split, __pyx_n_s_to_multiple_restrictions, __pyx_n_s_to_multiple_restrictions, __pyx_n_s_to_numeric_constraint, __pyx_n_s_to_numeric_constraint, __pyx_n_s_to_equality_constraint, __pyx_n_s_to_equality_constraint, __pyx_n_s_restrictions_cleaned, __pyx_n_s_restrictions_cleaned_unique, __pyx_n_s_restrictions_unique_indices, __pyx_n_s_parsed_restrictions, __pyx_n_s_res, __pyx_n_s_params_used, __pyx_n_s_parsed_restriction, __pyx_n_s_params_used_list, __pyx_n_s_finalized_constraint, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_r, __pyx_n_s_r, __pyx_n_s_i); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__37); - __Pyx_GIVEREF(__pyx_tuple__37); - __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 27, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_parser_py, __pyx_n_s_parse_restrictions, 23, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 23, __pyx_L1_error) - - /* "constraint/parser.py":239 - * return parsed_restrictions - * - * 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_tuple__39 = PyTuple_Pack(10, __pyx_n_s_constraints, __pyx_n_s_domains, __pyx_n_s_picklable, __pyx_n_s_parsed_restrictions, __pyx_n_s_compiled_constraints, __pyx_n_s_restriction, __pyx_n_s_params_used, __pyx_n_s_constraint, __pyx_n_s_code_object, __pyx_n_s_func); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); - __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_parser_py, __pyx_n_s_compile_to_constraints, 239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 239, __pyx_L1_error) - __pyx_tuple__41 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_8_genexpr) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + 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_8_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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 + { + #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); + } + #endif + } } -/* #### Code section: init_constants ### */ -static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { - __pyx_umethod_PyList_Type_index.type = (PyObject*)&PyList_Type; - __pyx_umethod_PyList_Type_index.method_name = &__pyx_n_s_index; - if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_8_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_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_r) { + e = (*v)(p->__pyx_v_r, a); if (e) return e; + } return 0; - __pyx_L1_error:; - return -1; } -/* #### Code section: init_globals ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - /* AssertionsEnabled.init */ - if (likely(__Pyx_init_assertions_enabled() == 0)); else +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_8_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_8_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_8_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr_spec = { + "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, + __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr_slots, +}; +#else -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.parser.""__pyx_scope_struct_8_genexpr", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_8_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_8_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 PY_VERSION_HEX >= 0x030800b1 && (!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 - return 0; - __pyx_L1_error:; - return -1; -} +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; +/* #### Code section: initfunc_declarations ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/ /* #### Code section: init_module ### */ -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ - -static int __Pyx_modinit_global_init_code(void) { +static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_variable_export_code(void) { +static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_function_export_code(void) { +static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_type_init_code(void) { +static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __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_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions)) __PYX_ERR(0, 23, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions_spec, __pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions) < 0) __PYX_ERR(0, 23, __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, 24, __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, 24, __pyx_L1_error) #else - __pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions = &__pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions; + __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_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions->tp_print = 0; + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions) < 0) __PYX_ERR(0, 24, __pyx_L1_error) #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions->tp_dictoffset && __pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __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_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint)) __PYX_ERR(0, 71, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint_spec, __pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint) < 0) __PYX_ERR(0, 71, __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, 72, __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, 72, __pyx_L1_error) #else - __pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint = &__pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint; + __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_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint) < 0) __PYX_ERR(0, 71, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint->tp_print = 0; + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint) < 0) __PYX_ERR(0, 72, __pyx_L1_error) #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint->tp_dictoffset && __pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __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_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr)) __PYX_ERR(0, 83, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr_spec, __pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 83, __pyx_L1_error) + __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) #else - __pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr; + __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_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 83, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr->tp_print = 0; + 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_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr->tp_dictoffset && __pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __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_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr)) __PYX_ERR(0, 144, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr_spec, __pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 144, __pyx_L1_error) + __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, 104, __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, 104, __pyx_L1_error) #else - __pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr; + __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_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 144, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr->tp_print = 0; + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 104, __pyx_L1_error) #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __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_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr)) __PYX_ERR(0, 151, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_spec, __pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 151, __pyx_L1_error) + __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, 159, __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, 159, __pyx_L1_error) #else - __pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr; + __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_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 151, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr->tp_print = 0; + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 159, __pyx_L1_error) #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr->tp_dictoffset && __pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint)) __PYX_ERR(0, 172, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint_spec, __pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint) < 0) __PYX_ERR(0, 172, __pyx_L1_error) + __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, 166, __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, 166, __pyx_L1_error) #else - __pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint = &__pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint; + __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_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint) < 0) __PYX_ERR(0, 172, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint->tp_print = 0; + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 166, __pyx_L1_error) #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint->tp_dictoffset && __pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __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_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr)) __PYX_ERR(0, 191, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr_spec, __pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint)) __PYX_ERR(0, 187, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint) < 0) __PYX_ERR(0, 187, __pyx_L1_error) #else - __pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint = &__pyx_type_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 191, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr->tp_print = 0; + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint) < 0) __PYX_ERR(0, 187, __pyx_L1_error) #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr->tp_dictoffset && __pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __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_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr)) __PYX_ERR(0, 201, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr_spec, __pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 201, __pyx_L1_error) + __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, 206, __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, 206, __pyx_L1_error) #else - __pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr; + __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_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 201, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr->tp_print = 0; + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 206, __pyx_L1_error) #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr->tp_dictoffset && __pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif - __Pyx_RefNannyFinishContext(); - return 0; + #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, 216, __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, 216, __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, 216, __pyx_L1_error) + #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)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr->tp_getattro = PyObject_GenericGetAttr; + } + #endif + __Pyx_RefNannyFinishContext(); + return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } -static int __Pyx_modinit_type_import_code(void) { +static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_variable_import_code(void) { +static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_function_import_code(void) { +static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } - -#if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_parser(PyObject* module); /*proto*/ 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}, + #endif + #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE + {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED}, + #endif {0, NULL} }; #endif @@ -12080,12 +11534,10 @@ namespace { PyModuleDef_HEAD_INIT, "parser", __pyx_k_Module_containing_the_code_for_p, /* m_doc */ - #if CYTHON_PEP489_MULTI_PHASE_INIT - 0, /* m_size */ - #elif CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstate), /* m_size */ + #if CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstatetype), /* m_size */ #else - -1, /* m_size */ + (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT @@ -12106,51 +11558,71 @@ namespace { #ifdef __cplusplus } /* anonymous namespace */ #endif -#endif +/* PyModInitFuncType */ #ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#elif PY_MAJOR_VERSION < 3 -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" void -#else -#define __Pyx_PyMODINIT_FUNC void -#endif -#else -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * + #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #else -#define __Pyx_PyMODINIT_FUNC PyObject * -#endif + #ifdef __cplusplus + #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * + #else + #define __Pyx_PyMODINIT_FUNC PyObject * + #endif #endif - -#if PY_MAJOR_VERSION < 3 -__Pyx_PyMODINIT_FUNC initparser(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC initparser(void) -#else __Pyx_PyMODINIT_FUNC PyInit_parser(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_parser(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } +/* ModuleCreationPEP489 */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 +static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { + { + PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think + if (!module) { + PyErr_Clear(); // just try the 3.8-3.12 version + module = PyImport_ImportModule("_xxsubinterpreters"); + if (!module) goto bad; + } + PyObject *current = PyObject_CallMethod(module, "get_current", NULL); + Py_DECREF(module); + if (!current) goto bad; + if (PyTuple_Check(current)) { + PyObject *new_current = PySequence_GetItem(current, 0); + Py_DECREF(current); + current = new_current; + if (!new_current) goto bad; + } + long long as_c_int = PyLong_AsLongLong(current); + Py_DECREF(current); + return as_c_int; + } + bad: + PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n"); + return -1; +} +#endif +#if !CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; +#if 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 + PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId(); +#else PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); +#endif + if (unlikely(current_id == -1)) { + return -1; + } if (main_interpreter_id == -1) { main_interpreter_id = current_id; - return (unlikely(current_id == -1)) ? -1 : 0; - } else if (unlikely(main_interpreter_id != current_id)) - #else - static PyInterpreterState *main_interpreter = NULL; - PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; - if (!main_interpreter) { - main_interpreter = current_interpreter; - } else if (unlikely(main_interpreter != current_interpreter)) - #endif - { + return 0; + } else if (unlikely(main_interpreter_id != current_id)) { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); @@ -12158,21 +11630,14 @@ static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { } return 0; } -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) -#else -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { -#if CYTHON_COMPILING_IN_LIMITED_API - result = PyModule_AddObject(module, to_name, value); -#else result = PyDict_SetItemString(moddict, to_name, value); -#endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { @@ -12185,8 +11650,10 @@ static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); + #if !CYTHON_USE_MODULE_STATE if (__Pyx_check_single_interpreter()) return NULL; + #endif if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); @@ -12194,12 +11661,8 @@ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDe module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; -#if CYTHON_COMPILING_IN_LIMITED_API - moddict = module; -#else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; -#endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; @@ -12213,12 +11676,12 @@ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDe static CYTHON_SMALL_CODE int __pyx_pymod_exec_parser(PyObject *__pyx_pyinit_module) #endif -#endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif + __pyx_mstatetype *__pyx_mstate = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; @@ -12232,36 +11695,37 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_parser(PyObject *__pyx_pyinit_modu PyErr_SetString(PyExc_RuntimeError, "Module 'parser' has already been imported. Re-initialisation is not supported."); return -1; } - #elif PY_MAJOR_VERSION >= 3 + #else if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_m = __pyx_pyinit_module; - Py_INCREF(__pyx_m); + __pyx_t_1 = __pyx_pyinit_module; + Py_INCREF(__pyx_t_1); #else - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("parser", __pyx_methods, __pyx_k_Module_containing_the_code_for_p, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #if CYTHON_USE_MODULE_STATE { - int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "parser" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_m = __pyx_t_1; #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED); #endif + __pyx_mstate = __pyx_mstate_global; CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_mstate->__pyx_d); + __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + 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) { @@ -12271,14 +11735,15 @@ if (!__Pyx_RefNanny) { Py_FatalError("failed to import 'refnanny' module"); } #endif - __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_parser(void)", 0); + +__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(); #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __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) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif @@ -12294,58 +11759,44 @@ if (!__Pyx_RefNanny) { #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - PyEval_InitThreads(); - #endif /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants() < 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 PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif if (__pyx_module_is_main_constraint__parser) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_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) } - #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "constraint.parser")) { if (unlikely((PyDict_SetItemString(modules, "constraint.parser", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } - #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 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() < 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(); - (void)__Pyx_modinit_variable_export_code(); - (void)__Pyx_modinit_function_export_code(); - if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - (void)__Pyx_modinit_type_import_code(); - (void)__Pyx_modinit_variable_import_code(); - (void)__Pyx_modinit_function_import_code(); + (void)__Pyx_modinit_global_init_code(__pyx_mstate); + (void)__Pyx_modinit_variable_export_code(__pyx_mstate); + (void)__Pyx_modinit_function_export_code(__pyx_mstate); + if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(__pyx_mstate); + (void)__Pyx_modinit_variable_import_code(__pyx_mstate); + (void)__Pyx_modinit_function_import_code(__pyx_mstate); /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /* "constraint/parser.py":2 * """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_n_s_re, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) +*/ + __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_d, __pyx_n_s_re, __pyx_t_2) < 0) __PYX_ERR(0, 2, __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, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/parser.py":3 @@ -12354,18 +11805,15 @@ if (!__Pyx_RefNanny) { * from types import FunctionType # <<<<<<<<<<<<<< * from typing import Union, Optional * from constraint.constraints import ( - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) +*/ + __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_INCREF(__pyx_n_s_FunctionType); - __Pyx_GIVEREF(__pyx_n_s_FunctionType); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_FunctionType)) __PYX_ERR(0, 3, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_types, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) + __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_n_s_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_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_FunctionType, __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; @@ -12375,25 +11823,19 @@ if (!__Pyx_RefNanny) { * from typing import Union, Optional # <<<<<<<<<<<<<< * from constraint.constraints import ( * AllDifferentConstraint, - */ - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) +*/ + __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_INCREF(__pyx_n_s_Union); - __Pyx_GIVEREF(__pyx_n_s_Union); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Union)) __PYX_ERR(0, 4, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_Optional); - __Pyx_GIVEREF(__pyx_n_s_Optional); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_Optional)) __PYX_ERR(0, 4, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) + __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) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Union); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) + __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_d, __pyx_n_s_Union, __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_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_n_s_Optional); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) + __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_d, __pyx_n_s_Optional, __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_Optional, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12403,39 +11845,9 @@ if (!__Pyx_RefNanny) { * AllDifferentConstraint, # <<<<<<<<<<<<<< * AllEqualConstraint, * Constraint, - */ - __pyx_t_2 = PyList_New(10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyList_Pack(11, __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_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_FunctionConstraint, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_AllDifferentConstraint); - __Pyx_GIVEREF(__pyx_n_s_AllDifferentConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_AllDifferentConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_AllEqualConstraint); - __Pyx_GIVEREF(__pyx_n_s_AllEqualConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_AllEqualConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_Constraint); - __Pyx_GIVEREF(__pyx_n_s_Constraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_Constraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_ExactSumConstraint); - __Pyx_GIVEREF(__pyx_n_s_ExactSumConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_ExactSumConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_MaxProdConstraint); - __Pyx_GIVEREF(__pyx_n_s_MaxProdConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_MaxProdConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_MaxSumConstraint); - __Pyx_GIVEREF(__pyx_n_s_MaxSumConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_s_MaxSumConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_MinProdConstraint); - __Pyx_GIVEREF(__pyx_n_s_MinProdConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 6, __pyx_n_s_MinProdConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_MinSumConstraint); - __Pyx_GIVEREF(__pyx_n_s_MinSumConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 7, __pyx_n_s_MinSumConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_FunctionConstraint); - __Pyx_GIVEREF(__pyx_n_s_FunctionConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 8, __pyx_n_s_FunctionConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_CompilableFunctionConstraint); - __Pyx_GIVEREF(__pyx_n_s_CompilableFunctionConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 9, __pyx_n_s_CompilableFunctionConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); /* "constraint/parser.py":5 * from types import FunctionType @@ -12443,99 +11855,103 @@ if (!__Pyx_RefNanny) { * from constraint.constraints import ( # <<<<<<<<<<<<<< * AllDifferentConstraint, * AllEqualConstraint, - */ - __pyx_t_3 = __Pyx_Import(__pyx_n_s_constraint_constraints, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) +*/ + __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_n_s_AllDifferentConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __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_d, __pyx_n_s_AllDifferentConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + 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_n_s_AllEqualConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __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_d, __pyx_n_s_AllEqualConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + 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_n_s_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __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_d, __pyx_n_s_Constraint, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + 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_n_s_ExactSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __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_d, __pyx_n_s_ExactSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + 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_n_s_MaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __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_d, __pyx_n_s_MaxProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __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_n_s_MaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __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_d, __pyx_n_s_MaxSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) + 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_n_s_MinProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __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_d, __pyx_n_s_MinProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __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_n_s_MinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __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_d, __pyx_n_s_MinSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __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_n_s_FunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __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_d, __pyx_n_s_FunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __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_n_s_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __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_d, __pyx_n_s_CompilableFunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __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_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, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":23 + /* "constraint/parser.py":24 * ) * * 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 - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_restrictions, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tune_params, __pyx_n_s_dict) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_list_tuple_Union_Constraint_str) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_1parse_restrictions, 0, __pyx_n_s_parse_restrictions, NULL, __pyx_n_s_constraint_parser, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + 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, 24, __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, 24, __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, 24, __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[12])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __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_d, __pyx_n_s_parse_restrictions, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_parse_restrictions, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":239 + /* "constraint/parser.py":254 * return parsed_restrictions * * 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, 239, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_constraints, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 239, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 239, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_kp_s_list_tuple_Constraint_list_str_U) < 0) __PYX_ERR(0, 239, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_3compile_to_constraints, 0, __pyx_n_s_compile_to_constraints, NULL, __pyx_n_s_constraint_parser, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error) + 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, 254, __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, 254, __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, 254, __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[13])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__41); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[1]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_compile_to_constraints, __pyx_t_3) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_compile_to_constraints, __pyx_t_3) < 0) __PYX_ERR(0, 254, __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_d, __pyx_n_s_test, __pyx_t_3) < 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_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ @@ -12545,7 +11961,7 @@ if (!__Pyx_RefNanny) { __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { - if (__pyx_d && stringtab_initialized) { + if (__pyx_mstate->__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init constraint.parser", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE @@ -12566,12 +11982,456 @@ if (!__Pyx_RefNanny) { __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; - #elif PY_MAJOR_VERSION >= 3 - return __pyx_m; #else - return; + return __pyx_m; #endif } +/* #### Code section: pystring_table ### */ + +typedef struct { + const char *s; +#if 179 <= 65535 + const unsigned short n; +#elif 179 / 2 < INT_MAX + const unsigned int n; +#elif 179 / 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_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_VariableExactSumConstraint, sizeof(__pyx_k_VariableExactSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableExactSumConstraint */ + {__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__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__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_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_number_is_int, sizeof(__pyx_k_number_is_int), 0, 1, 1}, /* PyObject cname: __pyx_n_u_number_is_int */ + {__pyx_k_o, sizeof(__pyx_k_o), 0, 1, 1}, /* PyObject cname: __pyx_n_u_o */ + {__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_or, sizeof(__pyx_k_or), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_or */ + {__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_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_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_s, sizeof(__pyx_k_s), 0, 1, 1}, /* PyObject cname: __pyx_n_u_s */ + {__pyx_k_send, sizeof(__pyx_k_send), 0, 1, 1}, /* PyObject cname: __pyx_n_u_send */ + {__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_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_value, sizeof(__pyx_k_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_value */ + {__pyx_k_variable_supported_operators, sizeof(__pyx_k_variable_supported_operators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_supported_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: 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, 63, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_eval); if (!__pyx_builtin_eval) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_compile); if (!__pyx_builtin_compile) __PYX_ERR(0, 273, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "constraint/parser.py":109 + * # if both sides are parameters, use the VariableExactSumConstraint + * if variables_on_left: + * return VariableExactSumConstraint(variables[-1], variables[:-1]) # <<<<<<<<<<<<<< + * else: + * return 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, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); + + /* "constraint/parser.py":111 + * return VariableExactSumConstraint(variables[-1], variables[:-1]) + * else: + * return VariableExactSumConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< + * + * # left_num and right_num can't be both None or both a constant +*/ + __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, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[1]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[1]); + + /* "constraint/parser.py":218 + * 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 + * # get the indices of the unique restrictions, use these to build a new list of restrictions +*/ + __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u__15, __pyx_mstate_global->__pyx_kp_u__16); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); + + /* "constraint/parser.py":239 + * 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, 239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[2]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[2]); + + /* "constraint/parser.py":241 + * 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, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[3]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[3]); + + /* "constraint/parser.py":254 + * return parsed_restrictions + * + * 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_mstate_global->__pyx_tuple[1] = PyTuple_Pack(1, ((PyObject*)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +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; + 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) + 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 : 8; + unsigned int line_table_length : 15; + } __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 *tuple_dedup_map +); + + +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}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; + __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_1, 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), 104, 2}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; + __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_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), 159, 2}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_o}; + __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_Q_2, 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), 166, 2}; + 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__23, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 87, 45}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s, __pyx_mstate->__pyx_n_u_number}; + __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_is_or_evals_to_number, __pyx_k_XQ_Qa_z_5_q_q, 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), 206, 2}; + 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__23, 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), 216, 2}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_r}; + __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; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 29, 50}; + 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[7] = __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[7])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 37, 50}; + 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[8] = __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[8])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 47, 251}; + 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[9] = __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[9])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 26, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 72, 899}; + 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_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_variables_on_left, __pyx_mstate->__pyx_n_u_number, __pyx_mstate->__pyx_n_u_number_is_int, __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_s, __pyx_mstate->__pyx_n_u_genexpr, __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_parser_py, __pyx_mstate->__pyx_n_u_to_numeric_constraint, __pyx_k_A_avV6_a_Bhas_q_a_3a_Q_1_aq_he81, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 187, 222}; + 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[11] = __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[11])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 27, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 24, 386}; + 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_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[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_parse_restrictions, __pyx_k_Ya_1_Q2_U_b_U_6_Q_q_t4uA_d_4y_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 254, 177}; + 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[13] = __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[13])) goto bad; + } + Py_DECREF(tuple_dedup_map); + return 0; + bad: + Py_DECREF(tuple_dedup_map); + return -1; +} +/* #### Code section: init_globals ### */ + +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) + + /* AssertionsEnabled.init */ + if (likely(__Pyx_init_assertions_enabled() == 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 + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + return 0; + __pyx_L1_error:; + return -1; +} /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ @@ -12612,11 +12472,9 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; itp_getattro)) return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ -#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -12734,11 +12588,11 @@ static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; -#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 +#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 && PY_VERSION_HEX >= 0x030700B1 +#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); @@ -12754,20 +12608,36 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif } return result; } /* TupleAndListFromArray */ -#if CYTHON_COMPILING_IN_CPYTHON +#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; @@ -12781,8 +12651,7 @@ __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { - Py_INCREF(__pyx_empty_tuple); - return __pyx_empty_tuple; + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; @@ -12805,7 +12674,8 @@ __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ + !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { @@ -12852,55 +12722,39 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL return PyObject_RichCompareBool(s1, s2, equals); #else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; + Py_ssize_t length, length2; int kind; void *data1, *data2; + #if !CYTHON_COMPILING_IN_LIMITED_API if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; + #endif length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length < 0)) return -1; + #endif + length2 = __Pyx_PyUnicode_GET_LENGTH(s2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length2 < 0)) return -1; + #endif + if (length != length2) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; - #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; - #else - hash1 = ((PyUnicodeObject*)s1)->hash; - hash2 = ((PyUnicodeObject*)s2)->hash; - #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } @@ -12918,9 +12772,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { @@ -12930,9 +12781,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -12940,14 +12788,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int return result; } return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ); return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_NE); #endif } @@ -12956,14 +12798,25 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { - Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(n == -1)) return NULL; + #endif for (i = 0; i < n; i++) { - if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + if (s == namei) return kwvalues[i]; } for (i = 0; i < n; i++) { - int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; @@ -12971,15 +12824,26 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO } return NULL; } -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { - Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); + Py_ssize_t i, nkwargs; PyObject *dict; +#if !CYTHON_ASSUME_SAFE_SIZE + nkwargs = PyTuple_Size(kwnames); + if (unlikely(nkwargs < 0)) return NULL; +#else + nkwargs = PyTuple_GET_SIZE(kwnames); +#endif dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif -} - -/* ParseKeywords */ -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); - while (1) { - Py_XDECREF(key); key = NULL; - Py_XDECREF(value); value = NULL; - if (kwds_is_tuple) { - Py_ssize_t size; -#if CYTHON_ASSUME_SAFE_MACROS - size = PyTuple_GET_SIZE(kwds); -#else - size = PyTuple_Size(kwds); - if (size < 0) goto bad; -#endif - if (pos >= size) break; -#if CYTHON_AVOID_BORROWED_REFS - key = __Pyx_PySequence_ITEM(kwds, pos); - if (!key) goto bad; -#elif CYTHON_ASSUME_SAFE_MACROS - key = PyTuple_GET_ITEM(kwds, pos); -#else - key = PyTuple_GetItem(kwds, pos); - if (!key) goto bad; -#endif - value = kwvalues[pos]; - pos++; - } - else - { - if (!PyDict_Next(kwds, &pos, &key, &value)) break; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); -#endif - } - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(value); - Py_DECREF(key); -#endif - key = NULL; - value = NULL; - continue; - } -#if !CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); -#endif - Py_INCREF(value); - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; -#endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = ( - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key) - ); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; -#endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - Py_XDECREF(key); - Py_XDECREF(value); - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - #if PY_MAJOR_VERSION < 3 - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - PyErr_Format(PyExc_TypeError, - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - Py_XDECREF(key); - Py_XDECREF(value); - return -1; -} - -/* ArgTypeTest */ -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) -{ - __Pyx_TypeName type_name; - __Pyx_TypeName obj_type_name; - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - else if (exact) { - #if PY_MAJOR_VERSION == 2 - if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { - if (likely(__Pyx_TypeCheck(obj, type))) return 1; - } - type_name = __Pyx_PyType_GetName(type); - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME - ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); - __Pyx_DECREF_TypeName(type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return 0; } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject *const *args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; @@ -13244,14 +12894,12 @@ static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args --tstate->recursion_depth; return result; } -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { +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; -#if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; -#endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; @@ -13259,19 +12907,11 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { - return NULL; - } - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } - #endif if ( -#if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && -#endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { @@ -13308,9 +12948,7 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, k = NULL; } closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); -#endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); @@ -13319,17 +12957,10 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, d = NULL; nd = 0; } -#if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); -#else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, closure); -#endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); @@ -13344,13 +12975,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -13369,13 +12995,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -13389,7 +13010,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API -static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { +static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; @@ -13397,7 +13018,7 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **arg if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); - if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: @@ -13405,7 +13026,32 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **arg return result; } #endif -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { +#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API + #if PY_VERSION_HEX < 0x03090000 + #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable) + #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 (__Pyx_CyFunction_CheckExact(callable)) { + return __Pyx_CyFunction_func_vectorcall(callable); + } + #endif + if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) { + return NULL; + } + assert(PyCallable_Check(callable)); + Py_ssize_t offset = tp->tp_vectorcall_offset; + assert(offset > 0); + vectorcallfunc ptr; + memcpy(&ptr, (char *) callable + offset, sizeof(ptr)); + return ptr; +} + #else + #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable) + #endif +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { @@ -13426,12 +13072,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } - #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif - #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); @@ -13439,24 +13083,22 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif #endif if (kwargs == NULL) { - #if CYTHON_VECTORCALL - #if PY_VERSION_HEX < 0x03090000 - vectorcallfunc f = _PyVectorcall_Function(func); - #else - vectorcallfunc f = PyVectorcall_Function(func); - #endif + #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API + vectorcallfunc f = __Pyx_PyVectorcall_Function(func); if (f) { - return f(func, args, (size_t)nargs, NULL); + 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, (size_t)nargs, NULL); + if (f) return f(func, args, _nargs, NULL); } + #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL + return PyObject_Vectorcall(func, args, _nargs, NULL); #endif } if (nargs == 0) { - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); @@ -13465,349 +13107,993 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif } -/* RaiseClosureNameError */ -static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { - PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); +/* UnpackUnboundCMethod */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; + PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); + if (unlikely(!selfless_args)) return NULL; + result = PyObject_Call(method, selfless_args, kwargs); + Py_DECREF(selfless_args); + return result; } - -/* PyDictVersioning */ -#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; - return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000 +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { + return _PyObject_Vectorcall + (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames); } -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { - PyObject **dictptr = NULL; - Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; - if (offset) { -#if CYTHON_COMPILING_IN_CPYTHON - dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else - dictptr = _PyObject_GetDictPtr(obj); +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + return +#if PY_VERSION_HEX < 0x03090000 + _PyObject_Vectorcall +#else + PyObject_Vectorcall #endif - } - return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; -} -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) - return 0; - return obj_dict_version == __Pyx_get_object_dict_version(obj); + (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames); } #endif - -/* GetModuleGlobalName */ -#if CYTHON_USE_DICT_VERSIONS -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +static PyMethodDef __Pyx_UnboundCMethod_Def = { + "CythonUnboundCMethod", + __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 + METH_VARARGS | METH_KEYWORDS, #else -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) + METH_FASTCALL | METH_KEYWORDS, #endif -{ - PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 - result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } else if (unlikely(PyErr_Occurred())) { - return NULL; - } -#elif CYTHON_COMPILING_IN_LIMITED_API - if (unlikely(!__pyx_m)) { - return NULL; - } - result = PyObject_GetAttr(__pyx_m, name); - if (likely(result)) { - return result; - } + NULL +}; +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method, *result=NULL; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + result = method; +#if CYTHON_COMPILING_IN_CPYTHON + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } else +#endif +#if CYTHON_COMPILING_IN_PYPY #else - result = PyDict_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } + if (PyCFunction_Check(method)) #endif + { + PyObject *self; + int self_found; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + self = PyObject_GetAttrString(method, "__self__"); + if (!self) { + PyErr_Clear(); + } #else - result = PyObject_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); + self = PyCFunction_GET_SELF(method); +#endif + self_found = (self && self != Py_None); +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + Py_XDECREF(self); +#endif + if (self_found) { + PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); + if (unlikely(!unbound_method)) return -1; + Py_DECREF(method); + result = unbound_method; + } } - PyErr_Clear(); +#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if (unlikely(target->method)) { + Py_DECREF(result); + } else #endif - return __Pyx_GetBuiltinName(name); -} - -/* 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); + target->method = result; + return 0; } -/* PyIntBinop */ -#if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { - CYTHON_MAYBE_UNUSED_VAR(intval); - CYTHON_MAYBE_UNUSED_VAR(inplace); - CYTHON_UNUSED_VAR(zerodivision_check); - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long x; - long a = PyInt_AS_LONG(op1); - - x = (long)((unsigned long)a + (unsigned long)b); - if (likely((x^a) >= 0 || (x^b) >= 0)) - return PyInt_FromLong(x); - return PyLong_Type.tp_as_number->nb_add(op1, op2); +/* CallUnboundCMethod2 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { + int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); + if (likely(was_initialized == 2 && cfunc->func)) { + PyObject *args[2] = {arg1, arg2}; + if (cfunc->flag == METH_FASTCALL) { + return __Pyx_CallCFunctionFast(cfunc, self, args, 2); + } + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL); + } +#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__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2); } - #endif - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(PyLong_CheckExact(op1))) { - const long b = intval; - long a, x; -#ifdef HAVE_LONG_LONG - const PY_LONG_LONG llb = intval; - PY_LONG_LONG lla, llx; #endif - if (unlikely(__Pyx_PyLong_IsZero(op1))) { - return __Pyx_NewRef(op2); + PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); + __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); + return result; +} +#endif +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + PyObject *result = NULL; + PyObject *args = PyTuple_New(2); + if (unlikely(!args)) return NULL; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + if (cfunc->flag & METH_KEYWORDS) + result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); + else + result = __Pyx_CallCFunction(cfunc, self, args); + Py_DECREF(args); + return result; + } +#endif + { + PyObject *args[4] = {NULL, self, arg1, arg2}; + return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + } +} + +/* ParseKeywords */ +static int __Pyx_ValidateDuplicatePosArgs( + PyObject *kwds, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + const char* function_name) +{ + PyObject ** const *name = argnames; + while (name != first_kw_arg) { + PyObject *key = **name; + int found = PyDict_Contains(kwds, key); + if (unlikely(found)) { + if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; } - if (likely(__Pyx_PyLong_IsCompact(op1))) { - a = __Pyx_PyLong_CompactValue(op1); - } 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 - } 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 - } - 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; - 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 - } - 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 - } - CYTHON_FALLTHROUGH; - default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + name++; + } + return 0; +bad: + return -1; +} +#if CYTHON_USE_UNICODE_INTERNALS +static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) { + int kind; + Py_ssize_t len = PyUnicode_GET_LENGTH(s1); + if (len != PyUnicode_GET_LENGTH(s2)) return 0; + kind = PyUnicode_KIND(s1); + if (kind != PyUnicode_KIND(s2)) return 0; + const void *data1 = PyUnicode_DATA(s1); + const void *data2 = PyUnicode_DATA(s2); + return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0); +} +#endif +static int __Pyx_MatchKeywordArg_str( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + PyObject ** const *name; + #if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t key_hash = ((PyASCIIObject*)key)->hash; + if (unlikely(key_hash == -1)) { + key_hash = PyObject_Hash(key); + if (unlikely(key_hash == -1)) + goto bad; + } + #endif + name = first_kw_arg; + while (*name) { + PyObject *name_str = **name; + #if CYTHON_USE_UNICODE_INTERNALS + if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) { + *index_found = (size_t) (name - argnames); + return 1; + } + #else + #if CYTHON_ASSUME_SAFE_SIZE + if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) + #endif + { + int cmp = PyUnicode_Compare(name_str, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + *index_found = (size_t) (name - argnames); + return 1; } } - x = a + b; - return PyLong_FromLong(x); -#ifdef HAVE_LONG_LONG - long_long: - llx = lla + llb; - return PyLong_FromLongLong(llx); + #endif + name++; + } + name = argnames; + while (name != first_kw_arg) { + PyObject *name_str = **name; + #if CYTHON_USE_UNICODE_INTERNALS + if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) { + if (__Pyx_UnicodeKeywordsEqual(name_str, key)) + goto arg_passed_twice; + } + #else + #if CYTHON_ASSUME_SAFE_SIZE + if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) + #endif + { + if (unlikely(name_str == key)) goto arg_passed_twice; + int cmp = PyUnicode_Compare(name_str, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + } + #endif + name++; + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +bad: + return -1; +} +static int __Pyx_MatchKeywordArg_nostr( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + PyObject ** const *name; + if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; + name = first_kw_arg; + while (*name) { + int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); + if (cmp == 1) { + *index_found = (size_t) (name - argnames); + return 1; + } + if (unlikely(cmp == -1)) goto bad; + name++; + } + name = argnames; + while (name != first_kw_arg) { + int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); + if (unlikely(cmp != 0)) { + if (cmp == 1) goto arg_passed_twice; + else goto bad; + } + name++; + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +bad: + return -1; +} +static CYTHON_INLINE int __Pyx_MatchKeywordArg( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + return likely(PyUnicode_CheckExact(key)) ? + __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) : + __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name); +} +static void __Pyx_RejectUnknownKeyword( + PyObject *kwds, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + const char *function_name) +{ + Py_ssize_t pos = 0; + PyObject *key = NULL; + __Pyx_BEGIN_CRITICAL_SECTION(kwds); + while (PyDict_Next(kwds, &pos, &key, NULL)) { + 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) { + if (cmp == 0) { + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif + break; + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif + } + } + __Pyx_END_CRITICAL_SECTION(); + assert(PyErr_Occurred()); +} +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) +{ + PyObject** const *name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + Py_ssize_t extracted = 0; +#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) + if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; +#endif + name = first_kw_arg; + while (*name && num_kwargs > extracted) { + PyObject * key = **name; + PyObject *value; + int found = 0; + #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + found = PyDict_GetItemRef(kwds, key, &value); + #else + value = PyDict_GetItemWithError(kwds, key); + if (value) { + Py_INCREF(value); + found = 1; + } else { + if (unlikely(PyErr_Occurred())) goto bad; + } + #endif + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + extracted++; + } + name++; + } + if (num_kwargs > extracted) { + if (ignore_unknown_kwargs) { + if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1)) + goto bad; + } else { + __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name); + goto bad; + } + } + return 0; +bad: + return -1; +} +static int __Pyx_ParseKeywordDictToDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject** const *name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + Py_ssize_t len; +#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) + if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; +#endif + if (PyDict_Update(kwds2, kwds) < 0) goto bad; + name = first_kw_arg; + while (*name) { + PyObject *key = **name; + PyObject *value; +#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop)) + int found = PyDict_Pop(kwds2, key, &value); + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + } +#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + int found = PyDict_GetItemRef(kwds2, key, &value); + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad; + } +#else + #if CYTHON_COMPILING_IN_CPYTHON + value = _PyDict_Pop(kwds2, key, kwds2); + #else + value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2); + #endif + if (value == kwds2) { + Py_DECREF(value); + } else { + if (unlikely(!value)) goto bad; + values[name-argnames] = value; + } #endif - - + name++; + } + len = PyDict_Size(kwds2); + if (len > 0) { + return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name); + } else if (unlikely(len == -1)) { + goto bad; + } + return 0; +bad: + return -1; +} +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) +{ + PyObject *key = NULL; + PyObject** const * name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) { +#if CYTHON_AVOID_BORROWED_REFS + key = __Pyx_PySequence_ITEM(kwds, pos); +#else + key = __Pyx_PyTuple_GET_ITEM(kwds, pos); +#endif +#if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!key)) goto bad; +#endif + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + PyObject *value = kwvalues[pos]; + values[name-argnames] = __Pyx_NewRef(value); + } else { + size_t index_found = 0; + int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); + if (cmp == 1) { + PyObject *value = kwvalues[pos]; + values[index_found] = __Pyx_NewRef(value); + } else { + if (unlikely(cmp == -1)) goto bad; + if (kwds2) { + PyObject *value = kwvalues[pos]; + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else if (!ignore_unknown_kwargs) { + goto invalid_keyword; + } + } + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + key = NULL; + #endif } + return 0; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + goto bad; +bad: + #if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(key); #endif - if (PyFloat_CheckExact(op1)) { - const long b = intval; -#if CYTHON_COMPILING_IN_LIMITED_API - double a = __pyx_PyFloat_AsDouble(op1); + return -1; +} +static 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) +{ + if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) + return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); + else if (kwds2) + return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name); + else + return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); +} + +/* RaiseArgTupleInvalid */ +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + __Pyx_TypeName type_name; + __Pyx_TypeName obj_type_name; + PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode; + int from_annotation_subclass = 0; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (!exact) { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } else if (exact == 2) { + if (__Pyx_TypeCheck(obj, type)) { + from_annotation_subclass = 1; + extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately; + } + } + type_name = __Pyx_PyType_GetFullyQualifiedName(type); + obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME + ", got " __Pyx_FMT_TYPENAME ")" +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + "%s%U" +#endif + , name, type_name, obj_type_name +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + , (from_annotation_subclass ? ". " : ""), extra_info +#endif + ); +#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + if (exact == 2 && from_annotation_subclass) { + PyObject *res; + PyObject *vargs[2]; + vargs[0] = PyErr_GetRaisedException(); + vargs[1] = extra_info; + res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL); + Py_XDECREF(res); + PyErr_SetRaisedException(vargs[0]); + } +#endif + __Pyx_DECREF_TypeName(type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} + +/* PyObjectFastCallMethod */ +#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000 +static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) { + PyObject *result; + PyObject *attr = PyObject_GetAttr(args[0], name); + if (unlikely(!attr)) + return NULL; + result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1); + Py_DECREF(attr); + return result; +} +#endif + +/* RaiseClosureNameError */ +static void __Pyx_RaiseClosureNameError(const char *varname) { + PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); +} + +/* 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 + +/* PyDictVersioning */ +#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; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else - double a = PyFloat_AS_DOUBLE(op1); + dictptr = _PyObject_GetDictPtr(obj); #endif - double result; - - PyFPE_START_PROTECT("add", return NULL) - result = ((double)a) + (double)b; - PyFPE_END_PROTECT(result) - return PyFloat_FromDouble(result); } - return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!__pyx_m)) { + if (!PyErr_Occurred()) + PyErr_SetNone(PyExc_NameError); + return NULL; + } + result = PyObject_GetAttr(__pyx_m, name); + if (likely(result)) { + return result; + } + PyErr_Clear(); +#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear(); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return result; + } +#else + result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); #endif + return __Pyx_GetBuiltinName(name); +} -/* PyIntBinop */ +/* PyLongBinop */ #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { - CYTHON_MAYBE_UNUSED_VAR(intval); +static PyObject* __Pyx_Fallback___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, int inplace) { + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#if CYTHON_USE_PYLONG_INTERNALS +static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long x; - long a = PyInt_AS_LONG(op1); - - x = (long)((unsigned long)a - (unsigned long)b); - if (likely((x^a) >= 0 || (x^~b) >= 0)) - return PyInt_FromLong(x); - return PyLong_Type.tp_as_number->nb_subtract(op1, op2); + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + if (unlikely(__Pyx_PyLong_IsZero(op1))) { + return __Pyx_NewRef(op2); } - #endif + if (likely(__Pyx_PyLong_IsCompact(op1))) { + a = __Pyx_PyLong_CompactValue(op1); + } 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 + } 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 + } + 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; + 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 + } + 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 + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + } + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); +#endif + return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace); + + +} +#endif +static PyObject* __Pyx_Float___Pyx_PyLong_AddObjC(PyObject *float_val, long intval, int zerodivision_check) { + CYTHON_UNUSED_VAR(zerodivision_check); + const long b = intval; + double a = __Pyx_PyFloat_AS_DOUBLE(float_val); + double result; + + result = ((double)a) + (double)b; + return PyFloat_FromDouble(result); +} +static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_UNUSED_VAR(zerodivision_check); #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { - const long b = intval; - long a, x; + return __Pyx_Unpacked___Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check); + } + #endif + if (PyFloat_CheckExact(op1)) { + return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check); + } + return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace); +} +#endif + +/* PyLongBinop */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_Fallback___Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, int inplace) { + return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); +} +#if CYTHON_USE_PYLONG_INTERNALS +static PyObject* __Pyx_Unpacked___Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { + CYTHON_MAYBE_UNUSED_VAR(inplace); + CYTHON_UNUSED_VAR(zerodivision_check); + const long b = intval; + long a, x; #ifdef HAVE_LONG_LONG - const PY_LONG_LONG llb = intval; - PY_LONG_LONG lla, llx; + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; #endif - if (unlikely(__Pyx_PyLong_IsZero(op1))) { - return PyLong_FromLong(-intval); - } - if (likely(__Pyx_PyLong_IsCompact(op1))) { - a = __Pyx_PyLong_CompactValue(op1); - } 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 - } 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 - } - 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; - 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 - } - 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 - } - CYTHON_FALLTHROUGH; - default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); - } + if (unlikely(__Pyx_PyLong_IsZero(op1))) { + return PyLong_FromLong(-intval); + } + if (likely(__Pyx_PyLong_IsCompact(op1))) { + a = __Pyx_PyLong_CompactValue(op1); + } 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 + } 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 + } + 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; + 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 + } + 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 + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } - x = a - b; - return PyLong_FromLong(x); + } + x = a - b; + return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG - long_long: - llx = lla - llb; - return PyLong_FromLongLong(llx); + long_long: + llx = lla - llb; + return PyLong_FromLongLong(llx); #endif + return __Pyx_Fallback___Pyx_PyLong_SubtractObjC(op1, op2, inplace); + + +} +#endif +static PyObject* __Pyx_Float___Pyx_PyLong_SubtractObjC(PyObject *float_val, long intval, int zerodivision_check) { + CYTHON_UNUSED_VAR(zerodivision_check); + const long b = intval; + double a = __Pyx_PyFloat_AS_DOUBLE(float_val); + double result; - + result = ((double)a) - (double)b; + return PyFloat_FromDouble(result); +} +static CYTHON_INLINE PyObject* __Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_UNUSED_VAR(zerodivision_check); + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + return __Pyx_Unpacked___Pyx_PyLong_SubtractObjC(op1, op2, intval, inplace, zerodivision_check); } #endif if (PyFloat_CheckExact(op1)) { - const long b = intval; -#if CYTHON_COMPILING_IN_LIMITED_API - double a = __pyx_PyFloat_AsDouble(op1); -#else - double a = PyFloat_AS_DOUBLE(op1); -#endif - double result; - - PyFPE_START_PROTECT("subtract", return NULL) - result = ((double)a) - (double)b; - PyFPE_END_PROTECT(result) - return PyFloat_FromDouble(result); + return __Pyx_Float___Pyx_PyLong_SubtractObjC(op1, intval, zerodivision_check); } - return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); + return __Pyx_Fallback___Pyx_PyLong_SubtractObjC(op1, op2, inplace); } #endif @@ -13822,7 +14108,7 @@ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { 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_AVOID_BORROWED_REFS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); @@ -13832,7 +14118,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_ Py_INCREF(r); return r; } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif @@ -13840,7 +14126,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_ 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_AVOID_BORROWED_REFS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); @@ -13850,7 +14136,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize Py_INCREF(r); return r; } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif @@ -13858,13 +14144,11 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize 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_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS 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))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; + return __Pyx_PyList_GetItemRef(o, n); } } else if (PyTuple_CheckExact(o)) { @@ -13878,7 +14162,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { - PyObject *r, *key = PyInt_FromSsize_t(i); + PyObject *r, *key = PyLong_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); @@ -13903,7 +14187,13 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, return PySequence_GetItem(o, i); } #endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + 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); } /* ObjectGetItem */ @@ -13916,7 +14206,7 @@ static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { - __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); + __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); @@ -13927,7 +14217,7 @@ 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))) { - PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem); if (!meth) { PyErr_Clear(); } else { @@ -13936,7 +14226,7 @@ static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { return result; } } - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + 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); @@ -13960,53 +14250,11 @@ static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { 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) { + int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS - PyMappingMethods* mp; -#if PY_MAJOR_VERSION < 3 - PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; - if (likely(ms && ms->sq_slice)) { - if (!has_cstart) { - if (_py_start && (*_py_start != Py_None)) { - cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); - if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstart = 0; - } - if (!has_cstop) { - if (_py_stop && (*_py_stop != Py_None)) { - cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); - if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstop = PY_SSIZE_T_MAX; - } - if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { - Py_ssize_t l = ms->sq_length(obj); - if (likely(l >= 0)) { - if (cstop < 0) { - cstop += l; - if (cstop < 0) cstop = 0; - } - if (cstart < 0) { - cstart += l; - if (cstart < 0) cstart = 0; - } - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - goto bad; - PyErr_Clear(); - } - } - return ms->sq_slice(obj, cstart, cstop); - } -#else - CYTHON_UNUSED_VAR(wraparound); -#endif - mp = Py_TYPE(obj)->tp_as_mapping; + PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) -#else - CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; @@ -14020,7 +14268,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, py_start = *_py_start; } else { if (has_cstart) { - owned_start = py_start = PyInt_FromSsize_t(cstart); + owned_start = py_start = PyLong_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; @@ -14029,7 +14277,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, py_stop = *_py_stop; } else { if (has_cstop) { - owned_stop = py_stop = PyInt_FromSsize_t(cstop); + owned_stop = py_stop = PyLong_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; @@ -14052,7 +14300,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, } return result; } - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + 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); @@ -14061,58 +14309,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, } /* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - __Pyx_PyThreadState_declare - CYTHON_UNUSED_VAR(cause); - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { @@ -14197,9 +14393,9 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { - #if PY_VERSION_HEX >= 0x030C00A6 +#if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); - #elif CYTHON_FAST_THREAD_STATE +#elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -14219,7 +14415,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_XDECREF(owned_instance); return; } -#endif /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE @@ -14303,6 +14498,11 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject } #endif +/* RaiseUnboundLocalError */ +static void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) @@ -14313,14 +14513,9 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030C00A6 + #if PY_VERSION_HEX >= 0x030C0000 local_value = tstate->current_exception; tstate->current_exception = 0; - if (likely(local_value)) { - local_type = (PyObject*) Py_TYPE(local_value); - Py_INCREF(local_type); - local_tb = PyException_GetTraceback(local_value); - } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; @@ -14329,24 +14524,30 @@ 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 + local_value = PyErr_GetRaisedException(); #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif +#if __PYX_LIMITED_VERSION_HEX > 0x030C0000 + if (likely(local_value)) { + local_type = (PyObject*) Py_TYPE(local_value); + Py_INCREF(local_type); + local_tb = PyException_GetTraceback(local_value); + } +#else PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 - if (unlikely(tstate->current_exception)) -#elif CYTHON_FAST_THREAD_STATE +#if CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; - #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } - #endif +#endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000 Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); @@ -14384,10 +14585,16 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); +#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000 + PyErr_SetHandledException(local_value); + Py_XDECREF(local_value); + Py_XDECREF(local_type); + Py_XDECREF(local_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; +#if __PYX_LIMITED_VERSION_HEX <= 0x030C0000 bad: *type = 0; *value = 0; @@ -14396,41 +14603,37 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; -} - -/* RaiseUnboundLocalError */ -static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { - PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +#endif } /* pep479 */ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { - PyObject *exc, *val, *tb, *cur_exc; + PyObject *exc, *val, *tb, *cur_exc, *new_exc; __Pyx_PyThreadState_declare - #ifdef __Pyx_StopAsyncIteration_USED int is_async_stopiteration = 0; - #endif CYTHON_MAYBE_UNUSED_VAR(in_async_gen); - cur_exc = PyErr_Occurred(); + __Pyx_PyThreadState_assign + cur_exc = __Pyx_PyErr_CurrentExceptionType(); if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) { - #ifdef __Pyx_StopAsyncIteration_USED - if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) { + if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopAsyncIteration))) { is_async_stopiteration = 1; - } else - #endif + } else { return; + } } - __Pyx_PyThreadState_assign __Pyx_GetException(&exc, &val, &tb); Py_XDECREF(exc); - Py_XDECREF(val); Py_XDECREF(tb); - PyErr_SetString(PyExc_RuntimeError, - #ifdef __Pyx_StopAsyncIteration_USED + new_exc = PyObject_CallFunction(PyExc_RuntimeError, "s", is_async_stopiteration ? "async generator raised StopAsyncIteration" : in_async_gen ? "async generator raised StopIteration" : - #endif "generator raised StopIteration"); + if (!new_exc) { + Py_XDECREF(val); + return; + } + PyException_SetCause(new_exc, val); // steals ref to val + PyErr_SetObject(PyExc_RuntimeError, new_exc); } /* RaiseTooManyValuesToUnpack */ @@ -14447,7 +14650,6 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { } /* FixUpExtensionType */ -#if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); @@ -14517,23 +14719,50 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject #endif return 0; } -#endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); + 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); +#else + value = PyDict_SetDefault(d, key, default_value); + if (unlikely(!value)) return NULL; + Py_INCREF(value); +#endif + return value; } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, - Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { + Py_ssize_t basicsize; if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_basicsize; + py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); + if (unlikely(!py_basicsize)) return -1; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = NULL; + if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1; +#else + basicsize = ((PyTypeObject*) cached_type)->tp_basicsize; +#endif if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", @@ -14542,80 +14771,51 @@ static int __Pyx_VerifyCachedType(PyObject *cached_type, } return 0; } -#if !CYTHON_USE_TYPE_SPECS -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { - PyObject* abi_module; - const char* object_name; - PyTypeObject *cached_type = NULL; - abi_module = __Pyx_FetchSharedCythonABIModule(); - if (!abi_module) return NULL; - object_name = strrchr(type->tp_name, '.'); - object_name = object_name ? object_name+1 : type->tp_name; - cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); - if (cached_type) { - if (__Pyx_VerifyCachedType( - (PyObject *)cached_type, - object_name, - cached_type->tp_basicsize, - type->tp_basicsize) < 0) { - goto bad; - } - goto done; - } - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); - if (PyType_Ready(type) < 0) goto bad; - if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) - goto bad; - Py_INCREF(type); - cached_type = type; -done: - Py_DECREF(abi_module); - return cached_type; -bad: - Py_XDECREF(cached_type); - cached_type = NULL; - goto done; -} -#else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { - PyObject *abi_module, *cached_type = NULL; + PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name; + int get_item_ref_result; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; + py_object_name = PyUnicode_FromString(object_name); + if (!py_object_name) return NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); - if (!abi_module) return NULL; - cached_type = PyObject_GetAttrString(abi_module, object_name); - if (cached_type) { - Py_ssize_t basicsize; -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *py_basicsize; - py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); - if (unlikely(!py_basicsize)) goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; -#else - basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; -#endif + if (!abi_module) goto done; + abi_module_dict = PyModule_GetDict(abi_module); + if (!abi_module_dict) goto done; + get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type); + if (get_item_ref_result == 1) { if (__Pyx_VerifyCachedType( cached_type, object_name, - basicsize, spec->basicsize) < 0) { goto bad; } goto done; + } else if (unlikely(get_item_ref_result == -1)) { + goto bad; } - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(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; - if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; + new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type, 1); + if (unlikely(new_cached_type != cached_type)) { + if (unlikely(!new_cached_type)) goto bad; + Py_DECREF(cached_type); + cached_type = new_cached_type; + if (__Pyx_VerifyCachedType( + cached_type, + object_name, + spec->basicsize) < 0) { + goto bad; + } + goto done; + } else { + Py_DECREF(new_cached_type); + } done: - Py_DECREF(abi_module); + Py_XDECREF(abi_module); + Py_DECREF(py_object_name); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: @@ -14623,10 +14823,54 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec cached_type = NULL; goto done; } + +/* CallTypeTraverse */ +#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) { + #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 + if (__Pyx_get_runtime_version() < 0x03090000) return 0; + #endif + if (!always_call) { + PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*); + unsigned long flags = PyType_GetFlags(base); + if (flags & Py_TPFLAGS_HEAPTYPE) { + return 0; + } + } + Py_VISIT((PyObject*)Py_TYPE(o)); + return 0; +} +#endif + +/* PyMethodNew */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + PyObject *result; + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + { + PyObject *args[] = {func, self}; + result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL); + } + #else + result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL); + #endif + return result; +} +#else +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} #endif /* PyVectorcallFastCallDict */ -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; @@ -14637,7 +14881,12 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector size_t j; PyObject *key, *value; unsigned long keys_are_strings; + #if !CYTHON_ASSUME_SAFE_SIZE + Py_ssize_t nkw = PyDict_Size(kw); + if (unlikely(nkw == -1)) return NULL; + #else Py_ssize_t nkw = PyDict_GET_SIZE(kw); + #endif newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); @@ -14653,10 +14902,19 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { - keys_are_strings &= Py_TYPE(key)->tp_flags; + 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 PyTuple_SET_ITEM(kwnames, i, key); + #endif kwvalues[i] = value; i++; } @@ -14674,16 +14932,29 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { - if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { + Py_ssize_t kw_size = + likely(kw == NULL) ? + 0 : +#if !CYTHON_ASSUME_SAFE_SIZE + PyDict_Size(kw); +#else + PyDict_GET_SIZE(kw); +#endif + if (kw_size == 0) { return vc(func, args, nargs, NULL); } +#if !CYTHON_ASSUME_SAFE_SIZE + else if (unlikely(kw_size == -1)) { + return NULL; + } +#endif return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { @@ -14691,8 +14962,25 @@ static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) } return 0; } +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) { + if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) { + int result; + PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func); + if (unlikely(!newFunc)) { + PyErr_Clear(); // It's only an optimization, so don't throw an error + return 0; + } + result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc); + Py_DECREF(newFunc); + return result; + } + return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc); +} #else -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) { + if (PyMethod_Check(func)) { + func = PyMethod_GET_FUNCTION(func); + } return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif @@ -14708,20 +14996,15 @@ static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* #endif } static PyObject * -__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) +__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op) { - CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { -#if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#else - op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#endif if (unlikely(op->func_doc == NULL)) return NULL; } else { @@ -14733,6 +15016,15 @@ __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) Py_INCREF(op->func_doc); return op->func_doc; } +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { + PyObject *result; + CYTHON_UNUSED_VAR(closure); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_doc_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { @@ -14741,20 +15033,19 @@ __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *cont value = Py_None; } Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_doc, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op) { - CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); -#elif PY_MAJOR_VERSION >= 3 - op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else - op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; @@ -14762,53 +15053,60 @@ __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) Py_INCREF(op->func_name); return op->func_name; } +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +{ + PyObject *result = NULL; + CYTHON_UNUSED_VAR(context); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_name_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_name, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); + PyObject *result; + __Pyx_BEGIN_CRITICAL_SECTION(op); Py_INCREF(op->func_qualname); - return op->func_qualname; + result = op->func_qualname; + __Pyx_END_CRITICAL_SECTION(); + return result; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_qualname, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) +__Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op) { - CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) @@ -14817,6 +15115,16 @@ __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) 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) { @@ -14832,7 +15140,9 @@ __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *con return -1; } Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_dict, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * @@ -14893,13 +15203,14 @@ __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { +__Pyx_CyFunction_get_defaults_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_tuple; - CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; @@ -14911,6 +15222,15 @@ __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { Py_INCREF(result); return result; } +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = NULL; + CYTHON_UNUSED_VAR(context); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_defaults_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); @@ -14924,13 +15244,14 @@ __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, voi PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { +__Pyx_CyFunction_get_kwdefaults_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_kwdict; - CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; @@ -14942,6 +15263,15 @@ __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { Py_INCREF(result); return result; } +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result; + CYTHON_UNUSED_VAR(context); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_kwdefaults_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); @@ -14953,13 +15283,14 @@ __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, vo return -1; } Py_XINCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_annotations, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { +__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; - CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; @@ -14969,16 +15300,19 @@ __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { return result; } static PyObject * -__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { - int is_coroutine; +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { + PyObject *result; CYTHON_UNUSED_VAR(context); - if (op->func_is_coroutine) { - return __Pyx_NewRef(op->func_is_coroutine); - } - is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; -#if PY_VERSION_HEX >= 0x03050000 + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_annotations_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} +static PyObject * +__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { + int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; if (is_coroutine) { - PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; + PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); @@ -14991,20 +15325,68 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { return NULL; } #endif - module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); + module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; - op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); + is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); - if (likely(op->func_is_coroutine)) { - return __Pyx_NewRef(op->func_is_coroutine); + if (likely(is_coroutine_value)) { + return is_coroutine_value; } ignore: PyErr_Clear(); } + return __Pyx_PyBool_FromLong(is_coroutine); +} +static PyObject * +__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { + PyObject *result; + CYTHON_UNUSED_VAR(context); + if (op->func_is_coroutine) { + return __Pyx_NewRef(op->func_is_coroutine); + } + result = __Pyx_CyFunction_get_is_coroutine_value(op); + if (unlikely(!result)) + return NULL; + __Pyx_BEGIN_CRITICAL_SECTION(op); + if (op->func_is_coroutine) { + Py_DECREF(result); + result = __Pyx_NewRef(op->func_is_coroutine); + } else { + op->func_is_coroutine = __Pyx_NewRef(result); + } + __Pyx_END_CRITICAL_SECTION(); + return result; +} +static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, message, size); + Py_DECREF(py_name); +#else + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + name, message, size); +#endif +} +static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s", + py_name, message); + Py_DECREF(py_name); +#else + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s", + name, message); #endif - op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); - return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * @@ -15019,24 +15401,24 @@ __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *c } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { - {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, - {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, - {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, + {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"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}, + {"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}, + {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {"__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}, + {"_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}, #endif @@ -15044,23 +15426,19 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, + {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif -#if CYTHON_USE_TYPE_SPECS - {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, + {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API + {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else -#if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, -#endif -#endif + {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API + {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, + {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} @@ -15068,19 +15446,19 @@ static PyMemberDef __pyx_CyFunction_members[] = { static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { + PyObject *result = NULL; CYTHON_UNUSED_VAR(args); -#if PY_MAJOR_VERSION >= 3 + __Pyx_BEGIN_CRITICAL_SECTION(m); Py_INCREF(m->func_qualname); - return m->func_qualname; -#else - return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); -#endif + result = m->func_qualname; + __Pyx_END_CRITICAL_SECTION(); + return result; } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) @@ -15122,8 +15500,6 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef * Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; - op->defaults_pyobjects = 0; - op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; @@ -15185,14 +15561,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_XDECREF(pydefaults[i]); - PyObject_Free(m->defaults); - m->defaults = NULL; - } + Py_CLEAR(m->defaults); return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) @@ -15209,6 +15578,10 @@ static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { + { + int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg); + if (e) return e; + } Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); @@ -15216,40 +15589,33 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); - Py_VISIT(m->func_name); - Py_VISIT(m->func_qualname); + __Pyx_VISIT_CONST(m->func_name); + __Pyx_VISIT_CONST(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); - Py_VISIT(m->func_code); + __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_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_VISIT(pydefaults[i]); - } + Py_VISIT(m->defaults); return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { -#if PY_MAJOR_VERSION >= 3 - return PyUnicode_FromFormat("", + PyObject *repr; + __Pyx_BEGIN_CRITICAL_SECTION(op); + repr = PyUnicode_FromFormat("", op->func_qualname, (void *)op); -#else - return PyString_FromFormat("", - PyString_AsString(op->func_qualname), (void *)op); -#endif + __Pyx_END_CRITICAL_SECTION(); + return repr; } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; - PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); @@ -15268,10 +15634,10 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: - return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); @@ -15279,24 +15645,15 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif if (likely(size == 0)) return (*meth)(self, NULL); -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes no arguments", size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); @@ -15315,18 +15672,9 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif return result; } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes exactly one argument", size); return NULL; } break; @@ -15334,16 +15682,8 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", - py_name); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", - f->m_ml->ml_name); -#endif + __Pyx_CyFunction_raise_type_error( + (__pyx_CyFunctionObject*)func, "takes no keyword arguments"); return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { @@ -15360,10 +15700,10 @@ 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 +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; @@ -15375,11 +15715,11 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P Py_ssize_t argc; PyObject *new_args; PyObject *self; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); - if (unlikely(!argc) < 0) return NULL; + if (unlikely(argc < 0)) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) @@ -15387,14 +15727,9 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); -#if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); -#else - PyErr_SetString(PyExc_TypeError, - "unbound method needs an argument"); -#endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); @@ -15404,21 +15739,21 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P } return result; } -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { - PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", - ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + __Pyx_CyFunction_raise_type_error( + cyfunc, "needs an argument"); return -1; } ret = 1; } - if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) { + __Pyx_CyFunction_raise_type_error( + cyfunc, "takes no keyword arguments"); return -1; } return ret; @@ -15426,13 +15761,18 @@ 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; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #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); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; @@ -15440,29 +15780,38 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } if (unlikely(nargs != 0)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes no arguments", nargs); return NULL; } - return def->ml_meth(self, NULL); + return meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #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); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; @@ -15470,29 +15819,38 @@ static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } if (unlikely(nargs != 1)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes exactly one argument", nargs); return NULL; } - return def->ml_meth(self, args[0]); + return meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #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); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; @@ -15500,17 +15858,21 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } - return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); + return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; @@ -15518,6 +15880,12 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; @@ -15525,15 +15893,19 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } - return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); + return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, (size_t)nargs, kwnames); } #endif -#if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, @@ -15553,326 +15925,181 @@ static PyType_Spec __pyx_CyFunctionType_spec = { #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif -#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) +#if CYTHON_METH_FASTCALL +#if defined(Py_TPFLAGS_HAVE_VECTORCALL) + Py_TPFLAGS_HAVE_VECTORCALL | +#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, - __pyx_CyFunctionType_slots -}; -#else -static PyTypeObject __pyx_CyFunctionType_type = { - PyVarObject_HEAD_INIT(0, 0) - __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", - sizeof(__pyx_CyFunctionObject), - 0, - (destructor) __Pyx_CyFunction_dealloc, -#if !CYTHON_METH_FASTCALL - 0, -#elif CYTHON_BACKPORT_VECTORCALL - (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), -#else - offsetof(PyCFunctionObject, vectorcall), -#endif - 0, - 0, -#if PY_MAJOR_VERSION < 3 - 0, -#else - 0, -#endif - (reprfunc) __Pyx_CyFunction_repr, - 0, - 0, - 0, - 0, - __Pyx_CyFunction_CallAsMethod, - 0, - 0, - 0, - 0, -#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR - Py_TPFLAGS_METHOD_DESCRIPTOR | -#endif -#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL - _Py_TPFLAGS_HAVE_VECTORCALL | +#endif // CYTHON_METH_FASTCALL +#if PY_VERSION_HEX >= 0x030A0000 + Py_TPFLAGS_IMMUTABLETYPE | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, - 0, - (traverseproc) __Pyx_CyFunction_traverse, - (inquiry) __Pyx_CyFunction_clear, - 0, -#if PY_VERSION_HEX < 0x030500A0 - offsetof(__pyx_CyFunctionObject, func_weakreflist), -#else - offsetof(PyCFunctionObject, m_weakreflist), -#endif - 0, - 0, - __pyx_CyFunction_methods, - __pyx_CyFunction_members, - __pyx_CyFunction_getsets, - 0, - 0, - __Pyx_PyMethod_New, - 0, - offsetof(__pyx_CyFunctionObject, func_dict), - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, -#if PY_VERSION_HEX >= 0x030400a1 - 0, -#endif -#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, -#endif -#if __PYX_NEED_TP_PRINT_SLOT - 0, -#endif -#if PY_VERSION_HEX >= 0x030C0000 - 0, -#endif -#if PY_VERSION_HEX >= 0x030d00A4 - 0, -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, -#endif + __pyx_CyFunctionType_slots }; -#endif static int __pyx_CyFunction_init(PyObject *module) { -#if CYTHON_USE_TYPE_SPECS - __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); -#else - CYTHON_UNUSED_VAR(module); - __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); -#endif - if (unlikely(__pyx_CyFunctionType == NULL)) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); + mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); + if (unlikely(mstate->__pyx_CyFunctionType == NULL)) { return -1; } return 0; } -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults = PyObject_Malloc(size); - if (unlikely(!m->defaults)) - return PyErr_NoMemory(); - memset(m->defaults, 0, size); - m->defaults_pyobjects = pyobjects; - m->defaults_size = size; - return m->defaults; -} -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults_tuple = tuple; - Py_INCREF(tuple); -} -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults_kwdict = dict; - Py_INCREF(dict); -} -static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->func_annotations = dict; - Py_INCREF(dict); -} - -/* CythonFunction */ -static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, - PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { - PyObject *op = __Pyx_CyFunction_Init( - PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), - ml, flags, qualname, closure, module, globals, code - ); - if (likely(op)) { - PyObject_GC_Track(op); - } - return op; -} - -/* RaiseUnexpectedTypeError */ -static int -__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) -{ - __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, - expected, obj_type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return 0; -} - -/* RaiseNoneIterError */ -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); -} - -/* UnpackUnboundCMethod */ -static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { - PyObject *result; - PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); - if (unlikely(!selfless_args)) return NULL; - result = PyObject_Call(method, selfless_args, kwargs); - Py_DECREF(selfless_args); - return result; -} -static PyMethodDef __Pyx_UnboundCMethod_Def = { - "CythonUnboundCMethod", - __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), - METH_VARARGS | METH_KEYWORDS, - NULL -}; -static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { - PyObject *method; - method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); - if (unlikely(!method)) - return -1; - target->method = method; -#if CYTHON_COMPILING_IN_CPYTHON - #if PY_MAJOR_VERSION >= 3 - if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) - #else - if (likely(!__Pyx_CyOrPyCFunction_Check(method))) - #endif - { - PyMethodDescrObject *descr = (PyMethodDescrObject*) method; - target->func = descr->d_method->ml_meth; - target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); - } else -#endif -#if CYTHON_COMPILING_IN_PYPY -#else - if (PyCFunction_Check(method)) -#endif - { - PyObject *self; - int self_found; -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - self = PyObject_GetAttrString(method, "__self__"); - if (!self) { - PyErr_Clear(); - } -#else - self = PyCFunction_GET_SELF(method); -#endif - self_found = (self && self != Py_None); -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - Py_XDECREF(self); -#endif - if (self_found) { - PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); - if (unlikely(!unbound_method)) return -1; - Py_DECREF(method); - target->method = unbound_method; - } + m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type); + if (unlikely(!m->defaults)) + return NULL; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* CythonFunction */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyObject *op = __Pyx_CyFunction_Init( + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_mstate_global->__pyx_CyFunctionType), + ml, flags, qualname, closure, module, globals, code + ); + if (likely(op)) { + PyObject_GC_Track(op); } + return op; +} + +/* RaiseUnexpectedTypeError */ +static int +__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) +{ + __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, + expected, obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); return 0; } +/* RaiseNoneIterError */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +/* PyObjectCall2Args */ +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); +} + /* CallUnboundCMethod1 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { - if (likely(cfunc->func)) { + int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); + if (likely(was_initialized == 2 && cfunc->func)) { int flag = cfunc->flag; if (flag == METH_O) { - return (*(cfunc->func))(self, arg); - } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) { - #if PY_VERSION_HEX >= 0x030700A0 - return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); - #else - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); - #endif - } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) { - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + return __Pyx_CallCFunction(cfunc, self, arg); + } else if (flag == METH_FASTCALL) { + return __Pyx_CallCFunctionFast(cfunc, self, &arg, 1); + } else if (flag == (METH_FASTCALL | METH_KEYWORDS)) { + return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, &arg, 1, NULL); } } - return __Pyx__CallUnboundCMethod1(cfunc, self, arg); +#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__CallUnboundCMethod1(&tmp_cfunc, self, arg); + } +#endif + PyObject* result = __Pyx__CallUnboundCMethod1(cfunc, self, arg); + __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); + return result; } #endif static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ - PyObject *args, *result = NULL; + PyObject *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { - args = PyTuple_New(1); - if (unlikely(!args)) goto bad; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); if (cfunc->flag & METH_KEYWORDS) - result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); else - result = (*cfunc->func)(self, args); - } else { - args = PyTuple_New(2); - if (unlikely(!args)) goto bad; - Py_INCREF(self); - PyTuple_SET_ITEM(args, 0, self); - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 1, arg); - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); - } -#else - args = PyTuple_Pack(2, self, arg); - if (unlikely(!args)) goto bad; - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + result = __Pyx_CallCFunction(cfunc, self, args); + Py_DECREF(args); + } else #endif -bad: - Py_XDECREF(args); + { + result = __Pyx_PyObject_Call2Args(cfunc->method, self, arg); + } return result; } /* JoinPyUnicode */ -static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, +static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char) { #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyObject *result_uval; int result_ukind, kind_shift; Py_ssize_t i, char_pos; void *result_udata; - CYTHON_MAYBE_UNUSED_VAR(max_char); -#if CYTHON_PEP393_ENABLED + if (max_char > 1114111) max_char = 1114111; result_uval = PyUnicode_New(result_ulength, max_char); if (unlikely(!result_uval)) return NULL; result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; result_udata = PyUnicode_DATA(result_uval); -#else - result_uval = PyUnicode_FromUnicode(NULL, result_ulength); - if (unlikely(!result_uval)) return NULL; - result_ukind = sizeof(Py_UNICODE); - kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1; - result_udata = PyUnicode_AS_UNICODE(result_uval); -#endif assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); + if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0)) + goto overflow; char_pos = 0; for (i=0; i < value_count; i++) { int ukind; Py_ssize_t ulength; void *udata; - PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); - if (unlikely(__Pyx_PyUnicode_READY(uval))) + PyObject *uval = values[i]; + #if !CYTHON_COMPILING_IN_LIMITED_API + if (__Pyx_PyUnicode_READY(uval) == (-1)) goto bad; + #endif ulength = __Pyx_PyUnicode_GET_LENGTH(uval); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(ulength < 0)) goto bad; + #endif if (unlikely(!ulength)) continue; if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) goto overflow; ukind = __Pyx_PyUnicode_KIND(uval); udata = __Pyx_PyUnicode_DATA(uval); - if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { + if (ukind == result_ukind) { memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); } else { #if PY_VERSION_HEX >= 0x030d0000 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; - #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) + #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters) _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); #else Py_ssize_t j; @@ -15891,10 +16118,20 @@ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_co Py_DECREF(result_uval); return NULL; #else + Py_ssize_t i; + PyObject *result = NULL; + PyObject *value_tuple = PyTuple_New(value_count); + if (unlikely(!value_tuple)) return NULL; CYTHON_UNUSED_VAR(max_char); CYTHON_UNUSED_VAR(result_ulength); - CYTHON_UNUSED_VAR(value_count); - return PyUnicode_Join(__pyx_empty_unicode, value_tuple); + for (i=0; i__pyx_empty_unicode, value_tuple); +bad: + Py_DECREF(value_tuple); + return result; #endif } @@ -15926,11 +16163,7 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS -#if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) -#else - if (likely(PyString_Check(n))) -#endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); @@ -15938,7 +16171,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { /* Globals */ static PyObject* __Pyx_Globals(void) { - return __Pyx_NewRef(__pyx_d); + return __Pyx_NewRef(__pyx_mstate_global->__pyx_d); } /* PyObjectCallNoArg */ @@ -15970,18 +16203,12 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) -#elif PY_MAJOR_VERSION >= 3 +#else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif -#else - #ifdef __Pyx_CyFunction_USED - if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) - #else - if (likely(PyFunction_Check(descr))) - #endif #endif { meth_found = 1; @@ -16019,15 +16246,10 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me *method = descr; return 0; } - type_name = __Pyx_PyType_GetName(tp); + type_name = __Pyx_PyType_GetFullyQualifiedName(tp); PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(name)); -#endif __Pyx_DECREF_TypeName(type_name); return 0; #else @@ -16068,14 +16290,15 @@ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name #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; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); - if (n < 0) return -1; + if (unlikely(n < 0)) return -1; #endif for (i = 1; i < n; i++) { + PyTypeObject *b; #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; @@ -16084,23 +16307,11 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; -#endif - PyTypeObject *b; -#if PY_MAJOR_VERSION < 3 - if (PyClass_Check(b0)) - { - PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", - PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); -#if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); -#endif - return -1; - } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { - __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); @@ -16112,7 +16323,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; -#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY +#if CYTHON_USE_TYPE_SLOTS b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); @@ -16123,7 +16334,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #endif if (b_dictoffset) { { - __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " @@ -16132,7 +16343,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs type_name, b_name); __Pyx_DECREF_TypeName(b_name); } -#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) +#if !CYTHON_USE_TYPE_SLOTS dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS @@ -16150,8 +16361,18 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #endif /* PyType_Ready */ +CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) { + while (t) { + PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); + if (bases) { + return 1; + } + t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*); + } + return 0; +} static int __Pyx_PyType_Ready(PyTypeObject *t) { -#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) +#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; @@ -16159,10 +16380,13 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { return PyType_Ready(t); #else int r; + if (!__Pyx_PyType_HasMultipleInheritance(t)) { + return PyType_Ready(t); + } PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; -#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) +#if !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 @@ -16171,12 +16395,13 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { #else PyObject *ret, *py_status; PyObject *gc = NULL; - #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) - gc = PyImport_GetModule(__pyx_kp_u_gc); + #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\ + !CYTHON_COMPILING_IN_GRAAL + gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc); #endif - if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); + if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc); if (unlikely(!gc)) return -1; - py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); + py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; @@ -16184,7 +16409,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; @@ -16203,7 +16428,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); -#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) +#if !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) @@ -16212,7 +16437,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); @@ -16231,114 +16456,51 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { #endif } -/* PyObject_GenericGetAttrNoDict */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { - __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); - PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", - type_name, attr_name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(attr_name)); -#endif - __Pyx_DECREF_TypeName(type_name); - return NULL; -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { - PyObject *descr; - PyTypeObject *tp = Py_TYPE(obj); - if (unlikely(!PyString_Check(attr_name))) { - return PyObject_GenericGetAttr(obj, attr_name); - } - assert(!tp->tp_dictoffset); - descr = _PyType_Lookup(tp, attr_name); - if (unlikely(!descr)) { - return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); - } - Py_INCREF(descr); - #if PY_MAJOR_VERSION < 3 - if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) - #endif - { - descrgetfunc f = Py_TYPE(descr)->tp_descr_get; - if (unlikely(f)) { - PyObject *res = f(descr, obj, (PyObject *)tp); - Py_DECREF(descr); - return res; - } - } - return descr; -} -#endif - /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; - #if PY_MAJOR_VERSION < 3 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (unlikely(!py_import)) - goto bad; - if (!from_list) { - empty_list = PyList_New(0); - if (unlikely(!empty_list)) - goto bad; - from_list = empty_list; - } - #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, 1); - if (unlikely(!module)) { - if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_MAJOR_VERSION < 3 - PyObject *py_level = PyInt_FromLong(level); - if (unlikely(!py_level)) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); - Py_DECREF(py_level); - #else + if (level == -1) { + const char* package_sep = strchr(__Pyx_MODULE_NAME, '.'); + if (package_sep != (0)) { module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, level); - #endif + name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, 1); + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } } + level = 0; + } + if (!module) { + module = PyImport_ImportModuleLevelObject( + name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, level); } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_import); - #endif return module; } /* ImportDottedModule */ -#if PY_MAJOR_VERSION >= 3 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 (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { +#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); @@ -16350,28 +16512,18 @@ static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( -#if PY_MAJOR_VERSION < 3 - PyExc_ImportError, - "No module named '%s'", PyString_AS_STRING(partial_name)); -#else -#if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, -#else - PyExc_ImportError, -#endif "No module named '%U'", partial_name); -#endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } -#endif -#if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; -#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) +#if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ + CYTHON_COMPILING_IN_GRAAL PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; @@ -16382,17 +16534,21 @@ static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { #endif return imported_module; } -#endif -#if PY_MAJOR_VERSION >= 3 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 = PySequence_ITEM(parts_tuple, i); + 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) @@ -16406,20 +16562,7 @@ static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject * } return module; } -#endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if PY_MAJOR_VERSION < 3 - PyObject *module, *from_list, *star = __pyx_n_s__14; - CYTHON_UNUSED_VAR(parts_tuple); - from_list = PyList_New(1); - if (unlikely(!from_list)) - return NULL; - Py_INCREF(star); - PyList_SET_ITEM(from_list, 0, star); - module = __Pyx_Import(name, from_list, 0); - Py_DECREF(from_list); - return module; -#else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) @@ -16431,15 +16574,14 @@ static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); -#endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 +#if CYTHON_COMPILING_IN_CPYTHON PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { - PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); + PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_mstate_global->__pyx_n_u_spec); if (likely(spec)) { - PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); + 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; @@ -16459,6 +16601,25 @@ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) 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_kp_u__21); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } - #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ + CYTHON_COMPILING_IN_GRAAL { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) @@ -16492,18 +16654,13 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { Py_XDECREF(module_name); } if (unlikely(!value)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif + PyErr_Format(PyExc_ImportError, "cannot import name %S", name); } return value; } /* CLineInTraceback */ -#ifndef CYTHON_CLINE_IN_TRACEBACK +#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; @@ -16511,22 +16668,26 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); - if (unlikely(!__pyx_cython_runtime)) { + 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_cython_runtime); + cython_runtime_dict = _PyObject_GetDictPtr(__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_n_s_cline_in_traceback)) + __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_cython_runtime, __pyx_n_s_cline_in_traceback); + 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(); @@ -16535,18 +16696,18 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { } if (!use_cline) { c_line = 0; - (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + (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)) { c_line = 0; } + Py_XDECREF(use_cline); __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ -#if !CYTHON_COMPILING_IN_LIMITED_API 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) { @@ -16568,64 +16729,103 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co return mid + 1; } } -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; +static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) { + __Pyx_CachedCodeObjectType* code_object; int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + if (unlikely(!code_line) || unlikely(!code_cache->entries)) { return NULL; } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); + if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) { return NULL; } - code_object = __pyx_code_cache.entries[pos].code_object; + code_object = code_cache->entries[pos].code_object; Py_INCREF(code_object); return code_object; } -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) { +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS + (void)__pyx__find_code_object; + return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss. +#else + struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count); + if (old_count < 0) { + __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); + return NULL; + } +#endif + __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line); +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); +#endif + return result; +#endif +} +static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object) +{ int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + __Pyx_CodeObjectCacheEntry* entries = code_cache->entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; + code_cache->entries = entries; + code_cache->max_count = 64; + code_cache->count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; + pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); + if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) { + __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object; entries[pos].code_object = code_object; + Py_INCREF(code_object); Py_DECREF(tmp); return; } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; + if (code_cache->count == code_cache->max_count) { + int new_max = code_cache->max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; + code_cache->entries = entries; + code_cache->max_count = new_max; } - for (i=__pyx_code_cache.count; i>pos; i--) { + for (i=code_cache->count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; - __pyx_code_cache.count++; + code_cache->count++; Py_INCREF(code_object); } +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) { +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS + (void)__pyx__insert_code_object; + return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail. +#else + struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_nonatomic_int_type expected = 0; + if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) { + return; + } +#endif + __pyx__insert_code_object(code_cache, code_line, code_object); +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN); #endif +#endif +} /* AddTraceback */ #include "compile.h" @@ -16645,35 +16845,12 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { - PyObject *result; - result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); - #if __PYX_LIMITED_VERSION_HEX < 0x030780000 - { - PyObject *compiled = NULL, *result = NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; - compiled = Py_CompileString( - "out = type(code)(\n" - " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" - " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" - " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" - " code.co_lnotab)\n", "", Py_file_input); - if (!compiled) return NULL; - result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); - Py_DECREF(compiled); - if (!result) PyErr_Print(); - Py_DECREF(result); - result = PyDict_GetItemString(scratch_dict, "out"); - if (result) Py_INCREF(result); - return result; - } - #else return NULL; - #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { @@ -16686,20 +16863,26 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); - code_object = Py_CompileString("_getframe()", filename, Py_eval_input); - 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 (unlikely(!py_funcname)) goto bad; - dict = PyDict_New(); - if (unlikely(!dict)) goto bad; - { - PyObject *old_code_object = code_object; - code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); - Py_DECREF(old_code_object); + code_object = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!code_object) { + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + 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 (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, code_object); + } else { + dict = PyDict_New(); } - if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; @@ -16725,58 +16908,17 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; - #if PY_MAJOR_VERSION < 3 - PyObject *py_srcfile = NULL; - py_srcfile = PyString_FromString(filename); - if (!py_srcfile) goto bad; - #endif if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - if (!py_funcname) goto bad; - #endif } - #if PY_MAJOR_VERSION < 3 - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - #else py_code = PyCode_NewEmpty(filename, funcname, py_line); - #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_srcfile); - #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -16807,7 +16949,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ + __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; @@ -16819,8 +16961,40 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } #endif +/* PyObjectVectorCallKwBuilder */ +#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); + args[n] = value; + return 0; +} +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_VectorcallBuilder_AddArgStr; + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n); +} +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + PyObject *pyKey = PyUnicode_FromString(key); + if (!pyKey) return -1; + return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n); +} +#else // CYTHON_VECTORCALL +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) { + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return PyDict_SetItem(builder, key, value); +} +#endif + /* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -16832,17 +17006,17 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG +#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); @@ -16863,25 +17037,25 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + PyObject *from_bytes, *result = NULL, *kwds = NULL; + PyObject *py_bytes = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - if (!is_unsigned) { - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + { + PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; + if (!is_unsigned) { + kwds = __Pyx_MakeVectorcallBuilderKwds(1); + if (!kwds) goto limited_bad; + if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; + } + result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } - result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); - Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); @@ -16891,18 +17065,41 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { } /* FormatTypeName */ -#if CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 static __Pyx_TypeName -__Pyx_PyType_GetName(PyTypeObject* tp) +__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp) { - PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_n_s_name); - if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { - PyErr_Clear(); - Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__42); + PyObject *module = NULL, *name = NULL, *result = NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030b0000 + name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_mstate_global->__pyx_n_u_qualname); + #else + name = PyType_GetQualName(tp); + #endif + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad; + module = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_mstate_global->__pyx_n_u_module); + if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad; + if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) { + result = name; + name = NULL; + goto done; } - return name; + result = PyUnicode_FromFormat("%U.%U", module, name); + if (unlikely(result == NULL)) goto bad; + done: + Py_XDECREF(name); + Py_XDECREF(module); + return result; + bad: + PyErr_Clear(); + if (name) { + result = name; + name = NULL; + } else { + result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__22); + } + goto done; } #endif @@ -16929,7 +17126,7 @@ __Pyx_PyType_GetName(PyTypeObject* tp) } /* CIntFromPy */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -16939,24 +17136,11 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(long) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + val = __Pyx_PyLong_As_long(tmp); Py_DECREF(tmp); return val; } @@ -17196,7 +17380,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { } /* CIntFromPy */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -17206,24 +17390,11 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); + val = __Pyx_PyLong_As_int(tmp); Py_DECREF(tmp); return val; } @@ -17503,29 +17674,6 @@ static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } -#if PY_MAJOR_VERSION == 2 -static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { - PyObject *exception, *value, *tb; - int res; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&exception, &value, &tb); - res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - if (!res) { - res = PyObject_IsSubclass(err, exc_type2); - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - } - __Pyx_ErrRestore(exception, value, tb); - return res; -} -#else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); @@ -17533,21 +17681,15 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } -#endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; i__Pyx_GetBuiltinNext_LimitedAPI_cache)) + __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next); + return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache; +} +#endif +static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) { +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + PyObject *result; + PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI(); + if (unlikely(!next)) return NULL; + result = PyObject_CallFunctionObjArgs(next, iterator, NULL); + return result; +#else + (void)__Pyx_GetBuiltinName; // only for early limited API + iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator); + assert(iternext); + return iternext(iterator); +#endif } /* PyObjectCallMethod1 */ -#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) +#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); @@ -17647,7 +17806,7 @@ 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 >= 0x030C00A2 +#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; @@ -17666,7 +17825,62 @@ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name #endif } +/* ReturnWithStopIteration */ +static void __Pyx__ReturnWithStopIteration(PyObject* value, int async); +static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext) { + if (value == Py_None) { + if (async || !iternext) + PyErr_SetNone(async ? PyExc_StopAsyncIteration : PyExc_StopIteration); + return; + } + __Pyx__ReturnWithStopIteration(value, async); +} +static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) { +#if CYTHON_COMPILING_IN_CPYTHON + __Pyx_PyThreadState_declare +#endif + PyObject *exc; + PyObject *exc_type = async ? PyExc_StopAsyncIteration : PyExc_StopIteration; +#if CYTHON_COMPILING_IN_CPYTHON + if ((PY_VERSION_HEX >= (0x030C00A6)) || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) { + if (PY_VERSION_HEX >= (0x030e00A1)) { + exc = __Pyx_PyObject_CallOneArg(exc_type, value); + } else { + PyObject *args_tuple = PyTuple_New(1); + if (unlikely(!args_tuple)) return; + Py_INCREF(value); + PyTuple_SET_ITEM(args_tuple, 0, value); + exc = PyObject_Call(exc_type, args_tuple, NULL); + Py_DECREF(args_tuple); + } + if (unlikely(!exc)) return; + } else { + Py_INCREF(value); + exc = value; + } + #if CYTHON_FAST_THREAD_STATE + __Pyx_PyThreadState_assign + #if CYTHON_USE_EXC_INFO_STACK + if (!__pyx_tstate->exc_info->exc_value) + #else + if (!__pyx_tstate->exc_type) + #endif + { + Py_INCREF(exc_type); + __Pyx_ErrRestore(exc_type, exc, NULL); + return; + } + #endif +#else + exc = __Pyx_PyObject_CallOneArg(exc_type, value); + if (unlikely(!exc)) return; +#endif + PyErr_SetObject(exc_type, exc); + Py_DECREF(exc); +} + /* CoroutineBase */ +#if !CYTHON_COMPILING_IN_LIMITED_API #include #if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE @@ -17674,7 +17888,14 @@ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name #endif #include "internal/pycore_frame.h" #endif -#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +#endif // CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void +__Pyx_Coroutine_Undelegate(__pyx_CoroutineObject *gen) { +#if CYTHON_USE_AM_SEND + gen->yieldfrom_am_send = NULL; +#endif + Py_CLEAR(gen->yieldfrom); +} static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) { PyObject *et, *ev, *tb; PyObject *value = NULL; @@ -17692,20 +17913,35 @@ static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyO Py_INCREF(Py_None); value = Py_None; } -#if PY_VERSION_HEX >= 0x030300A0 else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) { + #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL + value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value); + if (unlikely(!value)) goto limited_api_failure; + #else value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); + #endif Py_DECREF(ev); } -#endif else if (unlikely(PyTuple_Check(ev))) { - if (PyTuple_GET_SIZE(ev) >= 1) { + Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(ev); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(tuple_size < 0)) { + Py_XDECREF(tb); + Py_DECREF(ev); + Py_DECREF(et); + return -1; + } + #endif + if (tuple_size >= 1) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS value = PyTuple_GET_ITEM(ev, 0); Py_INCREF(value); -#else +#elif CYTHON_ASSUME_SAFE_MACROS value = PySequence_ITEM(ev, 0); +#else + value = PySequence_GetItem(ev, 0); + if (!value) goto limited_api_failure; #endif } else { Py_INCREF(Py_None); @@ -17733,27 +17969,35 @@ static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyO } Py_XDECREF(tb); Py_DECREF(et); -#if PY_VERSION_HEX >= 0x030300A0 +#if CYTHON_COMPILING_IN_LIMITED_API + value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value); +#else value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); +#endif Py_DECREF(ev); -#else - { - PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); - Py_DECREF(ev); - if (likely(args)) { - value = PySequence_GetItem(args, 0); - Py_DECREF(args); - } - if (unlikely(!value)) { - __Pyx_ErrRestore(NULL, NULL, NULL); - Py_INCREF(Py_None); - value = Py_None; - } - } +#if CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!value)) return -1; #endif *pvalue = value; return 0; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL || !CYTHON_ASSUME_SAFE_MACROS + limited_api_failure: + Py_XDECREF(et); + Py_XDECREF(tb); + Py_XDECREF(ev); + return -1; +#endif +} +static CYTHON_INLINE +__Pyx_PySendResult __Pyx_Coroutine_status_from_result(PyObject **retval) { + if (*retval) { + return PYGEN_NEXT; + } else if (likely(__Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, retval) == 0)) { + return PYGEN_RETURN; + } else { + return PYGEN_ERROR; + } } static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { @@ -17790,26 +18034,7 @@ static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) { } PyErr_SetString(PyExc_ValueError, msg); } -#define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) -static void __Pyx__Coroutine_NotStartedError(PyObject *gen) { - const char *msg; - CYTHON_MAYBE_UNUSED_VAR(gen); - if ((0)) { - #ifdef __Pyx_Coroutine_USED - } else if (__Pyx_Coroutine_Check(gen)) { - msg = "can't send non-None value to a just-started coroutine"; - #endif - #ifdef __Pyx_AsyncGen_USED - } else if (__Pyx_AsyncGen_CheckExact(gen)) { - msg = "can't send non-None value to a just-started async generator"; - #endif - } else { - msg = "can't send non-None value to a just-started generator"; - } - PyErr_SetString(PyExc_TypeError, msg); -} -#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) -static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { +static void __Pyx_Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { CYTHON_MAYBE_UNUSED_VAR(gen); CYTHON_MAYBE_UNUSED_VAR(closing); #ifdef __Pyx_Coroutine_USED @@ -17820,26 +18045,22 @@ static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *val if (value) { #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) - PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); + PyErr_SetNone(PyExc_StopAsyncIteration); else #endif PyErr_SetNone(PyExc_StopIteration); } } static -PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { +__Pyx_PySendResult __Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, PyObject **result, int closing) { __Pyx_PyThreadState_declare PyThreadState *tstate; __Pyx_ExcInfoStruct *exc_state; PyObject *retval; - assert(!self->is_running); - if (unlikely(self->resume_label == 0)) { - if (unlikely(value && value != Py_None)) { - return __Pyx_Coroutine_NotStartedError((PyObject*)self); - } - } + assert(__Pyx_Coroutine_get_is_running(self)); // Callers should ensure is_running if (unlikely(self->resume_label == -1)) { - return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + return PYGEN_ERROR; } #if CYTHON_FAST_THREAD_STATE __Pyx_PyThreadState_assign @@ -17849,7 +18070,7 @@ PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, i #endif exc_state = &self->gi_exc_state; if (exc_state->exc_value) { - #if CYTHON_COMPILING_IN_PYPY + #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY #else PyObject *exc_tb; #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON @@ -17886,19 +18107,21 @@ PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, i __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); } #endif - self->is_running = 1; retval = self->body(self, tstate, value); - self->is_running = 0; #if CYTHON_USE_EXC_INFO_STACK exc_state = &self->gi_exc_state; tstate->exc_info = exc_state->previous_item; exc_state->previous_item = NULL; __Pyx_Coroutine_ResetFrameBackpointer(exc_state); #endif - return retval; + *result = retval; + if (self->resume_label == -1) { + return likely(retval) ? PYGEN_RETURN : PYGEN_ERROR; + } + return PYGEN_NEXT; } static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { -#if CYTHON_COMPILING_IN_PYPY +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(exc_state); #else PyObject *exc_tb; @@ -17918,24 +18141,22 @@ static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStr } #endif } -static CYTHON_INLINE -PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) { +#define __Pyx_Coroutine_MethodReturnFromResult(gen, result, retval, iternext)\ + ((result) == PYGEN_NEXT ? (retval) : __Pyx__Coroutine_MethodReturnFromResult(gen, result, retval, iternext)) +static PyObject * +__Pyx__Coroutine_MethodReturnFromResult(PyObject* gen, __Pyx_PySendResult result, PyObject *retval, int iternext) { CYTHON_MAYBE_UNUSED_VAR(gen); - if (unlikely(!retval)) { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - if (!__Pyx_PyErr_Occurred()) { - PyObject *exc = PyExc_StopIteration; - #ifdef __Pyx_AsyncGen_USED - if (__Pyx_AsyncGen_CheckExact(gen)) - exc = __Pyx_PyExc_StopAsyncIteration; - #endif - __Pyx_PyErr_SetNone(exc); - } + if (likely(result == PYGEN_RETURN)) { + int is_async = 0; + #ifdef __Pyx_AsyncGen_USED + is_async = __Pyx_AsyncGen_CheckExact(gen); + #endif + __Pyx_ReturnWithStopIteration(retval, is_async, iternext); + Py_XDECREF(retval); } - return retval; + return NULL; } -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) +#if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { #if PY_VERSION_HEX <= 0x030A00A1 @@ -17972,25 +18193,58 @@ PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { #endif } #endif -static CYTHON_INLINE -PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { - PyObject *ret; +static CYTHON_INLINE __Pyx_PySendResult +__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen, PyObject** retval) { + __Pyx_PySendResult result; PyObject *val = NULL; + assert(__Pyx_Coroutine_get_is_running(gen)); __Pyx_Coroutine_Undelegate(gen); __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); - ret = __Pyx_Coroutine_SendEx(gen, val, 0); + result = __Pyx_Coroutine_SendEx(gen, val, retval, 0); Py_XDECREF(val); - return ret; + return result; } +#if CYTHON_USE_AM_SEND +static __Pyx_PySendResult +__Pyx_Coroutine_SendToDelegate(__pyx_CoroutineObject *gen, __Pyx_pyiter_sendfunc gen_am_send, PyObject *value, PyObject **retval) { + PyObject *ret = NULL; + __Pyx_PySendResult delegate_result, result; + assert(__Pyx_Coroutine_get_is_running(gen)); + delegate_result = gen_am_send(gen->yieldfrom, value, &ret); + if (delegate_result == PYGEN_NEXT) { + assert (ret != NULL); + *retval = ret; + return PYGEN_NEXT; + } + assert (delegate_result != PYGEN_ERROR || ret == NULL); + __Pyx_Coroutine_Undelegate(gen); + result = __Pyx_Coroutine_SendEx(gen, ret, retval, 0); + Py_XDECREF(ret); + return result; +} +#endif static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { - PyObject *retval; + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_AmSend(self, value, &retval); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0); +} +static __Pyx_PySendResult +__Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval) { + __Pyx_PySendResult result; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) - return __Pyx_Coroutine_AlreadyRunningError(gen); - if (yf) { + if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { + *retval = __Pyx_Coroutine_AlreadyRunningError(gen); + return PYGEN_ERROR; + } + #if CYTHON_USE_AM_SEND + if (gen->yieldfrom_am_send) { + result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, value, retval); + } else + #endif + if (gen->yieldfrom) { + PyObject *yf = gen->yieldfrom; PyObject *ret; - gen->is_running = 1; + #if !CYTHON_USE_AM_SEND #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, value); @@ -18006,66 +18260,67 @@ static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { ret = __Pyx_async_gen_asend_send(yf, value); } else #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + #if CYTHON_COMPILING_IN_CPYTHON if (PyGen_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else - #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyCoro_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif + #endif { - if (value == Py_None) - ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + #if !CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x03080000 + if (value == Py_None && PyIter_Check(yf)) + ret = __Pyx_PyIter_Next_Plain(yf); else - ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); + #endif + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_mstate_global->__pyx_n_u_send, value); } - gen->is_running = 0; if (likely(ret)) { - return ret; + __Pyx_Coroutine_unset_is_running(gen); + *retval = ret; + return PYGEN_NEXT; } - retval = __Pyx_Coroutine_FinishDelegation(gen); + result = __Pyx_Coroutine_FinishDelegation(gen, retval); } else { - retval = __Pyx_Coroutine_SendEx(gen, value, 0); + result = __Pyx_Coroutine_SendEx(gen, value, retval, 0); } - return __Pyx_Coroutine_MethodReturn(self, retval); + __Pyx_Coroutine_unset_is_running(gen); + return result; } static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { + __Pyx_PySendResult result; PyObject *retval = NULL; - int err = 0; + CYTHON_UNUSED_VAR(gen); + assert(__Pyx_Coroutine_get_is_running(gen)); #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; + result = __Pyx_Coroutine_Close(yf, &retval); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; + result = __Pyx_Coroutine_Close(yf, &retval); } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { - retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); - if (!retval) - return -1; + result = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf); } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { retval = __Pyx_async_gen_asend_close(yf, NULL); + result = PYGEN_RETURN; } else if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { retval = __Pyx_async_gen_athrow_close(yf, NULL); + result = PYGEN_RETURN; } else #endif { PyObject *meth; - gen->is_running = 1; - meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close); + result = PYGEN_RETURN; + meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_close); if (unlikely(!meth)) { if (unlikely(PyErr_Occurred())) { PyErr_WriteUnraisable(yf); @@ -18073,57 +18328,77 @@ static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { } else { retval = __Pyx_PyObject_CallNoArg(meth); Py_DECREF(meth); - if (unlikely(!retval)) - err = -1; + if (unlikely(!retval)) { + result = PYGEN_ERROR; + } } - gen->is_running = 0; } Py_XDECREF(retval); - return err; + return result == PYGEN_ERROR ? -1 : 0; } static PyObject *__Pyx_Generator_Next(PyObject *self) { + __Pyx_PySendResult result; + PyObject *retval = NULL; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) + if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { return __Pyx_Coroutine_AlreadyRunningError(gen); - if (yf) { + } + #if CYTHON_USE_AM_SEND + if (gen->yieldfrom_am_send) { + result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, Py_None, &retval); + } else + #endif + if (gen->yieldfrom) { + PyObject *yf = gen->yieldfrom; PyObject *ret; - gen->is_running = 1; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Generator_Next(yf); } else #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) - if (PyGen_CheckExact(yf)) { - ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); - } else - #endif #ifdef __Pyx_Coroutine_USED - if (__Pyx_Coroutine_Check(yf)) { + if (__Pyx_Coroutine_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, Py_None); } else #endif - ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); - gen->is_running = 0; + #if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX < 0x030A00A3 || !CYTHON_USE_AM_SEND) + if (PyGen_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); + } else + #endif + ret = __Pyx_PyIter_Next_Plain(yf); if (likely(ret)) { + __Pyx_Coroutine_unset_is_running(gen); return ret; } - return __Pyx_Coroutine_FinishDelegation(gen); + result = __Pyx_Coroutine_FinishDelegation(gen, &retval); + } else { + result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0); } - return __Pyx_Coroutine_SendEx(gen, Py_None, 0); + __Pyx_Coroutine_unset_is_running(gen); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 1); } static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) { + PyObject *retval = NULL; + __Pyx_PySendResult result; CYTHON_UNUSED_VAR(arg); - return __Pyx_Coroutine_Close(self); + result = __Pyx_Coroutine_Close(self, &retval); + if (unlikely(result == PYGEN_ERROR)) + return NULL; + Py_XDECREF(retval); + Py_RETURN_NONE; } -static PyObject *__Pyx_Coroutine_Close(PyObject *self) { +static __Pyx_PySendResult +__Pyx_Coroutine_Close(PyObject *self, PyObject **retval) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject *retval, *raised_exception; - PyObject *yf = gen->yieldfrom; + __Pyx_PySendResult result; + PyObject *yf; int err = 0; - if (unlikely(gen->is_running)) - return __Pyx_Coroutine_AlreadyRunningError(gen); + if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { + *retval = __Pyx_Coroutine_AlreadyRunningError(gen); + return PYGEN_ERROR; + } + yf = gen->yieldfrom; if (yf) { Py_INCREF(yf); err = __Pyx_Coroutine_CloseIter(gen, yf); @@ -18132,10 +18407,25 @@ static PyObject *__Pyx_Coroutine_Close(PyObject *self) { } if (err == 0) PyErr_SetNone(PyExc_GeneratorExit); - retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); - if (unlikely(retval)) { + result = __Pyx_Coroutine_SendEx(gen, NULL, retval, 1); + if (result == PYGEN_ERROR) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_Coroutine_unset_is_running(gen); + if (!__Pyx_PyErr_Occurred()) { + return PYGEN_RETURN; + } else if (likely(__Pyx_PyErr_ExceptionMatches2(PyExc_GeneratorExit, PyExc_StopIteration))) { + __Pyx_PyErr_Clear(); + return PYGEN_RETURN; + } + return PYGEN_ERROR; + } else if (likely(result == PYGEN_RETURN && *retval == Py_None)) { + __Pyx_Coroutine_unset_is_running(gen); + return PYGEN_RETURN; + } else { const char *msg; - Py_DECREF(retval); + Py_DECREF(*retval); + *retval = NULL; if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check(self)) { @@ -18143,33 +18433,25 @@ static PyObject *__Pyx_Coroutine_Close(PyObject *self) { #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(self)) { -#if PY_VERSION_HEX < 0x03060000 - msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; -#else msg = "async generator ignored GeneratorExit"; -#endif #endif } else { msg = "generator ignored GeneratorExit"; } PyErr_SetString(PyExc_RuntimeError, msg); - return NULL; - } - raised_exception = PyErr_Occurred(); - if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { - if (raised_exception) PyErr_Clear(); - Py_INCREF(Py_None); - return Py_None; + __Pyx_Coroutine_unset_is_running(gen); + return PYGEN_ERROR; } - return NULL; } static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, PyObject *args, int close_on_genexit) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) + PyObject *yf; + if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) return __Pyx_Coroutine_AlreadyRunningError(gen); + yf = gen->yieldfrom; if (yf) { + __Pyx_PySendResult result; PyObject *ret; Py_INCREF(yf); if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { @@ -18177,10 +18459,9 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject Py_DECREF(yf); __Pyx_Coroutine_Undelegate(gen); if (err < 0) - return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); + goto propagate_exception; goto throw_here; } - gen->is_running = 1; if (0 #ifdef __Pyx_Generator_USED || __Pyx_Generator_CheckExact(yf) @@ -18195,15 +18476,14 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); #endif } else { - PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw); + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_throw); if (unlikely(!meth)) { Py_DECREF(yf); if (unlikely(PyErr_Occurred())) { - gen->is_running = 0; + __Pyx_Coroutine_unset_is_running(gen); return NULL; } __Pyx_Coroutine_Undelegate(gen); - gen->is_running = 0; goto throw_here; } if (likely(args)) { @@ -18214,22 +18494,30 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject } Py_DECREF(meth); } - gen->is_running = 0; Py_DECREF(yf); - if (!ret) { - ret = __Pyx_Coroutine_FinishDelegation(gen); + if (ret) { + __Pyx_Coroutine_unset_is_running(gen); + return ret; } - return __Pyx_Coroutine_MethodReturn(self, ret); + result = __Pyx_Coroutine_FinishDelegation(gen, &ret); + __Pyx_Coroutine_unset_is_running(gen); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, ret, 0); } throw_here: __Pyx_Raise(typ, val, tb, NULL); - return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); +propagate_exception: + { + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, NULL, &retval, 0); + __Pyx_Coroutine_unset_is_running(gen); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0); + } } static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { PyObject *typ; PyObject *val = NULL; PyObject *tb = NULL; - if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))) + if (unlikely(!PyArg_UnpackTuple(args, "throw", 1, 3, &typ, &val, &tb))) return NULL; return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); } @@ -18244,6 +18532,10 @@ static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct * return 0; } static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { + { + int e = __Pyx_call_type_traverse((PyObject*)gen, 1, visit, arg); + if (e) return e; + } Py_VISIT(gen->closure); Py_VISIT(gen->classobj); Py_VISIT(gen->yieldfrom); @@ -18253,7 +18545,7 @@ static int __Pyx_Coroutine_clear(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; Py_CLEAR(gen->closure); Py_CLEAR(gen->classobj); - Py_CLEAR(gen->yieldfrom); + __Pyx_Coroutine_Undelegate(gen); __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { @@ -18274,10 +18566,13 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) { PyObject_ClearWeakRefs(self); if (gen->resume_label >= 0) { PyObject_GC_Track(self); -#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE +#if CYTHON_USE_TP_FINALIZE if (unlikely(PyObject_CallFinalizerFromDealloc(self))) #else - Py_TYPE(gen)->tp_del(self); + { + destructor del = __Pyx_PyObject_GetSlot(gen, tp_del, destructor); + if (del) del(self); + } if (unlikely(Py_REFCNT(self) > 0)) #endif { @@ -18296,6 +18591,7 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) { __Pyx_Coroutine_clear(self); __Pyx_PyHeapTypeObject_GC_Del(gen); } +#if CYTHON_USE_TP_FINALIZE static void __Pyx_Coroutine_del(PyObject *self) { PyObject *error_type, *error_value, *error_traceback; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; @@ -18303,10 +18599,6 @@ static void __Pyx_Coroutine_del(PyObject *self) { if (gen->resume_label < 0) { return; } -#if !CYTHON_USE_TP_FINALIZE - assert(self->ob_refcnt == 0); - __Pyx_SET_REFCNT(self, 1); -#endif __Pyx_PyThreadState_assign __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); #ifdef __Pyx_AsyncGen_USED @@ -18332,66 +18624,23 @@ static void __Pyx_Coroutine_del(PyObject *self) { #endif { PyObject_GC_UnTrack(self); -#if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) PyErr_WriteUnraisable(self); -#else - {PyObject *msg; - char *cmsg; - #if CYTHON_COMPILING_IN_PYPY - msg = NULL; - cmsg = (char*) "coroutine was never awaited"; - #else - char *cname; - PyObject *qualname; - qualname = gen->gi_qualname; - cname = PyString_AS_STRING(qualname); - msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); - if (unlikely(!msg)) { - PyErr_Clear(); - cmsg = (char*) "coroutine was never awaited"; - } else { - cmsg = PyString_AS_STRING(msg); - } - #endif - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) - PyErr_WriteUnraisable(self); - Py_XDECREF(msg);} -#endif PyObject_GC_Track(self); } #endif } else { - PyObject *res = __Pyx_Coroutine_Close(self); - if (unlikely(!res)) { - if (PyErr_Occurred()) - PyErr_WriteUnraisable(self); + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_Close(self, &retval); + if (result == PYGEN_ERROR) { + PyErr_WriteUnraisable(self); } else { - Py_DECREF(res); + Py_XDECREF(retval); } } __Pyx_ErrRestore(error_type, error_value, error_traceback); -#if !CYTHON_USE_TP_FINALIZE - assert(Py_REFCNT(self) > 0); - if (likely(--self->ob_refcnt == 0)) { - return; - } - { - Py_ssize_t refcnt = Py_REFCNT(self); - _Py_NewReference(self); - __Pyx_SET_REFCNT(self, refcnt); - } -#if CYTHON_COMPILING_IN_CPYTHON - assert(PyType_IS_GC(Py_TYPE(self)) && - _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); - _Py_DEC_REFTOTAL; -#endif -#ifdef COUNT_ALLOCS - --Py_TYPE(self)->tp_frees; - --Py_TYPE(self)->tp_allocs; -#endif -#endif } +#endif static PyObject * __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context) { @@ -18405,12 +18654,7 @@ static int __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; @@ -18432,12 +18676,7 @@ static int __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; @@ -18447,26 +18686,53 @@ __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void return 0; } static PyObject * -__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) +__Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self) { - PyObject *frame = self->gi_frame; - CYTHON_UNUSED_VAR(context); +#if !CYTHON_COMPILING_IN_LIMITED_API + PyObject *frame; + #if PY_VERSION_HEX >= 0x030d0000 + Py_BEGIN_CRITICAL_SECTION(self); + #endif + frame = self->gi_frame; if (!frame) { if (unlikely(!self->gi_code)) { Py_RETURN_NONE; } + PyObject *globals = PyDict_New(); + if (unlikely(!globals)) return NULL; frame = (PyObject *) PyFrame_New( PyThreadState_Get(), /*PyThreadState *tstate,*/ (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ + globals, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); + Py_DECREF(globals); if (unlikely(!frame)) return NULL; - self->gi_frame = frame; + if (unlikely(self->gi_frame)) { + Py_DECREF(frame); + frame = self->gi_frame; + } else { + self->gi_frame = frame; + } } Py_INCREF(frame); + #if PY_VERSION_HEX >= 0x030d0000 + Py_END_CRITICAL_SECTION(); + #endif return frame; +#else + CYTHON_UNUSED_VAR(self); + Py_RETURN_NONE; +#endif +} +static PyObject * +__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) { + CYTHON_UNUSED_VAR(context); + PyObject *frame = self->gi_frame; + if (frame) + return __Pyx_NewRef(frame); + return __Pyx__Coroutine_get_frame(self); } static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, @@ -18486,7 +18752,8 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( gen->resume_label = 0; gen->classobj = NULL; gen->yieldfrom = NULL; - #if PY_VERSION_HEX >= 0x030B00a4 + gen->yieldfrom_am_send = NULL; + #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_LIMITED_API gen->gi_exc_state.exc_value = NULL; #else gen->gi_exc_state.exc_type = NULL; @@ -18509,135 +18776,85 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( PyObject_GC_Track(gen); return gen; } - -/* PatchModuleWithCoroutine */ -static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - int result; - PyObject *globals, *result_obj; - globals = PyDict_New(); if (unlikely(!globals)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_coroutine_type", - #ifdef __Pyx_Coroutine_USED - (PyObject*)__pyx_CoroutineType); - #else - Py_None); +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 - if (unlikely(result < 0)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_generator_type", - #ifdef __Pyx_Generator_USED - (PyObject*)__pyx_GeneratorType); - #else - Py_None); + result = gen->is_running; + gen->is_running = 1; + #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_END_CRITICAL_SECTION(); #endif - if (unlikely(result < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; - result_obj = PyRun_String(py_code, Py_file_input, globals, globals); - if (unlikely(!result_obj)) goto ignore; - Py_DECREF(result_obj); - Py_DECREF(globals); - return module; -ignore: - Py_XDECREF(globals); - PyErr_WriteUnraisable(module); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { - Py_DECREF(module); - module = NULL; - } -#else - py_code++; -#endif - return module; + return result; } - -/* PatchGeneratorABC */ -#ifndef CYTHON_REGISTER_ABCS -#define CYTHON_REGISTER_ABCS 1 -#endif -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) -static PyObject* __Pyx_patch_abc_module(PyObject *module); -static PyObject* __Pyx_patch_abc_module(PyObject *module) { - module = __Pyx_Coroutine_patch_module( - module, "" -"if _cython_generator_type is not None:\n" -" try: Generator = _module.Generator\n" -" except AttributeError: pass\n" -" else: Generator.register(_cython_generator_type)\n" -"if _cython_coroutine_type is not None:\n" -" try: Coroutine = _module.Coroutine\n" -" except AttributeError: pass\n" -" else: Coroutine.register(_cython_coroutine_type)\n" - ); - return module; +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 + assert(gen->is_running); + gen->is_running = 0; + #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_END_CRITICAL_SECTION(); + #endif } -#endif -static int __Pyx_patch_abc(void) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - static int abc_patched = 0; - if (CYTHON_REGISTER_ABCS && !abc_patched) { - PyObject *module; - module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); - if (unlikely(!module)) { - PyErr_WriteUnraisable(NULL); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, - ((PY_MAJOR_VERSION >= 3) ? - "Cython module failed to register with collections.abc module" : - "Cython module failed to register with collections module"), 1) < 0)) { - return -1; - } - } else { - module = __Pyx_patch_abc_module(module); - abc_patched = 1; - if (unlikely(!module)) - return -1; - Py_DECREF(module); - } - module = PyImport_ImportModule("backports_abc"); - if (module) { - module = __Pyx_patch_abc_module(module); - Py_XDECREF(module); - } - if (!module) { - PyErr_Clear(); - } +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 + result = gen->is_running; + #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_END_CRITICAL_SECTION(); + #endif + return result; +} +static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure) { + CYTHON_UNUSED_VAR(closure); + char result = __Pyx_Coroutine_get_is_running((__pyx_CoroutineObject*)gen); + if (result) Py_RETURN_TRUE; + else Py_RETURN_FALSE; +} +#if __PYX_HAS_PY_AM_SEND == 2 +static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send) { + Py_ssize_t ptr_offset = (char*)(type->tp_as_async) - (char*)type; + if (ptr_offset < 0 || ptr_offset > type->tp_basicsize) { + return; } -#else - if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); -#endif - return 0; + memcpy((void*)static_amsend_methods, (void*)(type->tp_as_async), sizeof(*type->tp_as_async)); + static_amsend_methods->am_send = am_send; + type->tp_as_async = __Pyx_SlotTpAsAsync(static_amsend_methods); } +#endif /* Generator */ static PyMethodDef __pyx_Generator_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, - (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, + PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, - (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, + PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, - (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, + PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, {0, 0, 0, 0} }; static PyMemberDef __pyx_Generator_memberlist[] = { - {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, - {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, - (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, - {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, - {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, -#if CYTHON_USE_TYPE_SPECS - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, -#endif + {"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, + 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}, + {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Generator_getsets[] = { - {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, - (char*) PyDoc_STR("name of the generator"), 0}, - {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, - (char*) PyDoc_STR("qualified name of the generator"), 0}, - {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, - (char*) PyDoc_STR("Frame of the generator"), 0}, + {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, + PyDoc_STR("name of the generator"), 0}, + {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, + PyDoc_STR("qualified name of the generator"), 0}, + {"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, + PyDoc_STR("Frame of the generator"), 0}, + {"gi_running", __Pyx_Coroutine_get_is_running_getter, NULL, NULL, NULL}, {0, 0, 0, 0, 0} }; -#if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_GeneratorType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc}, {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse}, @@ -18646,9 +18863,12 @@ static PyType_Slot __pyx_GeneratorType_slots[] = { {Py_tp_methods, (void *)__pyx_Generator_methods}, {Py_tp_members, (void *)__pyx_Generator_memberlist}, {Py_tp_getset, (void *)__pyx_Generator_getsets}, - {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict}, + {Py_tp_getattro, (void *) PyObject_GenericGetAttr}, #if CYTHON_USE_TP_FINALIZE {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, +#endif +#if __PYX_HAS_PY_AM_SEND == 1 + {Py_am_send, (void *)__Pyx_Coroutine_AmSend}, #endif {0, 0}, }; @@ -18656,124 +18876,71 @@ static PyType_Spec __pyx_GeneratorType_spec = { __PYX_TYPE_MODULE_PREFIX "generator", sizeof(__pyx_CoroutineObject), 0, - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, - __pyx_GeneratorType_slots -}; -#else -static PyTypeObject __pyx_GeneratorType_type = { - PyVarObject_HEAD_INIT(0, 0) - __PYX_TYPE_MODULE_PREFIX "generator", - sizeof(__pyx_CoroutineObject), - 0, - (destructor) __Pyx_Coroutine_dealloc, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, - 0, - (traverseproc) __Pyx_Coroutine_traverse, - 0, - 0, - offsetof(__pyx_CoroutineObject, gi_weakreflist), - 0, - (iternextfunc) __Pyx_Generator_Next, - __pyx_Generator_methods, - __pyx_Generator_memberlist, - __pyx_Generator_getsets, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, -#if CYTHON_USE_TP_FINALIZE - 0, -#else - __Pyx_Coroutine_del, -#endif - 0, -#if CYTHON_USE_TP_FINALIZE - __Pyx_Coroutine_del, -#elif PY_VERSION_HEX >= 0x030400a1 - 0, -#endif -#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, -#endif -#if __PYX_NEED_TP_PRINT_SLOT - 0, -#endif -#if PY_VERSION_HEX >= 0x030C0000 - 0, -#endif -#if PY_VERSION_HEX >= 0x030d00A4 - 0, -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, +#if PY_VERSION_HEX >= 0x030A0000 + Py_TPFLAGS_IMMUTABLETYPE | #endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE | __Pyx_TPFLAGS_HAVE_AM_SEND, + __pyx_GeneratorType_slots }; +#if __PYX_HAS_PY_AM_SEND == 2 +static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async; #endif static int __pyx_Generator_init(PyObject *module) { -#if CYTHON_USE_TYPE_SPECS - __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); -#else - CYTHON_UNUSED_VAR(module); - __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; - __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; - __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); -#endif - if (unlikely(!__pyx_GeneratorType)) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); + mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); + if (unlikely(!mstate->__pyx_GeneratorType)) { return -1; } +#if __PYX_HAS_PY_AM_SEND == 2 + __Pyx_SetBackportTypeAmSend(mstate->__pyx_GeneratorType, &__pyx_Generator_as_async, &__Pyx_Coroutine_AmSend); +#endif return 0; } +static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *retval = NULL; + if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { + return __Pyx_Coroutine_AlreadyRunningError(gen); + } + __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0); + __Pyx_Coroutine_unset_is_running(gen); + (void) result; + assert (result == PYGEN_RETURN || result == PYGEN_ERROR); + assert ((result == PYGEN_RETURN && retval != NULL) || (result == PYGEN_ERROR && retval == NULL)); + return retval; +} -/* CheckBinaryVersion */ +/* GetRuntimeVersion */ static unsigned long __Pyx_get_runtime_version(void) { -#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 +#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 return Py_Version & ~0xFFUL; #else - 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'); + 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; } - version += factor * digit; - if (rt_version[i] != '.') - break; - digit = 0; - factor >>= 8; - ++i; + __Pyx_cached_runtime_version = version; } - return 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; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) @@ -18796,45 +18963,165 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt } } -/* InitStrings */ -#if PY_MAJOR_VERSION >= 3 -static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { - if (t.is_unicode | t.is_str) { - if (t.intern) { - *str = PyUnicode_InternFromString(t.s); - } else if (t.encoding) { - *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); +/* NewCodeObj */ +#if CYTHON_COMPILING_IN_LIMITED_API + static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030b0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); } else { - *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } - } else { - *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; } - if (!*str) - return -1; - if (PyObject_Hash(*str) == -1) - return -1; - return 0; -} +#elif PY_VERSION_HEX >= 0x030B0000 + static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + 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); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !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 + #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION >= 3 - __Pyx_InitString(*t, t->p); - #else +static PyObject* __Pyx_PyCode_New( + const __Pyx_PyCode_New_function_description descr, + PyObject * const *varnames, + PyObject *filename, + PyObject *funcname, + const char *line_table, + PyObject *tuple_dedup_map +) { + PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_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; + for (Py_ssize_t i=0; i < var_count; i++) { + Py_INCREF(varnames[i]); + if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done; + } + #if CYTHON_COMPILING_IN_LIMITED_API + varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple); + if (!varnames_tuple_dedup) { + if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done; + varnames_tuple_dedup = varnames_tuple; + } + #else + varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple); + if (unlikely(!varnames_tuple_dedup)) goto done; + #endif + #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; + code_bytes = PyBytes_FromStringAndSize(NULL, code_len); + if (unlikely(!code_bytes)) goto done; + char* c_code_bytes = PyBytes_AsString(code_bytes); + if (unlikely(!c_code_bytes)) goto done; + memset(c_code_bytes, 0, (size_t) code_len); + } + code_obj = (PyObject*) __Pyx__PyCode_New( + (int) descr.argcount, + (int) descr.num_posonly_args, + (int) descr.num_kwonly_args, + (int) descr.nlocals, + 0, + (int) descr.flags, + code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + varnames_tuple_dedup, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + filename, + funcname, + (int) descr.first_line, + (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table_bytes) ? line_table_bytes : __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 + Py_DECREF(varnames_tuple); + 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) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); + 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 { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + str = PyBytes_FromStringAndSize(t->s, t->n - 1); } - if (!*t->p) + if (!str) return -1; - if (PyObject_Hash(*t->p) == -1) + *target = str; + if (PyObject_Hash(str) == -1) return -1; - #endif ++t; + ++target; } return 0; } @@ -18862,31 +19149,30 @@ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#if !CYTHON_PEP393_ENABLED -static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } + const char* result; + Py_ssize_t unicode_length; + CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 + if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL; + #else + result = PyUnicode_AsUTF8AndSize(o, length); + #endif + #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + unicode_length = PyUnicode_GetLength(o); + if (unlikely(unicode_length < 0)) return NULL; + if (unlikely(unicode_length != *length)) { + PyUnicode_AsASCIIString(o); + return NULL; } + #endif + return result; } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -} #else -static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); @@ -18898,25 +19184,25 @@ static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py #else return PyUnicode_AsUTF8AndSize(o, length); #endif -} #endif +} #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + if (PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif -#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { +#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))) *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); - } else +#else + *length = PyByteArray_Size(o); + if (*length == -1) return NULL; + return PyByteArray_AsString(o); #endif + } else { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); @@ -18939,9 +19225,8 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { Py_DECREF(x); return retval; } -static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { - __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); -#if PY_MAJOR_VERSION >= 3 +static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result)); if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " @@ -18955,74 +19240,44 @@ static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const __Pyx_DECREF_TypeName(result_type_name); return result; } -#endif PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", - type_name, type_name, result_type_name); + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")", + result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif - const char *name = NULL; PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x) || PyLong_Check(x))) -#else if (likely(PyLong_Check(x))) -#endif - return __Pyx_NewRef(x); + return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; - #if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = m->nb_int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = m->nb_long(x); - } - #else if (likely(m && m->nb_int)) { - name = "int"; - res = m->nb_int(x); + res = m->nb_int(x); } - #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { - res = PyNumber_Int(x); + res = PyNumber_Long(x); } #endif if (likely(res)) { -#if PY_MAJOR_VERSION < 3 - if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { -#else - if (unlikely(!PyLong_CheckExact(res))) { -#endif - return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); - } + if (unlikely(!PyLong_CheckExact(res))) { + return __Pyx_PyNumber_LongWrongResultType(res); + } } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); + PyErr_SetString(PyExc_TypeError, + "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(b); - } -#endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { @@ -19068,35 +19323,350 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { } x = PyNumber_Index(b); if (!x) return -1; - ival = PyInt_AsSsize_t(x); + ival = PyLong_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); -#if PY_MAJOR_VERSION < 3 - } else if (likely(PyInt_CheckExact(o))) { - return PyInt_AS_LONG(o); -#endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; - ival = PyInt_AsLong(x); + ival = PyLong_AsLong(x); Py_DECREF(x); return ival; } } +static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) { + CYTHON_UNUSED_VAR(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); } -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { + return PyLong_FromSize_t(ival); } +/* MultiPhaseInitModuleState */ +#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE +#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000) + #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1 +#else + #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0 +#endif +#endif +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS +#error "Module state with PEP489 requires atomics. Currently that's one of\ + C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics" +#endif +#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +#define __Pyx_ModuleStateLookup_Lock() +#define __Pyx_ModuleStateLookup_Unlock() +#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000 +static PyMutex __Pyx_ModuleStateLookup_mutex = {0}; +#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(__cplusplus) && __cplusplus >= 201103L +#include +static std::mutex __Pyx_ModuleStateLookup_mutex; +#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock() +#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock() +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__) +#include +static mtx_t __Pyx_ModuleStateLookup_mutex; +static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT; +static void __Pyx_ModuleStateLookup_initialize_mutex(void) { + mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain); +} +#define __Pyx_ModuleStateLookup_Lock()\ + call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\ + mtx_lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(HAVE_PTHREAD_H) +#include +static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER; +#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(_WIN32) +#include // synchapi.h on its own doesn't work +static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT; +#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) +#else +#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\ + Requires C standard >= C11, or C++ standard >= C++11,\ + or pthreads, or the Windows 32 API, or Python >= 3.13." +#endif +typedef struct { + int64_t id; + PyObject *module; +} __Pyx_InterpreterIdAndModule; +typedef struct { + char interpreter_id_as_index; + Py_ssize_t count; + Py_ssize_t allocated; + __Pyx_InterpreterIdAndModule table[1]; +} __Pyx_ModuleStateLookupData; +#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32 +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0; +#endif +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0; +#else +static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL; +#endif +static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound( + __Pyx_InterpreterIdAndModule* table, + Py_ssize_t count, + int64_t interpreterId) { + __Pyx_InterpreterIdAndModule* begin = table; + __Pyx_InterpreterIdAndModule* end = begin + count; + if (begin->id == interpreterId) { + return begin; + } + while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { + __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2; + if (halfway->id == interpreterId) { + return halfway; + } + if (halfway->id < interpreterId) { + begin = halfway; + } else { + end = halfway; + } + } + for (; begin < end; ++begin) { + if (begin->id >= interpreterId) return begin; + } + return begin; +} +static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return NULL; +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); + { + __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); + if (likely(data)) { + __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data); + if (likely(data == new_data)) { + goto read_finished; + } + } + __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); + __Pyx_ModuleStateLookup_Lock(); + __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter); + data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); + __Pyx_ModuleStateLookup_Unlock(); + } + read_finished:; +#else + __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data; +#endif + __Pyx_InterpreterIdAndModule* found = NULL; + if (unlikely(!data)) goto end; + if (data->interpreter_id_as_index) { + if (interpreter_id < data->count) { + found = data->table+interpreter_id; + } + } else { + found = __Pyx_State_FindModuleStateLookupTableLowerBound( + data->table, data->count, interpreter_id); + } + end: + { + PyObject *result=NULL; + if (found && found->id == interpreter_id) { + result = found->module; + } +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); +#endif + return result; + } +} +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) { + while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0); +} +#else +#define __Pyx_ModuleStateLookup_wait_until_no_readers() +#endif +static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) { + Py_ssize_t to_allocate = (*old_data)->allocated; + while (to_allocate <= interpreter_id) { + if (to_allocate == 0) to_allocate = 1; + else to_allocate *= 2; + } + __Pyx_ModuleStateLookupData *new_data = *old_data; + if (to_allocate != (*old_data)->allocated) { + new_data = (__Pyx_ModuleStateLookupData *)realloc( + *old_data, + sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); + if (!new_data) { + PyErr_NoMemory(); + return -1; + } + for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) { + new_data->table[i].id = i; + new_data->table[i].module = NULL; + } + new_data->allocated = to_allocate; + } + new_data->table[interpreter_id].module = module; + if (new_data->count < interpreter_id+1) { + new_data->count = interpreter_id+1; + } + *old_data = new_data; + return 0; +} +static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) { + __Pyx_InterpreterIdAndModule *read = data->table; + __Pyx_InterpreterIdAndModule *write = data->table; + __Pyx_InterpreterIdAndModule *end = read + data->count; + for (; readmodule) { + write->id = read->id; + write->module = read->module; + ++write; + } + } + data->count = write - data->table; + for (; writeid = 0; + write->module = NULL; + } + data->interpreter_id_as_index = 0; +} +static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return -1; + int result = 0; + __Pyx_ModuleStateLookup_Lock(); +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *) + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); +#else + __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data; +#endif + __Pyx_ModuleStateLookupData *new_data = old_data; + if (!new_data) { + new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData)); + if (!new_data) { + result = -1; + PyErr_NoMemory(); + goto end; + } + new_data->allocated = 1; + new_data->interpreter_id_as_index = 1; + } + __Pyx_ModuleStateLookup_wait_until_no_readers(); + if (new_data->interpreter_id_as_index) { + if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { + result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id); + goto end; + } + __Pyx_State_ConvertFromInterpIdAsIndex(new_data); + } + { + Py_ssize_t insert_at = 0; + { + __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( + new_data->table, new_data->count, interpreter_id); + assert(lower_bound); + insert_at = lower_bound - new_data->table; + if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) { + lower_bound->module = module; + goto end; // already in table, nothing more to do + } + } + if (new_data->count+1 >= new_data->allocated) { + Py_ssize_t to_allocate = (new_data->count+1)*2; + new_data = + (__Pyx_ModuleStateLookupData*)realloc( + new_data, + sizeof(__Pyx_ModuleStateLookupData) + + (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); + if (!new_data) { + result = -1; + new_data = old_data; + PyErr_NoMemory(); + goto end; + } + new_data->allocated = to_allocate; + } + ++new_data->count; + int64_t last_id = interpreter_id; + PyObject *last_module = module; + for (Py_ssize_t i=insert_at; icount; ++i) { + int64_t current_id = new_data->table[i].id; + new_data->table[i].id = last_id; + last_id = current_id; + PyObject *current_module = new_data->table[i].module; + new_data->table[i].module = last_module; + last_module = current_module; + } + } + end: +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data); +#else + __Pyx_ModuleStateLookup_data = new_data; +#endif + __Pyx_ModuleStateLookup_Unlock(); + return result; +} +static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return -1; + __Pyx_ModuleStateLookup_Lock(); +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *) + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); +#else + __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data; +#endif + if (data->interpreter_id_as_index) { + if (interpreter_id < data->count) { + data->table[interpreter_id].module = NULL; + } + goto done; + } + { + __Pyx_ModuleStateLookup_wait_until_no_readers(); + __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( + data->table, data->count, interpreter_id); + if (!lower_bound) goto done; + if (lower_bound->id != interpreter_id) goto done; + __Pyx_InterpreterIdAndModule *end = data->table+data->count; + for (;lower_boundid = (lower_bound+1)->id; + lower_bound->module = (lower_bound+1)->module; + } + } + --data->count; + if (data->count == 0) { + free(data); + data = NULL; + } + done: +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data); +#else + __Pyx_ModuleStateLookup_data = data; +#endif + __Pyx_ModuleStateLookup_Unlock(); + return 0; +} +#endif + /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) diff --git a/constraint/problem.c b/constraint/problem.c index e9b09a7..ad5e61a 100644 --- a/constraint/problem.c +++ b/constraint/problem.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.0.12 */ +/* Generated by Cython 3.1.1 */ /* BEGIN: Cython Metadata { @@ -18,32 +18,21 @@ END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ -#if defined(CYTHON_LIMITED_API) && 0 - #ifndef Py_LIMITED_API - #if CYTHON_LIMITED_API+0 > 0x03030000 - #define Py_LIMITED_API CYTHON_LIMITED_API - #else - #define Py_LIMITED_API 0x03030000 - #endif - #endif +/* InitLimitedAPI */ +#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API) + #define CYTHON_LIMITED_API 1 #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) - #error Cython requires Python 2.7+ or Python 3.3+. -#else -#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API -#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#elif PY_VERSION_HEX < 0x03080000 + #error Cython requires Python 3.8+. #else -#define __PYX_EXTRA_ABI_MODULE_NAME "" -#endif -#define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME -#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI -#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x03000CF0 +#define __PYX_ABI_VERSION "3_1_1" +#define CYTHON_HEX_VERSION 0x030101F0 #define CYTHON_FUTURE_DIVISION 1 +/* CModulePreamble */ #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -83,19 +72,13 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -106,8 +89,12 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #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 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -119,18 +106,22 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 + #define CYTHON_USE_EXC_INFO_STACK 1 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif @@ -141,20 +132,14 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 + #define CYTHON_USE_TYPE_SLOTS 1 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -165,8 +150,13 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #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 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -178,7 +168,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT @@ -188,14 +178,19 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00) + #endif + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100) #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 @@ -208,7 +203,7 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS @@ -217,8 +212,6 @@ END: Cython Metadata */ #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -231,8 +224,13 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -240,71 +238,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 1 - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif - #undef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 -#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 1 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #ifndef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #ifndef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 1 - #endif + #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS @@ -316,26 +250,37 @@ END: Cython Metadata */ #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 + #define CYTHON_USE_TP_FINALIZE 0 + #endif + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000) #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 - #endif - #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif + #undef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #ifndef CYTHON_USE_TYPE_SLOTS + #ifdef Py_GIL_DISABLED + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1 + #else + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 + #endif + #if PY_VERSION_HEX < 0x030A0000 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #elif !defined(CYTHON_USE_TYPE_SLOTS) #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS @@ -344,22 +289,19 @@ END: Cython Metadata */ #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif - #if PY_MAJOR_VERSION < 3 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif - #ifndef CYTHON_USE_PYLIST_INTERNALS + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLIST_INTERNALS) #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif - #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) @@ -368,20 +310,32 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 + #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS) + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif - #ifndef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #elif !defined(CYTHON_FAST_GIL) + #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #define CYTHON_METH_FASTCALL 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 @@ -389,51 +343,49 @@ END: Cython Metadata */ #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif - #if PY_VERSION_HEX < 0x030400a1 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #elif !defined(CYTHON_USE_TP_FINALIZE) + #ifndef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1) + #endif + #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif - #if PY_VERSION_HEX < 0x030600B1 + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 1 + #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE) #endif - #if PY_VERSION_HEX < 0x030700A3 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 1 + #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif #endif -#if !defined(CYTHON_FAST_PYCCALL) -#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#ifndef CYTHON_FAST_PYCCALL +#define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL #endif -#if !defined(CYTHON_VECTORCALL) +#ifndef CYTHON_VECTORCALL +#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) #endif +#endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS - #if PY_MAJOR_VERSION < 3 - #include "longintrepr.h" - #endif #undef SHIFT #undef BASE #undef MASK @@ -568,6 +520,9 @@ END: Cython Metadata */ #endif #endif #endif +#ifndef Py_UNREACHABLE + #define Py_UNREACHABLE() assert(0); abort() +#endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; @@ -582,6 +537,7 @@ END: Cython Metadata */ #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) +/* CInitCode */ #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) @@ -596,109 +552,42 @@ END: Cython Metadata */ #endif #endif +/* PythonCompatibility */ #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_DefaultClassType PyClass_Type - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_DefaultClassType PyType_Type +#define __Pyx_BUILTIN_MODULE_NAME "builtins" +#define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API - static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyObject *exception_table = NULL; - PyObject *types_module=NULL, *code_type=NULL, *result=NULL; - #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; - PyObject *py_minor_version = NULL; - #endif - long minor_version = 0; - PyObject *type, *value, *traceback; - PyErr_Fetch(&type, &value, &traceback); - #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; - #else - if (!(version_info = PySys_GetObject("version_info"))) goto end; - if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; - minor_version = PyLong_AsLong(py_minor_version); - Py_DECREF(py_minor_version); - if (minor_version == -1 && PyErr_Occurred()) goto end; - #endif - if (!(types_module = PyImport_ImportModule("types"))) goto end; - if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; - if (minor_version <= 7) { - (void)p; - result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else if (minor_version <= 10) { - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else { - if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); - } - end: - Py_XDECREF(code_type); - Py_XDECREF(exception_table); - Py_XDECREF(types_module); - if (type) { - PyErr_Restore(type, value, traceback); - } - return result; - } #ifndef CO_OPTIMIZED - #define CO_OPTIMIZED 0x0001 + static int CO_OPTIMIZED; #endif #ifndef CO_NEWLOCALS - #define CO_NEWLOCALS 0x0002 + static int CO_NEWLOCALS; #endif #ifndef CO_VARARGS - #define CO_VARARGS 0x0004 + static int CO_VARARGS; #endif #ifndef CO_VARKEYWORDS - #define CO_VARKEYWORDS 0x0008 + static int CO_VARKEYWORDS; #endif #ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x0200 + static int CO_ASYNC_GENERATOR; #endif #ifndef CO_GENERATOR - #define CO_GENERATOR 0x0020 + static int CO_GENERATOR; #endif #ifndef CO_COROUTINE - #define CO_COROUTINE 0x0080 + static int CO_COROUTINE; #endif -#elif PY_VERSION_HEX >= 0x030B0000 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); - if (!empty_bytes) return NULL; - result = - #if PY_VERSION_HEX >= 0x030C0000 - PyUnstable_Code_NewWithPosOnlyArgs - #else - PyCode_NewWithPosOnlyArgs - #endif - (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); - Py_DECREF(empty_bytes); - return result; - } -#elif PY_VERSION_HEX >= 0x030800B2 && !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 - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 + #endif #endif +static int __Pyx_init_co_variables(void); #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else @@ -730,12 +619,6 @@ END: Cython Metadata */ #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif -#ifndef CO_COROUTINE - #define CO_COROUTINE 0x80 -#endif -#ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x200 -#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -757,7 +640,7 @@ END: Cython Metadata */ #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif -#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) +#ifndef METH_FASTCALL #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif @@ -795,7 +678,7 @@ END: Cython Metadata */ #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif -#if PY_MAJOR_VERSION >= 0x030900B1 +#if PY_VERSION_HEX >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) @@ -812,7 +695,7 @@ static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif -static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { +static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else @@ -820,7 +703,7 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) -#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 +#if __PYX_LIMITED_VERSION_HEX < 0x03090000 #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 @@ -836,8 +719,10 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_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)) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) @@ -848,15 +733,11 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() -#elif PY_VERSION_HEX >= 0x03060000 - #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() -#elif PY_VERSION_HEX >= 0x03000000 - #define __Pyx_PyThreadState_Current PyThreadState_GET() #else - #define __Pyx_PyThreadState_Current _PyThreadState_Current + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #endif -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +#if CYTHON_USE_MODULE_STATE +static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); @@ -864,85 +745,43 @@ static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) Py_FatalError("Couldn't find the module state"); return result; } -#endif -#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o) #else - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) -#endif -#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) -#include "pythread.h" -#define Py_tss_NEEDS_INIT 0 -typedef int Py_tss_t; -static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { - *key = PyThread_create_key(); - return 0; -} -static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { - Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); - *key = Py_tss_NEEDS_INIT; - return key; -} -static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { - PyObject_Free(key); -} -static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { - return *key != Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { - PyThread_delete_key(*key); - *key = Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { - return PyThread_set_key_value(*key, value); -} -static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { - return PyThread_get_key_value(*key); -} -#endif -#if PY_MAJOR_VERSION < 3 - #if CYTHON_COMPILING_IN_PYPY - #if PYPY_VERSION_NUM < 0x07030600 - #if defined(__cplusplus) && __cplusplus >= 201402L - [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] - #elif defined(__GNUC__) || defined(__clang__) - __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) - #elif defined(_MSC_VER) - __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) - #endif - static CYTHON_INLINE int PyGILState_Check(void) { - return 0; - } - #else // PYPY_VERSION_NUM < 0x07030600 - #endif // PYPY_VERSION_NUM < 0x07030600 - #else - static CYTHON_INLINE int PyGILState_Check(void) { - PyThreadState * tstate = _PyThreadState_Current; - return tstate && (tstate == PyGILState_GetThisThreadState()); - } - #endif +#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global) #endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype) +#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype) +#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype) +#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype) +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype) + #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL) + #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\ + ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\ + (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\ + __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL) + #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype) + #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype) +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif -#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) +#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } -#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000 #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else @@ -966,17 +805,11 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) - #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) - #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) -#else - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif +#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ @@ -988,24 +821,20 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) -#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 +#else #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) @@ -1021,20 +850,6 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif -#else - #define CYTHON_PEP393_ENABLED 0 - #define PyUnicode_1BYTE_KIND 1 - #define PyUnicode_2BYTE_KIND 2 - #define PyUnicode_4BYTE_KIND 4 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) @@ -1048,8 +863,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif - #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) - #undef PyUnicode_Contains + #if !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) @@ -1059,33 +873,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #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 PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#ifndef PyObject_Unicode - #define PyObject_Unicode PyObject_Str -#endif -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) @@ -1102,28 +890,75 @@ 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_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS + #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) + #else + #define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i) + #endif +#else + #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) +#endif +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 +#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) +#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyObject_GetItem(dict, key); + if (*result == NULL) { + if (PyErr_ExceptionMatches(PyExc_KeyError)) { + PyErr_Clear(); + return 0; + } + return -1; + } + return 1; +} +#else +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyDict_GetItemWithError(dict, key); + if (*result == NULL) { + return PyErr_Occurred() ? -1 : 0; + } + Py_INCREF(*result); + return 1; +} +#endif +#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST + #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj) +#else + #define __Pyx_VISIT_CONST(obj) +#endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i) +#endif +#if CYTHON_ASSUME_SAFE_SIZE #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o) #else - #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) - #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) - #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) - #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) #endif -#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 +#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) { @@ -1132,86 +967,139 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, return module; } #endif -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define __Pyx_Py3Int_Check(op) PyLong_Check(op) - #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#else - #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) - #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t +#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t +#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 + #define __Pyx_PySendResult PySendResult #else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t + typedef enum { + PYGEN_RETURN = 0, + PYGEN_ERROR = -1, + PYGEN_NEXT = 1, + } __Pyx_PySendResult; #endif -#if CYTHON_USE_ASYNC_SLOTS - #if PY_VERSION_HEX >= 0x030500B1 - #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods - #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) - #else - #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) - #endif +#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3 + typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result); +#else + #define __Pyx_pyiter_sendfunc sendfunc +#endif +#if !CYTHON_USE_AM_SEND +#define __PYX_HAS_PY_AM_SEND 0 +#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000 +#define __PYX_HAS_PY_AM_SEND 1 #else - #define __Pyx_PyType_AsAsync(obj) NULL +#define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation #endif -#ifndef __Pyx_PyAsyncMethodsStruct +#if __PYX_HAS_PY_AM_SEND < 2 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods +#else typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; + __Pyx_pyiter_sendfunc am_send; } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s)) #endif - -#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) - #if !defined(_USE_MATH_DEFINES) - #define _USE_MATH_DEFINES - #endif -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) +#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0 + #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21) #else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} + #define __Pyx_TPFLAGS_HAVE_AM_SEND (0) #endif -#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) -#define __Pyx_truncl trunc +#if PY_VERSION_HEX >= 0x03090000 +#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get() #else -#define __Pyx_truncl truncl +#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp #endif - -#define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } -#define __PYX_ERR(f_index, lineno, Ln_error) \ +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000 +#ifdef __cplusplus +extern "C" +#endif +PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize); +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) { + int value; + PyObject *py_value = PyObject_GetAttrString(inspect, name); + if (!py_value) return 0; + value = (int) PyLong_AsLong(py_value); + Py_DECREF(py_value); + *write_to = value; + return value != -1 || !PyErr_Occurred(); +} +static int __Pyx_init_co_variables(void) { + PyObject *inspect; + int result; + inspect = PyImport_ImportModule("inspect"); + result = +#if !defined(CO_OPTIMIZED) + __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) && +#endif +#if !defined(CO_NEWLOCALS) + __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) && +#endif +#if !defined(CO_VARARGS) + __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) && +#endif +#if !defined(CO_VARKEYWORDS) + __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) && +#endif +#if !defined(CO_ASYNC_GENERATOR) + __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) && +#endif +#if !defined(CO_GENERATOR) + __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) && +#endif +#if !defined(CO_COROUTINE) + __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) && +#endif + 1; + Py_DECREF(inspect); + return result ? 0 : -1; +} +#else +static int __Pyx_init_co_variables(void) { + return 0; // It's a limited API-only feature +} +#endif + +/* MathInitCode */ +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #ifndef _USE_MATH_DEFINES + #define _USE_MATH_DEFINES + #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 +#define __Pyx_truncl truncl +#endif + +#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0 +#endif +#ifndef CYTHON_CLINE_IN_TRACEBACK +#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#endif +#if CYTHON_CLINE_IN_TRACEBACK +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; } +#else +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; } +#endif +#define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C @@ -1242,12 +1130,8 @@ static CYTHON_INLINE float __PYX_NAN() { #define CYTHON_WITHOUT_ASSERTIONS #endif -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -1290,19 +1174,23 @@ static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s) +#else + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s) +#endif #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) @@ -1311,32 +1199,44 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef) + return Py_NewRef(obj); +#else + Py_INCREF(obj); + return obj; +#endif +} +static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef) + return Py_XNewRef(obj); +#else + Py_XINCREF(obj); + return obj; +#endif +} +static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b); static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x) #else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x) #endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x)) #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK @@ -1383,81 +1283,12 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -#include -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = (char) c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL) #else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#include -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #endif @@ -1469,26 +1300,194 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) { #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ +/* PretendToInitialize */ +#ifdef __cplusplus +#include +template +static void __Pyx_pretend_to_initialize(T* ptr) { +#if __cplusplus > 201103L + if ((std::is_trivially_default_constructible::value)) +#endif + *ptr = T(); + (void)ptr; +} +#else static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } +#endif + #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; -static const char * __pyx_cfilenm = __FILE__; +static const char * const __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ -static const char *__pyx_f[] = { +static const char* const __pyx_f[] = { "constraint/problem.py", }; /* #### Code section: utility_code_proto_before_types ### */ -/* ForceInitThreads.proto */ -#ifndef __PYX_FORCE_INIT_THREADS - #define __PYX_FORCE_INIT_THREADS 0 +/* Atomics.proto */ +#include +#ifndef CYTHON_ATOMICS + #define CYTHON_ATOMICS 1 +#endif +#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS +#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __pyx_atomic_int_type int +#define __pyx_nonatomic_int_type int +#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ + (__STDC_VERSION__ >= 201112L) &&\ + !defined(__STDC_NO_ATOMICS__)) + #include +#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ + (__cplusplus >= 201103L) ||\ + (defined(_MSC_VER) && _MSC_VER >= 1700))) + #include +#endif +#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ + (__STDC_VERSION__ >= 201112L) &&\ + !defined(__STDC_NO_ATOMICS__) &&\ + ATOMIC_INT_LOCK_FREE == 2) + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type atomic_int + #define __pyx_atomic_ptr_type atomic_uintptr_t + #define __pyx_nonatomic_ptr_type uintptr_t + #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed) + #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel) + #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel) + #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg) + #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired) + #define __pyx_atomic_load(value) atomic_load(value) + #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value) + #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) + #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) + #pragma message ("Using standard C atomics") + #elif defined(__PYX_DEBUG_ATOMICS) + #warning "Using standard C atomics" + #endif +#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ + (__cplusplus >= 201103L) ||\ +\ + (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\ + ATOMIC_INT_LOCK_FREE == 2) + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type std::atomic_int + #define __pyx_atomic_ptr_type std::atomic_uintptr_t + #define __pyx_nonatomic_ptr_type uintptr_t + #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed) + #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel) + #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel) + #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg) + #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired) + #define __pyx_atomic_load(value) std::atomic_load(value) + #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value) + #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) + #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) + #pragma message ("Using standard C++ atomics") + #elif defined(__PYX_DEBUG_ATOMICS) + #warning "Using standard C++ atomics" + #endif +#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\ + (__GNUC_MINOR__ > 1 ||\ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2)))) + #define __pyx_atomic_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) + #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg) + static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { + __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired); + int result = old == *expected; + *expected = old; + return result; + } + #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0) + #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value) + #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) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using GNU atomics" + #endif +#elif CYTHON_ATOMICS && defined(_MSC_VER) + #include + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type long + #define __pyx_atomic_ptr_type void* + #undef __pyx_nonatomic_int_type + #define __pyx_nonatomic_int_type long + #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) + #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1) + #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg) + static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { + __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected); + int result = old == *expected; + *expected = old; + return result; + } + #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0) + #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value) + #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) + #ifdef __PYX_DEBUG_ATOMICS + #pragma message ("Using MSVC atomics") + #endif +#else + #undef CYTHON_ATOMICS + #define CYTHON_ATOMICS 0 + #ifdef __PYX_DEBUG_ATOMICS + #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 */ +#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) +#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 +#endif +#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_BEGIN_CRITICAL_SECTION(o) { +#define __Pyx_END_CRITICAL_SECTION() } +#else +#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION +#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION +#endif + +/* IncludeStructmemberH.proto */ +#include /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ @@ -1507,7 +1506,7 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr; * assert all(isinstance(c, str) for c in constraint), f"Expected constraints to be strings, got {constraint}" # <<<<<<<<<<<<<< * self._str_constraints.extend(constraint) * return - */ +*/ struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; @@ -1521,7 +1520,7 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr { * 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() - */ +*/ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList { PyObject_HEAD PyObject *__pyx_v_get_in_order; @@ -1534,7 +1533,7 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedL * return list(tuple(solution.values()) for solution in solutions) # <<<<<<<<<<<<<< * get_in_order = itemgetter(*order) * return list(get_in_order(params) for params in solutions) - */ +*/ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; @@ -1548,7 +1547,7 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr { * return list(get_in_order(params) for params in solutions) # <<<<<<<<<<<<<< * * def getSolutionsAsListDict( - */ +*/ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr { PyObject_HEAD struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *__pyx_outer_scope; @@ -1563,7 +1562,7 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr { * 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 = {} - */ +*/ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; @@ -1590,7 +1589,6 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr { static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ @@ -1604,11 +1602,6 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr { __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) - #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() -#endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ @@ -1720,6 +1713,8 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +#endif +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif @@ -1734,50 +1729,37 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i) #elif CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) -#else - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) -#endif -#if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) - #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i)) #else - #define __Pyx_Arg_NewRef_VARARGS(arg) arg - #define __Pyx_Arg_XDECREF_VARARGS(arg) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i)) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL - #define __Pyx_Arg_FASTCALL(args, i) args[i] - #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i]) + #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif - #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs - to have the same reference counting */ - #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else - #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS + #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS - #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) - #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS -#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) -#else #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) +#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) #endif @@ -1785,10 +1767,110 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, - const char* function_name); +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 */ +#define __Pyx_CallCFunction(cfunc, self, args)\ + ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args) +#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\ + ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs) +#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\ + ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs) +#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 */ +#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 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectFastCall.proto */ +#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 */ +typedef struct { + PyObject *type; + PyObject **method_name; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS + __pyx_atomic_int_type initialized; +#endif + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) { +#if !CYTHON_ATOMICS + return 1; +#else + __pyx_nonatomic_int_type expected = 0; + if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) { + return 0; + } + return expected; +#endif +} +static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) { +#if CYTHON_ATOMICS + __pyx_atomic_store(&cfunc->initialized, 2); +#endif +} +#else +#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2 +#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc) +#endif + +/* CallUnboundCMethod2.proto */ +CYTHON_UNUSED +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); +#else +#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) +#endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, @@ -1825,7 +1907,7 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ - (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) @@ -1841,71 +1923,24 @@ static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_ve static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif -/* 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 **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" -#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif - #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 */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +/* PyObjectDelAttr.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 +#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL) #else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - -/* PyObjectCallMethO.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n) #endif -/* PyObjectFastCall.proto */ -#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 **args, size_t nargs, PyObject *kwargs); - /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else -#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* AssertionsEnabled.proto */ -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define __Pyx_init_assertions_enabled() (0) - #define __pyx_assertions_enabled() (1) -#elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) +#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) { @@ -1937,11 +1972,6 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ PyObject_Format(s, f)) -#elif PY_MAJOR_VERSION < 3 - #define __Pyx_PyObject_FormatSimple(s, f) (\ - likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ - likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ - PyObject_Format(s, f)) #elif CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ @@ -1955,7 +1985,7 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr #endif /* JoinPyUnicode.proto */ -static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, +static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char); /* RaiseException.proto */ @@ -1969,23 +1999,31 @@ static CYTHON_INLINE int __Pyx_PyObject_SetSlice( PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); +/* PyObjectFastCallMethod.proto */ +#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000 +#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL) +#else +static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf); +#endif + /* 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)); } -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); - -/* GetAttr.proto */ -static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); +/* PyUnicode_Unicode.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj); /* HasAttr.proto */ +#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 /* RaiseUnboundLocalError.proto */ -static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); +static void __Pyx_RaiseUnboundLocalError(const char *varname); /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE @@ -2022,6 +2060,9 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { /* PyObjectCall2Args.proto */ 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 */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); @@ -2032,12 +2073,37 @@ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /* CallableCheck.proto */ -#if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3 +#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCallable_Check(obj) (Py_TYPE(obj)->tp_call != NULL) #else #define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj) #endif +/* PyObjectVectorCallKwBuilder.proto */ +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 +#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall +#endif +#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n) +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict +#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n) +#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value) +#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value) +#endif + +/* PyObjectVectorCallMethodKwBuilder.proto */ +#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000 +#define __Pyx_Object_VectorcallMethod_CallFromBuilder PyObject_VectorcallMethod +#else +static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames); +#endif + /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); @@ -2078,13 +2144,13 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { #endif /* RaiseClosureNameError.proto */ -static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); +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 && PY_MAJOR_VERSION >= 3 +# if CYTHON_COMPILING_IN_CPYTHON #if CYTHON_REFNANNY #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, __pyx_refnanny) #else @@ -2102,7 +2168,7 @@ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_ConcatInPlace(left, right)) /* DictGetItem.proto */ -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #define __Pyx_PyObject_Dict_GetItem(obj, name)\ (likely(PyDict_CheckExact(obj)) ?\ @@ -2134,12 +2200,8 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto */ -#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ - (likely(is_tuple || PyTuple_Check(tuple)) ?\ - (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ - __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ - (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ - __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) +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( PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); static int __Pyx_unpack_tuple2_generic( @@ -2151,13 +2213,15 @@ 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); -/* IncludeStructmemberH.proto */ -#include +/* 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 +#else +static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg); +#endif /* FixUpExtensionType.proto */ -#if CYTHON_USE_TYPE_SPECS -static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); -#endif +static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS @@ -2167,21 +2231,15 @@ 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); -/* PyObject_GenericGetAttrNoDict.proto */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr -#endif - /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); -#if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); -#endif + +/* ListPack.proto */ +static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); @@ -2205,42 +2263,17 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); +/* dict_setdefault.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type); + /* FetchCommonType.proto */ -#if !CYTHON_USE_TYPE_SPECS -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); -#else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); -#endif /* PyMethodNew.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - typesModule = PyImport_ImportModule("types"); - if (!typesModule) return NULL; - methodType = PyObject_GetAttrString(typesModule, "MethodType"); - Py_DECREF(typesModule); - if (!methodType) return NULL; - result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); - Py_DECREF(methodType); - return result; -} -#elif PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - return PyMethod_New(func, self); -} -#else - #define __Pyx_PyMethod_New PyMethod_New -#endif +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); /* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif @@ -2274,10 +2307,11 @@ typedef struct { #else PyCMethodObject func; #endif -#if CYTHON_BACKPORT_VECTORCALL +#if CYTHON_BACKPORT_VECTORCALL ||\ + (CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL) __pyx_vectorcallfunc func_vectorcall; #endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; @@ -2290,9 +2324,7 @@ typedef struct { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif - void *defaults; - int defaults_pyobjects; - size_t defaults_size; + PyObject *defaults; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -2301,10 +2333,10 @@ typedef struct { PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check -#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) -#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) -#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType) +#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType) +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, @@ -2313,9 +2345,8 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef * PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, - size_t size, - int pyobjects); +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, + PyTypeObject *defaults_type); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, @@ -2328,7 +2359,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 +#if CYTHON_BACKPORT_VECTORCALL || 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) @@ -2343,7 +2374,7 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, PyObject* code); /* SetNameInClass.proto */ -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON @@ -2373,28 +2404,33 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* CLineInTraceback.proto */ -#ifdef CYTHON_CLINE_IN_TRACEBACK -#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) -#else +#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 */ -#if !CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject __Pyx_CachedCodeObjectType; +#else +typedef PyCodeObject __Pyx_CachedCodeObjectType; +#endif typedef struct { - PyCodeObject* code_object; + __Pyx_CachedCodeObjectType* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_int_type accessor_count; + #endif }; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); -#endif +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -2404,12 +2440,16 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" -static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 +#define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName #else +static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp); +#endif +#else // !LIMITED_API typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" -#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif @@ -2419,13 +2459,13 @@ typedef const char *__Pyx_TypeName; #endif /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value); /* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON @@ -2439,10 +2479,17 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) -#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) { + return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2); +} #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) +#ifdef PyExceptionInstance_Check + #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj) +#else + #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException) +#endif /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE @@ -2452,6 +2499,15 @@ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject * static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif +/* IterNextPlain.proto */ +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 */ +static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext); + /* CoroutineBase.proto */ struct __pyx_CoroutineObject; typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); @@ -2472,11 +2528,16 @@ typedef struct __pyx_CoroutineObject { PyObject *gi_weakreflist; PyObject *classobj; PyObject *yieldfrom; + __Pyx_pyiter_sendfunc yieldfrom_am_send; PyObject *gi_name; PyObject *gi_qualname; PyObject *gi_modulename; PyObject *gi_code; PyObject *gi_frame; +#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE) + PyMonitoringState __pyx_pymonitoring_state[__Pyx_MonitoringEventTypes_CyGen_count]; + uint64_t __pyx_pymonitoring_version; +#endif int resume_label; char is_running; } __pyx_CoroutineObject; @@ -2488,8 +2549,9 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( PyObject *name, PyObject *qualname, PyObject *module_name); static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); static int __Pyx_Coroutine_clear(PyObject *self); +static __Pyx_PySendResult __Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval); static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); -static PyObject *__Pyx_Coroutine_Close(PyObject *self); +static __Pyx_PySendResult __Pyx_Coroutine_Close(PyObject *self, PyObject **retval); static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); #if CYTHON_USE_EXC_INFO_STACK #define __Pyx_Coroutine_SwapException(self) @@ -2513,29 +2575,76 @@ static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); #endif static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); - -/* PatchModuleWithCoroutine.proto */ -static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); - -/* PatchGeneratorABC.proto */ -static int __Pyx_patch_abc(void); +static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen); +static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen); +static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen); +static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure); +#if __PYX_HAS_PY_AM_SEND == 2 +static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send); +#endif /* Generator.proto */ #define __Pyx_Generator_USED -#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_GeneratorType) +#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_GeneratorType) #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ - __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) + __Pyx__Coroutine_New(__pyx_mstate_global->__pyx_GeneratorType, body, code, closure, name, qualname, module_name) static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(PyObject *module); +static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self); -/* CheckBinaryVersion.proto */ +/* 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); -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); +/* MultiPhaseInitModuleState.proto */ +#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE +static PyObject *__Pyx_State_FindModule(void*); +static int __Pyx_State_AddModule(PyObject* module, void*); +static int __Pyx_State_RemoveModule(void*); +#elif CYTHON_USE_MODULE_STATE +#define __Pyx_State_FindModule PyState_FindModule +#define __Pyx_State_AddModule PyState_AddModule +#define __Pyx_State_RemoveModule PyState_RemoveModule +#endif /* #### Code section: module_declarations ### */ +/* CythonABIVersion.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API + #if CYTHON_METH_FASTCALL + #define __PYX_FASTCALL_ABI_SUFFIX "_fastcall" + #else + #define __PYX_FASTCALL_ABI_SUFFIX + #endif + #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX +#else + #define __PYX_LIMITED_ABI_SUFFIX +#endif +#if __PYX_HAS_PY_AM_SEND == 1 + #define __PYX_AM_SEND_ABI_SUFFIX +#elif __PYX_HAS_PY_AM_SEND == 2 + #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport" +#else + #define __PYX_AM_SEND_ABI_SUFFIX "noamsend" +#endif +#ifndef __PYX_MONITORING_ABI_SUFFIX + #define __PYX_MONITORING_ABI_SUFFIX +#endif +#if CYTHON_USE_TP_FINALIZE + #define __PYX_TP_FINALIZE_ABI_SUFFIX +#else + #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize" +#endif +#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED) + #define __PYX_FREELISTS_ABI_SUFFIX +#else + #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists" +#endif +#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." + /* Module declarations from "constraint.problem" */ /* #### Code section: typeinfo ### */ @@ -2554,25 +2663,32 @@ 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__5[] = "*"; -static const char __pyx_k__6[] = "."; +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__29[] = "_"; -static const char __pyx_k__33[] = "?"; +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_args[] = "args"; +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_dict[] = "__dict__"; +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__"; @@ -2584,22 +2700,23 @@ 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_super[] = "super"; 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_import[] = "__import__"; 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"; @@ -2610,15 +2727,17 @@ 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"; @@ -2653,7 +2772,6 @@ 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_init_subclass[] = "__init_subclass__"; static const char __pyx_k_AssertionError[] = "AssertionError"; static const char __pyx_k_ParallelSolver[] = "ParallelSolver"; static const char __pyx_k_Problem___init[] = "Problem.__init__"; @@ -2676,13 +2794,17 @@ 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"; @@ -2697,9 +2819,14 @@ static const char __pyx_k_Problem_getSolution_line_178[] = "Problem.getSolution 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."; @@ -2715,6 +2842,7 @@ static const char __pyx_k_Expected_constraints_to_be_strin[] = "Expected constra 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"; @@ -2750,6 +2878,17 @@ static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct_3_genexpr static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ +/* SmallCodeConfig */ +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; @@ -2775,246 +2914,262 @@ typedef struct { #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif - #if CYTHON_USE_MODULE_STATE 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; PyObject *__pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr; PyObject *__pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr; - #endif PyTypeObject *__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr; PyTypeObject *__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList; 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; - PyObject *__pyx_kp_u_; - PyObject *__pyx_kp_u_Add_a_constraint_to_the_problem; - PyObject *__pyx_kp_u_Add_a_variable_to_the_problem_Ex; - PyObject *__pyx_kp_u_Add_one_or_more_variables_to_the; - PyObject *__pyx_n_s_AssertionError; - PyObject *__pyx_n_s_Callable; - PyObject *__pyx_kp_u_Change_the_problem_solver_curren; - PyObject *__pyx_kp_s_Class_used_to_define_a_problem_a; - PyObject *__pyx_n_s_CompilableFunctionConstraint; - PyObject *__pyx_n_s_Constraint; - PyObject *__pyx_kp_u_Constraints_must_be_instances_of; - PyObject *__pyx_n_s_Domain; - PyObject *__pyx_kp_u_Domain_is_empty; - PyObject *__pyx_kp_u_Domains_must_be_instances_of_sub; - PyObject *__pyx_kp_u_Expected_constraints_to_be_strin; - PyObject *__pyx_kp_u_Find_and_return_a_solution_to_th; - PyObject *__pyx_kp_u_Find_and_return_all_solutions_to; - PyObject *__pyx_n_s_FunctionConstraint; - PyObject *__pyx_n_s_Hashable; - PyObject *__pyx_n_s_ImportError; - PyObject *__pyx_kp_u_Obtain_the_problem_solver_curren; - PyObject *__pyx_n_s_OptimizedBacktrackingSolver; - PyObject *__pyx_n_s_Optional; - PyObject *__pyx_kp_s_Optional_Sequence; - PyObject *__pyx_n_s_ParallelSolver; - PyObject *__pyx_kp_u_ParallelSolver_is_currently_expe; - PyObject *__pyx_n_s_Problem; - PyObject *__pyx_n_s_Problem___init; - PyObject *__pyx_n_s_Problem__getArgs; - PyObject *__pyx_n_s_Problem__getArgs_locals_genexpr; - PyObject *__pyx_n_s_Problem_addConstraint; - PyObject *__pyx_kp_u_Problem_addConstraint_line_139; - PyObject *__pyx_n_s_Problem_addConstraint_locals_gen; - PyObject *__pyx_n_s_Problem_addVariable; - PyObject *__pyx_kp_u_Problem_addVariable_line_86; - PyObject *__pyx_n_s_Problem_addVariables; - PyObject *__pyx_kp_u_Problem_addVariables_line_116; - PyObject *__pyx_n_s_Problem_getSolution; - PyObject *__pyx_n_s_Problem_getSolutionIter; - PyObject *__pyx_kp_u_Problem_getSolutionIter_line_216; - PyObject *__pyx_kp_u_Problem_getSolution_line_178; - PyObject *__pyx_n_s_Problem_getSolutions; - PyObject *__pyx_n_s_Problem_getSolutionsAsListDict; - PyObject *__pyx_n_s_Problem_getSolutionsOrderedList; - PyObject *__pyx_n_s_Problem_getSolutionsOrderedList_2; - PyObject *__pyx_kp_u_Problem_getSolutions_line_197; - PyObject *__pyx_n_s_Problem_getSolver; - PyObject *__pyx_kp_u_Problem_getSolver_line_72; - PyObject *__pyx_n_s_Problem_reset; - PyObject *__pyx_kp_u_Problem_reset_line_44; - PyObject *__pyx_n_s_Problem_setSolver; - PyObject *__pyx_kp_u_Problem_setSolver_line_57; - PyObject *__pyx_kp_u_Reset_the_current_problem_defini; - PyObject *__pyx_kp_u_Return_an_iterator_to_the_soluti; - PyObject *__pyx_n_s_Sequence; - PyObject *__pyx_n_s_Solver; - PyObject *__pyx_kp_u_Tried_to_insert_duplicated_varia; - PyObject *__pyx_n_s_TypeError; - PyObject *__pyx_n_s_Union; - PyObject *__pyx_kp_s_Union_Constraint_Callable_str; - PyObject *__pyx_kp_u_Using_the_ParallelSolver_in_Thre; - PyObject *__pyx_n_s_ValueError; - PyObject *__pyx_kp_u_You_have_used_FunctionConstraint; - PyObject *__pyx_n_s__29; - PyObject *__pyx_n_s__33; - PyObject *__pyx_n_s__5; - PyObject *__pyx_kp_u__6; - PyObject *__pyx_n_s_addConstraint; - PyObject *__pyx_n_s_addVariable; - PyObject *__pyx_n_s_addVariables; - PyObject *__pyx_n_s_allvariables; - PyObject *__pyx_n_s_append; - PyObject *__pyx_n_s_args; - PyObject *__pyx_n_s_asyncio_coroutines; - PyObject *__pyx_n_s_bool; - PyObject *__pyx_n_s_c; - PyObject *__pyx_n_s_clear; - PyObject *__pyx_n_s_cline_in_traceback; - PyObject *__pyx_n_s_close; - PyObject *__pyx_n_s_collections_abc; - PyObject *__pyx_n_s_compile_to_constraints; - PyObject *__pyx_n_s_constraint; - PyObject *__pyx_n_s_constraint_constraints; - PyObject *__pyx_n_s_constraint_domain; - PyObject *__pyx_n_s_constraint_parser; - PyObject *__pyx_n_s_constraint_problem; - PyObject *__pyx_kp_s_constraint_problem_py; - PyObject *__pyx_n_s_constraint_solvers; - PyObject *__pyx_n_s_constraints; - PyObject *__pyx_n_s_constraints_2; - PyObject *__pyx_n_s_copy; - PyObject *__pyx_n_s_deepcopy; - PyObject *__pyx_n_s_dict; - PyObject *__pyx_kp_u_disable; - PyObject *__pyx_n_s_doc; - PyObject *__pyx_n_s_domain; - PyObject *__pyx_n_s_domains; - PyObject *__pyx_kp_u_duplicate_parameter_configurati; - PyObject *__pyx_kp_u_enable; - PyObject *__pyx_n_s_extend; - PyObject *__pyx_n_s_freethreading; - PyObject *__pyx_kp_u_gc; - PyObject *__pyx_n_s_genexpr; - PyObject *__pyx_n_s_getArgs; - PyObject *__pyx_n_s_getSolution; - PyObject *__pyx_n_s_getSolutionIter; - PyObject *__pyx_n_s_getSolutions; - PyObject *__pyx_n_s_getSolutionsAsListDict; - PyObject *__pyx_n_s_getSolutionsOrderedList; - PyObject *__pyx_n_s_getSolver; - PyObject *__pyx_n_s_get_in_order; - PyObject *__pyx_n_u_getitem; - PyObject *__pyx_n_s_import; - PyObject *__pyx_n_s_init; - PyObject *__pyx_n_s_init_subclass; - PyObject *__pyx_n_s_initializing; - PyObject *__pyx_n_s_is_coroutine; - PyObject *__pyx_n_s_is_gil_enabled; - PyObject *__pyx_kp_u_isenabled; - PyObject *__pyx_n_s_itemgetter; - PyObject *__pyx_n_s_keys; - PyObject *__pyx_kp_s_list_str; - PyObject *__pyx_kp_s_list_tuple; - PyObject *__pyx_n_s_main; - PyObject *__pyx_n_s_metaclass; - PyObject *__pyx_n_s_module; - PyObject *__pyx_n_s_msg; - PyObject *__pyx_n_s_name; - PyObject *__pyx_n_s_operator; - PyObject *__pyx_n_s_order; - PyObject *__pyx_n_s_parsed; - PyObject *__pyx_n_s_picklable; - PyObject *__pyx_n_s_preProcess; - PyObject *__pyx_n_s_prepare; - PyObject *__pyx_n_s_process_mode; - PyObject *__pyx_n_s_qualname; - PyObject *__pyx_n_s_range; - PyObject *__pyx_n_s_requires_pickling; - PyObject *__pyx_n_s_reset; - PyObject *__pyx_n_s_resetState; - PyObject *__pyx_n_s_return; - PyObject *__pyx_n_s_self; - PyObject *__pyx_n_s_send; - PyObject *__pyx_n_s_setSolver; - PyObject *__pyx_n_s_set_name; - PyObject *__pyx_n_s_size_dict; - PyObject *__pyx_n_s_size_list; - PyObject *__pyx_n_s_solutions; - PyObject *__pyx_n_s_solutions_dict; - PyObject *__pyx_n_s_solutions_list; - PyObject *__pyx_n_s_solver; - PyObject *__pyx_n_s_solver_2; - PyObject *__pyx_kp_u_solver_is_not_instance_of_Solve; - PyObject *__pyx_n_s_spec; - PyObject *__pyx_n_s_str_constraints; - PyObject *__pyx_n_s_super; - PyObject *__pyx_n_s_sys; - PyObject *__pyx_n_s_test; - PyObject *__pyx_n_s_throw; - PyObject *__pyx_kp_s_tuple_list_tuple_dict_tuple_int; - PyObject *__pyx_n_s_typing; - PyObject *__pyx_n_s_v; - PyObject *__pyx_n_s_validate; - PyObject *__pyx_n_s_values; - PyObject *__pyx_n_s_variable; - PyObject *__pyx_n_s_variables; - PyObject *__pyx_n_s_variables_2; - PyObject *__pyx_n_s_vconstraints; - PyObject *__pyx_n_s_warn; - PyObject *__pyx_n_s_warnings; - PyObject *__pyx_n_s_zip; - PyObject *__pyx_slice__2; - PyObject *__pyx_tuple__3; - PyObject *__pyx_tuple__4; - PyObject *__pyx_tuple__7; - PyObject *__pyx_tuple__9; - PyObject *__pyx_tuple__10; - PyObject *__pyx_tuple__14; - PyObject *__pyx_tuple__16; - PyObject *__pyx_tuple__18; - PyObject *__pyx_tuple__20; - PyObject *__pyx_tuple__24; - PyObject *__pyx_tuple__26; - PyObject *__pyx_tuple__28; - PyObject *__pyx_tuple__30; - PyObject *__pyx_tuple__32; - PyObject *__pyx_codeobj__8; - PyObject *__pyx_codeobj__11; - PyObject *__pyx_codeobj__12; - PyObject *__pyx_codeobj__13; - PyObject *__pyx_codeobj__15; - PyObject *__pyx_codeobj__17; - PyObject *__pyx_codeobj__19; - PyObject *__pyx_codeobj__21; - PyObject *__pyx_codeobj__22; - PyObject *__pyx_codeobj__23; - PyObject *__pyx_codeobj__25; - PyObject *__pyx_codeobj__27; - PyObject *__pyx_codeobj__31; -} __pyx_mstate; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; + PyObject *__pyx_slice[1]; + PyObject *__pyx_tuple[4]; + PyObject *__pyx_codeobj_tab[17]; + PyObject *__pyx_string_tab[173]; +/* #### Code section: module_state_contents ### */ + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *__pyx_freelist_10constraint_7problem___pyx_scope_struct__genexpr[8]; +int __pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *__pyx_freelist_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList[8]; +int __pyx_freecount_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *__pyx_freelist_10constraint_7problem___pyx_scope_struct_2_genexpr[8]; +int __pyx_freecount_10constraint_7problem___pyx_scope_struct_2_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *__pyx_freelist_10constraint_7problem___pyx_scope_struct_3_genexpr[8]; +int __pyx_freecount_10constraint_7problem___pyx_scope_struct_3_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *__pyx_freelist_10constraint_7problem___pyx_scope_struct_4_genexpr[8]; +int __pyx_freecount_10constraint_7problem___pyx_scope_struct_4_genexpr; +#endif +/* CachedMethodType.module_state_decls */ +#if CYTHON_COMPILING_IN_LIMITED_API +PyObject *__Pyx_CachedMethodType; +#endif + +/* CodeObjectCache.module_state_decls */ +struct __Pyx_CodeObjectCache __pyx_code_cache; + +/* IterNextPlain.module_state_decls */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 +PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache; +#endif + +/* #### Code section: module_state_end ### */ +} __pyx_mstatetype; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { - extern struct PyModuleDef __pyx_moduledef; +extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif -#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) +#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef))) -#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) - -#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) +#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef)) #else -static __pyx_mstate __pyx_mstate_global_static = +static __pyx_mstatetype __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif -static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; -#endif +static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: constant_name_defines ### */ +#define __pyx_kp_u_ __pyx_string_tab[0] +#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_size_dict __pyx_string_tab[146] +#define __pyx_n_u_size_list __pyx_string_tab[147] +#define __pyx_n_u_solution __pyx_string_tab[148] +#define __pyx_n_u_solutions __pyx_string_tab[149] +#define __pyx_n_u_solutions_dict __pyx_string_tab[150] +#define __pyx_n_u_solutions_list __pyx_string_tab[151] +#define __pyx_n_u_solver __pyx_string_tab[152] +#define __pyx_n_u_solver_2 __pyx_string_tab[153] +#define __pyx_kp_u_solver_is_not_instance_of_Solve __pyx_string_tab[154] +#define __pyx_n_u_spec __pyx_string_tab[155] +#define __pyx_n_u_str_constraints __pyx_string_tab[156] +#define __pyx_n_u_sys __pyx_string_tab[157] +#define __pyx_n_u_test __pyx_string_tab[158] +#define __pyx_n_u_throw __pyx_string_tab[159] +#define __pyx_kp_u_tuple_list_tuple_dict_tuple_int __pyx_string_tab[160] +#define __pyx_n_u_typing __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] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE -static int __pyx_m_clear(PyObject *m) { - __pyx_mstate *clear_module_state = __pyx_mstate(m); +static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { + __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); @@ -3028,6 +3183,9 @@ static int __pyx_m_clear(PyObject *m) { #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif + #if CYTHON_PEP489_MULTI_PHASE_INIT + __Pyx_State_RemoveModule(NULL); + #endif Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_7problem___pyx_scope_struct__genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList); @@ -3038,219 +3196,24 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr); 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); - Py_CLEAR(clear_module_state->__pyx_kp_u_); - Py_CLEAR(clear_module_state->__pyx_kp_u_Add_a_constraint_to_the_problem); - Py_CLEAR(clear_module_state->__pyx_kp_u_Add_a_variable_to_the_problem_Ex); - Py_CLEAR(clear_module_state->__pyx_kp_u_Add_one_or_more_variables_to_the); - Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); - Py_CLEAR(clear_module_state->__pyx_n_s_Callable); - Py_CLEAR(clear_module_state->__pyx_kp_u_Change_the_problem_solver_curren); - Py_CLEAR(clear_module_state->__pyx_kp_s_Class_used_to_define_a_problem_a); - Py_CLEAR(clear_module_state->__pyx_n_s_CompilableFunctionConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_Constraint); - Py_CLEAR(clear_module_state->__pyx_kp_u_Constraints_must_be_instances_of); - Py_CLEAR(clear_module_state->__pyx_n_s_Domain); - Py_CLEAR(clear_module_state->__pyx_kp_u_Domain_is_empty); - Py_CLEAR(clear_module_state->__pyx_kp_u_Domains_must_be_instances_of_sub); - Py_CLEAR(clear_module_state->__pyx_kp_u_Expected_constraints_to_be_strin); - Py_CLEAR(clear_module_state->__pyx_kp_u_Find_and_return_a_solution_to_th); - Py_CLEAR(clear_module_state->__pyx_kp_u_Find_and_return_all_solutions_to); - Py_CLEAR(clear_module_state->__pyx_n_s_FunctionConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_Hashable); - Py_CLEAR(clear_module_state->__pyx_n_s_ImportError); - Py_CLEAR(clear_module_state->__pyx_kp_u_Obtain_the_problem_solver_curren); - Py_CLEAR(clear_module_state->__pyx_n_s_OptimizedBacktrackingSolver); - Py_CLEAR(clear_module_state->__pyx_n_s_Optional); - Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_Sequence); - Py_CLEAR(clear_module_state->__pyx_n_s_ParallelSolver); - Py_CLEAR(clear_module_state->__pyx_kp_u_ParallelSolver_is_currently_expe); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem___init); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem__getArgs); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem__getArgs_locals_genexpr); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_addConstraint); - Py_CLEAR(clear_module_state->__pyx_kp_u_Problem_addConstraint_line_139); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_addConstraint_locals_gen); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_addVariable); - Py_CLEAR(clear_module_state->__pyx_kp_u_Problem_addVariable_line_86); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_addVariables); - Py_CLEAR(clear_module_state->__pyx_kp_u_Problem_addVariables_line_116); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_getSolution); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_getSolutionIter); - Py_CLEAR(clear_module_state->__pyx_kp_u_Problem_getSolutionIter_line_216); - Py_CLEAR(clear_module_state->__pyx_kp_u_Problem_getSolution_line_178); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_getSolutions); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_getSolutionsAsListDict); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_getSolutionsOrderedList); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_getSolutionsOrderedList_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_Problem_getSolutions_line_197); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_getSolver); - Py_CLEAR(clear_module_state->__pyx_kp_u_Problem_getSolver_line_72); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_reset); - Py_CLEAR(clear_module_state->__pyx_kp_u_Problem_reset_line_44); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_setSolver); - Py_CLEAR(clear_module_state->__pyx_kp_u_Problem_setSolver_line_57); - Py_CLEAR(clear_module_state->__pyx_kp_u_Reset_the_current_problem_defini); - Py_CLEAR(clear_module_state->__pyx_kp_u_Return_an_iterator_to_the_soluti); - Py_CLEAR(clear_module_state->__pyx_n_s_Sequence); - Py_CLEAR(clear_module_state->__pyx_n_s_Solver); - Py_CLEAR(clear_module_state->__pyx_kp_u_Tried_to_insert_duplicated_varia); - Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); - Py_CLEAR(clear_module_state->__pyx_n_s_Union); - Py_CLEAR(clear_module_state->__pyx_kp_s_Union_Constraint_Callable_str); - Py_CLEAR(clear_module_state->__pyx_kp_u_Using_the_ParallelSolver_in_Thre); - Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); - Py_CLEAR(clear_module_state->__pyx_kp_u_You_have_used_FunctionConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s__29); - Py_CLEAR(clear_module_state->__pyx_n_s__33); - Py_CLEAR(clear_module_state->__pyx_n_s__5); - Py_CLEAR(clear_module_state->__pyx_kp_u__6); - Py_CLEAR(clear_module_state->__pyx_n_s_addConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_addVariable); - Py_CLEAR(clear_module_state->__pyx_n_s_addVariables); - Py_CLEAR(clear_module_state->__pyx_n_s_allvariables); - Py_CLEAR(clear_module_state->__pyx_n_s_append); - Py_CLEAR(clear_module_state->__pyx_n_s_args); - Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); - Py_CLEAR(clear_module_state->__pyx_n_s_bool); - Py_CLEAR(clear_module_state->__pyx_n_s_c); - Py_CLEAR(clear_module_state->__pyx_n_s_clear); - Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); - Py_CLEAR(clear_module_state->__pyx_n_s_close); - Py_CLEAR(clear_module_state->__pyx_n_s_collections_abc); - Py_CLEAR(clear_module_state->__pyx_n_s_compile_to_constraints); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_constraints); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_domain); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_parser); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_problem); - Py_CLEAR(clear_module_state->__pyx_kp_s_constraint_problem_py); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_solvers); - Py_CLEAR(clear_module_state->__pyx_n_s_constraints); - Py_CLEAR(clear_module_state->__pyx_n_s_constraints_2); - Py_CLEAR(clear_module_state->__pyx_n_s_copy); - Py_CLEAR(clear_module_state->__pyx_n_s_deepcopy); - Py_CLEAR(clear_module_state->__pyx_n_s_dict); - Py_CLEAR(clear_module_state->__pyx_kp_u_disable); - Py_CLEAR(clear_module_state->__pyx_n_s_doc); - Py_CLEAR(clear_module_state->__pyx_n_s_domain); - Py_CLEAR(clear_module_state->__pyx_n_s_domains); - Py_CLEAR(clear_module_state->__pyx_kp_u_duplicate_parameter_configurati); - Py_CLEAR(clear_module_state->__pyx_kp_u_enable); - Py_CLEAR(clear_module_state->__pyx_n_s_extend); - Py_CLEAR(clear_module_state->__pyx_n_s_freethreading); - Py_CLEAR(clear_module_state->__pyx_kp_u_gc); - Py_CLEAR(clear_module_state->__pyx_n_s_genexpr); - Py_CLEAR(clear_module_state->__pyx_n_s_getArgs); - Py_CLEAR(clear_module_state->__pyx_n_s_getSolution); - Py_CLEAR(clear_module_state->__pyx_n_s_getSolutionIter); - Py_CLEAR(clear_module_state->__pyx_n_s_getSolutions); - Py_CLEAR(clear_module_state->__pyx_n_s_getSolutionsAsListDict); - Py_CLEAR(clear_module_state->__pyx_n_s_getSolutionsOrderedList); - Py_CLEAR(clear_module_state->__pyx_n_s_getSolver); - Py_CLEAR(clear_module_state->__pyx_n_s_get_in_order); - Py_CLEAR(clear_module_state->__pyx_n_u_getitem); - Py_CLEAR(clear_module_state->__pyx_n_s_import); - Py_CLEAR(clear_module_state->__pyx_n_s_init); - Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); - Py_CLEAR(clear_module_state->__pyx_n_s_initializing); - Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); - Py_CLEAR(clear_module_state->__pyx_n_s_is_gil_enabled); - Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); - Py_CLEAR(clear_module_state->__pyx_n_s_itemgetter); - Py_CLEAR(clear_module_state->__pyx_n_s_keys); - Py_CLEAR(clear_module_state->__pyx_kp_s_list_str); - Py_CLEAR(clear_module_state->__pyx_kp_s_list_tuple); - Py_CLEAR(clear_module_state->__pyx_n_s_main); - Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); - Py_CLEAR(clear_module_state->__pyx_n_s_module); - Py_CLEAR(clear_module_state->__pyx_n_s_msg); - Py_CLEAR(clear_module_state->__pyx_n_s_name); - Py_CLEAR(clear_module_state->__pyx_n_s_operator); - Py_CLEAR(clear_module_state->__pyx_n_s_order); - Py_CLEAR(clear_module_state->__pyx_n_s_parsed); - Py_CLEAR(clear_module_state->__pyx_n_s_picklable); - Py_CLEAR(clear_module_state->__pyx_n_s_preProcess); - Py_CLEAR(clear_module_state->__pyx_n_s_prepare); - Py_CLEAR(clear_module_state->__pyx_n_s_process_mode); - Py_CLEAR(clear_module_state->__pyx_n_s_qualname); - Py_CLEAR(clear_module_state->__pyx_n_s_range); - Py_CLEAR(clear_module_state->__pyx_n_s_requires_pickling); - Py_CLEAR(clear_module_state->__pyx_n_s_reset); - Py_CLEAR(clear_module_state->__pyx_n_s_resetState); - Py_CLEAR(clear_module_state->__pyx_n_s_return); - Py_CLEAR(clear_module_state->__pyx_n_s_self); - Py_CLEAR(clear_module_state->__pyx_n_s_send); - Py_CLEAR(clear_module_state->__pyx_n_s_setSolver); - Py_CLEAR(clear_module_state->__pyx_n_s_set_name); - Py_CLEAR(clear_module_state->__pyx_n_s_size_dict); - Py_CLEAR(clear_module_state->__pyx_n_s_size_list); - Py_CLEAR(clear_module_state->__pyx_n_s_solutions); - Py_CLEAR(clear_module_state->__pyx_n_s_solutions_dict); - Py_CLEAR(clear_module_state->__pyx_n_s_solutions_list); - Py_CLEAR(clear_module_state->__pyx_n_s_solver); - Py_CLEAR(clear_module_state->__pyx_n_s_solver_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_solver_is_not_instance_of_Solve); - Py_CLEAR(clear_module_state->__pyx_n_s_spec); - Py_CLEAR(clear_module_state->__pyx_n_s_str_constraints); - Py_CLEAR(clear_module_state->__pyx_n_s_super); - Py_CLEAR(clear_module_state->__pyx_n_s_sys); - Py_CLEAR(clear_module_state->__pyx_n_s_test); - Py_CLEAR(clear_module_state->__pyx_n_s_throw); - Py_CLEAR(clear_module_state->__pyx_kp_s_tuple_list_tuple_dict_tuple_int); - Py_CLEAR(clear_module_state->__pyx_n_s_typing); - Py_CLEAR(clear_module_state->__pyx_n_s_v); - Py_CLEAR(clear_module_state->__pyx_n_s_validate); - Py_CLEAR(clear_module_state->__pyx_n_s_values); - Py_CLEAR(clear_module_state->__pyx_n_s_variable); - Py_CLEAR(clear_module_state->__pyx_n_s_variables); - Py_CLEAR(clear_module_state->__pyx_n_s_variables_2); - Py_CLEAR(clear_module_state->__pyx_n_s_vconstraints); - Py_CLEAR(clear_module_state->__pyx_n_s_warn); - Py_CLEAR(clear_module_state->__pyx_n_s_warnings); - Py_CLEAR(clear_module_state->__pyx_n_s_zip); - Py_CLEAR(clear_module_state->__pyx_slice__2); - Py_CLEAR(clear_module_state->__pyx_tuple__3); - Py_CLEAR(clear_module_state->__pyx_tuple__4); - Py_CLEAR(clear_module_state->__pyx_tuple__7); - Py_CLEAR(clear_module_state->__pyx_tuple__9); - Py_CLEAR(clear_module_state->__pyx_tuple__10); - Py_CLEAR(clear_module_state->__pyx_tuple__14); - Py_CLEAR(clear_module_state->__pyx_tuple__16); - Py_CLEAR(clear_module_state->__pyx_tuple__18); - Py_CLEAR(clear_module_state->__pyx_tuple__20); - Py_CLEAR(clear_module_state->__pyx_tuple__24); - Py_CLEAR(clear_module_state->__pyx_tuple__26); - Py_CLEAR(clear_module_state->__pyx_tuple__28); - Py_CLEAR(clear_module_state->__pyx_tuple__30); - Py_CLEAR(clear_module_state->__pyx_tuple__32); - Py_CLEAR(clear_module_state->__pyx_codeobj__8); - Py_CLEAR(clear_module_state->__pyx_codeobj__11); - Py_CLEAR(clear_module_state->__pyx_codeobj__12); - Py_CLEAR(clear_module_state->__pyx_codeobj__13); - Py_CLEAR(clear_module_state->__pyx_codeobj__15); - Py_CLEAR(clear_module_state->__pyx_codeobj__17); - Py_CLEAR(clear_module_state->__pyx_codeobj__19); - Py_CLEAR(clear_module_state->__pyx_codeobj__21); - Py_CLEAR(clear_module_state->__pyx_codeobj__22); - Py_CLEAR(clear_module_state->__pyx_codeobj__23); - Py_CLEAR(clear_module_state->__pyx_codeobj__25); - Py_CLEAR(clear_module_state->__pyx_codeobj__27); - Py_CLEAR(clear_module_state->__pyx_codeobj__31); + 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<17; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<173; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE -static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { - __pyx_mstate *traverse_module_state = __pyx_mstate(m); +static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); - Py_VISIT(traverse_module_state->__pyx_empty_tuple); - Py_VISIT(traverse_module_state->__pyx_empty_bytes); - Py_VISIT(traverse_module_state->__pyx_empty_unicode); + __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 @@ -3267,444 +3230,13 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr); 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); - Py_VISIT(traverse_module_state->__pyx_kp_u_); - Py_VISIT(traverse_module_state->__pyx_kp_u_Add_a_constraint_to_the_problem); - Py_VISIT(traverse_module_state->__pyx_kp_u_Add_a_variable_to_the_problem_Ex); - Py_VISIT(traverse_module_state->__pyx_kp_u_Add_one_or_more_variables_to_the); - Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); - Py_VISIT(traverse_module_state->__pyx_n_s_Callable); - Py_VISIT(traverse_module_state->__pyx_kp_u_Change_the_problem_solver_curren); - Py_VISIT(traverse_module_state->__pyx_kp_s_Class_used_to_define_a_problem_a); - Py_VISIT(traverse_module_state->__pyx_n_s_CompilableFunctionConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_Constraint); - Py_VISIT(traverse_module_state->__pyx_kp_u_Constraints_must_be_instances_of); - Py_VISIT(traverse_module_state->__pyx_n_s_Domain); - Py_VISIT(traverse_module_state->__pyx_kp_u_Domain_is_empty); - Py_VISIT(traverse_module_state->__pyx_kp_u_Domains_must_be_instances_of_sub); - Py_VISIT(traverse_module_state->__pyx_kp_u_Expected_constraints_to_be_strin); - Py_VISIT(traverse_module_state->__pyx_kp_u_Find_and_return_a_solution_to_th); - Py_VISIT(traverse_module_state->__pyx_kp_u_Find_and_return_all_solutions_to); - Py_VISIT(traverse_module_state->__pyx_n_s_FunctionConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_Hashable); - Py_VISIT(traverse_module_state->__pyx_n_s_ImportError); - Py_VISIT(traverse_module_state->__pyx_kp_u_Obtain_the_problem_solver_curren); - Py_VISIT(traverse_module_state->__pyx_n_s_OptimizedBacktrackingSolver); - Py_VISIT(traverse_module_state->__pyx_n_s_Optional); - Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_Sequence); - Py_VISIT(traverse_module_state->__pyx_n_s_ParallelSolver); - Py_VISIT(traverse_module_state->__pyx_kp_u_ParallelSolver_is_currently_expe); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem___init); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem__getArgs); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem__getArgs_locals_genexpr); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_addConstraint); - Py_VISIT(traverse_module_state->__pyx_kp_u_Problem_addConstraint_line_139); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_addConstraint_locals_gen); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_addVariable); - Py_VISIT(traverse_module_state->__pyx_kp_u_Problem_addVariable_line_86); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_addVariables); - Py_VISIT(traverse_module_state->__pyx_kp_u_Problem_addVariables_line_116); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_getSolution); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_getSolutionIter); - Py_VISIT(traverse_module_state->__pyx_kp_u_Problem_getSolutionIter_line_216); - Py_VISIT(traverse_module_state->__pyx_kp_u_Problem_getSolution_line_178); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_getSolutions); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_getSolutionsAsListDict); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_getSolutionsOrderedList); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_getSolutionsOrderedList_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_Problem_getSolutions_line_197); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_getSolver); - Py_VISIT(traverse_module_state->__pyx_kp_u_Problem_getSolver_line_72); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_reset); - Py_VISIT(traverse_module_state->__pyx_kp_u_Problem_reset_line_44); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_setSolver); - Py_VISIT(traverse_module_state->__pyx_kp_u_Problem_setSolver_line_57); - Py_VISIT(traverse_module_state->__pyx_kp_u_Reset_the_current_problem_defini); - Py_VISIT(traverse_module_state->__pyx_kp_u_Return_an_iterator_to_the_soluti); - Py_VISIT(traverse_module_state->__pyx_n_s_Sequence); - Py_VISIT(traverse_module_state->__pyx_n_s_Solver); - Py_VISIT(traverse_module_state->__pyx_kp_u_Tried_to_insert_duplicated_varia); - Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); - Py_VISIT(traverse_module_state->__pyx_n_s_Union); - Py_VISIT(traverse_module_state->__pyx_kp_s_Union_Constraint_Callable_str); - Py_VISIT(traverse_module_state->__pyx_kp_u_Using_the_ParallelSolver_in_Thre); - Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); - Py_VISIT(traverse_module_state->__pyx_kp_u_You_have_used_FunctionConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s__29); - Py_VISIT(traverse_module_state->__pyx_n_s__33); - Py_VISIT(traverse_module_state->__pyx_n_s__5); - Py_VISIT(traverse_module_state->__pyx_kp_u__6); - Py_VISIT(traverse_module_state->__pyx_n_s_addConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_addVariable); - Py_VISIT(traverse_module_state->__pyx_n_s_addVariables); - Py_VISIT(traverse_module_state->__pyx_n_s_allvariables); - Py_VISIT(traverse_module_state->__pyx_n_s_append); - Py_VISIT(traverse_module_state->__pyx_n_s_args); - Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); - Py_VISIT(traverse_module_state->__pyx_n_s_bool); - Py_VISIT(traverse_module_state->__pyx_n_s_c); - Py_VISIT(traverse_module_state->__pyx_n_s_clear); - Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); - Py_VISIT(traverse_module_state->__pyx_n_s_close); - Py_VISIT(traverse_module_state->__pyx_n_s_collections_abc); - Py_VISIT(traverse_module_state->__pyx_n_s_compile_to_constraints); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_constraints); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_domain); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_parser); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_problem); - Py_VISIT(traverse_module_state->__pyx_kp_s_constraint_problem_py); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_solvers); - Py_VISIT(traverse_module_state->__pyx_n_s_constraints); - Py_VISIT(traverse_module_state->__pyx_n_s_constraints_2); - Py_VISIT(traverse_module_state->__pyx_n_s_copy); - Py_VISIT(traverse_module_state->__pyx_n_s_deepcopy); - Py_VISIT(traverse_module_state->__pyx_n_s_dict); - Py_VISIT(traverse_module_state->__pyx_kp_u_disable); - Py_VISIT(traverse_module_state->__pyx_n_s_doc); - Py_VISIT(traverse_module_state->__pyx_n_s_domain); - Py_VISIT(traverse_module_state->__pyx_n_s_domains); - Py_VISIT(traverse_module_state->__pyx_kp_u_duplicate_parameter_configurati); - Py_VISIT(traverse_module_state->__pyx_kp_u_enable); - Py_VISIT(traverse_module_state->__pyx_n_s_extend); - Py_VISIT(traverse_module_state->__pyx_n_s_freethreading); - Py_VISIT(traverse_module_state->__pyx_kp_u_gc); - Py_VISIT(traverse_module_state->__pyx_n_s_genexpr); - Py_VISIT(traverse_module_state->__pyx_n_s_getArgs); - Py_VISIT(traverse_module_state->__pyx_n_s_getSolution); - Py_VISIT(traverse_module_state->__pyx_n_s_getSolutionIter); - Py_VISIT(traverse_module_state->__pyx_n_s_getSolutions); - Py_VISIT(traverse_module_state->__pyx_n_s_getSolutionsAsListDict); - Py_VISIT(traverse_module_state->__pyx_n_s_getSolutionsOrderedList); - Py_VISIT(traverse_module_state->__pyx_n_s_getSolver); - Py_VISIT(traverse_module_state->__pyx_n_s_get_in_order); - Py_VISIT(traverse_module_state->__pyx_n_u_getitem); - Py_VISIT(traverse_module_state->__pyx_n_s_import); - Py_VISIT(traverse_module_state->__pyx_n_s_init); - Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); - Py_VISIT(traverse_module_state->__pyx_n_s_initializing); - Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); - Py_VISIT(traverse_module_state->__pyx_n_s_is_gil_enabled); - Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); - Py_VISIT(traverse_module_state->__pyx_n_s_itemgetter); - Py_VISIT(traverse_module_state->__pyx_n_s_keys); - Py_VISIT(traverse_module_state->__pyx_kp_s_list_str); - Py_VISIT(traverse_module_state->__pyx_kp_s_list_tuple); - Py_VISIT(traverse_module_state->__pyx_n_s_main); - Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); - Py_VISIT(traverse_module_state->__pyx_n_s_module); - Py_VISIT(traverse_module_state->__pyx_n_s_msg); - Py_VISIT(traverse_module_state->__pyx_n_s_name); - Py_VISIT(traverse_module_state->__pyx_n_s_operator); - Py_VISIT(traverse_module_state->__pyx_n_s_order); - Py_VISIT(traverse_module_state->__pyx_n_s_parsed); - Py_VISIT(traverse_module_state->__pyx_n_s_picklable); - Py_VISIT(traverse_module_state->__pyx_n_s_preProcess); - Py_VISIT(traverse_module_state->__pyx_n_s_prepare); - Py_VISIT(traverse_module_state->__pyx_n_s_process_mode); - Py_VISIT(traverse_module_state->__pyx_n_s_qualname); - Py_VISIT(traverse_module_state->__pyx_n_s_range); - Py_VISIT(traverse_module_state->__pyx_n_s_requires_pickling); - Py_VISIT(traverse_module_state->__pyx_n_s_reset); - Py_VISIT(traverse_module_state->__pyx_n_s_resetState); - Py_VISIT(traverse_module_state->__pyx_n_s_return); - Py_VISIT(traverse_module_state->__pyx_n_s_self); - Py_VISIT(traverse_module_state->__pyx_n_s_send); - Py_VISIT(traverse_module_state->__pyx_n_s_setSolver); - Py_VISIT(traverse_module_state->__pyx_n_s_set_name); - Py_VISIT(traverse_module_state->__pyx_n_s_size_dict); - Py_VISIT(traverse_module_state->__pyx_n_s_size_list); - Py_VISIT(traverse_module_state->__pyx_n_s_solutions); - Py_VISIT(traverse_module_state->__pyx_n_s_solutions_dict); - Py_VISIT(traverse_module_state->__pyx_n_s_solutions_list); - Py_VISIT(traverse_module_state->__pyx_n_s_solver); - Py_VISIT(traverse_module_state->__pyx_n_s_solver_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_solver_is_not_instance_of_Solve); - Py_VISIT(traverse_module_state->__pyx_n_s_spec); - Py_VISIT(traverse_module_state->__pyx_n_s_str_constraints); - Py_VISIT(traverse_module_state->__pyx_n_s_super); - Py_VISIT(traverse_module_state->__pyx_n_s_sys); - Py_VISIT(traverse_module_state->__pyx_n_s_test); - Py_VISIT(traverse_module_state->__pyx_n_s_throw); - Py_VISIT(traverse_module_state->__pyx_kp_s_tuple_list_tuple_dict_tuple_int); - Py_VISIT(traverse_module_state->__pyx_n_s_typing); - Py_VISIT(traverse_module_state->__pyx_n_s_v); - Py_VISIT(traverse_module_state->__pyx_n_s_validate); - Py_VISIT(traverse_module_state->__pyx_n_s_values); - Py_VISIT(traverse_module_state->__pyx_n_s_variable); - Py_VISIT(traverse_module_state->__pyx_n_s_variables); - Py_VISIT(traverse_module_state->__pyx_n_s_variables_2); - Py_VISIT(traverse_module_state->__pyx_n_s_vconstraints); - Py_VISIT(traverse_module_state->__pyx_n_s_warn); - Py_VISIT(traverse_module_state->__pyx_n_s_warnings); - Py_VISIT(traverse_module_state->__pyx_n_s_zip); - Py_VISIT(traverse_module_state->__pyx_slice__2); - Py_VISIT(traverse_module_state->__pyx_tuple__3); - Py_VISIT(traverse_module_state->__pyx_tuple__4); - Py_VISIT(traverse_module_state->__pyx_tuple__7); - Py_VISIT(traverse_module_state->__pyx_tuple__9); - Py_VISIT(traverse_module_state->__pyx_tuple__10); - Py_VISIT(traverse_module_state->__pyx_tuple__14); - Py_VISIT(traverse_module_state->__pyx_tuple__16); - Py_VISIT(traverse_module_state->__pyx_tuple__18); - Py_VISIT(traverse_module_state->__pyx_tuple__20); - Py_VISIT(traverse_module_state->__pyx_tuple__24); - Py_VISIT(traverse_module_state->__pyx_tuple__26); - Py_VISIT(traverse_module_state->__pyx_tuple__28); - Py_VISIT(traverse_module_state->__pyx_tuple__30); - Py_VISIT(traverse_module_state->__pyx_tuple__32); - Py_VISIT(traverse_module_state->__pyx_codeobj__8); - Py_VISIT(traverse_module_state->__pyx_codeobj__11); - Py_VISIT(traverse_module_state->__pyx_codeobj__12); - Py_VISIT(traverse_module_state->__pyx_codeobj__13); - Py_VISIT(traverse_module_state->__pyx_codeobj__15); - Py_VISIT(traverse_module_state->__pyx_codeobj__17); - Py_VISIT(traverse_module_state->__pyx_codeobj__19); - Py_VISIT(traverse_module_state->__pyx_codeobj__21); - Py_VISIT(traverse_module_state->__pyx_codeobj__22); - Py_VISIT(traverse_module_state->__pyx_codeobj__23); - Py_VISIT(traverse_module_state->__pyx_codeobj__25); - Py_VISIT(traverse_module_state->__pyx_codeobj__27); - Py_VISIT(traverse_module_state->__pyx_codeobj__31); + 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<17; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<173; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } return 0; } #endif -/* #### Code section: module_state_defines ### */ -#define __pyx_d __pyx_mstate_global->__pyx_d -#define __pyx_b __pyx_mstate_global->__pyx_b -#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime -#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple -#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes -#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode -#ifdef __Pyx_CyFunction_USED -#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType -#endif -#ifdef __Pyx_FusedFunction_USED -#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType -#endif -#ifdef __Pyx_Generator_USED -#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType -#endif -#ifdef __Pyx_IterableCoroutine_USED -#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType -#endif -#if CYTHON_USE_MODULE_STATE -#define __pyx_type_10constraint_7problem___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_type_10constraint_7problem___pyx_scope_struct__genexpr -#define __pyx_type_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList __pyx_mstate_global->__pyx_type_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList -#define __pyx_type_10constraint_7problem___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_type_10constraint_7problem___pyx_scope_struct_2_genexpr -#define __pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr -#define __pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr __pyx_mstate_global->__pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr -#endif -#define __pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr -#define __pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList __pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList -#define __pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr -#define __pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr -#define __pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr -#define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ -#define __pyx_kp_u_Add_a_constraint_to_the_problem __pyx_mstate_global->__pyx_kp_u_Add_a_constraint_to_the_problem -#define __pyx_kp_u_Add_a_variable_to_the_problem_Ex __pyx_mstate_global->__pyx_kp_u_Add_a_variable_to_the_problem_Ex -#define __pyx_kp_u_Add_one_or_more_variables_to_the __pyx_mstate_global->__pyx_kp_u_Add_one_or_more_variables_to_the -#define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError -#define __pyx_n_s_Callable __pyx_mstate_global->__pyx_n_s_Callable -#define __pyx_kp_u_Change_the_problem_solver_curren __pyx_mstate_global->__pyx_kp_u_Change_the_problem_solver_curren -#define __pyx_kp_s_Class_used_to_define_a_problem_a __pyx_mstate_global->__pyx_kp_s_Class_used_to_define_a_problem_a -#define __pyx_n_s_CompilableFunctionConstraint __pyx_mstate_global->__pyx_n_s_CompilableFunctionConstraint -#define __pyx_n_s_Constraint __pyx_mstate_global->__pyx_n_s_Constraint -#define __pyx_kp_u_Constraints_must_be_instances_of __pyx_mstate_global->__pyx_kp_u_Constraints_must_be_instances_of -#define __pyx_n_s_Domain __pyx_mstate_global->__pyx_n_s_Domain -#define __pyx_kp_u_Domain_is_empty __pyx_mstate_global->__pyx_kp_u_Domain_is_empty -#define __pyx_kp_u_Domains_must_be_instances_of_sub __pyx_mstate_global->__pyx_kp_u_Domains_must_be_instances_of_sub -#define __pyx_kp_u_Expected_constraints_to_be_strin __pyx_mstate_global->__pyx_kp_u_Expected_constraints_to_be_strin -#define __pyx_kp_u_Find_and_return_a_solution_to_th __pyx_mstate_global->__pyx_kp_u_Find_and_return_a_solution_to_th -#define __pyx_kp_u_Find_and_return_all_solutions_to __pyx_mstate_global->__pyx_kp_u_Find_and_return_all_solutions_to -#define __pyx_n_s_FunctionConstraint __pyx_mstate_global->__pyx_n_s_FunctionConstraint -#define __pyx_n_s_Hashable __pyx_mstate_global->__pyx_n_s_Hashable -#define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError -#define __pyx_kp_u_Obtain_the_problem_solver_curren __pyx_mstate_global->__pyx_kp_u_Obtain_the_problem_solver_curren -#define __pyx_n_s_OptimizedBacktrackingSolver __pyx_mstate_global->__pyx_n_s_OptimizedBacktrackingSolver -#define __pyx_n_s_Optional __pyx_mstate_global->__pyx_n_s_Optional -#define __pyx_kp_s_Optional_Sequence __pyx_mstate_global->__pyx_kp_s_Optional_Sequence -#define __pyx_n_s_ParallelSolver __pyx_mstate_global->__pyx_n_s_ParallelSolver -#define __pyx_kp_u_ParallelSolver_is_currently_expe __pyx_mstate_global->__pyx_kp_u_ParallelSolver_is_currently_expe -#define __pyx_n_s_Problem __pyx_mstate_global->__pyx_n_s_Problem -#define __pyx_n_s_Problem___init __pyx_mstate_global->__pyx_n_s_Problem___init -#define __pyx_n_s_Problem__getArgs __pyx_mstate_global->__pyx_n_s_Problem__getArgs -#define __pyx_n_s_Problem__getArgs_locals_genexpr __pyx_mstate_global->__pyx_n_s_Problem__getArgs_locals_genexpr -#define __pyx_n_s_Problem_addConstraint __pyx_mstate_global->__pyx_n_s_Problem_addConstraint -#define __pyx_kp_u_Problem_addConstraint_line_139 __pyx_mstate_global->__pyx_kp_u_Problem_addConstraint_line_139 -#define __pyx_n_s_Problem_addConstraint_locals_gen __pyx_mstate_global->__pyx_n_s_Problem_addConstraint_locals_gen -#define __pyx_n_s_Problem_addVariable __pyx_mstate_global->__pyx_n_s_Problem_addVariable -#define __pyx_kp_u_Problem_addVariable_line_86 __pyx_mstate_global->__pyx_kp_u_Problem_addVariable_line_86 -#define __pyx_n_s_Problem_addVariables __pyx_mstate_global->__pyx_n_s_Problem_addVariables -#define __pyx_kp_u_Problem_addVariables_line_116 __pyx_mstate_global->__pyx_kp_u_Problem_addVariables_line_116 -#define __pyx_n_s_Problem_getSolution __pyx_mstate_global->__pyx_n_s_Problem_getSolution -#define __pyx_n_s_Problem_getSolutionIter __pyx_mstate_global->__pyx_n_s_Problem_getSolutionIter -#define __pyx_kp_u_Problem_getSolutionIter_line_216 __pyx_mstate_global->__pyx_kp_u_Problem_getSolutionIter_line_216 -#define __pyx_kp_u_Problem_getSolution_line_178 __pyx_mstate_global->__pyx_kp_u_Problem_getSolution_line_178 -#define __pyx_n_s_Problem_getSolutions __pyx_mstate_global->__pyx_n_s_Problem_getSolutions -#define __pyx_n_s_Problem_getSolutionsAsListDict __pyx_mstate_global->__pyx_n_s_Problem_getSolutionsAsListDict -#define __pyx_n_s_Problem_getSolutionsOrderedList __pyx_mstate_global->__pyx_n_s_Problem_getSolutionsOrderedList -#define __pyx_n_s_Problem_getSolutionsOrderedList_2 __pyx_mstate_global->__pyx_n_s_Problem_getSolutionsOrderedList_2 -#define __pyx_kp_u_Problem_getSolutions_line_197 __pyx_mstate_global->__pyx_kp_u_Problem_getSolutions_line_197 -#define __pyx_n_s_Problem_getSolver __pyx_mstate_global->__pyx_n_s_Problem_getSolver -#define __pyx_kp_u_Problem_getSolver_line_72 __pyx_mstate_global->__pyx_kp_u_Problem_getSolver_line_72 -#define __pyx_n_s_Problem_reset __pyx_mstate_global->__pyx_n_s_Problem_reset -#define __pyx_kp_u_Problem_reset_line_44 __pyx_mstate_global->__pyx_kp_u_Problem_reset_line_44 -#define __pyx_n_s_Problem_setSolver __pyx_mstate_global->__pyx_n_s_Problem_setSolver -#define __pyx_kp_u_Problem_setSolver_line_57 __pyx_mstate_global->__pyx_kp_u_Problem_setSolver_line_57 -#define __pyx_kp_u_Reset_the_current_problem_defini __pyx_mstate_global->__pyx_kp_u_Reset_the_current_problem_defini -#define __pyx_kp_u_Return_an_iterator_to_the_soluti __pyx_mstate_global->__pyx_kp_u_Return_an_iterator_to_the_soluti -#define __pyx_n_s_Sequence __pyx_mstate_global->__pyx_n_s_Sequence -#define __pyx_n_s_Solver __pyx_mstate_global->__pyx_n_s_Solver -#define __pyx_kp_u_Tried_to_insert_duplicated_varia __pyx_mstate_global->__pyx_kp_u_Tried_to_insert_duplicated_varia -#define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError -#define __pyx_n_s_Union __pyx_mstate_global->__pyx_n_s_Union -#define __pyx_kp_s_Union_Constraint_Callable_str __pyx_mstate_global->__pyx_kp_s_Union_Constraint_Callable_str -#define __pyx_kp_u_Using_the_ParallelSolver_in_Thre __pyx_mstate_global->__pyx_kp_u_Using_the_ParallelSolver_in_Thre -#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError -#define __pyx_kp_u_You_have_used_FunctionConstraint __pyx_mstate_global->__pyx_kp_u_You_have_used_FunctionConstraint -#define __pyx_n_s__29 __pyx_mstate_global->__pyx_n_s__29 -#define __pyx_n_s__33 __pyx_mstate_global->__pyx_n_s__33 -#define __pyx_n_s__5 __pyx_mstate_global->__pyx_n_s__5 -#define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6 -#define __pyx_n_s_addConstraint __pyx_mstate_global->__pyx_n_s_addConstraint -#define __pyx_n_s_addVariable __pyx_mstate_global->__pyx_n_s_addVariable -#define __pyx_n_s_addVariables __pyx_mstate_global->__pyx_n_s_addVariables -#define __pyx_n_s_allvariables __pyx_mstate_global->__pyx_n_s_allvariables -#define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append -#define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args -#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines -#define __pyx_n_s_bool __pyx_mstate_global->__pyx_n_s_bool -#define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c -#define __pyx_n_s_clear __pyx_mstate_global->__pyx_n_s_clear -#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback -#define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close -#define __pyx_n_s_collections_abc __pyx_mstate_global->__pyx_n_s_collections_abc -#define __pyx_n_s_compile_to_constraints __pyx_mstate_global->__pyx_n_s_compile_to_constraints -#define __pyx_n_s_constraint __pyx_mstate_global->__pyx_n_s_constraint -#define __pyx_n_s_constraint_constraints __pyx_mstate_global->__pyx_n_s_constraint_constraints -#define __pyx_n_s_constraint_domain __pyx_mstate_global->__pyx_n_s_constraint_domain -#define __pyx_n_s_constraint_parser __pyx_mstate_global->__pyx_n_s_constraint_parser -#define __pyx_n_s_constraint_problem __pyx_mstate_global->__pyx_n_s_constraint_problem -#define __pyx_kp_s_constraint_problem_py __pyx_mstate_global->__pyx_kp_s_constraint_problem_py -#define __pyx_n_s_constraint_solvers __pyx_mstate_global->__pyx_n_s_constraint_solvers -#define __pyx_n_s_constraints __pyx_mstate_global->__pyx_n_s_constraints -#define __pyx_n_s_constraints_2 __pyx_mstate_global->__pyx_n_s_constraints_2 -#define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy -#define __pyx_n_s_deepcopy __pyx_mstate_global->__pyx_n_s_deepcopy -#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict -#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable -#define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc -#define __pyx_n_s_domain __pyx_mstate_global->__pyx_n_s_domain -#define __pyx_n_s_domains __pyx_mstate_global->__pyx_n_s_domains -#define __pyx_kp_u_duplicate_parameter_configurati __pyx_mstate_global->__pyx_kp_u_duplicate_parameter_configurati -#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable -#define __pyx_n_s_extend __pyx_mstate_global->__pyx_n_s_extend -#define __pyx_n_s_freethreading __pyx_mstate_global->__pyx_n_s_freethreading -#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc -#define __pyx_n_s_genexpr __pyx_mstate_global->__pyx_n_s_genexpr -#define __pyx_n_s_getArgs __pyx_mstate_global->__pyx_n_s_getArgs -#define __pyx_n_s_getSolution __pyx_mstate_global->__pyx_n_s_getSolution -#define __pyx_n_s_getSolutionIter __pyx_mstate_global->__pyx_n_s_getSolutionIter -#define __pyx_n_s_getSolutions __pyx_mstate_global->__pyx_n_s_getSolutions -#define __pyx_n_s_getSolutionsAsListDict __pyx_mstate_global->__pyx_n_s_getSolutionsAsListDict -#define __pyx_n_s_getSolutionsOrderedList __pyx_mstate_global->__pyx_n_s_getSolutionsOrderedList -#define __pyx_n_s_getSolver __pyx_mstate_global->__pyx_n_s_getSolver -#define __pyx_n_s_get_in_order __pyx_mstate_global->__pyx_n_s_get_in_order -#define __pyx_n_u_getitem __pyx_mstate_global->__pyx_n_u_getitem -#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import -#define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init -#define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass -#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing -#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine -#define __pyx_n_s_is_gil_enabled __pyx_mstate_global->__pyx_n_s_is_gil_enabled -#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled -#define __pyx_n_s_itemgetter __pyx_mstate_global->__pyx_n_s_itemgetter -#define __pyx_n_s_keys __pyx_mstate_global->__pyx_n_s_keys -#define __pyx_kp_s_list_str __pyx_mstate_global->__pyx_kp_s_list_str -#define __pyx_kp_s_list_tuple __pyx_mstate_global->__pyx_kp_s_list_tuple -#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main -#define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass -#define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module -#define __pyx_n_s_msg __pyx_mstate_global->__pyx_n_s_msg -#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name -#define __pyx_n_s_operator __pyx_mstate_global->__pyx_n_s_operator -#define __pyx_n_s_order __pyx_mstate_global->__pyx_n_s_order -#define __pyx_n_s_parsed __pyx_mstate_global->__pyx_n_s_parsed -#define __pyx_n_s_picklable __pyx_mstate_global->__pyx_n_s_picklable -#define __pyx_n_s_preProcess __pyx_mstate_global->__pyx_n_s_preProcess -#define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare -#define __pyx_n_s_process_mode __pyx_mstate_global->__pyx_n_s_process_mode -#define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname -#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range -#define __pyx_n_s_requires_pickling __pyx_mstate_global->__pyx_n_s_requires_pickling -#define __pyx_n_s_reset __pyx_mstate_global->__pyx_n_s_reset -#define __pyx_n_s_resetState __pyx_mstate_global->__pyx_n_s_resetState -#define __pyx_n_s_return __pyx_mstate_global->__pyx_n_s_return -#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self -#define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send -#define __pyx_n_s_setSolver __pyx_mstate_global->__pyx_n_s_setSolver -#define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name -#define __pyx_n_s_size_dict __pyx_mstate_global->__pyx_n_s_size_dict -#define __pyx_n_s_size_list __pyx_mstate_global->__pyx_n_s_size_list -#define __pyx_n_s_solutions __pyx_mstate_global->__pyx_n_s_solutions -#define __pyx_n_s_solutions_dict __pyx_mstate_global->__pyx_n_s_solutions_dict -#define __pyx_n_s_solutions_list __pyx_mstate_global->__pyx_n_s_solutions_list -#define __pyx_n_s_solver __pyx_mstate_global->__pyx_n_s_solver -#define __pyx_n_s_solver_2 __pyx_mstate_global->__pyx_n_s_solver_2 -#define __pyx_kp_u_solver_is_not_instance_of_Solve __pyx_mstate_global->__pyx_kp_u_solver_is_not_instance_of_Solve -#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec -#define __pyx_n_s_str_constraints __pyx_mstate_global->__pyx_n_s_str_constraints -#define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super -#define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys -#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test -#define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw -#define __pyx_kp_s_tuple_list_tuple_dict_tuple_int __pyx_mstate_global->__pyx_kp_s_tuple_list_tuple_dict_tuple_int -#define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing -#define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v -#define __pyx_n_s_validate __pyx_mstate_global->__pyx_n_s_validate -#define __pyx_n_s_values __pyx_mstate_global->__pyx_n_s_values -#define __pyx_n_s_variable __pyx_mstate_global->__pyx_n_s_variable -#define __pyx_n_s_variables __pyx_mstate_global->__pyx_n_s_variables -#define __pyx_n_s_variables_2 __pyx_mstate_global->__pyx_n_s_variables_2 -#define __pyx_n_s_vconstraints __pyx_mstate_global->__pyx_n_s_vconstraints -#define __pyx_n_s_warn __pyx_mstate_global->__pyx_n_s_warn -#define __pyx_n_s_warnings __pyx_mstate_global->__pyx_n_s_warnings -#define __pyx_n_s_zip __pyx_mstate_global->__pyx_n_s_zip -#define __pyx_slice__2 __pyx_mstate_global->__pyx_slice__2 -#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 -#define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 -#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 -#define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 -#define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 -#define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 -#define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 -#define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 -#define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 -#define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 -#define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 -#define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 -#define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 -#define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32 -#define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 -#define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 -#define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 -#define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 -#define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 -#define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 -#define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 -#define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 -#define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 -#define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 -#define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 -#define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 -#define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31 /* #### Code section: module_code ### */ /* "constraint/problem.py":24 @@ -3713,7 +3245,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { * def __init__(self, solver: Solver=None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_1__init__(PyObject *__pyx_self, @@ -3724,7 +3256,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7problem_7Problem___init__, "Initialization method.\n\n Args:\n solver (instance of a :py:class:`Solver`): Problem solver (default :py:class:`OptimizedBacktrackingSolver`)\n "); -static PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem___init__}; +static PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem___init__}; static PyObject *__pyx_pw_10constraint_7problem_7Problem_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3746,7 +3278,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -3754,47 +3286,41 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_solver,0}; - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + 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) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 24, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_solver); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 24, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 24, __pyx_L3_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 (!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) } } } else { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + 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) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) break; default: goto __pyx_L5_argtuple_error; } + if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None)); } __pyx_v_self = values[0]; __pyx_v_solver = values[1]; @@ -3805,11 +3331,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.problem.Problem.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3818,11 +3341,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_7problem_7Problem___init__(__pyx_self, __pyx_v_self, __pyx_v_solver); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -3836,15 +3356,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - unsigned int __pyx_t_6; - Py_ssize_t __pyx_t_7; - Py_UCS4 __pyx_t_8; + size_t __pyx_t_6; + PyObject *__pyx_t_7[3]; + int __pyx_t_8; int __pyx_t_9; - int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/problem.py":30 * solver (instance of a :py:class:`Solver`): Problem solver (default :py:class:`OptimizedBacktrackingSolver`) @@ -3852,7 +3371,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED * 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) if (!__pyx_t_2) { } else { @@ -3860,35 +3379,34 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED __pyx_t_1 = __pyx_v_solver; goto __pyx_L3_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OptimizedBacktrackingSolver); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; + __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_GOTREF(__pyx_t_5); + __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __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_4); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); + __pyx_t_6 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + 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_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) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __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_n_s_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, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/problem.py":31 @@ -3897,10 +3415,10 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED * 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_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_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, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/problem.py":32 @@ -3909,10 +3427,10 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED * 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_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_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, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/problem.py":33 @@ -3921,10 +3439,10 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED * 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_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_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, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/problem.py":36 @@ -3933,44 +3451,31 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED * assert isinstance(self._solver, Solver), f"`solver` is not instance of Solver class (is {type(self._solver)})." # <<<<<<<<<<<<<< * * # warn for experimental parallel solver - */ +*/ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_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, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_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, 36, __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_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 = PyTuple_New(3); 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, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = 0; - __pyx_t_8 = 127; - __Pyx_INCREF(__pyx_kp_u_solver_is_not_instance_of_Solve); - __pyx_t_7 += 45; - __Pyx_GIVEREF(__pyx_kp_u_solver_is_not_instance_of_Solve); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_solver_is_not_instance_of_Solve); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_solver_2); 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, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_t_1)), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __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) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_8; - __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_kp_u_); - __pyx_t_7 += 2; - __Pyx_GIVEREF(__pyx_kp_u_); - PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_); - __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 36, __pyx_L1_error) } } @@ -3984,14 +3489,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED * 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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_solver_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ParallelSolver); 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, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_IsInstance(__pyx_t_4, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __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_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_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 @@ -4000,32 +3505,31 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED * 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_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_warn); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = NULL; - __pyx_t_6 = 0; +*/ + __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_GOTREF(__pyx_t_5); + __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); + assert(__pyx_t_3); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); + __pyx_t_6 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_u_ParallelSolver_is_currently_expe}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + 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_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) + __Pyx_GOTREF(__pyx_t_1); } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/problem.py":41 * if isinstance(self._solver, ParallelSolver): @@ -4033,26 +3537,26 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED * if not self._solver._process_mode and not freethreading: # <<<<<<<<<<<<<< * warn("Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance.") * - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_process_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_10 = (!__pyx_t_9); - if (__pyx_t_10) { +*/ + __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_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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_9 = (!__pyx_t_8); + if (__pyx_t_9) { } else { - __pyx_t_2 = __pyx_t_10; + __pyx_t_2 = __pyx_t_9; goto __pyx_L7_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_freethreading); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = (!__pyx_t_10); - __pyx_t_2 = __pyx_t_9; + __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_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_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) { @@ -4062,32 +3566,31 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED * warn("Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance.") # <<<<<<<<<<<<<< * * def reset(self): - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_warn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); +*/ __pyx_t_1 = NULL; - __pyx_t_6 = 0; + __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_GOTREF(__pyx_t_3); + __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_6 = 1; - } + assert(__pyx_t_1); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); + __pyx_t_6 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_u_Using_the_ParallelSolver_in_Thre}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + 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_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/problem.py":41 * if isinstance(self._solver, ParallelSolver): @@ -4095,7 +3598,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED * if not self._solver._process_mode and not freethreading: # <<<<<<<<<<<<<< * warn("Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance.") * - */ +*/ } /* "constraint/problem.py":39 @@ -4104,7 +3607,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED * 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: - */ +*/ } /* "constraint/problem.py":24 @@ -4113,7 +3616,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED * def __init__(self, solver: Solver=None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -4137,7 +3640,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED * def reset(self): # <<<<<<<<<<<<<< * """Reset the current problem definition. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_3reset(PyObject *__pyx_self, @@ -4148,7 +3651,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7problem_7Problem_2reset, "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 PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_3reset = {"reset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_3reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_2reset}; +static PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_3reset = {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_3reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_2reset}; static PyObject *__pyx_pw_10constraint_7problem_7Problem_3reset(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4169,7 +3672,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -4177,33 +3680,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "reset") < 0)) __PYX_ERR(0, 44, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 44, __pyx_L3_error) } __pyx_v_self = values[0]; } @@ -4213,11 +3711,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.problem.Problem.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4226,11 +3721,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_7problem_7Problem_2reset(__pyx_self, __pyx_v_self); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -4242,11 +3734,11 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_2reset(CYTHON_UNUSED Py PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; + size_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("reset", 1); + __Pyx_RefNannySetupContext("reset", 0); /* "constraint/problem.py":54 * >>> @@ -4254,10 +3746,10 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_2reset(CYTHON_UNUSED Py * del self._constraints[:] # <<<<<<<<<<<<<< * self._variables.clear() * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_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, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_DelSlice(__pyx_t_1, 0, 0, NULL, NULL, &__pyx_slice__2, 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, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/problem.py":55 @@ -4266,33 +3758,19 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_2reset(CYTHON_UNUSED Py * self._variables.clear() # <<<<<<<<<<<<<< * * def setSolver(self, solver): - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_clear); 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, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; + __pyx_t_2 = __pyx_t_3; + __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } - } - #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + __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_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) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4302,7 +3780,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_2reset(CYTHON_UNUSED Py * def reset(self): # <<<<<<<<<<<<<< * """Reset the current problem definition. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -4325,7 +3803,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_2reset(CYTHON_UNUSED Py * def setSolver(self, solver): # <<<<<<<<<<<<<< * """Change the problem solver currently in use. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_5setSolver(PyObject *__pyx_self, @@ -4336,7 +3814,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7problem_7Problem_4setSolver, "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 PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_5setSolver = {"setSolver", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_5setSolver, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_4setSolver}; +static PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_5setSolver = {"setSolver", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_5setSolver, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_4setSolver}; static PyObject *__pyx_pw_10constraint_7problem_7Problem_5setSolver(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4358,7 +3836,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSolver (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -4366,46 +3844,34 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_solver,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + 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) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_solver)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("setSolver", 1, 2, 2, 1); __PYX_ERR(0, 57, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSolver") < 0)) __PYX_ERR(0, 57, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 57, __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) } __pyx_v_self = values[0]; __pyx_v_solver = values[1]; @@ -4416,11 +3882,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.problem.Problem.setSolver", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4429,11 +3892,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_7problem_7Problem_4setSolver(__pyx_self, __pyx_v_self, __pyx_v_solver); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -4445,7 +3905,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_4setSolver(CYTHON_UNUSE int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("setSolver", 1); + __Pyx_RefNannySetupContext("setSolver", 0); /* "constraint/problem.py":70 * solver @@ -4453,8 +3913,8 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_4setSolver(CYTHON_UNUSE * self._solver = solver # <<<<<<<<<<<<<< * * def getSolver(self): - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_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, 70, __pyx_L1_error) /* "constraint/problem.py":57 * self._variables.clear() @@ -4462,7 +3922,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_4setSolver(CYTHON_UNUSE * def setSolver(self, solver): # <<<<<<<<<<<<<< * """Change the problem solver currently in use. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -4482,7 +3942,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_4setSolver(CYTHON_UNUSE * def getSolver(self): # <<<<<<<<<<<<<< * """Obtain the problem solver currently in use. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_7getSolver(PyObject *__pyx_self, @@ -4493,7 +3953,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7problem_7Problem_6getSolver, "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 PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_7getSolver = {"getSolver", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_7getSolver, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_6getSolver}; +static PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_7getSolver = {"getSolver", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_7getSolver, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_6getSolver}; static PyObject *__pyx_pw_10constraint_7problem_7Problem_7getSolver(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4514,7 +3974,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolver (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -4522,33 +3982,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolver") < 0)) __PYX_ERR(0, 72, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 72, __pyx_L3_error) } __pyx_v_self = values[0]; } @@ -4558,11 +4013,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.problem.Problem.getSolver", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4571,11 +4023,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_7problem_7Problem_6getSolver(__pyx_self, __pyx_v_self); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -4588,7 +4037,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_6getSolver(CYTHON_UNUSE int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolver", 1); + __Pyx_RefNannySetupContext("getSolver", 0); /* "constraint/problem.py":84 * instance of a :py:class:`Solver` subclass: Solver currently in use @@ -4596,9 +4045,9 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_6getSolver(CYTHON_UNUSE * return self._solver # <<<<<<<<<<<<<< * * def addVariable(self, variable: Hashable, domain): - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_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, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4610,7 +4059,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_6getSolver(CYTHON_UNUSE * def getSolver(self): # <<<<<<<<<<<<<< * """Obtain the problem solver currently in use. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -4629,7 +4078,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_6getSolver(CYTHON_UNUSE * def addVariable(self, variable: Hashable, domain): # <<<<<<<<<<<<<< * """Add a variable to the problem. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_9addVariable(PyObject *__pyx_self, @@ -4640,7 +4089,7 @@ 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 "); -static PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_9addVariable = {"addVariable", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_9addVariable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_8addVariable}; +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 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4663,7 +4112,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addVariable (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -4671,59 +4120,40 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variable,&__pyx_n_s_domain,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + 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) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + 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) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variable)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("addVariable", 1, 3, 3, 1); __PYX_ERR(0, 86, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domain)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("addVariable", 1, 3, 3, 2); __PYX_ERR(0, 86, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addVariable") < 0)) __PYX_ERR(0, 86, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 86, __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) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 86, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variable = values[1]; @@ -4735,11 +4165,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.problem.Problem.addVariable", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4748,11 +4175,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_7problem_7Problem_8addVariable(__pyx_self, __pyx_v_self, __pyx_v_variable, __pyx_v_domain); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -4766,8 +4190,9 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - unsigned int __pyx_t_5; - int __pyx_t_6; + size_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -4780,8 +4205,8 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * 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_n_s_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, 102, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4793,13 +4218,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * msg = f"Tried to insert duplicated variable {repr(variable)}" # <<<<<<<<<<<<<< * raise ValueError(msg) * if isinstance(domain, Domain): - */ +*/ __pyx_t_1 = PyObject_Repr(__pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); 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, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__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, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_1); @@ -4811,9 +4236,19 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * raise ValueError(msg) # <<<<<<<<<<<<<< * if isinstance(domain, Domain): * domain = copy.deepcopy(domain) - */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); +*/ + __pyx_t_3 = NULL; + __Pyx_INCREF(__pyx_builtin_ValueError); + __pyx_t_4 = __pyx_builtin_ValueError; + __pyx_t_5 = 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_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) + __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) @@ -4824,7 +4259,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * if variable in self._variables: # <<<<<<<<<<<<<< * msg = f"Tried to insert duplicated variable {repr(variable)}" * raise ValueError(msg) - */ +*/ } /* "constraint/problem.py":105 @@ -4833,8 +4268,8 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * if isinstance(domain, Domain): # <<<<<<<<<<<<<< * domain = copy.deepcopy(domain) * elif hasattr(domain, "__getitem__"): - */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_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, 105, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4846,33 +4281,32 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * domain = copy.deepcopy(domain) # <<<<<<<<<<<<<< * elif hasattr(domain, "__getitem__"): * domain = Domain(domain) - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error) +*/ + __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_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __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_3 = NULL; - __pyx_t_5 = 0; + __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + 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_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); + __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_domain}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + 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) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; @@ -4883,7 +4317,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * if isinstance(domain, Domain): # <<<<<<<<<<<<<< * domain = copy.deepcopy(domain) * elif hasattr(domain, "__getitem__"): - */ +*/ goto __pyx_L4; } @@ -4893,8 +4327,8 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * elif hasattr(domain, "__getitem__"): # <<<<<<<<<<<<<< * domain = Domain(domain) * else: - */ - __pyx_t_2 = __Pyx_HasAttr(__pyx_v_domain, __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, 107, __pyx_L1_error) if (likely(__pyx_t_2)) { /* "constraint/problem.py":108 @@ -4903,30 +4337,29 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * domain = Domain(domain) # <<<<<<<<<<<<<< * else: * msg = "Domains must be instances of subclasses of the Domain class" - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Domain); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error) +*/ + __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_3 = NULL; - __pyx_t_5 = 0; + __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + __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); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_domain}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + 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) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; @@ -4937,7 +4370,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * elif hasattr(domain, "__getitem__"): # <<<<<<<<<<<<<< * domain = Domain(domain) * else: - */ +*/ goto __pyx_L4; } @@ -4947,10 +4380,10 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * msg = "Domains must be instances of subclasses of the Domain class" # <<<<<<<<<<<<<< * raise TypeError(msg) * if not domain: - */ +*/ /*else*/ { - __Pyx_INCREF(__pyx_kp_u_Domains_must_be_instances_of_sub); - __pyx_v_msg = __pyx_kp_u_Domains_must_be_instances_of_sub; + __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 * else: @@ -4958,9 +4391,19 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * raise TypeError(msg) # <<<<<<<<<<<<<< * if not domain: * raise ValueError("Domain is empty") - */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_v_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); +*/ + __pyx_t_4 = NULL; + __Pyx_INCREF(__pyx_builtin_TypeError); + __pyx_t_6 = __pyx_builtin_TypeError; + __pyx_t_5 = 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) + __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) @@ -4973,10 +4416,10 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * 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_6 = (!__pyx_t_2); - if (unlikely(__pyx_t_6)) { + __pyx_t_7 = (!__pyx_t_2); + if (unlikely(__pyx_t_7)) { /* "constraint/problem.py":113 * raise TypeError(msg) @@ -4984,9 +4427,19 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * raise ValueError("Domain is empty") # <<<<<<<<<<<<<< * self._variables[variable] = domain * - */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); +*/ + __pyx_t_6 = NULL; + __Pyx_INCREF(__pyx_builtin_ValueError); + __pyx_t_4 = __pyx_builtin_ValueError; + __pyx_t_5 = 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) + __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) @@ -4997,7 +4450,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * if not domain: # <<<<<<<<<<<<<< * raise ValueError("Domain is empty") * self._variables[variable] = domain - */ +*/ } /* "constraint/problem.py":114 @@ -5006,8 +4459,8 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * self._variables[variable] = domain # <<<<<<<<<<<<<< * * def addVariables(self, variables: Sequence, domain): - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_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, 114, __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) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5018,7 +4471,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * def addVariable(self, variable: Hashable, domain): # <<<<<<<<<<<<<< * """Add a variable to the problem. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -5027,6 +4480,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("constraint.problem.Problem.addVariable", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -5043,7 +4497,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * def addVariables(self, variables: Sequence, domain): # <<<<<<<<<<<<<< * """Add one or more variables to the problem. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_11addVariables(PyObject *__pyx_self, @@ -5054,7 +4508,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7problem_7Problem_10addVariables, "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 PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_11addVariables = {"addVariables", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_11addVariables, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_10addVariables}; +static PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_11addVariables = {"addVariables", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_11addVariables, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_10addVariables}; static PyObject *__pyx_pw_10constraint_7problem_7Problem_11addVariables(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -5077,7 +4531,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addVariables (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -5085,59 +4539,40 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables_2,&__pyx_n_s_domain,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + 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) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + 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) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables_2)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("addVariables", 1, 3, 3, 1); __PYX_ERR(0, 116, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domain)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("addVariables", 1, 3, 3, 2); __PYX_ERR(0, 116, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addVariables") < 0)) __PYX_ERR(0, 116, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 116, __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) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 116, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -5149,11 +4584,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.problem.Problem.addVariables", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5162,11 +4594,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_7problem_7Problem_10addVariables(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domain); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -5181,12 +4610,11 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - unsigned int __pyx_t_7; + size_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("addVariables", 1); + __Pyx_RefNannySetupContext("addVariables", 0); /* "constraint/problem.py":136 * may assume @@ -5194,7 +4622,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U * for variable in variables: # <<<<<<<<<<<<<< * self.addVariable(variable, domain) * - */ +*/ 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; @@ -5202,51 +4630,48 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U } 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_GOTREF(__pyx_t_1); - __pyx_t_3 = __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, 136, __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 136, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 136, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 136, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 136, __pyx_L1_error) + __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); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif + ++__pyx_t_2; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 136, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 136, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_4); } + __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; @@ -5256,30 +4681,16 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U * self.addVariable(variable, domain) # <<<<<<<<<<<<<< * * def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = None): - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_addVariable); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_7 = 1; - } - } - #endif +*/ + __pyx_t_5 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_5); + __pyx_t_6 = 0; { - PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_variable, __pyx_v_domain}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5289,7 +4700,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U * for variable in variables: # <<<<<<<<<<<<<< * self.addVariable(variable, domain) * - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5299,7 +4710,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U * def addVariables(self, variables: Sequence, domain): # <<<<<<<<<<<<<< * """Add one or more variables to the problem. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -5308,7 +4719,6 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("constraint.problem.Problem.addVariables", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -5324,7 +4734,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U * def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Add a constraint to the problem. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_13addConstraint(PyObject *__pyx_self, @@ -5335,7 +4745,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7problem_7Problem_12addConstraint, "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 PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_13addConstraint = {"addConstraint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_13addConstraint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_12addConstraint}; +static PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_13addConstraint = {"addConstraint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_13addConstraint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_12addConstraint}; static PyObject *__pyx_pw_10constraint_7problem_7Problem_13addConstraint(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -5358,7 +4768,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addConstraint (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -5366,60 +4776,47 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_constraint,&__pyx_n_s_variables_2,0}; - values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + 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) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + 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) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraint)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("addConstraint", 0, 2, 3, 1); __PYX_ERR(0, 139, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables_2); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addConstraint") < 0)) __PYX_ERR(0, 139, __pyx_L3_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 (!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) } } } else { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + 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) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 139, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } + if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); } __pyx_v_self = values[0]; __pyx_v_constraint = values[1]; @@ -5431,11 +4828,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.problem.Problem.addConstraint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5444,11 +4838,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_7problem_7Problem_12addConstraint(__pyx_self, __pyx_v_self, __pyx_v_constraint, __pyx_v_variables); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -5461,7 +4852,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2genera * assert all(isinstance(c, str) for c in constraint), f"Expected constraints to be strings, got {constraint}" # <<<<<<<<<<<<<< * self._str_constraints.extend(constraint) * return - */ +*/ static PyObject *__pyx_pf_10constraint_7problem_7Problem_13addConstraint_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *__pyx_cur_scope; @@ -5471,7 +4862,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_13addConstraint_genexpr const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *)__pyx_tp_new_10constraint_7problem___pyx_scope_struct__genexpr(__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *)__pyx_tp_new_10constraint_7problem___pyx_scope_struct__genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *)Py_None); __Pyx_INCREF(Py_None); @@ -5483,7 +4874,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, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Problem_addConstraint_locals_gen, __pyx_n_s_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, 162, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5530,51 +4921,48 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2genera } 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_GOTREF(__pyx_t_1); - __pyx_t_3 = __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, 162, __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 162, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 162, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 162, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 162, __pyx_L1_error) + __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); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif + ++__pyx_t_2; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 162, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 162, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_4); } + __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); @@ -5601,10 +4989,12 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2genera /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + 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 @@ -5622,7 +5012,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2genera * def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Add a constraint to the problem. * - */ +*/ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_constraint, PyObject *__pyx_v_variables) { PyObject *__pyx_v_msg = NULL; @@ -5634,7 +5024,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - unsigned int __pyx_t_6; + size_t __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; @@ -5648,7 +5038,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * if isinstance(constraint, str): # <<<<<<<<<<<<<< * self._str_constraints.append(constraint) * return - */ +*/ __pyx_t_1 = PyUnicode_Check(__pyx_v_constraint); if (__pyx_t_1) { @@ -5658,8 +5048,8 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * self._str_constraints.append(constraint) # <<<<<<<<<<<<<< * return * elif isinstance(constraint, list): - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_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, 159, __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_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -5670,7 +5060,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * return # <<<<<<<<<<<<<< * elif isinstance(constraint, list): * assert all(isinstance(c, str) for c in constraint), f"Expected constraints to be strings, got {constraint}" - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -5681,7 +5071,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * if isinstance(constraint, str): # <<<<<<<<<<<<<< * self._str_constraints.append(constraint) * return - */ +*/ } /* "constraint/problem.py":161 @@ -5690,7 +5080,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * 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) - */ +*/ __pyx_t_1 = PyList_Check(__pyx_v_constraint); if (__pyx_t_1) { @@ -5700,20 +5090,20 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * assert all(isinstance(c, str) for c in constraint), f"Expected constraints to be strings, got {constraint}" # <<<<<<<<<<<<<< * self._str_constraints.extend(constraint) * return - */ +*/ #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_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_Generator_Next(__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, 162, __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) { - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_constraint, __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, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyUnicode_Concat(__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, 162, __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); @@ -5731,33 +5121,19 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * self._str_constraints.extend(constraint) # <<<<<<<<<<<<<< * return * - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_str_constraints); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_extend); 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, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; + __pyx_t_4 = __pyx_t_5; + __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_6 = 1; - } - } - #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_constraint}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __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_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) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -5767,7 +5143,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * return # <<<<<<<<<<<<<< * * # add regular constraints - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -5778,7 +5154,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * 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) - */ +*/ } /* "constraint/problem.py":167 @@ -5787,8 +5163,8 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * 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_n_s_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, 167, __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_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -5801,7 +5177,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * 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) if (__pyx_t_7) { @@ -5811,30 +5187,29 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * constraint = FunctionConstraint(constraint) # <<<<<<<<<<<<<< * elif isinstance(constraint, str): * constraint = CompilableFunctionConstraint(constraint) - */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FunctionConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = NULL; - __pyx_t_6 = 0; +*/ + __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_GOTREF(__pyx_t_4); + __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_6 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + assert(__pyx_t_5); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __pyx_t_6 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_constraint}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + 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_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) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF_SET(__pyx_v_constraint, __pyx_t_2); __pyx_t_2 = 0; @@ -5845,7 +5220,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * if callable(constraint): # <<<<<<<<<<<<<< * # future warn("A function or lambda has been used for a constraint, consider using string constraints") * constraint = FunctionConstraint(constraint) - */ +*/ goto __pyx_L5; } @@ -5855,7 +5230,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * elif isinstance(constraint, str): # <<<<<<<<<<<<<< * constraint = CompilableFunctionConstraint(constraint) * else: - */ +*/ __pyx_t_7 = PyUnicode_Check(__pyx_v_constraint); if (likely(__pyx_t_7)) { @@ -5865,30 +5240,29 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * constraint = CompilableFunctionConstraint(constraint) # <<<<<<<<<<<<<< * else: * msg = "Constraints must be instances of subclasses " "of the Constraint class" - */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CompilableFunctionConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); +*/ __pyx_t_4 = NULL; - __pyx_t_6 = 0; + __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_GOTREF(__pyx_t_5); + __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_6 = 1; - } + assert(__pyx_t_4); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); + __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_constraint}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __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_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) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF_SET(__pyx_v_constraint, __pyx_t_2); __pyx_t_2 = 0; @@ -5899,7 +5273,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * elif isinstance(constraint, str): # <<<<<<<<<<<<<< * constraint = CompilableFunctionConstraint(constraint) * else: - */ +*/ goto __pyx_L5; } @@ -5909,10 +5283,10 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * msg = "Constraints must be instances of subclasses " "of the Constraint class" # <<<<<<<<<<<<<< * raise ValueError(msg) * self._constraints.append((constraint, variables)) - */ +*/ /*else*/ { - __Pyx_INCREF(__pyx_kp_u_Constraints_must_be_instances_of); - __pyx_v_msg = __pyx_kp_u_Constraints_must_be_instances_of; + __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 * else: @@ -5920,9 +5294,19 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * raise ValueError(msg) # <<<<<<<<<<<<<< * self._constraints.append((constraint, variables)) * - */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_msg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); +*/ + __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_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) + __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) @@ -5935,7 +5319,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * 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/problem.py":176 @@ -5944,20 +5328,20 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * self._constraints.append((constraint, variables)) # <<<<<<<<<<<<<< * * def getSolution(self): - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_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, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_constraint); __Pyx_GIVEREF(__pyx_v_constraint); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_constraint)) __PYX_ERR(0, 176, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 176, __pyx_L1_error); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_variables)) __PYX_ERR(0, 176, __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, 176, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/problem.py":139 * self.addVariable(variable, domain) @@ -5965,7 +5349,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Add a constraint to the problem. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -5991,7 +5375,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * def getSolution(self): # <<<<<<<<<<<<<< * """Find and return a solution to the problem. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_15getSolution(PyObject *__pyx_self, @@ -6002,7 +5386,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7problem_7Problem_14getSolution, "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 PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_15getSolution = {"getSolution", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_15getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_14getSolution}; +static PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_15getSolution = {"getSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_15getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_14getSolution}; static PyObject *__pyx_pw_10constraint_7problem_7Problem_15getSolution(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -6023,7 +5407,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -6031,33 +5415,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolution") < 0)) __PYX_ERR(0, 178, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 178, __pyx_L3_error) } __pyx_v_self = values[0]; } @@ -6067,11 +5446,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.problem.Problem.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6080,11 +5456,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_7problem_7Problem_14getSolution(__pyx_self, __pyx_v_self); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -6100,15 +5473,15 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *(*__pyx_t_6)(PyObject *); - int __pyx_t_7; + size_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; - unsigned int __pyx_t_9; + int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolution", 1); + __Pyx_RefNannySetupContext("getSolution", 0); /* "constraint/problem.py":192 * dictionary mapping variables to values: Solution for the problem @@ -6116,24 +5489,29 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) # <<<<<<<<<<<<<< * if not domains: * return None - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getArgs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error) +*/ + __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_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_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, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_picklable, __pyx_t_4) < 0) __PYX_ERR(0, 192, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { - PyObject* sequence = __pyx_t_4; + __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_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); + __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) + __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 != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); @@ -6142,55 +5520,61 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); + __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); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_1 = PyList_GET_ITEM(sequence, 1); - __pyx_t_3 = PyList_GET_ITEM(sequence, 2); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __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_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_XGOTREF(__pyx_t_2); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySequence_ITEM(sequence, 2); 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, 192, __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_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_GOTREF(__pyx_t_2); #endif - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); - index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - index = 2; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 192, __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); + index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(0, 192, __pyx_L1_error) - __pyx_t_6 = NULL; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L4_unpacking_done; - __pyx_L3_unpacking_failed:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = NULL; + index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; + __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) + __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __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_L4_unpacking_done:; } - __pyx_v_domains = __pyx_t_2; - __pyx_t_2 = 0; - __pyx_v_constraints = __pyx_t_1; - __pyx_t_1 = 0; - __pyx_v_vconstraints = __pyx_t_3; + __pyx_v_domains = __pyx_t_3; __pyx_t_3 = 0; + __pyx_v_constraints = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_vconstraints = __pyx_t_2; + __pyx_t_2 = 0; /* "constraint/problem.py":193 * """ @@ -6198,10 +5582,10 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN * if not domains: # <<<<<<<<<<<<<< * return None * return self._solver.getSolution(domains, constraints, vconstraints) - */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domains); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 193, __pyx_L1_error) - __pyx_t_8 = (!__pyx_t_7); - if (__pyx_t_8) { +*/ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domains); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_9 = (!__pyx_t_8); + if (__pyx_t_9) { /* "constraint/problem.py":194 * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) @@ -6209,7 +5593,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN * return None # <<<<<<<<<<<<<< * return self._solver.getSolution(domains, constraints, vconstraints) * - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -6220,7 +5604,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN * if not domains: # <<<<<<<<<<<<<< * return None * return self._solver.getSolution(domains, constraints, vconstraints) - */ +*/ } /* "constraint/problem.py":195 @@ -6229,37 +5613,23 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN * return self._solver.getSolution(domains, constraints, vconstraints) # <<<<<<<<<<<<<< * * def getSolutions(self): - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getSolution); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_9 = 1; - } - } - #endif + __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_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_3, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_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) + __Pyx_GOTREF(__pyx_t_1); } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; /* "constraint/problem.py":178 @@ -6268,7 +5638,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN * def getSolution(self): # <<<<<<<<<<<<<< * """Find and return a solution to the problem. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -6276,7 +5646,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN __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.problem.Problem.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -6294,7 +5664,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN * def getSolutions(self): # <<<<<<<<<<<<<< * """Find and return all solutions to the problem. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_17getSolutions(PyObject *__pyx_self, @@ -6305,7 +5675,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7problem_7Problem_16getSolutions, "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 PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_17getSolutions = {"getSolutions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_17getSolutions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_16getSolutions}; +static PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_17getSolutions = {"getSolutions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_17getSolutions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_16getSolutions}; static PyObject *__pyx_pw_10constraint_7problem_7Problem_17getSolutions(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -6326,7 +5696,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutions (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -6334,33 +5704,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutions") < 0)) __PYX_ERR(0, 197, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 197, __pyx_L3_error) } __pyx_v_self = values[0]; } @@ -6370,11 +5735,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.problem.Problem.getSolutions", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6383,11 +5745,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_7problem_7Problem_16getSolutions(__pyx_self, __pyx_v_self); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -6403,15 +5762,15 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *(*__pyx_t_6)(PyObject *); - int __pyx_t_7; + size_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; - unsigned int __pyx_t_9; + int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolutions", 1); + __Pyx_RefNannySetupContext("getSolutions", 0); /* "constraint/problem.py":211 * list of dictionaries mapping variables to values: All solutions for the problem @@ -6419,24 +5778,29 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) # <<<<<<<<<<<<<< * if not domains: * return [] - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getArgs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error) +*/ + __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_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_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, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_picklable, __pyx_t_4) < 0) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { - PyObject* sequence = __pyx_t_4; + __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_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); + __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) + __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 != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); @@ -6445,55 +5809,61 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); + __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); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_1 = PyList_GET_ITEM(sequence, 1); - __pyx_t_3 = PyList_GET_ITEM(sequence, 2); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __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_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_XGOTREF(__pyx_t_2); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySequence_ITEM(sequence, 2); 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, 211, __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_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_GOTREF(__pyx_t_2); #endif - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); - index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - index = 2; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __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); + index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(0, 211, __pyx_L1_error) - __pyx_t_6 = NULL; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; + __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) + __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = NULL; + __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_L4_unpacking_done:; } - __pyx_v_domains = __pyx_t_2; - __pyx_t_2 = 0; - __pyx_v_constraints = __pyx_t_1; - __pyx_t_1 = 0; - __pyx_v_vconstraints = __pyx_t_3; + __pyx_v_domains = __pyx_t_3; __pyx_t_3 = 0; + __pyx_v_constraints = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_vconstraints = __pyx_t_2; + __pyx_t_2 = 0; /* "constraint/problem.py":212 * """ @@ -6501,10 +5871,10 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U * if not domains: # <<<<<<<<<<<<<< * return [] * return self._solver.getSolutions(domains, constraints, vconstraints) - */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domains); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 212, __pyx_L1_error) - __pyx_t_8 = (!__pyx_t_7); - if (__pyx_t_8) { +*/ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domains); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_9 = (!__pyx_t_8); + if (__pyx_t_9) { /* "constraint/problem.py":213 * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) @@ -6512,12 +5882,12 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U * return [] # <<<<<<<<<<<<<< * return self._solver.getSolutions(domains, constraints, vconstraints) * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; /* "constraint/problem.py":212 @@ -6526,7 +5896,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U * if not domains: # <<<<<<<<<<<<<< * return [] * return self._solver.getSolutions(domains, constraints, vconstraints) - */ +*/ } /* "constraint/problem.py":214 @@ -6535,37 +5905,23 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U * return self._solver.getSolutions(domains, constraints, vconstraints) # <<<<<<<<<<<<<< * * def getSolutionIter(self): - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getSolutions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_9 = 1; - } - } - #endif + __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_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_3, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_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) + __Pyx_GOTREF(__pyx_t_1); } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; /* "constraint/problem.py":197 @@ -6574,7 +5930,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U * def getSolutions(self): # <<<<<<<<<<<<<< * """Find and return all solutions to the problem. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -6582,7 +5938,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U __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.problem.Problem.getSolutions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -6600,7 +5956,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U * def getSolutionIter(self): # <<<<<<<<<<<<<< * """Return an iterator to the solutions of the problem. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_19getSolutionIter(PyObject *__pyx_self, @@ -6611,7 +5967,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7problem_7Problem_18getSolutionIter, "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 PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_19getSolutionIter = {"getSolutionIter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_19getSolutionIter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_18getSolutionIter}; +static PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_19getSolutionIter = {"getSolutionIter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_19getSolutionIter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_18getSolutionIter}; static PyObject *__pyx_pw_10constraint_7problem_7Problem_19getSolutionIter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -6632,7 +5988,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionIter (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -6640,33 +5996,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutionIter") < 0)) __PYX_ERR(0, 216, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 216, __pyx_L3_error) } __pyx_v_self = values[0]; } @@ -6676,11 +6027,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.problem.Problem.getSolutionIter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6689,11 +6037,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(__pyx_self, __pyx_v_self); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -6709,15 +6054,15 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *(*__pyx_t_6)(PyObject *); - int __pyx_t_7; + size_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; - unsigned int __pyx_t_9; + int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolutionIter", 1); + __Pyx_RefNannySetupContext("getSolutionIter", 0); /* "constraint/problem.py":232 * StopIteration @@ -6725,24 +6070,29 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) # <<<<<<<<<<<<<< * if not domains: * return iter(()) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getArgs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) +*/ + __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_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_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, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_picklable, __pyx_t_4) < 0) __PYX_ERR(0, 232, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { - PyObject* sequence = __pyx_t_4; + __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_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); + __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) + __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 != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); @@ -6751,55 +6101,61 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); + __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); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_1 = PyList_GET_ITEM(sequence, 1); - __pyx_t_3 = PyList_GET_ITEM(sequence, 2); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __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_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_XGOTREF(__pyx_t_2); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySequence_ITEM(sequence, 2); 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, 232, __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_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_GOTREF(__pyx_t_2); #endif - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); - index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - index = 2; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __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); + index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(0, 232, __pyx_L1_error) - __pyx_t_6 = NULL; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; + __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) + __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = NULL; + __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_L4_unpacking_done:; } - __pyx_v_domains = __pyx_t_2; - __pyx_t_2 = 0; - __pyx_v_constraints = __pyx_t_1; - __pyx_t_1 = 0; - __pyx_v_vconstraints = __pyx_t_3; + __pyx_v_domains = __pyx_t_3; __pyx_t_3 = 0; + __pyx_v_constraints = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_vconstraints = __pyx_t_2; + __pyx_t_2 = 0; /* "constraint/problem.py":233 * """ @@ -6807,10 +6163,10 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO * if not domains: # <<<<<<<<<<<<<< * return iter(()) * return self._solver.getSolutionIter(domains, constraints, vconstraints) - */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domains); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 233, __pyx_L1_error) - __pyx_t_8 = (!__pyx_t_7); - if (__pyx_t_8) { +*/ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domains); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_9 = (!__pyx_t_8); + if (__pyx_t_9) { /* "constraint/problem.py":234 * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) @@ -6818,12 +6174,12 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO * return iter(()) # <<<<<<<<<<<<<< * return self._solver.getSolutionIter(domains, constraints, vconstraints) * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyObject_GetIter(__pyx_empty_tuple); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_1 = PyObject_GetIter(__pyx_mstate_global->__pyx_empty_tuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; /* "constraint/problem.py":233 @@ -6832,7 +6188,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO * if not domains: # <<<<<<<<<<<<<< * return iter(()) * return self._solver.getSolutionIter(domains, constraints, vconstraints) - */ +*/ } /* "constraint/problem.py":235 @@ -6841,37 +6197,23 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO * return self._solver.getSolutionIter(domains, constraints, vconstraints) # <<<<<<<<<<<<<< * * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getSolutionIter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - __pyx_t_9 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_9 = 1; - } - } - #endif + __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_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_3, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_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) + __Pyx_GOTREF(__pyx_t_1); } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; /* "constraint/problem.py":216 @@ -6880,7 +6222,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO * def getSolutionIter(self): # <<<<<<<<<<<<<< * """Return an iterator to the solutions of the problem. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -6888,7 +6230,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO __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.problem.Problem.getSolutionIter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -6906,7 +6248,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO * 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() - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_21getSolutionsOrderedList(PyObject *__pyx_self, @@ -6917,7 +6259,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7problem_7Problem_20getSolutionsOrderedList, "Returns the solutions as a list of tuples, with each solution tuple ordered according to `order`."); -static PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_21getSolutionsOrderedList = {"getSolutionsOrderedList", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_21getSolutionsOrderedList, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_20getSolutionsOrderedList}; +static PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_21getSolutionsOrderedList = {"getSolutionsOrderedList", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_21getSolutionsOrderedList, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_20getSolutionsOrderedList}; static PyObject *__pyx_pw_10constraint_7problem_7Problem_21getSolutionsOrderedList(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -6939,7 +6281,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionsOrderedList (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -6947,47 +6289,41 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_order,0}; - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None)); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + 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) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_order); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutionsOrderedList") < 0)) __PYX_ERR(0, 237, __pyx_L3_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 (!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) } } } else { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + 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) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) break; default: goto __pyx_L5_argtuple_error; } + if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)Py_None)); } __pyx_v_self = values[0]; __pyx_v_order = ((PyObject*)values[1]); @@ -6998,30 +6334,29 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.problem.Problem.getSolutionsOrderedList", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_order), (&PyList_Type), 1, "order", 1))) __PYX_ERR(0, 237, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_order), (&PyList_Type), 1, "order", 2))) __PYX_ERR(0, 237, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedList(__pyx_self, __pyx_v_self, __pyx_v_order); /* 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -7033,7 +6368,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi * return list(tuple(solution.values()) for solution in solutions) # <<<<<<<<<<<<<< * get_in_order = itemgetter(*order) * return list(get_in_order(params) for params in solutions) - */ +*/ static PyObject *__pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedList_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *__pyx_cur_scope; @@ -7043,7 +6378,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedLi const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *)__pyx_tp_new_10constraint_7problem___pyx_scope_struct_2_genexpr(__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *)__pyx_tp_new_10constraint_7problem___pyx_scope_struct_2_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *)Py_None); __Pyx_INCREF(Py_None); @@ -7055,7 +6390,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, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Problem_getSolutionsOrderedList, __pyx_n_s_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, 241, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -7079,8 +6414,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - unsigned int __pyx_t_6; + size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -7106,44 +6440,28 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 241, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 241, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + ++__pyx_t_2; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_solution); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_solution, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_solution, __pyx_n_s_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } - } - #endif + __pyx_t_4 = __pyx_cur_scope->__pyx_v_solution; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -7158,12 +6476,13 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + 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 @@ -7182,7 +6501,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi * return list(get_in_order(params) for params in solutions) # <<<<<<<<<<<<<< * * def getSolutionsAsListDict( - */ +*/ static PyObject *__pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedList_3genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *__pyx_cur_scope; @@ -7192,7 +6511,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedLi const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *)__pyx_tp_new_10constraint_7problem___pyx_scope_struct_3_genexpr(__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *)__pyx_tp_new_10constraint_7problem___pyx_scope_struct_3_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *)Py_None); __Pyx_INCREF(Py_None); @@ -7207,7 +6526,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, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Problem_getSolutionsOrderedList, __pyx_n_s_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, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -7232,7 +6551,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - unsigned int __pyx_t_6; + size_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -7258,44 +6577,42 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 243, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 243, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + ++__pyx_t_2; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - #endif __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) } __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_get_in_order); - __pyx_t_4 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_get_in_order; __pyx_t_5 = NULL; - __pyx_t_6 = 0; + __pyx_t_5 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_get_in_order; + __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } - } + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __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_4); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); + __pyx_t_6 = 0; + } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_params}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + 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_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) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -7307,12 +6624,14 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + 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 @@ -7330,7 +6649,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi * 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() - */ +*/ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedList(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_order) { struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *__pyx_cur_scope; @@ -7341,16 +6660,16 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; + size_t __pyx_t_3; + int __pyx_t_4; int __pyx_t_5; - int __pyx_t_6; - Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_6; + PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolutionsOrderedList", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *)__pyx_tp_new_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList(__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *)__pyx_tp_new_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList(__pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *)Py_None); __Pyx_INCREF(Py_None); @@ -7365,30 +6684,16 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi * solutions: list[dict] = self.getSolutions() # <<<<<<<<<<<<<< * if order is None or len(order) == 1: * return list(tuple(solution.values()) for solution in solutions) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getSolutions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + __pyx_t_2 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } 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) __pyx_v_solutions = ((PyObject*)__pyx_t_1); @@ -7400,22 +6705,22 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi * if order is None or len(order) == 1: # <<<<<<<<<<<<<< * return list(tuple(solution.values()) for solution in solutions) * get_in_order = itemgetter(*order) - */ - __pyx_t_6 = (__pyx_v_order == ((PyObject*)Py_None)); - if (!__pyx_t_6) { +*/ + __pyx_t_5 = (__pyx_v_order == ((PyObject*)Py_None)); + if (!__pyx_t_5) { } else { - __pyx_t_5 = __pyx_t_6; + __pyx_t_4 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } 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_t_7 = __Pyx_PyList_GET_SIZE(__pyx_v_order); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 240, __pyx_L1_error) - __pyx_t_6 = (__pyx_t_7 == 1); - __pyx_t_5 = __pyx_t_6; + __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_5 = (__pyx_t_6 == 1); + __pyx_t_4 = __pyx_t_5; __pyx_L4_bool_binop_done:; - if (__pyx_t_5) { + if (__pyx_t_4) { /* "constraint/problem.py":241 * solutions: list[dict] = self.getSolutions() @@ -7423,11 +6728,11 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi * 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_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_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_Generator_Next(__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, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((PyObject*)__pyx_t_2); @@ -7440,7 +6745,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi * if order is None or len(order) == 1: # <<<<<<<<<<<<<< * return list(tuple(solution.values()) for solution in solutions) * get_in_order = itemgetter(*order) - */ +*/ } /* "constraint/problem.py":242 @@ -7449,18 +6754,18 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi * get_in_order = itemgetter(*order) # <<<<<<<<<<<<<< * return list(get_in_order(params) for params in solutions) * - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_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, 242, __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_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_t_3); - __pyx_cur_scope->__pyx_v_get_in_order = __pyx_t_3; - __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_7); + __pyx_cur_scope->__pyx_v_get_in_order = __pyx_t_7; + __pyx_t_7 = 0; /* "constraint/problem.py":243 * return list(tuple(solution.values()) for solution in solutions) @@ -7468,13 +6773,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi * return list(get_in_order(params) for params in solutions) # <<<<<<<<<<<<<< * * def getSolutionsAsListDict( - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedList_3genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_solutions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_1)) __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, 243, __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_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; @@ -7485,13 +6790,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi * 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() - */ +*/ /* 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_7); __Pyx_AddTraceback("constraint.problem.Problem.getSolutionsOrderedList", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -7510,7 +6815,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi * def getSolutionsAsListDict( # <<<<<<<<<<<<<< * self, order: list[str] = None, validate: bool = True * ) -> tuple[list[tuple], dict[tuple, int], int]: # noqa: E501 - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_23getSolutionsAsListDict(PyObject *__pyx_self, @@ -7521,7 +6826,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7problem_7Problem_22getSolutionsAsListDict, "Returns the searchspace as a list of tuples, a dict of the searchspace for fast lookups and the size."); -static PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_23getSolutionsAsListDict = {"getSolutionsAsListDict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_23getSolutionsAsListDict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_22getSolutionsAsListDict}; +static PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_23getSolutionsAsListDict = {"getSolutionsAsListDict", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_23getSolutionsAsListDict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_22getSolutionsAsListDict}; static PyObject *__pyx_pw_10constraint_7problem_7Problem_23getSolutionsAsListDict(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -7544,7 +6849,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionsAsListDict (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -7552,67 +6857,59 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_order,&__pyx_n_s_validate,0}; - - /* "constraint/problem.py":246 - * - * 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.""" - */ - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None)); - values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + 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) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + 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) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_order); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_validate); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutionsAsListDict") < 0)) __PYX_ERR(0, 245, __pyx_L3_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) + + /* "constraint/problem.py":246 + * + * 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.""" +*/ + 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) } } } else { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + 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) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + 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) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) 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]); @@ -7624,17 +6921,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.problem.Problem.getSolutionsAsListDict", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_order), (&PyList_Type), 1, "order", 1))) __PYX_ERR(0, 246, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_order), (&PyList_Type), 1, "order", 2))) __PYX_ERR(0, 246, __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 @@ -7643,19 +6937,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds * def getSolutionsAsListDict( # <<<<<<<<<<<<<< * self, order: list[str] = None, validate: bool = True * ) -> tuple[list[tuple], dict[tuple, int], int]: # noqa: E501 - */ +*/ /* 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -7669,14 +6965,20 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; - Py_ssize_t __pyx_t_5; - int __pyx_t_6; + size_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + 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_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolutionsAsListDict", 1); + __Pyx_RefNannySetupContext("getSolutionsAsListDict", 0); /* "constraint/problem.py":249 * ) -> tuple[list[tuple], dict[tuple, int], int]: # noqa: E501 @@ -7684,30 +6986,16 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * solutions_list = self.getSolutionsOrderedList(order) # <<<<<<<<<<<<<< * size_list = len(solutions_list) * solutions_dict: dict = dict(zip(solutions_list, range(size_list))) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getSolutionsOrderedList); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + __pyx_t_2 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_order}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_solutions_list = __pyx_t_1; __pyx_t_1 = 0; @@ -7718,9 +7006,9 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * size_list = len(solutions_list) # <<<<<<<<<<<<<< * solutions_dict: dict = dict(zip(solutions_list, range(size_list))) * if validate: - */ - __pyx_t_5 = PyObject_Length(__pyx_v_solutions_list); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 250, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); 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, 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_GOTREF(__pyx_t_1); __pyx_v_size_list = __pyx_t_1; __pyx_t_1 = 0; @@ -7731,25 +7019,47 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * solutions_dict: dict = dict(zip(solutions_list, range(size_list))) # <<<<<<<<<<<<<< * if validate: * # check for duplicates - */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_size_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_solutions_list); - __Pyx_GIVEREF(__pyx_v_solutions_list); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_solutions_list)) __PYX_ERR(0, 251, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error); +*/ + __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_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); + } + __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); + } + __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)); + __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) + __Pyx_GOTREF(__pyx_t_1); + } + __pyx_v_solutions_dict = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_solutions_dict = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; /* "constraint/problem.py":252 * size_list = len(solutions_list) @@ -7757,9 +7067,9 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * if validate: # <<<<<<<<<<<<<< * # check for duplicates * size_dict = len(solutions_dict) - */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_validate); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 252, __pyx_L1_error) - if (__pyx_t_6) { +*/ + __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) { /* "constraint/problem.py":254 * if validate: @@ -7767,12 +7077,12 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * size_dict = len(solutions_dict) # <<<<<<<<<<<<<< * if size_list != size_dict: * raise ValueError( - */ - __pyx_t_5 = PyDict_Size(__pyx_v_solutions_dict); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 254, __pyx_L1_error) - __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_size_dict = __pyx_t_2; - __pyx_t_2 = 0; +*/ + __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_GOTREF(__pyx_t_1); + __pyx_v_size_dict = __pyx_t_1; + __pyx_t_1 = 0; /* "constraint/problem.py":255 * # check for duplicates @@ -7780,11 +7090,22 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * if size_list != size_dict: # <<<<<<<<<<<<<< * raise ValueError( * f"{size_list - size_dict} duplicate parameter configurations in searchspace, should not happen." - */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_size_list, __pyx_v_size_dict, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 255, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(__pyx_t_6)) { +*/ + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_t_12)) { + + /* "constraint/problem.py":256 + * 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." + * ) +*/ + __pyx_t_5 = NULL; + __Pyx_INCREF(__pyx_builtin_ValueError); + __pyx_t_6 = __pyx_builtin_ValueError; /* "constraint/problem.py":257 * if size_list != size_dict: @@ -7792,26 +7113,25 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * f"{size_list - size_dict} duplicate parameter configurations in searchspace, should not happen." # <<<<<<<<<<<<<< * ) * 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) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __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_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_kp_u_duplicate_parameter_configurati); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "constraint/problem.py":256 - * 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." - * ) - */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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)); + __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_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) @@ -7822,7 +7142,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * if size_list != size_dict: # <<<<<<<<<<<<<< * raise ValueError( * f"{size_list - size_dict} duplicate parameter configurations in searchspace, should not happen." - */ +*/ } /* "constraint/problem.py":252 @@ -7831,7 +7151,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * if validate: # <<<<<<<<<<<<<< * # check for duplicates * size_dict = len(solutions_dict) - */ +*/ } /* "constraint/problem.py":259 @@ -7840,7 +7160,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * return ( # <<<<<<<<<<<<<< * solutions_list, * solutions_dict, - */ +*/ __Pyx_XDECREF(__pyx_r); /* "constraint/problem.py":260 @@ -7849,18 +7169,18 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * 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_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)) __PYX_ERR(0, 260, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_solutions_list) != (0)) __PYX_ERR(0, 260, __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)) __PYX_ERR(0, 260, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_solutions_dict) != (0)) __PYX_ERR(0, 260, __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)) __PYX_ERR(0, 260, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_size_list) != (0)) __PYX_ERR(0, 260, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; @@ -7871,13 +7191,19 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * def getSolutionsAsListDict( # <<<<<<<<<<<<<< * self, order: list[str] = None, validate: bool = True * ) -> tuple[list[tuple], dict[tuple, int], int]: # noqa: E501 - */ +*/ /* 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_5); + __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_AddTraceback("constraint.problem.Problem.getSolutionsAsListDict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -7896,7 +7222,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< * domains = self._variables.copy() * allvariables = domains.keys() - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_25_getArgs(PyObject *__pyx_self, @@ -7906,7 +7232,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_25_getArgs = {"_getArgs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_25_getArgs, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_25_getArgs = {"_getArgs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_25_getArgs, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_7problem_7Problem_25_getArgs(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -7928,7 +7254,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_getArgs (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -7936,47 +7262,41 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_picklable,0}; - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + 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) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_picklable); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_getArgs") < 0)) __PYX_ERR(0, 265, __pyx_L3_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 (!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) } } } else { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + 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) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + 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) break; default: goto __pyx_L5_argtuple_error; } + if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); } __pyx_v_self = values[0]; __pyx_v_picklable = values[1]; @@ -7987,11 +7307,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.problem.Problem._getArgs", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -8000,11 +7317,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_7problem_7Problem_24_getArgs(__pyx_self, __pyx_v_self, __pyx_v_picklable); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -8017,7 +7331,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ * 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 = {} - */ +*/ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8_getArgs_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *__pyx_cur_scope; @@ -8027,7 +7341,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8_getArgs_genexpr(CYTHO const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *)__pyx_tp_new_10constraint_7problem___pyx_scope_struct_4_genexpr(__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *)__pyx_tp_new_10constraint_7problem___pyx_scope_struct_4_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *)Py_None); __Pyx_INCREF(Py_None); @@ -8039,7 +7353,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, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Problem__getArgs_locals_genexpr, __pyx_n_s_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, 286, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -8086,17 +7400,15 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 286, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 286, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + ++__pyx_t_2; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - #endif 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); @@ -8107,18 +7419,22 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_5); } else { - __pyx_t_4 = PyList_GET_ITEM(sequence, 0); - __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __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_XGOTREF(__pyx_t_5); } - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_4 = 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, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = 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, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -8127,7 +7443,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __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; @@ -8151,7 +7467,7 @@ 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_n_s_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, 286, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -8175,13 +7491,15 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + 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 @@ -8199,7 +7517,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< * domains = self._variables.copy() * allvariables = domains.keys() - */ +*/ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_picklable) { PyObject *__pyx_v_domains = NULL; @@ -8220,15 +7538,15 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; + size_t __pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; - Py_ssize_t __pyx_t_10; - PyObject *(*__pyx_t_11)(PyObject *); - PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + PyObject *(*__pyx_t_12)(PyObject *); PyObject *__pyx_t_13 = NULL; PyObject *(*__pyx_t_14)(PyObject *); int __pyx_t_15; @@ -8238,7 +7556,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_getArgs", 1); + __Pyx_RefNannySetupContext("_getArgs", 0); /* "constraint/problem.py":266 * @@ -8246,33 +7564,19 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * domains = self._variables.copy() # <<<<<<<<<<<<<< * allvariables = domains.keys() * constraints: list[tuple[Constraint, list]] = [] - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); 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, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; + __pyx_t_2 = __pyx_t_3; + __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } - } - #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + __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_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) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_domains = __pyx_t_1; __pyx_t_1 = 0; @@ -8283,30 +7587,16 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * allvariables = domains.keys() # <<<<<<<<<<<<<< * constraints: list[tuple[Constraint, list]] = [] * - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_domains, __pyx_n_s_keys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = NULL; +*/ + __pyx_t_3 = __pyx_v_domains; + __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } - } - #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_allvariables = __pyx_t_1; __pyx_t_1 = 0; @@ -8317,7 +7607,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * 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_GOTREF(__pyx_t_1); __pyx_v_constraints = ((PyObject*)__pyx_t_1); @@ -8329,8 +7619,8 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * 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_n_s_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, 271, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8343,8 +7633,8 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * 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_n_s_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, 273, __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); @@ -8353,7 +7643,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } 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_GOTREF(__pyx_t_3); - __pyx_t_7 = __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, 273, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -8361,44 +7651,41 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 273, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 273, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_5); + ++__pyx_t_5; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 273, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); #endif + ++__pyx_t_5; } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 273, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 273, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_1); } + __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_1); __pyx_t_1 = 0; @@ -8408,32 +7695,42 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * parsed = compile_to_constraints([constraint], domains, picklable=picklable) # <<<<<<<<<<<<<< * for c, v, _ in parsed: * self.addConstraint(c, v) - */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_compile_to_constraints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_constraint); - __Pyx_GIVEREF(__pyx_v_constraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_constraint)) __PYX_ERR(0, 274, __pyx_L1_error); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 274, __pyx_L1_error) +*/ + __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_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_domains); - __Pyx_GIVEREF(__pyx_v_domains); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_domains)) __PYX_ERR(0, 274, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_picklable, __pyx_v_picklable) < 0) __PYX_ERR(0, 274, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, __pyx_t_2); 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, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_parsed, __pyx_t_9); - __pyx_t_9 = 0; + __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); + __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); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __pyx_t_4 = 0; + } + #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_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); + __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) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_parsed, __pyx_t_1); + __pyx_t_1 = 0; /* "constraint/problem.py":275 * for constraint in self._str_constraints: @@ -8441,61 +7738,58 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * for c, v, _ in parsed: # <<<<<<<<<<<<<< * self.addConstraint(c, v) * - */ +*/ if (likely(PyList_CheckExact(__pyx_v_parsed)) || PyTuple_CheckExact(__pyx_v_parsed)) { - __pyx_t_9 = __pyx_v_parsed; __Pyx_INCREF(__pyx_t_9); - __pyx_t_10 = 0; - __pyx_t_11 = NULL; + __pyx_t_1 = __pyx_v_parsed; __Pyx_INCREF(__pyx_t_1); + __pyx_t_11 = 0; + __pyx_t_12 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_parsed); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_11)) __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, 275, __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) } for (;;) { - if (likely(!__pyx_t_11)) { - if (likely(PyList_CheckExact(__pyx_t_9))) { + if (likely(!__pyx_t_12)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS + 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) #endif - if (__pyx_t_10 >= __pyx_temp) break; + if (__pyx_t_11 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 275, __pyx_L1_error) - #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif + __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_11); + ++__pyx_t_11; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS + 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) #endif - if (__pyx_t_10 >= __pyx_temp) break; + if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_11)); #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_11); #endif + ++__pyx_t_11; } + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 275, __pyx_L1_error) } else { - __pyx_t_2 = __pyx_t_11(__pyx_t_9); - if (unlikely(!__pyx_t_2)) { + __pyx_t_8 = __pyx_t_12(__pyx_t_1); + if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 275, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 275, __pyx_L1_error) + PyErr_Clear(); } 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_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 != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); @@ -8504,38 +7798,44 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_10); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_9); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_8 = PyList_GET_ITEM(sequence, 0); - __pyx_t_1 = PyList_GET_ITEM(sequence, 1); - __pyx_t_12 = PyList_GET_ITEM(sequence, 2); + __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 275, __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_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_XGOTREF(__pyx_t_2); } - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_12); #else - __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 275, __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_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_GOTREF(__pyx_t_2); #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; - __pyx_t_13 = PyObject_GetIter(__pyx_t_2); 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, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); - index = 0; __pyx_t_8 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_8)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_8); - index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - index = 2; __pyx_t_12 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_12); + __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); + index = 0; __pyx_t_10 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_10)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_10); + index = 1; __pyx_t_9 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed; + __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) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; @@ -8547,12 +7847,12 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __PYX_ERR(0, 275, __pyx_L1_error) __pyx_L9_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_8); - __pyx_t_8 = 0; - __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1); - __pyx_t_1 = 0; - __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_12); - __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_10); + __pyx_t_10 = 0; + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_9); + __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_2); + __pyx_t_2 = 0; /* "constraint/problem.py":276 * parsed = compile_to_constraints([constraint], domains, picklable=picklable) @@ -8560,32 +7860,18 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * self.addConstraint(c, v) # <<<<<<<<<<<<<< * * # add regular constraints - */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_addConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 276, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = NULL; +*/ + __pyx_t_2 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_12); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_12, function); - __pyx_t_4 = 1; - } - } - #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_c, __pyx_v_v}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "constraint/problem.py":275 * for constraint in self._str_constraints: @@ -8593,9 +7879,9 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * for c, v, _ in parsed: # <<<<<<<<<<<<<< * self.addConstraint(c, v) * - */ +*/ } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/problem.py":273 * if len(self._str_constraints) > 0: @@ -8603,7 +7889,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * for constraint in self._str_constraints: # <<<<<<<<<<<<<< * parsed = compile_to_constraints([constraint], domains, picklable=picklable) * for c, v, _ in parsed: - */ +*/ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -8613,7 +7899,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * 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: - */ +*/ } /* "constraint/problem.py":279 @@ -8622,62 +7908,59 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * for constraint, variables in self._constraints: # <<<<<<<<<<<<<< * if not variables: * variables = list(allvariables) - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_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, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_9 = __pyx_t_3; __Pyx_INCREF(__pyx_t_9); + __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_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_7)) __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, 279, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_9))) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS + 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) #endif if (__pyx_t_5 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 279, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_5); + ++__pyx_t_5; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS + 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) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); #endif + ++__pyx_t_5; } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_7(__pyx_t_9); + __pyx_t_3 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 279, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 279, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_3); } + __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); @@ -8688,46 +7971,50 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_8); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_12 = PyList_GET_ITEM(sequence, 1); + __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 279, __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_XGOTREF(__pyx_t_2); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_12); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 279, __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_GOTREF(__pyx_t_2); - __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 279, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); - index = 0; __pyx_t_2 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L14_unpacking_failed; + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); + index = 0; __pyx_t_8 = __pyx_t_14(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L14_unpacking_failed; + __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); - index = 1; __pyx_t_12 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_12)) goto __pyx_L14_unpacking_failed; - __Pyx_GOTREF(__pyx_t_12); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_1), 2) < 0) __PYX_ERR(0, 279, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_9), 2) < 0) __PYX_ERR(0, 279, __pyx_L1_error) __pyx_t_14 = NULL; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L15_unpacking_done; __pyx_L14_unpacking_failed:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __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_L15_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_8); + __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_variables, __pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_variables, __pyx_t_12); - __pyx_t_12 = 0; /* "constraint/problem.py":280 * # add regular constraints @@ -8735,7 +8022,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * 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_15 = (!__pyx_t_6); if (__pyx_t_15) { @@ -8746,7 +8033,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * 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_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_variables, __pyx_t_3); @@ -8758,7 +8045,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * if not variables: # <<<<<<<<<<<<<< * variables = list(allvariables) * constraints.append((constraint, variables)) - */ +*/ } /* "constraint/problem.py":282 @@ -8767,15 +8054,15 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * 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_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)) __PYX_ERR(0, 282, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 282, __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)) __PYX_ERR(0, 282, __pyx_L1_error); + 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) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -8785,9 +8072,9 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * for constraint, variables in self._constraints: # <<<<<<<<<<<<<< * if not variables: * variables = list(allvariables) - */ +*/ } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/problem.py":285 * @@ -8795,7 +8082,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * 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) if (__pyx_t_15) { @@ -8805,19 +8092,19 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * 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 = {} - */ +*/ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_9 = __pyx_pf_10constraint_7problem_7Problem_8_getArgs_genexpr(NULL, __pyx_v_constraints); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_9); if (unlikely(!__pyx_t_3)) __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, 286, __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_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __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_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_kp_u_You_have_used_FunctionConstraint, 0, 0); + __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_mstate_global->__pyx_kp_u_You_have_used_FunctionConstraint, 0, 0); __PYX_ERR(0, 286, __pyx_L1_error) } } @@ -8831,7 +8118,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * 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 * - */ +*/ } /* "constraint/problem.py":288 @@ -8840,7 +8127,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * 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_GOTREF(__pyx_t_3); __pyx_v_vconstraints = ((PyObject*)__pyx_t_3); @@ -8852,7 +8139,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * for variable in domains: # <<<<<<<<<<<<<< * vconstraints[variable] = [] * for constraint, variables in constraints: - */ +*/ if (likely(PyList_CheckExact(__pyx_v_domains)) || PyTuple_CheckExact(__pyx_v_domains)) { __pyx_t_3 = __pyx_v_domains; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; @@ -8860,53 +8147,50 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } 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_GOTREF(__pyx_t_3); - __pyx_t_7 = __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, 289, __pyx_L1_error) } for (;;) { 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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 289, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 289, __pyx_L1_error) - #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 289, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - #endif + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_5); + ++__pyx_t_5; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 289, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5)); #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 289, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); #endif + ++__pyx_t_5; } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error) } else { - __pyx_t_9 = __pyx_t_7(__pyx_t_3); - if (unlikely(!__pyx_t_9)) { + __pyx_t_1 = __pyx_t_7(__pyx_t_3); + if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 289, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 289, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_9); } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_9); - __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; /* "constraint/problem.py":290 * vconstraints = {} @@ -8914,11 +8198,11 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * vconstraints[variable] = [] # <<<<<<<<<<<<<< * for constraint, variables in constraints: * for variable in variables: - */ - __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (unlikely((PyDict_SetItem(__pyx_v_vconstraints, __pyx_v_variable, __pyx_t_9) < 0))) __PYX_ERR(0, 290, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; +*/ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __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) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/problem.py":289 * @@ -8926,7 +8210,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * for variable in domains: # <<<<<<<<<<<<<< * vconstraints[variable] = [] * for constraint, variables in constraints: - */ +*/ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -8936,25 +8220,23 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * for constraint, variables in constraints: # <<<<<<<<<<<<<< * for variable in variables: * vconstraints[variable].append((constraint, variables)) - */ +*/ __pyx_t_3 = __pyx_v_constraints; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 291, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 291, __pyx_L1_error) - #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - #endif - if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) { - PyObject* sequence = __pyx_t_9; + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_5); + ++__pyx_t_5; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __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; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); @@ -8963,46 +8245,50 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_12 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __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_XGOTREF(__pyx_t_8); } - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(__pyx_t_2); #else - __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = PySequence_ITEM(sequence, 1); 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, 291, __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_GOTREF(__pyx_t_8); #endif - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_1 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); - index = 0; __pyx_t_12 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_12)) goto __pyx_L24_unpacking_failed; - __Pyx_GOTREF(__pyx_t_12); - index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L24_unpacking_failed; + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 291, __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); + index = 0; __pyx_t_2 = __pyx_t_14(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L24_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_1), 2) < 0) __PYX_ERR(0, 291, __pyx_L1_error) + 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) __pyx_t_14 = NULL; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L25_unpacking_done; __pyx_L24_unpacking_failed:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __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_L25_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_12); - __pyx_t_12 = 0; - __Pyx_XDECREF_SET(__pyx_v_variables, __pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_variables, __pyx_t_8); + __pyx_t_8 = 0; /* "constraint/problem.py":292 * vconstraints[variable] = [] @@ -9010,61 +8296,58 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * for variable in variables: # <<<<<<<<<<<<<< * vconstraints[variable].append((constraint, variables)) * for constraint, variables in constraints[:]: - */ +*/ 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_10 = 0; + __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); + __pyx_t_11 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 292, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_7)) __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, 292, __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) } for (;;) { if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_9))) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS + 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) #endif - if (__pyx_t_10 >= __pyx_temp) break; + if (__pyx_t_11 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 292, __pyx_L1_error) - #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif + __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_11); + ++__pyx_t_11; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS + 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) #endif - if (__pyx_t_10 >= __pyx_temp) break; + if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 292, __pyx_L1_error) + __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_11)); #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_11); #endif + ++__pyx_t_11; } + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 292, __pyx_L1_error) } else { - __pyx_t_2 = __pyx_t_7(__pyx_t_9); - if (unlikely(!__pyx_t_2)) { + __pyx_t_8 = __pyx_t_7(__pyx_t_1); + if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 292, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 292, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_8); + __pyx_t_8 = 0; /* "constraint/problem.py":293 * for constraint, variables in constraints: @@ -9072,20 +8355,20 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * vconstraints[variable].append((constraint, variables)) # <<<<<<<<<<<<<< * for constraint, variables in constraints[:]: * constraint.preProcess(variables, domains, constraints, vconstraints) - */ - __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_2)) __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, 293, __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_GOTREF(__pyx_t_2); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 293, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_constraint); __Pyx_GIVEREF(__pyx_v_constraint); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_constraint)) __PYX_ERR(0, 293, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 293, __pyx_L1_error); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_variables)) __PYX_ERR(0, 293, __pyx_L1_error); - __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_12); 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, 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) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "constraint/problem.py":292 * vconstraints[variable] = [] @@ -9093,9 +8376,9 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * for variable in variables: # <<<<<<<<<<<<<< * vconstraints[variable].append((constraint, variables)) * for constraint, variables in constraints[:]: - */ +*/ } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/problem.py":291 * for variable in domains: @@ -9103,7 +8386,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * for constraint, variables in constraints: # <<<<<<<<<<<<<< * for variable in variables: * vconstraints[variable].append((constraint, variables)) - */ +*/ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -9113,26 +8396,24 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * 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_GOTREF(__pyx_t_3); - __pyx_t_9 = __pyx_t_3; __Pyx_INCREF(__pyx_t_9); + __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS + 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) #endif if (__pyx_t_5 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 294, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_5); + ++__pyx_t_5; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - #endif 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); @@ -9143,46 +8424,50 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_12 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + 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, 294, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); } - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(__pyx_t_2); #else - __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = PySequence_ITEM(sequence, 1); 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, 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, 294, __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_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 294, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); - index = 0; __pyx_t_12 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_12)) goto __pyx_L32_unpacking_failed; - __Pyx_GOTREF(__pyx_t_12); - index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L32_unpacking_failed; + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); + index = 0; __pyx_t_2 = __pyx_t_14(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L32_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_1), 2) < 0) __PYX_ERR(0, 294, __pyx_L1_error) + 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) __pyx_t_14 = NULL; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L33_unpacking_done; __pyx_L32_unpacking_failed:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __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_L33_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_12); - __pyx_t_12 = 0; - __Pyx_XDECREF_SET(__pyx_v_variables, __pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_variables, __pyx_t_8); + __pyx_t_8 = 0; /* "constraint/problem.py":295 * vconstraints[variable].append((constraint, variables)) @@ -9190,30 +8475,16 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * constraint.preProcess(variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< * for domain in domains.values(): * domain.resetState() - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_constraint, __pyx_n_s_preProcess); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = NULL; +*/ + __pyx_t_8 = __pyx_v_constraint; + __Pyx_INCREF(__pyx_t_8); __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif { - PyObject *__pyx_callargs[5] = {__pyx_t_12, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -9223,9 +8494,9 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * for constraint, variables in constraints[:]: # <<<<<<<<<<<<<< * constraint.preProcess(variables, domains, constraints, vconstraints) * for domain in domains.values(): - */ +*/ } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/problem.py":296 * for constraint, variables in constraints[:]: @@ -9233,19 +8504,19 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * for domain in domains.values(): # <<<<<<<<<<<<<< * domain.resetState() * if not domain: - */ +*/ __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_t_3 = __Pyx_dict_iterator(__pyx_v_domains, 0, __pyx_n_s_values, (&__pyx_t_10), (&__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, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_9); - __pyx_t_9 = __pyx_t_3; + __Pyx_XDECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; while (1) { - __pyx_t_18 = __Pyx_dict_iter_next(__pyx_t_9, __pyx_t_10, &__pyx_t_5, NULL, &__pyx_t_3, NULL, __pyx_t_17); + __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) __Pyx_GOTREF(__pyx_t_3); @@ -9258,30 +8529,16 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * domain.resetState() # <<<<<<<<<<<<<< * if not domain: * return None, None, None - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_resetState); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = NULL; +*/ + __pyx_t_8 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_8); __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -9291,7 +8548,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * 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_15 = (!__pyx_t_6); if (__pyx_t_15) { @@ -9302,11 +8559,11 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * return None, None, None # <<<<<<<<<<<<<< * # doArc8(getArcs(domains, constraints), domains, {}) * return domains, constraints, vconstraints - */ +*/ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_tuple__4); - __pyx_r = __pyx_tuple__4; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[0]); + __pyx_r = __pyx_mstate_global->__pyx_tuple[0]; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "constraint/problem.py":298 @@ -9315,30 +8572,30 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * if not domain: # <<<<<<<<<<<<<< * return None, None, None * # doArc8(getArcs(domains, constraints), domains, {}) - */ +*/ } } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/problem.py":301 * return None, None, None * # doArc8(getArcs(domains, constraints), domains, {}) * return domains, constraints, vconstraints # <<<<<<<<<<<<<< - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __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_9, 0, __pyx_v_domains)) __PYX_ERR(0, 301, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_domains) != (0)) __PYX_ERR(0, 301, __pyx_L1_error); __Pyx_INCREF(__pyx_v_constraints); __Pyx_GIVEREF(__pyx_v_constraints); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_constraints)) __PYX_ERR(0, 301, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_constraints) != (0)) __PYX_ERR(0, 301, __pyx_L1_error); __Pyx_INCREF(__pyx_v_vconstraints); __Pyx_GIVEREF(__pyx_v_vconstraints); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_vconstraints)) __PYX_ERR(0, 301, __pyx_L1_error); - __pyx_r = __pyx_t_9; - __pyx_t_9 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_vconstraints) != (0)) __PYX_ERR(0, 301, __pyx_L1_error); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; /* "constraint/problem.py":265 @@ -9347,7 +8604,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< * domains = self._variables.copy() * allvariables = domains.keys() - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -9356,7 +8613,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("constraint.problem.Problem._getArgs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; @@ -9378,11 +8635,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_RefNannyFinishContext(); return __pyx_r; } - -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *__pyx_freelist_10constraint_7problem___pyx_scope_struct__genexpr[8]; -static int __pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr = 0; -#endif +/* #### Code section: module_exttypes ### */ static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; @@ -9391,8 +8644,8 @@ static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct__genexpr( o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr)))) { - o = (PyObject*)__pyx_freelist_10constraint_7problem___pyx_scope_struct__genexpr[--__pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr]; + 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)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7problem___pyx_scope_struct__genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -9419,12 +8672,12 @@ 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_freecount_10constraint_7problem___pyx_scope_struct__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr)))) { - __pyx_freelist_10constraint_7problem___pyx_scope_struct__genexpr[__pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *)o); + 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)))) { + __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 { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -9438,6 +8691,10 @@ static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct__genexpr(P static int __pyx_tp_traverse_10constraint_7problem___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *p = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct__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; } @@ -9476,12 +8733,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct__genexpr #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -9522,13 +8774,11 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct__genexpr 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -9547,11 +8797,6 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct__genexpr }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *__pyx_freelist_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList[8]; -static int __pyx_freecount_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList = 0; -#endif - 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 @@ -9559,8 +8804,8 @@ static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct_1_getSolu o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__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)))) { - o = (PyObject*)__pyx_freelist_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList[--__pyx_freecount_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList]; + 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)))) { + 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]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -9586,12 +8831,12 @@ 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_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)))) { - __pyx_freelist_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList[__pyx_freecount_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList++] = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *)o); + 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)))) { + __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 { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -9605,6 +8850,10 @@ static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_1_getSolut static int __pyx_tp_traverse_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *p = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_v_get_in_order) { e = (*v)(p->__pyx_v_get_in_order, a); if (e) return e; } @@ -9650,12 +8899,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_1_getSol #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -9696,13 +8940,11 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_1_getSol 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -9721,11 +8963,6 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_1_getSol }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *__pyx_freelist_10constraint_7problem___pyx_scope_struct_2_genexpr[8]; -static int __pyx_freecount_10constraint_7problem___pyx_scope_struct_2_genexpr = 0; -#endif - 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 @@ -9733,8 +8970,8 @@ static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct_2_genexpr o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__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)))) { - o = (PyObject*)__pyx_freelist_10constraint_7problem___pyx_scope_struct_2_genexpr[--__pyx_freecount_10constraint_7problem___pyx_scope_struct_2_genexpr]; + 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)))) { + 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]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -9761,12 +8998,12 @@ 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_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)))) { - __pyx_freelist_10constraint_7problem___pyx_scope_struct_2_genexpr[__pyx_freecount_10constraint_7problem___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *)o); + 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)))) { + __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 { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -9780,6 +9017,10 @@ static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_2_genexpr( static int __pyx_tp_traverse_10constraint_7problem___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_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; } @@ -9818,12 +9059,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_2_genexp #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -9864,13 +9100,11 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_2_genexp 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -9889,11 +9123,6 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_2_genexp }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *__pyx_freelist_10constraint_7problem___pyx_scope_struct_3_genexpr[8]; -static int __pyx_freecount_10constraint_7problem___pyx_scope_struct_3_genexpr = 0; -#endif - 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 @@ -9901,8 +9130,8 @@ static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct_3_genexpr o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__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)))) { - o = (PyObject*)__pyx_freelist_10constraint_7problem___pyx_scope_struct_3_genexpr[--__pyx_freecount_10constraint_7problem___pyx_scope_struct_3_genexpr]; + 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)))) { + 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]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -9930,12 +9159,12 @@ 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_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)))) { - __pyx_freelist_10constraint_7problem___pyx_scope_struct_3_genexpr[__pyx_freecount_10constraint_7problem___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *)o); + 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)))) { + __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 { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -9949,6 +9178,10 @@ static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_3_genexpr( static int __pyx_tp_traverse_10constraint_7problem___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_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; } @@ -9990,12 +9223,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_3_genexp #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -10036,13 +9264,11 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_3_genexp 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -10061,11 +9287,6 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_3_genexp }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *__pyx_freelist_10constraint_7problem___pyx_scope_struct_4_genexpr[8]; -static int __pyx_freecount_10constraint_7problem___pyx_scope_struct_4_genexpr = 0; -#endif - 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 @@ -10073,8 +9294,8 @@ static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct_4_genexpr o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__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)))) { - o = (PyObject*)__pyx_freelist_10constraint_7problem___pyx_scope_struct_4_genexpr[--__pyx_freecount_10constraint_7problem___pyx_scope_struct_4_genexpr]; + 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)))) { + 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]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -10102,12 +9323,12 @@ 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_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)))) { - __pyx_freelist_10constraint_7problem___pyx_scope_struct_4_genexpr[__pyx_freecount_10constraint_7problem___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *)o); + 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)))) { + __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 { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -10121,6 +9342,10 @@ static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_4_genexpr( static int __pyx_tp_traverse_10constraint_7problem___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_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; } @@ -10162,12 +9387,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_4_genexp #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -10208,13 +9428,11 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_4_genexp 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -10236,557 +9454,134 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_4_genexp static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; -#ifndef CYTHON_SMALL_CODE -#if defined(__clang__) - #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) -#else - #define CYTHON_SMALL_CODE -#endif -#endif -/* #### Code section: pystring_table ### */ +/* #### Code section: initfunc_declarations ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/ +/* #### Code section: init_module ### */ -static int __Pyx_CreateStringTabAndInitStrings(void) { - __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, - {&__pyx_kp_u_Add_a_constraint_to_the_problem, __pyx_k_Add_a_constraint_to_the_problem, sizeof(__pyx_k_Add_a_constraint_to_the_problem), 0, 1, 0, 0}, - {&__pyx_kp_u_Add_a_variable_to_the_problem_Ex, __pyx_k_Add_a_variable_to_the_problem_Ex, sizeof(__pyx_k_Add_a_variable_to_the_problem_Ex), 0, 1, 0, 0}, - {&__pyx_kp_u_Add_one_or_more_variables_to_the, __pyx_k_Add_one_or_more_variables_to_the, sizeof(__pyx_k_Add_one_or_more_variables_to_the), 0, 1, 0, 0}, - {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, - {&__pyx_n_s_Callable, __pyx_k_Callable, sizeof(__pyx_k_Callable), 0, 0, 1, 1}, - {&__pyx_kp_u_Change_the_problem_solver_curren, __pyx_k_Change_the_problem_solver_curren, sizeof(__pyx_k_Change_the_problem_solver_curren), 0, 1, 0, 0}, - {&__pyx_kp_s_Class_used_to_define_a_problem_a, __pyx_k_Class_used_to_define_a_problem_a, sizeof(__pyx_k_Class_used_to_define_a_problem_a), 0, 0, 1, 0}, - {&__pyx_n_s_CompilableFunctionConstraint, __pyx_k_CompilableFunctionConstraint, sizeof(__pyx_k_CompilableFunctionConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_Constraint, __pyx_k_Constraint, sizeof(__pyx_k_Constraint), 0, 0, 1, 1}, - {&__pyx_kp_u_Constraints_must_be_instances_of, __pyx_k_Constraints_must_be_instances_of, sizeof(__pyx_k_Constraints_must_be_instances_of), 0, 1, 0, 0}, - {&__pyx_n_s_Domain, __pyx_k_Domain, sizeof(__pyx_k_Domain), 0, 0, 1, 1}, - {&__pyx_kp_u_Domain_is_empty, __pyx_k_Domain_is_empty, sizeof(__pyx_k_Domain_is_empty), 0, 1, 0, 0}, - {&__pyx_kp_u_Domains_must_be_instances_of_sub, __pyx_k_Domains_must_be_instances_of_sub, sizeof(__pyx_k_Domains_must_be_instances_of_sub), 0, 1, 0, 0}, - {&__pyx_kp_u_Expected_constraints_to_be_strin, __pyx_k_Expected_constraints_to_be_strin, sizeof(__pyx_k_Expected_constraints_to_be_strin), 0, 1, 0, 0}, - {&__pyx_kp_u_Find_and_return_a_solution_to_th, __pyx_k_Find_and_return_a_solution_to_th, sizeof(__pyx_k_Find_and_return_a_solution_to_th), 0, 1, 0, 0}, - {&__pyx_kp_u_Find_and_return_all_solutions_to, __pyx_k_Find_and_return_all_solutions_to, sizeof(__pyx_k_Find_and_return_all_solutions_to), 0, 1, 0, 0}, - {&__pyx_n_s_FunctionConstraint, __pyx_k_FunctionConstraint, sizeof(__pyx_k_FunctionConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_Hashable, __pyx_k_Hashable, sizeof(__pyx_k_Hashable), 0, 0, 1, 1}, - {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, - {&__pyx_kp_u_Obtain_the_problem_solver_curren, __pyx_k_Obtain_the_problem_solver_curren, sizeof(__pyx_k_Obtain_the_problem_solver_curren), 0, 1, 0, 0}, - {&__pyx_n_s_OptimizedBacktrackingSolver, __pyx_k_OptimizedBacktrackingSolver, sizeof(__pyx_k_OptimizedBacktrackingSolver), 0, 0, 1, 1}, - {&__pyx_n_s_Optional, __pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 0, 1, 1}, - {&__pyx_kp_s_Optional_Sequence, __pyx_k_Optional_Sequence, sizeof(__pyx_k_Optional_Sequence), 0, 0, 1, 0}, - {&__pyx_n_s_ParallelSolver, __pyx_k_ParallelSolver, sizeof(__pyx_k_ParallelSolver), 0, 0, 1, 1}, - {&__pyx_kp_u_ParallelSolver_is_currently_expe, __pyx_k_ParallelSolver_is_currently_expe, sizeof(__pyx_k_ParallelSolver_is_currently_expe), 0, 1, 0, 0}, - {&__pyx_n_s_Problem, __pyx_k_Problem, sizeof(__pyx_k_Problem), 0, 0, 1, 1}, - {&__pyx_n_s_Problem___init, __pyx_k_Problem___init, sizeof(__pyx_k_Problem___init), 0, 0, 1, 1}, - {&__pyx_n_s_Problem__getArgs, __pyx_k_Problem__getArgs, sizeof(__pyx_k_Problem__getArgs), 0, 0, 1, 1}, - {&__pyx_n_s_Problem__getArgs_locals_genexpr, __pyx_k_Problem__getArgs_locals_genexpr, sizeof(__pyx_k_Problem__getArgs_locals_genexpr), 0, 0, 1, 1}, - {&__pyx_n_s_Problem_addConstraint, __pyx_k_Problem_addConstraint, sizeof(__pyx_k_Problem_addConstraint), 0, 0, 1, 1}, - {&__pyx_kp_u_Problem_addConstraint_line_139, __pyx_k_Problem_addConstraint_line_139, sizeof(__pyx_k_Problem_addConstraint_line_139), 0, 1, 0, 0}, - {&__pyx_n_s_Problem_addConstraint_locals_gen, __pyx_k_Problem_addConstraint_locals_gen, sizeof(__pyx_k_Problem_addConstraint_locals_gen), 0, 0, 1, 1}, - {&__pyx_n_s_Problem_addVariable, __pyx_k_Problem_addVariable, sizeof(__pyx_k_Problem_addVariable), 0, 0, 1, 1}, - {&__pyx_kp_u_Problem_addVariable_line_86, __pyx_k_Problem_addVariable_line_86, sizeof(__pyx_k_Problem_addVariable_line_86), 0, 1, 0, 0}, - {&__pyx_n_s_Problem_addVariables, __pyx_k_Problem_addVariables, sizeof(__pyx_k_Problem_addVariables), 0, 0, 1, 1}, - {&__pyx_kp_u_Problem_addVariables_line_116, __pyx_k_Problem_addVariables_line_116, sizeof(__pyx_k_Problem_addVariables_line_116), 0, 1, 0, 0}, - {&__pyx_n_s_Problem_getSolution, __pyx_k_Problem_getSolution, sizeof(__pyx_k_Problem_getSolution), 0, 0, 1, 1}, - {&__pyx_n_s_Problem_getSolutionIter, __pyx_k_Problem_getSolutionIter, sizeof(__pyx_k_Problem_getSolutionIter), 0, 0, 1, 1}, - {&__pyx_kp_u_Problem_getSolutionIter_line_216, __pyx_k_Problem_getSolutionIter_line_216, sizeof(__pyx_k_Problem_getSolutionIter_line_216), 0, 1, 0, 0}, - {&__pyx_kp_u_Problem_getSolution_line_178, __pyx_k_Problem_getSolution_line_178, sizeof(__pyx_k_Problem_getSolution_line_178), 0, 1, 0, 0}, - {&__pyx_n_s_Problem_getSolutions, __pyx_k_Problem_getSolutions, sizeof(__pyx_k_Problem_getSolutions), 0, 0, 1, 1}, - {&__pyx_n_s_Problem_getSolutionsAsListDict, __pyx_k_Problem_getSolutionsAsListDict, sizeof(__pyx_k_Problem_getSolutionsAsListDict), 0, 0, 1, 1}, - {&__pyx_n_s_Problem_getSolutionsOrderedList, __pyx_k_Problem_getSolutionsOrderedList, sizeof(__pyx_k_Problem_getSolutionsOrderedList), 0, 0, 1, 1}, - {&__pyx_n_s_Problem_getSolutionsOrderedList_2, __pyx_k_Problem_getSolutionsOrderedList_2, sizeof(__pyx_k_Problem_getSolutionsOrderedList_2), 0, 0, 1, 1}, - {&__pyx_kp_u_Problem_getSolutions_line_197, __pyx_k_Problem_getSolutions_line_197, sizeof(__pyx_k_Problem_getSolutions_line_197), 0, 1, 0, 0}, - {&__pyx_n_s_Problem_getSolver, __pyx_k_Problem_getSolver, sizeof(__pyx_k_Problem_getSolver), 0, 0, 1, 1}, - {&__pyx_kp_u_Problem_getSolver_line_72, __pyx_k_Problem_getSolver_line_72, sizeof(__pyx_k_Problem_getSolver_line_72), 0, 1, 0, 0}, - {&__pyx_n_s_Problem_reset, __pyx_k_Problem_reset, sizeof(__pyx_k_Problem_reset), 0, 0, 1, 1}, - {&__pyx_kp_u_Problem_reset_line_44, __pyx_k_Problem_reset_line_44, sizeof(__pyx_k_Problem_reset_line_44), 0, 1, 0, 0}, - {&__pyx_n_s_Problem_setSolver, __pyx_k_Problem_setSolver, sizeof(__pyx_k_Problem_setSolver), 0, 0, 1, 1}, - {&__pyx_kp_u_Problem_setSolver_line_57, __pyx_k_Problem_setSolver_line_57, sizeof(__pyx_k_Problem_setSolver_line_57), 0, 1, 0, 0}, - {&__pyx_kp_u_Reset_the_current_problem_defini, __pyx_k_Reset_the_current_problem_defini, sizeof(__pyx_k_Reset_the_current_problem_defini), 0, 1, 0, 0}, - {&__pyx_kp_u_Return_an_iterator_to_the_soluti, __pyx_k_Return_an_iterator_to_the_soluti, sizeof(__pyx_k_Return_an_iterator_to_the_soluti), 0, 1, 0, 0}, - {&__pyx_n_s_Sequence, __pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 0, 1, 1}, - {&__pyx_n_s_Solver, __pyx_k_Solver, sizeof(__pyx_k_Solver), 0, 0, 1, 1}, - {&__pyx_kp_u_Tried_to_insert_duplicated_varia, __pyx_k_Tried_to_insert_duplicated_varia, sizeof(__pyx_k_Tried_to_insert_duplicated_varia), 0, 1, 0, 0}, - {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, - {&__pyx_n_s_Union, __pyx_k_Union, sizeof(__pyx_k_Union), 0, 0, 1, 1}, - {&__pyx_kp_s_Union_Constraint_Callable_str, __pyx_k_Union_Constraint_Callable_str, sizeof(__pyx_k_Union_Constraint_Callable_str), 0, 0, 1, 0}, - {&__pyx_kp_u_Using_the_ParallelSolver_in_Thre, __pyx_k_Using_the_ParallelSolver_in_Thre, sizeof(__pyx_k_Using_the_ParallelSolver_in_Thre), 0, 1, 0, 0}, - {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_kp_u_You_have_used_FunctionConstraint, __pyx_k_You_have_used_FunctionConstraint, sizeof(__pyx_k_You_have_used_FunctionConstraint), 0, 1, 0, 0}, - {&__pyx_n_s__29, __pyx_k__29, sizeof(__pyx_k__29), 0, 0, 1, 1}, - {&__pyx_n_s__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 0, 1, 1}, - {&__pyx_n_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 1}, - {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0}, - {&__pyx_n_s_addConstraint, __pyx_k_addConstraint, sizeof(__pyx_k_addConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_addVariable, __pyx_k_addVariable, sizeof(__pyx_k_addVariable), 0, 0, 1, 1}, - {&__pyx_n_s_addVariables, __pyx_k_addVariables, sizeof(__pyx_k_addVariables), 0, 0, 1, 1}, - {&__pyx_n_s_allvariables, __pyx_k_allvariables, sizeof(__pyx_k_allvariables), 0, 0, 1, 1}, - {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, - {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, - {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, - {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, - {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, - {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, - {&__pyx_n_s_collections_abc, __pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 0, 1, 1}, - {&__pyx_n_s_compile_to_constraints, __pyx_k_compile_to_constraints, sizeof(__pyx_k_compile_to_constraints), 0, 0, 1, 1}, - {&__pyx_n_s_constraint, __pyx_k_constraint, sizeof(__pyx_k_constraint), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_constraints, __pyx_k_constraint_constraints, sizeof(__pyx_k_constraint_constraints), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_domain, __pyx_k_constraint_domain, sizeof(__pyx_k_constraint_domain), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_parser, __pyx_k_constraint_parser, sizeof(__pyx_k_constraint_parser), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_problem, __pyx_k_constraint_problem, sizeof(__pyx_k_constraint_problem), 0, 0, 1, 1}, - {&__pyx_kp_s_constraint_problem_py, __pyx_k_constraint_problem_py, sizeof(__pyx_k_constraint_problem_py), 0, 0, 1, 0}, - {&__pyx_n_s_constraint_solvers, __pyx_k_constraint_solvers, sizeof(__pyx_k_constraint_solvers), 0, 0, 1, 1}, - {&__pyx_n_s_constraints, __pyx_k_constraints, sizeof(__pyx_k_constraints), 0, 0, 1, 1}, - {&__pyx_n_s_constraints_2, __pyx_k_constraints_2, sizeof(__pyx_k_constraints_2), 0, 0, 1, 1}, - {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, - {&__pyx_n_s_deepcopy, __pyx_k_deepcopy, sizeof(__pyx_k_deepcopy), 0, 0, 1, 1}, - {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, - {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, - {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, - {&__pyx_n_s_domain, __pyx_k_domain, sizeof(__pyx_k_domain), 0, 0, 1, 1}, - {&__pyx_n_s_domains, __pyx_k_domains, sizeof(__pyx_k_domains), 0, 0, 1, 1}, - {&__pyx_kp_u_duplicate_parameter_configurati, __pyx_k_duplicate_parameter_configurati, sizeof(__pyx_k_duplicate_parameter_configurati), 0, 1, 0, 0}, - {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, - {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1}, - {&__pyx_n_s_freethreading, __pyx_k_freethreading, sizeof(__pyx_k_freethreading), 0, 0, 1, 1}, - {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, - {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, - {&__pyx_n_s_getArgs, __pyx_k_getArgs, sizeof(__pyx_k_getArgs), 0, 0, 1, 1}, - {&__pyx_n_s_getSolution, __pyx_k_getSolution, sizeof(__pyx_k_getSolution), 0, 0, 1, 1}, - {&__pyx_n_s_getSolutionIter, __pyx_k_getSolutionIter, sizeof(__pyx_k_getSolutionIter), 0, 0, 1, 1}, - {&__pyx_n_s_getSolutions, __pyx_k_getSolutions, sizeof(__pyx_k_getSolutions), 0, 0, 1, 1}, - {&__pyx_n_s_getSolutionsAsListDict, __pyx_k_getSolutionsAsListDict, sizeof(__pyx_k_getSolutionsAsListDict), 0, 0, 1, 1}, - {&__pyx_n_s_getSolutionsOrderedList, __pyx_k_getSolutionsOrderedList, sizeof(__pyx_k_getSolutionsOrderedList), 0, 0, 1, 1}, - {&__pyx_n_s_getSolver, __pyx_k_getSolver, sizeof(__pyx_k_getSolver), 0, 0, 1, 1}, - {&__pyx_n_s_get_in_order, __pyx_k_get_in_order, sizeof(__pyx_k_get_in_order), 0, 0, 1, 1}, - {&__pyx_n_u_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 1, 0, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, - {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, - {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, - {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, - {&__pyx_n_s_is_gil_enabled, __pyx_k_is_gil_enabled, sizeof(__pyx_k_is_gil_enabled), 0, 0, 1, 1}, - {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, - {&__pyx_n_s_itemgetter, __pyx_k_itemgetter, sizeof(__pyx_k_itemgetter), 0, 0, 1, 1}, - {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, - {&__pyx_kp_s_list_str, __pyx_k_list_str, sizeof(__pyx_k_list_str), 0, 0, 1, 0}, - {&__pyx_kp_s_list_tuple, __pyx_k_list_tuple, sizeof(__pyx_k_list_tuple), 0, 0, 1, 0}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, - {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, - {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1}, - {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1}, - {&__pyx_n_s_parsed, __pyx_k_parsed, sizeof(__pyx_k_parsed), 0, 0, 1, 1}, - {&__pyx_n_s_picklable, __pyx_k_picklable, sizeof(__pyx_k_picklable), 0, 0, 1, 1}, - {&__pyx_n_s_preProcess, __pyx_k_preProcess, sizeof(__pyx_k_preProcess), 0, 0, 1, 1}, - {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, - {&__pyx_n_s_process_mode, __pyx_k_process_mode, sizeof(__pyx_k_process_mode), 0, 0, 1, 1}, - {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_requires_pickling, __pyx_k_requires_pickling, sizeof(__pyx_k_requires_pickling), 0, 0, 1, 1}, - {&__pyx_n_s_reset, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1}, - {&__pyx_n_s_resetState, __pyx_k_resetState, sizeof(__pyx_k_resetState), 0, 0, 1, 1}, - {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1}, - {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, - {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, - {&__pyx_n_s_setSolver, __pyx_k_setSolver, sizeof(__pyx_k_setSolver), 0, 0, 1, 1}, - {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, - {&__pyx_n_s_size_dict, __pyx_k_size_dict, sizeof(__pyx_k_size_dict), 0, 0, 1, 1}, - {&__pyx_n_s_size_list, __pyx_k_size_list, sizeof(__pyx_k_size_list), 0, 0, 1, 1}, - {&__pyx_n_s_solutions, __pyx_k_solutions, sizeof(__pyx_k_solutions), 0, 0, 1, 1}, - {&__pyx_n_s_solutions_dict, __pyx_k_solutions_dict, sizeof(__pyx_k_solutions_dict), 0, 0, 1, 1}, - {&__pyx_n_s_solutions_list, __pyx_k_solutions_list, sizeof(__pyx_k_solutions_list), 0, 0, 1, 1}, - {&__pyx_n_s_solver, __pyx_k_solver, sizeof(__pyx_k_solver), 0, 0, 1, 1}, - {&__pyx_n_s_solver_2, __pyx_k_solver_2, sizeof(__pyx_k_solver_2), 0, 0, 1, 1}, - {&__pyx_kp_u_solver_is_not_instance_of_Solve, __pyx_k_solver_is_not_instance_of_Solve, sizeof(__pyx_k_solver_is_not_instance_of_Solve), 0, 1, 0, 0}, - {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, - {&__pyx_n_s_str_constraints, __pyx_k_str_constraints, sizeof(__pyx_k_str_constraints), 0, 0, 1, 1}, - {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, - {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, - {&__pyx_kp_s_tuple_list_tuple_dict_tuple_int, __pyx_k_tuple_list_tuple_dict_tuple_int, sizeof(__pyx_k_tuple_list_tuple_dict_tuple_int), 0, 0, 1, 0}, - {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1}, - {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, - {&__pyx_n_s_validate, __pyx_k_validate, sizeof(__pyx_k_validate), 0, 0, 1, 1}, - {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, - {&__pyx_n_s_variable, __pyx_k_variable, sizeof(__pyx_k_variable), 0, 0, 1, 1}, - {&__pyx_n_s_variables, __pyx_k_variables, sizeof(__pyx_k_variables), 0, 0, 1, 1}, - {&__pyx_n_s_variables_2, __pyx_k_variables_2, sizeof(__pyx_k_variables_2), 0, 0, 1, 1}, - {&__pyx_n_s_vconstraints, __pyx_k_vconstraints, sizeof(__pyx_k_vconstraints), 0, 0, 1, 1}, - {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1}, - {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, - {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} - }; - return __Pyx_InitStrings(__pyx_string_tab); -} -/* #### Code section: cached_builtins ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 17, __pyx_L1_error) - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 36, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 104, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 111, __pyx_L1_error) - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 251, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 251, __pyx_L1_error) +static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); return 0; - __pyx_L1_error:; - return -1; } -/* #### Code section: cached_constants ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { +static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "constraint/problem.py":54 - * >>> - * """ - * del self._constraints[:] # <<<<<<<<<<<<<< - * self._variables.clear() - * - */ - __pyx_slice__2 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__2)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__2); - __Pyx_GIVEREF(__pyx_slice__2); - - /* "constraint/problem.py":113 - * raise TypeError(msg) - * if not domain: - * raise ValueError("Domain is empty") # <<<<<<<<<<<<<< - * self._variables[variable] = domain - * - */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Domain_is_empty); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 113, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} - /* "constraint/problem.py":299 - * domain.resetState() - * if not domain: - * return None, None, None # <<<<<<<<<<<<<< - * # doArc8(getArcs(domains, constraints), domains, {}) - * return domains, constraints, vconstraints - */ - __pyx_tuple__4 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 299, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); +static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} - /* "constraint/problem.py":24 - * """Class used to define a problem and retrieve solutions.""" - * - * def __init__(self, solver: Solver=None): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_solver); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 24, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_init, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 24, __pyx_L1_error) - __pyx_tuple__9 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 24, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); - - /* "constraint/problem.py":44 - * warn("Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance.") - * - * def reset(self): # <<<<<<<<<<<<<< - * """Reset the current problem definition. - * - */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_reset, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 44, __pyx_L1_error) - - /* "constraint/problem.py":57 - * self._variables.clear() - * - * def setSolver(self, solver): # <<<<<<<<<<<<<< - * """Change the problem solver currently in use. - * - */ - __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_setSolver, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 57, __pyx_L1_error) - - /* "constraint/problem.py":72 - * self._solver = solver - * - * def getSolver(self): # <<<<<<<<<<<<<< - * """Obtain the problem solver currently in use. - * - */ - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_getSolver, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 72, __pyx_L1_error) - - /* "constraint/problem.py":86 - * return self._solver - * - * def addVariable(self, variable: Hashable, domain): # <<<<<<<<<<<<<< - * """Add a variable to the problem. - * - */ - __pyx_tuple__14 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_variable, __pyx_n_s_domain, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 86, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_addVariable, 86, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 86, __pyx_L1_error) - - /* "constraint/problem.py":116 - * self._variables[variable] = domain - * - * def addVariables(self, variables: Sequence, domain): # <<<<<<<<<<<<<< - * """Add one or more variables to the problem. - * - */ - __pyx_tuple__16 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_variables_2, __pyx_n_s_domain, __pyx_n_s_variable); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); - __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_addVariables, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 116, __pyx_L1_error) - - /* "constraint/problem.py":139 - * self.addVariable(variable, domain) - * - * def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = None): # <<<<<<<<<<<<<< - * """Add a constraint to the problem. - * - */ - __pyx_tuple__18 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_constraint, __pyx_n_s_variables_2, __pyx_n_s_msg, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); - __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_addConstraint, 139, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 139, __pyx_L1_error) - - /* "constraint/problem.py":178 - * self._constraints.append((constraint, variables)) - * - * def getSolution(self): # <<<<<<<<<<<<<< - * """Find and return a solution to the problem. - * - */ - __pyx_tuple__20 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_constraints_2, __pyx_n_s_vconstraints); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_getSolution, 178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 178, __pyx_L1_error) - - /* "constraint/problem.py":197 - * return self._solver.getSolution(domains, constraints, vconstraints) - * - * def getSolutions(self): # <<<<<<<<<<<<<< - * """Find and return all solutions to the problem. - * - */ - __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_getSolutions, 197, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 197, __pyx_L1_error) - - /* "constraint/problem.py":216 - * return self._solver.getSolutions(domains, constraints, vconstraints) - * - * def getSolutionIter(self): # <<<<<<<<<<<<<< - * """Return an iterator to the solutions of the problem. - * - */ - __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_getSolutionIter, 216, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 216, __pyx_L1_error) - - /* "constraint/problem.py":237 - * 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_tuple__24 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_order, __pyx_n_s_solutions, __pyx_n_s_get_in_order, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); - __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_getSolutionsOrderedList, 237, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 237, __pyx_L1_error) - - /* "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_tuple__26 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_order, __pyx_n_s_validate, __pyx_n_s_solutions_list, __pyx_n_s_size_list, __pyx_n_s_solutions_dict, __pyx_n_s_size_dict); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); - __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_getSolutionsAsListDict, 245, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 245, __pyx_L1_error) - __pyx_tuple__28 = PyTuple_Pack(2, Py_None, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); - - /* "constraint/problem.py":265 - * ) - * - * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< - * domains = self._variables.copy() - * allvariables = domains.keys() - */ - __pyx_tuple__30 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_picklable, __pyx_n_s_domains, __pyx_n_s_allvariables, __pyx_n_s_constraints_2, __pyx_n_s_constraint, __pyx_n_s_parsed, __pyx_n_s_c, __pyx_n_s_v, __pyx_n_s__29, __pyx_n_s_variables_2, __pyx_n_s_vconstraints, __pyx_n_s_variable, __pyx_n_s_domain, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); - __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_getArgs, 265, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 265, __pyx_L1_error) - __pyx_tuple__32 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} -/* #### Code section: init_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { - if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_globals ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - /* AssertionsEnabled.init */ - if (likely(__Pyx_init_assertions_enabled() == 0)); else - -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) - - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_module ### */ - -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ - -static int __Pyx_modinit_global_init_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); - /*--- Global init code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_variable_export_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); - /*--- Variable export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_function_export_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); - /*--- Function export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_type_init_code(void) { +static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __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_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_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, 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) #else - __pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr = &__pyx_type_10constraint_7problem___pyx_scope_struct__genexpr; + __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_ptype_10constraint_7problem___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 162, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr->tp_print = 0; + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 162, __pyx_L1_error) #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __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_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_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, 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) #else - __pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList = &__pyx_type_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList; + __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_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList) < 0) __PYX_ERR(0, 237, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList->tp_print = 0; + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList) < 0) __PYX_ERR(0, 237, __pyx_L1_error) #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList->tp_dictoffset && __pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __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_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_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, 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) #else - __pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr = &__pyx_type_10constraint_7problem___pyx_scope_struct_2_genexpr; + __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_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 241, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr->tp_print = 0; + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 241, __pyx_L1_error) #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr->tp_dictoffset && __pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __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_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_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, 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) #else - __pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr = &__pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr; + __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_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 243, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr->tp_print = 0; + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 243, __pyx_L1_error) #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __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_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_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, 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) #else - __pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr = &__pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr; + __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_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 286, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr->tp_print = 0; + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 286, __pyx_L1_error) #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr->tp_dictoffset && __pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif __Pyx_RefNannyFinishContext(); @@ -10796,38 +9591,45 @@ static int __Pyx_modinit_type_init_code(void) { return -1; } -static int __Pyx_modinit_type_import_code(void) { +static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_variable_import_code(void) { +static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_function_import_code(void) { +static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } - -#if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_problem(PyObject* module); /*proto*/ 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}, + #endif + #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE + {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED}, + #endif {0, NULL} }; #endif @@ -10842,12 +9644,10 @@ namespace { PyModuleDef_HEAD_INIT, "problem", __pyx_k_Module_containing_the_code_for_p, /* m_doc */ - #if CYTHON_PEP489_MULTI_PHASE_INIT - 0, /* m_size */ - #elif CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstate), /* m_size */ + #if CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstatetype), /* m_size */ #else - -1, /* m_size */ + (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT @@ -10868,51 +9668,71 @@ namespace { #ifdef __cplusplus } /* anonymous namespace */ #endif -#endif +/* PyModInitFuncType */ #ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#elif PY_MAJOR_VERSION < 3 -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" void -#else -#define __Pyx_PyMODINIT_FUNC void -#endif -#else -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * + #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #else -#define __Pyx_PyMODINIT_FUNC PyObject * -#endif + #ifdef __cplusplus + #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * + #else + #define __Pyx_PyMODINIT_FUNC PyObject * + #endif #endif - -#if PY_MAJOR_VERSION < 3 -__Pyx_PyMODINIT_FUNC initproblem(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC initproblem(void) -#else __Pyx_PyMODINIT_FUNC PyInit_problem(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_problem(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } +/* ModuleCreationPEP489 */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 +static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { + { + PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think + if (!module) { + PyErr_Clear(); // just try the 3.8-3.12 version + module = PyImport_ImportModule("_xxsubinterpreters"); + if (!module) goto bad; + } + PyObject *current = PyObject_CallMethod(module, "get_current", NULL); + Py_DECREF(module); + if (!current) goto bad; + if (PyTuple_Check(current)) { + PyObject *new_current = PySequence_GetItem(current, 0); + Py_DECREF(current); + current = new_current; + if (!new_current) goto bad; + } + long long as_c_int = PyLong_AsLongLong(current); + Py_DECREF(current); + return as_c_int; + } + bad: + PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n"); + return -1; +} +#endif +#if !CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; +#if 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 + PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId(); +#else PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); +#endif + if (unlikely(current_id == -1)) { + return -1; + } if (main_interpreter_id == -1) { main_interpreter_id = current_id; - return (unlikely(current_id == -1)) ? -1 : 0; - } else if (unlikely(main_interpreter_id != current_id)) - #else - static PyInterpreterState *main_interpreter = NULL; - PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; - if (!main_interpreter) { - main_interpreter = current_interpreter; - } else if (unlikely(main_interpreter != current_interpreter)) - #endif - { + return 0; + } else if (unlikely(main_interpreter_id != current_id)) { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); @@ -10920,21 +9740,14 @@ static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { } return 0; } -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) -#else -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { -#if CYTHON_COMPILING_IN_LIMITED_API - result = PyModule_AddObject(module, to_name, value); -#else result = PyDict_SetItemString(moddict, to_name, value); -#endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { @@ -10947,8 +9760,10 @@ static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); + #if !CYTHON_USE_MODULE_STATE if (__Pyx_check_single_interpreter()) return NULL; + #endif if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); @@ -10956,12 +9771,8 @@ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDe module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; -#if CYTHON_COMPILING_IN_LIMITED_API - moddict = module; -#else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; -#endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; @@ -10975,19 +9786,20 @@ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDe static CYTHON_SMALL_CODE int __pyx_pymod_exec_problem(PyObject *__pyx_pyinit_module) #endif -#endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif + __pyx_mstatetype *__pyx_mstate = NULL; 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; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_6 = NULL; + size_t __pyx_t_7; + int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -10998,36 +9810,37 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_problem(PyObject *__pyx_pyinit_mod PyErr_SetString(PyExc_RuntimeError, "Module 'problem' has already been imported. Re-initialisation is not supported."); return -1; } - #elif PY_MAJOR_VERSION >= 3 + #else if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_m = __pyx_pyinit_module; - Py_INCREF(__pyx_m); + __pyx_t_1 = __pyx_pyinit_module; + Py_INCREF(__pyx_t_1); #else - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("problem", __pyx_methods, __pyx_k_Module_containing_the_code_for_p, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #if CYTHON_USE_MODULE_STATE { - int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "problem" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_m = __pyx_t_1; #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED); #endif + __pyx_mstate = __pyx_mstate_global; CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_mstate->__pyx_d); + __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + 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) { @@ -11037,14 +9850,15 @@ if (!__Pyx_RefNanny) { Py_FatalError("failed to import 'refnanny' module"); } #endif - __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_problem(void)", 0); + +__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(); #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __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) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif @@ -11060,48 +9874,34 @@ if (!__Pyx_RefNanny) { #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - PyEval_InitThreads(); - #endif /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants() < 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 PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif if (__pyx_module_is_main_constraint__problem) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_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) } - #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "constraint.problem")) { if (unlikely((PyDict_SetItemString(modules, "constraint.problem", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } - #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 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() < 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(); - (void)__Pyx_modinit_variable_export_code(); - (void)__Pyx_modinit_function_export_code(); - if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - (void)__Pyx_modinit_type_import_code(); - (void)__Pyx_modinit_variable_import_code(); - (void)__Pyx_modinit_function_import_code(); + (void)__Pyx_modinit_global_init_code(__pyx_mstate); + (void)__Pyx_modinit_variable_export_code(__pyx_mstate); + (void)__Pyx_modinit_function_export_code(__pyx_mstate); + if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(__pyx_mstate); + (void)__Pyx_modinit_variable_import_code(__pyx_mstate); + (void)__Pyx_modinit_function_import_code(__pyx_mstate); /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /* "constraint/problem.py":3 * """Module containing the code for problem definitions.""" @@ -11109,10 +9909,10 @@ if (!__Pyx_RefNanny) { * import copy # <<<<<<<<<<<<<< * from warnings import warn * from operator import itemgetter - */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_copy, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) +*/ + __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_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_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 @@ -11121,18 +9921,15 @@ if (!__Pyx_RefNanny) { * from warnings import warn # <<<<<<<<<<<<<< * from operator import itemgetter * from typing import Callable, Optional, Union - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) +*/ + __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_INCREF(__pyx_n_s_warn); - __Pyx_GIVEREF(__pyx_n_s_warn); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_warn)) __PYX_ERR(0, 4, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_warnings, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) + __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_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) + __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) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_warn, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11142,18 +9939,15 @@ if (!__Pyx_RefNanny) { * from operator import itemgetter # <<<<<<<<<<<<<< * from typing import Callable, Optional, Union * from collections.abc import Sequence, Hashable - */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) +*/ + __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_INCREF(__pyx_n_s_itemgetter); - __Pyx_GIVEREF(__pyx_n_s_itemgetter); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_itemgetter)) __PYX_ERR(0, 5, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_operator, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __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_n_s_itemgetter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + __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_d, __pyx_n_s_itemgetter, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + 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; @@ -11163,32 +9957,23 @@ if (!__Pyx_RefNanny) { * from typing import Callable, Optional, Union # <<<<<<<<<<<<<< * from collections.abc import Sequence, Hashable * - */ - __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) +*/ + __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_INCREF(__pyx_n_s_Callable); - __Pyx_GIVEREF(__pyx_n_s_Callable); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Callable)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_Optional); - __Pyx_GIVEREF(__pyx_n_s_Optional); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_Optional)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_Union); - __Pyx_GIVEREF(__pyx_n_s_Union); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_Union)) __PYX_ERR(0, 6, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) + __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_n_s_Callable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __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_d, __pyx_n_s_Callable, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + 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_n_s_Optional); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __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_d, __pyx_n_s_Optional, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + 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_n_s_Union); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __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) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Union, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11198,25 +9983,19 @@ if (!__Pyx_RefNanny) { * from collections.abc import Sequence, Hashable # <<<<<<<<<<<<<< * * from constraint.constraints import Constraint, FunctionConstraint, CompilableFunctionConstraint - */ - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) +*/ + __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_INCREF(__pyx_n_s_Sequence); - __Pyx_GIVEREF(__pyx_n_s_Sequence); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Sequence)) __PYX_ERR(0, 7, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_Hashable); - __Pyx_GIVEREF(__pyx_n_s_Hashable); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_Hashable)) __PYX_ERR(0, 7, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections_abc, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __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) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __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_d, __pyx_n_s_Sequence, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + 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_n_s_Hashable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __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_d, __pyx_n_s_Hashable, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + 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; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11226,32 +10005,23 @@ if (!__Pyx_RefNanny) { * from constraint.constraints import Constraint, FunctionConstraint, CompilableFunctionConstraint # <<<<<<<<<<<<<< * from constraint.domain import Domain * from constraint.solvers import Solver, OptimizedBacktrackingSolver, ParallelSolver - */ - __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) +*/ + __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_INCREF(__pyx_n_s_Constraint); - __Pyx_GIVEREF(__pyx_n_s_Constraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Constraint)) __PYX_ERR(0, 9, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_FunctionConstraint); - __Pyx_GIVEREF(__pyx_n_s_FunctionConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_FunctionConstraint)) __PYX_ERR(0, 9, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_CompilableFunctionConstraint); - __Pyx_GIVEREF(__pyx_n_s_CompilableFunctionConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_CompilableFunctionConstraint)) __PYX_ERR(0, 9, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_constraint_constraints, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) + __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_n_s_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __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_d, __pyx_n_s_Constraint, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + 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_n_s_FunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __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_d, __pyx_n_s_FunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + 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_n_s_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __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) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CompilableFunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11261,18 +10031,15 @@ if (!__Pyx_RefNanny) { * from constraint.domain import Domain # <<<<<<<<<<<<<< * from constraint.solvers import Solver, OptimizedBacktrackingSolver, ParallelSolver * from constraint.parser import compile_to_constraints - */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) +*/ + __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_INCREF(__pyx_n_s_Domain); - __Pyx_GIVEREF(__pyx_n_s_Domain); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Domain)) __PYX_ERR(0, 10, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_constraint_domain, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __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) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) + __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_d, __pyx_n_s_Domain, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + 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; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11282,32 +10049,23 @@ if (!__Pyx_RefNanny) { * from constraint.solvers import Solver, OptimizedBacktrackingSolver, ParallelSolver # <<<<<<<<<<<<<< * from constraint.parser import compile_to_constraints * - */ - __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) +*/ + __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_INCREF(__pyx_n_s_Solver); - __Pyx_GIVEREF(__pyx_n_s_Solver); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Solver)) __PYX_ERR(0, 11, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_OptimizedBacktrackingSolver); - __Pyx_GIVEREF(__pyx_n_s_OptimizedBacktrackingSolver); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_OptimizedBacktrackingSolver)) __PYX_ERR(0, 11, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_ParallelSolver); - __Pyx_GIVEREF(__pyx_n_s_ParallelSolver); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_ParallelSolver)) __PYX_ERR(0, 11, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_constraint_solvers, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error) + __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_n_s_Solver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __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_d, __pyx_n_s_Solver, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) + 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_n_s_OptimizedBacktrackingSolver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __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_d, __pyx_n_s_OptimizedBacktrackingSolver, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) + 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_n_s_ParallelSolver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __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) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ParallelSolver, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11317,18 +10075,15 @@ if (!__Pyx_RefNanny) { * from constraint.parser import compile_to_constraints # <<<<<<<<<<<<<< * * try: - */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) +*/ + __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_INCREF(__pyx_n_s_compile_to_constraints); - __Pyx_GIVEREF(__pyx_n_s_compile_to_constraints); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_compile_to_constraints)) __PYX_ERR(0, 12, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_constraint_parser, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) + __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) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_compile_to_constraints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __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_d, __pyx_n_s_compile_to_constraints, __pyx_t_3) < 0) __PYX_ERR(0, 12, __pyx_L1_error) + 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; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11338,7 +10093,7 @@ if (!__Pyx_RefNanny) { * try: # <<<<<<<<<<<<<< * from sys import _is_gil_enabled * freethreading = _is_gil_enabled() - */ +*/ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -11354,18 +10109,15 @@ if (!__Pyx_RefNanny) { * from sys import _is_gil_enabled # <<<<<<<<<<<<<< * freethreading = _is_gil_enabled() * except ImportError: - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L2_error) +*/ + __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_INCREF(__pyx_n_s_is_gil_enabled); - __Pyx_GIVEREF(__pyx_n_s_is_gil_enabled); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_is_gil_enabled)) __PYX_ERR(0, 15, __pyx_L2_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_sys, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L2_error) + __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_n_s_is_gil_enabled); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L2_error) + __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) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_gil_enabled, __pyx_t_2) < 0) __PYX_ERR(0, 15, __pyx_L2_error) + 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) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11375,14 +10127,21 @@ if (!__Pyx_RefNanny) { * freethreading = _is_gil_enabled() # <<<<<<<<<<<<<< * except ImportError: * freethreading = False - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_is_gil_enabled); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 16, __pyx_L2_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L2_error) - __Pyx_GOTREF(__pyx_t_2); +*/ + __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; + { + 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); + } + 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_d, __pyx_n_s_freethreading, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L2_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/problem.py":14 * from constraint.parser import compile_to_constraints @@ -11390,7 +10149,7 @@ if (!__Pyx_RefNanny) { * try: # <<<<<<<<<<<<<< * from sys import _is_gil_enabled * freethreading = _is_gil_enabled() - */ +*/ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -11399,6 +10158,7 @@ if (!__Pyx_RefNanny) { __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; /* "constraint/problem.py":17 * from sys import _is_gil_enabled @@ -11406,14 +10166,14 @@ if (!__Pyx_RefNanny) { * except ImportError: # <<<<<<<<<<<<<< * freethreading = False * - */ - __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError); - if (__pyx_t_6) { +*/ + __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_8) { __Pyx_AddTraceback("constraint.problem", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_7) < 0) __PYX_ERR(0, 17, __pyx_L4_except_error) - __Pyx_XGOTREF(__pyx_t_2); + 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_7); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_2); /* "constraint/problem.py":18 * freethreading = _is_gil_enabled() @@ -11421,11 +10181,11 @@ if (!__Pyx_RefNanny) { * freethreading = False # <<<<<<<<<<<<<< * * - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_freethreading, Py_False) < 0) __PYX_ERR(0, 18, __pyx_L4_except_error) - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; +*/ + 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_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L3_exception_handled; } goto __pyx_L4_except_error; @@ -11436,7 +10196,7 @@ if (!__Pyx_RefNanny) { * try: # <<<<<<<<<<<<<< * from sys import _is_gil_enabled * freethreading = _is_gil_enabled() - */ +*/ __pyx_L4_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_4); @@ -11457,9 +10217,9 @@ if (!__Pyx_RefNanny) { * class Problem: # <<<<<<<<<<<<<< * """Class used to define a problem and retrieve solutions.""" * - */ - __pyx_t_7 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Problem, __pyx_n_s_Problem, (PyObject *) NULL, __pyx_n_s_constraint_problem, __pyx_kp_s_Class_used_to_define_a_problem_a); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); +*/ + __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); /* "constraint/problem.py":24 * """Class used to define a problem and retrieve solutions.""" @@ -11467,17 +10227,17 @@ if (!__Pyx_RefNanny) { * def __init__(self, solver: Solver=None): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) +*/ + __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); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_solver, __pyx_n_s_Solver) < 0) __PYX_ERR(0, 24, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_1__init__, 0, __pyx_n_s_Problem___init, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__9); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/problem.py":44 * warn("Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance.") @@ -11485,11 +10245,11 @@ if (!__Pyx_RefNanny) { * def reset(self): # <<<<<<<<<<<<<< * """Reset the current problem definition. * - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_3reset, 0, __pyx_n_s_Problem_reset, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_reset, __pyx_t_2) < 0) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +*/ + __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; /* "constraint/problem.py":57 * self._variables.clear() @@ -11497,11 +10257,11 @@ if (!__Pyx_RefNanny) { * def setSolver(self, solver): # <<<<<<<<<<<<<< * """Change the problem solver currently in use. * - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_5setSolver, 0, __pyx_n_s_Problem_setSolver, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_setSolver, __pyx_t_2) < 0) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +*/ + __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; /* "constraint/problem.py":72 * self._solver = solver @@ -11509,11 +10269,11 @@ if (!__Pyx_RefNanny) { * def getSolver(self): # <<<<<<<<<<<<<< * """Obtain the problem solver currently in use. * - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_7getSolver, 0, __pyx_n_s_Problem_getSolver, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_getSolver, __pyx_t_2) < 0) __PYX_ERR(0, 72, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +*/ + __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; /* "constraint/problem.py":86 * return self._solver @@ -11521,16 +10281,16 @@ if (!__Pyx_RefNanny) { * def addVariable(self, variable: Hashable, domain): # <<<<<<<<<<<<<< * """Add a variable to the problem. * - */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_variable, __pyx_n_s_Hashable) < 0) __PYX_ERR(0, 86, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_9addVariable, 0, __pyx_n_s_Problem_addVariable, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_addVariable, __pyx_t_3) < 0) __PYX_ERR(0, 86, __pyx_L1_error) + 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; /* "constraint/problem.py":116 * self._variables[variable] = domain @@ -11538,16 +10298,16 @@ if (!__Pyx_RefNanny) { * def addVariables(self, variables: Sequence, domain): # <<<<<<<<<<<<<< * """Add one or more variables to the problem. * - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error) +*/ + __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); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_variables_2, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 116, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_11addVariables, 0, __pyx_n_s_Problem_addVariables, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_addVariables, __pyx_t_2) < 0) __PYX_ERR(0, 116, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/problem.py":139 * self.addVariable(variable, domain) @@ -11555,18 +10315,18 @@ if (!__Pyx_RefNanny) { * def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Add a constraint to the problem. * - */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_constraint, __pyx_kp_s_Union_Constraint_Callable_str) < 0) __PYX_ERR(0, 139, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_variables_2, __pyx_kp_s_Optional_Sequence) < 0) __PYX_ERR(0, 139, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_13addConstraint, 0, __pyx_n_s_Problem_addConstraint, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__9); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_addConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 139, __pyx_L1_error) + 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; /* "constraint/problem.py":178 * self._constraints.append((constraint, variables)) @@ -11574,11 +10334,11 @@ if (!__Pyx_RefNanny) { * def getSolution(self): # <<<<<<<<<<<<<< * """Find and return a solution to the problem. * - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_15getSolution, 0, __pyx_n_s_Problem_getSolution, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_getSolution, __pyx_t_3) < 0) __PYX_ERR(0, 178, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +*/ + __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; /* "constraint/problem.py":197 * return self._solver.getSolution(domains, constraints, vconstraints) @@ -11586,11 +10346,11 @@ if (!__Pyx_RefNanny) { * def getSolutions(self): # <<<<<<<<<<<<<< * """Find and return all solutions to the problem. * - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_17getSolutions, 0, __pyx_n_s_Problem_getSolutions, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_getSolutions, __pyx_t_3) < 0) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +*/ + __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; /* "constraint/problem.py":216 * return self._solver.getSolutions(domains, constraints, vconstraints) @@ -11598,11 +10358,11 @@ if (!__Pyx_RefNanny) { * def getSolutionIter(self): # <<<<<<<<<<<<<< * """Return an iterator to the solutions of the problem. * - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_19getSolutionIter, 0, __pyx_n_s_Problem_getSolutionIter, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_getSolutionIter, __pyx_t_3) < 0) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +*/ + __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; /* "constraint/problem.py":237 * return self._solver.getSolutionIter(domains, constraints, vconstraints) @@ -11610,18 +10370,18 @@ if (!__Pyx_RefNanny) { * 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_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error) +*/ + __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); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 237, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 237, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_21getSolutionsOrderedList, 0, __pyx_n_s_Problem_getSolutionsOrderedList_2, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__9); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_getSolutionsOrderedList, __pyx_t_2) < 0) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/problem.py":245 * return list(get_in_order(params) for params in solutions) @@ -11629,19 +10389,19 @@ if (!__Pyx_RefNanny) { * def getSolutionsAsListDict( # <<<<<<<<<<<<<< * self, order: list[str] = None, validate: bool = True * ) -> tuple[list[tuple], dict[tuple, int], int]: # noqa: E501 - */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_order, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 245, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_validate, __pyx_n_s_bool) < 0) __PYX_ERR(0, 245, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_kp_s_tuple_list_tuple_dict_tuple_int) < 0) __PYX_ERR(0, 245, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_23getSolutionsAsListDict, 0, __pyx_n_s_Problem_getSolutionsAsListDict, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__28); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_getSolutionsAsListDict, __pyx_t_3) < 0) __PYX_ERR(0, 245, __pyx_L1_error) + 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; /* "constraint/problem.py":265 * ) @@ -11649,12 +10409,12 @@ if (!__Pyx_RefNanny) { * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< * domains = self._variables.copy() * allvariables = domains.keys() - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_25_getArgs, 0, __pyx_n_s_Problem__getArgs, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__32); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_getArgs, __pyx_t_3) < 0) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +*/ + __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; /* "constraint/problem.py":21 * @@ -11662,31 +10422,31 @@ if (!__Pyx_RefNanny) { * class Problem: # <<<<<<<<<<<<<< * """Class used to define a problem and retrieve solutions.""" * - */ - __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Problem, __pyx_empty_tuple, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Problem, __pyx_t_3) < 0) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; +*/ + __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; /* "constraint/problem.py":1 * """Module containing the code for problem definitions.""" # <<<<<<<<<<<<<< * * import copy - */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u_Problem_reset_line_44, __pyx_kp_u_Reset_the_current_problem_defini) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u_Problem_setSolver_line_57, __pyx_kp_u_Change_the_problem_solver_curren) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u_Problem_getSolver_line_72, __pyx_kp_u_Obtain_the_problem_solver_curren) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u_Problem_addVariable_line_86, __pyx_kp_u_Add_a_variable_to_the_problem_Ex) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u_Problem_addVariables_line_116, __pyx_kp_u_Add_one_or_more_variables_to_the) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u_Problem_addConstraint_line_139, __pyx_kp_u_Add_a_constraint_to_the_problem) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u_Problem_getSolution_line_178, __pyx_kp_u_Find_and_return_a_solution_to_th) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u_Problem_getSolutions_line_197, __pyx_kp_u_Find_and_return_all_solutions_to) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u_Problem_getSolutionIter_line_216, __pyx_kp_u_Return_an_iterator_to_the_soluti) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; +*/ + __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; /*--- Wrapped vars code ---*/ @@ -11694,9 +10454,9 @@ if (!__Pyx_RefNanny) { __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); if (__pyx_m) { - if (__pyx_d && stringtab_initialized) { + if (__pyx_mstate->__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init constraint.problem", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE @@ -11717,12 +10477,454 @@ if (!__Pyx_RefNanny) { __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; - #elif PY_MAJOR_VERSION >= 3 - return __pyx_m; #else - return; + return __pyx_m; #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_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) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "constraint/problem.py":54 + * >>> + * """ + * 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_GOTREF(__pyx_mstate_global->__pyx_slice[0]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); + + /* "constraint/problem.py":299 + * 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_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); + + /* "constraint/problem.py":24 + * """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_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 + * ) + * + * 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_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +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); + 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; +/* 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 *tuple_dedup_map +); + + +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}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 241, 2}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 243, 2}; + 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; + } + { + 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 = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 24, 125}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 44, 22}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 57, 11}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 72, 11}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 86, 122}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 116, 25}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 139, 157}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 178, 55}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 197, 55}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 216, 60}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 237, 63}; + 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; + } + { + 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 = {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; + } + Py_DECREF(tuple_dedup_map); + return 0; + bad: + Py_DECREF(tuple_dedup_map); + return -1; +} +/* #### Code section: init_globals ### */ + +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) + + /* AssertionsEnabled.init */ + if (likely(__Pyx_init_assertions_enabled() == 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 + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + return 0; + __pyx_L1_error:; + return -1; +} /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ @@ -11763,11 +10965,9 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; itp_getattro)) return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ -#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -11885,11 +11081,11 @@ static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; -#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 +#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 && PY_VERSION_HEX >= 0x030700B1 +#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); @@ -11905,20 +11101,36 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif } return result; } /* TupleAndListFromArray */ -#if CYTHON_COMPILING_IN_CPYTHON +#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; @@ -11932,8 +11144,7 @@ __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { - Py_INCREF(__pyx_empty_tuple); - return __pyx_empty_tuple; + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; @@ -11956,7 +11167,8 @@ __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ + !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { @@ -12003,55 +11215,39 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL return PyObject_RichCompareBool(s1, s2, equals); #else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; + Py_ssize_t length, length2; int kind; void *data1, *data2; + #if !CYTHON_COMPILING_IN_LIMITED_API if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; + #endif length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length < 0)) return -1; + #endif + length2 = __Pyx_PyUnicode_GET_LENGTH(s2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length2 < 0)) return -1; + #endif + if (length != length2) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; - #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; - #else - hash1 = ((PyUnicodeObject*)s1)->hash; - hash2 = ((PyUnicodeObject*)s2)->hash; - #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } @@ -12069,9 +11265,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { @@ -12081,9 +11274,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -12091,14 +11281,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int return result; } return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ); return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_NE); #endif } @@ -12107,14 +11291,25 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { - Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(n == -1)) return NULL; + #endif for (i = 0; i < n; i++) { - if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + if (s == namei) return kwvalues[i]; } for (i = 0; i < n; i++) { - int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; @@ -12122,15 +11317,26 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO } return NULL; } -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { - Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); + Py_ssize_t i, nkwargs; PyObject *dict; +#if !CYTHON_ASSUME_SAFE_SIZE + nkwargs = PyTuple_Size(kwnames); + if (unlikely(nkwargs < 0)) return NULL; +#else + nkwargs = PyTuple_GET_SIZE(kwnames); +#endif dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif -} - -/* ParseKeywords */ -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); - while (1) { - Py_XDECREF(key); key = NULL; - Py_XDECREF(value); value = NULL; - if (kwds_is_tuple) { - Py_ssize_t size; -#if CYTHON_ASSUME_SAFE_MACROS - size = PyTuple_GET_SIZE(kwds); -#else - size = PyTuple_Size(kwds); - if (size < 0) goto bad; -#endif - if (pos >= size) break; -#if CYTHON_AVOID_BORROWED_REFS - key = __Pyx_PySequence_ITEM(kwds, pos); - if (!key) goto bad; -#elif CYTHON_ASSUME_SAFE_MACROS - key = PyTuple_GET_ITEM(kwds, pos); -#else - key = PyTuple_GetItem(kwds, pos); - if (!key) goto bad; -#endif - value = kwvalues[pos]; - pos++; - } - else - { - if (!PyDict_Next(kwds, &pos, &key, &value)) break; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); -#endif - } - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(value); - Py_DECREF(key); -#endif - key = NULL; - value = NULL; - continue; - } -#if !CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); -#endif - Py_INCREF(value); - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; -#endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = ( - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key) - ); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; -#endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - Py_XDECREF(key); - Py_XDECREF(value); - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - #if PY_MAJOR_VERSION < 3 - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - PyErr_Format(PyExc_TypeError, - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - Py_XDECREF(key); - Py_XDECREF(value); - return -1; -} - -/* RaiseArgTupleInvalid */ -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) -{ - Py_ssize_t num_expected; - const char *more_or_less; - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - PyErr_Format(PyExc_TypeError, - "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -/* PyDictVersioning */ -#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; - return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; -} -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { - PyObject **dictptr = NULL; - Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; - if (offset) { -#if CYTHON_COMPILING_IN_CPYTHON - dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); -#else - dictptr = _PyObject_GetDictPtr(obj); -#endif - } - return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; -} -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) - return 0; - return obj_dict_version == __Pyx_get_object_dict_version(obj); -} -#endif - -/* GetModuleGlobalName */ -#if CYTHON_USE_DICT_VERSIONS -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) -#else -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) -#endif -{ - PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 - result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } else if (unlikely(PyErr_Occurred())) { - return NULL; - } -#elif CYTHON_COMPILING_IN_LIMITED_API - if (unlikely(!__pyx_m)) { - return NULL; - } - result = PyObject_GetAttr(__pyx_m, name); - if (likely(result)) { - return result; - } -#else - result = PyDict_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } -#endif -#else - result = PyObject_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } - PyErr_Clear(); -#endif - return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject *const *args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; @@ -12437,14 +11387,12 @@ static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args --tstate->recursion_depth; return result; } -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { +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; -#if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; -#endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; @@ -12452,19 +11400,11 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { - return NULL; - } - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } - #endif if ( -#if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && -#endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { @@ -12501,9 +11441,7 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, k = NULL; } closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); -#endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); @@ -12512,17 +11450,10 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, d = NULL; nd = 0; } -#if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); -#else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, closure); -#endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); @@ -12537,13 +11468,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -12562,13 +11488,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -12582,7 +11503,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API -static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { +static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; @@ -12590,7 +11511,7 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **arg if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); - if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: @@ -12598,7 +11519,32 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **arg return result; } #endif -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { +#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API + #if PY_VERSION_HEX < 0x03090000 + #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable) + #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 (__Pyx_CyFunction_CheckExact(callable)) { + return __Pyx_CyFunction_func_vectorcall(callable); + } + #endif + if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) { + return NULL; + } + assert(PyCallable_Check(callable)); + Py_ssize_t offset = tp->tp_vectorcall_offset; + assert(offset > 0); + vectorcallfunc ptr; + memcpy(&ptr, (char *) callable + offset, sizeof(ptr)); + return ptr; +} + #else + #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable) + #endif +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { @@ -12619,12 +11565,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } - #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif - #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); @@ -12632,24 +11576,22 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif #endif if (kwargs == NULL) { - #if CYTHON_VECTORCALL - #if PY_VERSION_HEX < 0x03090000 - vectorcallfunc f = _PyVectorcall_Function(func); - #else - vectorcallfunc f = PyVectorcall_Function(func); - #endif + #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API + vectorcallfunc f = __Pyx_PyVectorcall_Function(func); if (f) { - return f(func, args, (size_t)nargs, NULL); + 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, (size_t)nargs, NULL); + if (f) return f(func, args, _nargs, NULL); } + #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL + return PyObject_Vectorcall(func, args, _nargs, NULL); #endif } if (nargs == 0) { - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); @@ -12658,64 +11600,661 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif } +/* UnpackUnboundCMethod */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; + PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); + if (unlikely(!selfless_args)) return NULL; + result = PyObject_Call(method, selfless_args, kwargs); + Py_DECREF(selfless_args); + return result; +} +#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000 +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { + return _PyObject_Vectorcall + (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames); +} +#else +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + return +#if PY_VERSION_HEX < 0x03090000 + _PyObject_Vectorcall +#else + PyObject_Vectorcall +#endif + (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames); +} +#endif +static PyMethodDef __Pyx_UnboundCMethod_Def = { + "CythonUnboundCMethod", + __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 + METH_VARARGS | METH_KEYWORDS, +#else + METH_FASTCALL | METH_KEYWORDS, +#endif + NULL +}; +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method, *result=NULL; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + result = method; +#if CYTHON_COMPILING_IN_CPYTHON + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } else +#endif +#if CYTHON_COMPILING_IN_PYPY +#else + if (PyCFunction_Check(method)) +#endif + { + PyObject *self; + int self_found; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + self = PyObject_GetAttrString(method, "__self__"); + if (!self) { + PyErr_Clear(); + } +#else + self = PyCFunction_GET_SELF(method); +#endif + self_found = (self && self != Py_None); +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + Py_XDECREF(self); +#endif + if (self_found) { + PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); + if (unlikely(!unbound_method)) return -1; + Py_DECREF(method); + result = unbound_method; + } + } +#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if (unlikely(target->method)) { + Py_DECREF(result); + } else +#endif + target->method = result; + return 0; +} + +/* CallUnboundCMethod2 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { + int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); + if (likely(was_initialized == 2 && cfunc->func)) { + PyObject *args[2] = {arg1, arg2}; + if (cfunc->flag == METH_FASTCALL) { + return __Pyx_CallCFunctionFast(cfunc, self, args, 2); + } + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL); + } +#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__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2); + } +#endif + PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); + __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); + return result; +} +#endif +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + PyObject *result = NULL; + PyObject *args = PyTuple_New(2); + if (unlikely(!args)) return NULL; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + if (cfunc->flag & METH_KEYWORDS) + result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); + else + result = __Pyx_CallCFunction(cfunc, self, args); + Py_DECREF(args); + return result; + } +#endif + { + PyObject *args[4] = {NULL, self, arg1, arg2}; + return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + } +} + +/* ParseKeywords */ +static int __Pyx_ValidateDuplicatePosArgs( + PyObject *kwds, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + const char* function_name) +{ + PyObject ** const *name = argnames; + while (name != first_kw_arg) { + PyObject *key = **name; + int found = PyDict_Contains(kwds, key); + if (unlikely(found)) { + if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; + } + name++; + } + return 0; +bad: + return -1; +} +#if CYTHON_USE_UNICODE_INTERNALS +static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) { + int kind; + Py_ssize_t len = PyUnicode_GET_LENGTH(s1); + if (len != PyUnicode_GET_LENGTH(s2)) return 0; + kind = PyUnicode_KIND(s1); + if (kind != PyUnicode_KIND(s2)) return 0; + const void *data1 = PyUnicode_DATA(s1); + const void *data2 = PyUnicode_DATA(s2); + return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0); +} +#endif +static int __Pyx_MatchKeywordArg_str( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + PyObject ** const *name; + #if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t key_hash = ((PyASCIIObject*)key)->hash; + if (unlikely(key_hash == -1)) { + key_hash = PyObject_Hash(key); + if (unlikely(key_hash == -1)) + goto bad; + } + #endif + name = first_kw_arg; + while (*name) { + PyObject *name_str = **name; + #if CYTHON_USE_UNICODE_INTERNALS + if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) { + *index_found = (size_t) (name - argnames); + return 1; + } + #else + #if CYTHON_ASSUME_SAFE_SIZE + if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) + #endif + { + int cmp = PyUnicode_Compare(name_str, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + *index_found = (size_t) (name - argnames); + return 1; + } + } + #endif + name++; + } + name = argnames; + while (name != first_kw_arg) { + PyObject *name_str = **name; + #if CYTHON_USE_UNICODE_INTERNALS + if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) { + if (__Pyx_UnicodeKeywordsEqual(name_str, key)) + goto arg_passed_twice; + } + #else + #if CYTHON_ASSUME_SAFE_SIZE + if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) + #endif + { + if (unlikely(name_str == key)) goto arg_passed_twice; + int cmp = PyUnicode_Compare(name_str, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + } + #endif + name++; + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +bad: + return -1; +} +static int __Pyx_MatchKeywordArg_nostr( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + PyObject ** const *name; + if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; + name = first_kw_arg; + while (*name) { + int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); + if (cmp == 1) { + *index_found = (size_t) (name - argnames); + return 1; + } + if (unlikely(cmp == -1)) goto bad; + name++; + } + name = argnames; + while (name != first_kw_arg) { + int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); + if (unlikely(cmp != 0)) { + if (cmp == 1) goto arg_passed_twice; + else goto bad; + } + name++; + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +bad: + return -1; +} +static CYTHON_INLINE int __Pyx_MatchKeywordArg( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + return likely(PyUnicode_CheckExact(key)) ? + __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) : + __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name); +} +static void __Pyx_RejectUnknownKeyword( + PyObject *kwds, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + const char *function_name) +{ + Py_ssize_t pos = 0; + PyObject *key = NULL; + __Pyx_BEGIN_CRITICAL_SECTION(kwds); + while (PyDict_Next(kwds, &pos, &key, NULL)) { + 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) { + if (cmp == 0) { + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif + break; + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif + } + } + __Pyx_END_CRITICAL_SECTION(); + assert(PyErr_Occurred()); +} +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) +{ + PyObject** const *name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + Py_ssize_t extracted = 0; +#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) + if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; +#endif + name = first_kw_arg; + while (*name && num_kwargs > extracted) { + PyObject * key = **name; + PyObject *value; + int found = 0; + #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + found = PyDict_GetItemRef(kwds, key, &value); + #else + value = PyDict_GetItemWithError(kwds, key); + if (value) { + Py_INCREF(value); + found = 1; + } else { + if (unlikely(PyErr_Occurred())) goto bad; + } + #endif + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + extracted++; + } + name++; + } + if (num_kwargs > extracted) { + if (ignore_unknown_kwargs) { + if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1)) + goto bad; + } else { + __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name); + goto bad; + } + } + return 0; +bad: + return -1; +} +static int __Pyx_ParseKeywordDictToDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject** const *name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + Py_ssize_t len; +#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) + if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; +#endif + if (PyDict_Update(kwds2, kwds) < 0) goto bad; + name = first_kw_arg; + while (*name) { + PyObject *key = **name; + PyObject *value; +#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop)) + int found = PyDict_Pop(kwds2, key, &value); + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + } +#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + int found = PyDict_GetItemRef(kwds2, key, &value); + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad; + } +#else + #if CYTHON_COMPILING_IN_CPYTHON + value = _PyDict_Pop(kwds2, key, kwds2); + #else + value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2); + #endif + if (value == kwds2) { + Py_DECREF(value); + } else { + if (unlikely(!value)) goto bad; + values[name-argnames] = value; + } +#endif + name++; + } + len = PyDict_Size(kwds2); + if (len > 0) { + return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name); + } else if (unlikely(len == -1)) { + goto bad; + } + return 0; +bad: + return -1; +} +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) +{ + PyObject *key = NULL; + PyObject** const * name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) { +#if CYTHON_AVOID_BORROWED_REFS + key = __Pyx_PySequence_ITEM(kwds, pos); +#else + key = __Pyx_PyTuple_GET_ITEM(kwds, pos); +#endif +#if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!key)) goto bad; +#endif + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + PyObject *value = kwvalues[pos]; + values[name-argnames] = __Pyx_NewRef(value); + } else { + size_t index_found = 0; + int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); + if (cmp == 1) { + PyObject *value = kwvalues[pos]; + values[index_found] = __Pyx_NewRef(value); + } else { + if (unlikely(cmp == -1)) goto bad; + if (kwds2) { + PyObject *value = kwvalues[pos]; + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else if (!ignore_unknown_kwargs) { + goto invalid_keyword; + } + } + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + key = NULL; + #endif + } + return 0; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + goto bad; +bad: + #if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(key); + #endif + return -1; +} +static 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) +{ + if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) + return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); + else if (kwds2) + return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name); + else + return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); +} + +/* RaiseArgTupleInvalid */ +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* PyDictVersioning */ +#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; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!__pyx_m)) { + if (!PyErr_Occurred()) + PyErr_SetNone(PyExc_NameError); + return NULL; + } + result = PyObject_GetAttr(__pyx_m, name); + if (likely(result)) { + return result; + } + PyErr_Clear(); +#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear(); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return result; + } +#else + result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_setattr)) - return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); -#endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* JoinPyUnicode */ -static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, +static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char) { #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyObject *result_uval; int result_ukind, kind_shift; Py_ssize_t i, char_pos; void *result_udata; - CYTHON_MAYBE_UNUSED_VAR(max_char); -#if CYTHON_PEP393_ENABLED + if (max_char > 1114111) max_char = 1114111; result_uval = PyUnicode_New(result_ulength, max_char); if (unlikely(!result_uval)) return NULL; result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; - result_udata = PyUnicode_DATA(result_uval); -#else - result_uval = PyUnicode_FromUnicode(NULL, result_ulength); - if (unlikely(!result_uval)) return NULL; - result_ukind = sizeof(Py_UNICODE); - kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1; - result_udata = PyUnicode_AS_UNICODE(result_uval); -#endif + result_udata = PyUnicode_DATA(result_uval); assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); + if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0)) + goto overflow; char_pos = 0; for (i=0; i < value_count; i++) { int ukind; Py_ssize_t ulength; void *udata; - PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); - if (unlikely(__Pyx_PyUnicode_READY(uval))) + PyObject *uval = values[i]; + #if !CYTHON_COMPILING_IN_LIMITED_API + if (__Pyx_PyUnicode_READY(uval) == (-1)) goto bad; + #endif ulength = __Pyx_PyUnicode_GET_LENGTH(uval); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(ulength < 0)) goto bad; + #endif if (unlikely(!ulength)) continue; if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) goto overflow; ukind = __Pyx_PyUnicode_KIND(uval); udata = __Pyx_PyUnicode_DATA(uval); - if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { + if (ukind == result_ukind) { memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); } else { #if PY_VERSION_HEX >= 0x030d0000 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; - #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) + #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters) _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); #else Py_ssize_t j; @@ -12734,66 +12273,24 @@ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_co Py_DECREF(result_uval); return NULL; #else + Py_ssize_t i; + PyObject *result = NULL; + PyObject *value_tuple = PyTuple_New(value_count); + if (unlikely(!value_tuple)) return NULL; CYTHON_UNUSED_VAR(max_char); CYTHON_UNUSED_VAR(result_ulength); - CYTHON_UNUSED_VAR(value_count); - return PyUnicode_Join(__pyx_empty_unicode, value_tuple); + for (i=0; i__pyx_empty_unicode, value_tuple); +bad: + Py_DECREF(value_tuple); + return result; #endif } /* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - __Pyx_PyThreadState_declare - CYTHON_UNUSED_VAR(cause); - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { @@ -12878,9 +12375,9 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { - #if PY_VERSION_HEX >= 0x030C00A6 +#if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); - #elif CYTHON_FAST_THREAD_STATE +#elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -12900,59 +12397,16 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_XDECREF(owned_instance); return; } -#endif /* SliceObject */ static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, 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) { + int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS - PyMappingMethods* mp; -#if PY_MAJOR_VERSION < 3 - PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; - if (likely(ms && ms->sq_ass_slice)) { - if (!has_cstart) { - if (_py_start && (*_py_start != Py_None)) { - cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); - if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstart = 0; - } - if (!has_cstop) { - if (_py_stop && (*_py_stop != Py_None)) { - cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); - if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstop = PY_SSIZE_T_MAX; - } - if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { - Py_ssize_t l = ms->sq_length(obj); - if (likely(l >= 0)) { - if (cstop < 0) { - cstop += l; - if (cstop < 0) cstop = 0; - } - if (cstart < 0) { - cstart += l; - if (cstart < 0) cstart = 0; - } - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - goto bad; - PyErr_Clear(); - } - } - return ms->sq_ass_slice(obj, cstart, cstop, value); - } -#else - CYTHON_UNUSED_VAR(wraparound); -#endif - mp = Py_TYPE(obj)->tp_as_mapping; + PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_ass_subscript)) -#else - CYTHON_UNUSED_VAR(wraparound); #endif { int result; @@ -12966,7 +12420,7 @@ static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, py_start = *_py_start; } else { if (has_cstart) { - owned_start = py_start = PyInt_FromSsize_t(cstart); + owned_start = py_start = PyLong_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; @@ -12975,7 +12429,7 @@ static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, py_stop = *_py_stop; } else { if (has_cstop) { - owned_stop = py_stop = PyInt_FromSsize_t(cstop); + owned_stop = py_stop = PyLong_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; @@ -12998,7 +12452,7 @@ static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, } return result; } - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object does not support slice %.10s", obj_type_name, value ? "assignment" : "deletion"); @@ -13007,45 +12461,47 @@ static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, return -1; } -/* 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); +/* PyObjectFastCallMethod */ +#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000 +static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) { + PyObject *result; + PyObject *attr = PyObject_GetAttr(args[0], name); + if (unlikely(!attr)) + return NULL; + result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1); + Py_DECREF(attr); + return result; } - -/* GetAttr */ -static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { -#if CYTHON_USE_TYPE_SLOTS -#if PY_MAJOR_VERSION >= 3 - if (likely(PyUnicode_Check(n))) -#else - if (likely(PyString_Check(n))) #endif - return __Pyx_PyObject_GetAttrStr(o, n); -#endif - return PyObject_GetAttr(o, n); + +/* PyUnicode_Unicode */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) { + if (unlikely(obj == Py_None)) + obj = __pyx_mstate_global->__pyx_kp_u_None; + return __Pyx_NewRef(obj); } /* HasAttr */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; - if (unlikely(!__Pyx_PyBaseString_Check(n))) { + if (unlikely(!PyUnicode_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } - r = __Pyx_GetAttr(o, n); + r = __Pyx_PyObject_GetAttrStrNoError(o, n); if (!r) { - PyErr_Clear(); - return 0; + return (unlikely(PyErr_Occurred())) ? -1 : 0; } else { Py_DECREF(r); return 1; } } +#endif /* RaiseUnboundLocalError */ -static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { +static void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } @@ -13059,14 +12515,9 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030C00A6 + #if PY_VERSION_HEX >= 0x030C0000 local_value = tstate->current_exception; tstate->current_exception = 0; - if (likely(local_value)) { - local_type = (PyObject*) Py_TYPE(local_value); - Py_INCREF(local_type); - local_tb = PyException_GetTraceback(local_value); - } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; @@ -13075,24 +12526,30 @@ 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 + local_value = PyErr_GetRaisedException(); #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif +#if __PYX_LIMITED_VERSION_HEX > 0x030C0000 + if (likely(local_value)) { + local_type = (PyObject*) Py_TYPE(local_value); + Py_INCREF(local_type); + local_tb = PyException_GetTraceback(local_value); + } +#else PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 - if (unlikely(tstate->current_exception)) -#elif CYTHON_FAST_THREAD_STATE +#if CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; - #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } - #endif +#endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000 Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); @@ -13130,10 +12587,16 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); +#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000 + PyErr_SetHandledException(local_value); + Py_XDECREF(local_value); + Py_XDECREF(local_type); + Py_XDECREF(local_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; +#if __PYX_LIMITED_VERSION_HEX <= 0x030C0000 bad: *type = 0; *value = 0; @@ -13142,36 +12605,37 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; +#endif } /* pep479 */ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { - PyObject *exc, *val, *tb, *cur_exc; + PyObject *exc, *val, *tb, *cur_exc, *new_exc; __Pyx_PyThreadState_declare - #ifdef __Pyx_StopAsyncIteration_USED int is_async_stopiteration = 0; - #endif CYTHON_MAYBE_UNUSED_VAR(in_async_gen); - cur_exc = PyErr_Occurred(); + __Pyx_PyThreadState_assign + cur_exc = __Pyx_PyErr_CurrentExceptionType(); if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) { - #ifdef __Pyx_StopAsyncIteration_USED - if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) { + if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopAsyncIteration))) { is_async_stopiteration = 1; - } else - #endif + } else { return; + } } - __Pyx_PyThreadState_assign __Pyx_GetException(&exc, &val, &tb); Py_XDECREF(exc); - Py_XDECREF(val); Py_XDECREF(tb); - PyErr_SetString(PyExc_RuntimeError, - #ifdef __Pyx_StopAsyncIteration_USED + new_exc = PyObject_CallFunction(PyExc_RuntimeError, "s", is_async_stopiteration ? "async generator raised StopAsyncIteration" : in_async_gen ? "async generator raised StopIteration" : - #endif "generator raised StopIteration"); + if (!new_exc) { + Py_XDECREF(val); + return; + } + PyException_SetCause(new_exc, val); // steals ref to val + PyErr_SetObject(PyExc_RuntimeError, new_exc); } /* PyObjectCall2Args */ @@ -13180,6 +12644,12 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyOb 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 */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; @@ -13203,18 +12673,12 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) -#elif PY_MAJOR_VERSION >= 3 +#else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif -#else - #ifdef __Pyx_CyFunction_USED - if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) - #else - if (likely(PyFunction_Check(descr))) - #endif #endif { meth_found = 1; @@ -13252,15 +12716,10 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me *method = descr; return 0; } - type_name = __Pyx_PyType_GetName(tp); + type_name = __Pyx_PyType_GetFullyQualifiedName(tp); PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(name)); -#endif __Pyx_DECREF_TypeName(type_name); return 0; #else @@ -13282,7 +12741,7 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me } /* PyObjectCallMethod1 */ -#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) +#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); @@ -13290,7 +12749,7 @@ 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 >= 0x030C00A2 +#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; @@ -13314,7 +12773,7 @@ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { - PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); + PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_mstate_global->__pyx_n_u_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); @@ -13322,6 +12781,51 @@ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { return 0; } +/* PyObjectVectorCallKwBuilder */ +#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); + args[n] = value; + return 0; +} +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_VectorcallBuilder_AddArgStr; + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n); +} +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + PyObject *pyKey = PyUnicode_FromString(key); + if (!pyKey) return -1; + return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n); +} +#else // CYTHON_VECTORCALL +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) { + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return PyDict_SetItem(builder, key, value); +} +#endif + +/* PyObjectVectorCallMethodKwBuilder */ +#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000 +static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) { + PyObject *result; + PyObject *obj = PyObject_GetAttr(args[0], name); + if (unlikely(!obj)) + return NULL; + result = __Pyx_Object_Vectorcall_CallFromBuilder(obj, args+1, nargsf-1, kwnames); + Py_DECREF(obj); + return result; +} +#endif + /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, @@ -13365,30 +12869,51 @@ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *nam { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; + PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode; + int from_annotation_subclass = 0; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } - else if (exact) { - #if PY_MAJOR_VERSION == 2 - if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { + else if (!exact) { if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } else if (exact == 2) { + if (__Pyx_TypeCheck(obj, type)) { + from_annotation_subclass = 1; + extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately; + } } - type_name = __Pyx_PyType_GetName(type); - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + type_name = __Pyx_PyType_GetFullyQualifiedName(type); + obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME - ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); + ", got " __Pyx_FMT_TYPENAME ")" +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + "%s%U" +#endif + , name, type_name, obj_type_name +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + , (from_annotation_subclass ? ". " : ""), extra_info +#endif + ); +#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + if (exact == 2 && from_annotation_subclass) { + PyObject *res; + PyObject *vargs[2]; + vargs[0] = PyErr_GetRaisedException(); + vargs[1] = extra_info; + res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL); + Py_XDECREF(res); + PyErr_SetRaisedException(vargs[0]); + } +#endif __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* RaiseClosureNameError */ -static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { +static void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } @@ -13396,7 +12921,7 @@ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) { - __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, expected, obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); @@ -13404,7 +12929,7 @@ __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) } /* UnicodeConcatInPlace */ -# if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +# if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_unicode_modifiable(PyObject *unicode) { @@ -13468,25 +12993,20 @@ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_le #endif /* DictGetItem */ -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (!PyErr_Occurred()) { - if (unlikely(PyTuple_Check(key))) { - PyObject* args = PyTuple_Pack(1, key); - if (likely(args)) { - PyErr_SetObject(PyExc_KeyError, args); - Py_DECREF(args); - } - } else { - PyErr_SetObject(PyExc_KeyError, key); + if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error + if (unlikely(PyTuple_Check(key))) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) { + PyErr_SetObject(PyExc_KeyError, args); + Py_DECREF(args); } + } else { + PyErr_SetObject(PyExc_KeyError, key); } - return NULL; } - Py_INCREF(value); return value; } #endif @@ -13508,7 +13028,13 @@ static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop *_start = start; *_stop = stop; } -static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice( +static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice( + PyObject* src, Py_ssize_t start, Py_ssize_t stop) { + Py_ssize_t length = PyTuple_GET_SIZE(src); + __Pyx_crop_slice(&start, &stop, &length); + return __Pyx_PyTuple_FromArray(((PyTupleObject*)src)->ob_item + start, length); +} +static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice_locked( PyObject* src, Py_ssize_t start, Py_ssize_t stop) { Py_ssize_t length = PyList_GET_SIZE(src); __Pyx_crop_slice(&start, &stop, &length); @@ -13517,13 +13043,15 @@ static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice( } return __Pyx_PyList_FromArray(((PyListObject*)src)->ob_item + start, length); } -static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice( +static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice( PyObject* src, Py_ssize_t start, Py_ssize_t stop) { - Py_ssize_t length = PyTuple_GET_SIZE(src); - __Pyx_crop_slice(&start, &stop, &length); - return __Pyx_PyTuple_FromArray(((PyTupleObject*)src)->ob_item + start, length); + PyObject *result; + __Pyx_BEGIN_CRITICAL_SECTION(src); + result = __Pyx_PyList_GetSlice_locked(src, start, stop); + __Pyx_END_CRITICAL_SECTION(); + return result; } -#endif +#endif // CYTHON_COMPILING_IN_CPYTHON /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { @@ -13556,20 +13084,45 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); - } else if (PyTuple_GET_SIZE(t) < index) { - __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { - __Pyx_RaiseTooManyValuesError(index); + Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(t); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(size < 0)) return; + #endif + if (size < index) { + __Pyx_RaiseNeedMoreValuesError(size); + } else { + __Pyx_RaiseTooManyValuesError(index); + } } } /* UnpackTuple2 */ +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))) { + Py_ssize_t size; + if (has_known_size) { + return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple); + } + size = __Pyx_PyTuple_GET_SIZE(tuple); + if (likely(size == 2)) { + return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple); + } + if (size >= 0) { + __Pyx_UnpackTupleError(tuple, 2); + } + return -1; + } else { + return __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple); + } +} static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { PyObject *value1 = NULL, *value2 = NULL; -#if CYTHON_COMPILING_IN_PYPY - value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; - value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; +#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS + value1 = __Pyx_PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; + value2 = __Pyx_PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); @@ -13580,7 +13133,7 @@ static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( *pvalue1 = value1; *pvalue2 = value2; return 0; -#if CYTHON_COMPILING_IN_PYPY +#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS bad: Py_XDECREF(value1); Py_XDECREF(value2); @@ -13616,7 +13169,7 @@ static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyOb } /* dict_iter */ -#if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 +#if CYTHON_COMPILING_IN_PYPY #include #endif static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, @@ -13628,7 +13181,7 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; -#elif PY_MAJOR_VERSION >= 3 +#else static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; PyObject **pp = NULL; if (method_name) { @@ -13663,53 +13216,102 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di } return PyObject_GetIter(iterable); } -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 (source_is_dict) { - PyObject *key, *value; - if (unlikely(orig_length != PyDict_Size(iter_obj))) { - PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); +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) { + PyObject *key, *value; + if (unlikely(orig_length != PyDict_Size(iter_obj))) { + PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); + return -1; + } + if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { + return 0; + } + if (pitem) { + PyObject* tuple = PyTuple_New(2); + if (unlikely(!tuple)) { return -1; } - if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { - return 0; + Py_INCREF(key); + Py_INCREF(value); + #if CYTHON_ASSUME_SAFE_MACROS + PyTuple_SET_ITEM(tuple, 0, key); + PyTuple_SET_ITEM(tuple, 1, value); + #else + if (unlikely(PyTuple_SetItem(tuple, 0, key) < 0)) { + Py_DECREF(value); + Py_DECREF(tuple); + return -1; } - if (pitem) { - PyObject* tuple = PyTuple_New(2); - if (unlikely(!tuple)) { - return -1; - } + if (unlikely(PyTuple_SetItem(tuple, 1, value) < 0)) { + Py_DECREF(tuple); + return -1; + } + #endif + *pitem = tuple; + } else { + if (pkey) { Py_INCREF(key); + *pkey = key; + } + if (pvalue) { Py_INCREF(value); - PyTuple_SET_ITEM(tuple, 0, key); - PyTuple_SET_ITEM(tuple, 1, value); - *pitem = tuple; - } else { - if (pkey) { - Py_INCREF(key); - *pkey = key; - } - if (pvalue) { - Py_INCREF(value); - *pvalue = value; - } + *pvalue = value; } - return 1; + } + return 1; +} +#endif +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 (source_is_dict) { + int result; +#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_BEGIN_CRITICAL_SECTION(iter_obj); +#endif + result = __Pyx_dict_iter_next_source_is_dict(iter_obj, orig_length, ppos, pkey, pvalue, pitem); +#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_END_CRITICAL_SECTION(); +#endif + return result; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; - if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; + Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(iter_obj); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(tuple_size < 0)) return -1; + #endif + if (unlikely(pos >= tuple_size)) return 0; *ppos = pos + 1; + #if CYTHON_ASSUME_SAFE_MACROS next_item = PyTuple_GET_ITEM(iter_obj, pos); + #else + next_item = PyTuple_GetItem(iter_obj, pos); + if (unlikely(!next_item)) return -1; + #endif Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; - if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; + Py_ssize_t list_size = __Pyx_PyList_GET_SIZE(iter_obj); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(list_size < 0)) return -1; + #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); + if (unlikely(!next_item)) return -1; + Py_INCREF(next_item); + #endif } else #endif { @@ -13731,8 +13333,26 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( return 1; } +/* CallTypeTraverse */ +#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) { + #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 + if (__Pyx_get_runtime_version() < 0x03090000) return 0; + #endif + if (!always_call) { + PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*); + unsigned long flags = PyType_GetFlags(base); + if (flags & Py_TPFLAGS_HEAPTYPE) { + return 0; + } + } + Py_VISIT((PyObject*)Py_TYPE(o)); + return 0; +} +#endif + /* FixUpExtensionType */ -#if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); @@ -13802,20 +13422,20 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject #endif return 0; } -#endif /* ValidateBasesTuple */ #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; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); - if (n < 0) return -1; + if (unlikely(n < 0)) return -1; #endif for (i = 1; i < n; i++) { + PyTypeObject *b; #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; @@ -13824,23 +13444,11 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; -#endif - PyTypeObject *b; -#if PY_MAJOR_VERSION < 3 - if (PyClass_Check(b0)) - { - PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", - PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); -#if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); -#endif - return -1; - } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { - __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); @@ -13852,7 +13460,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; -#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY +#if CYTHON_USE_TYPE_SLOTS b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); @@ -13863,7 +13471,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #endif if (b_dictoffset) { { - __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " @@ -13872,7 +13480,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs type_name, b_name); __Pyx_DECREF_TypeName(b_name); } -#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) +#if !CYTHON_USE_TYPE_SLOTS dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS @@ -13890,8 +13498,18 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #endif /* PyType_Ready */ +CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) { + while (t) { + PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); + if (bases) { + return 1; + } + t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*); + } + return 0; +} static int __Pyx_PyType_Ready(PyTypeObject *t) { -#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) +#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; @@ -13899,10 +13517,13 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { return PyType_Ready(t); #else int r; + if (!__Pyx_PyType_HasMultipleInheritance(t)) { + return PyType_Ready(t); + } PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; -#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) +#if !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 @@ -13911,12 +13532,13 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { #else PyObject *ret, *py_status; PyObject *gc = NULL; - #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) - gc = PyImport_GetModule(__pyx_kp_u_gc); + #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\ + !CYTHON_COMPILING_IN_GRAAL + gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc); #endif - if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); + if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc); if (unlikely(!gc)) return -1; - py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); + py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; @@ -13924,7 +13546,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; @@ -13943,7 +13565,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); -#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) +#if !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) @@ -13952,7 +13574,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); @@ -13971,114 +13593,51 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { #endif } -/* PyObject_GenericGetAttrNoDict */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { - __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); - PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", - type_name, attr_name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(attr_name)); -#endif - __Pyx_DECREF_TypeName(type_name); - return NULL; -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { - PyObject *descr; - PyTypeObject *tp = Py_TYPE(obj); - if (unlikely(!PyString_Check(attr_name))) { - return PyObject_GenericGetAttr(obj, attr_name); - } - assert(!tp->tp_dictoffset); - descr = _PyType_Lookup(tp, attr_name); - if (unlikely(!descr)) { - return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); - } - Py_INCREF(descr); - #if PY_MAJOR_VERSION < 3 - if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) - #endif - { - descrgetfunc f = Py_TYPE(descr)->tp_descr_get; - if (unlikely(f)) { - PyObject *res = f(descr, obj, (PyObject *)tp); - Py_DECREF(descr); - return res; - } - } - return descr; -} -#endif - /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; - #if PY_MAJOR_VERSION < 3 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (unlikely(!py_import)) - goto bad; - if (!from_list) { - empty_list = PyList_New(0); - if (unlikely(!empty_list)) - goto bad; - from_list = empty_list; - } - #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, 1); - if (unlikely(!module)) { - if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_MAJOR_VERSION < 3 - PyObject *py_level = PyInt_FromLong(level); - if (unlikely(!py_level)) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); - Py_DECREF(py_level); - #else + if (level == -1) { + const char* package_sep = strchr(__Pyx_MODULE_NAME, '.'); + if (package_sep != (0)) { module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, level); - #endif + name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, 1); + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } } + level = 0; + } + if (!module) { + module = PyImport_ImportModuleLevelObject( + name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, level); } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_import); - #endif return module; } /* ImportDottedModule */ -#if PY_MAJOR_VERSION >= 3 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 (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { +#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); @@ -14090,28 +13649,18 @@ static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( -#if PY_MAJOR_VERSION < 3 - PyExc_ImportError, - "No module named '%s'", PyString_AS_STRING(partial_name)); -#else -#if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, -#else - PyExc_ImportError, -#endif "No module named '%U'", partial_name); -#endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } -#endif -#if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; -#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) +#if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ + CYTHON_COMPILING_IN_GRAAL PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; @@ -14122,17 +13671,21 @@ static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { #endif return imported_module; } -#endif -#if PY_MAJOR_VERSION >= 3 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 = PySequence_ITEM(parts_tuple, i); + 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) @@ -14146,20 +13699,7 @@ static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject * } return module; } -#endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if PY_MAJOR_VERSION < 3 - PyObject *module, *from_list, *star = __pyx_n_s__5; - CYTHON_UNUSED_VAR(parts_tuple); - from_list = PyList_New(1); - if (unlikely(!from_list)) - return NULL; - Py_INCREF(star); - PyList_SET_ITEM(from_list, 0, star); - module = __Pyx_Import(name, from_list, 0); - Py_DECREF(from_list); - return module; -#else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) @@ -14171,15 +13711,14 @@ static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); -#endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 +#if CYTHON_COMPILING_IN_CPYTHON PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { - PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); + PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_mstate_global->__pyx_n_u_spec); if (likely(spec)) { - PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); + 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; @@ -14199,6 +13738,25 @@ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) 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_kp_u__2); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } - #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ + CYTHON_COMPILING_IN_GRAAL { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) @@ -14232,12 +13791,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { Py_XDECREF(module_name); } if (unlikely(!value)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif + PyErr_Format(PyExc_ImportError, "cannot import name %S", name); } return value; } @@ -14326,19 +13880,47 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); + 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); +#else + value = PyDict_SetDefault(d, key, default_value); + if (unlikely(!value)) return NULL; + Py_INCREF(value); +#endif + return value; } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, - Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { + Py_ssize_t basicsize; if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_basicsize; + py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); + if (unlikely(!py_basicsize)) return -1; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = NULL; + if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1; +#else + basicsize = ((PyTypeObject*) cached_type)->tp_basicsize; +#endif if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", @@ -14347,80 +13929,51 @@ static int __Pyx_VerifyCachedType(PyObject *cached_type, } return 0; } -#if !CYTHON_USE_TYPE_SPECS -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { - PyObject* abi_module; - const char* object_name; - PyTypeObject *cached_type = NULL; - abi_module = __Pyx_FetchSharedCythonABIModule(); - if (!abi_module) return NULL; - object_name = strrchr(type->tp_name, '.'); - object_name = object_name ? object_name+1 : type->tp_name; - cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); - if (cached_type) { - if (__Pyx_VerifyCachedType( - (PyObject *)cached_type, - object_name, - cached_type->tp_basicsize, - type->tp_basicsize) < 0) { - goto bad; - } - goto done; - } - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); - if (PyType_Ready(type) < 0) goto bad; - if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) - goto bad; - Py_INCREF(type); - cached_type = type; -done: - Py_DECREF(abi_module); - return cached_type; -bad: - Py_XDECREF(cached_type); - cached_type = NULL; - goto done; -} -#else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { - PyObject *abi_module, *cached_type = NULL; + PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name; + int get_item_ref_result; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; + py_object_name = PyUnicode_FromString(object_name); + if (!py_object_name) return NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); - if (!abi_module) return NULL; - cached_type = PyObject_GetAttrString(abi_module, object_name); - if (cached_type) { - Py_ssize_t basicsize; -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *py_basicsize; - py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); - if (unlikely(!py_basicsize)) goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; -#else - basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; -#endif + if (!abi_module) goto done; + abi_module_dict = PyModule_GetDict(abi_module); + if (!abi_module_dict) goto done; + get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type); + if (get_item_ref_result == 1) { if (__Pyx_VerifyCachedType( cached_type, object_name, - basicsize, spec->basicsize) < 0) { goto bad; } goto done; + } else if (unlikely(get_item_ref_result == -1)) { + goto bad; } - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(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; - if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; + new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type, 1); + if (unlikely(new_cached_type != cached_type)) { + if (unlikely(!new_cached_type)) goto bad; + Py_DECREF(cached_type); + cached_type = new_cached_type; + if (__Pyx_VerifyCachedType( + cached_type, + object_name, + spec->basicsize) < 0) { + goto bad; + } + goto done; + } else { + Py_DECREF(new_cached_type); + } done: - Py_DECREF(abi_module); + Py_XDECREF(abi_module); + Py_DECREF(py_object_name); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: @@ -14428,10 +13981,35 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec cached_type = NULL; goto done; } + +/* PyMethodNew */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + PyObject *result; + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + { + PyObject *args[] = {func, self}; + result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL); + } + #else + result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL); + #endif + return result; +} +#else +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} #endif /* PyVectorcallFastCallDict */ -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; @@ -14442,7 +14020,12 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector size_t j; PyObject *key, *value; unsigned long keys_are_strings; + #if !CYTHON_ASSUME_SAFE_SIZE + Py_ssize_t nkw = PyDict_Size(kw); + if (unlikely(nkw == -1)) return NULL; + #else Py_ssize_t nkw = PyDict_GET_SIZE(kw); + #endif newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); @@ -14458,10 +14041,19 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { - keys_are_strings &= Py_TYPE(key)->tp_flags; + 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 PyTuple_SET_ITEM(kwnames, i, key); + #endif kwvalues[i] = value; i++; } @@ -14479,16 +14071,29 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { - if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { + Py_ssize_t kw_size = + likely(kw == NULL) ? + 0 : +#if !CYTHON_ASSUME_SAFE_SIZE + PyDict_Size(kw); +#else + PyDict_GET_SIZE(kw); +#endif + if (kw_size == 0) { return vc(func, args, nargs, NULL); } +#if !CYTHON_ASSUME_SAFE_SIZE + else if (unlikely(kw_size == -1)) { + return NULL; + } +#endif return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { @@ -14496,8 +14101,25 @@ static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) } return 0; } +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) { + if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) { + int result; + PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func); + if (unlikely(!newFunc)) { + PyErr_Clear(); // It's only an optimization, so don't throw an error + return 0; + } + result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc); + Py_DECREF(newFunc); + return result; + } + return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc); +} #else -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) { + if (PyMethod_Check(func)) { + func = PyMethod_GET_FUNCTION(func); + } return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif @@ -14513,20 +14135,15 @@ static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* #endif } static PyObject * -__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) +__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op) { - CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { -#if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#else - op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#endif if (unlikely(op->func_doc == NULL)) return NULL; } else { @@ -14538,6 +14155,15 @@ __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) Py_INCREF(op->func_doc); return op->func_doc; } +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { + PyObject *result; + CYTHON_UNUSED_VAR(closure); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_doc_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { @@ -14546,20 +14172,19 @@ __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *cont value = Py_None; } Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_doc, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op) { - CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); -#elif PY_MAJOR_VERSION >= 3 - op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else - op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; @@ -14567,53 +14192,60 @@ __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) Py_INCREF(op->func_name); return op->func_name; } +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +{ + PyObject *result = NULL; + CYTHON_UNUSED_VAR(context); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_name_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_name, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); + PyObject *result; + __Pyx_BEGIN_CRITICAL_SECTION(op); Py_INCREF(op->func_qualname); - return op->func_qualname; + result = op->func_qualname; + __Pyx_END_CRITICAL_SECTION(); + return result; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_qualname, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) +__Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op) { - CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) @@ -14622,6 +14254,16 @@ __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) 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) { @@ -14637,7 +14279,9 @@ __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *con return -1; } Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_dict, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * @@ -14698,13 +14342,14 @@ __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { +__Pyx_CyFunction_get_defaults_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_tuple; - CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; @@ -14716,6 +14361,15 @@ __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { Py_INCREF(result); return result; } +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = NULL; + CYTHON_UNUSED_VAR(context); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_defaults_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); @@ -14729,13 +14383,14 @@ __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, voi PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { +__Pyx_CyFunction_get_kwdefaults_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_kwdict; - CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; @@ -14747,6 +14402,15 @@ __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { Py_INCREF(result); return result; } +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result; + CYTHON_UNUSED_VAR(context); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_kwdefaults_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); @@ -14758,13 +14422,14 @@ __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, vo return -1; } Py_XINCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_annotations, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { +__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; - CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; @@ -14774,16 +14439,19 @@ __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { return result; } static PyObject * -__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { - int is_coroutine; +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { + PyObject *result; CYTHON_UNUSED_VAR(context); - if (op->func_is_coroutine) { - return __Pyx_NewRef(op->func_is_coroutine); - } - is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; -#if PY_VERSION_HEX >= 0x03050000 + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_annotations_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} +static PyObject * +__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { + int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; if (is_coroutine) { - PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; + PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); @@ -14796,20 +14464,68 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { return NULL; } #endif - module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); + module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; - op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); + is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); - if (likely(op->func_is_coroutine)) { - return __Pyx_NewRef(op->func_is_coroutine); + if (likely(is_coroutine_value)) { + return is_coroutine_value; } ignore: PyErr_Clear(); } + return __Pyx_PyBool_FromLong(is_coroutine); +} +static PyObject * +__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { + PyObject *result; + CYTHON_UNUSED_VAR(context); + if (op->func_is_coroutine) { + return __Pyx_NewRef(op->func_is_coroutine); + } + result = __Pyx_CyFunction_get_is_coroutine_value(op); + if (unlikely(!result)) + return NULL; + __Pyx_BEGIN_CRITICAL_SECTION(op); + if (op->func_is_coroutine) { + Py_DECREF(result); + result = __Pyx_NewRef(op->func_is_coroutine); + } else { + op->func_is_coroutine = __Pyx_NewRef(result); + } + __Pyx_END_CRITICAL_SECTION(); + return result; +} +static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, message, size); + Py_DECREF(py_name); +#else + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + name, message, size); +#endif +} +static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s", + py_name, message); + Py_DECREF(py_name); +#else + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s", + name, message); #endif - op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); - return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * @@ -14824,24 +14540,24 @@ __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *c } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { - {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, - {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, - {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, + {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"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}, + {"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}, + {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {"__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}, + {"_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}, #endif @@ -14849,23 +14565,19 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, + {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif -#if CYTHON_USE_TYPE_SPECS - {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, + {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API + {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else -#if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, -#endif -#endif + {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API + {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, + {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} @@ -14873,19 +14585,19 @@ static PyMemberDef __pyx_CyFunction_members[] = { static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { + PyObject *result = NULL; CYTHON_UNUSED_VAR(args); -#if PY_MAJOR_VERSION >= 3 + __Pyx_BEGIN_CRITICAL_SECTION(m); Py_INCREF(m->func_qualname); - return m->func_qualname; -#else - return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); -#endif + result = m->func_qualname; + __Pyx_END_CRITICAL_SECTION(); + return result; } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) @@ -14927,8 +14639,6 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef * Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; - op->defaults_pyobjects = 0; - op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; @@ -14990,14 +14700,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_XDECREF(pydefaults[i]); - PyObject_Free(m->defaults); - m->defaults = NULL; - } + Py_CLEAR(m->defaults); return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) @@ -15014,6 +14717,10 @@ static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { + { + int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg); + if (e) return e; + } Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); @@ -15021,40 +14728,33 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); - Py_VISIT(m->func_name); - Py_VISIT(m->func_qualname); + __Pyx_VISIT_CONST(m->func_name); + __Pyx_VISIT_CONST(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); - Py_VISIT(m->func_code); + __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_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_VISIT(pydefaults[i]); - } + Py_VISIT(m->defaults); return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { -#if PY_MAJOR_VERSION >= 3 - return PyUnicode_FromFormat("", + PyObject *repr; + __Pyx_BEGIN_CRITICAL_SECTION(op); + repr = PyUnicode_FromFormat("", op->func_qualname, (void *)op); -#else - return PyString_FromFormat("", - PyString_AsString(op->func_qualname), (void *)op); -#endif + __Pyx_END_CRITICAL_SECTION(); + return repr; } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; - PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); @@ -15073,10 +14773,10 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: - return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); @@ -15084,24 +14784,15 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif if (likely(size == 0)) return (*meth)(self, NULL); -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes no arguments", size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); @@ -15119,19 +14810,10 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py Py_DECREF(arg0); #endif return result; - } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif + } + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes exactly one argument", size); return NULL; } break; @@ -15139,16 +14821,8 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", - py_name); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", - f->m_ml->ml_name); -#endif + __Pyx_CyFunction_raise_type_error( + (__pyx_CyFunctionObject*)func, "takes no keyword arguments"); return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { @@ -15165,10 +14839,10 @@ 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 +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; @@ -15180,11 +14854,11 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P Py_ssize_t argc; PyObject *new_args; PyObject *self; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); - if (unlikely(!argc) < 0) return NULL; + if (unlikely(argc < 0)) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) @@ -15192,14 +14866,9 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); -#if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); -#else - PyErr_SetString(PyExc_TypeError, - "unbound method needs an argument"); -#endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); @@ -15209,21 +14878,21 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P } return result; } -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { - PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", - ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + __Pyx_CyFunction_raise_type_error( + cyfunc, "needs an argument"); return -1; } ret = 1; } - if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) { + __Pyx_CyFunction_raise_type_error( + cyfunc, "takes no keyword arguments"); return -1; } return ret; @@ -15231,13 +14900,18 @@ 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; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #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); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; @@ -15245,29 +14919,38 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } if (unlikely(nargs != 0)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes no arguments", nargs); return NULL; } - return def->ml_meth(self, NULL); + return meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #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); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; @@ -15275,29 +14958,38 @@ static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } if (unlikely(nargs != 1)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes exactly one argument", nargs); return NULL; } - return def->ml_meth(self, args[0]); + return meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #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); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; @@ -15305,17 +14997,21 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } - return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); + return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; @@ -15323,6 +15019,12 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; @@ -15330,15 +15032,19 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } - return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); + return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, (size_t)nargs, kwnames); } #endif -#if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, @@ -15358,121 +15064,32 @@ static PyType_Spec __pyx_CyFunctionType_spec = { #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif -#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) +#if CYTHON_METH_FASTCALL +#if defined(Py_TPFLAGS_HAVE_VECTORCALL) + Py_TPFLAGS_HAVE_VECTORCALL | +#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, - __pyx_CyFunctionType_slots -}; -#else -static PyTypeObject __pyx_CyFunctionType_type = { - PyVarObject_HEAD_INIT(0, 0) - __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", - sizeof(__pyx_CyFunctionObject), - 0, - (destructor) __Pyx_CyFunction_dealloc, -#if !CYTHON_METH_FASTCALL - 0, -#elif CYTHON_BACKPORT_VECTORCALL - (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), -#else - offsetof(PyCFunctionObject, vectorcall), -#endif - 0, - 0, -#if PY_MAJOR_VERSION < 3 - 0, -#else - 0, -#endif - (reprfunc) __Pyx_CyFunction_repr, - 0, - 0, - 0, - 0, - __Pyx_CyFunction_CallAsMethod, - 0, - 0, - 0, - 0, -#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR - Py_TPFLAGS_METHOD_DESCRIPTOR | -#endif -#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL - _Py_TPFLAGS_HAVE_VECTORCALL | +#endif // CYTHON_METH_FASTCALL +#if PY_VERSION_HEX >= 0x030A0000 + Py_TPFLAGS_IMMUTABLETYPE | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, - 0, - (traverseproc) __Pyx_CyFunction_traverse, - (inquiry) __Pyx_CyFunction_clear, - 0, -#if PY_VERSION_HEX < 0x030500A0 - offsetof(__pyx_CyFunctionObject, func_weakreflist), -#else - offsetof(PyCFunctionObject, m_weakreflist), -#endif - 0, - 0, - __pyx_CyFunction_methods, - __pyx_CyFunction_members, - __pyx_CyFunction_getsets, - 0, - 0, - __Pyx_PyMethod_New, - 0, - offsetof(__pyx_CyFunctionObject, func_dict), - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, -#if PY_VERSION_HEX >= 0x030400a1 - 0, -#endif -#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, -#endif -#if __PYX_NEED_TP_PRINT_SLOT - 0, -#endif -#if PY_VERSION_HEX >= 0x030C0000 - 0, -#endif -#if PY_VERSION_HEX >= 0x030d00A4 - 0, -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, -#endif + __pyx_CyFunctionType_slots }; -#endif static int __pyx_CyFunction_init(PyObject *module) { -#if CYTHON_USE_TYPE_SPECS - __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); -#else - CYTHON_UNUSED_VAR(module); - __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); -#endif - if (unlikely(__pyx_CyFunctionType == NULL)) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); + mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); + if (unlikely(mstate->__pyx_CyFunctionType == NULL)) { return -1; } return 0; } -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults = PyObject_Malloc(size); + m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type); if (unlikely(!m->defaults)) - return PyErr_NoMemory(); - memset(m->defaults, 0, size); - m->defaults_pyobjects = pyobjects; - m->defaults_size = size; + return NULL; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { @@ -15495,7 +15112,7 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( - PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_mstate_global->__pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { @@ -15507,7 +15124,7 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qual /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); @@ -15522,10 +15139,6 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); -#if PY_MAJOR_VERSION < 3 - if (tmptype == &PyClass_Type) - continue; -#endif if (!metaclass) { metaclass = tmptype; continue; @@ -15544,11 +15157,7 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas return NULL; } if (!metaclass) { -#if PY_MAJOR_VERSION < 3 - metaclass = &PyClass_Type; -#else metaclass = &PyType_Type; -#endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; @@ -15559,10 +15168,6 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); -#if PY_MAJOR_VERSION < 3 - if (unlikely(PyInstance_Check(obj))) - return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); -#endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; @@ -15583,7 +15188,7 @@ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { - PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); + PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_mstate_global->__pyx_n_u_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); @@ -15598,148 +15203,14 @@ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, } if (unlikely(!ns)) return NULL; - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; -#if PY_VERSION_HEX >= 0x03030000 - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; -#else - CYTHON_MAYBE_UNUSED_VAR(qualname); -#endif - if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } -#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS -static int __Pyx_SetNamesPEP487(PyObject *type_obj) { - PyTypeObject *type = (PyTypeObject*) type_obj; - PyObject *names_to_set, *key, *value, *set_name, *tmp; - Py_ssize_t i = 0; -#if CYTHON_USE_TYPE_SLOTS - names_to_set = PyDict_Copy(type->tp_dict); -#else - { - PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); - names_to_set = NULL; - if (likely(d)) { - PyObject *names_to_set = PyDict_New(); - int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; - Py_DECREF(d); - if (unlikely(ret < 0)) - Py_CLEAR(names_to_set); - } - } -#endif - if (unlikely(names_to_set == NULL)) - goto bad; - while (PyDict_Next(names_to_set, &i, &key, &value)) { - set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); - if (unlikely(set_name != NULL)) { - tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); - Py_DECREF(set_name); - if (unlikely(tmp == NULL)) { - __Pyx_TypeName value_type_name = - __Pyx_PyType_GetName(Py_TYPE(value)); - __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); - PyErr_Format(PyExc_RuntimeError, -#if PY_MAJOR_VERSION >= 3 - "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", - value_type_name, key, type_name); -#else - "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", - value_type_name, - PyString_Check(key) ? PyString_AS_STRING(key) : "?", - type_name); -#endif - goto bad; - } else { - Py_DECREF(tmp); - } - } - else if (unlikely(PyErr_Occurred())) { - goto bad; - } - } - Py_DECREF(names_to_set); - return 0; -bad: - Py_XDECREF(names_to_set); - return -1; -} -static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { -#if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - PyTypeObject *type = (PyTypeObject*) type_obj; - PyObject *mro = type->tp_mro; - Py_ssize_t i, nbases; - if (unlikely(!mro)) goto done; - (void) &__Pyx_GetBuiltinName; - Py_INCREF(mro); - nbases = PyTuple_GET_SIZE(mro); - assert(PyTuple_GET_ITEM(mro, 0) == type_obj); - for (i = 1; i < nbases-1; i++) { - PyObject *base, *dict, *meth; - base = PyTuple_GET_ITEM(mro, i); - dict = ((PyTypeObject *)base)->tp_dict; - meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); - if (unlikely(meth)) { - descrgetfunc f = Py_TYPE(meth)->tp_descr_get; - PyObject *res; - Py_INCREF(meth); - if (likely(f)) { - res = f(meth, NULL, type_obj); - Py_DECREF(meth); - if (unlikely(!res)) goto bad; - meth = res; - } - res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); - Py_DECREF(meth); - if (unlikely(!res)) goto bad; - Py_DECREF(res); - goto done; - } else if (unlikely(PyErr_Occurred())) { - goto bad; - } - } -done: - Py_XDECREF(mro); - return type_obj; -bad: - Py_XDECREF(mro); - Py_DECREF(type_obj); - return NULL; -#else - PyObject *super_type, *super, *func, *res; -#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) - super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); -#else - super_type = (PyObject*) &PySuper_Type; - (void) &__Pyx_GetBuiltinName; -#endif - super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; -#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) - Py_XDECREF(super_type); -#endif - if (unlikely(!super)) { - Py_CLEAR(type_obj); - goto done; - } - func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); - Py_DECREF(super); - if (likely(!func)) { - if (unlikely(PyErr_Occurred())) - Py_CLEAR(type_obj); - goto done; - } - res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); - Py_DECREF(func); - if (unlikely(!res)) - Py_CLEAR(type_obj); - Py_XDECREF(res); -done: - return type_obj; -#endif -} -#endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { @@ -15747,7 +15218,7 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { - owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { @@ -15763,30 +15234,13 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj return NULL; owned_metaclass = metaclass; } - result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, -#if PY_VERSION_HEX < 0x030600A4 - (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw -#else - mkw -#endif - ); + result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_XDECREF(owned_metaclass); -#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS - if (likely(result) && likely(PyType_Check(result))) { - if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { - Py_CLEAR(result); - } else { - result = __Pyx_InitSubclassPEP487(result, mkw); - } - } -#else - (void) &__Pyx_GetBuiltinName; -#endif return result; } /* CLineInTraceback */ -#ifndef CYTHON_CLINE_IN_TRACEBACK +#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; @@ -15794,22 +15248,26 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); - if (unlikely(!__pyx_cython_runtime)) { + 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_cython_runtime); + cython_runtime_dict = _PyObject_GetDictPtr(__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_n_s_cline_in_traceback)) + __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_cython_runtime, __pyx_n_s_cline_in_traceback); + 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(); @@ -15818,18 +15276,18 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { } if (!use_cline) { c_line = 0; - (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + (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)) { c_line = 0; } + Py_XDECREF(use_cline); __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ -#if !CYTHON_COMPILING_IN_LIMITED_API 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) { @@ -15851,64 +15309,103 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co return mid + 1; } } -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; +static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) { + __Pyx_CachedCodeObjectType* code_object; int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + if (unlikely(!code_line) || unlikely(!code_cache->entries)) { return NULL; } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); + if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) { return NULL; } - code_object = __pyx_code_cache.entries[pos].code_object; + code_object = code_cache->entries[pos].code_object; Py_INCREF(code_object); return code_object; } -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) { +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS + (void)__pyx__find_code_object; + return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss. +#else + struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count); + if (old_count < 0) { + __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); + return NULL; + } +#endif + __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line); +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); +#endif + return result; +#endif +} +static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object) +{ int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + __Pyx_CodeObjectCacheEntry* entries = code_cache->entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; + code_cache->entries = entries; + code_cache->max_count = 64; + code_cache->count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; + pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); + if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) { + __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object; entries[pos].code_object = code_object; + Py_INCREF(code_object); Py_DECREF(tmp); return; } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; + if (code_cache->count == code_cache->max_count) { + int new_max = code_cache->max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; + code_cache->entries = entries; + code_cache->max_count = new_max; } - for (i=__pyx_code_cache.count; i>pos; i--) { + for (i=code_cache->count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; - __pyx_code_cache.count++; + code_cache->count++; Py_INCREF(code_object); } +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) { +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS + (void)__pyx__insert_code_object; + return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail. +#else + struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_nonatomic_int_type expected = 0; + if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) { + return; + } #endif + __pyx__insert_code_object(code_cache, code_line, code_object); +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN); +#endif +#endif +} /* AddTraceback */ #include "compile.h" @@ -15928,35 +15425,12 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { - PyObject *result; - result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); - #if __PYX_LIMITED_VERSION_HEX < 0x030780000 - { - PyObject *compiled = NULL, *result = NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; - compiled = Py_CompileString( - "out = type(code)(\n" - " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" - " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" - " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" - " code.co_lnotab)\n", "", Py_file_input); - if (!compiled) return NULL; - result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); - Py_DECREF(compiled); - if (!result) PyErr_Print(); - Py_DECREF(result); - result = PyDict_GetItemString(scratch_dict, "out"); - if (result) Py_INCREF(result); - return result; - } - #else return NULL; - #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { @@ -15969,20 +15443,26 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); - code_object = Py_CompileString("_getframe()", filename, Py_eval_input); - 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 (unlikely(!py_funcname)) goto bad; - dict = PyDict_New(); - if (unlikely(!dict)) goto bad; - { - PyObject *old_code_object = code_object; - code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); - Py_DECREF(old_code_object); + code_object = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!code_object) { + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + 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 (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, code_object); + } else { + dict = PyDict_New(); } - if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; @@ -16008,58 +15488,17 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; - #if PY_MAJOR_VERSION < 3 - PyObject *py_srcfile = NULL; - py_srcfile = PyString_FromString(filename); - if (!py_srcfile) goto bad; - #endif if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - if (!py_funcname) goto bad; - #endif } - #if PY_MAJOR_VERSION < 3 - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - #else py_code = PyCode_NewEmpty(filename, funcname, py_line); - #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_srcfile); - #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -16090,7 +15529,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ + __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; @@ -16103,23 +15542,46 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #endif /* FormatTypeName */ -#if CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 static __Pyx_TypeName -__Pyx_PyType_GetName(PyTypeObject* tp) +__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp) { - PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_n_s_name); - if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { - PyErr_Clear(); - Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__33); + PyObject *module = NULL, *name = NULL, *result = NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030b0000 + name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_mstate_global->__pyx_n_u_qualname); + #else + name = PyType_GetQualName(tp); + #endif + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad; + module = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_mstate_global->__pyx_n_u_module); + if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad; + if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) { + result = name; + name = NULL; + goto done; } - return name; + result = PyUnicode_FromFormat("%U.%U", module, name); + if (unlikely(result == NULL)) goto bad; + done: + Py_XDECREF(name); + Py_XDECREF(module); + return result; + bad: + PyErr_Clear(); + if (name) { + result = name; + name = NULL; + } else { + result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__3); + } + goto done; } #endif /* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -16131,17 +15593,17 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG +#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); @@ -16162,25 +15624,25 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + PyObject *from_bytes, *result = NULL, *kwds = NULL; + PyObject *py_bytes = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - if (!is_unsigned) { - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + { + PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; + if (!is_unsigned) { + kwds = __Pyx_MakeVectorcallBuilderKwds(1); + if (!kwds) goto limited_bad; + if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; + } + result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } - result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); - Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); @@ -16212,7 +15674,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { } /* CIntFromPy */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -16222,24 +15684,11 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(long) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + val = __Pyx_PyLong_As_long(tmp); Py_DECREF(tmp); return val; } @@ -16479,7 +15928,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { } /* CIntFromPy */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -16489,24 +15938,11 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); + val = __Pyx_PyLong_As_int(tmp); Py_DECREF(tmp); return val; } @@ -16782,33 +16218,10 @@ static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, if (base == (PyObject *)a || base == (PyObject *)b) return 1; } - return 0; - } - return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); -} -#if PY_MAJOR_VERSION == 2 -static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { - PyObject *exception, *value, *tb; - int res; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&exception, &value, &tb); - res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - if (!res) { - res = PyObject_IsSubclass(err, exc_type2); - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } + return 0; } - __Pyx_ErrRestore(exception, value, tb); - return res; + return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } -#else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); @@ -16816,21 +16229,15 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } -#endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; i__Pyx_GetBuiltinNext_LimitedAPI_cache)) + __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next); + return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache; +} +#endif +static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) { +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + PyObject *result; + PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI(); + if (unlikely(!next)) return NULL; + result = PyObject_CallFunctionObjArgs(next, iterator, NULL); + return result; +#else + (void)__Pyx_GetBuiltinName; // only for early limited API + iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator); + assert(iternext); + return iternext(iterator); +#endif +} + +/* ReturnWithStopIteration */ +static void __Pyx__ReturnWithStopIteration(PyObject* value, int async); +static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext) { + if (value == Py_None) { + if (async || !iternext) + PyErr_SetNone(async ? PyExc_StopAsyncIteration : PyExc_StopIteration); + return; + } + __Pyx__ReturnWithStopIteration(value, async); +} +static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) { +#if CYTHON_COMPILING_IN_CPYTHON + __Pyx_PyThreadState_declare +#endif + PyObject *exc; + PyObject *exc_type = async ? PyExc_StopAsyncIteration : PyExc_StopIteration; +#if CYTHON_COMPILING_IN_CPYTHON + if ((PY_VERSION_HEX >= (0x030C00A6)) || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) { + if (PY_VERSION_HEX >= (0x030e00A1)) { + exc = __Pyx_PyObject_CallOneArg(exc_type, value); + } else { + PyObject *args_tuple = PyTuple_New(1); + if (unlikely(!args_tuple)) return; + Py_INCREF(value); + PyTuple_SET_ITEM(args_tuple, 0, value); + exc = PyObject_Call(exc_type, args_tuple, NULL); + Py_DECREF(args_tuple); + } + if (unlikely(!exc)) return; + } else { + Py_INCREF(value); + exc = value; + } + #if CYTHON_FAST_THREAD_STATE + __Pyx_PyThreadState_assign + #if CYTHON_USE_EXC_INFO_STACK + if (!__pyx_tstate->exc_info->exc_value) + #else + if (!__pyx_tstate->exc_type) + #endif + { + Py_INCREF(exc_type); + __Pyx_ErrRestore(exc_type, exc, NULL); + return; + } + #endif +#else + exc = __Pyx_PyObject_CallOneArg(exc_type, value); + if (unlikely(!exc)) return; +#endif + PyErr_SetObject(exc_type, exc); + Py_DECREF(exc); +} + /* CoroutineBase */ +#if !CYTHON_COMPILING_IN_LIMITED_API #include #if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE @@ -16923,7 +16408,14 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, #endif #include "internal/pycore_frame.h" #endif -#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +#endif // CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void +__Pyx_Coroutine_Undelegate(__pyx_CoroutineObject *gen) { +#if CYTHON_USE_AM_SEND + gen->yieldfrom_am_send = NULL; +#endif + Py_CLEAR(gen->yieldfrom); +} static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) { PyObject *et, *ev, *tb; PyObject *value = NULL; @@ -16941,20 +16433,35 @@ static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyO Py_INCREF(Py_None); value = Py_None; } -#if PY_VERSION_HEX >= 0x030300A0 else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) { + #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL + value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value); + if (unlikely(!value)) goto limited_api_failure; + #else value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); + #endif Py_DECREF(ev); } -#endif else if (unlikely(PyTuple_Check(ev))) { - if (PyTuple_GET_SIZE(ev) >= 1) { + Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(ev); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(tuple_size < 0)) { + Py_XDECREF(tb); + Py_DECREF(ev); + Py_DECREF(et); + return -1; + } + #endif + if (tuple_size >= 1) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS value = PyTuple_GET_ITEM(ev, 0); Py_INCREF(value); -#else +#elif CYTHON_ASSUME_SAFE_MACROS value = PySequence_ITEM(ev, 0); +#else + value = PySequence_GetItem(ev, 0); + if (!value) goto limited_api_failure; #endif } else { Py_INCREF(Py_None); @@ -16982,27 +16489,35 @@ static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyO } Py_XDECREF(tb); Py_DECREF(et); -#if PY_VERSION_HEX >= 0x030300A0 +#if CYTHON_COMPILING_IN_LIMITED_API + value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value); +#else value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); +#endif Py_DECREF(ev); -#else - { - PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); - Py_DECREF(ev); - if (likely(args)) { - value = PySequence_GetItem(args, 0); - Py_DECREF(args); - } - if (unlikely(!value)) { - __Pyx_ErrRestore(NULL, NULL, NULL); - Py_INCREF(Py_None); - value = Py_None; - } - } +#if CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!value)) return -1; #endif *pvalue = value; return 0; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL || !CYTHON_ASSUME_SAFE_MACROS + limited_api_failure: + Py_XDECREF(et); + Py_XDECREF(tb); + Py_XDECREF(ev); + return -1; +#endif +} +static CYTHON_INLINE +__Pyx_PySendResult __Pyx_Coroutine_status_from_result(PyObject **retval) { + if (*retval) { + return PYGEN_NEXT; + } else if (likely(__Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, retval) == 0)) { + return PYGEN_RETURN; + } else { + return PYGEN_ERROR; + } } static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { @@ -17039,26 +16554,7 @@ static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) { } PyErr_SetString(PyExc_ValueError, msg); } -#define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) -static void __Pyx__Coroutine_NotStartedError(PyObject *gen) { - const char *msg; - CYTHON_MAYBE_UNUSED_VAR(gen); - if ((0)) { - #ifdef __Pyx_Coroutine_USED - } else if (__Pyx_Coroutine_Check(gen)) { - msg = "can't send non-None value to a just-started coroutine"; - #endif - #ifdef __Pyx_AsyncGen_USED - } else if (__Pyx_AsyncGen_CheckExact(gen)) { - msg = "can't send non-None value to a just-started async generator"; - #endif - } else { - msg = "can't send non-None value to a just-started generator"; - } - PyErr_SetString(PyExc_TypeError, msg); -} -#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) -static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { +static void __Pyx_Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { CYTHON_MAYBE_UNUSED_VAR(gen); CYTHON_MAYBE_UNUSED_VAR(closing); #ifdef __Pyx_Coroutine_USED @@ -17069,26 +16565,22 @@ static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *val if (value) { #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) - PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); + PyErr_SetNone(PyExc_StopAsyncIteration); else #endif PyErr_SetNone(PyExc_StopIteration); } } static -PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { +__Pyx_PySendResult __Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, PyObject **result, int closing) { __Pyx_PyThreadState_declare PyThreadState *tstate; __Pyx_ExcInfoStruct *exc_state; PyObject *retval; - assert(!self->is_running); - if (unlikely(self->resume_label == 0)) { - if (unlikely(value && value != Py_None)) { - return __Pyx_Coroutine_NotStartedError((PyObject*)self); - } - } + assert(__Pyx_Coroutine_get_is_running(self)); // Callers should ensure is_running if (unlikely(self->resume_label == -1)) { - return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + return PYGEN_ERROR; } #if CYTHON_FAST_THREAD_STATE __Pyx_PyThreadState_assign @@ -17098,7 +16590,7 @@ PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, i #endif exc_state = &self->gi_exc_state; if (exc_state->exc_value) { - #if CYTHON_COMPILING_IN_PYPY + #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY #else PyObject *exc_tb; #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON @@ -17135,19 +16627,21 @@ PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, i __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); } #endif - self->is_running = 1; retval = self->body(self, tstate, value); - self->is_running = 0; #if CYTHON_USE_EXC_INFO_STACK exc_state = &self->gi_exc_state; tstate->exc_info = exc_state->previous_item; exc_state->previous_item = NULL; __Pyx_Coroutine_ResetFrameBackpointer(exc_state); #endif - return retval; + *result = retval; + if (self->resume_label == -1) { + return likely(retval) ? PYGEN_RETURN : PYGEN_ERROR; + } + return PYGEN_NEXT; } static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { -#if CYTHON_COMPILING_IN_PYPY +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(exc_state); #else PyObject *exc_tb; @@ -17167,24 +16661,22 @@ static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStr } #endif } -static CYTHON_INLINE -PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) { +#define __Pyx_Coroutine_MethodReturnFromResult(gen, result, retval, iternext)\ + ((result) == PYGEN_NEXT ? (retval) : __Pyx__Coroutine_MethodReturnFromResult(gen, result, retval, iternext)) +static PyObject * +__Pyx__Coroutine_MethodReturnFromResult(PyObject* gen, __Pyx_PySendResult result, PyObject *retval, int iternext) { CYTHON_MAYBE_UNUSED_VAR(gen); - if (unlikely(!retval)) { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - if (!__Pyx_PyErr_Occurred()) { - PyObject *exc = PyExc_StopIteration; - #ifdef __Pyx_AsyncGen_USED - if (__Pyx_AsyncGen_CheckExact(gen)) - exc = __Pyx_PyExc_StopAsyncIteration; - #endif - __Pyx_PyErr_SetNone(exc); - } + if (likely(result == PYGEN_RETURN)) { + int is_async = 0; + #ifdef __Pyx_AsyncGen_USED + is_async = __Pyx_AsyncGen_CheckExact(gen); + #endif + __Pyx_ReturnWithStopIteration(retval, is_async, iternext); + Py_XDECREF(retval); } - return retval; + return NULL; } -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) +#if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { #if PY_VERSION_HEX <= 0x030A00A1 @@ -17221,25 +16713,58 @@ PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { #endif } #endif -static CYTHON_INLINE -PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { - PyObject *ret; +static CYTHON_INLINE __Pyx_PySendResult +__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen, PyObject** retval) { + __Pyx_PySendResult result; PyObject *val = NULL; + assert(__Pyx_Coroutine_get_is_running(gen)); __Pyx_Coroutine_Undelegate(gen); __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); - ret = __Pyx_Coroutine_SendEx(gen, val, 0); + result = __Pyx_Coroutine_SendEx(gen, val, retval, 0); Py_XDECREF(val); - return ret; + return result; +} +#if CYTHON_USE_AM_SEND +static __Pyx_PySendResult +__Pyx_Coroutine_SendToDelegate(__pyx_CoroutineObject *gen, __Pyx_pyiter_sendfunc gen_am_send, PyObject *value, PyObject **retval) { + PyObject *ret = NULL; + __Pyx_PySendResult delegate_result, result; + assert(__Pyx_Coroutine_get_is_running(gen)); + delegate_result = gen_am_send(gen->yieldfrom, value, &ret); + if (delegate_result == PYGEN_NEXT) { + assert (ret != NULL); + *retval = ret; + return PYGEN_NEXT; + } + assert (delegate_result != PYGEN_ERROR || ret == NULL); + __Pyx_Coroutine_Undelegate(gen); + result = __Pyx_Coroutine_SendEx(gen, ret, retval, 0); + Py_XDECREF(ret); + return result; } +#endif static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { - PyObject *retval; + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_AmSend(self, value, &retval); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0); +} +static __Pyx_PySendResult +__Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval) { + __Pyx_PySendResult result; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) - return __Pyx_Coroutine_AlreadyRunningError(gen); - if (yf) { + if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { + *retval = __Pyx_Coroutine_AlreadyRunningError(gen); + return PYGEN_ERROR; + } + #if CYTHON_USE_AM_SEND + if (gen->yieldfrom_am_send) { + result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, value, retval); + } else + #endif + if (gen->yieldfrom) { + PyObject *yf = gen->yieldfrom; PyObject *ret; - gen->is_running = 1; + #if !CYTHON_USE_AM_SEND #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, value); @@ -17255,66 +16780,67 @@ static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { ret = __Pyx_async_gen_asend_send(yf, value); } else #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + #if CYTHON_COMPILING_IN_CPYTHON if (PyGen_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else - #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyCoro_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif + #endif { - if (value == Py_None) - ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + #if !CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x03080000 + if (value == Py_None && PyIter_Check(yf)) + ret = __Pyx_PyIter_Next_Plain(yf); else - ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); + #endif + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_mstate_global->__pyx_n_u_send, value); } - gen->is_running = 0; if (likely(ret)) { - return ret; + __Pyx_Coroutine_unset_is_running(gen); + *retval = ret; + return PYGEN_NEXT; } - retval = __Pyx_Coroutine_FinishDelegation(gen); + result = __Pyx_Coroutine_FinishDelegation(gen, retval); } else { - retval = __Pyx_Coroutine_SendEx(gen, value, 0); + result = __Pyx_Coroutine_SendEx(gen, value, retval, 0); } - return __Pyx_Coroutine_MethodReturn(self, retval); + __Pyx_Coroutine_unset_is_running(gen); + return result; } static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { + __Pyx_PySendResult result; PyObject *retval = NULL; - int err = 0; + CYTHON_UNUSED_VAR(gen); + assert(__Pyx_Coroutine_get_is_running(gen)); #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; + result = __Pyx_Coroutine_Close(yf, &retval); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; + result = __Pyx_Coroutine_Close(yf, &retval); } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { - retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); - if (!retval) - return -1; + result = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf); } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { retval = __Pyx_async_gen_asend_close(yf, NULL); + result = PYGEN_RETURN; } else if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { retval = __Pyx_async_gen_athrow_close(yf, NULL); + result = PYGEN_RETURN; } else #endif { PyObject *meth; - gen->is_running = 1; - meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close); + result = PYGEN_RETURN; + meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_close); if (unlikely(!meth)) { if (unlikely(PyErr_Occurred())) { PyErr_WriteUnraisable(yf); @@ -17322,57 +16848,77 @@ static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { } else { retval = __Pyx_PyObject_CallNoArg(meth); Py_DECREF(meth); - if (unlikely(!retval)) - err = -1; + if (unlikely(!retval)) { + result = PYGEN_ERROR; + } } - gen->is_running = 0; } Py_XDECREF(retval); - return err; + return result == PYGEN_ERROR ? -1 : 0; } static PyObject *__Pyx_Generator_Next(PyObject *self) { + __Pyx_PySendResult result; + PyObject *retval = NULL; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) + if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { return __Pyx_Coroutine_AlreadyRunningError(gen); - if (yf) { + } + #if CYTHON_USE_AM_SEND + if (gen->yieldfrom_am_send) { + result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, Py_None, &retval); + } else + #endif + if (gen->yieldfrom) { + PyObject *yf = gen->yieldfrom; PyObject *ret; - gen->is_running = 1; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Generator_Next(yf); } else #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) - if (PyGen_CheckExact(yf)) { - ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); - } else - #endif #ifdef __Pyx_Coroutine_USED - if (__Pyx_Coroutine_Check(yf)) { + if (__Pyx_Coroutine_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, Py_None); } else #endif - ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); - gen->is_running = 0; + #if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX < 0x030A00A3 || !CYTHON_USE_AM_SEND) + if (PyGen_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); + } else + #endif + ret = __Pyx_PyIter_Next_Plain(yf); if (likely(ret)) { + __Pyx_Coroutine_unset_is_running(gen); return ret; } - return __Pyx_Coroutine_FinishDelegation(gen); + result = __Pyx_Coroutine_FinishDelegation(gen, &retval); + } else { + result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0); } - return __Pyx_Coroutine_SendEx(gen, Py_None, 0); + __Pyx_Coroutine_unset_is_running(gen); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 1); } static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) { + PyObject *retval = NULL; + __Pyx_PySendResult result; CYTHON_UNUSED_VAR(arg); - return __Pyx_Coroutine_Close(self); + result = __Pyx_Coroutine_Close(self, &retval); + if (unlikely(result == PYGEN_ERROR)) + return NULL; + Py_XDECREF(retval); + Py_RETURN_NONE; } -static PyObject *__Pyx_Coroutine_Close(PyObject *self) { +static __Pyx_PySendResult +__Pyx_Coroutine_Close(PyObject *self, PyObject **retval) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject *retval, *raised_exception; - PyObject *yf = gen->yieldfrom; + __Pyx_PySendResult result; + PyObject *yf; int err = 0; - if (unlikely(gen->is_running)) - return __Pyx_Coroutine_AlreadyRunningError(gen); + if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { + *retval = __Pyx_Coroutine_AlreadyRunningError(gen); + return PYGEN_ERROR; + } + yf = gen->yieldfrom; if (yf) { Py_INCREF(yf); err = __Pyx_Coroutine_CloseIter(gen, yf); @@ -17381,10 +16927,25 @@ static PyObject *__Pyx_Coroutine_Close(PyObject *self) { } if (err == 0) PyErr_SetNone(PyExc_GeneratorExit); - retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); - if (unlikely(retval)) { + result = __Pyx_Coroutine_SendEx(gen, NULL, retval, 1); + if (result == PYGEN_ERROR) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_Coroutine_unset_is_running(gen); + if (!__Pyx_PyErr_Occurred()) { + return PYGEN_RETURN; + } else if (likely(__Pyx_PyErr_ExceptionMatches2(PyExc_GeneratorExit, PyExc_StopIteration))) { + __Pyx_PyErr_Clear(); + return PYGEN_RETURN; + } + return PYGEN_ERROR; + } else if (likely(result == PYGEN_RETURN && *retval == Py_None)) { + __Pyx_Coroutine_unset_is_running(gen); + return PYGEN_RETURN; + } else { const char *msg; - Py_DECREF(retval); + Py_DECREF(*retval); + *retval = NULL; if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check(self)) { @@ -17392,33 +16953,25 @@ static PyObject *__Pyx_Coroutine_Close(PyObject *self) { #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(self)) { -#if PY_VERSION_HEX < 0x03060000 - msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; -#else msg = "async generator ignored GeneratorExit"; -#endif #endif } else { msg = "generator ignored GeneratorExit"; } PyErr_SetString(PyExc_RuntimeError, msg); - return NULL; - } - raised_exception = PyErr_Occurred(); - if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { - if (raised_exception) PyErr_Clear(); - Py_INCREF(Py_None); - return Py_None; + __Pyx_Coroutine_unset_is_running(gen); + return PYGEN_ERROR; } - return NULL; } static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, PyObject *args, int close_on_genexit) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) + PyObject *yf; + if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) return __Pyx_Coroutine_AlreadyRunningError(gen); + yf = gen->yieldfrom; if (yf) { + __Pyx_PySendResult result; PyObject *ret; Py_INCREF(yf); if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { @@ -17426,10 +16979,9 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject Py_DECREF(yf); __Pyx_Coroutine_Undelegate(gen); if (err < 0) - return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); + goto propagate_exception; goto throw_here; } - gen->is_running = 1; if (0 #ifdef __Pyx_Generator_USED || __Pyx_Generator_CheckExact(yf) @@ -17444,15 +16996,14 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); #endif } else { - PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw); + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_throw); if (unlikely(!meth)) { Py_DECREF(yf); if (unlikely(PyErr_Occurred())) { - gen->is_running = 0; + __Pyx_Coroutine_unset_is_running(gen); return NULL; } __Pyx_Coroutine_Undelegate(gen); - gen->is_running = 0; goto throw_here; } if (likely(args)) { @@ -17463,22 +17014,30 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject } Py_DECREF(meth); } - gen->is_running = 0; Py_DECREF(yf); - if (!ret) { - ret = __Pyx_Coroutine_FinishDelegation(gen); + if (ret) { + __Pyx_Coroutine_unset_is_running(gen); + return ret; } - return __Pyx_Coroutine_MethodReturn(self, ret); + result = __Pyx_Coroutine_FinishDelegation(gen, &ret); + __Pyx_Coroutine_unset_is_running(gen); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, ret, 0); } throw_here: __Pyx_Raise(typ, val, tb, NULL); - return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); +propagate_exception: + { + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, NULL, &retval, 0); + __Pyx_Coroutine_unset_is_running(gen); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0); + } } static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { PyObject *typ; PyObject *val = NULL; PyObject *tb = NULL; - if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))) + if (unlikely(!PyArg_UnpackTuple(args, "throw", 1, 3, &typ, &val, &tb))) return NULL; return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); } @@ -17493,6 +17052,10 @@ static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct * return 0; } static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { + { + int e = __Pyx_call_type_traverse((PyObject*)gen, 1, visit, arg); + if (e) return e; + } Py_VISIT(gen->closure); Py_VISIT(gen->classobj); Py_VISIT(gen->yieldfrom); @@ -17502,7 +17065,7 @@ static int __Pyx_Coroutine_clear(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; Py_CLEAR(gen->closure); Py_CLEAR(gen->classobj); - Py_CLEAR(gen->yieldfrom); + __Pyx_Coroutine_Undelegate(gen); __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { @@ -17523,10 +17086,13 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) { PyObject_ClearWeakRefs(self); if (gen->resume_label >= 0) { PyObject_GC_Track(self); -#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE +#if CYTHON_USE_TP_FINALIZE if (unlikely(PyObject_CallFinalizerFromDealloc(self))) #else - Py_TYPE(gen)->tp_del(self); + { + destructor del = __Pyx_PyObject_GetSlot(gen, tp_del, destructor); + if (del) del(self); + } if (unlikely(Py_REFCNT(self) > 0)) #endif { @@ -17545,6 +17111,7 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) { __Pyx_Coroutine_clear(self); __Pyx_PyHeapTypeObject_GC_Del(gen); } +#if CYTHON_USE_TP_FINALIZE static void __Pyx_Coroutine_del(PyObject *self) { PyObject *error_type, *error_value, *error_traceback; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; @@ -17552,10 +17119,6 @@ static void __Pyx_Coroutine_del(PyObject *self) { if (gen->resume_label < 0) { return; } -#if !CYTHON_USE_TP_FINALIZE - assert(self->ob_refcnt == 0); - __Pyx_SET_REFCNT(self, 1); -#endif __Pyx_PyThreadState_assign __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); #ifdef __Pyx_AsyncGen_USED @@ -17581,66 +17144,23 @@ static void __Pyx_Coroutine_del(PyObject *self) { #endif { PyObject_GC_UnTrack(self); -#if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) PyErr_WriteUnraisable(self); -#else - {PyObject *msg; - char *cmsg; - #if CYTHON_COMPILING_IN_PYPY - msg = NULL; - cmsg = (char*) "coroutine was never awaited"; - #else - char *cname; - PyObject *qualname; - qualname = gen->gi_qualname; - cname = PyString_AS_STRING(qualname); - msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); - if (unlikely(!msg)) { - PyErr_Clear(); - cmsg = (char*) "coroutine was never awaited"; - } else { - cmsg = PyString_AS_STRING(msg); - } - #endif - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) - PyErr_WriteUnraisable(self); - Py_XDECREF(msg);} -#endif PyObject_GC_Track(self); } #endif } else { - PyObject *res = __Pyx_Coroutine_Close(self); - if (unlikely(!res)) { - if (PyErr_Occurred()) - PyErr_WriteUnraisable(self); + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_Close(self, &retval); + if (result == PYGEN_ERROR) { + PyErr_WriteUnraisable(self); } else { - Py_DECREF(res); + Py_XDECREF(retval); } } __Pyx_ErrRestore(error_type, error_value, error_traceback); -#if !CYTHON_USE_TP_FINALIZE - assert(Py_REFCNT(self) > 0); - if (likely(--self->ob_refcnt == 0)) { - return; - } - { - Py_ssize_t refcnt = Py_REFCNT(self); - _Py_NewReference(self); - __Pyx_SET_REFCNT(self, refcnt); - } -#if CYTHON_COMPILING_IN_CPYTHON - assert(PyType_IS_GC(Py_TYPE(self)) && - _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); - _Py_DEC_REFTOTAL; -#endif -#ifdef COUNT_ALLOCS - --Py_TYPE(self)->tp_frees; - --Py_TYPE(self)->tp_allocs; -#endif -#endif } +#endif static PyObject * __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context) { @@ -17654,12 +17174,7 @@ static int __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; @@ -17681,12 +17196,7 @@ static int __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; @@ -17696,26 +17206,53 @@ __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void return 0; } static PyObject * -__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) +__Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self) { - PyObject *frame = self->gi_frame; - CYTHON_UNUSED_VAR(context); +#if !CYTHON_COMPILING_IN_LIMITED_API + PyObject *frame; + #if PY_VERSION_HEX >= 0x030d0000 + Py_BEGIN_CRITICAL_SECTION(self); + #endif + frame = self->gi_frame; if (!frame) { if (unlikely(!self->gi_code)) { Py_RETURN_NONE; } + PyObject *globals = PyDict_New(); + if (unlikely(!globals)) return NULL; frame = (PyObject *) PyFrame_New( PyThreadState_Get(), /*PyThreadState *tstate,*/ (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ + globals, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); + Py_DECREF(globals); if (unlikely(!frame)) return NULL; - self->gi_frame = frame; + if (unlikely(self->gi_frame)) { + Py_DECREF(frame); + frame = self->gi_frame; + } else { + self->gi_frame = frame; + } } Py_INCREF(frame); + #if PY_VERSION_HEX >= 0x030d0000 + Py_END_CRITICAL_SECTION(); + #endif return frame; +#else + CYTHON_UNUSED_VAR(self); + Py_RETURN_NONE; +#endif +} +static PyObject * +__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) { + CYTHON_UNUSED_VAR(context); + PyObject *frame = self->gi_frame; + if (frame) + return __Pyx_NewRef(frame); + return __Pyx__Coroutine_get_frame(self); } static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, @@ -17735,7 +17272,8 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( gen->resume_label = 0; gen->classobj = NULL; gen->yieldfrom = NULL; - #if PY_VERSION_HEX >= 0x030B00a4 + gen->yieldfrom_am_send = NULL; + #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_LIMITED_API gen->gi_exc_state.exc_value = NULL; #else gen->gi_exc_state.exc_type = NULL; @@ -17758,135 +17296,85 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( PyObject_GC_Track(gen); return gen; } - -/* PatchModuleWithCoroutine */ -static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - int result; - PyObject *globals, *result_obj; - globals = PyDict_New(); if (unlikely(!globals)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_coroutine_type", - #ifdef __Pyx_Coroutine_USED - (PyObject*)__pyx_CoroutineType); - #else - Py_None); +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 - if (unlikely(result < 0)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_generator_type", - #ifdef __Pyx_Generator_USED - (PyObject*)__pyx_GeneratorType); - #else - Py_None); + result = gen->is_running; + gen->is_running = 1; + #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_END_CRITICAL_SECTION(); #endif - if (unlikely(result < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; - result_obj = PyRun_String(py_code, Py_file_input, globals, globals); - if (unlikely(!result_obj)) goto ignore; - Py_DECREF(result_obj); - Py_DECREF(globals); - return module; -ignore: - Py_XDECREF(globals); - PyErr_WriteUnraisable(module); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { - Py_DECREF(module); - module = NULL; - } -#else - py_code++; -#endif - return module; + return result; } - -/* PatchGeneratorABC */ -#ifndef CYTHON_REGISTER_ABCS -#define CYTHON_REGISTER_ABCS 1 -#endif -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) -static PyObject* __Pyx_patch_abc_module(PyObject *module); -static PyObject* __Pyx_patch_abc_module(PyObject *module) { - module = __Pyx_Coroutine_patch_module( - module, "" -"if _cython_generator_type is not None:\n" -" try: Generator = _module.Generator\n" -" except AttributeError: pass\n" -" else: Generator.register(_cython_generator_type)\n" -"if _cython_coroutine_type is not None:\n" -" try: Coroutine = _module.Coroutine\n" -" except AttributeError: pass\n" -" else: Coroutine.register(_cython_coroutine_type)\n" - ); - return module; +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 + assert(gen->is_running); + gen->is_running = 0; + #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_END_CRITICAL_SECTION(); + #endif } -#endif -static int __Pyx_patch_abc(void) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - static int abc_patched = 0; - if (CYTHON_REGISTER_ABCS && !abc_patched) { - PyObject *module; - module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); - if (unlikely(!module)) { - PyErr_WriteUnraisable(NULL); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, - ((PY_MAJOR_VERSION >= 3) ? - "Cython module failed to register with collections.abc module" : - "Cython module failed to register with collections module"), 1) < 0)) { - return -1; - } - } else { - module = __Pyx_patch_abc_module(module); - abc_patched = 1; - if (unlikely(!module)) - return -1; - Py_DECREF(module); - } - module = PyImport_ImportModule("backports_abc"); - if (module) { - module = __Pyx_patch_abc_module(module); - Py_XDECREF(module); - } - if (!module) { - PyErr_Clear(); - } +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 + result = gen->is_running; + #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_END_CRITICAL_SECTION(); + #endif + return result; +} +static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure) { + CYTHON_UNUSED_VAR(closure); + char result = __Pyx_Coroutine_get_is_running((__pyx_CoroutineObject*)gen); + if (result) Py_RETURN_TRUE; + else Py_RETURN_FALSE; +} +#if __PYX_HAS_PY_AM_SEND == 2 +static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send) { + Py_ssize_t ptr_offset = (char*)(type->tp_as_async) - (char*)type; + if (ptr_offset < 0 || ptr_offset > type->tp_basicsize) { + return; } -#else - if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); -#endif - return 0; + memcpy((void*)static_amsend_methods, (void*)(type->tp_as_async), sizeof(*type->tp_as_async)); + static_amsend_methods->am_send = am_send; + type->tp_as_async = __Pyx_SlotTpAsAsync(static_amsend_methods); } +#endif /* Generator */ static PyMethodDef __pyx_Generator_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, - (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, + PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, - (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, + PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, - (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, + PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, {0, 0, 0, 0} }; -static PyMemberDef __pyx_Generator_memberlist[] = { - {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, - {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, - (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, - {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, - {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, -#if CYTHON_USE_TYPE_SPECS - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, -#endif +static PyMemberDef __pyx_Generator_memberlist[] = { + {"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, + 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}, + {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Generator_getsets[] = { - {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, - (char*) PyDoc_STR("name of the generator"), 0}, - {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, - (char*) PyDoc_STR("qualified name of the generator"), 0}, - {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, - (char*) PyDoc_STR("Frame of the generator"), 0}, + {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, + PyDoc_STR("name of the generator"), 0}, + {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, + PyDoc_STR("qualified name of the generator"), 0}, + {"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, + PyDoc_STR("Frame of the generator"), 0}, + {"gi_running", __Pyx_Coroutine_get_is_running_getter, NULL, NULL, NULL}, {0, 0, 0, 0, 0} }; -#if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_GeneratorType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc}, {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse}, @@ -17895,9 +17383,12 @@ static PyType_Slot __pyx_GeneratorType_slots[] = { {Py_tp_methods, (void *)__pyx_Generator_methods}, {Py_tp_members, (void *)__pyx_Generator_memberlist}, {Py_tp_getset, (void *)__pyx_Generator_getsets}, - {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict}, + {Py_tp_getattro, (void *) PyObject_GenericGetAttr}, #if CYTHON_USE_TP_FINALIZE {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, +#endif +#if __PYX_HAS_PY_AM_SEND == 1 + {Py_am_send, (void *)__Pyx_Coroutine_AmSend}, #endif {0, 0}, }; @@ -17905,124 +17396,71 @@ static PyType_Spec __pyx_GeneratorType_spec = { __PYX_TYPE_MODULE_PREFIX "generator", sizeof(__pyx_CoroutineObject), 0, - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, - __pyx_GeneratorType_slots -}; -#else -static PyTypeObject __pyx_GeneratorType_type = { - PyVarObject_HEAD_INIT(0, 0) - __PYX_TYPE_MODULE_PREFIX "generator", - sizeof(__pyx_CoroutineObject), - 0, - (destructor) __Pyx_Coroutine_dealloc, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, - 0, - (traverseproc) __Pyx_Coroutine_traverse, - 0, - 0, - offsetof(__pyx_CoroutineObject, gi_weakreflist), - 0, - (iternextfunc) __Pyx_Generator_Next, - __pyx_Generator_methods, - __pyx_Generator_memberlist, - __pyx_Generator_getsets, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, -#if CYTHON_USE_TP_FINALIZE - 0, -#else - __Pyx_Coroutine_del, -#endif - 0, -#if CYTHON_USE_TP_FINALIZE - __Pyx_Coroutine_del, -#elif PY_VERSION_HEX >= 0x030400a1 - 0, -#endif -#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, -#endif -#if __PYX_NEED_TP_PRINT_SLOT - 0, -#endif -#if PY_VERSION_HEX >= 0x030C0000 - 0, -#endif -#if PY_VERSION_HEX >= 0x030d00A4 - 0, -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, +#if PY_VERSION_HEX >= 0x030A0000 + Py_TPFLAGS_IMMUTABLETYPE | #endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE | __Pyx_TPFLAGS_HAVE_AM_SEND, + __pyx_GeneratorType_slots }; +#if __PYX_HAS_PY_AM_SEND == 2 +static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async; #endif static int __pyx_Generator_init(PyObject *module) { -#if CYTHON_USE_TYPE_SPECS - __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); -#else - CYTHON_UNUSED_VAR(module); - __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; - __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; - __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); -#endif - if (unlikely(!__pyx_GeneratorType)) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); + mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); + if (unlikely(!mstate->__pyx_GeneratorType)) { return -1; } +#if __PYX_HAS_PY_AM_SEND == 2 + __Pyx_SetBackportTypeAmSend(mstate->__pyx_GeneratorType, &__pyx_Generator_as_async, &__Pyx_Coroutine_AmSend); +#endif return 0; } +static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *retval = NULL; + if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { + return __Pyx_Coroutine_AlreadyRunningError(gen); + } + __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0); + __Pyx_Coroutine_unset_is_running(gen); + (void) result; + assert (result == PYGEN_RETURN || result == PYGEN_ERROR); + assert ((result == PYGEN_RETURN && retval != NULL) || (result == PYGEN_ERROR && retval == NULL)); + return retval; +} -/* CheckBinaryVersion */ +/* GetRuntimeVersion */ static unsigned long __Pyx_get_runtime_version(void) { -#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 +#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 return Py_Version & ~0xFFUL; #else - 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'); + 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; } - version += factor * digit; - if (rt_version[i] != '.') - break; - digit = 0; - factor >>= 8; - ++i; + __Pyx_cached_runtime_version = version; } - return 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; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) @@ -18045,45 +17483,165 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt } } -/* InitStrings */ -#if PY_MAJOR_VERSION >= 3 -static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { - if (t.is_unicode | t.is_str) { - if (t.intern) { - *str = PyUnicode_InternFromString(t.s); - } else if (t.encoding) { - *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); +/* NewCodeObj */ +#if CYTHON_COMPILING_IN_LIMITED_API + static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030b0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); } else { - *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } - } else { - *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; } - if (!*str) - return -1; - if (PyObject_Hash(*str) == -1) - return -1; - return 0; -} +#elif PY_VERSION_HEX >= 0x030B0000 + static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + 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); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !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 + #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION >= 3 - __Pyx_InitString(*t, t->p); - #else +static PyObject* __Pyx_PyCode_New( + const __Pyx_PyCode_New_function_description descr, + PyObject * const *varnames, + PyObject *filename, + PyObject *funcname, + const char *line_table, + PyObject *tuple_dedup_map +) { + PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_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; + for (Py_ssize_t i=0; i < var_count; i++) { + Py_INCREF(varnames[i]); + if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done; + } + #if CYTHON_COMPILING_IN_LIMITED_API + varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple); + if (!varnames_tuple_dedup) { + if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done; + varnames_tuple_dedup = varnames_tuple; + } + #else + varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple); + if (unlikely(!varnames_tuple_dedup)) goto done; + #endif + #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; + code_bytes = PyBytes_FromStringAndSize(NULL, code_len); + if (unlikely(!code_bytes)) goto done; + char* c_code_bytes = PyBytes_AsString(code_bytes); + if (unlikely(!c_code_bytes)) goto done; + memset(c_code_bytes, 0, (size_t) code_len); + } + code_obj = (PyObject*) __Pyx__PyCode_New( + (int) descr.argcount, + (int) descr.num_posonly_args, + (int) descr.num_kwonly_args, + (int) descr.nlocals, + 0, + (int) descr.flags, + code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + varnames_tuple_dedup, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + filename, + funcname, + (int) descr.first_line, + (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table_bytes) ? line_table_bytes : __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 + Py_DECREF(varnames_tuple); + 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) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); + 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 { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + str = PyBytes_FromStringAndSize(t->s, t->n - 1); } - if (!*t->p) + if (!str) return -1; - if (PyObject_Hash(*t->p) == -1) + *target = str; + if (PyObject_Hash(str) == -1) return -1; - #endif ++t; + ++target; } return 0; } @@ -18111,31 +17669,30 @@ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#if !CYTHON_PEP393_ENABLED -static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } + const char* result; + Py_ssize_t unicode_length; + CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 + if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL; + #else + result = PyUnicode_AsUTF8AndSize(o, length); + #endif + #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + unicode_length = PyUnicode_GetLength(o); + if (unlikely(unicode_length < 0)) return NULL; + if (unlikely(unicode_length != *length)) { + PyUnicode_AsASCIIString(o); + return NULL; } + #endif + return result; } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -} #else -static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); @@ -18147,25 +17704,25 @@ static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py #else return PyUnicode_AsUTF8AndSize(o, length); #endif -} #endif +} #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + if (PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif -#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { +#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))) *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); - } else +#else + *length = PyByteArray_Size(o); + if (*length == -1) return NULL; + return PyByteArray_AsString(o); #endif + } else { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); @@ -18188,9 +17745,8 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { Py_DECREF(x); return retval; } -static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { - __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); -#if PY_MAJOR_VERSION >= 3 +static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result)); if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " @@ -18204,74 +17760,44 @@ static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const __Pyx_DECREF_TypeName(result_type_name); return result; } -#endif PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", - type_name, type_name, result_type_name); + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")", + result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif - const char *name = NULL; PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x) || PyLong_Check(x))) -#else if (likely(PyLong_Check(x))) -#endif - return __Pyx_NewRef(x); + return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; - #if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = m->nb_int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = m->nb_long(x); - } - #else if (likely(m && m->nb_int)) { - name = "int"; - res = m->nb_int(x); + res = m->nb_int(x); } - #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { - res = PyNumber_Int(x); + res = PyNumber_Long(x); } #endif if (likely(res)) { -#if PY_MAJOR_VERSION < 3 - if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { -#else - if (unlikely(!PyLong_CheckExact(res))) { -#endif - return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); - } + if (unlikely(!PyLong_CheckExact(res))) { + return __Pyx_PyNumber_LongWrongResultType(res); + } } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); + PyErr_SetString(PyExc_TypeError, + "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(b); - } -#endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { @@ -18317,34 +17843,349 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { } x = PyNumber_Index(b); if (!x) return -1; - ival = PyInt_AsSsize_t(x); + ival = PyLong_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); -#if PY_MAJOR_VERSION < 3 - } else if (likely(PyInt_CheckExact(o))) { - return PyInt_AS_LONG(o); -#endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; - ival = PyInt_AsLong(x); + ival = PyLong_AsLong(x); Py_DECREF(x); return ival; } } +static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) { + CYTHON_UNUSED_VAR(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); } -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { + return PyLong_FromSize_t(ival); +} + + +/* MultiPhaseInitModuleState */ +#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE +#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000) + #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1 +#else + #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0 +#endif +#endif +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS +#error "Module state with PEP489 requires atomics. Currently that's one of\ + C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics" +#endif +#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +#define __Pyx_ModuleStateLookup_Lock() +#define __Pyx_ModuleStateLookup_Unlock() +#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000 +static PyMutex __Pyx_ModuleStateLookup_mutex = {0}; +#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(__cplusplus) && __cplusplus >= 201103L +#include +static std::mutex __Pyx_ModuleStateLookup_mutex; +#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock() +#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock() +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__) +#include +static mtx_t __Pyx_ModuleStateLookup_mutex; +static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT; +static void __Pyx_ModuleStateLookup_initialize_mutex(void) { + mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain); +} +#define __Pyx_ModuleStateLookup_Lock()\ + call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\ + mtx_lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(HAVE_PTHREAD_H) +#include +static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER; +#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(_WIN32) +#include // synchapi.h on its own doesn't work +static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT; +#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) +#else +#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\ + Requires C standard >= C11, or C++ standard >= C++11,\ + or pthreads, or the Windows 32 API, or Python >= 3.13." +#endif +typedef struct { + int64_t id; + PyObject *module; +} __Pyx_InterpreterIdAndModule; +typedef struct { + char interpreter_id_as_index; + Py_ssize_t count; + Py_ssize_t allocated; + __Pyx_InterpreterIdAndModule table[1]; +} __Pyx_ModuleStateLookupData; +#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32 +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0; +#endif +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0; +#else +static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL; +#endif +static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound( + __Pyx_InterpreterIdAndModule* table, + Py_ssize_t count, + int64_t interpreterId) { + __Pyx_InterpreterIdAndModule* begin = table; + __Pyx_InterpreterIdAndModule* end = begin + count; + if (begin->id == interpreterId) { + return begin; + } + while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { + __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2; + if (halfway->id == interpreterId) { + return halfway; + } + if (halfway->id < interpreterId) { + begin = halfway; + } else { + end = halfway; + } + } + for (; begin < end; ++begin) { + if (begin->id >= interpreterId) return begin; + } + return begin; +} +static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return NULL; +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); + { + __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); + if (likely(data)) { + __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data); + if (likely(data == new_data)) { + goto read_finished; + } + } + __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); + __Pyx_ModuleStateLookup_Lock(); + __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter); + data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); + __Pyx_ModuleStateLookup_Unlock(); + } + read_finished:; +#else + __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data; +#endif + __Pyx_InterpreterIdAndModule* found = NULL; + if (unlikely(!data)) goto end; + if (data->interpreter_id_as_index) { + if (interpreter_id < data->count) { + found = data->table+interpreter_id; + } + } else { + found = __Pyx_State_FindModuleStateLookupTableLowerBound( + data->table, data->count, interpreter_id); + } + end: + { + PyObject *result=NULL; + if (found && found->id == interpreter_id) { + result = found->module; + } +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); +#endif + return result; + } +} +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) { + while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0); } - +#else +#define __Pyx_ModuleStateLookup_wait_until_no_readers() +#endif +static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) { + Py_ssize_t to_allocate = (*old_data)->allocated; + while (to_allocate <= interpreter_id) { + if (to_allocate == 0) to_allocate = 1; + else to_allocate *= 2; + } + __Pyx_ModuleStateLookupData *new_data = *old_data; + if (to_allocate != (*old_data)->allocated) { + new_data = (__Pyx_ModuleStateLookupData *)realloc( + *old_data, + sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); + if (!new_data) { + PyErr_NoMemory(); + return -1; + } + for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) { + new_data->table[i].id = i; + new_data->table[i].module = NULL; + } + new_data->allocated = to_allocate; + } + new_data->table[interpreter_id].module = module; + if (new_data->count < interpreter_id+1) { + new_data->count = interpreter_id+1; + } + *old_data = new_data; + return 0; +} +static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) { + __Pyx_InterpreterIdAndModule *read = data->table; + __Pyx_InterpreterIdAndModule *write = data->table; + __Pyx_InterpreterIdAndModule *end = read + data->count; + for (; readmodule) { + write->id = read->id; + write->module = read->module; + ++write; + } + } + data->count = write - data->table; + for (; writeid = 0; + write->module = NULL; + } + data->interpreter_id_as_index = 0; +} +static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return -1; + int result = 0; + __Pyx_ModuleStateLookup_Lock(); +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *) + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); +#else + __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data; +#endif + __Pyx_ModuleStateLookupData *new_data = old_data; + if (!new_data) { + new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData)); + if (!new_data) { + result = -1; + PyErr_NoMemory(); + goto end; + } + new_data->allocated = 1; + new_data->interpreter_id_as_index = 1; + } + __Pyx_ModuleStateLookup_wait_until_no_readers(); + if (new_data->interpreter_id_as_index) { + if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { + result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id); + goto end; + } + __Pyx_State_ConvertFromInterpIdAsIndex(new_data); + } + { + Py_ssize_t insert_at = 0; + { + __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( + new_data->table, new_data->count, interpreter_id); + assert(lower_bound); + insert_at = lower_bound - new_data->table; + if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) { + lower_bound->module = module; + goto end; // already in table, nothing more to do + } + } + if (new_data->count+1 >= new_data->allocated) { + Py_ssize_t to_allocate = (new_data->count+1)*2; + new_data = + (__Pyx_ModuleStateLookupData*)realloc( + new_data, + sizeof(__Pyx_ModuleStateLookupData) + + (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); + if (!new_data) { + result = -1; + new_data = old_data; + PyErr_NoMemory(); + goto end; + } + new_data->allocated = to_allocate; + } + ++new_data->count; + int64_t last_id = interpreter_id; + PyObject *last_module = module; + for (Py_ssize_t i=insert_at; icount; ++i) { + int64_t current_id = new_data->table[i].id; + new_data->table[i].id = last_id; + last_id = current_id; + PyObject *current_module = new_data->table[i].module; + new_data->table[i].module = last_module; + last_module = current_module; + } + } + end: +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data); +#else + __Pyx_ModuleStateLookup_data = new_data; +#endif + __Pyx_ModuleStateLookup_Unlock(); + return result; +} +static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return -1; + __Pyx_ModuleStateLookup_Lock(); +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *) + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); +#else + __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data; +#endif + if (data->interpreter_id_as_index) { + if (interpreter_id < data->count) { + data->table[interpreter_id].module = NULL; + } + goto done; + } + { + __Pyx_ModuleStateLookup_wait_until_no_readers(); + __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( + data->table, data->count, interpreter_id); + if (!lower_bound) goto done; + if (lower_bound->id != interpreter_id) goto done; + __Pyx_InterpreterIdAndModule *end = data->table+data->count; + for (;lower_boundid = (lower_bound+1)->id; + lower_bound->module = (lower_bound+1)->module; + } + } + --data->count; + if (data->count == 0) { + free(data); + data = NULL; + } + done: +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data); +#else + __Pyx_ModuleStateLookup_data = data; +#endif + __Pyx_ModuleStateLookup_Unlock(); + return 0; +} +#endif /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER diff --git a/constraint/solvers.c b/constraint/solvers.c index c71ad08..ad9ab52 100644 --- a/constraint/solvers.c +++ b/constraint/solvers.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.0.12 */ +/* Generated by Cython 3.1.1 */ /* BEGIN: Cython Metadata { @@ -18,32 +18,21 @@ END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ -#if defined(CYTHON_LIMITED_API) && 0 - #ifndef Py_LIMITED_API - #if CYTHON_LIMITED_API+0 > 0x03030000 - #define Py_LIMITED_API CYTHON_LIMITED_API - #else - #define Py_LIMITED_API 0x03030000 - #endif - #endif +/* InitLimitedAPI */ +#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API) + #define CYTHON_LIMITED_API 1 #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) - #error Cython requires Python 2.7+ or Python 3.3+. -#else -#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API -#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#elif PY_VERSION_HEX < 0x03080000 + #error Cython requires Python 3.8+. #else -#define __PYX_EXTRA_ABI_MODULE_NAME "" -#endif -#define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME -#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI -#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x03000CF0 +#define __PYX_ABI_VERSION "3_1_1" +#define CYTHON_HEX_VERSION 0x030101F0 #define CYTHON_FUTURE_DIVISION 1 +/* CModulePreamble */ #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -83,19 +72,13 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -106,8 +89,12 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #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 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -119,18 +106,22 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 + #define CYTHON_USE_EXC_INFO_STACK 1 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif @@ -141,20 +132,14 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 + #define CYTHON_USE_TYPE_SLOTS 1 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -165,8 +150,13 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #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 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -178,7 +168,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT @@ -188,14 +178,19 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00) + #endif + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100) #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 @@ -208,7 +203,7 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS @@ -217,8 +212,6 @@ END: Cython Metadata */ #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -231,8 +224,13 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -240,71 +238,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 1 - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif - #undef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 -#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 1 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #ifndef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #ifndef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 1 - #endif + #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS @@ -316,26 +250,37 @@ END: Cython Metadata */ #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 + #define CYTHON_USE_TP_FINALIZE 0 + #endif + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000) #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 - #endif - #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif + #undef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #ifndef CYTHON_USE_TYPE_SLOTS + #ifdef Py_GIL_DISABLED + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1 + #else + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 + #endif + #if PY_VERSION_HEX < 0x030A0000 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #elif !defined(CYTHON_USE_TYPE_SLOTS) #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS @@ -344,22 +289,19 @@ END: Cython Metadata */ #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif - #if PY_MAJOR_VERSION < 3 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif - #ifndef CYTHON_USE_PYLIST_INTERNALS + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLIST_INTERNALS) #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif - #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) @@ -368,20 +310,32 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 + #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS) + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif - #ifndef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #elif !defined(CYTHON_FAST_GIL) + #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #define CYTHON_METH_FASTCALL 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 @@ -389,51 +343,49 @@ END: Cython Metadata */ #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif - #if PY_VERSION_HEX < 0x030400a1 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #elif !defined(CYTHON_USE_TP_FINALIZE) + #ifndef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1) + #endif + #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif - #if PY_VERSION_HEX < 0x030600B1 + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 1 + #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE) #endif - #if PY_VERSION_HEX < 0x030700A3 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 1 + #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif #endif -#if !defined(CYTHON_FAST_PYCCALL) -#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#ifndef CYTHON_FAST_PYCCALL +#define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL #endif -#if !defined(CYTHON_VECTORCALL) +#ifndef CYTHON_VECTORCALL +#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) #endif +#endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS - #if PY_MAJOR_VERSION < 3 - #include "longintrepr.h" - #endif #undef SHIFT #undef BASE #undef MASK @@ -568,6 +520,9 @@ END: Cython Metadata */ #endif #endif #endif +#ifndef Py_UNREACHABLE + #define Py_UNREACHABLE() assert(0); abort() +#endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; @@ -582,6 +537,7 @@ END: Cython Metadata */ #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) +/* CInitCode */ #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) @@ -596,109 +552,42 @@ END: Cython Metadata */ #endif #endif +/* PythonCompatibility */ #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_DefaultClassType PyClass_Type - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_DefaultClassType PyType_Type +#define __Pyx_BUILTIN_MODULE_NAME "builtins" +#define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API - static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyObject *exception_table = NULL; - PyObject *types_module=NULL, *code_type=NULL, *result=NULL; - #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; - PyObject *py_minor_version = NULL; - #endif - long minor_version = 0; - PyObject *type, *value, *traceback; - PyErr_Fetch(&type, &value, &traceback); - #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; - #else - if (!(version_info = PySys_GetObject("version_info"))) goto end; - if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; - minor_version = PyLong_AsLong(py_minor_version); - Py_DECREF(py_minor_version); - if (minor_version == -1 && PyErr_Occurred()) goto end; - #endif - if (!(types_module = PyImport_ImportModule("types"))) goto end; - if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; - if (minor_version <= 7) { - (void)p; - result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else if (minor_version <= 10) { - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else { - if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); - } - end: - Py_XDECREF(code_type); - Py_XDECREF(exception_table); - Py_XDECREF(types_module); - if (type) { - PyErr_Restore(type, value, traceback); - } - return result; - } #ifndef CO_OPTIMIZED - #define CO_OPTIMIZED 0x0001 + static int CO_OPTIMIZED; #endif #ifndef CO_NEWLOCALS - #define CO_NEWLOCALS 0x0002 + static int CO_NEWLOCALS; #endif #ifndef CO_VARARGS - #define CO_VARARGS 0x0004 + static int CO_VARARGS; #endif #ifndef CO_VARKEYWORDS - #define CO_VARKEYWORDS 0x0008 + static int CO_VARKEYWORDS; #endif #ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x0200 + static int CO_ASYNC_GENERATOR; #endif #ifndef CO_GENERATOR - #define CO_GENERATOR 0x0020 + static int CO_GENERATOR; #endif #ifndef CO_COROUTINE - #define CO_COROUTINE 0x0080 + static int CO_COROUTINE; #endif -#elif PY_VERSION_HEX >= 0x030B0000 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); - if (!empty_bytes) return NULL; - result = - #if PY_VERSION_HEX >= 0x030C0000 - PyUnstable_Code_NewWithPosOnlyArgs - #else - PyCode_NewWithPosOnlyArgs - #endif - (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); - Py_DECREF(empty_bytes); - return result; - } -#elif PY_VERSION_HEX >= 0x030800B2 && !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 - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 + #endif #endif +static int __Pyx_init_co_variables(void); #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else @@ -730,12 +619,6 @@ END: Cython Metadata */ #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif -#ifndef CO_COROUTINE - #define CO_COROUTINE 0x80 -#endif -#ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x200 -#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -757,7 +640,7 @@ END: Cython Metadata */ #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif -#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) +#ifndef METH_FASTCALL #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif @@ -795,7 +678,7 @@ END: Cython Metadata */ #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif -#if PY_MAJOR_VERSION >= 0x030900B1 +#if PY_VERSION_HEX >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) @@ -812,7 +695,7 @@ static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif -static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { +static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else @@ -820,7 +703,7 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) -#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 +#if __PYX_LIMITED_VERSION_HEX < 0x03090000 #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 @@ -836,8 +719,10 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_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)) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) @@ -848,15 +733,11 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() -#elif PY_VERSION_HEX >= 0x03060000 - #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() -#elif PY_VERSION_HEX >= 0x03000000 - #define __Pyx_PyThreadState_Current PyThreadState_GET() #else - #define __Pyx_PyThreadState_Current _PyThreadState_Current + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #endif -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +#if CYTHON_USE_MODULE_STATE +static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); @@ -864,85 +745,43 @@ static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) Py_FatalError("Couldn't find the module state"); return result; } -#endif -#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o) #else - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) -#endif -#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) -#include "pythread.h" -#define Py_tss_NEEDS_INIT 0 -typedef int Py_tss_t; -static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { - *key = PyThread_create_key(); - return 0; -} -static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { - Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); - *key = Py_tss_NEEDS_INIT; - return key; -} -static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { - PyObject_Free(key); -} -static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { - return *key != Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { - PyThread_delete_key(*key); - *key = Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { - return PyThread_set_key_value(*key, value); -} -static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { - return PyThread_get_key_value(*key); -} -#endif -#if PY_MAJOR_VERSION < 3 - #if CYTHON_COMPILING_IN_PYPY - #if PYPY_VERSION_NUM < 0x07030600 - #if defined(__cplusplus) && __cplusplus >= 201402L - [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] - #elif defined(__GNUC__) || defined(__clang__) - __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) - #elif defined(_MSC_VER) - __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) - #endif - static CYTHON_INLINE int PyGILState_Check(void) { - return 0; - } - #else // PYPY_VERSION_NUM < 0x07030600 - #endif // PYPY_VERSION_NUM < 0x07030600 - #else - static CYTHON_INLINE int PyGILState_Check(void) { - PyThreadState * tstate = _PyThreadState_Current; - return tstate && (tstate == PyGILState_GetThisThreadState()); - } - #endif +#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global) #endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype) +#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype) +#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype) +#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype) +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype) + #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL) + #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\ + ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\ + (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\ + __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL) + #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype) + #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype) +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif -#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) +#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } -#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000 #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else @@ -966,17 +805,11 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) - #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) - #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) -#else - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif +#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ @@ -988,24 +821,20 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) -#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 +#else #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) @@ -1021,20 +850,6 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif -#else - #define CYTHON_PEP393_ENABLED 0 - #define PyUnicode_1BYTE_KIND 1 - #define PyUnicode_2BYTE_KIND 2 - #define PyUnicode_4BYTE_KIND 4 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) @@ -1048,8 +863,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif - #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) - #undef PyUnicode_Contains + #if !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) @@ -1059,33 +873,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #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 PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#ifndef PyObject_Unicode - #define PyObject_Unicode PyObject_Str -#endif -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) @@ -1102,28 +890,75 @@ 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_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS + #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) + #else + #define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i) + #endif +#else + #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) +#endif +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 +#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) +#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyObject_GetItem(dict, key); + if (*result == NULL) { + if (PyErr_ExceptionMatches(PyExc_KeyError)) { + PyErr_Clear(); + return 0; + } + return -1; + } + return 1; +} +#else +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyDict_GetItemWithError(dict, key); + if (*result == NULL) { + return PyErr_Occurred() ? -1 : 0; + } + Py_INCREF(*result); + return 1; +} +#endif +#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST + #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj) +#else + #define __Pyx_VISIT_CONST(obj) +#endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i) +#endif +#if CYTHON_ASSUME_SAFE_SIZE #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o) #else - #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) - #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) - #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) - #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) #endif -#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 +#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) { @@ -1132,85 +967,138 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, return module; } #endif -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define __Pyx_Py3Int_Check(op) PyLong_Check(op) - #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#else - #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) - #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t -#endif -#if CYTHON_USE_ASYNC_SLOTS - #if PY_VERSION_HEX >= 0x030500B1 - #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods - #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) - #else - #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) - #endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) +#endif +#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t +#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t +#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 + #define __Pyx_PySendResult PySendResult +#else + typedef enum { + PYGEN_RETURN = 0, + PYGEN_ERROR = -1, + PYGEN_NEXT = 1, + } __Pyx_PySendResult; +#endif +#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3 + typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result); #else - #define __Pyx_PyType_AsAsync(obj) NULL + #define __Pyx_pyiter_sendfunc sendfunc #endif -#ifndef __Pyx_PyAsyncMethodsStruct +#if !CYTHON_USE_AM_SEND +#define __PYX_HAS_PY_AM_SEND 0 +#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000 +#define __PYX_HAS_PY_AM_SEND 1 +#else +#define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation +#endif +#if __PYX_HAS_PY_AM_SEND < 2 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods +#else typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; + __Pyx_pyiter_sendfunc am_send; } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s)) #endif - -#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) - #if !defined(_USE_MATH_DEFINES) - #define _USE_MATH_DEFINES - #endif -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) +#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0 + #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21) #else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} + #define __Pyx_TPFLAGS_HAVE_AM_SEND (0) #endif -#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) -#define __Pyx_truncl trunc +#if PY_VERSION_HEX >= 0x03090000 +#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get() #else -#define __Pyx_truncl truncl +#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp +#endif +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000 +#ifdef __cplusplus +extern "C" +#endif +PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize); +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) { + int value; + PyObject *py_value = PyObject_GetAttrString(inspect, name); + if (!py_value) return 0; + value = (int) PyLong_AsLong(py_value); + Py_DECREF(py_value); + *write_to = value; + return value != -1 || !PyErr_Occurred(); +} +static int __Pyx_init_co_variables(void) { + PyObject *inspect; + int result; + inspect = PyImport_ImportModule("inspect"); + result = +#if !defined(CO_OPTIMIZED) + __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) && +#endif +#if !defined(CO_NEWLOCALS) + __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) && +#endif +#if !defined(CO_VARARGS) + __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) && +#endif +#if !defined(CO_VARKEYWORDS) + __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) && +#endif +#if !defined(CO_ASYNC_GENERATOR) + __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) && +#endif +#if !defined(CO_GENERATOR) + __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) && +#endif +#if !defined(CO_COROUTINE) + __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) && +#endif + 1; + Py_DECREF(inspect); + return result ? 0 : -1; +} +#else +static int __Pyx_init_co_variables(void) { + return 0; // It's a limited API-only feature +} +#endif + +/* MathInitCode */ +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #ifndef _USE_MATH_DEFINES + #define _USE_MATH_DEFINES + #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 +#define __Pyx_truncl truncl #endif -#define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0 +#endif +#ifndef CYTHON_CLINE_IN_TRACEBACK +#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#endif +#if CYTHON_CLINE_IN_TRACEBACK +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; } +#else +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; } +#endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } @@ -1242,12 +1130,8 @@ static CYTHON_INLINE float __PYX_NAN() { #define CYTHON_WITHOUT_ASSERTIONS #endif -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -1290,19 +1174,23 @@ static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s) +#else + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s) +#endif #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) @@ -1311,32 +1199,44 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef) + return Py_NewRef(obj); +#else + Py_INCREF(obj); + return obj; +#endif +} +static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef) + return Py_XNewRef(obj); +#else + Py_XINCREF(obj); + return obj; +#endif +} +static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b); static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x) #else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x) #endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x)) #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK @@ -1383,81 +1283,12 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -#include -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = (char) c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL) #else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#include -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #endif @@ -1469,25 +1300,193 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) { #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ +/* PretendToInitialize */ +#ifdef __cplusplus +#include +template +static void __Pyx_pretend_to_initialize(T* ptr) { +#if __cplusplus > 201103L + if ((std::is_trivially_default_constructible::value)) +#endif + *ptr = T(); + (void)ptr; +} +#else static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } +#endif + #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; -static const char * __pyx_cfilenm = __FILE__; +static const char * const __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ -static const char *__pyx_f[] = { +static const char* const __pyx_f[] = { "constraint/solvers.py", }; /* #### Code section: utility_code_proto_before_types ### */ -/* ForceInitThreads.proto */ -#ifndef __PYX_FORCE_INIT_THREADS - #define __PYX_FORCE_INIT_THREADS 0 +/* Atomics.proto */ +#include +#ifndef CYTHON_ATOMICS + #define CYTHON_ATOMICS 1 +#endif +#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS +#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __pyx_atomic_int_type int +#define __pyx_nonatomic_int_type int +#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ + (__STDC_VERSION__ >= 201112L) &&\ + !defined(__STDC_NO_ATOMICS__)) + #include +#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ + (__cplusplus >= 201103L) ||\ + (defined(_MSC_VER) && _MSC_VER >= 1700))) + #include +#endif +#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ + (__STDC_VERSION__ >= 201112L) &&\ + !defined(__STDC_NO_ATOMICS__) &&\ + ATOMIC_INT_LOCK_FREE == 2) + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type atomic_int + #define __pyx_atomic_ptr_type atomic_uintptr_t + #define __pyx_nonatomic_ptr_type uintptr_t + #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed) + #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel) + #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel) + #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg) + #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired) + #define __pyx_atomic_load(value) atomic_load(value) + #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value) + #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) + #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) + #pragma message ("Using standard C atomics") + #elif defined(__PYX_DEBUG_ATOMICS) + #warning "Using standard C atomics" + #endif +#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ + (__cplusplus >= 201103L) ||\ +\ + (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\ + ATOMIC_INT_LOCK_FREE == 2) + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type std::atomic_int + #define __pyx_atomic_ptr_type std::atomic_uintptr_t + #define __pyx_nonatomic_ptr_type uintptr_t + #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed) + #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel) + #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel) + #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg) + #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired) + #define __pyx_atomic_load(value) std::atomic_load(value) + #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value) + #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) + #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) + #pragma message ("Using standard C++ atomics") + #elif defined(__PYX_DEBUG_ATOMICS) + #warning "Using standard C++ atomics" + #endif +#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\ + (__GNUC_MINOR__ > 1 ||\ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2)))) + #define __pyx_atomic_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) + #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg) + static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { + __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired); + int result = old == *expected; + *expected = old; + return result; + } + #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0) + #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value) + #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) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using GNU atomics" + #endif +#elif CYTHON_ATOMICS && defined(_MSC_VER) + #include + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type long + #define __pyx_atomic_ptr_type void* + #undef __pyx_nonatomic_int_type + #define __pyx_nonatomic_int_type long + #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) + #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1) + #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg) + static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { + __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected); + int result = old == *expected; + *expected = old; + return result; + } + #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0) + #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value) + #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) + #ifdef __PYX_DEBUG_ATOMICS + #pragma message ("Using MSVC atomics") + #endif +#else + #undef CYTHON_ATOMICS + #define CYTHON_ATOMICS 0 + #ifdef __PYX_DEBUG_ATOMICS + #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 */ +#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) +#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 +#endif +#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_BEGIN_CRITICAL_SECTION(o) { +#define __Pyx_END_CRITICAL_SECTION() } +#else +#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION +#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION #endif /* #### Code section: numeric_typedefs ### */ @@ -1509,7 +1508,7 @@ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr; * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * forwardcheck = self._forwardcheck * assignments = {} - */ +*/ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter { PyObject_HEAD PyObject *__pyx_v_assignments; @@ -1538,7 +1537,7 @@ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter { * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * forwardcheck = self._forwardcheck * assignments = {} - */ +*/ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter { PyObject_HEAD PyObject *__pyx_v_assignments; @@ -1565,7 +1564,7 @@ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter { * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 # <<<<<<<<<<<<<< * """Parallelized all-solutions finder using ProcessPoolExecutor for work-stealing.""" * # Precompute constraints lookup per variable - */ +*/ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList { PyObject_HEAD PyObject *__pyx_v_constraint_lookup; @@ -1582,7 +1581,7 @@ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList { * args = ((self.requires_pickling, domains, constraint_lookup, first_var, val, remaining_vars.copy()) for val in domains[first_var]) # noqa: E501 # <<<<<<<<<<<<<< * solutions: list[dict[Hashable, any]] = [] * - */ +*/ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr { PyObject_HEAD struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *__pyx_outer_scope; @@ -1600,7 +1599,7 @@ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr { * def is_valid(assignment: dict[Hashable, any], constraints_lookup: list[tuple[Constraint, Hashable]], domains: dict[Hashable, Domain]) -> bool: # noqa E501 # <<<<<<<<<<<<<< * """Check if all constraints are satisfied given the current assignment.""" * return all( - */ +*/ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid { PyObject_HEAD PyObject *__pyx_v_assignment; @@ -1614,7 +1613,7 @@ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid { * constraint(vars_involved, domains, assignment, None) # <<<<<<<<<<<<<< * for constraint, vars_involved in constraints_lookup * if all(v in assignment for v in vars_involved) - */ +*/ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr { PyObject_HEAD struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *__pyx_outer_scope; @@ -1631,7 +1630,7 @@ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr { * if all(v in assignment for v in vars_involved) # <<<<<<<<<<<<<< * ) * - */ +*/ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr { PyObject_HEAD struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *__pyx_outer_scope; @@ -1658,7 +1657,6 @@ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr { static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ @@ -1672,11 +1670,6 @@ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr { __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) - #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() -#endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ @@ -1788,6 +1781,8 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +#endif +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif @@ -1802,111 +1797,68 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i) #elif CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) -#else - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) -#endif -#if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) - #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i)) #else - #define __Pyx_Arg_NewRef_VARARGS(arg) arg - #define __Pyx_Arg_XDECREF_VARARGS(arg) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i)) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL - #define __Pyx_Arg_FASTCALL(args, i) args[i] - #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i]) + #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif - #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs - to have the same reference counting */ - #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else - #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS + #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS - #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) - #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS -#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) -#else #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) +#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) #endif -/* 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); - /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, - const char* function_name); - -/* 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); - -/* RaiseNeedMoreValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -/* IterFinish.proto */ -static CYTHON_INLINE int __Pyx_IterFinish(void); - -/* UnpackItemEndCheck.proto */ -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); - -/* ListAppend.proto */ -#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS -static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { - PyListObject* L = (PyListObject*) list; - Py_ssize_t len = Py_SIZE(list); - if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { - Py_INCREF(x); - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 - L->ob_item[len] = x; - #else - PyList_SET_ITEM(list, len, x); - #endif - __Pyx_SET_SIZE(list, len + 1); - return 0; - } - return PyList_Append(list, x); -} -#else -#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) -#endif +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 */ +#define __Pyx_CallCFunction(cfunc, self, args)\ + ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args) +#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\ + ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs) +#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\ + ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs) +#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 **args, Py_ssize_t nargs, PyObject *kwargs); +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) @@ -1916,12 +1868,6 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" -#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else @@ -1950,7 +1896,92 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject /* PyObjectFastCall.proto */ #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 **args, size_t nargs, PyObject *kwargs); +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs); + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS + __pyx_atomic_int_type initialized; +#endif + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) { +#if !CYTHON_ATOMICS + return 1; +#else + __pyx_nonatomic_int_type expected = 0; + if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) { + return 0; + } + return expected; +#endif +} +static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) { +#if CYTHON_ATOMICS + __pyx_atomic_store(&cfunc->initialized, 2); +#endif +} +#else +#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2 +#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc) +#endif + +/* CallUnboundCMethod2.proto */ +CYTHON_UNUSED +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); +#else +#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) +#endif + +/* 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); + +/* 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); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + L->ob_item[len] = x; + #else + PyList_SET_ITEM(list, len, x); + #endif + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); @@ -1970,21 +2001,11 @@ 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); -/* UnpackUnboundCMethod.proto */ -typedef struct { - PyObject *type; - PyObject **method_name; - PyCFunction func; - PyObject *method; - int flag; -} __Pyx_CachedCFunction; - -/* CallUnboundCMethod2.proto */ -static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 -static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); +/* PyObjectFastCallMethod.proto */ +#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000 +#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL) #else -#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) +static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf); #endif /* PyDictContains.proto */ @@ -1994,7 +2015,7 @@ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, } /* DictGetItem.proto */ -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #define __Pyx_PyObject_Dict_GetItem(obj, name)\ (likely(PyDict_CheckExact(obj)) ?\ @@ -2044,11 +2065,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ PyObject_Format(s, f)) -#elif PY_MAJOR_VERSION < 3 - #define __Pyx_PyObject_FormatSimple(s, f) (\ - likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ - likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ - PyObject_Format(s, f)) #elif CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ @@ -2062,7 +2078,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( #endif /* UnicodeConcatInPlace.proto */ -# if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +# if CYTHON_COMPILING_IN_CPYTHON #if CYTHON_REFNANNY #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, __pyx_refnanny) #else @@ -2082,12 +2098,19 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); +/* PyObjectDelAttr.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 +#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL) +#else +#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n) +#endif + /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else -#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif @@ -2104,12 +2127,8 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto */ -#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ - (likely(is_tuple || PyTuple_Check(tuple)) ?\ - (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ - __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ - (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ - __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) +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( PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); static int __Pyx_unpack_tuple2_generic( @@ -2142,53 +2161,27 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif -/* IncludeStructmemberH.proto */ -#include - /* FixUpExtensionType.proto */ -#if CYTHON_USE_TYPE_SPECS -static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); -#endif +static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ -#if !CYTHON_USE_TYPE_SPECS -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); -#else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); -#endif -/* PyMethodNew.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - typesModule = PyImport_ImportModule("types"); - if (!typesModule) return NULL; - methodType = PyObject_GetAttrString(typesModule, "MethodType"); - Py_DECREF(typesModule); - if (!methodType) return NULL; - result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); - Py_DECREF(methodType); - return result; -} -#elif PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - return PyMethod_New(func, self); -} +/* 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 #else - #define __Pyx_PyMethod_New PyMethod_New +static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg); #endif +/* PyMethodNew.proto */ +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); + /* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif @@ -2222,10 +2215,11 @@ typedef struct { #else PyCMethodObject func; #endif -#if CYTHON_BACKPORT_VECTORCALL +#if CYTHON_BACKPORT_VECTORCALL ||\ + (CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL) __pyx_vectorcallfunc func_vectorcall; #endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; @@ -2238,9 +2232,7 @@ typedef struct { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif - void *defaults; - int defaults_pyobjects; - size_t defaults_size; + PyObject *defaults; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -2249,10 +2241,10 @@ typedef struct { PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check -#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) -#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) -#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType) +#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType) +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, @@ -2261,9 +2253,8 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef * PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, - size_t size, - int pyobjects); +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, + PyTypeObject *defaults_type); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, @@ -2276,7 +2267,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 +#if CYTHON_BACKPORT_VECTORCALL || 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) @@ -2290,9 +2281,34 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, PyObject *module, PyObject *globals, PyObject* code); +/* PyObjectVectorCallKwBuilder.proto */ +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 +#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall +#endif +#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n) +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict +#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n) +#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value) +#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value) +#endif + +/* PyObjectVectorCallMethodKwBuilder.proto */ +#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000 +#define __Pyx_Object_VectorcallMethod_CallFromBuilder PyObject_VectorcallMethod +#else +static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames); +#endif + /* pop.proto */ static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L); -#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L); #define __Pyx_PyObject_Pop(L) (likely(PyList_CheckExact(L)) ?\ __Pyx_PyList_Pop(L) : __Pyx__PyObject_Pop(L)) @@ -2302,21 +2318,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L); #endif /* CallUnboundCMethod0.proto */ +CYTHON_UNUSED static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); #if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_CallUnboundCMethod0(cfunc, self)\ - (likely((cfunc)->func) ?\ - (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\ - (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\ - (PY_VERSION_HEX >= 0x030700A0 ?\ - (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\ - (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\ - (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\ - (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\ - (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\ - ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\ - __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\ - __Pyx__CallUnboundCMethod0(cfunc, self)) +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); #else #define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) #endif @@ -2332,6 +2337,12 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /* pep479.proto */ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); +/* IterNextPlain.proto */ +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 + /* IterNext.proto */ #define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL) static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *); @@ -2389,7 +2400,7 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ - (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) @@ -2408,11 +2419,11 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); /* py_dict_keys.proto */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d); -/* PyIntBinop.proto */ +/* PyLongBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else -#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ +#define __Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif @@ -2425,15 +2436,16 @@ static CYTHON_INLINE int __Pyx_PyObject_SetSlice( int has_cstart, int has_cstop, int wraparound); /* RaiseClosureNameError.proto */ -static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); +static void __Pyx_RaiseClosureNameError(const char *varname); /* RaiseUnboundLocalError.proto */ -static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); +static void __Pyx_RaiseUnboundLocalError(const char *varname); /* dict_getitem_default.proto */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); /* CallUnboundCMethod1.proto */ +CYTHON_UNUSED static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); @@ -2465,7 +2477,9 @@ static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyOb /* ListExtend.proto */ static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00a2 + return PyList_Extend(L, v); +#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 PyObject* none = _PyList_Extend((PyListObject*)L, v); if (unlikely(!none)) return -1; @@ -2490,27 +2504,21 @@ 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); -/* PyObject_GenericGetAttrNoDict.proto */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr -#endif - /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); -#if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); -#endif + +/* ListPack.proto */ +static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* SetNameInClass.proto */ -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON @@ -2536,28 +2544,33 @@ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj); /* CLineInTraceback.proto */ -#ifdef CYTHON_CLINE_IN_TRACEBACK -#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) -#else +#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 */ -#if !CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject __Pyx_CachedCodeObjectType; +#else +typedef PyCodeObject __Pyx_CachedCodeObjectType; +#endif typedef struct { - PyCodeObject* code_object; + __Pyx_CachedCodeObjectType* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_int_type accessor_count; + #endif }; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); -#endif +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -2569,26 +2582,30 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #endif /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" -static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 +#define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName #else +static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp); +#endif +#else // !LIMITED_API typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" -#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON @@ -2602,10 +2619,17 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) -#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) { + return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2); +} #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) +#ifdef PyExceptionInstance_Check + #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj) +#else + #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException) +#endif /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE @@ -2615,6 +2639,9 @@ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject * static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif +/* ReturnWithStopIteration.proto */ +static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext); + /* CoroutineBase.proto */ struct __pyx_CoroutineObject; typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); @@ -2635,11 +2662,16 @@ typedef struct __pyx_CoroutineObject { PyObject *gi_weakreflist; PyObject *classobj; PyObject *yieldfrom; + __Pyx_pyiter_sendfunc yieldfrom_am_send; PyObject *gi_name; PyObject *gi_qualname; PyObject *gi_modulename; PyObject *gi_code; PyObject *gi_frame; +#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE) + PyMonitoringState __pyx_pymonitoring_state[__Pyx_MonitoringEventTypes_CyGen_count]; + uint64_t __pyx_pymonitoring_version; +#endif int resume_label; char is_running; } __pyx_CoroutineObject; @@ -2651,8 +2683,9 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( PyObject *name, PyObject *qualname, PyObject *module_name); static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); static int __Pyx_Coroutine_clear(PyObject *self); +static __Pyx_PySendResult __Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval); static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); -static PyObject *__Pyx_Coroutine_Close(PyObject *self); +static __Pyx_PySendResult __Pyx_Coroutine_Close(PyObject *self, PyObject **retval); static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); #if CYTHON_USE_EXC_INFO_STACK #define __Pyx_Coroutine_SwapException(self) @@ -2676,29 +2709,76 @@ static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); #endif static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); - -/* PatchModuleWithCoroutine.proto */ -static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); - -/* PatchGeneratorABC.proto */ -static int __Pyx_patch_abc(void); +static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen); +static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen); +static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen); +static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure); +#if __PYX_HAS_PY_AM_SEND == 2 +static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send); +#endif /* Generator.proto */ #define __Pyx_Generator_USED -#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_GeneratorType) +#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_GeneratorType) #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ - __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) + __Pyx__Coroutine_New(__pyx_mstate_global->__pyx_GeneratorType, body, code, closure, name, qualname, module_name) static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(PyObject *module); +static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self); -/* CheckBinaryVersion.proto */ +/* 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); -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); +/* MultiPhaseInitModuleState.proto */ +#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE +static PyObject *__Pyx_State_FindModule(void*); +static int __Pyx_State_AddModule(PyObject* module, void*); +static int __Pyx_State_RemoveModule(void*); +#elif CYTHON_USE_MODULE_STATE +#define __Pyx_State_FindModule PyState_FindModule +#define __Pyx_State_AddModule PyState_AddModule +#define __Pyx_State_RemoveModule PyState_RemoveModule +#endif /* #### Code section: module_declarations ### */ +/* CythonABIVersion.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API + #if CYTHON_METH_FASTCALL + #define __PYX_FASTCALL_ABI_SUFFIX "_fastcall" + #else + #define __PYX_FASTCALL_ABI_SUFFIX + #endif + #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX +#else + #define __PYX_LIMITED_ABI_SUFFIX +#endif +#if __PYX_HAS_PY_AM_SEND == 1 + #define __PYX_AM_SEND_ABI_SUFFIX +#elif __PYX_HAS_PY_AM_SEND == 2 + #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport" +#else + #define __PYX_AM_SEND_ABI_SUFFIX "noamsend" +#endif +#ifndef __PYX_MONITORING_ABI_SUFFIX + #define __PYX_MONITORING_ABI_SUFFIX +#endif +#if CYTHON_USE_TP_FINALIZE + #define __PYX_TP_FINALIZE_ABI_SUFFIX +#else + #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize" +#endif +#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED) + #define __PYX_FREELISTS_ABI_SUFFIX +#else + #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists" +#endif +#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." + /* Module declarations from "constraint.solvers" */ /* #### Code section: typeinfo ### */ @@ -2717,14 +2797,17 @@ 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__6[] = "*"; -static const char __pyx_k__7[] = "."; +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__10[] = "_"; -static const char __pyx_k__61[] = "?"; +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"; @@ -2732,6 +2815,8 @@ 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"; @@ -2740,7 +2825,7 @@ 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_func[] = "__func__"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_item[] = "item"; static const char __pyx_k_iter[] = "iter"; @@ -2748,6 +2833,7 @@ 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"; @@ -2768,17 +2854,19 @@ 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_dict_2[] = "__dict__"; 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_import[] = "__import__"; +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"; @@ -2787,6 +2875,9 @@ 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"; @@ -2798,14 +2889,16 @@ 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"; @@ -2825,6 +2918,10 @@ 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"; @@ -2847,15 +2944,17 @@ 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_init_subclass[] = "__init_subclass__"; 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"; @@ -2887,6 +2986,8 @@ 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]]"; @@ -2894,6 +2995,7 @@ 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"; @@ -2902,16 +3004,26 @@ static const char __pyx_k_only_provides_all_solutions[] = " only provides all so 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 "; @@ -2979,13 +3091,19 @@ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_3_genexpr static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_4_is_valid(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, 0, 0, 0, 0}; -static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys = {0, 0, 0, 0, 0}; -static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_setdefault = {0, 0, 0, 0, 0}; -static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_copy = {0, 0, 0, 0, 0}; -static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop = {0, 0, 0, 0, 0}; /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ +/* SmallCodeConfig */ +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; @@ -3011,7 +3129,6 @@ typedef struct { #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif - #if CYTHON_USE_MODULE_STATE 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; @@ -3019,7 +3136,6 @@ typedef struct { PyObject *__pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_valid; PyObject *__pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr; PyObject *__pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr; - #endif PyTypeObject *__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter; PyTypeObject *__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter; PyTypeObject *__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList; @@ -3027,311 +3143,314 @@ typedef struct { PyTypeObject *__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid; PyTypeObject *__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr; PyTypeObject *__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr; - PyObject *__pyx_kp_s_Abstract_base_class_for_solvers; - PyObject *__pyx_n_s_BacktrackingSolver; - PyObject *__pyx_n_s_BacktrackingSolver___init; - PyObject *__pyx_n_s_BacktrackingSolver_getSolution; - PyObject *__pyx_n_s_BacktrackingSolver_getSolutionIt; - PyObject *__pyx_n_s_BacktrackingSolver_getSolutionIt_2; - PyObject *__pyx_n_s_BacktrackingSolver_getSolutions; - PyObject *__pyx_kp_u_Can_t_happen; - PyObject *__pyx_n_s_CompilableFunctionConstraint; - PyObject *__pyx_n_s_Constraint; - PyObject *__pyx_n_s_Domain; - PyObject *__pyx_n_s_FunctionConstraint; - PyObject *__pyx_n_s_FunctionType; - PyObject *__pyx_n_s_Hashable; - PyObject *__pyx_n_s_MinConflictsSolver; - PyObject *__pyx_n_s_MinConflictsSolver___init; - PyObject *__pyx_n_s_MinConflictsSolver_getSolution; - PyObject *__pyx_n_s_NotImplementedError; - PyObject *__pyx_n_s_OptimizedBacktrackingSolver; - PyObject *__pyx_n_s_OptimizedBacktrackingSolver___in; - PyObject *__pyx_n_s_OptimizedBacktrackingSolver_getS; - PyObject *__pyx_n_s_OptimizedBacktrackingSolver_getS_2; - PyObject *__pyx_n_s_OptimizedBacktrackingSolver_getS_3; - PyObject *__pyx_n_s_OptimizedBacktrackingSolver_getS_4; - PyObject *__pyx_n_s_OptimizedBacktrackingSolver_getS_5; - PyObject *__pyx_n_s_OptimizedBacktrackingSolver_getS_6; - PyObject *__pyx_n_s_ParallelSolver; - PyObject *__pyx_n_s_ParallelSolver___init; - PyObject *__pyx_n_s_ParallelSolver_getSolution; - PyObject *__pyx_n_s_ParallelSolver_getSolutions; - PyObject *__pyx_n_s_ParallelSolver_getSolutionsList; - PyObject *__pyx_n_s_ParallelSolver_getSolutionsList_2; - PyObject *__pyx_n_s_ParallelSolver_getSolutionsList_3; - PyObject *__pyx_kp_s_Problem_solver_based_on_the_mini; - PyObject *__pyx_kp_s_Problem_solver_that_executes_all; - PyObject *__pyx_kp_s_Problem_solver_with_backtracking; - PyObject *__pyx_kp_s_Problem_solver_with_backtracking_2; - PyObject *__pyx_n_s_ProcessPoolExecutor; - PyObject *__pyx_n_s_RecursiveBacktrackingSolver; - PyObject *__pyx_n_s_RecursiveBacktrackingSolver___in; - PyObject *__pyx_n_s_RecursiveBacktrackingSolver_getS; - PyObject *__pyx_n_s_RecursiveBacktrackingSolver_getS_2; - PyObject *__pyx_n_s_RecursiveBacktrackingSolver_recu; - PyObject *__pyx_n_s_RecursiveBacktrackingSolver_recu_2; - PyObject *__pyx_kp_s_Recursive_problem_solver_with_ba; - PyObject *__pyx_n_s_RuntimeError; - PyObject *__pyx_n_s_Solver; - PyObject *__pyx_n_s_Solver_getSolution; - PyObject *__pyx_n_s_Solver_getSolutionIter; - PyObject *__pyx_n_s_Solver_getSolutions; - PyObject *__pyx_n_s_StopIteration; - PyObject *__pyx_n_s_ThreadPoolExecutor; - PyObject *__pyx_n_s__10; - PyObject *__pyx_n_s__6; - PyObject *__pyx_n_s__61; - PyObject *__pyx_kp_u__7; - PyObject *__pyx_n_s_append; - PyObject *__pyx_n_s_arcconstraints; - PyObject *__pyx_n_s_arcs; - PyObject *__pyx_n_s_arcsvariable; - PyObject *__pyx_n_s_args; - PyObject *__pyx_n_s_assignment; - PyObject *__pyx_n_s_assignments; - PyObject *__pyx_n_s_asyncio_coroutines; - PyObject *__pyx_n_s_bool; - PyObject *__pyx_n_s_c; - PyObject *__pyx_n_s_check; - PyObject *__pyx_n_s_choice; - PyObject *__pyx_n_s_chunksize; - PyObject *__pyx_n_s_class; - PyObject *__pyx_n_s_class_getitem; - PyObject *__pyx_n_s_cline_in_traceback; - PyObject *__pyx_n_s_close; - PyObject *__pyx_n_s_co_consts; - PyObject *__pyx_n_s_code_object; - PyObject *__pyx_n_s_collections_abc; - PyObject *__pyx_n_s_compile; - PyObject *__pyx_n_s_compile_to_function; - PyObject *__pyx_n_s_concurrent_futures; - PyObject *__pyx_n_s_conflicted; - PyObject *__pyx_n_s_constraint; - PyObject *__pyx_n_s_constraint_constraints; - PyObject *__pyx_n_s_constraint_domain; - PyObject *__pyx_n_s_constraint_lookup; - PyObject *__pyx_n_s_constraint_solvers; - PyObject *__pyx_kp_s_constraint_solvers_py; - PyObject *__pyx_n_s_constraints; - PyObject *__pyx_n_s_constraints_lookup; - PyObject *__pyx_n_s_copy; - PyObject *__pyx_n_s_count; - PyObject *__pyx_n_s_dict; - PyObject *__pyx_n_s_dict_2; - PyObject *__pyx_kp_s_dict_Hashable_Domain; - PyObject *__pyx_kp_s_dict_Hashable_any; - PyObject *__pyx_kp_s_dict_Hashable_list_tuple_Constra; - PyObject *__pyx_kp_u_disable; - PyObject *__pyx_n_s_doArc8; - PyObject *__pyx_n_s_doc; - PyObject *__pyx_kp_u_doesn_t_provide_iteration; - PyObject *__pyx_n_s_domain; - PyObject *__pyx_n_s_domains; - PyObject *__pyx_kp_u_enable; - PyObject *__pyx_n_s_enter; - PyObject *__pyx_n_u_exec; - PyObject *__pyx_n_s_executor; - PyObject *__pyx_n_s_exit; - PyObject *__pyx_n_s_first_value; - PyObject *__pyx_n_s_first_var; - PyObject *__pyx_n_s_forwardcheck; - PyObject *__pyx_n_s_forwardcheck_2; - PyObject *__pyx_n_s_fromkeys; - PyObject *__pyx_n_s_func; - PyObject *__pyx_n_s_func_2; - PyObject *__pyx_n_s_func_string; - PyObject *__pyx_kp_u_gc; - PyObject *__pyx_n_s_genexpr; - PyObject *__pyx_n_s_get; - PyObject *__pyx_n_s_getArcs; - PyObject *__pyx_n_s_getSolution; - PyObject *__pyx_n_s_getSolutionIter; - PyObject *__pyx_n_s_getSolutions; - PyObject *__pyx_n_s_getSolutionsList; - PyObject *__pyx_n_s_getSortedVariables; - PyObject *__pyx_n_s_hideValue; - PyObject *__pyx_n_s_import; - PyObject *__pyx_n_s_init; - PyObject *__pyx_n_s_init_subclass; - PyObject *__pyx_n_s_initializing; - PyObject *__pyx_kp_u_is_an_abstract_class; - PyObject *__pyx_n_s_is_coroutine; - PyObject *__pyx_n_s_is_valid; - PyObject *__pyx_n_s_is_valid_locals_genexpr; - PyObject *__pyx_n_s_is_valid_locals_genexpr_locals_g; - PyObject *__pyx_kp_u_isenabled; - PyObject *__pyx_n_s_item; - PyObject *__pyx_n_s_items; - PyObject *__pyx_n_s_iter; - PyObject *__pyx_n_s_key; - PyObject *__pyx_n_s_keys; - PyObject *__pyx_n_s_list; - PyObject *__pyx_kp_s_list_Hashable; - PyObject *__pyx_kp_s_list_dict_Hashable_any; - PyObject *__pyx_kp_s_list_tuple; - PyObject *__pyx_kp_s_list_tuple_Constraint_Hashable; - PyObject *__pyx_n_s_local_assignment; - PyObject *__pyx_n_s_lst; - PyObject *__pyx_n_s_main; - PyObject *__pyx_n_s_map; - PyObject *__pyx_n_s_metaclass; - PyObject *__pyx_n_s_mincount; - PyObject *__pyx_n_s_minvalues; - PyObject *__pyx_n_s_module; - PyObject *__pyx_n_s_mro_entries; - PyObject *__pyx_n_s_msg; - PyObject *__pyx_n_s_name; - PyObject *__pyx_kp_u_only_provides_all_solutions; - PyObject *__pyx_n_s_otherdomain; - PyObject *__pyx_n_s_othervalue; - PyObject *__pyx_n_s_othervariable; - PyObject *__pyx_n_s_parallel_pool; - PyObject *__pyx_n_s_parallel_worker; - PyObject *__pyx_n_s_pop; - PyObject *__pyx_n_s_popState; - PyObject *__pyx_n_s_popitem; - PyObject *__pyx_n_s_prepare; - PyObject *__pyx_n_s_process_mode; - PyObject *__pyx_n_s_process_mode_2; - PyObject *__pyx_kp_u_provides_only_a_single_solution; - PyObject *__pyx_n_s_pushState; - PyObject *__pyx_n_s_pushdomains; - PyObject *__pyx_n_s_qualname; - PyObject *__pyx_n_s_queue; - PyObject *__pyx_n_s_rand; - PyObject *__pyx_n_s_rand_2; - PyObject *__pyx_n_s_random; - PyObject *__pyx_n_s_range; - PyObject *__pyx_n_s_recursiveBacktracking; - PyObject *__pyx_n_s_remaining_vars; - PyObject *__pyx_n_s_requires_pickling; - PyObject *__pyx_n_s_result; - PyObject *__pyx_n_s_results; - PyObject *__pyx_n_s_return; - PyObject *__pyx_n_s_self; - PyObject *__pyx_n_s_send; - PyObject *__pyx_n_s_sequential_optimized_backtrack; - PyObject *__pyx_n_s_sequential_recursive_backtrack; - PyObject *__pyx_n_s_set_name; - PyObject *__pyx_n_s_setdefault; - PyObject *__pyx_n_s_shuffle; - PyObject *__pyx_n_s_single; - PyObject *__pyx_n_s_solutions; - PyObject *__pyx_n_s_sort; - PyObject *__pyx_n_s_sorted; - PyObject *__pyx_n_s_sorted_variables; - PyObject *__pyx_n_s_sorted_vars; - PyObject *__pyx_n_s_spec; - PyObject *__pyx_n_s_steps; - PyObject *__pyx_n_s_steps_2; - PyObject *__pyx_kp_u_string; - PyObject *__pyx_n_s_super; - PyObject *__pyx_n_s_test; - PyObject *__pyx_n_s_throw; - PyObject *__pyx_kp_s_tuple_bool_dict_Hashable_Domain; - PyObject *__pyx_n_s_types; - PyObject *__pyx_n_s_unassigned_vars; - PyObject *__pyx_n_s_v; - PyObject *__pyx_n_s_vals; - PyObject *__pyx_n_s_value; - PyObject *__pyx_n_s_values; - PyObject *__pyx_n_s_var; - PyObject *__pyx_n_s_variable; - PyObject *__pyx_n_s_variable1; - PyObject *__pyx_n_s_variable2; - PyObject *__pyx_n_s_variables; - PyObject *__pyx_n_s_vconstraints; - PyObject *__pyx_n_s_x; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; + __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[218]; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_1000; - PyObject *__pyx_slice_; - PyObject *__pyx_tuple__3; - PyObject *__pyx_tuple__5; - PyObject *__pyx_tuple__8; - PyObject *__pyx_tuple__11; - PyObject *__pyx_tuple__13; - PyObject *__pyx_tuple__17; - PyObject *__pyx_tuple__19; - PyObject *__pyx_tuple__20; - PyObject *__pyx_tuple__21; - PyObject *__pyx_tuple__23; - PyObject *__pyx_tuple__26; - PyObject *__pyx_tuple__27; - PyObject *__pyx_tuple__31; - PyObject *__pyx_tuple__34; - PyObject *__pyx_tuple__36; - PyObject *__pyx_tuple__39; - PyObject *__pyx_tuple__41; - PyObject *__pyx_tuple__42; - PyObject *__pyx_tuple__44; - PyObject *__pyx_tuple__46; - PyObject *__pyx_tuple__48; - PyObject *__pyx_tuple__51; - PyObject *__pyx_tuple__53; - PyObject *__pyx_tuple__55; - PyObject *__pyx_tuple__57; - PyObject *__pyx_tuple__59; - PyObject *__pyx_codeobj__2; - PyObject *__pyx_codeobj__4; - PyObject *__pyx_codeobj__9; - PyObject *__pyx_codeobj__12; - PyObject *__pyx_codeobj__14; - PyObject *__pyx_codeobj__15; - PyObject *__pyx_codeobj__16; - PyObject *__pyx_codeobj__18; - PyObject *__pyx_codeobj__22; - PyObject *__pyx_codeobj__24; - PyObject *__pyx_codeobj__25; - PyObject *__pyx_codeobj__28; - PyObject *__pyx_codeobj__29; - PyObject *__pyx_codeobj__30; - PyObject *__pyx_codeobj__32; - PyObject *__pyx_codeobj__33; - PyObject *__pyx_codeobj__35; - PyObject *__pyx_codeobj__37; - PyObject *__pyx_codeobj__38; - PyObject *__pyx_codeobj__40; - PyObject *__pyx_codeobj__43; - PyObject *__pyx_codeobj__45; - PyObject *__pyx_codeobj__47; - PyObject *__pyx_codeobj__49; - PyObject *__pyx_codeobj__50; - PyObject *__pyx_codeobj__52; - PyObject *__pyx_codeobj__54; - PyObject *__pyx_codeobj__56; - PyObject *__pyx_codeobj__58; - PyObject *__pyx_codeobj__60; -} __pyx_mstate; +/* #### Code section: module_state_contents ### */ +/* CachedMethodType.module_state_decls */ +#if CYTHON_COMPILING_IN_LIMITED_API +PyObject *__Pyx_CachedMethodType; +#endif + +/* IterNextPlain.module_state_decls */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 +PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache; +#endif + + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter *__pyx_freelist_10constraint_7solvers___pyx_scope_struct__getSolutionIter[8]; +int __pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter[8]; +int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList[8]; +int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_3_genexpr[8]; +int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_3_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_4_is_valid[8]; +int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_4_is_valid; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_5_genexpr[8]; +int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_5_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_6_genexpr[8]; +int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_6_genexpr; +#endif +/* CodeObjectCache.module_state_decls */ +struct __Pyx_CodeObjectCache __pyx_code_cache; + +/* #### Code section: module_state_end ### */ +} __pyx_mstatetype; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { - extern struct PyModuleDef __pyx_moduledef; +extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif -#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) +#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef))) -#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) - -#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) +#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef)) #else -static __pyx_mstate __pyx_mstate_global_static = +static __pyx_mstatetype __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif -static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; -#endif +static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### 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_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] +#define __pyx_n_u_queue __pyx_string_tab[172] +#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_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_spec __pyx_string_tab[195] +#define __pyx_n_u_steps __pyx_string_tab[196] +#define __pyx_n_u_steps_2 __pyx_string_tab[197] +#define __pyx_kp_u_string __pyx_string_tab[198] +#define __pyx_n_u_super __pyx_string_tab[199] +#define __pyx_n_u_test __pyx_string_tab[200] +#define __pyx_n_u_throw __pyx_string_tab[201] +#define __pyx_kp_u_tuple_bool_dict_Hashable_Domain __pyx_string_tab[202] +#define __pyx_n_u_types __pyx_string_tab[203] +#define __pyx_n_u_unassigned_vars __pyx_string_tab[204] +#define __pyx_n_u_v __pyx_string_tab[205] +#define __pyx_n_u_val __pyx_string_tab[206] +#define __pyx_n_u_vals __pyx_string_tab[207] +#define __pyx_n_u_value __pyx_string_tab[208] +#define __pyx_n_u_values __pyx_string_tab[209] +#define __pyx_n_u_var __pyx_string_tab[210] +#define __pyx_n_u_variable __pyx_string_tab[211] +#define __pyx_n_u_variable1 __pyx_string_tab[212] +#define __pyx_n_u_variable2 __pyx_string_tab[213] +#define __pyx_n_u_variables __pyx_string_tab[214] +#define __pyx_n_u_vars_involved __pyx_string_tab[215] +#define __pyx_n_u_vconstraints __pyx_string_tab[216] +#define __pyx_n_u_x __pyx_string_tab[217] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE -static int __pyx_m_clear(PyObject *m) { - __pyx_mstate *clear_module_state = __pyx_mstate(m); +static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { + __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); @@ -3345,6 +3464,9 @@ static int __pyx_m_clear(PyObject *m) { #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif + #if CYTHON_PEP489_MULTI_PHASE_INIT + __Pyx_State_RemoveModule(NULL); + #endif Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter); Py_CLEAR(clear_module_state->__pyx_type_10constraint_7solvers___pyx_scope_struct__getSolutionIter); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter); @@ -3359,296 +3481,27 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr); - Py_CLEAR(clear_module_state->__pyx_kp_s_Abstract_base_class_for_solvers); - Py_CLEAR(clear_module_state->__pyx_n_s_BacktrackingSolver); - Py_CLEAR(clear_module_state->__pyx_n_s_BacktrackingSolver___init); - Py_CLEAR(clear_module_state->__pyx_n_s_BacktrackingSolver_getSolution); - Py_CLEAR(clear_module_state->__pyx_n_s_BacktrackingSolver_getSolutionIt); - Py_CLEAR(clear_module_state->__pyx_n_s_BacktrackingSolver_getSolutionIt_2); - Py_CLEAR(clear_module_state->__pyx_n_s_BacktrackingSolver_getSolutions); - Py_CLEAR(clear_module_state->__pyx_kp_u_Can_t_happen); - Py_CLEAR(clear_module_state->__pyx_n_s_CompilableFunctionConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_Constraint); - Py_CLEAR(clear_module_state->__pyx_n_s_Domain); - Py_CLEAR(clear_module_state->__pyx_n_s_FunctionConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_FunctionType); - Py_CLEAR(clear_module_state->__pyx_n_s_Hashable); - Py_CLEAR(clear_module_state->__pyx_n_s_MinConflictsSolver); - Py_CLEAR(clear_module_state->__pyx_n_s_MinConflictsSolver___init); - Py_CLEAR(clear_module_state->__pyx_n_s_MinConflictsSolver_getSolution); - Py_CLEAR(clear_module_state->__pyx_n_s_NotImplementedError); - Py_CLEAR(clear_module_state->__pyx_n_s_OptimizedBacktrackingSolver); - Py_CLEAR(clear_module_state->__pyx_n_s_OptimizedBacktrackingSolver___in); - Py_CLEAR(clear_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS); - Py_CLEAR(clear_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS_2); - Py_CLEAR(clear_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS_3); - Py_CLEAR(clear_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS_4); - Py_CLEAR(clear_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS_5); - Py_CLEAR(clear_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS_6); - Py_CLEAR(clear_module_state->__pyx_n_s_ParallelSolver); - Py_CLEAR(clear_module_state->__pyx_n_s_ParallelSolver___init); - Py_CLEAR(clear_module_state->__pyx_n_s_ParallelSolver_getSolution); - Py_CLEAR(clear_module_state->__pyx_n_s_ParallelSolver_getSolutions); - Py_CLEAR(clear_module_state->__pyx_n_s_ParallelSolver_getSolutionsList); - Py_CLEAR(clear_module_state->__pyx_n_s_ParallelSolver_getSolutionsList_2); - Py_CLEAR(clear_module_state->__pyx_n_s_ParallelSolver_getSolutionsList_3); - Py_CLEAR(clear_module_state->__pyx_kp_s_Problem_solver_based_on_the_mini); - Py_CLEAR(clear_module_state->__pyx_kp_s_Problem_solver_that_executes_all); - Py_CLEAR(clear_module_state->__pyx_kp_s_Problem_solver_with_backtracking); - Py_CLEAR(clear_module_state->__pyx_kp_s_Problem_solver_with_backtracking_2); - Py_CLEAR(clear_module_state->__pyx_n_s_ProcessPoolExecutor); - Py_CLEAR(clear_module_state->__pyx_n_s_RecursiveBacktrackingSolver); - Py_CLEAR(clear_module_state->__pyx_n_s_RecursiveBacktrackingSolver___in); - Py_CLEAR(clear_module_state->__pyx_n_s_RecursiveBacktrackingSolver_getS); - Py_CLEAR(clear_module_state->__pyx_n_s_RecursiveBacktrackingSolver_getS_2); - Py_CLEAR(clear_module_state->__pyx_n_s_RecursiveBacktrackingSolver_recu); - Py_CLEAR(clear_module_state->__pyx_n_s_RecursiveBacktrackingSolver_recu_2); - Py_CLEAR(clear_module_state->__pyx_kp_s_Recursive_problem_solver_with_ba); - Py_CLEAR(clear_module_state->__pyx_n_s_RuntimeError); - Py_CLEAR(clear_module_state->__pyx_n_s_Solver); - Py_CLEAR(clear_module_state->__pyx_n_s_Solver_getSolution); - Py_CLEAR(clear_module_state->__pyx_n_s_Solver_getSolutionIter); - Py_CLEAR(clear_module_state->__pyx_n_s_Solver_getSolutions); - Py_CLEAR(clear_module_state->__pyx_n_s_StopIteration); - Py_CLEAR(clear_module_state->__pyx_n_s_ThreadPoolExecutor); - Py_CLEAR(clear_module_state->__pyx_n_s__10); - Py_CLEAR(clear_module_state->__pyx_n_s__6); - Py_CLEAR(clear_module_state->__pyx_n_s__61); - Py_CLEAR(clear_module_state->__pyx_kp_u__7); - Py_CLEAR(clear_module_state->__pyx_n_s_append); - Py_CLEAR(clear_module_state->__pyx_n_s_arcconstraints); - Py_CLEAR(clear_module_state->__pyx_n_s_arcs); - Py_CLEAR(clear_module_state->__pyx_n_s_arcsvariable); - Py_CLEAR(clear_module_state->__pyx_n_s_args); - Py_CLEAR(clear_module_state->__pyx_n_s_assignment); - Py_CLEAR(clear_module_state->__pyx_n_s_assignments); - Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); - Py_CLEAR(clear_module_state->__pyx_n_s_bool); - Py_CLEAR(clear_module_state->__pyx_n_s_c); - Py_CLEAR(clear_module_state->__pyx_n_s_check); - Py_CLEAR(clear_module_state->__pyx_n_s_choice); - Py_CLEAR(clear_module_state->__pyx_n_s_chunksize); - Py_CLEAR(clear_module_state->__pyx_n_s_class); - Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); - Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); - Py_CLEAR(clear_module_state->__pyx_n_s_close); - Py_CLEAR(clear_module_state->__pyx_n_s_co_consts); - Py_CLEAR(clear_module_state->__pyx_n_s_code_object); - Py_CLEAR(clear_module_state->__pyx_n_s_collections_abc); - Py_CLEAR(clear_module_state->__pyx_n_s_compile); - Py_CLEAR(clear_module_state->__pyx_n_s_compile_to_function); - Py_CLEAR(clear_module_state->__pyx_n_s_concurrent_futures); - Py_CLEAR(clear_module_state->__pyx_n_s_conflicted); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_constraints); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_domain); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_lookup); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_solvers); - Py_CLEAR(clear_module_state->__pyx_kp_s_constraint_solvers_py); - Py_CLEAR(clear_module_state->__pyx_n_s_constraints); - Py_CLEAR(clear_module_state->__pyx_n_s_constraints_lookup); - Py_CLEAR(clear_module_state->__pyx_n_s_copy); - Py_CLEAR(clear_module_state->__pyx_n_s_count); - Py_CLEAR(clear_module_state->__pyx_n_s_dict); - Py_CLEAR(clear_module_state->__pyx_n_s_dict_2); - Py_CLEAR(clear_module_state->__pyx_kp_s_dict_Hashable_Domain); - Py_CLEAR(clear_module_state->__pyx_kp_s_dict_Hashable_any); - Py_CLEAR(clear_module_state->__pyx_kp_s_dict_Hashable_list_tuple_Constra); - Py_CLEAR(clear_module_state->__pyx_kp_u_disable); - Py_CLEAR(clear_module_state->__pyx_n_s_doArc8); - Py_CLEAR(clear_module_state->__pyx_n_s_doc); - Py_CLEAR(clear_module_state->__pyx_kp_u_doesn_t_provide_iteration); - Py_CLEAR(clear_module_state->__pyx_n_s_domain); - Py_CLEAR(clear_module_state->__pyx_n_s_domains); - Py_CLEAR(clear_module_state->__pyx_kp_u_enable); - Py_CLEAR(clear_module_state->__pyx_n_s_enter); - Py_CLEAR(clear_module_state->__pyx_n_u_exec); - Py_CLEAR(clear_module_state->__pyx_n_s_executor); - Py_CLEAR(clear_module_state->__pyx_n_s_exit); - Py_CLEAR(clear_module_state->__pyx_n_s_first_value); - Py_CLEAR(clear_module_state->__pyx_n_s_first_var); - Py_CLEAR(clear_module_state->__pyx_n_s_forwardcheck); - Py_CLEAR(clear_module_state->__pyx_n_s_forwardcheck_2); - Py_CLEAR(clear_module_state->__pyx_n_s_fromkeys); - Py_CLEAR(clear_module_state->__pyx_n_s_func); - Py_CLEAR(clear_module_state->__pyx_n_s_func_2); - Py_CLEAR(clear_module_state->__pyx_n_s_func_string); - Py_CLEAR(clear_module_state->__pyx_kp_u_gc); - Py_CLEAR(clear_module_state->__pyx_n_s_genexpr); - Py_CLEAR(clear_module_state->__pyx_n_s_get); - Py_CLEAR(clear_module_state->__pyx_n_s_getArcs); - Py_CLEAR(clear_module_state->__pyx_n_s_getSolution); - Py_CLEAR(clear_module_state->__pyx_n_s_getSolutionIter); - Py_CLEAR(clear_module_state->__pyx_n_s_getSolutions); - Py_CLEAR(clear_module_state->__pyx_n_s_getSolutionsList); - Py_CLEAR(clear_module_state->__pyx_n_s_getSortedVariables); - Py_CLEAR(clear_module_state->__pyx_n_s_hideValue); - Py_CLEAR(clear_module_state->__pyx_n_s_import); - Py_CLEAR(clear_module_state->__pyx_n_s_init); - Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); - Py_CLEAR(clear_module_state->__pyx_n_s_initializing); - Py_CLEAR(clear_module_state->__pyx_kp_u_is_an_abstract_class); - Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); - Py_CLEAR(clear_module_state->__pyx_n_s_is_valid); - Py_CLEAR(clear_module_state->__pyx_n_s_is_valid_locals_genexpr); - Py_CLEAR(clear_module_state->__pyx_n_s_is_valid_locals_genexpr_locals_g); - Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); - Py_CLEAR(clear_module_state->__pyx_n_s_item); - Py_CLEAR(clear_module_state->__pyx_n_s_items); - Py_CLEAR(clear_module_state->__pyx_n_s_iter); - Py_CLEAR(clear_module_state->__pyx_n_s_key); - Py_CLEAR(clear_module_state->__pyx_n_s_keys); - Py_CLEAR(clear_module_state->__pyx_n_s_list); - Py_CLEAR(clear_module_state->__pyx_kp_s_list_Hashable); - Py_CLEAR(clear_module_state->__pyx_kp_s_list_dict_Hashable_any); - Py_CLEAR(clear_module_state->__pyx_kp_s_list_tuple); - Py_CLEAR(clear_module_state->__pyx_kp_s_list_tuple_Constraint_Hashable); - Py_CLEAR(clear_module_state->__pyx_n_s_local_assignment); - Py_CLEAR(clear_module_state->__pyx_n_s_lst); - Py_CLEAR(clear_module_state->__pyx_n_s_main); - Py_CLEAR(clear_module_state->__pyx_n_s_map); - Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); - Py_CLEAR(clear_module_state->__pyx_n_s_mincount); - Py_CLEAR(clear_module_state->__pyx_n_s_minvalues); - Py_CLEAR(clear_module_state->__pyx_n_s_module); - Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); - Py_CLEAR(clear_module_state->__pyx_n_s_msg); - Py_CLEAR(clear_module_state->__pyx_n_s_name); - Py_CLEAR(clear_module_state->__pyx_kp_u_only_provides_all_solutions); - Py_CLEAR(clear_module_state->__pyx_n_s_otherdomain); - Py_CLEAR(clear_module_state->__pyx_n_s_othervalue); - Py_CLEAR(clear_module_state->__pyx_n_s_othervariable); - Py_CLEAR(clear_module_state->__pyx_n_s_parallel_pool); - Py_CLEAR(clear_module_state->__pyx_n_s_parallel_worker); - Py_CLEAR(clear_module_state->__pyx_n_s_pop); - Py_CLEAR(clear_module_state->__pyx_n_s_popState); - Py_CLEAR(clear_module_state->__pyx_n_s_popitem); - Py_CLEAR(clear_module_state->__pyx_n_s_prepare); - Py_CLEAR(clear_module_state->__pyx_n_s_process_mode); - Py_CLEAR(clear_module_state->__pyx_n_s_process_mode_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_provides_only_a_single_solution); - Py_CLEAR(clear_module_state->__pyx_n_s_pushState); - Py_CLEAR(clear_module_state->__pyx_n_s_pushdomains); - Py_CLEAR(clear_module_state->__pyx_n_s_qualname); - Py_CLEAR(clear_module_state->__pyx_n_s_queue); - Py_CLEAR(clear_module_state->__pyx_n_s_rand); - Py_CLEAR(clear_module_state->__pyx_n_s_rand_2); - Py_CLEAR(clear_module_state->__pyx_n_s_random); - Py_CLEAR(clear_module_state->__pyx_n_s_range); - Py_CLEAR(clear_module_state->__pyx_n_s_recursiveBacktracking); - Py_CLEAR(clear_module_state->__pyx_n_s_remaining_vars); - Py_CLEAR(clear_module_state->__pyx_n_s_requires_pickling); - Py_CLEAR(clear_module_state->__pyx_n_s_result); - Py_CLEAR(clear_module_state->__pyx_n_s_results); - Py_CLEAR(clear_module_state->__pyx_n_s_return); - Py_CLEAR(clear_module_state->__pyx_n_s_self); - Py_CLEAR(clear_module_state->__pyx_n_s_send); - Py_CLEAR(clear_module_state->__pyx_n_s_sequential_optimized_backtrack); - Py_CLEAR(clear_module_state->__pyx_n_s_sequential_recursive_backtrack); - Py_CLEAR(clear_module_state->__pyx_n_s_set_name); - Py_CLEAR(clear_module_state->__pyx_n_s_setdefault); - Py_CLEAR(clear_module_state->__pyx_n_s_shuffle); - Py_CLEAR(clear_module_state->__pyx_n_s_single); - Py_CLEAR(clear_module_state->__pyx_n_s_solutions); - Py_CLEAR(clear_module_state->__pyx_n_s_sort); - Py_CLEAR(clear_module_state->__pyx_n_s_sorted); - Py_CLEAR(clear_module_state->__pyx_n_s_sorted_variables); - Py_CLEAR(clear_module_state->__pyx_n_s_sorted_vars); - Py_CLEAR(clear_module_state->__pyx_n_s_spec); - Py_CLEAR(clear_module_state->__pyx_n_s_steps); - Py_CLEAR(clear_module_state->__pyx_n_s_steps_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_string); - Py_CLEAR(clear_module_state->__pyx_n_s_super); - Py_CLEAR(clear_module_state->__pyx_n_s_test); - Py_CLEAR(clear_module_state->__pyx_n_s_throw); - Py_CLEAR(clear_module_state->__pyx_kp_s_tuple_bool_dict_Hashable_Domain); - Py_CLEAR(clear_module_state->__pyx_n_s_types); - Py_CLEAR(clear_module_state->__pyx_n_s_unassigned_vars); - Py_CLEAR(clear_module_state->__pyx_n_s_v); - Py_CLEAR(clear_module_state->__pyx_n_s_vals); - Py_CLEAR(clear_module_state->__pyx_n_s_value); - Py_CLEAR(clear_module_state->__pyx_n_s_values); - Py_CLEAR(clear_module_state->__pyx_n_s_var); - Py_CLEAR(clear_module_state->__pyx_n_s_variable); - Py_CLEAR(clear_module_state->__pyx_n_s_variable1); - Py_CLEAR(clear_module_state->__pyx_n_s_variable2); - Py_CLEAR(clear_module_state->__pyx_n_s_variables); - Py_CLEAR(clear_module_state->__pyx_n_s_vconstraints); - Py_CLEAR(clear_module_state->__pyx_n_s_x); + 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<218; ++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); - Py_CLEAR(clear_module_state->__pyx_slice_); - Py_CLEAR(clear_module_state->__pyx_tuple__3); - Py_CLEAR(clear_module_state->__pyx_tuple__5); - Py_CLEAR(clear_module_state->__pyx_tuple__8); - Py_CLEAR(clear_module_state->__pyx_tuple__11); - Py_CLEAR(clear_module_state->__pyx_tuple__13); - Py_CLEAR(clear_module_state->__pyx_tuple__17); - Py_CLEAR(clear_module_state->__pyx_tuple__19); - Py_CLEAR(clear_module_state->__pyx_tuple__20); - Py_CLEAR(clear_module_state->__pyx_tuple__21); - Py_CLEAR(clear_module_state->__pyx_tuple__23); - Py_CLEAR(clear_module_state->__pyx_tuple__26); - Py_CLEAR(clear_module_state->__pyx_tuple__27); - Py_CLEAR(clear_module_state->__pyx_tuple__31); - Py_CLEAR(clear_module_state->__pyx_tuple__34); - Py_CLEAR(clear_module_state->__pyx_tuple__36); - Py_CLEAR(clear_module_state->__pyx_tuple__39); - Py_CLEAR(clear_module_state->__pyx_tuple__41); - Py_CLEAR(clear_module_state->__pyx_tuple__42); - Py_CLEAR(clear_module_state->__pyx_tuple__44); - Py_CLEAR(clear_module_state->__pyx_tuple__46); - Py_CLEAR(clear_module_state->__pyx_tuple__48); - Py_CLEAR(clear_module_state->__pyx_tuple__51); - Py_CLEAR(clear_module_state->__pyx_tuple__53); - Py_CLEAR(clear_module_state->__pyx_tuple__55); - Py_CLEAR(clear_module_state->__pyx_tuple__57); - Py_CLEAR(clear_module_state->__pyx_tuple__59); - Py_CLEAR(clear_module_state->__pyx_codeobj__2); - Py_CLEAR(clear_module_state->__pyx_codeobj__4); - Py_CLEAR(clear_module_state->__pyx_codeobj__9); - Py_CLEAR(clear_module_state->__pyx_codeobj__12); - Py_CLEAR(clear_module_state->__pyx_codeobj__14); - Py_CLEAR(clear_module_state->__pyx_codeobj__15); - Py_CLEAR(clear_module_state->__pyx_codeobj__16); - Py_CLEAR(clear_module_state->__pyx_codeobj__18); - Py_CLEAR(clear_module_state->__pyx_codeobj__22); - Py_CLEAR(clear_module_state->__pyx_codeobj__24); - Py_CLEAR(clear_module_state->__pyx_codeobj__25); - Py_CLEAR(clear_module_state->__pyx_codeobj__28); - Py_CLEAR(clear_module_state->__pyx_codeobj__29); - Py_CLEAR(clear_module_state->__pyx_codeobj__30); - Py_CLEAR(clear_module_state->__pyx_codeobj__32); - Py_CLEAR(clear_module_state->__pyx_codeobj__33); - Py_CLEAR(clear_module_state->__pyx_codeobj__35); - Py_CLEAR(clear_module_state->__pyx_codeobj__37); - Py_CLEAR(clear_module_state->__pyx_codeobj__38); - Py_CLEAR(clear_module_state->__pyx_codeobj__40); - Py_CLEAR(clear_module_state->__pyx_codeobj__43); - Py_CLEAR(clear_module_state->__pyx_codeobj__45); - Py_CLEAR(clear_module_state->__pyx_codeobj__47); - Py_CLEAR(clear_module_state->__pyx_codeobj__49); - Py_CLEAR(clear_module_state->__pyx_codeobj__50); - Py_CLEAR(clear_module_state->__pyx_codeobj__52); - Py_CLEAR(clear_module_state->__pyx_codeobj__54); - Py_CLEAR(clear_module_state->__pyx_codeobj__56); - Py_CLEAR(clear_module_state->__pyx_codeobj__58); - Py_CLEAR(clear_module_state->__pyx_codeobj__60); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE -static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { - __pyx_mstate *traverse_module_state = __pyx_mstate(m); +static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); - Py_VISIT(traverse_module_state->__pyx_empty_tuple); - Py_VISIT(traverse_module_state->__pyx_empty_bytes); - Py_VISIT(traverse_module_state->__pyx_empty_unicode); + __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 @@ -3669,602 +3522,16 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr); - Py_VISIT(traverse_module_state->__pyx_kp_s_Abstract_base_class_for_solvers); - Py_VISIT(traverse_module_state->__pyx_n_s_BacktrackingSolver); - Py_VISIT(traverse_module_state->__pyx_n_s_BacktrackingSolver___init); - Py_VISIT(traverse_module_state->__pyx_n_s_BacktrackingSolver_getSolution); - Py_VISIT(traverse_module_state->__pyx_n_s_BacktrackingSolver_getSolutionIt); - Py_VISIT(traverse_module_state->__pyx_n_s_BacktrackingSolver_getSolutionIt_2); - Py_VISIT(traverse_module_state->__pyx_n_s_BacktrackingSolver_getSolutions); - Py_VISIT(traverse_module_state->__pyx_kp_u_Can_t_happen); - Py_VISIT(traverse_module_state->__pyx_n_s_CompilableFunctionConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_Constraint); - Py_VISIT(traverse_module_state->__pyx_n_s_Domain); - Py_VISIT(traverse_module_state->__pyx_n_s_FunctionConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_FunctionType); - Py_VISIT(traverse_module_state->__pyx_n_s_Hashable); - Py_VISIT(traverse_module_state->__pyx_n_s_MinConflictsSolver); - Py_VISIT(traverse_module_state->__pyx_n_s_MinConflictsSolver___init); - Py_VISIT(traverse_module_state->__pyx_n_s_MinConflictsSolver_getSolution); - Py_VISIT(traverse_module_state->__pyx_n_s_NotImplementedError); - Py_VISIT(traverse_module_state->__pyx_n_s_OptimizedBacktrackingSolver); - Py_VISIT(traverse_module_state->__pyx_n_s_OptimizedBacktrackingSolver___in); - Py_VISIT(traverse_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS); - Py_VISIT(traverse_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS_2); - Py_VISIT(traverse_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS_3); - Py_VISIT(traverse_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS_4); - Py_VISIT(traverse_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS_5); - Py_VISIT(traverse_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS_6); - Py_VISIT(traverse_module_state->__pyx_n_s_ParallelSolver); - Py_VISIT(traverse_module_state->__pyx_n_s_ParallelSolver___init); - Py_VISIT(traverse_module_state->__pyx_n_s_ParallelSolver_getSolution); - Py_VISIT(traverse_module_state->__pyx_n_s_ParallelSolver_getSolutions); - Py_VISIT(traverse_module_state->__pyx_n_s_ParallelSolver_getSolutionsList); - Py_VISIT(traverse_module_state->__pyx_n_s_ParallelSolver_getSolutionsList_2); - Py_VISIT(traverse_module_state->__pyx_n_s_ParallelSolver_getSolutionsList_3); - Py_VISIT(traverse_module_state->__pyx_kp_s_Problem_solver_based_on_the_mini); - Py_VISIT(traverse_module_state->__pyx_kp_s_Problem_solver_that_executes_all); - Py_VISIT(traverse_module_state->__pyx_kp_s_Problem_solver_with_backtracking); - Py_VISIT(traverse_module_state->__pyx_kp_s_Problem_solver_with_backtracking_2); - Py_VISIT(traverse_module_state->__pyx_n_s_ProcessPoolExecutor); - Py_VISIT(traverse_module_state->__pyx_n_s_RecursiveBacktrackingSolver); - Py_VISIT(traverse_module_state->__pyx_n_s_RecursiveBacktrackingSolver___in); - Py_VISIT(traverse_module_state->__pyx_n_s_RecursiveBacktrackingSolver_getS); - Py_VISIT(traverse_module_state->__pyx_n_s_RecursiveBacktrackingSolver_getS_2); - Py_VISIT(traverse_module_state->__pyx_n_s_RecursiveBacktrackingSolver_recu); - Py_VISIT(traverse_module_state->__pyx_n_s_RecursiveBacktrackingSolver_recu_2); - Py_VISIT(traverse_module_state->__pyx_kp_s_Recursive_problem_solver_with_ba); - Py_VISIT(traverse_module_state->__pyx_n_s_RuntimeError); - Py_VISIT(traverse_module_state->__pyx_n_s_Solver); - Py_VISIT(traverse_module_state->__pyx_n_s_Solver_getSolution); - Py_VISIT(traverse_module_state->__pyx_n_s_Solver_getSolutionIter); - Py_VISIT(traverse_module_state->__pyx_n_s_Solver_getSolutions); - Py_VISIT(traverse_module_state->__pyx_n_s_StopIteration); - Py_VISIT(traverse_module_state->__pyx_n_s_ThreadPoolExecutor); - Py_VISIT(traverse_module_state->__pyx_n_s__10); - Py_VISIT(traverse_module_state->__pyx_n_s__6); - Py_VISIT(traverse_module_state->__pyx_n_s__61); - Py_VISIT(traverse_module_state->__pyx_kp_u__7); - Py_VISIT(traverse_module_state->__pyx_n_s_append); - Py_VISIT(traverse_module_state->__pyx_n_s_arcconstraints); - Py_VISIT(traverse_module_state->__pyx_n_s_arcs); - Py_VISIT(traverse_module_state->__pyx_n_s_arcsvariable); - Py_VISIT(traverse_module_state->__pyx_n_s_args); - Py_VISIT(traverse_module_state->__pyx_n_s_assignment); - Py_VISIT(traverse_module_state->__pyx_n_s_assignments); - Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); - Py_VISIT(traverse_module_state->__pyx_n_s_bool); - Py_VISIT(traverse_module_state->__pyx_n_s_c); - Py_VISIT(traverse_module_state->__pyx_n_s_check); - Py_VISIT(traverse_module_state->__pyx_n_s_choice); - Py_VISIT(traverse_module_state->__pyx_n_s_chunksize); - Py_VISIT(traverse_module_state->__pyx_n_s_class); - Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); - Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); - Py_VISIT(traverse_module_state->__pyx_n_s_close); - Py_VISIT(traverse_module_state->__pyx_n_s_co_consts); - Py_VISIT(traverse_module_state->__pyx_n_s_code_object); - Py_VISIT(traverse_module_state->__pyx_n_s_collections_abc); - Py_VISIT(traverse_module_state->__pyx_n_s_compile); - Py_VISIT(traverse_module_state->__pyx_n_s_compile_to_function); - Py_VISIT(traverse_module_state->__pyx_n_s_concurrent_futures); - Py_VISIT(traverse_module_state->__pyx_n_s_conflicted); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_constraints); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_domain); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_lookup); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_solvers); - Py_VISIT(traverse_module_state->__pyx_kp_s_constraint_solvers_py); - Py_VISIT(traverse_module_state->__pyx_n_s_constraints); - Py_VISIT(traverse_module_state->__pyx_n_s_constraints_lookup); - Py_VISIT(traverse_module_state->__pyx_n_s_copy); - Py_VISIT(traverse_module_state->__pyx_n_s_count); - Py_VISIT(traverse_module_state->__pyx_n_s_dict); - Py_VISIT(traverse_module_state->__pyx_n_s_dict_2); - Py_VISIT(traverse_module_state->__pyx_kp_s_dict_Hashable_Domain); - Py_VISIT(traverse_module_state->__pyx_kp_s_dict_Hashable_any); - Py_VISIT(traverse_module_state->__pyx_kp_s_dict_Hashable_list_tuple_Constra); - Py_VISIT(traverse_module_state->__pyx_kp_u_disable); - Py_VISIT(traverse_module_state->__pyx_n_s_doArc8); - Py_VISIT(traverse_module_state->__pyx_n_s_doc); - Py_VISIT(traverse_module_state->__pyx_kp_u_doesn_t_provide_iteration); - Py_VISIT(traverse_module_state->__pyx_n_s_domain); - Py_VISIT(traverse_module_state->__pyx_n_s_domains); - Py_VISIT(traverse_module_state->__pyx_kp_u_enable); - Py_VISIT(traverse_module_state->__pyx_n_s_enter); - Py_VISIT(traverse_module_state->__pyx_n_u_exec); - Py_VISIT(traverse_module_state->__pyx_n_s_executor); - Py_VISIT(traverse_module_state->__pyx_n_s_exit); - Py_VISIT(traverse_module_state->__pyx_n_s_first_value); - Py_VISIT(traverse_module_state->__pyx_n_s_first_var); - Py_VISIT(traverse_module_state->__pyx_n_s_forwardcheck); - Py_VISIT(traverse_module_state->__pyx_n_s_forwardcheck_2); - Py_VISIT(traverse_module_state->__pyx_n_s_fromkeys); - Py_VISIT(traverse_module_state->__pyx_n_s_func); - Py_VISIT(traverse_module_state->__pyx_n_s_func_2); - Py_VISIT(traverse_module_state->__pyx_n_s_func_string); - Py_VISIT(traverse_module_state->__pyx_kp_u_gc); - Py_VISIT(traverse_module_state->__pyx_n_s_genexpr); - Py_VISIT(traverse_module_state->__pyx_n_s_get); - Py_VISIT(traverse_module_state->__pyx_n_s_getArcs); - Py_VISIT(traverse_module_state->__pyx_n_s_getSolution); - Py_VISIT(traverse_module_state->__pyx_n_s_getSolutionIter); - Py_VISIT(traverse_module_state->__pyx_n_s_getSolutions); - Py_VISIT(traverse_module_state->__pyx_n_s_getSolutionsList); - Py_VISIT(traverse_module_state->__pyx_n_s_getSortedVariables); - Py_VISIT(traverse_module_state->__pyx_n_s_hideValue); - Py_VISIT(traverse_module_state->__pyx_n_s_import); - Py_VISIT(traverse_module_state->__pyx_n_s_init); - Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); - Py_VISIT(traverse_module_state->__pyx_n_s_initializing); - Py_VISIT(traverse_module_state->__pyx_kp_u_is_an_abstract_class); - Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); - Py_VISIT(traverse_module_state->__pyx_n_s_is_valid); - Py_VISIT(traverse_module_state->__pyx_n_s_is_valid_locals_genexpr); - Py_VISIT(traverse_module_state->__pyx_n_s_is_valid_locals_genexpr_locals_g); - Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); - Py_VISIT(traverse_module_state->__pyx_n_s_item); - Py_VISIT(traverse_module_state->__pyx_n_s_items); - Py_VISIT(traverse_module_state->__pyx_n_s_iter); - Py_VISIT(traverse_module_state->__pyx_n_s_key); - Py_VISIT(traverse_module_state->__pyx_n_s_keys); - Py_VISIT(traverse_module_state->__pyx_n_s_list); - Py_VISIT(traverse_module_state->__pyx_kp_s_list_Hashable); - Py_VISIT(traverse_module_state->__pyx_kp_s_list_dict_Hashable_any); - Py_VISIT(traverse_module_state->__pyx_kp_s_list_tuple); - Py_VISIT(traverse_module_state->__pyx_kp_s_list_tuple_Constraint_Hashable); - Py_VISIT(traverse_module_state->__pyx_n_s_local_assignment); - Py_VISIT(traverse_module_state->__pyx_n_s_lst); - Py_VISIT(traverse_module_state->__pyx_n_s_main); - Py_VISIT(traverse_module_state->__pyx_n_s_map); - Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); - Py_VISIT(traverse_module_state->__pyx_n_s_mincount); - Py_VISIT(traverse_module_state->__pyx_n_s_minvalues); - Py_VISIT(traverse_module_state->__pyx_n_s_module); - Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); - Py_VISIT(traverse_module_state->__pyx_n_s_msg); - Py_VISIT(traverse_module_state->__pyx_n_s_name); - Py_VISIT(traverse_module_state->__pyx_kp_u_only_provides_all_solutions); - Py_VISIT(traverse_module_state->__pyx_n_s_otherdomain); - Py_VISIT(traverse_module_state->__pyx_n_s_othervalue); - Py_VISIT(traverse_module_state->__pyx_n_s_othervariable); - Py_VISIT(traverse_module_state->__pyx_n_s_parallel_pool); - Py_VISIT(traverse_module_state->__pyx_n_s_parallel_worker); - Py_VISIT(traverse_module_state->__pyx_n_s_pop); - Py_VISIT(traverse_module_state->__pyx_n_s_popState); - Py_VISIT(traverse_module_state->__pyx_n_s_popitem); - Py_VISIT(traverse_module_state->__pyx_n_s_prepare); - Py_VISIT(traverse_module_state->__pyx_n_s_process_mode); - Py_VISIT(traverse_module_state->__pyx_n_s_process_mode_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_provides_only_a_single_solution); - Py_VISIT(traverse_module_state->__pyx_n_s_pushState); - Py_VISIT(traverse_module_state->__pyx_n_s_pushdomains); - Py_VISIT(traverse_module_state->__pyx_n_s_qualname); - Py_VISIT(traverse_module_state->__pyx_n_s_queue); - Py_VISIT(traverse_module_state->__pyx_n_s_rand); - Py_VISIT(traverse_module_state->__pyx_n_s_rand_2); - Py_VISIT(traverse_module_state->__pyx_n_s_random); - Py_VISIT(traverse_module_state->__pyx_n_s_range); - Py_VISIT(traverse_module_state->__pyx_n_s_recursiveBacktracking); - Py_VISIT(traverse_module_state->__pyx_n_s_remaining_vars); - Py_VISIT(traverse_module_state->__pyx_n_s_requires_pickling); - Py_VISIT(traverse_module_state->__pyx_n_s_result); - Py_VISIT(traverse_module_state->__pyx_n_s_results); - Py_VISIT(traverse_module_state->__pyx_n_s_return); - Py_VISIT(traverse_module_state->__pyx_n_s_self); - Py_VISIT(traverse_module_state->__pyx_n_s_send); - Py_VISIT(traverse_module_state->__pyx_n_s_sequential_optimized_backtrack); - Py_VISIT(traverse_module_state->__pyx_n_s_sequential_recursive_backtrack); - Py_VISIT(traverse_module_state->__pyx_n_s_set_name); - Py_VISIT(traverse_module_state->__pyx_n_s_setdefault); - Py_VISIT(traverse_module_state->__pyx_n_s_shuffle); - Py_VISIT(traverse_module_state->__pyx_n_s_single); - Py_VISIT(traverse_module_state->__pyx_n_s_solutions); - Py_VISIT(traverse_module_state->__pyx_n_s_sort); - Py_VISIT(traverse_module_state->__pyx_n_s_sorted); - Py_VISIT(traverse_module_state->__pyx_n_s_sorted_variables); - Py_VISIT(traverse_module_state->__pyx_n_s_sorted_vars); - Py_VISIT(traverse_module_state->__pyx_n_s_spec); - Py_VISIT(traverse_module_state->__pyx_n_s_steps); - Py_VISIT(traverse_module_state->__pyx_n_s_steps_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_string); - Py_VISIT(traverse_module_state->__pyx_n_s_super); - Py_VISIT(traverse_module_state->__pyx_n_s_test); - Py_VISIT(traverse_module_state->__pyx_n_s_throw); - Py_VISIT(traverse_module_state->__pyx_kp_s_tuple_bool_dict_Hashable_Domain); - Py_VISIT(traverse_module_state->__pyx_n_s_types); - Py_VISIT(traverse_module_state->__pyx_n_s_unassigned_vars); - Py_VISIT(traverse_module_state->__pyx_n_s_v); - Py_VISIT(traverse_module_state->__pyx_n_s_vals); - Py_VISIT(traverse_module_state->__pyx_n_s_value); - Py_VISIT(traverse_module_state->__pyx_n_s_values); - Py_VISIT(traverse_module_state->__pyx_n_s_var); - Py_VISIT(traverse_module_state->__pyx_n_s_variable); - Py_VISIT(traverse_module_state->__pyx_n_s_variable1); - Py_VISIT(traverse_module_state->__pyx_n_s_variable2); - Py_VISIT(traverse_module_state->__pyx_n_s_variables); - Py_VISIT(traverse_module_state->__pyx_n_s_vconstraints); - Py_VISIT(traverse_module_state->__pyx_n_s_x); - Py_VISIT(traverse_module_state->__pyx_int_0); - Py_VISIT(traverse_module_state->__pyx_int_1); - Py_VISIT(traverse_module_state->__pyx_int_1000); - Py_VISIT(traverse_module_state->__pyx_slice_); - Py_VISIT(traverse_module_state->__pyx_tuple__3); - Py_VISIT(traverse_module_state->__pyx_tuple__5); - Py_VISIT(traverse_module_state->__pyx_tuple__8); - Py_VISIT(traverse_module_state->__pyx_tuple__11); - Py_VISIT(traverse_module_state->__pyx_tuple__13); - Py_VISIT(traverse_module_state->__pyx_tuple__17); - Py_VISIT(traverse_module_state->__pyx_tuple__19); - Py_VISIT(traverse_module_state->__pyx_tuple__20); - Py_VISIT(traverse_module_state->__pyx_tuple__21); - Py_VISIT(traverse_module_state->__pyx_tuple__23); - Py_VISIT(traverse_module_state->__pyx_tuple__26); - Py_VISIT(traverse_module_state->__pyx_tuple__27); - Py_VISIT(traverse_module_state->__pyx_tuple__31); - Py_VISIT(traverse_module_state->__pyx_tuple__34); - Py_VISIT(traverse_module_state->__pyx_tuple__36); - Py_VISIT(traverse_module_state->__pyx_tuple__39); - Py_VISIT(traverse_module_state->__pyx_tuple__41); - Py_VISIT(traverse_module_state->__pyx_tuple__42); - Py_VISIT(traverse_module_state->__pyx_tuple__44); - Py_VISIT(traverse_module_state->__pyx_tuple__46); - Py_VISIT(traverse_module_state->__pyx_tuple__48); - Py_VISIT(traverse_module_state->__pyx_tuple__51); - Py_VISIT(traverse_module_state->__pyx_tuple__53); - Py_VISIT(traverse_module_state->__pyx_tuple__55); - Py_VISIT(traverse_module_state->__pyx_tuple__57); - Py_VISIT(traverse_module_state->__pyx_tuple__59); - Py_VISIT(traverse_module_state->__pyx_codeobj__2); - Py_VISIT(traverse_module_state->__pyx_codeobj__4); - Py_VISIT(traverse_module_state->__pyx_codeobj__9); - Py_VISIT(traverse_module_state->__pyx_codeobj__12); - Py_VISIT(traverse_module_state->__pyx_codeobj__14); - Py_VISIT(traverse_module_state->__pyx_codeobj__15); - Py_VISIT(traverse_module_state->__pyx_codeobj__16); - Py_VISIT(traverse_module_state->__pyx_codeobj__18); - Py_VISIT(traverse_module_state->__pyx_codeobj__22); - Py_VISIT(traverse_module_state->__pyx_codeobj__24); - Py_VISIT(traverse_module_state->__pyx_codeobj__25); - Py_VISIT(traverse_module_state->__pyx_codeobj__28); - Py_VISIT(traverse_module_state->__pyx_codeobj__29); - Py_VISIT(traverse_module_state->__pyx_codeobj__30); - Py_VISIT(traverse_module_state->__pyx_codeobj__32); - Py_VISIT(traverse_module_state->__pyx_codeobj__33); - Py_VISIT(traverse_module_state->__pyx_codeobj__35); - Py_VISIT(traverse_module_state->__pyx_codeobj__37); - Py_VISIT(traverse_module_state->__pyx_codeobj__38); - Py_VISIT(traverse_module_state->__pyx_codeobj__40); - Py_VISIT(traverse_module_state->__pyx_codeobj__43); - Py_VISIT(traverse_module_state->__pyx_codeobj__45); - Py_VISIT(traverse_module_state->__pyx_codeobj__47); - Py_VISIT(traverse_module_state->__pyx_codeobj__49); - Py_VISIT(traverse_module_state->__pyx_codeobj__50); - Py_VISIT(traverse_module_state->__pyx_codeobj__52); - Py_VISIT(traverse_module_state->__pyx_codeobj__54); - Py_VISIT(traverse_module_state->__pyx_codeobj__56); - Py_VISIT(traverse_module_state->__pyx_codeobj__58); - Py_VISIT(traverse_module_state->__pyx_codeobj__60); + 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<218; ++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; } #endif -/* #### Code section: module_state_defines ### */ -#define __pyx_d __pyx_mstate_global->__pyx_d -#define __pyx_b __pyx_mstate_global->__pyx_b -#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime -#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple -#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes -#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode -#ifdef __Pyx_CyFunction_USED -#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType -#endif -#ifdef __Pyx_FusedFunction_USED -#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType -#endif -#ifdef __Pyx_Generator_USED -#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType -#endif -#ifdef __Pyx_IterableCoroutine_USED -#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType -#endif -#if CYTHON_USE_MODULE_STATE -#define __pyx_type_10constraint_7solvers___pyx_scope_struct__getSolutionIter __pyx_mstate_global->__pyx_type_10constraint_7solvers___pyx_scope_struct__getSolutionIter -#define __pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter __pyx_mstate_global->__pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter -#define __pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList __pyx_mstate_global->__pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList -#define __pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexpr -#define __pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_valid __pyx_mstate_global->__pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_valid -#define __pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr __pyx_mstate_global->__pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr -#define __pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr __pyx_mstate_global->__pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr -#endif -#define __pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter -#define __pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter -#define __pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList -#define __pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr -#define __pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid -#define __pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr -#define __pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr -#define __pyx_kp_s_Abstract_base_class_for_solvers __pyx_mstate_global->__pyx_kp_s_Abstract_base_class_for_solvers -#define __pyx_n_s_BacktrackingSolver __pyx_mstate_global->__pyx_n_s_BacktrackingSolver -#define __pyx_n_s_BacktrackingSolver___init __pyx_mstate_global->__pyx_n_s_BacktrackingSolver___init -#define __pyx_n_s_BacktrackingSolver_getSolution __pyx_mstate_global->__pyx_n_s_BacktrackingSolver_getSolution -#define __pyx_n_s_BacktrackingSolver_getSolutionIt __pyx_mstate_global->__pyx_n_s_BacktrackingSolver_getSolutionIt -#define __pyx_n_s_BacktrackingSolver_getSolutionIt_2 __pyx_mstate_global->__pyx_n_s_BacktrackingSolver_getSolutionIt_2 -#define __pyx_n_s_BacktrackingSolver_getSolutions __pyx_mstate_global->__pyx_n_s_BacktrackingSolver_getSolutions -#define __pyx_kp_u_Can_t_happen __pyx_mstate_global->__pyx_kp_u_Can_t_happen -#define __pyx_n_s_CompilableFunctionConstraint __pyx_mstate_global->__pyx_n_s_CompilableFunctionConstraint -#define __pyx_n_s_Constraint __pyx_mstate_global->__pyx_n_s_Constraint -#define __pyx_n_s_Domain __pyx_mstate_global->__pyx_n_s_Domain -#define __pyx_n_s_FunctionConstraint __pyx_mstate_global->__pyx_n_s_FunctionConstraint -#define __pyx_n_s_FunctionType __pyx_mstate_global->__pyx_n_s_FunctionType -#define __pyx_n_s_Hashable __pyx_mstate_global->__pyx_n_s_Hashable -#define __pyx_n_s_MinConflictsSolver __pyx_mstate_global->__pyx_n_s_MinConflictsSolver -#define __pyx_n_s_MinConflictsSolver___init __pyx_mstate_global->__pyx_n_s_MinConflictsSolver___init -#define __pyx_n_s_MinConflictsSolver_getSolution __pyx_mstate_global->__pyx_n_s_MinConflictsSolver_getSolution -#define __pyx_n_s_NotImplementedError __pyx_mstate_global->__pyx_n_s_NotImplementedError -#define __pyx_n_s_OptimizedBacktrackingSolver __pyx_mstate_global->__pyx_n_s_OptimizedBacktrackingSolver -#define __pyx_n_s_OptimizedBacktrackingSolver___in __pyx_mstate_global->__pyx_n_s_OptimizedBacktrackingSolver___in -#define __pyx_n_s_OptimizedBacktrackingSolver_getS __pyx_mstate_global->__pyx_n_s_OptimizedBacktrackingSolver_getS -#define __pyx_n_s_OptimizedBacktrackingSolver_getS_2 __pyx_mstate_global->__pyx_n_s_OptimizedBacktrackingSolver_getS_2 -#define __pyx_n_s_OptimizedBacktrackingSolver_getS_3 __pyx_mstate_global->__pyx_n_s_OptimizedBacktrackingSolver_getS_3 -#define __pyx_n_s_OptimizedBacktrackingSolver_getS_4 __pyx_mstate_global->__pyx_n_s_OptimizedBacktrackingSolver_getS_4 -#define __pyx_n_s_OptimizedBacktrackingSolver_getS_5 __pyx_mstate_global->__pyx_n_s_OptimizedBacktrackingSolver_getS_5 -#define __pyx_n_s_OptimizedBacktrackingSolver_getS_6 __pyx_mstate_global->__pyx_n_s_OptimizedBacktrackingSolver_getS_6 -#define __pyx_n_s_ParallelSolver __pyx_mstate_global->__pyx_n_s_ParallelSolver -#define __pyx_n_s_ParallelSolver___init __pyx_mstate_global->__pyx_n_s_ParallelSolver___init -#define __pyx_n_s_ParallelSolver_getSolution __pyx_mstate_global->__pyx_n_s_ParallelSolver_getSolution -#define __pyx_n_s_ParallelSolver_getSolutions __pyx_mstate_global->__pyx_n_s_ParallelSolver_getSolutions -#define __pyx_n_s_ParallelSolver_getSolutionsList __pyx_mstate_global->__pyx_n_s_ParallelSolver_getSolutionsList -#define __pyx_n_s_ParallelSolver_getSolutionsList_2 __pyx_mstate_global->__pyx_n_s_ParallelSolver_getSolutionsList_2 -#define __pyx_n_s_ParallelSolver_getSolutionsList_3 __pyx_mstate_global->__pyx_n_s_ParallelSolver_getSolutionsList_3 -#define __pyx_kp_s_Problem_solver_based_on_the_mini __pyx_mstate_global->__pyx_kp_s_Problem_solver_based_on_the_mini -#define __pyx_kp_s_Problem_solver_that_executes_all __pyx_mstate_global->__pyx_kp_s_Problem_solver_that_executes_all -#define __pyx_kp_s_Problem_solver_with_backtracking __pyx_mstate_global->__pyx_kp_s_Problem_solver_with_backtracking -#define __pyx_kp_s_Problem_solver_with_backtracking_2 __pyx_mstate_global->__pyx_kp_s_Problem_solver_with_backtracking_2 -#define __pyx_n_s_ProcessPoolExecutor __pyx_mstate_global->__pyx_n_s_ProcessPoolExecutor -#define __pyx_n_s_RecursiveBacktrackingSolver __pyx_mstate_global->__pyx_n_s_RecursiveBacktrackingSolver -#define __pyx_n_s_RecursiveBacktrackingSolver___in __pyx_mstate_global->__pyx_n_s_RecursiveBacktrackingSolver___in -#define __pyx_n_s_RecursiveBacktrackingSolver_getS __pyx_mstate_global->__pyx_n_s_RecursiveBacktrackingSolver_getS -#define __pyx_n_s_RecursiveBacktrackingSolver_getS_2 __pyx_mstate_global->__pyx_n_s_RecursiveBacktrackingSolver_getS_2 -#define __pyx_n_s_RecursiveBacktrackingSolver_recu __pyx_mstate_global->__pyx_n_s_RecursiveBacktrackingSolver_recu -#define __pyx_n_s_RecursiveBacktrackingSolver_recu_2 __pyx_mstate_global->__pyx_n_s_RecursiveBacktrackingSolver_recu_2 -#define __pyx_kp_s_Recursive_problem_solver_with_ba __pyx_mstate_global->__pyx_kp_s_Recursive_problem_solver_with_ba -#define __pyx_n_s_RuntimeError __pyx_mstate_global->__pyx_n_s_RuntimeError -#define __pyx_n_s_Solver __pyx_mstate_global->__pyx_n_s_Solver -#define __pyx_n_s_Solver_getSolution __pyx_mstate_global->__pyx_n_s_Solver_getSolution -#define __pyx_n_s_Solver_getSolutionIter __pyx_mstate_global->__pyx_n_s_Solver_getSolutionIter -#define __pyx_n_s_Solver_getSolutions __pyx_mstate_global->__pyx_n_s_Solver_getSolutions -#define __pyx_n_s_StopIteration __pyx_mstate_global->__pyx_n_s_StopIteration -#define __pyx_n_s_ThreadPoolExecutor __pyx_mstate_global->__pyx_n_s_ThreadPoolExecutor -#define __pyx_n_s__10 __pyx_mstate_global->__pyx_n_s__10 -#define __pyx_n_s__6 __pyx_mstate_global->__pyx_n_s__6 -#define __pyx_n_s__61 __pyx_mstate_global->__pyx_n_s__61 -#define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7 -#define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append -#define __pyx_n_s_arcconstraints __pyx_mstate_global->__pyx_n_s_arcconstraints -#define __pyx_n_s_arcs __pyx_mstate_global->__pyx_n_s_arcs -#define __pyx_n_s_arcsvariable __pyx_mstate_global->__pyx_n_s_arcsvariable -#define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args -#define __pyx_n_s_assignment __pyx_mstate_global->__pyx_n_s_assignment -#define __pyx_n_s_assignments __pyx_mstate_global->__pyx_n_s_assignments -#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines -#define __pyx_n_s_bool __pyx_mstate_global->__pyx_n_s_bool -#define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c -#define __pyx_n_s_check __pyx_mstate_global->__pyx_n_s_check -#define __pyx_n_s_choice __pyx_mstate_global->__pyx_n_s_choice -#define __pyx_n_s_chunksize __pyx_mstate_global->__pyx_n_s_chunksize -#define __pyx_n_s_class __pyx_mstate_global->__pyx_n_s_class -#define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem -#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback -#define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close -#define __pyx_n_s_co_consts __pyx_mstate_global->__pyx_n_s_co_consts -#define __pyx_n_s_code_object __pyx_mstate_global->__pyx_n_s_code_object -#define __pyx_n_s_collections_abc __pyx_mstate_global->__pyx_n_s_collections_abc -#define __pyx_n_s_compile __pyx_mstate_global->__pyx_n_s_compile -#define __pyx_n_s_compile_to_function __pyx_mstate_global->__pyx_n_s_compile_to_function -#define __pyx_n_s_concurrent_futures __pyx_mstate_global->__pyx_n_s_concurrent_futures -#define __pyx_n_s_conflicted __pyx_mstate_global->__pyx_n_s_conflicted -#define __pyx_n_s_constraint __pyx_mstate_global->__pyx_n_s_constraint -#define __pyx_n_s_constraint_constraints __pyx_mstate_global->__pyx_n_s_constraint_constraints -#define __pyx_n_s_constraint_domain __pyx_mstate_global->__pyx_n_s_constraint_domain -#define __pyx_n_s_constraint_lookup __pyx_mstate_global->__pyx_n_s_constraint_lookup -#define __pyx_n_s_constraint_solvers __pyx_mstate_global->__pyx_n_s_constraint_solvers -#define __pyx_kp_s_constraint_solvers_py __pyx_mstate_global->__pyx_kp_s_constraint_solvers_py -#define __pyx_n_s_constraints __pyx_mstate_global->__pyx_n_s_constraints -#define __pyx_n_s_constraints_lookup __pyx_mstate_global->__pyx_n_s_constraints_lookup -#define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy -#define __pyx_n_s_count __pyx_mstate_global->__pyx_n_s_count -#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict -#define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2 -#define __pyx_kp_s_dict_Hashable_Domain __pyx_mstate_global->__pyx_kp_s_dict_Hashable_Domain -#define __pyx_kp_s_dict_Hashable_any __pyx_mstate_global->__pyx_kp_s_dict_Hashable_any -#define __pyx_kp_s_dict_Hashable_list_tuple_Constra __pyx_mstate_global->__pyx_kp_s_dict_Hashable_list_tuple_Constra -#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable -#define __pyx_n_s_doArc8 __pyx_mstate_global->__pyx_n_s_doArc8 -#define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc -#define __pyx_kp_u_doesn_t_provide_iteration __pyx_mstate_global->__pyx_kp_u_doesn_t_provide_iteration -#define __pyx_n_s_domain __pyx_mstate_global->__pyx_n_s_domain -#define __pyx_n_s_domains __pyx_mstate_global->__pyx_n_s_domains -#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable -#define __pyx_n_s_enter __pyx_mstate_global->__pyx_n_s_enter -#define __pyx_n_u_exec __pyx_mstate_global->__pyx_n_u_exec -#define __pyx_n_s_executor __pyx_mstate_global->__pyx_n_s_executor -#define __pyx_n_s_exit __pyx_mstate_global->__pyx_n_s_exit -#define __pyx_n_s_first_value __pyx_mstate_global->__pyx_n_s_first_value -#define __pyx_n_s_first_var __pyx_mstate_global->__pyx_n_s_first_var -#define __pyx_n_s_forwardcheck __pyx_mstate_global->__pyx_n_s_forwardcheck -#define __pyx_n_s_forwardcheck_2 __pyx_mstate_global->__pyx_n_s_forwardcheck_2 -#define __pyx_n_s_fromkeys __pyx_mstate_global->__pyx_n_s_fromkeys -#define __pyx_n_s_func __pyx_mstate_global->__pyx_n_s_func -#define __pyx_n_s_func_2 __pyx_mstate_global->__pyx_n_s_func_2 -#define __pyx_n_s_func_string __pyx_mstate_global->__pyx_n_s_func_string -#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc -#define __pyx_n_s_genexpr __pyx_mstate_global->__pyx_n_s_genexpr -#define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get -#define __pyx_n_s_getArcs __pyx_mstate_global->__pyx_n_s_getArcs -#define __pyx_n_s_getSolution __pyx_mstate_global->__pyx_n_s_getSolution -#define __pyx_n_s_getSolutionIter __pyx_mstate_global->__pyx_n_s_getSolutionIter -#define __pyx_n_s_getSolutions __pyx_mstate_global->__pyx_n_s_getSolutions -#define __pyx_n_s_getSolutionsList __pyx_mstate_global->__pyx_n_s_getSolutionsList -#define __pyx_n_s_getSortedVariables __pyx_mstate_global->__pyx_n_s_getSortedVariables -#define __pyx_n_s_hideValue __pyx_mstate_global->__pyx_n_s_hideValue -#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import -#define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init -#define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass -#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing -#define __pyx_kp_u_is_an_abstract_class __pyx_mstate_global->__pyx_kp_u_is_an_abstract_class -#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine -#define __pyx_n_s_is_valid __pyx_mstate_global->__pyx_n_s_is_valid -#define __pyx_n_s_is_valid_locals_genexpr __pyx_mstate_global->__pyx_n_s_is_valid_locals_genexpr -#define __pyx_n_s_is_valid_locals_genexpr_locals_g __pyx_mstate_global->__pyx_n_s_is_valid_locals_genexpr_locals_g -#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled -#define __pyx_n_s_item __pyx_mstate_global->__pyx_n_s_item -#define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items -#define __pyx_n_s_iter __pyx_mstate_global->__pyx_n_s_iter -#define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key -#define __pyx_n_s_keys __pyx_mstate_global->__pyx_n_s_keys -#define __pyx_n_s_list __pyx_mstate_global->__pyx_n_s_list -#define __pyx_kp_s_list_Hashable __pyx_mstate_global->__pyx_kp_s_list_Hashable -#define __pyx_kp_s_list_dict_Hashable_any __pyx_mstate_global->__pyx_kp_s_list_dict_Hashable_any -#define __pyx_kp_s_list_tuple __pyx_mstate_global->__pyx_kp_s_list_tuple -#define __pyx_kp_s_list_tuple_Constraint_Hashable __pyx_mstate_global->__pyx_kp_s_list_tuple_Constraint_Hashable -#define __pyx_n_s_local_assignment __pyx_mstate_global->__pyx_n_s_local_assignment -#define __pyx_n_s_lst __pyx_mstate_global->__pyx_n_s_lst -#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main -#define __pyx_n_s_map __pyx_mstate_global->__pyx_n_s_map -#define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass -#define __pyx_n_s_mincount __pyx_mstate_global->__pyx_n_s_mincount -#define __pyx_n_s_minvalues __pyx_mstate_global->__pyx_n_s_minvalues -#define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module -#define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries -#define __pyx_n_s_msg __pyx_mstate_global->__pyx_n_s_msg -#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name -#define __pyx_kp_u_only_provides_all_solutions __pyx_mstate_global->__pyx_kp_u_only_provides_all_solutions -#define __pyx_n_s_otherdomain __pyx_mstate_global->__pyx_n_s_otherdomain -#define __pyx_n_s_othervalue __pyx_mstate_global->__pyx_n_s_othervalue -#define __pyx_n_s_othervariable __pyx_mstate_global->__pyx_n_s_othervariable -#define __pyx_n_s_parallel_pool __pyx_mstate_global->__pyx_n_s_parallel_pool -#define __pyx_n_s_parallel_worker __pyx_mstate_global->__pyx_n_s_parallel_worker -#define __pyx_n_s_pop __pyx_mstate_global->__pyx_n_s_pop -#define __pyx_n_s_popState __pyx_mstate_global->__pyx_n_s_popState -#define __pyx_n_s_popitem __pyx_mstate_global->__pyx_n_s_popitem -#define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare -#define __pyx_n_s_process_mode __pyx_mstate_global->__pyx_n_s_process_mode -#define __pyx_n_s_process_mode_2 __pyx_mstate_global->__pyx_n_s_process_mode_2 -#define __pyx_kp_u_provides_only_a_single_solution __pyx_mstate_global->__pyx_kp_u_provides_only_a_single_solution -#define __pyx_n_s_pushState __pyx_mstate_global->__pyx_n_s_pushState -#define __pyx_n_s_pushdomains __pyx_mstate_global->__pyx_n_s_pushdomains -#define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname -#define __pyx_n_s_queue __pyx_mstate_global->__pyx_n_s_queue -#define __pyx_n_s_rand __pyx_mstate_global->__pyx_n_s_rand -#define __pyx_n_s_rand_2 __pyx_mstate_global->__pyx_n_s_rand_2 -#define __pyx_n_s_random __pyx_mstate_global->__pyx_n_s_random -#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range -#define __pyx_n_s_recursiveBacktracking __pyx_mstate_global->__pyx_n_s_recursiveBacktracking -#define __pyx_n_s_remaining_vars __pyx_mstate_global->__pyx_n_s_remaining_vars -#define __pyx_n_s_requires_pickling __pyx_mstate_global->__pyx_n_s_requires_pickling -#define __pyx_n_s_result __pyx_mstate_global->__pyx_n_s_result -#define __pyx_n_s_results __pyx_mstate_global->__pyx_n_s_results -#define __pyx_n_s_return __pyx_mstate_global->__pyx_n_s_return -#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self -#define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send -#define __pyx_n_s_sequential_optimized_backtrack __pyx_mstate_global->__pyx_n_s_sequential_optimized_backtrack -#define __pyx_n_s_sequential_recursive_backtrack __pyx_mstate_global->__pyx_n_s_sequential_recursive_backtrack -#define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name -#define __pyx_n_s_setdefault __pyx_mstate_global->__pyx_n_s_setdefault -#define __pyx_n_s_shuffle __pyx_mstate_global->__pyx_n_s_shuffle -#define __pyx_n_s_single __pyx_mstate_global->__pyx_n_s_single -#define __pyx_n_s_solutions __pyx_mstate_global->__pyx_n_s_solutions -#define __pyx_n_s_sort __pyx_mstate_global->__pyx_n_s_sort -#define __pyx_n_s_sorted __pyx_mstate_global->__pyx_n_s_sorted -#define __pyx_n_s_sorted_variables __pyx_mstate_global->__pyx_n_s_sorted_variables -#define __pyx_n_s_sorted_vars __pyx_mstate_global->__pyx_n_s_sorted_vars -#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec -#define __pyx_n_s_steps __pyx_mstate_global->__pyx_n_s_steps -#define __pyx_n_s_steps_2 __pyx_mstate_global->__pyx_n_s_steps_2 -#define __pyx_kp_u_string __pyx_mstate_global->__pyx_kp_u_string -#define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super -#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test -#define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw -#define __pyx_kp_s_tuple_bool_dict_Hashable_Domain __pyx_mstate_global->__pyx_kp_s_tuple_bool_dict_Hashable_Domain -#define __pyx_n_s_types __pyx_mstate_global->__pyx_n_s_types -#define __pyx_n_s_unassigned_vars __pyx_mstate_global->__pyx_n_s_unassigned_vars -#define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v -#define __pyx_n_s_vals __pyx_mstate_global->__pyx_n_s_vals -#define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value -#define __pyx_n_s_values __pyx_mstate_global->__pyx_n_s_values -#define __pyx_n_s_var __pyx_mstate_global->__pyx_n_s_var -#define __pyx_n_s_variable __pyx_mstate_global->__pyx_n_s_variable -#define __pyx_n_s_variable1 __pyx_mstate_global->__pyx_n_s_variable1 -#define __pyx_n_s_variable2 __pyx_mstate_global->__pyx_n_s_variable2 -#define __pyx_n_s_variables __pyx_mstate_global->__pyx_n_s_variables -#define __pyx_n_s_vconstraints __pyx_mstate_global->__pyx_n_s_vconstraints -#define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x -#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 -#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 -#define __pyx_int_1000 __pyx_mstate_global->__pyx_int_1000 -#define __pyx_slice_ __pyx_mstate_global->__pyx_slice_ -#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 -#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 -#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 -#define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 -#define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 -#define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 -#define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 -#define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 -#define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 -#define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 -#define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 -#define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 -#define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 -#define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34 -#define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36 -#define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39 -#define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41 -#define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42 -#define __pyx_tuple__44 __pyx_mstate_global->__pyx_tuple__44 -#define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46 -#define __pyx_tuple__48 __pyx_mstate_global->__pyx_tuple__48 -#define __pyx_tuple__51 __pyx_mstate_global->__pyx_tuple__51 -#define __pyx_tuple__53 __pyx_mstate_global->__pyx_tuple__53 -#define __pyx_tuple__55 __pyx_mstate_global->__pyx_tuple__55 -#define __pyx_tuple__57 __pyx_mstate_global->__pyx_tuple__57 -#define __pyx_tuple__59 __pyx_mstate_global->__pyx_tuple__59 -#define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2 -#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 -#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 -#define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 -#define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 -#define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 -#define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 -#define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 -#define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 -#define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 -#define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 -#define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 -#define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 -#define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 -#define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 -#define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 -#define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 -#define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37 -#define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 -#define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40 -#define __pyx_codeobj__43 __pyx_mstate_global->__pyx_codeobj__43 -#define __pyx_codeobj__45 __pyx_mstate_global->__pyx_codeobj__45 -#define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47 -#define __pyx_codeobj__49 __pyx_mstate_global->__pyx_codeobj__49 -#define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50 -#define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52 -#define __pyx_codeobj__54 __pyx_mstate_global->__pyx_codeobj__54 -#define __pyx_codeobj__56 __pyx_mstate_global->__pyx_codeobj__56 -#define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58 -#define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60 /* #### Code section: module_code ### */ /* "constraint/solvers.py":13 @@ -4273,7 +3540,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { * def getArcs(domains: dict, constraints: list[tuple]) -> dict: # <<<<<<<<<<<<<< * """Return a dictionary mapping pairs (arcs) of constrained variables. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_1getArcs(PyObject *__pyx_self, @@ -4284,7 +3551,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7solvers_getArcs, "Return a dictionary mapping pairs (arcs) of constrained variables.\n\n @attention: Currently unused.\n "); -static PyMethodDef __pyx_mdef_10constraint_7solvers_1getArcs = {"getArcs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_1getArcs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_getArcs}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_1getArcs = {"getArcs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_1getArcs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_getArcs}; static PyObject *__pyx_pw_10constraint_7solvers_1getArcs(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4306,7 +3573,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getArcs (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -4314,46 +3581,34 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_domains,&__pyx_n_s_constraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 13, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 13, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 13, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 13, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getArcs", 1, 2, 2, 1); __PYX_ERR(0, 13, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getArcs") < 0)) __PYX_ERR(0, 13, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 13, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 13, __pyx_L3_error) } __pyx_v_domains = ((PyObject*)values[0]); __pyx_v_constraints = ((PyObject*)values[1]); @@ -4364,31 +3619,30 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.getArcs", __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", 1))) __PYX_ERR(0, 13, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 13, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 13, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 13, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_getArcs(__pyx_self, __pyx_v_domains, __pyx_v_constraints); /* 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -4411,12 +3665,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * Py_ssize_t __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; - unsigned int __pyx_t_10; + size_t __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getArcs", 1); + __Pyx_RefNannySetupContext("getArcs", 0); /* "constraint/solvers.py":18 * @attention: Currently unused. @@ -4424,7 +3678,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * arcs = {} # <<<<<<<<<<<<<< * for x in constraints: * constraint, variables = x - */ +*/ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arcs = ((PyObject*)__pyx_t_1); @@ -4436,23 +3690,21 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * for x in constraints: # <<<<<<<<<<<<<< * constraint, variables = x * if len(variables) == 2: - */ +*/ __pyx_t_1 = __pyx_v_constraints; __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 19, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 19, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + ++__pyx_t_2; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - #endif __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3); __pyx_t_3 = 0; @@ -4462,7 +3714,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * constraint, variables = x # <<<<<<<<<<<<<< * if len(variables) == 2: * variable1, variable2 = variables - */ +*/ if ((likely(PyTuple_CheckExact(__pyx_v_x))) || (PyList_CheckExact(__pyx_v_x))) { PyObject* sequence = __pyx_v_x; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); @@ -4473,25 +3725,29 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __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 = PyList_GET_ITEM(sequence, 0); - __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + 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); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; __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; @@ -4518,7 +3774,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * if len(variables) == 2: # <<<<<<<<<<<<<< * variable1, variable2 = variables * arcs.setdefault(variable1, {}).setdefault(variable2, []).append(x) - */ +*/ __pyx_t_7 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 21, __pyx_L1_error) __pyx_t_8 = (__pyx_t_7 == 2); if (__pyx_t_8) { @@ -4529,7 +3785,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * variable1, variable2 = variables # <<<<<<<<<<<<<< * arcs.setdefault(variable1, {}).setdefault(variable2, []).append(x) * arcs.setdefault(variable2, {}).setdefault(variable1, []).append(x) - */ +*/ if ((likely(PyTuple_CheckExact(__pyx_v_variables))) || (PyList_CheckExact(__pyx_v_variables))) { PyObject* sequence = __pyx_v_variables; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); @@ -4540,25 +3796,29 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = 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_4 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); + 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); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); } - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 22, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __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; @@ -4585,39 +3845,25 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * arcs.setdefault(variable1, {}).setdefault(variable2, []).append(x) # <<<<<<<<<<<<<< * arcs.setdefault(variable2, {}).setdefault(variable1, []).append(x) * return arcs - */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyDict_SetDefault(__pyx_v_arcs, __pyx_v_variable1, __pyx_t_4, -1L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 23, __pyx_L1_error) +*/ + __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_setdefault); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __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_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __pyx_t_9; + __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = NULL; __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_10 = 1; - } - } - #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_variable2, __pyx_t_5}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_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; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_11 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_x); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4628,39 +3874,25 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * arcs.setdefault(variable2, {}).setdefault(variable1, []).append(x) # <<<<<<<<<<<<<< * return arcs * - */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 24, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyDict_SetDefault(__pyx_v_arcs, __pyx_v_variable2, __pyx_t_4, -1L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 24, __pyx_L1_error) +*/ + __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_setdefault); 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, -1L); 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; + __Pyx_INCREF(__pyx_t_9); __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = NULL; __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_10 = 1; - } - } - #endif { PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_variable1, __pyx_t_5}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); + __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_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; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_11 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_x); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4671,7 +3903,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * if len(variables) == 2: # <<<<<<<<<<<<<< * variable1, variable2 = variables * arcs.setdefault(variable1, {}).setdefault(variable2, []).append(x) - */ +*/ } /* "constraint/solvers.py":19 @@ -4680,7 +3912,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * for x in constraints: # <<<<<<<<<<<<<< * constraint, variables = x * if len(variables) == 2: - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4690,7 +3922,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * return arcs # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_arcs); __pyx_r = __pyx_v_arcs; @@ -4702,7 +3934,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * def getArcs(domains: dict, constraints: list[tuple]) -> dict: # <<<<<<<<<<<<<< * """Return a dictionary mapping pairs (arcs) of constrained variables. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -4731,7 +3963,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * def doArc8(arcs: dict, domains: dict, assignments: dict) -> bool: # <<<<<<<<<<<<<< * """Perform the ARC-8 arc checking algorithm and prune domains. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_3doArc8(PyObject *__pyx_self, @@ -4742,7 +3974,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7solvers_2doArc8, "Perform the ARC-8 arc checking algorithm and prune domains.\n\n @attention: Currently unused.\n "); -static PyMethodDef __pyx_mdef_10constraint_7solvers_3doArc8 = {"doArc8", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_3doArc8, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_2doArc8}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_3doArc8 = {"doArc8", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_3doArc8, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_2doArc8}; static PyObject *__pyx_pw_10constraint_7solvers_3doArc8(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4765,7 +3997,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("doArc8 (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -4773,59 +4005,40 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arcs,&__pyx_n_s_domains,&__pyx_n_s_assignments,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 28, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 28, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 28, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_arcs)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("doArc8", 1, 3, 3, 1); __PYX_ERR(0, 28, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("doArc8", 1, 3, 3, 2); __PYX_ERR(0, 28, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "doArc8") < 0)) __PYX_ERR(0, 28, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 28, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 28, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 28, __pyx_L3_error) } __pyx_v_arcs = ((PyObject*)values[0]); __pyx_v_domains = ((PyObject*)values[1]); @@ -4837,32 +4050,31 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.doArc8", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arcs), (&PyDict_Type), 0, "arcs", 1))) __PYX_ERR(0, 28, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 28, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 28, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arcs), (&PyDict_Type), 0, "arcs", 2))) __PYX_ERR(0, 28, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 28, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 28, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_2doArc8(__pyx_self, __pyx_v_arcs, __pyx_v_domains, __pyx_v_assignments); /* 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -4884,9 +4096,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; - int __pyx_t_5; + size_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; @@ -4905,7 +4117,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("doArc8", 1); + __Pyx_RefNannySetupContext("doArc8", 0); /* "constraint/solvers.py":33 * @attention: Currently unused. @@ -4913,30 +4125,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * check = dict.fromkeys(domains, True) # <<<<<<<<<<<<<< * while check: * variable, _ = check.popitem() - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyDict_Type)), __pyx_n_s_fromkeys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + __pyx_t_2 = ((PyObject *)(&PyDict_Type)); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_domains, Py_True}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __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_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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_check = __pyx_t_1; __pyx_t_1 = 0; @@ -4947,10 +4145,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * while check: # <<<<<<<<<<<<<< * variable, _ = check.popitem() * if variable not in arcs or variable in assignments: - */ +*/ while (1) { - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_check); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 34, __pyx_L1_error) - if (!__pyx_t_5) break; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_check); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 34, __pyx_L1_error) + if (!__pyx_t_4) break; /* "constraint/solvers.py":35 * check = dict.fromkeys(domains, True) @@ -4958,30 +4156,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * variable, _ = check.popitem() # <<<<<<<<<<<<<< * if variable not in arcs or variable in assignments: * continue - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_check, __pyx_n_s_popitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + __pyx_t_2 = __pyx_v_check; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __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_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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; @@ -4993,19 +4177,23 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_5); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + 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); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_5); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { @@ -5013,11 +4201,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); + 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) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -5031,8 +4219,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_5); + __pyx_t_5 = 0; /* "constraint/solvers.py":36 * while check: @@ -5040,17 +4228,17 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if variable not in arcs or variable in assignments: # <<<<<<<<<<<<<< * continue * domain = domains[variable] - */ +*/ __pyx_t_8 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_arcs, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 36, __pyx_L1_error) if (!__pyx_t_8) { } else { - __pyx_t_5 = __pyx_t_8; + __pyx_t_4 = __pyx_t_8; goto __pyx_L8_bool_binop_done; } __pyx_t_8 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 36, __pyx_L1_error) - __pyx_t_5 = __pyx_t_8; + __pyx_t_4 = __pyx_t_8; __pyx_L8_bool_binop_done:; - if (__pyx_t_5) { + if (__pyx_t_4) { /* "constraint/solvers.py":37 * variable, _ = check.popitem() @@ -5058,7 +4246,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * continue # <<<<<<<<<<<<<< * domain = domains[variable] * arcsvariable = arcs[variable] - */ +*/ goto __pyx_L3_continue; /* "constraint/solvers.py":36 @@ -5067,7 +4255,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if variable not in arcs or variable in assignments: # <<<<<<<<<<<<<< * continue * domain = domains[variable] - */ +*/ } /* "constraint/solvers.py":38 @@ -5076,7 +4264,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * domain = domains[variable] # <<<<<<<<<<<<<< * arcsvariable = arcs[variable] * for othervariable in arcsvariable: - */ +*/ __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); @@ -5088,7 +4276,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * arcsvariable = arcs[variable] # <<<<<<<<<<<<<< * for othervariable in arcsvariable: * arcconstraints = arcsvariable[othervariable] - */ +*/ __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_arcs, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_arcsvariable, __pyx_t_1); @@ -5100,7 +4288,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * for othervariable in arcsvariable: # <<<<<<<<<<<<<< * arcconstraints = arcsvariable[othervariable] * if othervariable in assignments: - */ +*/ if (likely(PyList_CheckExact(__pyx_v_arcsvariable)) || PyTuple_CheckExact(__pyx_v_arcsvariable)) { __pyx_t_1 = __pyx_v_arcsvariable; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0; @@ -5108,53 +4296,50 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * } else { __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_arcsvariable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 40, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_10)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 40, __pyx_L1_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 40, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif + __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_9); + ++__pyx_t_9; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 40, __pyx_L1_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_9); #endif + ++__pyx_t_9; } + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 40, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_10(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { + __pyx_t_5 = __pyx_t_10(__pyx_t_1); + if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 40, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 40, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_3); } - __Pyx_XDECREF_SET(__pyx_v_othervariable, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_othervariable, __pyx_t_5); + __pyx_t_5 = 0; /* "constraint/solvers.py":41 * arcsvariable = arcs[variable] @@ -5162,11 +4347,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * arcconstraints = arcsvariable[othervariable] # <<<<<<<<<<<<<< * if othervariable in assignments: * otherdomain = [assignments[othervariable]] - */ - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_arcsvariable, __pyx_v_othervariable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_arcconstraints, __pyx_t_3); - __pyx_t_3 = 0; +*/ + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_arcsvariable, __pyx_v_othervariable); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_arcconstraints, __pyx_t_5); + __pyx_t_5 = 0; /* "constraint/solvers.py":42 * for othervariable in arcsvariable: @@ -5174,9 +4359,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if othervariable in assignments: # <<<<<<<<<<<<<< * otherdomain = [assignments[othervariable]] * else: - */ - __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_othervariable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 42, __pyx_L1_error) - if (__pyx_t_5) { +*/ + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_othervariable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 42, __pyx_L1_error) + if (__pyx_t_4) { /* "constraint/solvers.py":43 * arcconstraints = arcsvariable[othervariable] @@ -5184,14 +4369,14 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * otherdomain = [assignments[othervariable]] # <<<<<<<<<<<<<< * else: * otherdomain = domains[othervariable] - */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_othervariable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); +*/ + __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_othervariable); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error); - __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 43, __pyx_L1_error); + __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_otherdomain, __pyx_t_2); __pyx_t_2 = 0; @@ -5201,7 +4386,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if othervariable in assignments: # <<<<<<<<<<<<<< * otherdomain = [assignments[othervariable]] * else: - */ +*/ goto __pyx_L12; } @@ -5211,7 +4396,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * otherdomain = domains[othervariable] # <<<<<<<<<<<<<< * if domain: * # changed = False - */ +*/ /*else*/ { __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_othervariable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -5226,9 +4411,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if domain: # <<<<<<<<<<<<<< * # changed = False * for value in domain[:]: - */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 46, __pyx_L1_error) - if (__pyx_t_5) { +*/ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 46, __pyx_L1_error) + if (__pyx_t_4) { /* "constraint/solvers.py":48 * if domain: @@ -5236,62 +4421,59 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * for value in domain[:]: # <<<<<<<<<<<<<< * assignments[variable] = value * if otherdomain: - */ - __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __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, 48, __pyx_L1_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_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 48, __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, 48, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_5))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 48, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 48, __pyx_L1_error) - #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_11); + ++__pyx_t_11; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 48, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_11)); #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_11); #endif + ++__pyx_t_11; } + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) } else { - __pyx_t_2 = __pyx_t_12(__pyx_t_3); + __pyx_t_2 = __pyx_t_12(__pyx_t_5); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 48, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 48, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_2); } + __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_2); __pyx_t_2 = 0; @@ -5301,7 +4483,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * assignments[variable] = value # <<<<<<<<<<<<<< * if otherdomain: * for othervalue in otherdomain: - */ +*/ if (unlikely((PyDict_SetItem(__pyx_v_assignments, __pyx_v_variable, __pyx_v_value) < 0))) __PYX_ERR(0, 49, __pyx_L1_error) /* "constraint/solvers.py":50 @@ -5310,9 +4492,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if otherdomain: # <<<<<<<<<<<<<< * for othervalue in otherdomain: * assignments[othervariable] = othervalue - */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_otherdomain); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 50, __pyx_L1_error) - if (__pyx_t_5) { +*/ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_otherdomain); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 50, __pyx_L1_error) + if (__pyx_t_4) { /* "constraint/solvers.py":51 * assignments[variable] = value @@ -5320,7 +4502,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * for othervalue in otherdomain: # <<<<<<<<<<<<<< * assignments[othervariable] = othervalue * for constraint, variables in arcconstraints: - */ +*/ if (likely(PyList_CheckExact(__pyx_v_otherdomain)) || PyTuple_CheckExact(__pyx_v_otherdomain)) { __pyx_t_2 = __pyx_v_otherdomain; __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = 0; @@ -5328,51 +4510,48 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * } else { __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_otherdomain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 51, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_14)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 51, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 51, __pyx_L1_error) - #else - __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 51, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - #endif + __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_13); + ++__pyx_t_13; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 51, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13)); #else - __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 51, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); #endif + ++__pyx_t_13; } + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 51, __pyx_L1_error) } else { __pyx_t_6 = __pyx_t_14(__pyx_t_2); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 51, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 51, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_6); } + __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_othervalue, __pyx_t_6); __pyx_t_6 = 0; @@ -5382,7 +4561,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * assignments[othervariable] = othervalue # <<<<<<<<<<<<<< * for constraint, variables in arcconstraints: * if not constraint(variables, domains, assignments, True): - */ +*/ if (unlikely((PyDict_SetItem(__pyx_v_assignments, __pyx_v_othervariable, __pyx_v_othervalue) < 0))) __PYX_ERR(0, 52, __pyx_L1_error) /* "constraint/solvers.py":53 @@ -5391,7 +4570,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * for constraint, variables in arcconstraints: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, True): * break - */ +*/ if (likely(PyList_CheckExact(__pyx_v_arcconstraints)) || PyTuple_CheckExact(__pyx_v_arcconstraints)) { __pyx_t_6 = __pyx_v_arcconstraints; __Pyx_INCREF(__pyx_t_6); __pyx_t_15 = 0; @@ -5399,51 +4578,48 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * } else { __pyx_t_15 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_arcconstraints); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_16 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 53, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_16)) { if (likely(PyList_CheckExact(__pyx_t_6))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 53, __pyx_L1_error) #endif if (__pyx_t_15 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_17 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_15); __Pyx_INCREF(__pyx_t_17); __pyx_t_15++; if (unlikely((0 < 0))) __PYX_ERR(0, 53, __pyx_L1_error) - #else - __pyx_t_17 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_17); - #endif + __pyx_t_17 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_15); + ++__pyx_t_15; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 53, __pyx_L1_error) #endif if (__pyx_t_15 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_17 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_15); __Pyx_INCREF(__pyx_t_17); __pyx_t_15++; if (unlikely((0 < 0))) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_17 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_15)); #else - __pyx_t_17 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_17); + __pyx_t_17 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_15); #endif + ++__pyx_t_15; } + if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 53, __pyx_L1_error) } else { __pyx_t_17 = __pyx_t_16(__pyx_t_6); if (unlikely(!__pyx_t_17)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 53, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 53, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_17); } + __Pyx_GOTREF(__pyx_t_17); if ((likely(PyTuple_CheckExact(__pyx_t_17))) || (PyList_CheckExact(__pyx_t_17))) { PyObject* sequence = __pyx_t_17; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); @@ -5454,18 +4630,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_18 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_19 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_18 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_18); + __pyx_t_19 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_19); } else { - __pyx_t_18 = PyList_GET_ITEM(sequence, 0); - __pyx_t_19 = PyList_GET_ITEM(sequence, 1); + __pyx_t_18 = __Pyx_PyList_GetItemRef(sequence, 0); + 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); + if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_19); } - __Pyx_INCREF(__pyx_t_18); - __Pyx_INCREF(__pyx_t_19); #else - __pyx_t_18 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_18 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); - __pyx_t_19 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_19 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); #endif __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; @@ -5474,7 +4654,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * __pyx_t_20 = PyObject_GetIter(__pyx_t_17); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_20); + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_20); index = 0; __pyx_t_18 = __pyx_t_7(__pyx_t_20); if (unlikely(!__pyx_t_18)) goto __pyx_L21_unpacking_failed; __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; @@ -5501,33 +4681,33 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if not constraint(variables, domains, assignments, True): # <<<<<<<<<<<<<< * break * else: - */ +*/ + __pyx_t_19 = NULL; __Pyx_INCREF(__pyx_v_constraint); - __pyx_t_19 = __pyx_v_constraint; __pyx_t_18 = NULL; - __pyx_t_4 = 0; + __pyx_t_18 = __pyx_v_constraint; + __pyx_t_3 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_19))) { - __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_19); - if (likely(__pyx_t_18)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); - __Pyx_INCREF(__pyx_t_18); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_19, function); - __pyx_t_4 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_18))) { + __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_18); + assert(__pyx_t_19); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_18); + __Pyx_INCREF(__pyx_t_19); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_18, __pyx__function); + __pyx_t_3 = 0; } #endif { - PyObject *__pyx_callargs[5] = {__pyx_t_18, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, Py_True}; - __pyx_t_17 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; + 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_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) __Pyx_GOTREF(__pyx_t_17); - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_8 = (!__pyx_t_5); + __pyx_t_8 = (!__pyx_t_4); if (__pyx_t_8) { /* "constraint/solvers.py":55 @@ -5536,7 +4716,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * break # <<<<<<<<<<<<<< * else: * # All constraints passed. Value is safe. - */ +*/ goto __pyx_L20_break; /* "constraint/solvers.py":54 @@ -5545,7 +4725,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if not constraint(variables, domains, assignments, True): # <<<<<<<<<<<<<< * break * else: - */ +*/ } /* "constraint/solvers.py":53 @@ -5554,7 +4734,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * for constraint, variables in arcconstraints: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, True): * break - */ +*/ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L24_for_else; @@ -5570,7 +4750,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * break # <<<<<<<<<<<<<< * else: * # All othervalues failed. Kill value. - */ +*/ goto __pyx_L18_break; } __pyx_L25_for_end:; @@ -5581,7 +4761,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * for othervalue in otherdomain: # <<<<<<<<<<<<<< * assignments[othervariable] = othervalue * for constraint, variables in arcconstraints: - */ +*/ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L26_for_else; @@ -5597,30 +4777,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * domain.hideValue(value) # <<<<<<<<<<<<<< * # changed = True * del assignments[othervariable] - */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 61, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_17 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_17)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_17); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + __pyx_t_6 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_6); + __pyx_t_3 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_v_value}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 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_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); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -5632,7 +4798,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * del assignments[othervariable] # <<<<<<<<<<<<<< * del assignments[variable] * # if changed: - */ +*/ if (unlikely((PyDict_DelItem(__pyx_v_assignments, __pyx_v_othervariable) < 0))) __PYX_ERR(0, 63, __pyx_L1_error) /* "constraint/solvers.py":50 @@ -5641,7 +4807,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if otherdomain: # <<<<<<<<<<<<<< * for othervalue in otherdomain: * assignments[othervariable] = othervalue - */ +*/ } /* "constraint/solvers.py":48 @@ -5650,9 +4816,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * for value in domain[:]: # <<<<<<<<<<<<<< * assignments[variable] = value * if otherdomain: - */ +*/ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/solvers.py":64 * # changed = True @@ -5660,7 +4826,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * del assignments[variable] # <<<<<<<<<<<<<< * # if changed: * # check.update(dict.fromkeys(arcsvariable)) - */ +*/ if (unlikely((PyDict_DelItem(__pyx_v_assignments, __pyx_v_variable) < 0))) __PYX_ERR(0, 64, __pyx_L1_error) /* "constraint/solvers.py":46 @@ -5669,7 +4835,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if domain: # <<<<<<<<<<<<<< * # changed = False * for value in domain[:]: - */ +*/ } /* "constraint/solvers.py":67 @@ -5678,10 +4844,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if not domain: # <<<<<<<<<<<<<< * return False * return True - */ +*/ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 67, __pyx_L1_error) - __pyx_t_5 = (!__pyx_t_8); - if (__pyx_t_5) { + __pyx_t_4 = (!__pyx_t_8); + if (__pyx_t_4) { /* "constraint/solvers.py":68 * # check.update(dict.fromkeys(arcsvariable)) @@ -5689,7 +4855,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * return False # <<<<<<<<<<<<<< * return True * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -5702,7 +4868,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if not domain: # <<<<<<<<<<<<<< * return False * return True - */ +*/ } /* "constraint/solvers.py":40 @@ -5711,7 +4877,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * for othervariable in arcsvariable: # <<<<<<<<<<<<<< * arcconstraints = arcsvariable[othervariable] * if othervariable in assignments: - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_L3_continue:; @@ -5723,7 +4889,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * return True # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; @@ -5735,13 +4901,13 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * def doArc8(arcs: dict, domains: dict, assignments: dict) -> bool: # <<<<<<<<<<<<<< * """Perform the ARC-8 arc checking algorithm and prune domains. * - */ +*/ /* 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_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_17); __Pyx_XDECREF(__pyx_t_18); @@ -5773,7 +4939,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Return one solution for the given problem. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_6Solver_1getSolution(PyObject *__pyx_self, @@ -5784,7 +4950,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7solvers_6Solver_getSolution, "Return one solution for the given problem.\n\n Args:\n domains (dict): Dictionary mapping variables to their domains\n constraints (list): List of pairs of (constraint, variables)\n vconstraints (dict): Dictionary mapping variables to a list\n of constraints affecting the given variables.\n "); -static PyMethodDef __pyx_mdef_10constraint_7solvers_6Solver_1getSolution = {"getSolution", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_6Solver_1getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_6Solver_getSolution}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_6Solver_1getSolution = {"getSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_6Solver_1getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_6Solver_getSolution}; static PyObject *__pyx_pw_10constraint_7solvers_6Solver_1getSolution(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -5808,7 +4974,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -5816,72 +4982,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 77, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 77, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 77, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 77, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, 1); __PYX_ERR(0, 77, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, 2); __PYX_ERR(0, 77, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, 3); __PYX_ERR(0, 77, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolution") < 0)) __PYX_ERR(0, 77, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 77, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 77, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 77, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 77, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_domains = ((PyObject*)values[1]); @@ -5894,32 +5034,31 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.Solver.getSolution", __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", 1))) __PYX_ERR(0, 77, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 77, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 77, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 77, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 77, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 77, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_6Solver_getSolution(__pyx_self, __pyx_v_self, __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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -5930,10 +5069,12 @@ 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; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolution", 1); + __Pyx_RefNannySetupContext("getSolution", 0); /* "constraint/solvers.py":86 * of constraints affecting the given variables. @@ -5941,16 +5082,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_getSolution(CYTHON_UNUSE * msg = f"{self.__class__.__name__} is an abstract class" # <<<<<<<<<<<<<< * raise NotImplementedError(msg) * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); 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_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) + __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_kp_u_is_an_abstract_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_2); @@ -5962,9 +5103,19 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_getSolution(CYTHON_UNUSE * raise NotImplementedError(msg) # <<<<<<<<<<<<<< * * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): - */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_v_msg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); +*/ + __pyx_t_1 = NULL; + __Pyx_INCREF(__pyx_builtin_NotImplementedError); + __pyx_t_3 = __pyx_builtin_NotImplementedError; + __pyx_t_4 = 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_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); + } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 87, __pyx_L1_error) @@ -5975,12 +5126,13 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_getSolution(CYTHON_UNUSE * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Return one solution for the given problem. * - */ +*/ /* function exit code */ __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); @@ -5995,7 +5147,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_getSolution(CYTHON_UNUSE * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Return all solutions for the given problem. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_6Solver_3getSolutions(PyObject *__pyx_self, @@ -6006,7 +5158,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7solvers_6Solver_2getSolutions, "Return all solutions for the given problem.\n\n Args:\n domains (dict): Dictionary mapping variables to domains\n constraints (list): List of pairs of (constraint, variables)\n vconstraints (dict): Dictionary mapping variables to a list\n of constraints affecting the given variables.\n "); -static PyMethodDef __pyx_mdef_10constraint_7solvers_6Solver_3getSolutions = {"getSolutions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_6Solver_3getSolutions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_6Solver_2getSolutions}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_6Solver_3getSolutions = {"getSolutions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_6Solver_3getSolutions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_6Solver_2getSolutions}; static PyObject *__pyx_pw_10constraint_7solvers_6Solver_3getSolutions(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -6030,7 +5182,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutions (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -6038,72 +5190,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 89, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 89, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 89, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 89, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 4, 4, 1); __PYX_ERR(0, 89, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 4, 4, 2); __PYX_ERR(0, 89, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 4, 4, 3); __PYX_ERR(0, 89, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutions") < 0)) __PYX_ERR(0, 89, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 89, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 89, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 89, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 89, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_domains = ((PyObject*)values[1]); @@ -6116,32 +5242,31 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.Solver.getSolutions", __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", 1))) __PYX_ERR(0, 89, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 89, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 89, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 89, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 89, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 89, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_6Solver_2getSolutions(__pyx_self, __pyx_v_self, __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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -6152,10 +5277,12 @@ 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; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolutions", 1); + __Pyx_RefNannySetupContext("getSolutions", 0); /* "constraint/solvers.py":98 * of constraints affecting the given variables. @@ -6163,16 +5290,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_2getSolutions(CYTHON_UNU * msg = f"{self.__class__.__name__} provides only a single solution" # <<<<<<<<<<<<<< * raise NotImplementedError(msg) * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); 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_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __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_kp_u_provides_only_a_single_solution); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_2); @@ -6184,9 +5311,19 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_2getSolutions(CYTHON_UNU * raise NotImplementedError(msg) # <<<<<<<<<<<<<< * * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): - */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_v_msg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); +*/ + __pyx_t_1 = NULL; + __Pyx_INCREF(__pyx_builtin_NotImplementedError); + __pyx_t_3 = __pyx_builtin_NotImplementedError; + __pyx_t_4 = 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_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); + } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 99, __pyx_L1_error) @@ -6197,12 +5334,13 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_2getSolutions(CYTHON_UNU * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Return all solutions for the given problem. * - */ +*/ /* function exit code */ __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); @@ -6217,7 +5355,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_2getSolutions(CYTHON_UNU * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Return an iterator for the solutions of the given problem. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_6Solver_5getSolutionIter(PyObject *__pyx_self, @@ -6228,7 +5366,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7solvers_6Solver_4getSolutionIter, "Return an iterator for the solutions of the given problem.\n\n Args:\n domains (dict): Dictionary mapping variables to domains\n constraints (list): List of pairs of (constraint, variables)\n vconstraints (dict): Dictionary mapping variables to a list\n of constraints affecting the given variables.\n "); -static PyMethodDef __pyx_mdef_10constraint_7solvers_6Solver_5getSolutionIter = {"getSolutionIter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_6Solver_5getSolutionIter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_6Solver_4getSolutionIter}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_6Solver_5getSolutionIter = {"getSolutionIter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_6Solver_5getSolutionIter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_6Solver_4getSolutionIter}; static PyObject *__pyx_pw_10constraint_7solvers_6Solver_5getSolutionIter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -6252,7 +5390,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionIter (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -6260,72 +5398,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 101, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 101, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 101, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 101, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutionIter", 1, 4, 4, 1); __PYX_ERR(0, 101, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutionIter", 1, 4, 4, 2); __PYX_ERR(0, 101, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutionIter", 1, 4, 4, 3); __PYX_ERR(0, 101, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutionIter") < 0)) __PYX_ERR(0, 101, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 101, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 101, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 101, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 101, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_domains = ((PyObject*)values[1]); @@ -6338,32 +5450,31 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.Solver.getSolutionIter", __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", 1))) __PYX_ERR(0, 101, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 101, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 101, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 101, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 101, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 101, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_6Solver_4getSolutionIter(__pyx_self, __pyx_v_self, __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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -6374,10 +5485,12 @@ 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; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolutionIter", 1); + __Pyx_RefNannySetupContext("getSolutionIter", 0); /* "constraint/solvers.py":110 * of constraints affecting the given variables. @@ -6385,16 +5498,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_4getSolutionIter(CYTHON_ * msg = f"{self.__class__.__name__} doesn't provide iteration" # <<<<<<<<<<<<<< * raise NotImplementedError(msg) * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); 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_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) + __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_kp_u_doesn_t_provide_iteration); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_2); @@ -6406,9 +5519,19 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_4getSolutionIter(CYTHON_ * raise NotImplementedError(msg) # <<<<<<<<<<<<<< * * - */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_v_msg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); +*/ + __pyx_t_1 = NULL; + __Pyx_INCREF(__pyx_builtin_NotImplementedError); + __pyx_t_3 = __pyx_builtin_NotImplementedError; + __pyx_t_4 = 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_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); + } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 111, __pyx_L1_error) @@ -6419,12 +5542,13 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_4getSolutionIter(CYTHON_ * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Return an iterator for the solutions of the given problem. * - */ +*/ /* function exit code */ __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); @@ -6439,7 +5563,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_4getSolutionIter(CYTHON_ * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_18BacktrackingSolver_1__init__(PyObject *__pyx_self, @@ -6450,7 +5574,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7solvers_18BacktrackingSolver___init__, "Initialization method.\n\n Args:\n forwardcheck (bool): If false forward checking will not be\n requested to constraints while looking for solutions\n (default is true)\n "); -static PyMethodDef __pyx_mdef_10constraint_7solvers_18BacktrackingSolver_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_18BacktrackingSolver_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_18BacktrackingSolver___init__}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_18BacktrackingSolver_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_18BacktrackingSolver_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_18BacktrackingSolver___init__}; static PyObject *__pyx_pw_10constraint_7solvers_18BacktrackingSolver_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -6472,7 +5596,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -6480,47 +5604,41 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_forwardcheck,0}; - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 143, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 143, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 143, __pyx_L3_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 (!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) } } } else { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 143, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 143, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } + if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); } __pyx_v_self = values[0]; __pyx_v_forwardcheck = values[1]; @@ -6531,11 +5649,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.BacktrackingSolver.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6544,11 +5659,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_7solvers_18BacktrackingSolver___init__(__pyx_self, __pyx_v_self, __pyx_v_forwardcheck); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -6560,7 +5672,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver___init__(CY int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/solvers.py":151 * (default is true) @@ -6568,8 +5680,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver___init__(CY * self._forwardcheck = forwardcheck # <<<<<<<<<<<<<< * * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_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 * """ @@ -6577,7 +5689,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver___init__(CY * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -6598,7 +5710,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * forwardcheck = self._forwardcheck * assignments = {} - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_18BacktrackingSolver_3getSolutionIter(PyObject *__pyx_self, @@ -6608,7 +5720,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_7solvers_18BacktrackingSolver_3getSolutionIter = {"getSolutionIter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_18BacktrackingSolver_3getSolutionIter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_18BacktrackingSolver_3getSolutionIter = {"getSolutionIter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_18BacktrackingSolver_3getSolutionIter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_7solvers_18BacktrackingSolver_3getSolutionIter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -6632,7 +5744,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionIter (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -6640,72 +5752,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 153, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 153, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 153, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 153, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 153, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 153, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutionIter", 1, 4, 4, 1); __PYX_ERR(0, 153, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 153, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutionIter", 1, 4, 4, 2); __PYX_ERR(0, 153, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 153, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutionIter", 1, 4, 4, 3); __PYX_ERR(0, 153, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutionIter") < 0)) __PYX_ERR(0, 153, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 153, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 153, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 153, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 153, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_domains = ((PyObject*)values[1]); @@ -6718,32 +5804,31 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.BacktrackingSolver.getSolutionIter", __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", 1))) __PYX_ERR(0, 153, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 153, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 153, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 153, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 153, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 153, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_18BacktrackingSolver_2getSolutionIter(__pyx_self, __pyx_v_self, __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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -6754,7 +5839,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds * lst.sort(key=lambda x: (x[0], x[1])) # <<<<<<<<<<<<<< * for item in lst: * if item[-1] not in assignments: - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_18BacktrackingSolver_15getSolutionIter_lambda(PyObject *__pyx_self, @@ -6764,7 +5849,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_7solvers_18BacktrackingSolver_15getSolutionIter_lambda = {"lambda", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_18BacktrackingSolver_15getSolutionIter_lambda, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_18BacktrackingSolver_15getSolutionIter_lambda = {"lambda", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_18BacktrackingSolver_15getSolutionIter_lambda, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_7solvers_18BacktrackingSolver_15getSolutionIter_lambda(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -6785,7 +5870,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -6793,33 +5878,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 162, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 162, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda") < 0)) __PYX_ERR(0, 162, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 162, __pyx_L3_error) } __pyx_v_x = values[0]; } @@ -6829,11 +5909,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.BacktrackingSolver.getSolutionIter.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6842,11 +5919,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, __pyx_v_x); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -6861,18 +5935,18 @@ static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("lambda", 1); + __Pyx_RefNannySetupContext("lambda", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 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); 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_PyInt_From_long, 0, 0, 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); 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); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 162, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 162, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -6898,7 +5972,7 @@ static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * forwardcheck = self._forwardcheck * assignments = {} - */ +*/ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_2getSolutionIter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_domains, CYTHON_UNUSED PyObject *__pyx_v_constraints, PyObject *__pyx_v_vconstraints) { struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter *__pyx_cur_scope; @@ -6908,7 +5982,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_2getSolutio const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolutionIter", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct__getSolutionIter(__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct__getSolutionIter(__pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter *)Py_None); __Pyx_INCREF(Py_None); @@ -6929,7 +6003,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_2getSolutio __Pyx_INCREF(__pyx_cur_scope->__pyx_v_vconstraints); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_vconstraints); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator, __pyx_codeobj__2, (PyObject *) __pyx_cur_scope, __pyx_n_s_getSolutionIter, __pyx_n_s_BacktrackingSolver_getSolutionIt, __pyx_n_s_constraint_solvers); if (unlikely(!gen)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver_getSolutionIt, __pyx_mstate_global->__pyx_n_u_constraint_solvers); if (unlikely(!gen)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6959,11 +6033,11 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( Py_ssize_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; - int __pyx_t_11; + size_t __pyx_t_11; int __pyx_t_12; - PyObject *(*__pyx_t_13)(PyObject *); + int __pyx_t_13; PyObject *(*__pyx_t_14)(PyObject *); - unsigned int __pyx_t_15; + PyObject *(*__pyx_t_15)(PyObject *); int __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; @@ -6978,7 +6052,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 153, __pyx_L1_error) + 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, 153, __pyx_L1_error) + } /* "constraint/solvers.py":154 * @@ -6986,8 +6063,8 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * forwardcheck = self._forwardcheck # <<<<<<<<<<<<<< * assignments = {} * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_forwardcheck_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_forwardcheck_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_forwardcheck = __pyx_t_1; @@ -6999,7 +6076,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * assignments = {} # <<<<<<<<<<<<<< * * queue = [] - */ +*/ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -7012,7 +6089,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * queue = [] # <<<<<<<<<<<<<< * * while True: - */ +*/ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -7025,7 +6102,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * while True: # <<<<<<<<<<<<<< * # Mix the Degree and Minimum Remaing Values (MRV) heuristics * lst = [(-len(vconstraints[variable]), len(domains[variable]), variable) for variable in domains] - */ +*/ while (1) { /* "constraint/solvers.py":161 @@ -7034,7 +6111,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * lst = [(-len(vconstraints[variable]), len(domains[variable]), variable) for variable in domains] # <<<<<<<<<<<<<< * lst.sort(key=lambda x: (x[0], x[1])) * for item in lst: - */ +*/ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -7057,23 +6134,23 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromSsize_t((-__pyx_t_8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_6 = PyLong_FromSsize_t((-__pyx_t_8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_7genexpr__pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6)) __PYX_ERR(0, 161, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 161, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9)) __PYX_ERR(0, 161, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 161, __pyx_L1_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_7genexpr__pyx_v_variable); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_7genexpr__pyx_v_variable); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_cur_scope->__pyx_7genexpr__pyx_v_variable)) __PYX_ERR(0, 161, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_cur_scope->__pyx_7genexpr__pyx_v_variable) != (0)) __PYX_ERR(0, 161, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_9 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 161, __pyx_L1_error) @@ -7092,20 +6169,25 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * lst.sort(key=lambda x: (x[0], x[1])) # <<<<<<<<<<<<<< * for item in lst: * if item[-1] not in assignments: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_lst, __pyx_n_s_sort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_15getSolutionIter_lambda, 0, __pyx_n_s_BacktrackingSolver_getSolutionIt_2, NULL, __pyx_n_s_constraint_solvers, __pyx_d, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_t_10) < 0) __PYX_ERR(0, 162, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 162, __pyx_L1_error) +*/ + __pyx_t_2 = __pyx_cur_scope->__pyx_v_lst; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_15getSolutionIter_lambda, 0, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver_getSolutionIt_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = 0; + { + 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); + __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, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "constraint/solvers.py":163 * lst = [(-len(vconstraints[variable]), len(domains[variable]), variable) for variable in domains] @@ -7113,27 +6195,25 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for item in lst: # <<<<<<<<<<<<<< * if item[-1] not in assignments: * # Found unassigned variable - */ - __pyx_t_10 = __pyx_cur_scope->__pyx_v_lst; __Pyx_INCREF(__pyx_t_10); +*/ + __pyx_t_1 = __pyx_cur_scope->__pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 163, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 163, __pyx_L1_error) - #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif + __pyx_t_9 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + ++__pyx_t_4; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_item); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_item, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_item, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; /* "constraint/solvers.py":164 * lst.sort(key=lambda x: (x[0], x[1])) @@ -7141,12 +6221,12 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if item[-1] not in assignments: # <<<<<<<<<<<<<< * # Found unassigned variable * variable = item[-1] - */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_item, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = (__Pyx_PyDict_ContainsTF(__pyx_t_2, __pyx_cur_scope->__pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 164, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_11) { +*/ + __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_item, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); 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; + if (__pyx_t_12) { /* "constraint/solvers.py":166 * if item[-1] not in assignments: @@ -7154,13 +6234,13 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * variable = item[-1] # <<<<<<<<<<<<<< * values = domains[variable][:] * if forwardcheck: - */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_item, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); +*/ + __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_item, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); 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_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_variable, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; /* "constraint/solvers.py":167 * # Found unassigned variable @@ -7168,16 +6248,16 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * values = domains[variable][:] # <<<<<<<<<<<<<< * if forwardcheck: * pushdomains = [domains[x] for x in domains if x not in assignments and x != variable] - */ - __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +*/ + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetSlice(__pyx_t_9, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_values); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_values, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_values, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; /* "constraint/solvers.py":168 * variable = item[-1] @@ -7185,9 +6265,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if forwardcheck: # <<<<<<<<<<<<<< * pushdomains = [domains[x] for x in domains if x not in assignments and x != variable] * else: - */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_forwardcheck); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 168, __pyx_L1_error) - if (__pyx_t_11) { +*/ + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_forwardcheck); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 168, __pyx_L1_error) + if (__pyx_t_12) { /* "constraint/solvers.py":169 * values = domains[variable][:] @@ -7195,49 +6275,49 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * pushdomains = [domains[x] for x in domains if x not in assignments and x != variable] # <<<<<<<<<<<<<< * else: * pushdomains = None - */ +*/ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_domains, 1, ((PyObject *)NULL), (&__pyx_t_8), (&__pyx_t_5)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_2); - __pyx_t_2 = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_domains, 1, ((PyObject *)NULL), (&__pyx_t_8), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_9); + __pyx_t_9 = __pyx_t_2; + __pyx_t_2 = 0; while (1) { - __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_3, &__pyx_t_9, NULL, NULL, __pyx_t_5); + __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_9, __pyx_t_8, &__pyx_t_3, &__pyx_t_2, NULL, NULL, __pyx_t_5); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_8genexpr1__pyx_v_x); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_8genexpr1__pyx_v_x, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_12 = (__Pyx_PyDict_ContainsTF(__pyx_cur_scope->__pyx_8genexpr1__pyx_v_x, __pyx_cur_scope->__pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 169, __pyx_L1_error) - if (__pyx_t_12) { + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_8genexpr1__pyx_v_x, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_13 = (__Pyx_PyDict_ContainsTF(__pyx_cur_scope->__pyx_8genexpr1__pyx_v_x, __pyx_cur_scope->__pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 169, __pyx_L1_error) + if (__pyx_t_13) { } else { - __pyx_t_11 = __pyx_t_12; + __pyx_t_12 = __pyx_t_13; goto __pyx_L15_bool_binop_done; } - __pyx_t_9 = PyObject_RichCompare(__pyx_cur_scope->__pyx_8genexpr1__pyx_v_x, __pyx_cur_scope->__pyx_v_variable, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 169, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_11 = __pyx_t_12; + __pyx_t_2 = PyObject_RichCompare(__pyx_cur_scope->__pyx_8genexpr1__pyx_v_x, __pyx_cur_scope->__pyx_v_variable, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_12 = __pyx_t_13; __pyx_L15_bool_binop_done:; - if (__pyx_t_11) { - __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_8genexpr1__pyx_v_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_12) { + __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_8genexpr1__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } /* exit inner scope */ __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_pushdomains); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_pushdomains, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_pushdomains, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; /* "constraint/solvers.py":168 * variable = item[-1] @@ -7245,7 +6325,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if forwardcheck: # <<<<<<<<<<<<<< * pushdomains = [domains[x] for x in domains if x not in assignments and x != variable] * else: - */ +*/ goto __pyx_L11; } @@ -7255,7 +6335,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * pushdomains = None # <<<<<<<<<<<<<< * break * else: - */ +*/ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_pushdomains); @@ -7270,7 +6350,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * break # <<<<<<<<<<<<<< * else: * # No unassigned variables. We've got a solution. Go back - */ +*/ goto __pyx_L9_break; /* "constraint/solvers.py":164 @@ -7279,7 +6359,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if item[-1] not in assignments: # <<<<<<<<<<<<<< * # Found unassigned variable * variable = item[-1] - */ +*/ } /* "constraint/solvers.py":163 @@ -7288,12 +6368,12 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for item in lst: # <<<<<<<<<<<<<< * if item[-1] not in assignments: * # Found unassigned variable - */ +*/ } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L17_for_else; __pyx_L9_break:; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L18_for_end; /*else*/ { __pyx_L17_for_else:; @@ -7304,11 +6384,11 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * yield assignments.copy() # <<<<<<<<<<<<<< * if not queue: * return - */ - __pyx_t_10 = PyDict_Copy(__pyx_cur_scope->__pyx_v_assignments); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_r = __pyx_t_10; - __pyx_t_10 = 0; +*/ + __pyx_t_1 = PyDict_Copy(__pyx_cur_scope->__pyx_v_assignments); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); @@ -7324,10 +6404,11 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if not queue: # <<<<<<<<<<<<<< * return * variable, values, pushdomains = queue.pop() - */ - __pyx_t_11 = (PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_queue) != 0); - __pyx_t_12 = (!__pyx_t_11); - if (__pyx_t_12) { +*/ + __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) + __pyx_t_13 = (!__pyx_t_12); + if (__pyx_t_13) { /* "constraint/solvers.py":178 * yield assignments.copy() @@ -7335,9 +6416,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * return # <<<<<<<<<<<<<< * variable, values, pushdomains = queue.pop() * if pushdomains: - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_r = NULL; + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "constraint/solvers.py":177 @@ -7346,7 +6427,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if not queue: # <<<<<<<<<<<<<< * return * variable, values, pushdomains = queue.pop() - */ +*/ } /* "constraint/solvers.py":179 @@ -7355,11 +6436,11 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * variable, values, pushdomains = queue.pop() # <<<<<<<<<<<<<< * if pushdomains: * for domain in pushdomains: - */ - __pyx_t_10 = __Pyx_PyList_Pop(__pyx_cur_scope->__pyx_v_queue); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) { - PyObject* sequence = __pyx_t_10; +*/ + __pyx_t_1 = __Pyx_PyList_Pop(__pyx_cur_scope->__pyx_v_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __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; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); @@ -7368,61 +6449,67 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_10); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_9); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_1 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); - __pyx_t_9 = PyList_GET_ITEM(sequence, 2); + __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 0); + 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); + 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); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); } - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_9); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); - index = 0; __pyx_t_1 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - index = 1; __pyx_t_2 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 2; __pyx_t_9 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_9)) goto __pyx_L21_unpacking_failed; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); + index = 0; __pyx_t_10 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_10)) goto __pyx_L21_unpacking_failed; + __Pyx_GOTREF(__pyx_t_10); + index = 1; __pyx_t_9 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_9)) goto __pyx_L21_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_6), 3) < 0) __PYX_ERR(0, 179, __pyx_L1_error) - __pyx_t_13 = NULL; + 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) + __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L22_unpacking_done; __pyx_L21_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_13 = NULL; + __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 179, __pyx_L1_error) __pyx_L22_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_variable); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_variable, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_variable, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_values); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_values, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_pushdomains); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_pushdomains, __pyx_t_9); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_values, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_pushdomains); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_pushdomains, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; /* "constraint/solvers.py":180 * return @@ -7430,9 +6517,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 180, __pyx_L1_error) - if (__pyx_t_12) { +*/ + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 180, __pyx_L1_error) + if (__pyx_t_13) { /* "constraint/solvers.py":181 * variable, values, pushdomains = queue.pop() @@ -7440,63 +6527,60 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * - */ +*/ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) { - __pyx_t_10 = __pyx_cur_scope->__pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_10); + __pyx_t_1 = __pyx_cur_scope->__pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_14 = NULL; + __pyx_t_15 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 181, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_10))) { + if (likely(!__pyx_t_15)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 181, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) - #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - #endif + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + ++__pyx_t_4; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 181, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4)); #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); #endif + ++__pyx_t_4; } + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) } else { - __pyx_t_9 = __pyx_t_14(__pyx_t_10); - if (unlikely(!__pyx_t_9)) { + __pyx_t_2 = __pyx_t_15(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 181, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 181, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_9); } + __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_domain); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_domain, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_9); - __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_domain, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; /* "constraint/solvers.py":182 * if pushdomains: @@ -7504,32 +6588,18 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * domain.popState() # <<<<<<<<<<<<<< * * while True: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_n_s_popState); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = NULL; - __pyx_t_15 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_15 = 1; - } - } - #endif +*/ + __pyx_t_9 = __pyx_cur_scope->__pyx_v_domain; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_11 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_15, 0+__pyx_t_15); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_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); } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":181 * variable, values, pushdomains = queue.pop() @@ -7537,9 +6607,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * - */ +*/ } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/solvers.py":180 * return @@ -7547,7 +6617,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ } } __pyx_L18_for_end:; @@ -7558,7 +6628,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * while True: # <<<<<<<<<<<<<< * # We have a variable. Do we have any values left? * if not values: - */ +*/ while (1) { /* "constraint/solvers.py":186 @@ -7567,10 +6637,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if not values: # <<<<<<<<<<<<<< * # No. Go back to last variable, if there's one. * del assignments[variable] - */ - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_values); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 186, __pyx_L1_error) - __pyx_t_11 = (!__pyx_t_12); - if (__pyx_t_11) { +*/ + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_values); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_12 = (!__pyx_t_13); + if (__pyx_t_12) { /* "constraint/solvers.py":188 * if not values: @@ -7578,7 +6648,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * del assignments[variable] # <<<<<<<<<<<<<< * while queue: * variable, values, pushdomains = queue.pop() - */ +*/ if (unlikely((PyDict_DelItem(__pyx_cur_scope->__pyx_v_assignments, __pyx_cur_scope->__pyx_v_variable) < 0))) __PYX_ERR(0, 188, __pyx_L1_error) /* "constraint/solvers.py":189 @@ -7587,10 +6657,11 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * while queue: # <<<<<<<<<<<<<< * variable, values, pushdomains = queue.pop() * if pushdomains: - */ +*/ while (1) { - __pyx_t_11 = (PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_queue) != 0); - if (!__pyx_t_11) break; + __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) + if (!__pyx_t_12) break; /* "constraint/solvers.py":190 * del assignments[variable] @@ -7598,11 +6669,11 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * variable, values, pushdomains = queue.pop() # <<<<<<<<<<<<<< * if pushdomains: * for domain in pushdomains: - */ - __pyx_t_10 = __Pyx_PyList_Pop(__pyx_cur_scope->__pyx_v_queue); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) { - PyObject* sequence = __pyx_t_10; +*/ + __pyx_t_1 = __Pyx_PyList_Pop(__pyx_cur_scope->__pyx_v_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __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; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); @@ -7611,61 +6682,67 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_9); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_10); } else { - __pyx_t_9 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); - __pyx_t_1 = PyList_GET_ITEM(sequence, 2); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + 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); + 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); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_10); } - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); #else - __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); #endif - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); - index = 0; __pyx_t_9 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_9)) goto __pyx_L32_unpacking_failed; - __Pyx_GOTREF(__pyx_t_9); - index = 1; __pyx_t_2 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L32_unpacking_failed; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); + index = 0; __pyx_t_2 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L32_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - index = 2; __pyx_t_1 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L32_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_6), 3) < 0) __PYX_ERR(0, 190, __pyx_L1_error) - __pyx_t_13 = NULL; + index = 1; __pyx_t_9 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_9)) goto __pyx_L32_unpacking_failed; + __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) + __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L33_unpacking_done; __pyx_L32_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_13 = NULL; + __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 190, __pyx_L1_error) __pyx_L33_unpacking_done:; } __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_variable); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_variable, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_9); - __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_values); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_values, __pyx_t_2); + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_variable, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_values); + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_values, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_pushdomains); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_pushdomains, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_pushdomains, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; /* "constraint/solvers.py":191 * while queue: @@ -7673,9 +6750,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 191, __pyx_L1_error) - if (__pyx_t_11) { +*/ + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 191, __pyx_L1_error) + if (__pyx_t_12) { /* "constraint/solvers.py":192 * variable, values, pushdomains = queue.pop() @@ -7683,63 +6760,60 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * if values: - */ +*/ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) { - __pyx_t_10 = __pyx_cur_scope->__pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_10); + __pyx_t_1 = __pyx_cur_scope->__pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_14 = NULL; + __pyx_t_15 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 192, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_10))) { + if (likely(!__pyx_t_15)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 192, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 192, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif + __pyx_t_10 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + ++__pyx_t_4; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 192, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_10 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); #endif + ++__pyx_t_4; } + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_14(__pyx_t_10); - if (unlikely(!__pyx_t_1)) { + __pyx_t_10 = __pyx_t_15(__pyx_t_1); + if (unlikely(!__pyx_t_10)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 192, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 192, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_1); } + __Pyx_GOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_domain); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_domain, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_domain, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; /* "constraint/solvers.py":193 * if pushdomains: @@ -7747,32 +6821,18 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * domain.popState() # <<<<<<<<<<<<<< * if values: * break - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_n_s_popState); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = NULL; - __pyx_t_15 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_15 = 1; - } - } - #endif +*/ + __pyx_t_9 = __pyx_cur_scope->__pyx_v_domain; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_11 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_15, 0+__pyx_t_15); + __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_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "constraint/solvers.py":192 * variable, values, pushdomains = queue.pop() @@ -7780,9 +6840,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * if values: - */ +*/ } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/solvers.py":191 * while queue: @@ -7790,7 +6850,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ } /* "constraint/solvers.py":194 @@ -7799,9 +6859,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if values: # <<<<<<<<<<<<<< * break * del assignments[variable] - */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_values); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 194, __pyx_L1_error) - if (__pyx_t_11) { +*/ + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_values); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 194, __pyx_L1_error) + if (__pyx_t_12) { /* "constraint/solvers.py":195 * domain.popState() @@ -7809,7 +6869,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * break # <<<<<<<<<<<<<< * del assignments[variable] * else: - */ +*/ goto __pyx_L31_break; /* "constraint/solvers.py":194 @@ -7818,7 +6878,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if values: # <<<<<<<<<<<<<< * break * del assignments[variable] - */ +*/ } /* "constraint/solvers.py":196 @@ -7827,7 +6887,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * del assignments[variable] # <<<<<<<<<<<<<< * else: * return - */ +*/ if (unlikely((PyDict_DelItem(__pyx_cur_scope->__pyx_v_assignments, __pyx_cur_scope->__pyx_v_variable) < 0))) __PYX_ERR(0, 196, __pyx_L1_error) } @@ -7837,10 +6897,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * return # <<<<<<<<<<<<<< * * # Got a value. Check it. - */ +*/ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_r = NULL; + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } __pyx_L31_break:; @@ -7851,7 +6911,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if not values: # <<<<<<<<<<<<<< * # No. Go back to last variable, if there's one. * del assignments[variable] - */ +*/ } /* "constraint/solvers.py":201 @@ -7860,11 +6920,11 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * assignments[variable] = values.pop() # <<<<<<<<<<<<<< * * if pushdomains: - */ - __pyx_t_10 = __Pyx_PyObject_Pop(__pyx_cur_scope->__pyx_v_values); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (unlikely((PyDict_SetItem(__pyx_cur_scope->__pyx_v_assignments, __pyx_cur_scope->__pyx_v_variable, __pyx_t_10) < 0))) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; +*/ + __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_cur_scope->__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely((PyDict_SetItem(__pyx_cur_scope->__pyx_v_assignments, __pyx_cur_scope->__pyx_v_variable, __pyx_t_1) < 0))) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/solvers.py":203 * assignments[variable] = values.pop() @@ -7872,9 +6932,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.pushState() - */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 203, __pyx_L1_error) - if (__pyx_t_11) { +*/ + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 203, __pyx_L1_error) + if (__pyx_t_12) { /* "constraint/solvers.py":204 * @@ -7882,63 +6942,60 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.pushState() * - */ +*/ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) { - __pyx_t_10 = __pyx_cur_scope->__pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_10); + __pyx_t_1 = __pyx_cur_scope->__pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; - __pyx_t_14 = NULL; + __pyx_t_15 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 204, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_10))) { + if (likely(!__pyx_t_15)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 204, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 204, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif + __pyx_t_10 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + ++__pyx_t_4; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 204, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_10 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); #endif + ++__pyx_t_4; } + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 204, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_14(__pyx_t_10); - if (unlikely(!__pyx_t_1)) { + __pyx_t_10 = __pyx_t_15(__pyx_t_1); + if (unlikely(!__pyx_t_10)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 204, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 204, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_1); } + __Pyx_GOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_domain); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_domain, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_domain, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; /* "constraint/solvers.py":205 * if pushdomains: @@ -7946,32 +7003,18 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * domain.pushState() # <<<<<<<<<<<<<< * * for constraint, variables in vconstraints[variable]: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_n_s_pushState); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = NULL; - __pyx_t_15 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_15 = 1; - } - } - #endif +*/ + __pyx_t_9 = __pyx_cur_scope->__pyx_v_domain; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_11 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_15, 0+__pyx_t_15); + __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_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "constraint/solvers.py":204 * @@ -7979,9 +7022,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.pushState() * - */ +*/ } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/solvers.py":203 * assignments[variable] = values.pop() @@ -7989,7 +7032,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.pushState() - */ +*/ } /* "constraint/solvers.py":207 @@ -7998,64 +7041,61 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, pushdomains): * # Value is not good. - */ - __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_vconstraints, __pyx_cur_scope->__pyx_v_variable); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 207, __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_1 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_vconstraints, __pyx_cur_scope->__pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_10 = __pyx_t_1; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; - __pyx_t_14 = NULL; + __pyx_t_15 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 207, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(!__pyx_t_15)) { + if (likely(PyList_CheckExact(__pyx_t_10))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 207, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_10 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 207, __pyx_L1_error) - #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - #endif + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_4); + ++__pyx_t_4; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 207, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_4)); #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_4); #endif + ++__pyx_t_4; } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) } else { - __pyx_t_10 = __pyx_t_14(__pyx_t_1); - if (unlikely(!__pyx_t_10)) { + __pyx_t_1 = __pyx_t_15(__pyx_t_10); + if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 207, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 207, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_10); } - if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) { - PyObject* sequence = __pyx_t_10; + __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); @@ -8064,50 +7104,54 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_9); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_9 = PyList_GET_ITEM(sequence, 1); + __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 0); + 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); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_9); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); - index = 0; __pyx_t_2 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L45_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_9 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_9)) goto __pyx_L45_unpacking_failed; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); + index = 0; __pyx_t_9 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_9)) goto __pyx_L45_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_6), 2) < 0) __PYX_ERR(0, 207, __pyx_L1_error) - __pyx_t_13 = NULL; + 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) + __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L46_unpacking_done; __pyx_L45_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_13 = NULL; + __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 207, __pyx_L1_error) __pyx_L46_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_constraint); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_constraint, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_variables); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_variables, __pyx_t_9); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_constraint, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_variables); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_variables, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; /* "constraint/solvers.py":208 * @@ -8115,34 +7159,34 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if not constraint(variables, domains, assignments, pushdomains): # <<<<<<<<<<<<<< * # Value is not good. * break - */ +*/ + __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_constraint); - __pyx_t_9 = __pyx_cur_scope->__pyx_v_constraint; __pyx_t_2 = NULL; - __pyx_t_15 = 0; + __pyx_t_9 = __pyx_cur_scope->__pyx_v_constraint; + __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_15 = 1; - } + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); + __pyx_t_11 = 0; } #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_10 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_15, 4+__pyx_t_15); + __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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 208, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 208, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_12 = (!__pyx_t_11); - if (__pyx_t_12) { + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_13 = (!__pyx_t_12); + if (__pyx_t_13) { /* "constraint/solvers.py":210 * if not constraint(variables, domains, assignments, pushdomains): @@ -8150,7 +7194,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * break # <<<<<<<<<<<<<< * else: * break - */ +*/ goto __pyx_L44_break; /* "constraint/solvers.py":208 @@ -8159,7 +7203,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if not constraint(variables, domains, assignments, pushdomains): # <<<<<<<<<<<<<< * # Value is not good. * break - */ +*/ } /* "constraint/solvers.py":207 @@ -8168,12 +7212,12 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, pushdomains): * # Value is not good. - */ +*/ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L48_for_else; __pyx_L44_break:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L49_for_end; /*else*/ { __pyx_L48_for_else:; @@ -8184,7 +7228,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * break # <<<<<<<<<<<<<< * * if pushdomains: - */ +*/ goto __pyx_L28_break; } __pyx_L49_for_end:; @@ -8195,9 +7239,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 214, __pyx_L1_error) - if (__pyx_t_12) { +*/ + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 214, __pyx_L1_error) + if (__pyx_t_13) { /* "constraint/solvers.py":215 * @@ -8205,63 +7249,60 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * - */ +*/ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) { - __pyx_t_1 = __pyx_cur_scope->__pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_1); + __pyx_t_10 = __pyx_cur_scope->__pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; - __pyx_t_14 = NULL; + __pyx_t_15 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 215, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(!__pyx_t_15)) { + if (likely(PyList_CheckExact(__pyx_t_10))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 215, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_10 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 215, __pyx_L1_error) - #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - #endif + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_4); + ++__pyx_t_4; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 215, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_4)); #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_4); #endif + ++__pyx_t_4; } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) } else { - __pyx_t_10 = __pyx_t_14(__pyx_t_1); - if (unlikely(!__pyx_t_10)) { + __pyx_t_1 = __pyx_t_15(__pyx_t_10); + if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 215, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 215, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_10); } + __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_domain); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_domain, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); - __pyx_t_10 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_domain, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; /* "constraint/solvers.py":216 * if pushdomains: @@ -8269,32 +7310,18 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * domain.popState() # <<<<<<<<<<<<<< * * # Push state before looking for next variable. - */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_n_s_popState); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = NULL; - __pyx_t_15 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_15 = 1; - } - } - #endif +*/ + __pyx_t_9 = __pyx_cur_scope->__pyx_v_domain; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_11 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_15, 0+__pyx_t_15); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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_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); } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/solvers.py":215 * @@ -8302,9 +7329,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * - */ +*/ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "constraint/solvers.py":214 * break @@ -8312,7 +7339,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ } } __pyx_L28_break:; @@ -8323,20 +7350,20 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * queue.append((variable, values, pushdomains)) # <<<<<<<<<<<<<< * * raise RuntimeError("Can't happen") - */ - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); +*/ + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_variable); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_variable); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_variable)) __PYX_ERR(0, 219, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_cur_scope->__pyx_v_variable) != (0)) __PYX_ERR(0, 219, __pyx_L1_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_values); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_values); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_values)) __PYX_ERR(0, 219, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_cur_scope->__pyx_v_values) != (0)) __PYX_ERR(0, 219, __pyx_L1_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_pushdomains); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pushdomains); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_cur_scope->__pyx_v_pushdomains)) __PYX_ERR(0, 219, __pyx_L1_error); - __pyx_t_16 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_queue, __pyx_t_1); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 219, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_cur_scope->__pyx_v_pushdomains) != (0)) __PYX_ERR(0, 219, __pyx_L1_error); + __pyx_t_16 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_queue, __pyx_t_10); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 219, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } /* "constraint/solvers.py":221 @@ -8345,11 +7372,21 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< * * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __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_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_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); + } + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __PYX_ERR(0, 221, __pyx_L1_error) CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -8359,19 +7396,21 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * forwardcheck = self._forwardcheck * assignments = {} - */ +*/ /* function exit code */ __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("getSolutionIter", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("getSolutionIter", __pyx_clineno, __pyx_lineno, __pyx_filename); + } __pyx_L0:; - __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif @@ -8387,7 +7426,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * iter = self.getSolutionIter(domains, constraints, vconstraints) * try: - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_18BacktrackingSolver_6getSolution(PyObject *__pyx_self, @@ -8397,7 +7436,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_7solvers_18BacktrackingSolver_6getSolution = {"getSolution", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_18BacktrackingSolver_6getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_18BacktrackingSolver_6getSolution = {"getSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_18BacktrackingSolver_6getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_7solvers_18BacktrackingSolver_6getSolution(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -8421,7 +7460,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -8429,72 +7468,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 223, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 223, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 223, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 223, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, 1); __PYX_ERR(0, 223, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, 2); __PYX_ERR(0, 223, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, 3); __PYX_ERR(0, 223, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolution") < 0)) __PYX_ERR(0, 223, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 223, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 223, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 223, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 223, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_domains = ((PyObject*)values[1]); @@ -8507,32 +7520,31 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.BacktrackingSolver.getSolution", __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", 1))) __PYX_ERR(0, 223, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 223, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 223, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 223, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 223, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 223, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolution(__pyx_self, __pyx_v_self, __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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -8543,16 +7555,15 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; + size_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; + int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolution", 1); + __Pyx_RefNannySetupContext("getSolution", 0); /* "constraint/solvers.py":224 * @@ -8560,30 +7571,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio * iter = self.getSolutionIter(domains, constraints, vconstraints) # <<<<<<<<<<<<<< * try: * return next(iter) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getSolutionIter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + __pyx_t_2 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; { - PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __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_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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_iter = __pyx_t_1; __pyx_t_1 = 0; @@ -8594,14 +7591,14 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio * try: # <<<<<<<<<<<<<< * return next(iter) * except StopIteration: - */ +*/ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_7); /*try:*/ { /* "constraint/solvers.py":226 @@ -8610,7 +7607,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio * return next(iter) # <<<<<<<<<<<<<< * except StopIteration: * return None - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_iter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); @@ -8624,12 +7621,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio * try: # <<<<<<<<<<<<<< * return next(iter) * except StopIteration: - */ +*/ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/solvers.py":227 * try: @@ -8637,14 +7633,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio * except StopIteration: # <<<<<<<<<<<<<< * return None * - */ - __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); - if (__pyx_t_8) { - __Pyx_AddTraceback("constraint.solvers.BacktrackingSolver.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 227, __pyx_L5_except_error) - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); +*/ + __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); + if (__pyx_t_7) { + __Pyx_ErrRestore(0,0,0); /* "constraint/solvers.py":228 * return next(iter) @@ -8652,12 +7644,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio * return None # <<<<<<<<<<<<<< * * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; @@ -8668,24 +7657,24 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio * try: # <<<<<<<<<<<<<< * return next(iter) * except StopIteration: - */ +*/ __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L0; __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L0; } @@ -8695,13 +7684,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * iter = self.getSolutionIter(domains, constraints, vconstraints) * try: - */ +*/ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("constraint.solvers.BacktrackingSolver.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -8717,7 +7705,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * return list(self.getSolutionIter(domains, constraints, vconstraints)) * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_18BacktrackingSolver_8getSolutions(PyObject *__pyx_self, @@ -8727,7 +7715,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_7solvers_18BacktrackingSolver_8getSolutions = {"getSolutions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_18BacktrackingSolver_8getSolutions, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_18BacktrackingSolver_8getSolutions = {"getSolutions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_18BacktrackingSolver_8getSolutions, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_7solvers_18BacktrackingSolver_8getSolutions(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -8751,7 +7739,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutions (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -8759,72 +7747,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 230, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 230, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 230, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 230, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 4, 4, 1); __PYX_ERR(0, 230, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 4, 4, 2); __PYX_ERR(0, 230, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 4, 4, 3); __PYX_ERR(0, 230, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutions") < 0)) __PYX_ERR(0, 230, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 230, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 230, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 230, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 230, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_domains = ((PyObject*)values[1]); @@ -8837,32 +7799,31 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.BacktrackingSolver.getSolutions", __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", 1))) __PYX_ERR(0, 230, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 230, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 230, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 230, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 230, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 230, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_18BacktrackingSolver_7getSolutions(__pyx_self, __pyx_v_self, __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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -8872,12 +7833,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_7getSolutio __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; + size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolutions", 1); + __Pyx_RefNannySetupContext("getSolutions", 0); /* "constraint/solvers.py":231 * @@ -8885,31 +7845,17 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_7getSolutio * return list(self.getSolutionIter(domains, constraints, vconstraints)) # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getSolutionIter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif + __pyx_t_2 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; { - PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __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_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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -8924,13 +7870,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_7getSolutio * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * return list(self.getSolutionIter(domains, constraints, vconstraints)) * - */ +*/ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("constraint.solvers.BacktrackingSolver.getSolutions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -8945,7 +7890,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_7getSolutio * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_1__init__(PyObject *__pyx_self, @@ -8956,7 +7901,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7solvers_27OptimizedBacktrackingSolver___init__, "Initialization method.\n\n Args:\n forwardcheck (bool): If false forward checking will not be\n requested to constraints while looking for solutions\n (default is true)\n "); -static PyMethodDef __pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_27OptimizedBacktrackingSolver___init__}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_27OptimizedBacktrackingSolver___init__}; static PyObject *__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -8978,7 +7923,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -8986,47 +7931,41 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_forwardcheck,0}; - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 266, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 266, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 266, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 266, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 266, __pyx_L3_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 (!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) } } } else { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 266, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 266, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } + if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); } __pyx_v_self = values[0]; __pyx_v_forwardcheck = values[1]; @@ -9037,11 +7976,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.OptimizedBacktrackingSolver.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -9050,11 +7986,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver___init__(__pyx_self, __pyx_v_self, __pyx_v_forwardcheck); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -9066,7 +7999,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver___ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/solvers.py":274 * (default is true) @@ -9074,8 +8007,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver___ * self._forwardcheck = forwardcheck # <<<<<<<<<<<<<< * * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_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 * """ @@ -9083,7 +8016,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver___ * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -9104,7 +8037,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * forwardcheck = self._forwardcheck * assignments = {} - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_3getSolutionIter(PyObject *__pyx_self, @@ -9114,7 +8047,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_3getSolutionIter = {"getSolutionIter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_3getSolutionIter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_3getSolutionIter = {"getSolutionIter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_3getSolutionIter, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_3getSolutionIter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -9138,7 +8071,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionIter (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -9146,72 +8079,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 276, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 276, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 276, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 276, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutionIter", 1, 4, 4, 1); __PYX_ERR(0, 276, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutionIter", 1, 4, 4, 2); __PYX_ERR(0, 276, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutionIter", 1, 4, 4, 3); __PYX_ERR(0, 276, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutionIter") < 0)) __PYX_ERR(0, 276, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 276, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 276, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 276, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 276, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_domains = ((PyObject*)values[1]); @@ -9224,32 +8131,31 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.OptimizedBacktrackingSolver.getSolutionIter", __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", 1))) __PYX_ERR(0, 276, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 276, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 276, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 276, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 276, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 276, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_2getSolutionIter(__pyx_self, __pyx_v_self, __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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -9262,7 +8168,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_2g const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolutionIter", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter(__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter(__pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter *)Py_None); __Pyx_INCREF(Py_None); @@ -9283,7 +8189,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_2g __Pyx_INCREF(__pyx_cur_scope->__pyx_v_vconstraints); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_vconstraints); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4generator1, __pyx_codeobj__4, (PyObject *) __pyx_cur_scope, __pyx_n_s_getSolutionIter, __pyx_n_s_OptimizedBacktrackingSolver_getS, __pyx_n_s_constraint_solvers); if (unlikely(!gen)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4generator1, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver_getS, __pyx_mstate_global->__pyx_n_u_constraint_solvers); if (unlikely(!gen)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -9305,11 +8211,11 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; - Py_ssize_t __pyx_t_5; - PyObject *(*__pyx_t_6)(PyObject *); - int __pyx_t_7; + size_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; @@ -9332,7 +8238,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 276, __pyx_L1_error) + 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, 276, __pyx_L1_error) + } /* "constraint/solvers.py":277 * @@ -9340,8 +8249,8 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * forwardcheck = self._forwardcheck # <<<<<<<<<<<<<< * assignments = {} * sorted_variables = self.getSortedVariables(domains, vconstraints) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_forwardcheck_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_forwardcheck_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_forwardcheck = __pyx_t_1; @@ -9353,7 +8262,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * assignments = {} # <<<<<<<<<<<<<< * sorted_variables = self.getSortedVariables(domains, vconstraints) * - */ +*/ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -9366,30 +8275,16 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * sorted_variables = self.getSortedVariables(domains, vconstraints) # <<<<<<<<<<<<<< * * queue = [] - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_getSortedVariables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + __pyx_t_2 = __pyx_cur_scope->__pyx_v_self; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __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_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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_sorted_variables = __pyx_t_1; @@ -9401,7 +8296,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * queue = [] # <<<<<<<<<<<<<< * * while True: - */ +*/ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -9414,7 +8309,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * while True: # <<<<<<<<<<<<<< * # Mix the Degree and Minimum Remaing Values (MRV) heuristics * for variable in sorted_variables: - */ +*/ while (1) { /* "constraint/solvers.py":285 @@ -9423,59 +8318,56 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for variable in sorted_variables: # <<<<<<<<<<<<<< * if variable not in assignments: * # Found unassigned variable - */ +*/ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_sorted_variables)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_sorted_variables)) { __pyx_t_1 = __pyx_cur_scope->__pyx_v_sorted_variables; __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = 0; - __pyx_t_6 = NULL; + __pyx_t_4 = 0; + __pyx_t_5 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_sorted_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_sorted_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 285, __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, 285, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_6)) { + 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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 285, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_4 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 285, __pyx_L1_error) - #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + ++__pyx_t_4; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 285, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4)); #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); #endif + ++__pyx_t_4; } + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) } else { - __pyx_t_2 = __pyx_t_6(__pyx_t_1); + __pyx_t_2 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 285, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 285, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_2); } + __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_variable); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_variable, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); @@ -9487,9 +8379,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if variable not in assignments: # <<<<<<<<<<<<<< * # Found unassigned variable * values = domains[variable][:] - */ - __pyx_t_7 = (__Pyx_PyDict_ContainsTF(__pyx_cur_scope->__pyx_v_variable, __pyx_cur_scope->__pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 286, __pyx_L1_error) - if (__pyx_t_7) { +*/ + __pyx_t_6 = (__Pyx_PyDict_ContainsTF(__pyx_cur_scope->__pyx_v_variable, __pyx_cur_scope->__pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 286, __pyx_L1_error) + if (__pyx_t_6) { /* "constraint/solvers.py":288 * if variable not in assignments: @@ -9497,16 +8389,16 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * values = domains[variable][:] # <<<<<<<<<<<<<< * if forwardcheck: * pushdomains = [domains[x] for x in domains if x not in assignments and x != variable] - */ +*/ __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_values); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_values, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_values, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; /* "constraint/solvers.py":289 * # Found unassigned variable @@ -9514,9 +8406,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if forwardcheck: # <<<<<<<<<<<<<< * pushdomains = [domains[x] for x in domains if x not in assignments and x != variable] * else: - */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_forwardcheck); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 289, __pyx_L1_error) - if (__pyx_t_7) { +*/ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_forwardcheck); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 289, __pyx_L1_error) + if (__pyx_t_6) { /* "constraint/solvers.py":290 * values = domains[variable][:] @@ -9524,10 +8416,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * pushdomains = [domains[x] for x in domains if x not in assignments and x != variable] # <<<<<<<<<<<<<< * else: * pushdomains = None - */ +*/ { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 0; __pyx_t_11 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_domains, 1, ((PyObject *)NULL), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); @@ -9546,27 +8438,27 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __pyx_t_13 = (__Pyx_PyDict_ContainsTF(__pyx_cur_scope->__pyx_8genexpr2__pyx_v_x, __pyx_cur_scope->__pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 290, __pyx_L1_error) if (__pyx_t_13) { } else { - __pyx_t_7 = __pyx_t_13; + __pyx_t_6 = __pyx_t_13; goto __pyx_L13_bool_binop_done; } __pyx_t_11 = PyObject_RichCompare(__pyx_cur_scope->__pyx_8genexpr2__pyx_v_x, __pyx_cur_scope->__pyx_v_variable, Py_NE); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 290, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_7 = __pyx_t_13; + __pyx_t_6 = __pyx_t_13; __pyx_L13_bool_binop_done:; - if (__pyx_t_7) { + if (__pyx_t_6) { __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_8genexpr2__pyx_v_x); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 290, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* exit inner scope */ __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_pushdomains); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_pushdomains, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_pushdomains, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; /* "constraint/solvers.py":289 * # Found unassigned variable @@ -9574,7 +8466,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if forwardcheck: # <<<<<<<<<<<<<< * pushdomains = [domains[x] for x in domains if x not in assignments and x != variable] * else: - */ +*/ goto __pyx_L9; } @@ -9584,7 +8476,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * pushdomains = None # <<<<<<<<<<<<<< * break * else: - */ +*/ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_pushdomains); @@ -9599,7 +8491,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * break # <<<<<<<<<<<<<< * else: * # No unassigned variables. We've got a solution. Go back - */ +*/ goto __pyx_L7_break; /* "constraint/solvers.py":286 @@ -9608,7 +8500,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if variable not in assignments: # <<<<<<<<<<<<<< * # Found unassigned variable * values = domains[variable][:] - */ +*/ } /* "constraint/solvers.py":285 @@ -9617,7 +8509,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for variable in sorted_variables: # <<<<<<<<<<<<<< * if variable not in assignments: * # Found unassigned variable - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L15_for_else; @@ -9633,7 +8525,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * yield assignments.copy() # <<<<<<<<<<<<<< * if not queue: * return - */ +*/ __pyx_t_1 = PyDict_Copy(__pyx_cur_scope->__pyx_v_assignments); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; @@ -9653,9 +8545,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if not queue: # <<<<<<<<<<<<<< * return * variable, values, pushdomains = queue.pop() - */ - __pyx_t_7 = (PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_queue) != 0); - __pyx_t_13 = (!__pyx_t_7); +*/ + __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) + __pyx_t_13 = (!__pyx_t_6); if (__pyx_t_13) { /* "constraint/solvers.py":299 @@ -9664,9 +8557,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * return # <<<<<<<<<<<<<< * variable, values, pushdomains = queue.pop() * if pushdomains: - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_r = NULL; + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "constraint/solvers.py":298 @@ -9675,7 +8568,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if not queue: # <<<<<<<<<<<<<< * return * variable, values, pushdomains = queue.pop() - */ +*/ } /* "constraint/solvers.py":300 @@ -9684,7 +8577,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * variable, values, pushdomains = queue.pop() # <<<<<<<<<<<<<< * if pushdomains: * for domain in pushdomains: - */ +*/ __pyx_t_1 = __Pyx_PyList_Pop(__pyx_cur_scope->__pyx_v_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -9697,23 +8590,29 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); + __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_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); - __pyx_t_11 = PyList_GET_ITEM(sequence, 2); + __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 0); + 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); + 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); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_11); } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_11); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -9722,9 +8621,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __pyx_t_14 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); - index = 0; __pyx_t_3 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_3)) goto __pyx_L19_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); + index = 0; __pyx_t_7 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_7)) goto __pyx_L19_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_2 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_2)) goto __pyx_L19_unpacking_failed; __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; @@ -9741,9 +8640,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __pyx_L20_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_variable); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_variable, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_variable, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_values); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_values, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); @@ -9759,7 +8658,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 301, __pyx_L1_error) if (__pyx_t_13) { @@ -9769,59 +8668,56 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * - */ +*/ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) { __pyx_t_1 = __pyx_cur_scope->__pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = 0; - __pyx_t_6 = NULL; + __pyx_t_4 = 0; + __pyx_t_5 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __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, 302, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_6)) { + 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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 302, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_4 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_11 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_11); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 302, __pyx_L1_error) - #else - __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - #endif + __pyx_t_11 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + ++__pyx_t_4; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 302, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_11); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_11 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4)); #else - __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); #endif + ++__pyx_t_4; } + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 302, __pyx_L1_error) } else { - __pyx_t_11 = __pyx_t_6(__pyx_t_1); + __pyx_t_11 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_11)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 302, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 302, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_11); } + __Pyx_GOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_domain); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_domain, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); @@ -9833,30 +8729,16 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * domain.popState() # <<<<<<<<<<<<<< * * while True: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_n_s_popState); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + __pyx_t_2 = __pyx_cur_scope->__pyx_v_domain; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __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_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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -9866,7 +8748,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -9876,7 +8758,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ } } __pyx_L16_for_end:; @@ -9887,7 +8769,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * while True: # <<<<<<<<<<<<<< * # We have a variable. Do we have any values left? * if not values: - */ +*/ while (1) { /* "constraint/solvers.py":307 @@ -9896,10 +8778,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if not values: # <<<<<<<<<<<<<< * # No. Go back to last variable, if there's one. * del assignments[variable] - */ +*/ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_values); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 307, __pyx_L1_error) - __pyx_t_7 = (!__pyx_t_13); - if (__pyx_t_7) { + __pyx_t_6 = (!__pyx_t_13); + if (__pyx_t_6) { /* "constraint/solvers.py":309 * if not values: @@ -9907,7 +8789,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * del assignments[variable] # <<<<<<<<<<<<<< * while queue: * variable, values, pushdomains = queue.pop() - */ +*/ if (unlikely((PyDict_DelItem(__pyx_cur_scope->__pyx_v_assignments, __pyx_cur_scope->__pyx_v_variable) < 0))) __PYX_ERR(0, 309, __pyx_L1_error) /* "constraint/solvers.py":310 @@ -9916,10 +8798,11 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * while queue: # <<<<<<<<<<<<<< * variable, values, pushdomains = queue.pop() * if pushdomains: - */ +*/ while (1) { - __pyx_t_7 = (PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_queue) != 0); - if (!__pyx_t_7) break; + __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) + if (!__pyx_t_6) break; /* "constraint/solvers.py":311 * del assignments[variable] @@ -9927,7 +8810,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * variable, values, pushdomains = queue.pop() # <<<<<<<<<<<<<< * if pushdomains: * for domain in pushdomains: - */ +*/ __pyx_t_1 = __Pyx_PyList_Pop(__pyx_cur_scope->__pyx_v_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -9940,24 +8823,30 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_11); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_7); } else { - __pyx_t_11 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); - __pyx_t_3 = PyList_GET_ITEM(sequence, 2); + __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 0); + 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); + 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); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); } - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { @@ -9965,13 +8854,13 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __pyx_t_14 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); index = 0; __pyx_t_11 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_11)) goto __pyx_L30_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); index = 1; __pyx_t_2 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_2)) goto __pyx_L30_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - index = 2; __pyx_t_3 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_3)) goto __pyx_L30_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); + 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) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; @@ -9992,9 +8881,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_pushdomains); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_pushdomains, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_pushdomains, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; /* "constraint/solvers.py":312 * while queue: @@ -10002,9 +8891,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 312, __pyx_L1_error) - if (__pyx_t_7) { +*/ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 312, __pyx_L1_error) + if (__pyx_t_6) { /* "constraint/solvers.py":313 * variable, values, pushdomains = queue.pop() @@ -10012,63 +8901,60 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * if values: - */ +*/ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) { __pyx_t_1 = __pyx_cur_scope->__pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = 0; - __pyx_t_6 = NULL; + __pyx_t_4 = 0; + __pyx_t_5 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __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, 313, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_6)) { + 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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 313, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_4 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 313, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif + __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + ++__pyx_t_4; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 313, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); #endif + ++__pyx_t_4; } + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 313, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_6(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { + __pyx_t_7 = __pyx_t_5(__pyx_t_1); + if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 313, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 313, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_3); } + __Pyx_GOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_domain); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_domain, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_domain, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; /* "constraint/solvers.py":314 * if pushdomains: @@ -10076,32 +8962,18 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * domain.popState() # <<<<<<<<<<<<<< * if values: * break - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_n_s_popState); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + __pyx_t_2 = __pyx_cur_scope->__pyx_v_domain; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_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); } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "constraint/solvers.py":313 * variable, values, pushdomains = queue.pop() @@ -10109,7 +8981,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * if values: - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10119,7 +8991,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ } /* "constraint/solvers.py":315 @@ -10128,9 +9000,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if values: # <<<<<<<<<<<<<< * break * del assignments[variable] - */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_values); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 315, __pyx_L1_error) - if (__pyx_t_7) { +*/ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_values); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 315, __pyx_L1_error) + if (__pyx_t_6) { /* "constraint/solvers.py":316 * domain.popState() @@ -10138,7 +9010,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * break # <<<<<<<<<<<<<< * del assignments[variable] * else: - */ +*/ goto __pyx_L29_break; /* "constraint/solvers.py":315 @@ -10147,7 +9019,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if values: # <<<<<<<<<<<<<< * break * del assignments[variable] - */ +*/ } /* "constraint/solvers.py":317 @@ -10156,7 +9028,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * del assignments[variable] # <<<<<<<<<<<<<< * else: * return - */ +*/ if (unlikely((PyDict_DelItem(__pyx_cur_scope->__pyx_v_assignments, __pyx_cur_scope->__pyx_v_variable) < 0))) __PYX_ERR(0, 317, __pyx_L1_error) } @@ -10166,10 +9038,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * return # <<<<<<<<<<<<<< * * # Got a value. Check it. - */ +*/ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_r = NULL; + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } __pyx_L29_break:; @@ -10180,7 +9052,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if not values: # <<<<<<<<<<<<<< * # No. Go back to last variable, if there's one. * del assignments[variable] - */ +*/ } /* "constraint/solvers.py":322 @@ -10189,7 +9061,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * assignments[variable] = values.pop() # <<<<<<<<<<<<<< * * if pushdomains: - */ +*/ __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_cur_scope->__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely((PyDict_SetItem(__pyx_cur_scope->__pyx_v_assignments, __pyx_cur_scope->__pyx_v_variable, __pyx_t_1) < 0))) __PYX_ERR(0, 322, __pyx_L1_error) @@ -10201,9 +9073,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.pushState() - */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 324, __pyx_L1_error) - if (__pyx_t_7) { +*/ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 324, __pyx_L1_error) + if (__pyx_t_6) { /* "constraint/solvers.py":325 * @@ -10211,63 +9083,60 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.pushState() * - */ +*/ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) { __pyx_t_1 = __pyx_cur_scope->__pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = 0; - __pyx_t_6 = NULL; + __pyx_t_4 = 0; + __pyx_t_5 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __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, 325, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_6)) { + 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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 325, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_4 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 325, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif + __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + ++__pyx_t_4; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 325, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); #endif + ++__pyx_t_4; } + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_6(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { + __pyx_t_7 = __pyx_t_5(__pyx_t_1); + if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 325, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 325, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_3); } + __Pyx_GOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_domain); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_domain, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_domain, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; /* "constraint/solvers.py":326 * if pushdomains: @@ -10275,32 +9144,18 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * domain.pushState() # <<<<<<<<<<<<<< * * for constraint, variables in vconstraints[variable]: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_n_s_pushState); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + __pyx_t_2 = __pyx_cur_scope->__pyx_v_domain; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_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); } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "constraint/solvers.py":325 * @@ -10308,7 +9163,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.pushState() * - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10318,7 +9173,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.pushState() - */ +*/ } /* "constraint/solvers.py":328 @@ -10327,62 +9182,59 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, pushdomains): * # Value is not good. - */ +*/ __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_vconstraints, __pyx_cur_scope->__pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __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_6 = NULL; + __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); + __pyx_t_4 = 0; + __pyx_t_5 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 328, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_6)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_7))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 328, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_4 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 328, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_4); + ++__pyx_t_4; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 328, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_4)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_4); #endif + ++__pyx_t_4; } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_6(__pyx_t_3); + __pyx_t_1 = __pyx_t_5(__pyx_t_7); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 328, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 328, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_1); } + __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); @@ -10393,18 +9245,22 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_11); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_11 = PyList_GET_ITEM(sequence, 1); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + 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); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_11); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_11); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10413,7 +9269,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __pyx_t_14 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); index = 0; __pyx_t_2 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_2)) goto __pyx_L43_unpacking_failed; __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; @@ -10444,33 +9300,33 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if not constraint(variables, domains, assignments, pushdomains): # <<<<<<<<<<<<<< * # Value is not good. * break - */ +*/ + __pyx_t_11 = NULL; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_constraint); - __pyx_t_11 = __pyx_cur_scope->__pyx_v_constraint; __pyx_t_2 = NULL; - __pyx_t_4 = 0; + __pyx_t_2 = __pyx_cur_scope->__pyx_v_constraint; + __pyx_t_3 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - __pyx_t_4 = 1; - } + 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_2, __pyx__function); + __pyx_t_3 = 0; } #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_11, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + 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_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) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_13 = (!__pyx_t_7); + __pyx_t_13 = (!__pyx_t_6); if (__pyx_t_13) { /* "constraint/solvers.py":331 @@ -10479,7 +9335,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * break # <<<<<<<<<<<<<< * else: * break - */ +*/ goto __pyx_L42_break; /* "constraint/solvers.py":329 @@ -10488,7 +9344,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if not constraint(variables, domains, assignments, pushdomains): # <<<<<<<<<<<<<< * # Value is not good. * break - */ +*/ } /* "constraint/solvers.py":328 @@ -10497,12 +9353,12 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, pushdomains): * # Value is not good. - */ +*/ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L46_for_else; __pyx_L42_break:; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L47_for_end; /*else*/ { __pyx_L46_for_else:; @@ -10513,7 +9369,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * break # <<<<<<<<<<<<<< * * if pushdomains: - */ +*/ goto __pyx_L26_break; } __pyx_L47_for_end:; @@ -10524,7 +9380,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 335, __pyx_L1_error) if (__pyx_t_13) { @@ -10534,59 +9390,56 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * - */ +*/ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) { - __pyx_t_3 = __pyx_cur_scope->__pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_3); - __pyx_t_5 = 0; - __pyx_t_6 = NULL; + __pyx_t_7 = __pyx_cur_scope->__pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_7); + __pyx_t_4 = 0; + __pyx_t_5 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_6)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_7))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 336, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_4 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 336, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_4); + ++__pyx_t_4; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 336, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_4)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_4); #endif + ++__pyx_t_4; } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_6(__pyx_t_3); + __pyx_t_1 = __pyx_t_5(__pyx_t_7); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 336, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 336, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_1); } + __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_domain); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_domain, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -10598,30 +9451,16 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * domain.popState() # <<<<<<<<<<<<<< * * # Push state before looking for next variable. - */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_n_s_popState); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_2 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + __pyx_t_2 = __pyx_cur_scope->__pyx_v_domain; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + __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_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); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10631,9 +9470,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * - */ +*/ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "constraint/solvers.py":335 * break @@ -10641,7 +9480,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ } } __pyx_L26_break:; @@ -10652,20 +9491,20 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * queue.append((variable, values, pushdomains)) # <<<<<<<<<<<<<< * * raise RuntimeError("Can't happen") - */ - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); +*/ + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_variable); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_variable); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_variable)) __PYX_ERR(0, 340, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_cur_scope->__pyx_v_variable) != (0)) __PYX_ERR(0, 340, __pyx_L1_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_values); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_values); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_cur_scope->__pyx_v_values)) __PYX_ERR(0, 340, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_cur_scope->__pyx_v_values) != (0)) __PYX_ERR(0, 340, __pyx_L1_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_pushdomains); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pushdomains); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_cur_scope->__pyx_v_pushdomains)) __PYX_ERR(0, 340, __pyx_L1_error); - __pyx_t_16 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_queue, __pyx_t_3); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 340, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_cur_scope->__pyx_v_pushdomains) != (0)) __PYX_ERR(0, 340, __pyx_L1_error); + __pyx_t_16 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_queue, __pyx_t_7); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } /* "constraint/solvers.py":342 @@ -10674,11 +9513,21 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< * * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __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_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_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); + } + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(0, 342, __pyx_L1_error) CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -10688,19 +9537,21 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * forwardcheck = self._forwardcheck * assignments = {} - */ +*/ /* function exit code */ __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_14); - __Pyx_AddTraceback("getSolutionIter", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("getSolutionIter", __pyx_clineno, __pyx_lineno, __pyx_filename); + } __pyx_L0:; - __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif @@ -10716,7 +9567,7 @@ 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 # <<<<<<<<<<<<<< * """Optimized all-solutions finder that skips forwardchecking and returns the solutions in a list. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_6getSolutionsList(PyObject *__pyx_self, @@ -10727,7 +9578,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7solvers_27OptimizedBacktrackingSolver_5getSolutionsList, "Optimized all-solutions finder that skips forwardchecking and returns the solutions in a list.\n\n Args:\n domains: Dictionary mapping variables to domains\n vconstraints: Dictionary mapping variables to a list of constraints affecting the given variables.\n\n Returns:\n the list of solutions as a dictionary.\n "); -static PyMethodDef __pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_6getSolutionsList = {"getSolutionsList", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_6getSolutionsList, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_27OptimizedBacktrackingSolver_5getSolutionsList}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_6getSolutionsList = {"getSolutionsList", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_6getSolutionsList, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_27OptimizedBacktrackingSolver_5getSolutionsList}; static PyObject *__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_6getSolutionsList(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -10750,7 +9601,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionsList (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -10758,59 +9609,40 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 344, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 344, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 344, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 344, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 344, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutionsList", 1, 3, 3, 1); __PYX_ERR(0, 344, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 344, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutionsList", 1, 3, 3, 2); __PYX_ERR(0, 344, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutionsList") < 0)) __PYX_ERR(0, 344, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 344, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 344, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 344, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_domains = ((PyObject*)values[1]); @@ -10822,31 +9654,30 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.OptimizedBacktrackingSolver.getSolutionsList", __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", 1))) __PYX_ERR(0, 344, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 344, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 344, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 344, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5getSolutionsList(__pyx_self, __pyx_v_self, __pyx_v_domains, __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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -10864,11 +9695,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; - Py_ssize_t __pyx_t_5; - PyObject *(*__pyx_t_6)(PyObject *); - int __pyx_t_7; + size_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; @@ -10877,7 +9708,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolutionsList", 1); + __Pyx_RefNannySetupContext("getSolutionsList", 0); /* "constraint/solvers.py":356 * # Does not do forwardcheck for simplicity @@ -10885,7 +9716,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * assignments: dict = {} # <<<<<<<<<<<<<< * queue: list[tuple] = [] * solutions: list[dict] = list() - */ +*/ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_assignments = ((PyObject*)__pyx_t_1); @@ -10897,7 +9728,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * queue: list[tuple] = [] # <<<<<<<<<<<<<< * solutions: list[dict] = list() * sorted_variables = self.getSortedVariables(domains, vconstraints) - */ +*/ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_queue = ((PyObject*)__pyx_t_1); @@ -10909,7 +9740,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * solutions: list[dict] = list() # <<<<<<<<<<<<<< * sorted_variables = self.getSortedVariables(domains, vconstraints) * - */ +*/ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_solutions = ((PyObject*)__pyx_t_1); @@ -10921,30 +9752,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * sorted_variables = self.getSortedVariables(domains, vconstraints) # <<<<<<<<<<<<<< * * while True: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getSortedVariables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + __pyx_t_2 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_domains, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __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_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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_sorted_variables = __pyx_t_1; __pyx_t_1 = 0; @@ -10955,7 +9772,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * while True: # <<<<<<<<<<<<<< * # Mix the Degree and Minimum Remaing Values (MRV) heuristics * for variable in sorted_variables: - */ +*/ while (1) { /* "constraint/solvers.py":363 @@ -10964,59 +9781,56 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * for variable in sorted_variables: # <<<<<<<<<<<<<< * if variable not in assignments: * # Found unassigned variable - */ +*/ if (likely(PyList_CheckExact(__pyx_v_sorted_variables)) || PyTuple_CheckExact(__pyx_v_sorted_variables)) { __pyx_t_1 = __pyx_v_sorted_variables; __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = 0; - __pyx_t_6 = NULL; + __pyx_t_4 = 0; + __pyx_t_5 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_sorted_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_sorted_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 363, __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, 363, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_6)) { + 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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 363, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_4 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 363, __pyx_L1_error) - #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + ++__pyx_t_4; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 363, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4)); #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); #endif + ++__pyx_t_4; } + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error) } else { - __pyx_t_2 = __pyx_t_6(__pyx_t_1); + __pyx_t_2 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 363, __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_2); } + __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_2); __pyx_t_2 = 0; @@ -11026,9 +9840,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * if variable not in assignments: # <<<<<<<<<<<<<< * # Found unassigned variable * values = domains[variable][:] - */ - __pyx_t_7 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 364, __pyx_L1_error) - if (__pyx_t_7) { +*/ + __pyx_t_6 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 364, __pyx_L1_error) + if (__pyx_t_6) { /* "constraint/solvers.py":366 * if variable not in assignments: @@ -11036,14 +9850,14 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * values = domains[variable][:] # <<<<<<<<<<<<<< * break * else: - */ +*/ __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_values, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_values, __pyx_t_7); + __pyx_t_7 = 0; /* "constraint/solvers.py":367 * # Found unassigned variable @@ -11051,7 +9865,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * break # <<<<<<<<<<<<<< * else: * # No unassigned variables. We've got a solution. Go back - */ +*/ goto __pyx_L6_break; /* "constraint/solvers.py":364 @@ -11060,7 +9874,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * if variable not in assignments: # <<<<<<<<<<<<<< * # Found unassigned variable * values = domains[variable][:] - */ +*/ } /* "constraint/solvers.py":363 @@ -11069,7 +9883,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * for variable in sorted_variables: # <<<<<<<<<<<<<< * if variable not in assignments: * # Found unassigned variable - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L8_for_else; @@ -11085,7 +9899,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * solutions.append(assignments.copy()) # <<<<<<<<<<<<<< * if not queue: * return solutions - */ +*/ __pyx_t_1 = PyDict_Copy(__pyx_v_assignments); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_solutions, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 371, __pyx_L1_error) @@ -11097,9 +9911,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * if not queue: # <<<<<<<<<<<<<< * return solutions * variable, values = queue.pop() - */ - __pyx_t_7 = (PyList_GET_SIZE(__pyx_v_queue) != 0); - __pyx_t_9 = (!__pyx_t_7); +*/ + __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) + __pyx_t_9 = (!__pyx_t_6); if (__pyx_t_9) { /* "constraint/solvers.py":373 @@ -11108,7 +9923,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * return solutions # <<<<<<<<<<<<<< * variable, values = queue.pop() * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_solutions); __pyx_r = __pyx_v_solutions; @@ -11120,7 +9935,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * if not queue: # <<<<<<<<<<<<<< * return solutions * variable, values = queue.pop() - */ +*/ } /* "constraint/solvers.py":374 @@ -11129,7 +9944,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * variable, values = queue.pop() # <<<<<<<<<<<<<< * * while True: - */ +*/ __pyx_t_1 = __Pyx_PyList_Pop(__pyx_v_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -11142,18 +9957,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_7); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 0); + 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); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 374, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11162,9 +9981,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); - index = 0; __pyx_t_3 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); + index = 0; __pyx_t_7 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L11_unpacking_failed; + __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) @@ -11178,8 +9997,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g __PYX_ERR(0, 374, __pyx_L1_error) __pyx_L12_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_values, __pyx_t_2); __pyx_t_2 = 0; } @@ -11191,7 +10010,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * while True: # <<<<<<<<<<<<<< * # We have a variable. Do we have any values left? * if not values: - */ +*/ while (1) { /* "constraint/solvers.py":378 @@ -11200,10 +10019,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * if not values: # <<<<<<<<<<<<<< * # No. Go back to last variable, if there's one. * del assignments[variable] - */ +*/ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_values); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 378, __pyx_L1_error) - __pyx_t_7 = (!__pyx_t_9); - if (__pyx_t_7) { + __pyx_t_6 = (!__pyx_t_9); + if (__pyx_t_6) { /* "constraint/solvers.py":380 * if not values: @@ -11211,7 +10030,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * del assignments[variable] # <<<<<<<<<<<<<< * while queue: * variable, values = queue.pop() - */ +*/ if (unlikely((PyDict_DelItem(__pyx_v_assignments, __pyx_v_variable) < 0))) __PYX_ERR(0, 380, __pyx_L1_error) /* "constraint/solvers.py":381 @@ -11220,10 +10039,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * while queue: # <<<<<<<<<<<<<< * variable, values = queue.pop() * if values: - */ +*/ while (1) { - __pyx_t_7 = (PyList_GET_SIZE(__pyx_v_queue) != 0); - if (!__pyx_t_7) break; + __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) + if (!__pyx_t_6) break; /* "constraint/solvers.py":382 * del assignments[variable] @@ -11231,7 +10051,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * variable, values = queue.pop() # <<<<<<<<<<<<<< * if values: * break - */ +*/ __pyx_t_1 = __Pyx_PyList_Pop(__pyx_v_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -11244,19 +10064,23 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_7); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + 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); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { @@ -11264,11 +10088,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); + __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_L18_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_3 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L18_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); + 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) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -11282,8 +10106,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g } __Pyx_DECREF_SET(__pyx_v_variable, __pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_7); + __pyx_t_7 = 0; /* "constraint/solvers.py":383 * while queue: @@ -11291,9 +10115,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * if values: # <<<<<<<<<<<<<< * break * del assignments[variable] - */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_values); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 383, __pyx_L1_error) - if (__pyx_t_7) { +*/ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_values); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 383, __pyx_L1_error) + if (__pyx_t_6) { /* "constraint/solvers.py":384 * variable, values = queue.pop() @@ -11301,7 +10125,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * break # <<<<<<<<<<<<<< * del assignments[variable] * else: - */ +*/ goto __pyx_L17_break; /* "constraint/solvers.py":383 @@ -11310,7 +10134,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * if values: # <<<<<<<<<<<<<< * break * del assignments[variable] - */ +*/ } /* "constraint/solvers.py":385 @@ -11319,7 +10143,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * del assignments[variable] # <<<<<<<<<<<<<< * else: * return solutions - */ +*/ if (unlikely((PyDict_DelItem(__pyx_v_assignments, __pyx_v_variable) < 0))) __PYX_ERR(0, 385, __pyx_L1_error) } @@ -11329,7 +10153,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * return solutions # <<<<<<<<<<<<<< * * # Got a value. Check it. - */ +*/ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_solutions); @@ -11344,7 +10168,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * if not values: # <<<<<<<<<<<<<< * # No. Go back to last variable, if there's one. * del assignments[variable] - */ +*/ } /* "constraint/solvers.py":390 @@ -11353,7 +10177,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * assignments[variable] = values.pop() # <<<<<<<<<<<<<< * for constraint, variables in vconstraints[variable]: * if not constraint(variables, domains, assignments, None): - */ +*/ __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely((PyDict_SetItem(__pyx_v_assignments, __pyx_v_variable, __pyx_t_1) < 0))) __PYX_ERR(0, 390, __pyx_L1_error) @@ -11365,62 +10189,59 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, None): * # Value is not good. - */ +*/ __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __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_6 = NULL; + __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); + __pyx_t_4 = 0; + __pyx_t_5 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_6)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_7))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 391, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_4 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 391, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_4); + ++__pyx_t_4; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 391, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_4)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_4); #endif + ++__pyx_t_4; } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_6(__pyx_t_3); + __pyx_t_1 = __pyx_t_5(__pyx_t_7); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 391, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 391, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_1); } + __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); @@ -11431,18 +10252,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_10); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_10 = PyList_GET_ITEM(sequence, 1); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + 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); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_10); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_10); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11451,7 +10276,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g __pyx_t_12 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_12); if (unlikely(!__pyx_t_2)) goto __pyx_L23_unpacking_failed; __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; @@ -11478,33 +10303,33 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * if not constraint(variables, domains, assignments, None): # <<<<<<<<<<<<<< * # Value is not good. * break - */ +*/ + __pyx_t_10 = NULL; __Pyx_INCREF(__pyx_v_constraint); - __pyx_t_10 = __pyx_v_constraint; __pyx_t_2 = NULL; - __pyx_t_4 = 0; + __pyx_t_2 = __pyx_v_constraint; + __pyx_t_3 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_4 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_10); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __pyx_t_3 = 0; } #endif { - PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, Py_None}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + 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_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) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = (!__pyx_t_7); + __pyx_t_9 = (!__pyx_t_6); if (__pyx_t_9) { /* "constraint/solvers.py":394 @@ -11513,7 +10338,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * break # <<<<<<<<<<<<<< * else: * break - */ +*/ goto __pyx_L22_break; /* "constraint/solvers.py":392 @@ -11522,7 +10347,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * if not constraint(variables, domains, assignments, None): # <<<<<<<<<<<<<< * # Value is not good. * break - */ +*/ } /* "constraint/solvers.py":391 @@ -11531,12 +10356,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, None): * # Value is not good. - */ +*/ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L26_for_else; __pyx_L22_break:; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L27_for_end; /*else*/ { __pyx_L26_for_else:; @@ -11547,7 +10372,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * break # <<<<<<<<<<<<<< * * # Push state before looking for next variable. - */ +*/ goto __pyx_L14_break; } __pyx_L27_for_end:; @@ -11560,17 +10385,17 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * queue.append((variable, values)) # <<<<<<<<<<<<<< * * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); +*/ + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_variable); __Pyx_GIVEREF(__pyx_v_variable); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable)) __PYX_ERR(0, 399, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_variable) != (0)) __PYX_ERR(0, 399, __pyx_L1_error); __Pyx_INCREF(__pyx_v_values); __Pyx_GIVEREF(__pyx_v_values); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_values)) __PYX_ERR(0, 399, __pyx_L1_error); - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_queue, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 399, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_values) != (0)) __PYX_ERR(0, 399, __pyx_L1_error); + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_queue, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } /* "constraint/solvers.py":344 @@ -11579,7 +10404,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 # <<<<<<<<<<<<<< * """Optimized all-solutions finder that skips forwardchecking and returns the solutions in a list. * - */ +*/ /* function exit code */ __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); @@ -11587,7 +10412,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("constraint.solvers.OptimizedBacktrackingSolver.getSolutionsList", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -11612,7 +10437,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * if self._forwardcheck: * return list(self.getSolutionIter(domains, constraints, vconstraints)) - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_8getSolutions(PyObject *__pyx_self, @@ -11622,7 +10447,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_8getSolutions = {"getSolutions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_8getSolutions, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_8getSolutions = {"getSolutions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_8getSolutions, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_8getSolutions(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -11646,7 +10471,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutions (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -11654,72 +10479,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 401, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 401, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 401, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 401, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 401, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 401, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 4, 4, 1); __PYX_ERR(0, 401, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 401, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 4, 4, 2); __PYX_ERR(0, 401, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 401, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 4, 4, 3); __PYX_ERR(0, 401, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutions") < 0)) __PYX_ERR(0, 401, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 401, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 401, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 401, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 401, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_domains = ((PyObject*)values[1]); @@ -11732,32 +10531,31 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.OptimizedBacktrackingSolver.getSolutions", __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", 1))) __PYX_ERR(0, 401, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 401, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 401, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 401, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 401, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 401, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_7getSolutions(__pyx_self, __pyx_v_self, __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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -11768,12 +10566,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_7g PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - unsigned int __pyx_t_5; + size_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolutions", 1); + __Pyx_RefNannySetupContext("getSolutions", 0); /* "constraint/solvers.py":402 * @@ -11781,8 +10578,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_7g * if self._forwardcheck: # <<<<<<<<<<<<<< * return list(self.getSolutionIter(domains, constraints, vconstraints)) * return self.getSolutionsList(domains, vconstraints) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_forwardcheck_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_forwardcheck_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11794,31 +10591,17 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_7g * return list(self.getSolutionIter(domains, constraints, vconstraints)) # <<<<<<<<<<<<<< * return self.getSolutionsList(domains, vconstraints) * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getSolutionIter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - #endif + __pyx_t_3 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = 0; { - PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __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_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); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -11833,7 +10616,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_7g * if self._forwardcheck: # <<<<<<<<<<<<<< * return list(self.getSolutionIter(domains, constraints, vconstraints)) * return self.getSolutionsList(domains, vconstraints) - */ +*/ } /* "constraint/solvers.py":404 @@ -11842,31 +10625,17 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_7g * return self.getSolutionsList(domains, vconstraints) # <<<<<<<<<<<<<< * * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getSolutionsList); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_5 = 1; - } - } - #endif + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_4 = 0; { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_domains, __pyx_v_vconstraints}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __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_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); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -11878,13 +10647,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_7g * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * if self._forwardcheck: * return list(self.getSolutionIter(domains, constraints, vconstraints)) - */ +*/ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("constraint.solvers.OptimizedBacktrackingSolver.getSolutions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -11899,7 +10667,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_7g * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * iter = self.getSolutionIter(domains, constraints, vconstraints) * try: - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_10getSolution(PyObject *__pyx_self, @@ -11909,7 +10677,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_10getSolution = {"getSolution", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_10getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_10getSolution = {"getSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_10getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_10getSolution(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -11933,7 +10701,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -11941,72 +10709,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 406, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 406, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 406, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 406, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 406, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 406, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, 1); __PYX_ERR(0, 406, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 406, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, 2); __PYX_ERR(0, 406, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 406, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, 3); __PYX_ERR(0, 406, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolution") < 0)) __PYX_ERR(0, 406, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 406, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 406, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 406, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 406, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_domains = ((PyObject*)values[1]); @@ -12019,32 +10761,31 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.OptimizedBacktrackingSolver.getSolution", __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", 1))) __PYX_ERR(0, 406, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 406, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 406, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 406, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 406, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 406, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9getSolution(__pyx_self, __pyx_v_self, __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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -12055,16 +10796,15 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; + size_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; + int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolution", 1); + __Pyx_RefNannySetupContext("getSolution", 0); /* "constraint/solvers.py":407 * @@ -12072,30 +10812,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g * iter = self.getSolutionIter(domains, constraints, vconstraints) # <<<<<<<<<<<<<< * try: * return next(iter) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getSolutionIter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif +*/ + __pyx_t_2 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; { - PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __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_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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_iter = __pyx_t_1; __pyx_t_1 = 0; @@ -12106,14 +10832,14 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g * try: # <<<<<<<<<<<<<< * return next(iter) * except StopIteration: - */ +*/ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_7); /*try:*/ { /* "constraint/solvers.py":409 @@ -12122,7 +10848,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g * return next(iter) # <<<<<<<<<<<<<< * except StopIteration: * return None - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_iter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 409, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); @@ -12136,12 +10862,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g * try: # <<<<<<<<<<<<<< * return next(iter) * except StopIteration: - */ +*/ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/solvers.py":410 * try: @@ -12149,14 +10874,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g * except StopIteration: # <<<<<<<<<<<<<< * return None * - */ - __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); - if (__pyx_t_8) { - __Pyx_AddTraceback("constraint.solvers.OptimizedBacktrackingSolver.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 410, __pyx_L5_except_error) - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); +*/ + __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); + if (__pyx_t_7) { + __Pyx_ErrRestore(0,0,0); /* "constraint/solvers.py":411 * return next(iter) @@ -12164,12 +10885,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g * return None # <<<<<<<<<<<<<< * * def getSortedVariables(self, domains: dict, vconstraints: dict) -> list: - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; @@ -12180,24 +10898,24 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g * try: # <<<<<<<<<<<<<< * return next(iter) * except StopIteration: - */ +*/ __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L0; __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L0; } @@ -12207,13 +10925,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * iter = self.getSolutionIter(domains, constraints, vconstraints) * try: - */ +*/ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("constraint.solvers.OptimizedBacktrackingSolver.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -12229,7 +10946,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g * def getSortedVariables(self, domains: dict, vconstraints: dict) -> list: # <<<<<<<<<<<<<< * """Sorts the list of variables on number of vconstraints to find unassigned variables quicker. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_12getSortedVariables(PyObject *__pyx_self, @@ -12240,7 +10957,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7solvers_27OptimizedBacktrackingSolver_11getSortedVariables, "Sorts the list of variables on number of vconstraints to find unassigned variables quicker.\n\n Args:\n domains: Dictionary mapping variables to their domains\n vconstraints: Dictionary mapping variables to a list\n of constraints affecting the given variables.\n\n Returns:\n the list of variables, sorted from highest number of vconstraints to lowest.\n "); -static PyMethodDef __pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_12getSortedVariables = {"getSortedVariables", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_12getSortedVariables, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_27OptimizedBacktrackingSolver_11getSortedVariables}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_12getSortedVariables = {"getSortedVariables", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_12getSortedVariables, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_27OptimizedBacktrackingSolver_11getSortedVariables}; static PyObject *__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_12getSortedVariables(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -12263,7 +10980,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSortedVariables (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -12271,59 +10988,40 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 413, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 413, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 413, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 413, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 413, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSortedVariables", 1, 3, 3, 1); __PYX_ERR(0, 413, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 413, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSortedVariables", 1, 3, 3, 2); __PYX_ERR(0, 413, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSortedVariables") < 0)) __PYX_ERR(0, 413, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 413, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 413, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 413, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_domains = ((PyObject*)values[1]); @@ -12335,31 +11033,30 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.OptimizedBacktrackingSolver.getSortedVariables", __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", 1))) __PYX_ERR(0, 413, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 413, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 413, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 413, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11getSortedVariables(__pyx_self, __pyx_v_self, __pyx_v_domains, __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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -12370,7 +11067,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds * lst.sort(key=lambda x: (x[0], x[1])) # <<<<<<<<<<<<<< * return [c for _, _, c in lst] * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_18getSortedVariables_lambda1(PyObject *__pyx_self, @@ -12380,7 +11077,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_18getSortedVariables_lambda1 = {"lambda1", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_18getSortedVariables_lambda1, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_18getSortedVariables_lambda1 = {"lambda1", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_18getSortedVariables_lambda1, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_18getSortedVariables_lambda1(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -12401,7 +11098,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -12409,33 +11106,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 425, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda1") < 0)) __PYX_ERR(0, 425, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 425, __pyx_L3_error) } __pyx_v_x = values[0]; } @@ -12445,11 +11137,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.OptimizedBacktrackingSolver.getSortedVariables.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -12458,11 +11147,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, __pyx_v_x); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -12477,18 +11163,18 @@ static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("lambda1", 1); + __Pyx_RefNannySetupContext("lambda1", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 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); 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_PyInt_From_long, 0, 0, 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); 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); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 425, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 425, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -12514,7 +11200,7 @@ static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self * def getSortedVariables(self, domains: dict, vconstraints: dict) -> list: # <<<<<<<<<<<<<< * """Sorts the list of variables on number of vconstraints to find unassigned variables quicker. * - */ +*/ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11getSortedVariables(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_domains, PyObject *__pyx_v_vconstraints) { PyObject *__pyx_v_lst = NULL; @@ -12533,13 +11219,14 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 Py_ssize_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; + size_t __pyx_t_11; PyObject *__pyx_t_12 = NULL; - PyObject *(*__pyx_t_13)(PyObject *); + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSortedVariables", 1); + __Pyx_RefNannySetupContext("getSortedVariables", 0); /* "constraint/solvers.py":424 * the list of variables, sorted from highest number of vconstraints to lowest. @@ -12547,7 +11234,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 * lst = [(-len(vconstraints[variable]), len(domains[variable]), variable) for variable in domains] # <<<<<<<<<<<<<< * lst.sort(key=lambda x: (x[0], x[1])) * return [c for _, _, c in lst] - */ +*/ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); @@ -12568,23 +11255,23 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 424, __pyx_L5_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromSsize_t((-__pyx_t_8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 424, __pyx_L5_error) + __pyx_t_6 = PyLong_FromSsize_t((-__pyx_t_8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 424, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr3__pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 424, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 424, __pyx_L5_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 424, __pyx_L5_error) + __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 424, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 424, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6)) __PYX_ERR(0, 424, __pyx_L5_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 424, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9)) __PYX_ERR(0, 424, __pyx_L5_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 424, __pyx_L5_error); __Pyx_INCREF(__pyx_8genexpr3__pyx_v_variable); __Pyx_GIVEREF(__pyx_8genexpr3__pyx_v_variable); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_8genexpr3__pyx_v_variable)) __PYX_ERR(0, 424, __pyx_L5_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_8genexpr3__pyx_v_variable) != (0)) __PYX_ERR(0, 424, __pyx_L5_error); __pyx_t_6 = 0; __pyx_t_9 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 424, __pyx_L5_error) @@ -12607,20 +11294,25 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 * lst.sort(key=lambda x: (x[0], x[1])) # <<<<<<<<<<<<<< * return [c for _, _, c in lst] * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_lst, __pyx_n_s_sort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_18getSortedVariables_lambda1, 0, __pyx_n_s_OptimizedBacktrackingSolver_getS_2, NULL, __pyx_n_s_constraint_solvers, __pyx_d, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_t_10) < 0) __PYX_ERR(0, 425, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 425, __pyx_L1_error) +*/ + __pyx_t_2 = __pyx_v_lst; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_18getSortedVariables_lambda1, 0, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver_getS_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = 0; + { + 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); + __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, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "constraint/solvers.py":426 * lst = [(-len(vconstraints[variable]), len(domains[variable]), variable) for variable in domains] @@ -12628,29 +11320,27 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 * return [c for _, _, c in lst] # <<<<<<<<<<<<<< * * class RecursiveBacktrackingSolver(Solver): - */ +*/ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 426, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_9); __pyx_t_4 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 426, __pyx_L11_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 426, __pyx_L11_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; + __pyx_t_10 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_4); + ++__pyx_t_4; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 426, __pyx_L11_error) + __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 != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); @@ -12659,58 +11349,64 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_6); + __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_12); } else { - __pyx_t_9 = PyList_GET_ITEM(sequence, 0); - __pyx_t_6 = PyList_GET_ITEM(sequence, 1); - __pyx_t_11 = PyList_GET_ITEM(sequence, 2); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + 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); + 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); + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 426, __pyx_L11_error) + __Pyx_XGOTREF(__pyx_t_12); } - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(__pyx_t_11); #else - __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 426, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L11_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 426, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 426, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_12); #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else { Py_ssize_t index = -1; - __pyx_t_12 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 426, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); - index = 0; __pyx_t_9 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_9)) goto __pyx_L14_unpacking_failed; - __Pyx_GOTREF(__pyx_t_9); - index = 1; __pyx_t_6 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L14_unpacking_failed; + __pyx_t_13 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 426, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); + index = 0; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L14_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_6 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_6)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); - index = 2; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L14_unpacking_failed; - __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 3) < 0) __PYX_ERR(0, 426, __pyx_L11_error) - __pyx_t_13 = NULL; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + 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) + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L15_unpacking_done; __pyx_L14_unpacking_failed:; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 426, __pyx_L11_error) __pyx_L15_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v__, __pyx_t_9); - __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v__, __pyx_t_2); + __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_8genexpr4__pyx_v__, __pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_c, __pyx_t_11); - __pyx_t_11 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_8genexpr4__pyx_v_c))) __PYX_ERR(0, 426, __pyx_L11_error) + __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_c, __pyx_t_12); + __pyx_t_12 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_8genexpr4__pyx_v_c))) __PYX_ERR(0, 426, __pyx_L11_error) } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_8genexpr4__pyx_v__); __pyx_8genexpr4__pyx_v__ = 0; __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_c); __pyx_8genexpr4__pyx_v_c = 0; goto __pyx_L17_exit_scope; @@ -12720,8 +11416,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 goto __pyx_L1_error; __pyx_L17_exit_scope:; } /* exit inner scope */ - __pyx_r = ((PyObject*)__pyx_t_10); - __pyx_t_10 = 0; + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; goto __pyx_L0; /* "constraint/solvers.py":413 @@ -12730,7 +11426,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 * def getSortedVariables(self, domains: dict, vconstraints: dict) -> list: # <<<<<<<<<<<<<< * """Sorts the list of variables on number of vconstraints to find unassigned variables quicker. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -12739,8 +11435,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 __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_AddTraceback("constraint.solvers.OptimizedBacktrackingSolver.getSortedVariables", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -12759,7 +11455,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_1__init__(PyObject *__pyx_self, @@ -12770,7 +11466,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7solvers_27RecursiveBacktrackingSolver___init__, "Initialization method.\n\n Args:\n forwardcheck (bool): If false forward checking will not be\n requested to constraints while looking for solutions\n (default is true)\n "); -static PyMethodDef __pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_27RecursiveBacktrackingSolver___init__}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_27RecursiveBacktrackingSolver___init__}; static PyObject *__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -12792,7 +11488,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -12800,47 +11496,41 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_forwardcheck,0}; - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 456, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 456, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 456, __pyx_L3_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 (!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) } } } else { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 456, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 456, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } + if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); } __pyx_v_self = values[0]; __pyx_v_forwardcheck = values[1]; @@ -12851,11 +11541,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.RecursiveBacktrackingSolver.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -12864,11 +11551,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver___init__(__pyx_self, __pyx_v_self, __pyx_v_forwardcheck); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -12880,7 +11564,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver___ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/solvers.py":464 * (default is true) @@ -12888,8 +11572,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver___ * self._forwardcheck = forwardcheck # <<<<<<<<<<<<<< * * def recursiveBacktracking(self, solutions, domains, vconstraints, assignments, single): - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_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 * """ @@ -12897,7 +11581,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver___ * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -12917,7 +11601,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver___ * def recursiveBacktracking(self, solutions, domains, vconstraints, assignments, single): # <<<<<<<<<<<<<< * """Mix the Degree and Minimum Remaing Values (MRV) heuristics. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_3recursiveBacktracking(PyObject *__pyx_self, @@ -12928,7 +11612,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7solvers_27RecursiveBacktrackingSolver_2recursiveBacktracking, "Mix the Degree and Minimum Remaing Values (MRV) heuristics.\n\n Args:\n solutions: _description_\n domains: _description_\n vconstraints: _description_\n assignments: _description_\n single: _description_\n\n Returns:\n _description_\n "); -static PyMethodDef __pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_3recursiveBacktracking = {"recursiveBacktracking", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_3recursiveBacktracking, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_27RecursiveBacktrackingSolver_2recursiveBacktracking}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_3recursiveBacktracking = {"recursiveBacktracking", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_3recursiveBacktracking, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_27RecursiveBacktrackingSolver_2recursiveBacktracking}; static PyObject *__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_3recursiveBacktracking(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -12954,7 +11638,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("recursiveBacktracking (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -12962,98 +11646,58 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_solutions,&__pyx_n_s_domains,&__pyx_n_s_vconstraints,&__pyx_n_s_assignments,&__pyx_n_s_single,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + case 6: + values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 466, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 466, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 466, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 466, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 466, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 466, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 466, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_solutions)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 466, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("recursiveBacktracking", 1, 6, 6, 1); __PYX_ERR(0, 466, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 466, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("recursiveBacktracking", 1, 6, 6, 2); __PYX_ERR(0, 466, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 466, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("recursiveBacktracking", 1, 6, 6, 3); __PYX_ERR(0, 466, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 466, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("recursiveBacktracking", 1, 6, 6, 4); __PYX_ERR(0, 466, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_single)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 466, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("recursiveBacktracking", 1, 6, 6, 5); __PYX_ERR(0, 466, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "recursiveBacktracking") < 0)) __PYX_ERR(0, 466, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 6)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 466, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 466, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 466, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 466, __pyx_L3_error) + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 466, __pyx_L3_error) + values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 466, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_solutions = values[1]; @@ -13068,11 +11712,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.RecursiveBacktrackingSolver.recursiveBacktracking", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -13081,11 +11722,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2recursiveBacktracking(__pyx_self, __pyx_v_self, __pyx_v_solutions, __pyx_v_domains, __pyx_v_vconstraints, __pyx_v_assignments, __pyx_v_single); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -13097,7 +11735,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds * lst.sort(key=lambda x: (x[0], x[1])) # <<<<<<<<<<<<<< * for item in lst: * if item[-1] not in assignments: - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_21recursiveBacktracking_lambda2(PyObject *__pyx_self, @@ -13107,7 +11745,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_21recursiveBacktracking_lambda2 = {"lambda2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_21recursiveBacktracking_lambda2, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_21recursiveBacktracking_lambda2 = {"lambda2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_21recursiveBacktracking_lambda2, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_21recursiveBacktracking_lambda2(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -13128,7 +11766,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -13136,33 +11774,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 480, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 480, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda2") < 0)) __PYX_ERR(0, 480, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 480, __pyx_L3_error) } __pyx_v_x = values[0]; } @@ -13172,11 +11805,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.RecursiveBacktrackingSolver.recursiveBacktracking.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -13185,11 +11815,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, __pyx_v_x); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -13204,18 +11831,18 @@ static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("lambda2", 1); + __Pyx_RefNannySetupContext("lambda2", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 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); 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_PyInt_From_long, 0, 0, 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); 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); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 480, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 480, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -13241,7 +11868,7 @@ static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self * def recursiveBacktracking(self, solutions, domains, vconstraints, assignments, single): # <<<<<<<<<<<<<< * """Mix the Degree and Minimum Remaing Values (MRV) heuristics. * - */ +*/ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2recursiveBacktracking(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_solutions, PyObject *__pyx_v_domains, PyObject *__pyx_v_vconstraints, PyObject *__pyx_v_assignments, PyObject *__pyx_v_single) { PyObject *__pyx_v_lst = NULL; @@ -13265,8 +11892,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - unsigned int __pyx_t_10; + size_t __pyx_t_9; + int __pyx_t_10; int __pyx_t_11; PyObject *(*__pyx_t_12)(PyObject *); PyObject *__pyx_t_13 = NULL; @@ -13275,7 +11902,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("recursiveBacktracking", 1); + __Pyx_RefNannySetupContext("recursiveBacktracking", 0); /* "constraint/solvers.py":479 * _description_ @@ -13283,7 +11910,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * lst = [(-len(vconstraints[variable]), len(domains[variable]), variable) for variable in domains] # <<<<<<<<<<<<<< * lst.sort(key=lambda x: (x[0], x[1])) * for item in lst: - */ +*/ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); @@ -13294,74 +11921,71 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_domains); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L5_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, 479, __pyx_L5_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 479, __pyx_L5_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 479, __pyx_L5_error) - #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 479, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_5); - #endif + __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); + ++__pyx_t_3; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 479, __pyx_L5_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 479, __pyx_L5_error) + __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3)); #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 479, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); #endif + ++__pyx_t_3; } + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 479, __pyx_L5_error) } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 479, __pyx_L5_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 479, __pyx_L5_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_5); } + __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_variable, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_vconstraints, __pyx_8genexpr5__pyx_v_variable); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 479, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 479, __pyx_L5_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyInt_FromSsize_t((-__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 479, __pyx_L5_error) + __pyx_t_5 = PyLong_FromSsize_t((-__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 479, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_domains, __pyx_8genexpr5__pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 479, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 479, __pyx_L5_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 479, __pyx_L5_error) + __pyx_t_7 = PyLong_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 479, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 479, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5)) __PYX_ERR(0, 479, __pyx_L5_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 479, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(0, 479, __pyx_L5_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 479, __pyx_L5_error); __Pyx_INCREF(__pyx_8genexpr5__pyx_v_variable); __Pyx_GIVEREF(__pyx_8genexpr5__pyx_v_variable); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_8genexpr5__pyx_v_variable)) __PYX_ERR(0, 479, __pyx_L5_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_8genexpr5__pyx_v_variable) != (0)) __PYX_ERR(0, 479, __pyx_L5_error); __pyx_t_5 = 0; __pyx_t_7 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 479, __pyx_L5_error) @@ -13384,20 +12008,25 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * lst.sort(key=lambda x: (x[0], x[1])) # <<<<<<<<<<<<<< * for item in lst: * if item[-1] not in assignments: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_lst, __pyx_n_s_sort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_21recursiveBacktracking_lambda2, 0, __pyx_n_s_RecursiveBacktrackingSolver_recu, NULL, __pyx_n_s_constraint_solvers, __pyx_d, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_t_8) < 0) __PYX_ERR(0, 480, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 480, __pyx_L1_error) +*/ + __pyx_t_2 = __pyx_v_lst; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_21recursiveBacktracking_lambda2, 0, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver_recu, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = 0; + { + 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); + __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; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "constraint/solvers.py":481 * lst = [(-len(vconstraints[variable]), len(domains[variable]), variable) for variable in domains] @@ -13405,25 +12034,23 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for item in lst: # <<<<<<<<<<<<<< * if item[-1] not in assignments: * # Found an unassigned variable. Let's go. - */ - __pyx_t_8 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_8); +*/ + __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 481, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 481, __pyx_L1_error) - #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + ++__pyx_t_3; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7); + __pyx_t_7 = 0; /* "constraint/solvers.py":482 * lst.sort(key=lambda x: (x[0], x[1])) @@ -13431,12 +12058,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if item[-1] not in assignments: # <<<<<<<<<<<<<< * # Found an unassigned variable. Let's go. * break - */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_item, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 482, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_9) { +*/ + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_item, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); 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; + if (__pyx_t_10) { /* "constraint/solvers.py":484 * if item[-1] not in assignments: @@ -13444,7 +12071,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * break # <<<<<<<<<<<<<< * else: * # No unassigned variables. We've got a solution. - */ +*/ goto __pyx_L11_break; /* "constraint/solvers.py":482 @@ -13453,7 +12080,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if item[-1] not in assignments: # <<<<<<<<<<<<<< * # Found an unassigned variable. Let's go. * break - */ +*/ } /* "constraint/solvers.py":481 @@ -13462,12 +12089,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for item in lst: # <<<<<<<<<<<<<< * if item[-1] not in assignments: * # Found an unassigned variable. Let's go. - */ +*/ } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L13_for_else; __pyx_L11_break:; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L14_for_end; /*else*/ { __pyx_L13_for_else:; @@ -13478,33 +12105,19 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * solutions.append(assignments.copy()) # <<<<<<<<<<<<<< * return solutions * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_assignments, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = NULL; - __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_10 = 1; - } - } - #endif +*/ + __pyx_t_7 = __pyx_v_assignments; + __Pyx_INCREF(__pyx_t_7); + __pyx_t_9 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_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); } - __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_solutions, __pyx_t_8); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 487, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_solutions, __pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 487, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/solvers.py":488 * # No unassigned variables. We've got a solution. @@ -13512,7 +12125,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * return solutions # <<<<<<<<<<<<<< * * variable = item[-1] - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_solutions); __pyx_r = __pyx_v_solutions; @@ -13526,11 +12139,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * variable = item[-1] # <<<<<<<<<<<<<< * assignments[variable] = None * - */ - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_item, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 490, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_variable = __pyx_t_8; - __pyx_t_8 = 0; +*/ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_item, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); 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; /* "constraint/solvers.py":491 * @@ -13538,7 +12151,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * assignments[variable] = None # <<<<<<<<<<<<<< * * forwardcheck = self._forwardcheck - */ +*/ if (unlikely((PyObject_SetItem(__pyx_v_assignments, __pyx_v_variable, Py_None) < 0))) __PYX_ERR(0, 491, __pyx_L1_error) /* "constraint/solvers.py":493 @@ -13547,11 +12160,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * forwardcheck = self._forwardcheck # <<<<<<<<<<<<<< * if forwardcheck: * pushdomains = [domains[x] for x in domains if x not in assignments] - */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_forwardcheck_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_forwardcheck = __pyx_t_8; - __pyx_t_8 = 0; +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_forwardcheck_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_forwardcheck = __pyx_t_1; + __pyx_t_1 = 0; /* "constraint/solvers.py":494 * @@ -13559,9 +12172,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if forwardcheck: # <<<<<<<<<<<<<< * pushdomains = [domains[x] for x in domains if x not in assignments] * else: - */ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 494, __pyx_L1_error) - if (__pyx_t_9) { +*/ + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 494, __pyx_L1_error) + if (__pyx_t_10) { /* "constraint/solvers.py":495 * forwardcheck = self._forwardcheck @@ -13569,73 +12182,70 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * pushdomains = [domains[x] for x in domains if x not in assignments] # <<<<<<<<<<<<<< * else: * pushdomains = None - */ +*/ { /* enter inner scope */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 495, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_v_domains)) || PyTuple_CheckExact(__pyx_v_domains)) { - __pyx_t_2 = __pyx_v_domains; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = __pyx_v_domains; __Pyx_INCREF(__pyx_t_7); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_domains); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L18_error) + __pyx_t_3 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_domains); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 495, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L18_error) } for (;;) { if (likely(!__pyx_t_4)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(PyList_CheckExact(__pyx_t_7))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 495, __pyx_L18_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 495, __pyx_L18_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_1); - #endif + __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_3); + ++__pyx_t_3; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 495, __pyx_L18_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 495, __pyx_L18_error) + __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_3)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_3); #endif + ++__pyx_t_3; } + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 495, __pyx_L18_error) } else { - __pyx_t_1 = __pyx_t_4(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { + __pyx_t_8 = __pyx_t_4(__pyx_t_7); + if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 495, __pyx_L18_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 495, __pyx_L18_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_1); } - __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_x, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_8genexpr6__pyx_v_x, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 495, __pyx_L18_error) - if (__pyx_t_9) { - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_domains, __pyx_8genexpr6__pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 495, __pyx_L18_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_x, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_8genexpr6__pyx_v_x, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 495, __pyx_L18_error) + if (__pyx_t_10) { + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_domains, __pyx_8genexpr6__pyx_v_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 495, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 495, __pyx_L18_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_x); __pyx_8genexpr6__pyx_v_x = 0; goto __pyx_L23_exit_scope; __pyx_L18_error:; @@ -13643,8 +12253,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r goto __pyx_L1_error; __pyx_L23_exit_scope:; } /* exit inner scope */ - __pyx_v_pushdomains = ((PyObject*)__pyx_t_8); - __pyx_t_8 = 0; + __pyx_v_pushdomains = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; /* "constraint/solvers.py":494 * @@ -13652,7 +12262,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if forwardcheck: # <<<<<<<<<<<<<< * pushdomains = [domains[x] for x in domains if x not in assignments] * else: - */ +*/ goto __pyx_L15; } @@ -13662,7 +12272,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * pushdomains = None # <<<<<<<<<<<<<< * * for value in domains[variable]: - */ +*/ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_pushdomains = ((PyObject*)Py_None); @@ -13675,64 +12285,61 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for value in domains[variable]: # <<<<<<<<<<<<<< * assignments[variable] = value * if pushdomains: - */ - __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { - __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2); +*/ + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_4)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(PyList_CheckExact(__pyx_t_7))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 499, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 499, __pyx_L1_error) - #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - #endif + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_3); + ++__pyx_t_3; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 499, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_3)); #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_3); #endif + ++__pyx_t_3; } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error) } else { - __pyx_t_8 = __pyx_t_4(__pyx_t_2); - if (unlikely(!__pyx_t_8)) { + __pyx_t_1 = __pyx_t_4(__pyx_t_7); + if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 499, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 499, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_8); } - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8); - __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; /* "constraint/solvers.py":500 * @@ -13740,7 +12347,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * assignments[variable] = value # <<<<<<<<<<<<<< * if pushdomains: * for domain in pushdomains: - */ +*/ if (unlikely((PyObject_SetItem(__pyx_v_assignments, __pyx_v_variable, __pyx_v_value) < 0))) __PYX_ERR(0, 500, __pyx_L1_error) /* "constraint/solvers.py":501 @@ -13749,9 +12356,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.pushState() - */ - __pyx_t_9 = (__pyx_v_pushdomains != Py_None)&&(PyList_GET_SIZE(__pyx_v_pushdomains) != 0); - if (__pyx_t_9) { +*/ + __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_t_10) { /* "constraint/solvers.py":502 * assignments[variable] = value @@ -13759,29 +12367,27 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.pushState() * for constraint, variables in vconstraints[variable]: - */ +*/ if (unlikely(__pyx_v_pushdomains == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 502, __pyx_L1_error) } - __pyx_t_8 = __pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_8); + __pyx_t_1 = __pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 502, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 502, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + ++__pyx_t_6; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 502, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_8); + __pyx_t_8 = 0; /* "constraint/solvers.py":503 * if pushdomains: @@ -13789,32 +12395,18 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * domain.pushState() # <<<<<<<<<<<<<< * for constraint, variables in vconstraints[variable]: * if not constraint(variables, domains, assignments, pushdomains): - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_pushState); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = NULL; - __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_10 = 1; - } - } - #endif +*/ + __pyx_t_2 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_9 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_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); } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "constraint/solvers.py":502 * assignments[variable] = value @@ -13822,9 +12414,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.pushState() * for constraint, variables in vconstraints[variable]: - */ +*/ } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/solvers.py":501 * for value in domains[variable]: @@ -13832,7 +12424,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.pushState() - */ +*/ } /* "constraint/solvers.py":504 @@ -13841,64 +12433,61 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, pushdomains): * # Value is not good. - */ - __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __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_1 = __Pyx_PyObject_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __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, 504, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(PyList_CheckExact(__pyx_t_8))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 504, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 504, __pyx_L1_error) - #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - #endif + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_6); + ++__pyx_t_6; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 504, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6)); #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_6); #endif + ++__pyx_t_6; } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) } else { - __pyx_t_8 = __pyx_t_12(__pyx_t_1); - if (unlikely(!__pyx_t_8)) { + __pyx_t_1 = __pyx_t_12(__pyx_t_8); + if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 504, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 504, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_8); } - if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { - PyObject* sequence = __pyx_t_8; + __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); @@ -13907,29 +12496,33 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_5); } else { - __pyx_t_7 = PyList_GET_ITEM(sequence, 0); - __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + 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); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_5); } - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_13 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_13 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); - index = 0; __pyx_t_7 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_7)) goto __pyx_L32_unpacking_failed; - __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); + index = 0; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L32_unpacking_failed; + __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) @@ -13943,8 +12536,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r __PYX_ERR(0, 504, __pyx_L1_error) __pyx_L33_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_7); - __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_2); + __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_variables, __pyx_t_5); __pyx_t_5 = 0; @@ -13954,33 +12547,33 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if not constraint(variables, domains, assignments, pushdomains): # <<<<<<<<<<<<<< * # Value is not good. * break - */ +*/ + __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_constraint); - __pyx_t_5 = __pyx_v_constraint; __pyx_t_7 = NULL; - __pyx_t_10 = 0; + __pyx_t_2 = __pyx_v_constraint; + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_10 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_5); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_pushdomains}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_10, 4+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 505, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + 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_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) + __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 505, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_15 = (!__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 505, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_15 = (!__pyx_t_10); if (__pyx_t_15) { /* "constraint/solvers.py":507 @@ -13989,7 +12582,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * break # <<<<<<<<<<<<<< * else: * # Value is good. Recurse and get next variable. - */ +*/ goto __pyx_L31_break; /* "constraint/solvers.py":505 @@ -13998,7 +12591,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if not constraint(variables, domains, assignments, pushdomains): # <<<<<<<<<<<<<< * # Value is not good. * break - */ +*/ } /* "constraint/solvers.py":504 @@ -14007,12 +12600,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, pushdomains): * # Value is not good. - */ +*/ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L35_for_else; __pyx_L31_break:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L36_for_end; /*else*/ { __pyx_L35_for_else:; @@ -14023,32 +12616,18 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * self.recursiveBacktracking(solutions, domains, vconstraints, assignments, single) # <<<<<<<<<<<<<< * if solutions and single: * return solutions - */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_recursiveBacktracking); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 510, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = NULL; - __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_10 = 1; - } - } - #endif +*/ + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_9 = 0; { - PyObject *__pyx_callargs[6] = {__pyx_t_5, __pyx_v_solutions, __pyx_v_domains, __pyx_v_vconstraints, __pyx_v_assignments, __pyx_v_single}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 5+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_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); } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "constraint/solvers.py":511 * # Value is good. Recurse and get next variable. @@ -14056,15 +12635,15 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if solutions and single: # <<<<<<<<<<<<<< * return solutions * if pushdomains: - */ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_solutions); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 511, __pyx_L1_error) - if (__pyx_t_9) { +*/ + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_solutions); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 511, __pyx_L1_error) + if (__pyx_t_10) { } else { - __pyx_t_15 = __pyx_t_9; + __pyx_t_15 = __pyx_t_10; goto __pyx_L38_bool_binop_done; } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_single); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 511, __pyx_L1_error) - __pyx_t_15 = __pyx_t_9; + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_single); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 511, __pyx_L1_error) + __pyx_t_15 = __pyx_t_10; __pyx_L38_bool_binop_done:; if (__pyx_t_15) { @@ -14074,11 +12653,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * return solutions # <<<<<<<<<<<<<< * if pushdomains: * for domain in pushdomains: - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_solutions); __pyx_r = __pyx_v_solutions; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L0; /* "constraint/solvers.py":511 @@ -14087,7 +12666,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if solutions and single: # <<<<<<<<<<<<<< * return solutions * if pushdomains: - */ +*/ } } __pyx_L36_for_end:; @@ -14098,8 +12677,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ - __pyx_t_15 = (__pyx_v_pushdomains != Py_None)&&(PyList_GET_SIZE(__pyx_v_pushdomains) != 0); +*/ + __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) { /* "constraint/solvers.py":514 @@ -14108,29 +12688,27 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * del assignments[variable] - */ +*/ if (unlikely(__pyx_v_pushdomains == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 514, __pyx_L1_error) } - __pyx_t_1 = __pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_1); + __pyx_t_8 = __pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 514, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 514, __pyx_L1_error) - #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 514, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - #endif - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_8); - __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_6); + ++__pyx_t_6; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; /* "constraint/solvers.py":515 * if pushdomains: @@ -14138,32 +12716,18 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * domain.popState() # <<<<<<<<<<<<<< * del assignments[variable] * return solutions - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_popState); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 515, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = NULL; - __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_10 = 1; - } - } - #endif +*/ + __pyx_t_2 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_9 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 515, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_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); } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/solvers.py":514 * return solutions @@ -14171,9 +12735,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * del assignments[variable] - */ +*/ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "constraint/solvers.py":513 * if solutions and single: @@ -14181,7 +12745,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ } /* "constraint/solvers.py":499 @@ -14190,9 +12754,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for value in domains[variable]: # <<<<<<<<<<<<<< * assignments[variable] = value * if pushdomains: - */ +*/ } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "constraint/solvers.py":516 * for domain in pushdomains: @@ -14200,7 +12764,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * del assignments[variable] # <<<<<<<<<<<<<< * return solutions * - */ +*/ if (unlikely((PyObject_DelItem(__pyx_v_assignments, __pyx_v_variable) < 0))) __PYX_ERR(0, 516, __pyx_L1_error) /* "constraint/solvers.py":517 @@ -14209,7 +12773,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * return solutions # <<<<<<<<<<<<<< * * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_solutions); __pyx_r = __pyx_v_solutions; @@ -14221,7 +12785,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * def recursiveBacktracking(self, solutions, domains, vconstraints, assignments, single): # <<<<<<<<<<<<<< * """Mix the Degree and Minimum Remaing Values (MRV) heuristics. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -14256,7 +12820,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * solutions = self.recursiveBacktracking([], domains, vconstraints, {}, True) * return solutions and solutions[0] or None - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_5getSolution(PyObject *__pyx_self, @@ -14266,7 +12830,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_5getSolution = {"getSolution", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_5getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_5getSolution = {"getSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_5getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_5getSolution(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -14290,7 +12854,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -14298,72 +12862,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 519, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 519, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 519, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 519, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 519, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 519, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, 1); __PYX_ERR(0, 519, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 519, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, 2); __PYX_ERR(0, 519, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 519, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, 3); __PYX_ERR(0, 519, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolution") < 0)) __PYX_ERR(0, 519, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 519, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 519, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 519, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 519, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_domains = ((PyObject*)values[1]); @@ -14376,32 +12914,31 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.RecursiveBacktrackingSolver.getSolution", __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", 1))) __PYX_ERR(0, 519, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 519, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 519, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 519, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 519, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 519, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_4getSolution(__pyx_self, __pyx_v_self, __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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -14414,13 +12951,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_4g PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - unsigned int __pyx_t_6; - int __pyx_t_7; + size_t __pyx_t_5; + int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolution", 1); + __Pyx_RefNannySetupContext("getSolution", 0); /* "constraint/solvers.py":520 * @@ -14428,36 +12964,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_4g * solutions = self.recursiveBacktracking([], domains, vconstraints, {}, True) # <<<<<<<<<<<<<< * return solutions and solutions[0] or None * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_recursiveBacktracking); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); +*/ + __pyx_t_2 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; - } - } - #endif + __pyx_t_5 = 0; { - PyObject *__pyx_callargs[6] = {__pyx_t_5, __pyx_t_3, __pyx_v_domains, __pyx_v_vconstraints, __pyx_t_4, Py_True}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __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_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; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_solutions = __pyx_t_1; __pyx_t_1 = 0; @@ -14468,22 +12990,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_4g * return solutions and solutions[0] or None # <<<<<<<<<<<<<< * * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_solutions); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 521, __pyx_L1_error) - if (!__pyx_t_7) { + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_solutions); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 521, __pyx_L1_error) + if (!__pyx_t_6) { goto __pyx_L4_next_or; } else { } - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_solutions, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 521, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 521, __pyx_L1_error) - if (!__pyx_t_7) { - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_solutions, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); 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) { + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_1 = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L3_bool_binop_done; } __pyx_L4_next_or:; @@ -14500,7 +13022,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_4g * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * solutions = self.recursiveBacktracking([], domains, vconstraints, {}, True) * return solutions and solutions[0] or None - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -14508,7 +13030,6 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_4g __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("constraint.solvers.RecursiveBacktrackingSolver.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -14524,7 +13045,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_4g * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * return self.recursiveBacktracking([], domains, vconstraints, {}, False) * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_7getSolutions(PyObject *__pyx_self, @@ -14534,7 +13055,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_7getSolutions = {"getSolutions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_7getSolutions, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_7getSolutions = {"getSolutions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_7getSolutions, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_7getSolutions(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -14558,7 +13079,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutions (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -14566,72 +13087,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 523, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 523, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 523, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 523, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 523, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 523, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 4, 4, 1); __PYX_ERR(0, 523, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 523, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 4, 4, 2); __PYX_ERR(0, 523, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 523, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 4, 4, 3); __PYX_ERR(0, 523, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutions") < 0)) __PYX_ERR(0, 523, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 523, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 523, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 523, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 523, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_domains = ((PyObject*)values[1]); @@ -14644,32 +13139,31 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.RecursiveBacktrackingSolver.getSolutions", __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", 1))) __PYX_ERR(0, 523, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 523, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 523, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 523, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 523, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 523, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_6getSolutions(__pyx_self, __pyx_v_self, __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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -14681,12 +13175,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_6g PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - unsigned int __pyx_t_6; + size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolutions", 1); + __Pyx_RefNannySetupContext("getSolutions", 0); /* "constraint/solvers.py":524 * @@ -14694,37 +13187,23 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_6g * return self.recursiveBacktracking([], domains, vconstraints, {}, False) # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_recursiveBacktracking); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_2 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; - } - } - #endif + __pyx_t_5 = 0; { - PyObject *__pyx_callargs[6] = {__pyx_t_5, __pyx_t_3, __pyx_v_domains, __pyx_v_vconstraints, __pyx_t_4, Py_False}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __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_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; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -14736,7 +13215,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_6g * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * return self.recursiveBacktracking([], domains, vconstraints, {}, False) * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -14744,7 +13223,6 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_6g __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("constraint.solvers.RecursiveBacktrackingSolver.getSolutions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -14759,7 +13237,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_6g * def __init__(self, steps=1000, rand=None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_18MinConflictsSolver_1__init__(PyObject *__pyx_self, @@ -14770,7 +13248,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7solvers_18MinConflictsSolver___init__, "Initialization method.\n\n Args:\n steps (int): Maximum number of steps to perform before\n giving up when looking for a solution (default is 1000)\n rand (Random): Optional random.Random instance to use for\n repeatability.\n "); -static PyMethodDef __pyx_mdef_10constraint_7solvers_18MinConflictsSolver_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_18MinConflictsSolver_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_18MinConflictsSolver___init__}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_18MinConflictsSolver_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_18MinConflictsSolver_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_18MinConflictsSolver___init__}; static PyObject *__pyx_pw_10constraint_7solvers_18MinConflictsSolver_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -14793,7 +13271,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -14801,59 +13279,51 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_steps,&__pyx_n_s_rand,0}; - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1000))); - values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 554, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 554, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 554, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_steps); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rand); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 554, __pyx_L3_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 (!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++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, i); __PYX_ERR(0, 554, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 554, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 554, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 554, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_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)); } __pyx_v_self = values[0]; __pyx_v_steps = values[1]; @@ -14865,11 +13335,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.MinConflictsSolver.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -14878,11 +13345,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_7solvers_18MinConflictsSolver___init__(__pyx_self, __pyx_v_self, __pyx_v_steps, __pyx_v_rand); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -14894,7 +13358,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver___init__(CY int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/solvers.py":563 * repeatability. @@ -14902,8 +13366,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver___init__(CY * self._steps = steps # <<<<<<<<<<<<<< * self._rand = rand * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_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 * """ @@ -14911,8 +13375,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver___init__(CY * self._rand = rand # <<<<<<<<<<<<<< * * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_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 * """ @@ -14920,7 +13384,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver___init__(CY * def __init__(self, steps=1000, rand=None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -14940,7 +13404,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver___init__(CY * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * 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 - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_18MinConflictsSolver_3getSolution(PyObject *__pyx_self, @@ -14950,7 +13414,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_7solvers_18MinConflictsSolver_3getSolution = {"getSolution", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_18MinConflictsSolver_3getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_18MinConflictsSolver_3getSolution = {"getSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_18MinConflictsSolver_3getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_7solvers_18MinConflictsSolver_3getSolution(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -14974,7 +13438,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -14982,72 +13446,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 566, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 566, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 566, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 566, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, 1); __PYX_ERR(0, 566, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, 2); __PYX_ERR(0, 566, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, 3); __PYX_ERR(0, 566, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolution") < 0)) __PYX_ERR(0, 566, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 566, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 566, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 566, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 566, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_domains = ((PyObject*)values[1]); @@ -15060,32 +13498,31 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.MinConflictsSolver.getSolution", __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", 1))) __PYX_ERR(0, 566, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 566, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 566, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 566, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 566, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 566, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolution(__pyx_self, __pyx_v_self, __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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -15116,7 +13553,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; - unsigned int __pyx_t_11; + size_t __pyx_t_11; PyObject *(*__pyx_t_12)(PyObject *); Py_ssize_t __pyx_t_13; PyObject *(*__pyx_t_14)(PyObject *); @@ -15131,7 +13568,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolution", 1); + __Pyx_RefNannySetupContext("getSolution", 0); /* "constraint/solvers.py":567 * @@ -15139,23 +13576,23 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * 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 * assignments = {} - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rand_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_t_2 != Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rand_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_choice); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_choice); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; } else { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_choice); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_choice); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_2; @@ -15170,23 +13607,23 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * shuffle = self._rand.shuffle if self._rand is not None else random.shuffle # <<<<<<<<<<<<<< * assignments = {} * # Initial assignment - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rand_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_t_2 != Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rand_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_shuffle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; } else { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_shuffle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_2; @@ -15201,7 +13638,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * assignments = {} # <<<<<<<<<<<<<< * # Initial assignment * for variable in domains: - */ +*/ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_assignments = ((PyObject*)__pyx_t_1); @@ -15213,7 +13650,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for variable in domains: # <<<<<<<<<<<<<< * assignments[variable] = choice(domains[variable]) * for _ in range(self._steps): - */ +*/ __pyx_t_5 = 0; __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_domains, 1, ((PyObject *)NULL), (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -15234,32 +13671,32 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * assignments[variable] = choice(domains[variable]) # <<<<<<<<<<<<<< * for _ in range(self._steps): * conflicted = False - */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); +*/ + __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_choice); - __pyx_t_9 = __pyx_v_choice; __pyx_t_10 = NULL; - __pyx_t_11 = 0; + __pyx_t_9 = __pyx_v_choice; + __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_11 = 1; - } + __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_11 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + 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_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; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } if (unlikely((PyDict_SetItem(__pyx_v_assignments, __pyx_v_variable, __pyx_t_2) < 0))) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -15272,67 +13709,74 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for _ in range(self._steps): # <<<<<<<<<<<<<< * conflicted = False * lst = list(domains.keys()) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_steps_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - 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_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_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)); + __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_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 573, __pyx_L1_error) + __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_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(PyList_CheckExact(__pyx_t_9))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + 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; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 573, __pyx_L1_error) - #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif + __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_1); - #if !CYTHON_ASSUME_SAFE_MACROS + 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_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_6)); #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __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_2 = __pyx_t_12(__pyx_t_1); - if (unlikely(!__pyx_t_2)) { + __pyx_t_1 = __pyx_t_12(__pyx_t_9); + if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 573, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 573, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_1); + __pyx_t_1 = 0; /* "constraint/solvers.py":574 * assignments[variable] = choice(domains[variable]) @@ -15340,7 +13784,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * conflicted = False # <<<<<<<<<<<<<< * lst = list(domains.keys()) * shuffle(lst) - */ +*/ __pyx_v_conflicted = 0; /* "constraint/solvers.py":575 @@ -15349,14 +13793,14 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * lst = list(domains.keys()) # <<<<<<<<<<<<<< * shuffle(lst) * for variable in lst: - */ - __pyx_t_2 = __Pyx_PyDict_Keys(__pyx_v_domains); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PySequence_ListKeepNew(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 575, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_lst, ((PyObject*)__pyx_t_9)); - __pyx_t_9 = 0; +*/ + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_lst, ((PyObject*)__pyx_t_10)); + __pyx_t_10 = 0; /* "constraint/solvers.py":576 * conflicted = False @@ -15364,31 +13808,31 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * shuffle(lst) # <<<<<<<<<<<<<< * for variable in lst: * # Check if variable is not in conflict - */ +*/ + __pyx_t_1 = NULL; __Pyx_INCREF(__pyx_v_shuffle); - __pyx_t_2 = __pyx_v_shuffle; __pyx_t_4 = NULL; - __pyx_t_11 = 0; + __pyx_t_2 = __pyx_v_shuffle; + __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_11 = 1; - } + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_1); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __pyx_t_11 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_lst}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 576, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + 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_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_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "constraint/solvers.py":577 * lst = list(domains.keys()) @@ -15396,23 +13840,21 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for variable in lst: # <<<<<<<<<<<<<< * # Check if variable is not in conflict * for constraint, variables in vconstraints[variable]: - */ - __pyx_t_9 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_9); +*/ + __pyx_t_10 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_10); __pyx_t_5 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 577, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 577, __pyx_L1_error) - #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error) + __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); - #endif __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_2); __pyx_t_2 = 0; @@ -15422,62 +13864,59 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * 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_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); + __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_13 = 0; __pyx_t_14 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 579, __pyx_L1_error) + __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_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_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS + 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 CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 579, __pyx_L1_error) - #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_13); + ++__pyx_t_13; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS + 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 CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13)); #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_13); #endif + ++__pyx_t_13; } + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) } else { - __pyx_t_2 = __pyx_t_14(__pyx_t_4); + __pyx_t_2 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 579, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 579, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_2); } + __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); @@ -15488,18 +13927,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_15 = PyTuple_GET_ITEM(sequence, 1); + __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); } else { - __pyx_t_10 = PyList_GET_ITEM(sequence, 0); - __pyx_t_15 = PyList_GET_ITEM(sequence, 1); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); + 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_INCREF(__pyx_t_10); - __Pyx_INCREF(__pyx_t_15); #else - __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 579, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_15 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 579, __pyx_L1_error) + __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); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -15508,9 +13951,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio __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 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_16); - index = 0; __pyx_t_10 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_10)) goto __pyx_L11_unpacking_failed; - __Pyx_GOTREF(__pyx_t_10); + __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_GOTREF(__pyx_t_15); if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < 0) __PYX_ERR(0, 579, __pyx_L1_error) @@ -15524,8 +13967,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio __PYX_ERR(0, 579, __pyx_L1_error) __pyx_L12_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_10); - __pyx_t_10 = 0; + __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; @@ -15535,29 +13978,29 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * if not constraint(variables, domains, assignments): # <<<<<<<<<<<<<< * break * else: - */ +*/ + __pyx_t_15 = NULL; __Pyx_INCREF(__pyx_v_constraint); - __pyx_t_15 = __pyx_v_constraint; __pyx_t_10 = NULL; - __pyx_t_11 = 0; + __pyx_t_4 = __pyx_v_constraint; + __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_15))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_15); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_15, function); - __pyx_t_11 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_4); + assert(__pyx_t_15); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __pyx_t_11 = 0; } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_10, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_11, 3+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + 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; + __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); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __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; @@ -15570,7 +14013,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * break # <<<<<<<<<<<<<< * else: * continue - */ +*/ goto __pyx_L10_break; /* "constraint/solvers.py":580 @@ -15579,7 +14022,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * if not constraint(variables, domains, assignments): # <<<<<<<<<<<<<< * break * else: - */ +*/ } /* "constraint/solvers.py":579 @@ -15588,12 +14031,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments): * break - */ +*/ } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L14_for_else; __pyx_L10_break:; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L15_for_end; /*else*/ { __pyx_L14_for_else:; @@ -15604,7 +14047,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * continue # <<<<<<<<<<<<<< * # Variable has conflicts. Find values with less conflicts. * mincount = len(vconstraints[variable]) - */ +*/ goto __pyx_L7_continue; } __pyx_L15_for_end:; @@ -15615,15 +14058,15 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * mincount = len(vconstraints[variable]) # <<<<<<<<<<<<<< * minvalues = [] * for value in domains[variable]: - */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_13 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 585, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_mincount, __pyx_t_4); - __pyx_t_4 = 0; +*/ + __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_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_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_mincount, __pyx_t_1); + __pyx_t_1 = 0; /* "constraint/solvers.py":586 * # Variable has conflicts. Find values with less conflicts. @@ -15631,11 +14074,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * minvalues = [] # <<<<<<<<<<<<<< * for value in domains[variable]: * assignments[variable] = value - */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 586, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_minvalues, ((PyObject*)__pyx_t_4)); - __pyx_t_4 = 0; +*/ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_minvalues, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; /* "constraint/solvers.py":587 * mincount = len(vconstraints[variable]) @@ -15643,64 +14086,61 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for value in domains[variable]: # <<<<<<<<<<<<<< * assignments[variable] = value * count = 0 - */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __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_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; } else { - __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) + __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 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 587, __pyx_L1_error) + __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_14)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #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 CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_4); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 587, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_13); + ++__pyx_t_13; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #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 CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_4); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); #endif + ++__pyx_t_13; } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_14(__pyx_t_2); - if (unlikely(!__pyx_t_4)) { + __pyx_t_1 = __pyx_t_14(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 587, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 587, __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_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; /* "constraint/solvers.py":588 * minvalues = [] @@ -15708,7 +14148,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * assignments[variable] = value # <<<<<<<<<<<<<< * count = 0 * for constraint, variables in vconstraints[variable]: - */ +*/ if (unlikely((PyDict_SetItem(__pyx_v_assignments, __pyx_v_variable, __pyx_v_value) < 0))) __PYX_ERR(0, 588, __pyx_L1_error) /* "constraint/solvers.py":589 @@ -15717,9 +14157,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * count = 0 # <<<<<<<<<<<<<< * for constraint, variables in vconstraints[variable]: * if not constraint(variables, domains, assignments): - */ - __Pyx_INCREF(__pyx_int_0); - __Pyx_XDECREF_SET(__pyx_v_count, __pyx_int_0); +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __Pyx_XDECREF_SET(__pyx_v_count, __pyx_mstate_global->__pyx_int_0); /* "constraint/solvers.py":590 * assignments[variable] = value @@ -15727,64 +14167,61 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments): * count += 1 - */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_15 = __pyx_t_4; __Pyx_INCREF(__pyx_t_15); +*/ + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __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_19 = 0; __pyx_t_20 = NULL; } else { - __pyx_t_19 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 590, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_20 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_15); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 590, __pyx_L1_error) + __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_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_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_20)) { - 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); - #if !CYTHON_ASSUME_SAFE_MACROS + 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 CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_19); __Pyx_INCREF(__pyx_t_4); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 590, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_15, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_19); + ++__pyx_t_19; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_15); - #if !CYTHON_ASSUME_SAFE_MACROS + 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 CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_19); __Pyx_INCREF(__pyx_t_4); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_19)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_15, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_19); #endif + ++__pyx_t_19; } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_20(__pyx_t_15); - if (unlikely(!__pyx_t_4)) { + __pyx_t_1 = __pyx_t_20(__pyx_t_4); + if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 590, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 590, __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_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); @@ -15793,29 +14230,33 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_15); + __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_16); } else { - __pyx_t_10 = PyList_GET_ITEM(sequence, 0); - __pyx_t_16 = PyList_GET_ITEM(sequence, 1); + __pyx_t_15 = __Pyx_PyList_GetItemRef(sequence, 0); + 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); } - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(__pyx_t_16); #else - __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 590, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_16 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_15 = __Pyx_PySequence_ITEM(sequence, 0); 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_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_21 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 590, __pyx_L1_error) + __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_17 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_21); - index = 0; __pyx_t_10 = __pyx_t_17(__pyx_t_21); if (unlikely(!__pyx_t_10)) goto __pyx_L20_unpacking_failed; - __Pyx_GOTREF(__pyx_t_10); + __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_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) @@ -15829,8 +14270,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio __PYX_ERR(0, 590, __pyx_L1_error) __pyx_L21_unpacking_done:; } - __Pyx_DECREF_SET(__pyx_v_constraint, __pyx_t_10); - __pyx_t_10 = 0; + __Pyx_DECREF_SET(__pyx_v_constraint, __pyx_t_15); + __pyx_t_15 = 0; __Pyx_DECREF_SET(__pyx_v_variables, __pyx_t_16); __pyx_t_16 = 0; @@ -15840,32 +14281,32 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * if not constraint(variables, domains, assignments): # <<<<<<<<<<<<<< * count += 1 * if count == mincount: - */ +*/ + __pyx_t_16 = NULL; __Pyx_INCREF(__pyx_v_constraint); - __pyx_t_16 = __pyx_v_constraint; __pyx_t_10 = NULL; - __pyx_t_11 = 0; + __pyx_t_15 = __pyx_v_constraint; + __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_16))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_16); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_16, function); - __pyx_t_11 = 1; - } + 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); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_15, __pyx__function); + __pyx_t_11 = 0; } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_10, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_11, 3+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 591, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + 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; + 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_4); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 591, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_18); if (__pyx_t_3) { @@ -15875,11 +14316,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * count += 1 # <<<<<<<<<<<<<< * if count == mincount: * minvalues.append(value) - */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_count, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 592, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_count, __pyx_t_4); - __pyx_t_4 = 0; +*/ + __pyx_t_1 = __Pyx_PyLong_AddObjC(__pyx_v_count, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_count, __pyx_t_1); + __pyx_t_1 = 0; /* "constraint/solvers.py":591 * count = 0 @@ -15887,7 +14328,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * if not constraint(variables, domains, assignments): # <<<<<<<<<<<<<< * count += 1 * if count == mincount: - */ +*/ } /* "constraint/solvers.py":590 @@ -15896,9 +14337,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments): * count += 1 - */ +*/ } - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/solvers.py":593 * if not constraint(variables, domains, assignments): @@ -15906,10 +14347,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * if count == mincount: # <<<<<<<<<<<<<< * minvalues.append(value) * elif count < mincount: - */ - __pyx_t_15 = PyObject_RichCompare(__pyx_v_count, __pyx_v_mincount, Py_EQ); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 593, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; +*/ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_count, __pyx_v_mincount, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 593, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { /* "constraint/solvers.py":594 @@ -15918,7 +14359,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * minvalues.append(value) # <<<<<<<<<<<<<< * 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) /* "constraint/solvers.py":593 @@ -15927,7 +14368,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * if count == mincount: # <<<<<<<<<<<<<< * minvalues.append(value) * elif count < mincount: - */ +*/ goto __pyx_L24; } @@ -15937,10 +14378,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * elif count < mincount: # <<<<<<<<<<<<<< * mincount = count * del minvalues[:] - */ - __pyx_t_15 = PyObject_RichCompare(__pyx_v_count, __pyx_v_mincount, Py_LT); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 595, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; +*/ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_count, __pyx_v_mincount, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { /* "constraint/solvers.py":596 @@ -15949,7 +14390,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * mincount = count # <<<<<<<<<<<<<< * del minvalues[:] * minvalues.append(value) - */ +*/ __Pyx_INCREF(__pyx_v_count); __Pyx_DECREF_SET(__pyx_v_mincount, __pyx_v_count); @@ -15959,7 +14400,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * del minvalues[:] # <<<<<<<<<<<<<< * 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) /* "constraint/solvers.py":598 @@ -15968,7 +14409,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * minvalues.append(value) # <<<<<<<<<<<<<< * # 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) /* "constraint/solvers.py":595 @@ -15977,7 +14418,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * elif count < mincount: # <<<<<<<<<<<<<< * mincount = count * del minvalues[:] - */ +*/ } __pyx_L24:; @@ -15987,7 +14428,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for value in domains[variable]: # <<<<<<<<<<<<<< * assignments[variable] = value * count = 0 - */ +*/ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -15997,29 +14438,29 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * assignments[variable] = choice(minvalues) # <<<<<<<<<<<<<< * conflicted = True * if not conflicted: - */ +*/ + __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_choice); - __pyx_t_15 = __pyx_v_choice; __pyx_t_4 = NULL; - __pyx_t_11 = 0; + __pyx_t_1 = __pyx_v_choice; + __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_15))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_15); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_15, function); - __pyx_t_11 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); + assert(__pyx_t_4); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); + __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_minvalues}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); + __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_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); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } 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; @@ -16030,7 +14471,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * conflicted = True # <<<<<<<<<<<<<< * if not conflicted: * return assignments - */ +*/ __pyx_v_conflicted = 1; /* "constraint/solvers.py":577 @@ -16039,10 +14480,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for variable in lst: # <<<<<<<<<<<<<< * # Check if variable is not in conflict * for constraint, variables in vconstraints[variable]: - */ +*/ __pyx_L7_continue:; } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "constraint/solvers.py":602 * assignments[variable] = choice(minvalues) @@ -16050,7 +14491,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * if not conflicted: # <<<<<<<<<<<<<< * return assignments * return None - */ +*/ __pyx_t_3 = (!__pyx_v_conflicted); if (__pyx_t_3) { @@ -16060,11 +14501,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * return assignments # <<<<<<<<<<<<<< * return None * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_assignments); __pyx_r = __pyx_v_assignments; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L0; /* "constraint/solvers.py":602 @@ -16073,7 +14514,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * if not conflicted: # <<<<<<<<<<<<<< * return assignments * return None - */ +*/ } /* "constraint/solvers.py":573 @@ -16082,9 +14523,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for _ in range(self._steps): # <<<<<<<<<<<<<< * conflicted = False * lst = list(domains.keys()) - */ +*/ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "constraint/solvers.py":604 * if not conflicted: @@ -16092,7 +14533,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * return None # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -16103,7 +14544,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * 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 - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -16141,7 +14582,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * def __init__(self, process_mode=False): # <<<<<<<<<<<<<< * """Initialization method. Set `process_mode` to True for using ProcessPool, otherwise uses ThreadPool.""" * super().__init__() - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_14ParallelSolver_1__init__(PyObject *__pyx_self, @@ -16152,7 +14593,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7solvers_14ParallelSolver___init__, "Initialization method. Set `process_mode` to True for using ProcessPool, otherwise uses ThreadPool."); -static PyMethodDef __pyx_mdef_10constraint_7solvers_14ParallelSolver_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_14ParallelSolver_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_14ParallelSolver___init__}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_14ParallelSolver_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_14ParallelSolver_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_14ParallelSolver___init__}; static PyObject *__pyx_pw_10constraint_7solvers_14ParallelSolver_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -16174,7 +14615,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -16182,47 +14623,41 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_process_mode,0}; - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 644, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 644, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 644, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_process_mode); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 644, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 644, __pyx_L3_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 (!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) } } } else { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 644, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 644, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } + if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); } __pyx_v_self = values[0]; __pyx_v_process_mode = values[1]; @@ -16233,11 +14668,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.ParallelSolver.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -16246,11 +14678,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_7solvers_14ParallelSolver___init__(__pyx_self, __pyx_v_self, __pyx_v_process_mode); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -16262,11 +14691,14 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver___init__(CYTHON PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + size_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/solvers.py":646 * def __init__(self, process_mode=False): @@ -16274,45 +14706,33 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver___init__(CYTHON * super().__init__() # <<<<<<<<<<<<<< * self._process_mode = process_mode * self.requires_pickling = process_mode - */ - __pyx_t_2 = __Pyx_CyFunction_GetClassObj(__pyx_self); - if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 646, __pyx_L1_error) } - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 646, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } +*/ + __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; + { + 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)); + __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); } - #endif + __pyx_t_2 = __pyx_t_3; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + __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_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) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -16322,8 +14742,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver___init__(CYTHON * self._process_mode = process_mode # <<<<<<<<<<<<<< * self.requires_pickling = process_mode * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_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__() @@ -16331,8 +14751,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver___init__(CYTHON * self.requires_pickling = process_mode # <<<<<<<<<<<<<< * * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_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 @@ -16340,7 +14760,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver___init__(CYTHON * def __init__(self, process_mode=False): # <<<<<<<<<<<<<< * """Initialization method. Set `process_mode` to True for using ProcessPool, otherwise uses ThreadPool.""" * super().__init__() - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -16349,6 +14769,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver___init__(CYTHON __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.ParallelSolver.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -16363,7 +14786,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver___init__(CYTHON * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Return one solution for the given problem. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_14ParallelSolver_3getSolution(PyObject *__pyx_self, @@ -16374,7 +14797,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7solvers_14ParallelSolver_2getSolution, "Return one solution for the given problem.\n\n Args:\n domains (dict): Dictionary mapping variables to their domains\n constraints (list): List of pairs of (constraint, variables)\n vconstraints (dict): Dictionary mapping variables to a list\n of constraints affecting the given variables.\n "); -static PyMethodDef __pyx_mdef_10constraint_7solvers_14ParallelSolver_3getSolution = {"getSolution", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_14ParallelSolver_3getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_14ParallelSolver_2getSolution}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_14ParallelSolver_3getSolution = {"getSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_14ParallelSolver_3getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_14ParallelSolver_2getSolution}; static PyObject *__pyx_pw_10constraint_7solvers_14ParallelSolver_3getSolution(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -16398,7 +14821,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -16406,72 +14829,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 650, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 650, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 650, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 650, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 650, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 650, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, 1); __PYX_ERR(0, 650, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 650, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, 2); __PYX_ERR(0, 650, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 650, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, 3); __PYX_ERR(0, 650, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolution") < 0)) __PYX_ERR(0, 650, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 650, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 650, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 650, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 650, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_domains = ((PyObject*)values[1]); @@ -16484,32 +14881,31 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.ParallelSolver.getSolution", __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", 1))) __PYX_ERR(0, 650, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 650, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 650, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 650, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 650, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 650, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_14ParallelSolver_2getSolution(__pyx_self, __pyx_v_self, __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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -16520,10 +14916,12 @@ 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; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolution", 1); + __Pyx_RefNannySetupContext("getSolution", 0); /* "constraint/solvers.py":659 * of constraints affecting the given variables. @@ -16531,16 +14929,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_2getSolution(CY * msg = f"{self.__class__.__name__} only provides all solutions" # <<<<<<<<<<<<<< * raise NotImplementedError(msg) * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); 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_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error) + __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_kp_u_only_provides_all_solutions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_2); @@ -16552,9 +14950,19 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_2getSolution(CY * raise NotImplementedError(msg) # <<<<<<<<<<<<<< * * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 - */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_v_msg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); +*/ + __pyx_t_1 = NULL; + __Pyx_INCREF(__pyx_builtin_NotImplementedError); + __pyx_t_3 = __pyx_builtin_NotImplementedError; + __pyx_t_4 = 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_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); + } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 660, __pyx_L1_error) @@ -16565,12 +14973,13 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_2getSolution(CY * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Return one solution for the given problem. * - */ +*/ /* function exit code */ __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); @@ -16585,7 +14994,7 @@ 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 # <<<<<<<<<<<<<< * """Parallelized all-solutions finder using ProcessPoolExecutor for work-stealing.""" * # Precompute constraints lookup per variable - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_14ParallelSolver_5getSolutionsList(PyObject *__pyx_self, @@ -16596,7 +15005,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7solvers_14ParallelSolver_4getSolutionsList, "Parallelized all-solutions finder using ProcessPoolExecutor for work-stealing."); -static PyMethodDef __pyx_mdef_10constraint_7solvers_14ParallelSolver_5getSolutionsList = {"getSolutionsList", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_14ParallelSolver_5getSolutionsList, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_14ParallelSolver_4getSolutionsList}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_14ParallelSolver_5getSolutionsList = {"getSolutionsList", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_14ParallelSolver_5getSolutionsList, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_14ParallelSolver_4getSolutionsList}; static PyObject *__pyx_pw_10constraint_7solvers_14ParallelSolver_5getSolutionsList(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -16619,7 +15028,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionsList (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -16627,59 +15036,40 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 662, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 662, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 662, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 662, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 662, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutionsList", 1, 3, 3, 1); __PYX_ERR(0, 662, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 662, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutionsList", 1, 3, 3, 2); __PYX_ERR(0, 662, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutionsList") < 0)) __PYX_ERR(0, 662, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 662, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 662, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 662, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_domains = ((PyObject*)values[1]); @@ -16691,31 +15081,30 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.ParallelSolver.getSolutionsList", __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", 1))) __PYX_ERR(0, 662, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 662, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 662, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 662, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsList(__pyx_self, __pyx_v_self, __pyx_v_domains, __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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -16726,7 +15115,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds * sorted_vars: list[Hashable] = sorted(domains.keys(), key=lambda v: len(domains[v])) # <<<<<<<<<<<<<< * * # Split parallel and sequential parts - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_14ParallelSolver_16getSolutionsList_lambda3(PyObject *__pyx_self, @@ -16736,7 +15125,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_7solvers_14ParallelSolver_16getSolutionsList_lambda3 = {"lambda3", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_14ParallelSolver_16getSolutionsList_lambda3, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_14ParallelSolver_16getSolutionsList_lambda3 = {"lambda3", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_14ParallelSolver_16getSolutionsList_lambda3, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_7solvers_14ParallelSolver_16getSolutionsList_lambda3(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -16757,7 +15146,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda3 (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -16765,33 +15154,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 668, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 668, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda3") < 0)) __PYX_ERR(0, 668, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 668, __pyx_L3_error) } __pyx_v_v = values[0]; } @@ -16801,11 +15185,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.ParallelSolver.getSolutionsList.lambda3", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -16814,11 +15195,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_lambda_funcdef_lambda3(__pyx_self, __pyx_v_v); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -16834,7 +15212,7 @@ static PyObject *__pyx_lambda_funcdef_lambda3(PyObject *__pyx_self, PyObject *__ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("lambda3", 1); + __Pyx_RefNannySetupContext("lambda3", 0); __pyx_outer_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; __Pyx_XDECREF(__pyx_r); @@ -16847,7 +15225,7 @@ static PyObject *__pyx_lambda_funcdef_lambda3(PyObject *__pyx_self, PyObject *__ __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, 668, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) + __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -16871,7 +15249,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_14ParallelSolver_16getSolutionsL * args = ((self.requires_pickling, domains, constraint_lookup, first_var, val, remaining_vars.copy()) for val in domains[first_var]) # noqa: E501 # <<<<<<<<<<<<<< * solutions: list[dict[Hashable, any]] = [] * - */ +*/ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_16getSolutionsList_1genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr *__pyx_cur_scope; @@ -16881,7 +15259,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_16getSolutionsL const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_3_genexpr(__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_3_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr *)Py_None); __Pyx_INCREF(Py_None); @@ -16896,7 +15274,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_16getSolutionsL __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_7solvers_14ParallelSolver_16getSolutionsList_3generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ParallelSolver_getSolutionsList, __pyx_n_s_constraint_solvers); if (unlikely(!gen)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7solvers_14ParallelSolver_16getSolutionsList_3generator2, ((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_ParallelSolver_getSolutionsList, __pyx_mstate_global->__pyx_n_u_constraint_solvers); if (unlikely(!gen)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -16935,7 +15313,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_14ParallelSolver_16getSolutionsL return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 675, __pyx_L1_error) + 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, 675, __pyx_L1_error) + } if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 675, __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); @@ -16944,82 +15325,79 @@ static PyObject *__pyx_gb_10constraint_7solvers_14ParallelSolver_16getSolutionsL } 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, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __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, 675, __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 675, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 675, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 675, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 675, __pyx_L1_error) + __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); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif + ++__pyx_t_2; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 675, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 675, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_4); } + __Pyx_GOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_val); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_val, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 675, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_requires_pickling); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_requires_pickling); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains)) { __Pyx_RaiseClosureNameError("domains"); __PYX_ERR(0, 675, __pyx_L1_error) } if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_constraint_lookup)) { __Pyx_RaiseClosureNameError("constraint_lookup"); __PYX_ERR(0, 675, __pyx_L1_error) } if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_first_var)) { __Pyx_RaiseClosureNameError("first_var"); __PYX_ERR(0, 675, __pyx_L1_error) } if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_remaining_vars)) { __Pyx_RaiseClosureNameError("remaining_vars"); __PYX_ERR(0, 675, __pyx_L1_error) } - __pyx_t_5 = __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_copy, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_remaining_vars); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_5 = __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyList_Type__copy, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_remaining_vars); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 675, __pyx_L1_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains)) __PYX_ERR(0, 675, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains) != (0)) __PYX_ERR(0, 675, __pyx_L1_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_constraint_lookup); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_constraint_lookup); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_constraint_lookup)) __PYX_ERR(0, 675, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_constraint_lookup) != (0)) __PYX_ERR(0, 675, __pyx_L1_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_first_var); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_first_var); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_first_var)) __PYX_ERR(0, 675, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_first_var) != (0)) __PYX_ERR(0, 675, __pyx_L1_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_val); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_val); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_cur_scope->__pyx_v_val)) __PYX_ERR(0, 675, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_cur_scope->__pyx_v_val) != (0)) __PYX_ERR(0, 675, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_5) != (0)) __PYX_ERR(0, 675, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; @@ -17046,17 +15424,19 @@ static PyObject *__pyx_gb_10constraint_7solvers_14ParallelSolver_16getSolutionsL CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ - PyErr_SetNone(PyExc_StopIteration); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + } __pyx_L0:; - __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif @@ -17072,7 +15452,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_14ParallelSolver_16getSolutionsL * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 # <<<<<<<<<<<<<< * """Parallelized all-solutions finder using ProcessPoolExecutor for work-stealing.""" * # Precompute constraints lookup per variable - */ +*/ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsList(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_domains, PyObject *__pyx_v_vconstraints) { struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *__pyx_cur_scope; @@ -17095,21 +15475,23 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - unsigned int __pyx_t_10; + PyObject *__pyx_t_9 = NULL; + size_t __pyx_t_10; PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; + int __pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; - PyObject *(*__pyx_t_15)(PyObject *); - int __pyx_t_16; - PyObject *__pyx_t_17 = 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; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolutionsList", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList(__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList(__pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *)Py_None); __Pyx_INCREF(Py_None); @@ -17130,7 +15512,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * constraint_lookup: dict[Hashable, list[tuple[Constraint, Hashable]]] = {var: vconstraints.get(var, []) for var in domains} # noqa: E501 # <<<<<<<<<<<<<< * * # Sort variables by domain size (heuristic) - */ +*/ { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); @@ -17173,27 +15555,32 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * sorted_vars: list[Hashable] = sorted(domains.keys(), key=lambda v: len(domains[v])) # <<<<<<<<<<<<<< * * # Split parallel and sequential parts - */ - __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_cur_scope->__pyx_v_domains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __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)) __PYX_ERR(0, 668, __pyx_L1_error); +*/ + __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_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; + { + 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); + __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; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __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, 668, __pyx_L1_error) + __pyx_v_sorted_vars = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_16getSolutionsList_lambda3, 0, __pyx_n_s_ParallelSolver_getSolutionsList_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_constraint_solvers, __pyx_d, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_8) < 0) __PYX_ERR(0, 668, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(PyList_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_8))) __PYX_ERR(0, 668, __pyx_L1_error) - __pyx_v_sorted_vars = ((PyObject*)__pyx_t_8); - __pyx_t_8 = 0; /* "constraint/solvers.py":671 * @@ -17201,16 +15588,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * first_var = sorted_vars[0] # <<<<<<<<<<<<<< * remaining_vars = sorted_vars[1:] * - */ +*/ if (unlikely(__pyx_v_sorted_vars == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 671, __pyx_L1_error) } - __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_sorted_vars, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_cur_scope->__pyx_v_first_var = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_sorted_vars, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1); 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; + __pyx_t_1 = 0; /* "constraint/solvers.py":672 * # Split parallel and sequential parts @@ -17218,16 +15605,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * remaining_vars = sorted_vars[1:] # <<<<<<<<<<<<<< * * # Create the parallel function arguments and solutions lists - */ +*/ if (unlikely(__pyx_v_sorted_vars == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 672, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyList_GetSlice(__pyx_v_sorted_vars, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_cur_scope->__pyx_v_remaining_vars = ((PyObject*)__pyx_t_8); - __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyList_GetSlice(__pyx_v_sorted_vars, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_v_remaining_vars = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; /* "constraint/solvers.py":675 * @@ -17235,14 +15622,14 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * args = ((self.requires_pickling, domains, constraint_lookup, first_var, val, remaining_vars.copy()) for val in domains[first_var]) # noqa: E501 # <<<<<<<<<<<<<< * solutions: list[dict[Hashable, any]] = [] * - */ - __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_first_var); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __pyx_pf_10constraint_7solvers_14ParallelSolver_16getSolutionsList_1genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error) +*/ + __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_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_v_args = __pyx_t_1; - __pyx_t_1 = 0; + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_args = __pyx_t_8; + __pyx_t_8 = 0; /* "constraint/solvers.py":676 * # Create the parallel function arguments and solutions lists @@ -17250,11 +15637,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * solutions: list[dict[Hashable, any]] = [] # <<<<<<<<<<<<<< * * # execute in parallel - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_solutions = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; +*/ + __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; /* "constraint/solvers.py":679 * @@ -17262,24 +15649,24 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * parallel_pool = ProcessPoolExecutor if self._process_mode else ThreadPoolExecutor # <<<<<<<<<<<<<< * with parallel_pool() as executor: * # results = map(parallel_worker, args) # sequential - */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_process_mode_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 679, __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, 679, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__pyx_t_9) { - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ProcessPoolExecutor); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __pyx_t_8; - __pyx_t_8 = 0; +*/ + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_12) { + __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_1 = 0; } else { - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ThreadPoolExecutor); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __pyx_t_8; - __pyx_t_8 = 0; + __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_1 = 0; } - __pyx_v_parallel_pool = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_parallel_pool = __pyx_t_8; + __pyx_t_8 = 0; /* "constraint/solvers.py":680 * # execute in parallel @@ -17287,71 +15674,70 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * with parallel_pool() as executor: # <<<<<<<<<<<<<< * # results = map(parallel_worker, args) # sequential * results = executor.map(parallel_worker, args, chunksize=1) # parallel - */ +*/ /*with:*/ { + __pyx_t_1 = NULL; __Pyx_INCREF(__pyx_v_parallel_pool); - __pyx_t_8 = __pyx_v_parallel_pool; __pyx_t_2 = NULL; - __pyx_t_10 = 0; + __pyx_t_11 = __pyx_v_parallel_pool; + __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_10 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_11); + assert(__pyx_t_1); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); + __pyx_t_10 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + 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_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_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L9_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = NULL; - __pyx_t_10 = 0; + __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_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; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_10 = 1; - } + if (likely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9); + assert(__pyx_t_1); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); + __pyx_t_10 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 680, __pyx_L9_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + 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_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_t_2 = __pyx_t_8; - __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __pyx_t_11; + __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); - __Pyx_XGOTREF(__pyx_t_12); - __Pyx_XGOTREF(__pyx_t_13); + __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); /*try:*/ { - __pyx_v_executor = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_executor = __pyx_t_9; + __pyx_t_9 = 0; /* "constraint/solvers.py":682 * with parallel_pool() as executor: @@ -17359,29 +15745,26 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * results = executor.map(parallel_worker, args, chunksize=1) # parallel # <<<<<<<<<<<<<< * for result in results: * solutions.extend(result) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_executor, __pyx_n_s_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L13_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parallel_worker); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L13_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 682, __pyx_L13_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1)) __PYX_ERR(0, 682, __pyx_L13_error); - __Pyx_INCREF(__pyx_v_args); - __Pyx_GIVEREF(__pyx_v_args); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_args)) __PYX_ERR(0, 682, __pyx_L13_error); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L13_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chunksize, __pyx_int_1) < 0) __PYX_ERR(0, 682, __pyx_L13_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L13_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_results = __pyx_t_6; - __pyx_t_6 = 0; +*/ + __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; + { + PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, __pyx_t_11, __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; + __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); + } + __pyx_v_results = __pyx_t_9; + __pyx_t_9 = 0; /* "constraint/solvers.py":683 * # results = map(parallel_worker, args) # sequential @@ -17389,59 +15772,56 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * for result in results: # <<<<<<<<<<<<<< * solutions.extend(result) * - */ +*/ if (likely(PyList_CheckExact(__pyx_v_results)) || PyTuple_CheckExact(__pyx_v_results)) { - __pyx_t_6 = __pyx_v_results; __Pyx_INCREF(__pyx_t_6); + __pyx_t_9 = __pyx_v_results; __Pyx_INCREF(__pyx_t_9); __pyx_t_4 = 0; - __pyx_t_15 = NULL; + __pyx_t_17 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_results); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 683, __pyx_L13_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 683, __pyx_L13_error) + __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) } for (;;) { - if (likely(!__pyx_t_15)) { - if (likely(PyList_CheckExact(__pyx_t_6))) { + if (likely(!__pyx_t_17)) { + if (likely(PyList_CheckExact(__pyx_t_9))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 683, __pyx_L13_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 683, __pyx_L13_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L13_error) - __Pyx_GOTREF(__pyx_t_1); - #endif + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_4); + ++__pyx_t_4; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + 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, 683, __pyx_L13_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 683, __pyx_L13_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_4)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L13_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_9, __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_15(__pyx_t_6); + __pyx_t_1 = __pyx_t_17(__pyx_t_9); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 683, __pyx_L13_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 683, __pyx_L13_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_1); } + __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_1); __pyx_t_1 = 0; @@ -17451,8 +15831,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * solutions.extend(result) # <<<<<<<<<<<<<< * * return solutions - */ - __pyx_t_16 = __Pyx_PyList_Extend(__pyx_v_solutions, __pyx_v_result); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 684, __pyx_L13_error) +*/ + __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) /* "constraint/solvers.py":683 * # results = map(parallel_worker, args) # sequential @@ -17460,9 +15840,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * for result in results: # <<<<<<<<<<<<<< * solutions.extend(result) * - */ +*/ } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "constraint/solvers.py":680 * # execute in parallel @@ -17470,69 +15850,71 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * with parallel_pool() as executor: # <<<<<<<<<<<<<< * # results = map(parallel_worker, args) # sequential * results = executor.map(parallel_worker, args, chunksize=1) # parallel - */ +*/ } - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __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_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_6, &__pyx_t_1, &__pyx_t_8) < 0) __PYX_ERR(0, 680, __pyx_L15_except_error) - __Pyx_XGOTREF(__pyx_t_6); + 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); __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_8); - __pyx_t_2 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L15_except_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_2, NULL); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 680, __pyx_L15_except_error) - __Pyx_GOTREF(__pyx_t_17); - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_17); - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (__pyx_t_9 < 0) __PYX_ERR(0, 680, __pyx_L15_except_error) - __pyx_t_18 = (!__pyx_t_9); - if (unlikely(__pyx_t_18)) { - __Pyx_GIVEREF(__pyx_t_6); + __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_GIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_8); - __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_1, __pyx_t_8); - __pyx_t_6 = 0; __pyx_t_1 = 0; __pyx_t_8 = 0; + __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_ERR(0, 680, __pyx_L15_except_error) } - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L14_exception_handled; } __pyx_L15_except_error:; - __Pyx_XGIVEREF(__pyx_t_12); - __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); - __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); goto __pyx_L1_error; __pyx_L14_exception_handled:; - __Pyx_XGIVEREF(__pyx_t_12); - __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); - __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __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_L18_try_end:; } } /*finally:*/ { /*normal exit:*/{ - if (__pyx_t_11) { - __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__5, NULL); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + 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; } goto __pyx_L12; } @@ -17540,7 +15922,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi } goto __pyx_L25; __pyx_L9_error:; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L1_error; __pyx_L25:; } @@ -17551,7 +15933,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * return solutions # <<<<<<<<<<<<<< * * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_solutions); __pyx_r = __pyx_v_solutions; @@ -17563,7 +15945,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 # <<<<<<<<<<<<<< * """Parallelized all-solutions finder using ProcessPoolExecutor for work-stealing.""" * # Precompute constraints lookup per variable - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -17571,6 +15953,8 @@ 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_AddTraceback("constraint.solvers.ParallelSolver.getSolutionsList", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -17595,7 +15979,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * return self.getSolutionsList(domains, vconstraints) * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_14ParallelSolver_7getSolutions(PyObject *__pyx_self, @@ -17605,7 +15989,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_7solvers_14ParallelSolver_7getSolutions = {"getSolutions", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_14ParallelSolver_7getSolutions, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_14ParallelSolver_7getSolutions = {"getSolutions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_14ParallelSolver_7getSolutions, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10constraint_7solvers_14ParallelSolver_7getSolutions(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -17629,7 +16013,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutions (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -17637,72 +16021,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 688, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 688, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 688, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 688, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 688, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 688, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 4, 4, 1); __PYX_ERR(0, 688, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 688, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 4, 4, 2); __PYX_ERR(0, 688, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 688, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 4, 4, 3); __PYX_ERR(0, 688, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutions") < 0)) __PYX_ERR(0, 688, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 688, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 688, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 688, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 688, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_domains = ((PyObject*)values[1]); @@ -17715,32 +16073,31 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.ParallelSolver.getSolutions", __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", 1))) __PYX_ERR(0, 688, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 688, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 688, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 688, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 688, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 688, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_14ParallelSolver_6getSolutions(__pyx_self, __pyx_v_self, __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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -17750,12 +16107,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_6getSolutions(C __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; + size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolutions", 1); + __Pyx_RefNannySetupContext("getSolutions", 0); /* "constraint/solvers.py":689 * @@ -17763,31 +16119,17 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_6getSolutions(C * return self.getSolutionsList(domains, vconstraints) # <<<<<<<<<<<<<< * * ### Helper functions for parallel solver - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getSolutionsList); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 689, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif + __pyx_t_2 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_domains, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __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_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); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -17799,13 +16141,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_6getSolutions(C * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * return self.getSolutionsList(domains, vconstraints) * - */ +*/ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("constraint.solvers.ParallelSolver.getSolutions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -17820,7 +16161,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_6getSolutions(C * def is_valid(assignment: dict[Hashable, any], constraints_lookup: list[tuple[Constraint, Hashable]], domains: dict[Hashable, Domain]) -> bool: # noqa E501 # <<<<<<<<<<<<<< * """Check if all constraints are satisfied given the current assignment.""" * return all( - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_5is_valid(PyObject *__pyx_self, @@ -17831,7 +16172,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7solvers_4is_valid, "Check if all constraints are satisfied given the current assignment."); -static PyMethodDef __pyx_mdef_10constraint_7solvers_5is_valid = {"is_valid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_5is_valid, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_4is_valid}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_5is_valid = {"is_valid", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_5is_valid, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_4is_valid}; static PyObject *__pyx_pw_10constraint_7solvers_5is_valid(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -17854,7 +16195,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_valid (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -17862,59 +16203,40 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_assignment,&__pyx_n_s_constraints_lookup,&__pyx_n_s_domains,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 693, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 693, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 693, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignment)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 693, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints_lookup)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 693, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("is_valid", 1, 3, 3, 1); __PYX_ERR(0, 693, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 693, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("is_valid", 1, 3, 3, 2); __PYX_ERR(0, 693, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_valid") < 0)) __PYX_ERR(0, 693, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 693, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 693, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 693, __pyx_L3_error) } __pyx_v_assignment = ((PyObject*)values[0]); __pyx_v_constraints_lookup = ((PyObject*)values[1]); @@ -17926,32 +16248,31 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.is_valid", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignment), (&PyDict_Type), 0, "assignment", 1))) __PYX_ERR(0, 693, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints_lookup), (&PyList_Type), 0, "constraints_lookup", 1))) __PYX_ERR(0, 693, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 693, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignment), (&PyDict_Type), 0, "assignment", 2))) __PYX_ERR(0, 693, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints_lookup), (&PyList_Type), 0, "constraints_lookup", 2))) __PYX_ERR(0, 693, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 693, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_4is_valid(__pyx_self, __pyx_v_assignment, __pyx_v_constraints_lookup, __pyx_v_domains); /* 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -17964,7 +16285,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_7genexpr_2generator4(_ * if all(v in assignment for v in vars_involved) # <<<<<<<<<<<<<< * ) * - */ +*/ static PyObject *__pyx_pf_10constraint_7solvers_8is_valid_7genexpr_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr *__pyx_cur_scope; @@ -17974,7 +16295,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8is_valid_7genexpr_genexpr(PyObj const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_6_genexpr(__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_6_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr *)Py_None); __Pyx_INCREF(Py_None); @@ -17989,7 +16310,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8is_valid_7genexpr_genexpr(PyObj __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_7solvers_8is_valid_7genexpr_2generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_is_valid_locals_genexpr_locals_g, __pyx_n_s_constraint_solvers); if (unlikely(!gen)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7solvers_8is_valid_7genexpr_2generator4, ((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_is_valid_locals_genexpr_locals_g, __pyx_mstate_global->__pyx_n_u_constraint_solvers); if (unlikely(!gen)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -18036,51 +16357,48 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_7genexpr_2generator4(_ } 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, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __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, 698, __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 698, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 698, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 698, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 698, __pyx_L1_error) + __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); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif + ++__pyx_t_2; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __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 (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 698, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 698, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_4); } + __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); @@ -18112,10 +16430,12 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_7genexpr_2generator4(_ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + 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 @@ -18133,7 +16453,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_7genexpr_2generator4(_ * constraint(vars_involved, domains, assignment, None) # <<<<<<<<<<<<<< * for constraint, vars_involved in constraints_lookup * if all(v in assignment for v in vars_involved) - */ +*/ static PyObject *__pyx_pf_10constraint_7solvers_8is_valid_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *__pyx_cur_scope; @@ -18144,7 +16464,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8is_valid_genexpr(PyObject *__py const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_5_genexpr(__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_5_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *)Py_None); __Pyx_INCREF(Py_None); @@ -18159,7 +16479,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8is_valid_genexpr(PyObject *__py __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_7solvers_8is_valid_2generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_is_valid_locals_genexpr, __pyx_n_s_constraint_solvers); if (unlikely(!gen)) __PYX_ERR(0, 696, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7solvers_8is_valid_2generator3, ((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_is_valid_locals_genexpr, __pyx_mstate_global->__pyx_n_u_constraint_solvers); if (unlikely(!gen)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -18188,7 +16508,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; - unsigned int __pyx_t_9; + size_t __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; @@ -18210,24 +16530,22 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro * for constraint, vars_involved in constraints_lookup # <<<<<<<<<<<<<< * if all(v in assignment for v in vars_involved) * ) - */ +*/ if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 697, __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 697, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 697, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + ++__pyx_t_2; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - #endif 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); @@ -18238,18 +16556,22 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_5); } else { - __pyx_t_4 = PyList_GET_ITEM(sequence, 0); - __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); + 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); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_5); } - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -18258,7 +16580,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __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; @@ -18289,10 +16611,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro * if all(v in assignment for v in vars_involved) # <<<<<<<<<<<<<< * ) * - */ +*/ __pyx_t_3 = __pyx_pf_10constraint_7solvers_8is_valid_7genexpr_genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_vars_involved); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 698, __pyx_L1_error) @@ -18305,31 +16627,31 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro * constraint(vars_involved, domains, assignment, None) # <<<<<<<<<<<<<< * for constraint, vars_involved in constraints_lookup * if all(v in assignment for v in vars_involved) - */ +*/ + __pyx_t_3 = NULL; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_constraint); + __pyx_t_4 = __pyx_cur_scope->__pyx_v_constraint; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains)) { __Pyx_RaiseClosureNameError("domains"); __PYX_ERR(0, 696, __pyx_L1_error) } if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_assignment)) { __Pyx_RaiseClosureNameError("assignment"); __PYX_ERR(0, 696, __pyx_L1_error) } - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_constraint); - __pyx_t_3 = __pyx_cur_scope->__pyx_v_constraint; __pyx_t_4 = NULL; - __pyx_t_9 = 0; + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_9 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + assert(__pyx_t_3); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[5] = {__pyx_t_4, __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_3, __pyx_callargs+1-__pyx_t_9, 4+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + 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_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) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -18342,7 +16664,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro * return all( # <<<<<<<<<<<<<< * constraint(vars_involved, domains, assignment, None) * for constraint, vars_involved in constraints_lookup - */ +*/ __Pyx_XDECREF(__pyx_r); /* "constraint/solvers.py":696 @@ -18351,7 +16673,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro * constraint(vars_involved, domains, assignment, None) # <<<<<<<<<<<<<< * for constraint, vars_involved in constraints_lookup * if all(v in assignment for v in vars_involved) - */ +*/ __Pyx_INCREF(Py_False); __pyx_r = Py_False; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -18364,7 +16686,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro * if all(v in assignment for v in vars_involved) # <<<<<<<<<<<<<< * ) * - */ +*/ } /* "constraint/solvers.py":697 @@ -18373,7 +16695,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro * for constraint, vars_involved in constraints_lookup # <<<<<<<<<<<<<< * if all(v in assignment for v in vars_involved) * ) - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*else*/ { @@ -18384,7 +16706,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro * return all( # <<<<<<<<<<<<<< * constraint(vars_involved, domains, assignment, None) * for constraint, vars_involved in constraints_lookup - */ +*/ __Pyx_XDECREF(__pyx_r); /* "constraint/solvers.py":696 @@ -18393,7 +16715,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro * constraint(vars_involved, domains, assignment, None) # <<<<<<<<<<<<<< * for constraint, vars_involved in constraints_lookup * if all(v in assignment for v in vars_involved) - */ +*/ __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; @@ -18403,13 +16725,15 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + 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 @@ -18427,7 +16751,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro * def is_valid(assignment: dict[Hashable, any], constraints_lookup: list[tuple[Constraint, Hashable]], domains: dict[Hashable, Domain]) -> bool: # noqa E501 # <<<<<<<<<<<<<< * """Check if all constraints are satisfied given the current assignment.""" * return all( - */ +*/ static PyObject *__pyx_pf_10constraint_7solvers_4is_valid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_assignment, PyObject *__pyx_v_constraints_lookup, PyObject *__pyx_v_domains) { struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *__pyx_cur_scope; @@ -18440,7 +16764,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_4is_valid(CYTHON_UNUSED PyObject const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_valid", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_4_is_valid(__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_4_is_valid(__pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *)Py_None); __Pyx_INCREF(Py_None); @@ -18461,7 +16785,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_4is_valid(CYTHON_UNUSED PyObject * return all( # <<<<<<<<<<<<<< * constraint(vars_involved, domains, assignment, None) * for constraint, vars_involved in constraints_lookup - */ +*/ __Pyx_XDECREF(__pyx_r); /* "constraint/solvers.py":696 @@ -18470,10 +16794,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_4is_valid(CYTHON_UNUSED PyObject * constraint(vars_involved, domains, assignment, None) # <<<<<<<<<<<<<< * for constraint, vars_involved in constraints_lookup * if all(v in assignment for v in vars_involved) - */ +*/ __pyx_t_1 = __pyx_pf_10constraint_7solvers_8is_valid_genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_constraints_lookup); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error) + __pyx_t_2 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -18486,7 +16810,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_4is_valid(CYTHON_UNUSED PyObject * def is_valid(assignment: dict[Hashable, any], constraints_lookup: list[tuple[Constraint, Hashable]], domains: dict[Hashable, Domain]) -> bool: # noqa E501 # <<<<<<<<<<<<<< * """Check if all constraints are satisfied given the current assignment.""" * return all( - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -18508,7 +16832,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_4is_valid(CYTHON_UNUSED PyObject * def compile_to_function(constraint: CompilableFunctionConstraint) -> FunctionConstraint: # <<<<<<<<<<<<<< * """Compile a CompilableFunctionConstraint to a function, wrapped by a FunctionConstraint.""" * func_string = constraint._func - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_7compile_to_function(PyObject *__pyx_self, @@ -18519,7 +16843,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7solvers_6compile_to_function, "Compile a CompilableFunctionConstraint to a function, wrapped by a FunctionConstraint."); -static PyMethodDef __pyx_mdef_10constraint_7solvers_7compile_to_function = {"compile_to_function", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_7compile_to_function, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_6compile_to_function}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_7compile_to_function = {"compile_to_function", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_7compile_to_function, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_6compile_to_function}; static PyObject *__pyx_pw_10constraint_7solvers_7compile_to_function(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -18540,7 +16864,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("compile_to_function (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -18548,33 +16872,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_constraint,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 701, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraint)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 701, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "compile_to_function") < 0)) __PYX_ERR(0, 701, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 701, __pyx_L3_error) } __pyx_v_constraint = values[0]; } @@ -18584,11 +16903,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.compile_to_function", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -18597,11 +16913,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_10constraint_7solvers_6compile_to_function(__pyx_self, __pyx_v_constraint); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; @@ -18616,13 +16929,13 @@ static PyObject *__pyx_pf_10constraint_7solvers_6compile_to_function(CYTHON_UNUS PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; + size_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; - unsigned int __pyx_t_6; + PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("compile_to_function", 1); + __Pyx_RefNannySetupContext("compile_to_function", 0); /* "constraint/solvers.py":703 * def compile_to_function(constraint: CompilableFunctionConstraint) -> FunctionConstraint: @@ -18630,8 +16943,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_6compile_to_function(CYTHON_UNUS * func_string = constraint._func # <<<<<<<<<<<<<< * code_object = compile(func_string, "", "exec") * func = FunctionType(code_object.co_consts[0], globals()) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_constraint, __pyx_n_s_func); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_constraint, __pyx_mstate_global->__pyx_n_u_func_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_func_string = __pyx_t_1; __pyx_t_1 = 0; @@ -18642,23 +16955,21 @@ static PyObject *__pyx_pf_10constraint_7solvers_6compile_to_function(CYTHON_UNUS * code_object = compile(func_string, "", "exec") # <<<<<<<<<<<<<< * func = FunctionType(code_object.co_consts[0], globals()) * return FunctionConstraint(func) - */ - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_func_string); - __Pyx_GIVEREF(__pyx_v_func_string); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_func_string)) __PYX_ERR(0, 704, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u_string); - __Pyx_GIVEREF(__pyx_kp_u_string); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_string)) __PYX_ERR(0, 704, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_exec); - __Pyx_GIVEREF(__pyx_n_u_exec); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_n_u_exec)) __PYX_ERR(0, 704, __pyx_L1_error); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_compile, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_code_object = __pyx_t_2; - __pyx_t_2 = 0; +*/ + __pyx_t_2 = NULL; + __Pyx_INCREF(__pyx_builtin_compile); + __pyx_t_3 = __pyx_builtin_compile; + __pyx_t_4 = 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_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); + } + __pyx_v_code_object = __pyx_t_1; + __pyx_t_1 = 0; /* "constraint/solvers.py":705 * func_string = constraint._func @@ -18666,42 +16977,41 @@ static PyObject *__pyx_pf_10constraint_7solvers_6compile_to_function(CYTHON_UNUS * func = FunctionType(code_object.co_consts[0], globals()) # <<<<<<<<<<<<<< * return FunctionConstraint(func) * - */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FunctionType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_code_object, __pyx_n_s_co_consts); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_Globals(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; +*/ + __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_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); 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; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_6 = 1; - } + 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); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __pyx_t_4 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_4, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + 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; + __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; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __pyx_v_func = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_func = __pyx_t_1; + __pyx_t_1 = 0; /* "constraint/solvers.py":706 * code_object = compile(func_string, "", "exec") @@ -18709,34 +17019,33 @@ static PyObject *__pyx_pf_10constraint_7solvers_6compile_to_function(CYTHON_UNUS * return FunctionConstraint(func) # <<<<<<<<<<<<<< * * 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_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FunctionConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; - __pyx_t_6 = 0; + __pyx_t_2 = 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; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_6 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); + __pyx_t_4 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_func}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + 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; + __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); } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; /* "constraint/solvers.py":701 @@ -18745,15 +17054,15 @@ static PyObject *__pyx_pf_10constraint_7solvers_6compile_to_function(CYTHON_UNUS * def compile_to_function(constraint: CompilableFunctionConstraint) -> FunctionConstraint: # <<<<<<<<<<<<<< * """Compile a CompilableFunctionConstraint to a function, wrapped by a FunctionConstraint.""" * func_string = constraint._func - */ +*/ /* 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_XDECREF(__pyx_t_6); __Pyx_AddTraceback("constraint.solvers.compile_to_function", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -18771,7 +17080,7 @@ 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 # <<<<<<<<<<<<<< * """Sequential recursive backtracking function for subproblems.""" * if not unassigned_vars: - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_9sequential_recursive_backtrack(PyObject *__pyx_self, @@ -18782,7 +17091,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7solvers_8sequential_recursive_backtrack, "Sequential recursive backtracking function for subproblems."); -static PyMethodDef __pyx_mdef_10constraint_7solvers_9sequential_recursive_backtrack = {"sequential_recursive_backtrack", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_9sequential_recursive_backtrack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_8sequential_recursive_backtrack}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_9sequential_recursive_backtrack = {"sequential_recursive_backtrack", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_9sequential_recursive_backtrack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_8sequential_recursive_backtrack}; static PyObject *__pyx_pw_10constraint_7solvers_9sequential_recursive_backtrack(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -18806,7 +17115,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sequential_recursive_backtrack (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -18814,72 +17123,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_assignment,&__pyx_n_s_unassigned_vars,&__pyx_n_s_domains,&__pyx_n_s_constraint_lookup,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 708, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 708, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 708, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 708, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignment)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 708, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unassigned_vars)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 708, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("sequential_recursive_backtrack", 1, 4, 4, 1); __PYX_ERR(0, 708, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 708, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("sequential_recursive_backtrack", 1, 4, 4, 2); __PYX_ERR(0, 708, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraint_lookup)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 708, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("sequential_recursive_backtrack", 1, 4, 4, 3); __PYX_ERR(0, 708, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "sequential_recursive_backtrack") < 0)) __PYX_ERR(0, 708, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 708, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 708, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 708, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 708, __pyx_L3_error) } __pyx_v_assignment = ((PyObject*)values[0]); __pyx_v_unassigned_vars = ((PyObject*)values[1]); @@ -18892,33 +17175,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.sequential_recursive_backtrack", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignment), (&PyDict_Type), 0, "assignment", 1))) __PYX_ERR(0, 708, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unassigned_vars), (&PyList_Type), 0, "unassigned_vars", 1))) __PYX_ERR(0, 708, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 708, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraint_lookup), (&PyDict_Type), 0, "constraint_lookup", 1))) __PYX_ERR(0, 708, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignment), (&PyDict_Type), 0, "assignment", 2))) __PYX_ERR(0, 708, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unassigned_vars), (&PyList_Type), 0, "unassigned_vars", 2))) __PYX_ERR(0, 708, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 708, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraint_lookup), (&PyDict_Type), 0, "constraint_lookup", 2))) __PYX_ERR(0, 708, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack(__pyx_self, __pyx_v_assignment, __pyx_v_unassigned_vars, __pyx_v_domains, __pyx_v_constraint_lookup); /* 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -18939,12 +17221,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; - unsigned int __pyx_t_10; + size_t __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("sequential_recursive_backtrack", 1); + __Pyx_RefNannySetupContext("sequential_recursive_backtrack", 0); /* "constraint/solvers.py":710 * 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 @@ -18952,8 +17234,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * if not unassigned_vars: # <<<<<<<<<<<<<< * return [assignment.copy()] * - */ - __pyx_t_1 = (PyList_GET_SIZE(__pyx_v_unassigned_vars) != 0); +*/ + __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) __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { @@ -18963,14 +17246,14 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * return [assignment.copy()] # <<<<<<<<<<<<<< * * var = unassigned_vars[-1] - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyDict_Copy(__pyx_v_assignment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 711, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 711, __pyx_L1_error); __pyx_t_3 = 0; __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; @@ -18982,7 +17265,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * if not unassigned_vars: # <<<<<<<<<<<<<< * return [assignment.copy()] * - */ +*/ } /* "constraint/solvers.py":713 @@ -18991,8 +17274,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * var = unassigned_vars[-1] # <<<<<<<<<<<<<< * remaining_vars = unassigned_vars[:-1] * - */ - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_unassigned_vars, -1L, long, 1, __Pyx_PyInt_From_long, 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); 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; @@ -19003,7 +17286,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * remaining_vars = unassigned_vars[:-1] # <<<<<<<<<<<<<< * * solutions: list[dict[Hashable, any]] = [] - */ +*/ __pyx_t_4 = __Pyx_PyList_GetSlice(__pyx_v_unassigned_vars, 0, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_remaining_vars = ((PyObject*)__pyx_t_4); @@ -19015,7 +17298,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * solutions: list[dict[Hashable, any]] = [] # <<<<<<<<<<<<<< * for value in domains[var]: * assignment[var] = value - */ +*/ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_solutions = ((PyObject*)__pyx_t_4); @@ -19027,7 +17310,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * for value in domains[var]: # <<<<<<<<<<<<<< * assignment[var] = value * if is_valid(assignment, constraint_lookup[var], domains): - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { @@ -19037,7 +17320,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( } else { __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 717, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 717, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -19045,44 +17328,41 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 717, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 717, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 717, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_5); + ++__pyx_t_5; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 717, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 717, __pyx_L1_error) + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 717, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); #endif + ++__pyx_t_5; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 717, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 717, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 717, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_4); } + __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; @@ -19092,7 +17372,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * assignment[var] = value # <<<<<<<<<<<<<< * if is_valid(assignment, constraint_lookup[var], domains): * solutions.extend(sequential_recursive_backtrack(assignment, remaining_vars, domains, constraint_lookup)) - */ +*/ if (unlikely((PyDict_SetItem(__pyx_v_assignment, __pyx_v_var, __pyx_v_value) < 0))) __PYX_ERR(0, 718, __pyx_L1_error) /* "constraint/solvers.py":719 @@ -19101,33 +17381,32 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * if is_valid(assignment, constraint_lookup[var], domains): # <<<<<<<<<<<<<< * solutions.extend(sequential_recursive_backtrack(assignment, remaining_vars, domains, constraint_lookup)) * del assignment[var] - */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_is_valid); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 719, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_constraint_lookup, __pyx_v_var); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 719, __pyx_L1_error) +*/ + __pyx_t_7 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_is_valid); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = NULL; - __pyx_t_10 = 0; + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_constraint_lookup, __pyx_v_var); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 719, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_10 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __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_7); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __pyx_t_10 = 0; } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_v_assignment, __pyx_t_8, __pyx_v_domains}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_10, 3+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + 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_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_4)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -19139,30 +17418,29 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * solutions.extend(sequential_recursive_backtrack(assignment, remaining_vars, domains, constraint_lookup)) # <<<<<<<<<<<<<< * del assignment[var] * return solutions - */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_sequential_recursive_backtrack); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 720, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); +*/ __pyx_t_8 = NULL; - __pyx_t_10 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_sequential_recursive_backtrack); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_10 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); + assert(__pyx_t_8); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); + __pyx_t_10 = 0; } #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_7, __pyx_callargs+1-__pyx_t_10, 4+__pyx_t_10); + __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_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) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_11 = __Pyx_PyList_Extend(__pyx_v_solutions, __pyx_t_4); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -19173,7 +17451,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * if is_valid(assignment, constraint_lookup[var], domains): # <<<<<<<<<<<<<< * solutions.extend(sequential_recursive_backtrack(assignment, remaining_vars, domains, constraint_lookup)) * del assignment[var] - */ +*/ } /* "constraint/solvers.py":721 @@ -19182,7 +17460,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * del assignment[var] # <<<<<<<<<<<<<< * return solutions * - */ +*/ if (unlikely((PyDict_DelItem(__pyx_v_assignment, __pyx_v_var) < 0))) __PYX_ERR(0, 721, __pyx_L1_error) /* "constraint/solvers.py":717 @@ -19191,7 +17469,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * for value in domains[var]: # <<<<<<<<<<<<<< * assignment[var] = value * if is_valid(assignment, constraint_lookup[var], domains): - */ +*/ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -19201,7 +17479,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * return solutions # <<<<<<<<<<<<<< * * def sequential_optimized_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_INCREF(__pyx_v_solutions); __pyx_r = __pyx_v_solutions; @@ -19213,7 +17491,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * 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 # <<<<<<<<<<<<<< * """Sequential recursive backtracking function for subproblems.""" * if not unassigned_vars: - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -19240,7 +17518,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * def sequential_optimized_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 # <<<<<<<<<<<<<< * """Sequential optimized backtracking (as in OptimizedBacktrackingSolver) function for subproblems.""" * # Does not do forwardcheck for simplicity - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_11sequential_optimized_backtrack(PyObject *__pyx_self, @@ -19251,7 +17529,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7solvers_10sequential_optimized_backtrack, "Sequential optimized backtracking (as in OptimizedBacktrackingSolver) function for subproblems."); -static PyMethodDef __pyx_mdef_10constraint_7solvers_11sequential_optimized_backtrack = {"sequential_optimized_backtrack", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_11sequential_optimized_backtrack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_10sequential_optimized_backtrack}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_11sequential_optimized_backtrack = {"sequential_optimized_backtrack", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_11sequential_optimized_backtrack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_10sequential_optimized_backtrack}; static PyObject *__pyx_pw_10constraint_7solvers_11sequential_optimized_backtrack(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -19275,7 +17553,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sequential_optimized_backtrack (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -19283,72 +17561,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_assignment,&__pyx_n_s_unassigned_vars,&__pyx_n_s_domains,&__pyx_n_s_constraint_lookup,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 724, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 724, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 724, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 724, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignment)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 724, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unassigned_vars)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 724, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("sequential_optimized_backtrack", 1, 4, 4, 1); __PYX_ERR(0, 724, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 724, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("sequential_optimized_backtrack", 1, 4, 4, 2); __PYX_ERR(0, 724, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraint_lookup)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 724, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("sequential_optimized_backtrack", 1, 4, 4, 3); __PYX_ERR(0, 724, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "sequential_optimized_backtrack") < 0)) __PYX_ERR(0, 724, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 724, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 724, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 724, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 724, __pyx_L3_error) } __pyx_v_assignment = ((PyObject*)values[0]); __pyx_v_unassigned_vars = ((PyObject*)values[1]); @@ -19361,33 +17613,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.sequential_optimized_backtrack", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignment), (&PyDict_Type), 0, "assignment", 1))) __PYX_ERR(0, 724, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unassigned_vars), (&PyList_Type), 0, "unassigned_vars", 1))) __PYX_ERR(0, 724, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 724, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraint_lookup), (&PyDict_Type), 0, "constraint_lookup", 1))) __PYX_ERR(0, 724, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignment), (&PyDict_Type), 0, "assignment", 2))) __PYX_ERR(0, 724, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unassigned_vars), (&PyList_Type), 0, "unassigned_vars", 2))) __PYX_ERR(0, 724, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 724, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraint_lookup), (&PyDict_Type), 0, "constraint_lookup", 2))) __PYX_ERR(0, 724, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack(__pyx_self, __pyx_v_assignment, __pyx_v_unassigned_vars, __pyx_v_domains, __pyx_v_constraint_lookup); /* 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -19414,11 +17665,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack PyObject *(*__pyx_t_9)(PyObject *); PyObject *(*__pyx_t_10)(PyObject *); PyObject *__pyx_t_11 = NULL; - unsigned int __pyx_t_12; + size_t __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("sequential_optimized_backtrack", 1); + __Pyx_RefNannySetupContext("sequential_optimized_backtrack", 0); /* "constraint/solvers.py":728 * # Does not do forwardcheck for simplicity @@ -19426,7 +17677,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * assignments = assignment # <<<<<<<<<<<<<< * sorted_variables = unassigned_vars * queue: list[tuple] = [] - */ +*/ __Pyx_INCREF(__pyx_v_assignment); __pyx_v_assignments = __pyx_v_assignment; @@ -19436,7 +17687,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * sorted_variables = unassigned_vars # <<<<<<<<<<<<<< * queue: list[tuple] = [] * solutions: list[dict] = list() - */ +*/ __Pyx_INCREF(__pyx_v_unassigned_vars); __pyx_v_sorted_variables = __pyx_v_unassigned_vars; @@ -19446,7 +17697,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * queue: list[tuple] = [] # <<<<<<<<<<<<<< * solutions: list[dict] = list() * - */ +*/ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_queue = ((PyObject*)__pyx_t_1); @@ -19458,7 +17709,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * solutions: list[dict] = list() # <<<<<<<<<<<<<< * * while True: - */ +*/ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_solutions = ((PyObject*)__pyx_t_1); @@ -19470,7 +17721,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * while True: # <<<<<<<<<<<<<< * # Mix the Degree and Minimum Remaing Values (MRV) heuristics * for variable in sorted_variables: - */ +*/ while (1) { /* "constraint/solvers.py":735 @@ -19479,23 +17730,21 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * for variable in sorted_variables: # <<<<<<<<<<<<<< * if variable not in assignments: * # Found unassigned variable - */ +*/ __pyx_t_1 = __pyx_v_sorted_variables; __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_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 735, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 735, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + ++__pyx_t_2; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - #endif __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); __pyx_t_3 = 0; @@ -19505,7 +17754,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * if variable not in assignments: # <<<<<<<<<<<<<< * # Found unassigned variable * values = domains[variable][:] - */ +*/ __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 736, __pyx_L1_error) if (__pyx_t_4) { @@ -19515,10 +17764,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * values = domains[variable][:] # <<<<<<<<<<<<<< * break * else: - */ +*/ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_values, __pyx_t_5); @@ -19530,7 +17779,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * break # <<<<<<<<<<<<<< * else: * # No unassigned variables. We've got a solution. Go back - */ +*/ goto __pyx_L6_break; /* "constraint/solvers.py":736 @@ -19539,7 +17788,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * if variable not in assignments: # <<<<<<<<<<<<<< * # Found unassigned variable * values = domains[variable][:] - */ +*/ } /* "constraint/solvers.py":735 @@ -19548,7 +17797,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * for variable in sorted_variables: # <<<<<<<<<<<<<< * if variable not in assignments: * # Found unassigned variable - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L8_for_else; @@ -19564,7 +17813,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * solutions.append(assignments.copy()) # <<<<<<<<<<<<<< * if not queue: * return solutions - */ +*/ __pyx_t_1 = PyDict_Copy(__pyx_v_assignments); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_solutions, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 743, __pyx_L1_error) @@ -19576,8 +17825,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * if not queue: # <<<<<<<<<<<<<< * return solutions * variable, values = queue.pop() - */ - __pyx_t_4 = (PyList_GET_SIZE(__pyx_v_queue) != 0); +*/ + __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) __pyx_t_7 = (!__pyx_t_4); if (__pyx_t_7) { @@ -19587,7 +17837,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * return solutions # <<<<<<<<<<<<<< * variable, values = queue.pop() * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_solutions); __pyx_r = __pyx_v_solutions; @@ -19599,7 +17849,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * if not queue: # <<<<<<<<<<<<<< * return solutions * variable, values = queue.pop() - */ +*/ } /* "constraint/solvers.py":746 @@ -19608,7 +17858,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * variable, values = queue.pop() # <<<<<<<<<<<<<< * * while True: - */ +*/ __pyx_t_1 = __Pyx_PyList_Pop(__pyx_v_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -19621,18 +17871,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_5); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); } else { - __pyx_t_5 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0); + 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); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); } - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19641,7 +17895,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); + __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L11_unpacking_failed; __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; @@ -19670,7 +17924,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * while True: # <<<<<<<<<<<<<< * # We have a variable. Do we have any values left? * if not values: - */ +*/ while (1) { /* "constraint/solvers.py":750 @@ -19679,7 +17933,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * if not values: # <<<<<<<<<<<<<< * # No. Go back to last variable, if there's one. * del assignments[variable] - */ +*/ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_values); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 750, __pyx_L1_error) __pyx_t_4 = (!__pyx_t_7); if (__pyx_t_4) { @@ -19690,7 +17944,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * del assignments[variable] # <<<<<<<<<<<<<< * while queue: * variable, values = queue.pop() - */ +*/ if (unlikely((PyDict_DelItem(__pyx_v_assignments, __pyx_v_variable) < 0))) __PYX_ERR(0, 752, __pyx_L1_error) /* "constraint/solvers.py":753 @@ -19699,9 +17953,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * while queue: # <<<<<<<<<<<<<< * variable, values = queue.pop() * if values: - */ +*/ while (1) { - __pyx_t_4 = (PyList_GET_SIZE(__pyx_v_queue) != 0); + __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) if (!__pyx_t_4) break; /* "constraint/solvers.py":754 @@ -19710,7 +17965,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * variable, values = queue.pop() # <<<<<<<<<<<<<< * if values: * break - */ +*/ __pyx_t_1 = __Pyx_PyList_Pop(__pyx_v_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -19723,18 +17978,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_5); } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + 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); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 754, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_5); } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 754, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19743,7 +18002,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); + __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_L18_unpacking_failed; __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; @@ -19770,7 +18029,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * if values: # <<<<<<<<<<<<<< * break * del assignments[variable] - */ +*/ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_values); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 755, __pyx_L1_error) if (__pyx_t_4) { @@ -19780,7 +18039,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * break # <<<<<<<<<<<<<< * del assignments[variable] * else: - */ +*/ goto __pyx_L17_break; /* "constraint/solvers.py":755 @@ -19789,7 +18048,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * if values: # <<<<<<<<<<<<<< * break * del assignments[variable] - */ +*/ } /* "constraint/solvers.py":757 @@ -19798,7 +18057,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * del assignments[variable] # <<<<<<<<<<<<<< * else: * return solutions - */ +*/ if (unlikely((PyDict_DelItem(__pyx_v_assignments, __pyx_v_variable) < 0))) __PYX_ERR(0, 757, __pyx_L1_error) } @@ -19808,7 +18067,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * return solutions # <<<<<<<<<<<<<< * * # Got a value. Check it. - */ +*/ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_solutions); @@ -19823,7 +18082,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * if not values: # <<<<<<<<<<<<<< * # No. Go back to last variable, if there's one. * del assignments[variable] - */ +*/ } /* "constraint/solvers.py":762 @@ -19832,7 +18091,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * assignments[variable] = values.pop() # <<<<<<<<<<<<<< * for constraint, variables in constraint_lookup[variable]: * if not constraint(variables, domains, assignments, None): - */ +*/ __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely((PyDict_SetItem(__pyx_v_assignments, __pyx_v_variable, __pyx_t_1) < 0))) __PYX_ERR(0, 762, __pyx_L1_error) @@ -19844,7 +18103,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * for constraint, variables in constraint_lookup[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, None): * # Value is not good. - */ +*/ __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_constraint_lookup, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -19854,7 +18113,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack } else { __pyx_t_2 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 763, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -19862,44 +18121,41 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack if (likely(PyList_CheckExact(__pyx_t_5))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 763, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 763, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_2); + ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 763, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_2)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_2); #endif + ++__pyx_t_2; } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 763, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 763, __pyx_L1_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_1); } + __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); @@ -19910,18 +18166,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_8 = PyList_GET_ITEM(sequence, 1); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + 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); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 763, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_8); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19930,7 +18190,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); + __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_11); if (unlikely(!__pyx_t_3)) goto __pyx_L23_unpacking_failed; __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; @@ -19957,29 +18217,29 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * if not constraint(variables, domains, assignments, None): # <<<<<<<<<<<<<< * # Value is not good. * break - */ +*/ + __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_v_constraint); - __pyx_t_8 = __pyx_v_constraint; __pyx_t_3 = NULL; - __pyx_t_12 = 0; + __pyx_t_3 = __pyx_v_constraint; + __pyx_t_12 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_12 = 1; - } + 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_3, __pyx__function); + __pyx_t_12 = 0; } #endif { - PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, Py_None}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_12, 4+__pyx_t_12); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + 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_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) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19992,7 +18252,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * break # <<<<<<<<<<<<<< * else: * break - */ +*/ goto __pyx_L22_break; /* "constraint/solvers.py":764 @@ -20001,7 +18261,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * if not constraint(variables, domains, assignments, None): # <<<<<<<<<<<<<< * # Value is not good. * break - */ +*/ } /* "constraint/solvers.py":763 @@ -20010,7 +18270,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * for constraint, variables in constraint_lookup[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, None): * # Value is not good. - */ +*/ } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L26_for_else; @@ -20026,7 +18286,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * break # <<<<<<<<<<<<<< * * # Push state before looking for next variable. - */ +*/ goto __pyx_L14_break; } __pyx_L27_for_end:; @@ -20039,15 +18299,15 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * queue.append((variable, values)) # <<<<<<<<<<<<<< * * - */ +*/ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_variable); __Pyx_GIVEREF(__pyx_v_variable); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_variable)) __PYX_ERR(0, 771, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_variable) != (0)) __PYX_ERR(0, 771, __pyx_L1_error); __Pyx_INCREF(__pyx_v_values); __Pyx_GIVEREF(__pyx_v_values); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_values)) __PYX_ERR(0, 771, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_values) != (0)) __PYX_ERR(0, 771, __pyx_L1_error); __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_queue, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 771, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -20058,7 +18318,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * def sequential_optimized_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 # <<<<<<<<<<<<<< * """Sequential optimized backtracking (as in OptimizedBacktrackingSolver) function for subproblems.""" * # Does not do forwardcheck for simplicity - */ +*/ /* function exit code */ __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); @@ -20091,7 +18351,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * def parallel_worker(args: tuple[bool, dict[Hashable, Domain], dict[Hashable, list[tuple[Constraint, Hashable]]], Hashable, any, list[Hashable]]) -> list[dict[Hashable, any]]: # noqa E501 # <<<<<<<<<<<<<< * """Worker function for parallel execution on first variable.""" * process_mode, domains, constraint_lookup, first_var, first_value, remaining_vars = args - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_13parallel_worker(PyObject *__pyx_self, @@ -20102,7 +18362,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_10constraint_7solvers_12parallel_worker, "Worker function for parallel execution on first variable."); -static PyMethodDef __pyx_mdef_10constraint_7solvers_13parallel_worker = {"parallel_worker", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_13parallel_worker, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_12parallel_worker}; +static PyMethodDef __pyx_mdef_10constraint_7solvers_13parallel_worker = {"parallel_worker", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7solvers_13parallel_worker, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7solvers_12parallel_worker}; static PyObject *__pyx_pw_10constraint_7solvers_13parallel_worker(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -20123,7 +18383,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parallel_worker (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #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; @@ -20131,33 +18391,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_args,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + 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 (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 774, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 774, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "parallel_worker") < 0)) __PYX_ERR(0, 774, __pyx_L3_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) + 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) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 774, __pyx_L3_error) } __pyx_v_args = ((PyObject*)values[0]); } @@ -20167,30 +18422,29 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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.solvers.parallel_worker", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 0, "args", 1))) __PYX_ERR(0, 774, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 0, "args", 2))) __PYX_ERR(0, 774, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_12parallel_worker(__pyx_self, __pyx_v_args); /* 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:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + 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; } @@ -20224,11 +18478,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED PyObject *(*__pyx_t_13)(PyObject *); PyObject *__pyx_t_14 = NULL; PyObject *(*__pyx_t_15)(PyObject *); - unsigned int __pyx_t_16; + size_t __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("parallel_worker", 1); + __Pyx_RefNannySetupContext("parallel_worker", 0); /* "constraint/solvers.py":776 * def parallel_worker(args: tuple[bool, dict[Hashable, Domain], dict[Hashable, list[tuple[Constraint, Hashable]]], Hashable, any, list[Hashable]]) -> list[dict[Hashable, any]]: # noqa E501 @@ -20236,34 +18490,34 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * process_mode, domains, constraint_lookup, first_var, first_value, remaining_vars = args # <<<<<<<<<<<<<< * local_assignment = {first_var: first_value} * - */ +*/ if (1) { PyObject* sequence = __pyx_v_args; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence); if (unlikely(size != 6)) { if (size > 6) __Pyx_RaiseTooManyValuesError(6); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 776, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 4); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 5); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3); __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 4); __Pyx_INCREF(__pyx_t_5); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 5); __Pyx_INCREF(__pyx_t_6); #else { Py_ssize_t i; PyObject** temps[6] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6}; for (i=0; i < 6; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 776, __pyx_L1_error) + PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } @@ -20289,7 +18543,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * local_assignment = {first_var: first_value} # <<<<<<<<<<<<<< * * if process_mode: - */ +*/ __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) @@ -20302,7 +18556,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * if process_mode: # <<<<<<<<<<<<<< * # if there are any CompilableFunctionConstraint, they must be compiled locally first * for var, constraints in constraint_lookup.items(): - */ +*/ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_process_mode); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 779, __pyx_L1_error) if (__pyx_t_7) { @@ -20312,13 +18566,13 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * for var, constraints in constraint_lookup.items(): # <<<<<<<<<<<<<< * constraint_lookup[var] = [tuple([compile_to_function(constraint) if isinstance(constraint, CompilableFunctionConstraint) else constraint, vals]) for constraint, vals in constraints] # noqa E501 * - */ +*/ __pyx_t_8 = 0; if (unlikely(__pyx_v_constraint_lookup == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 781, __pyx_L1_error) } - __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_constraint_lookup, 0, __pyx_n_s_items, (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 781, __pyx_L1_error) + __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_constraint_lookup, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_5; @@ -20340,7 +18594,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * constraint_lookup[var] = [tuple([compile_to_function(constraint) if isinstance(constraint, CompilableFunctionConstraint) else constraint, vals]) for constraint, vals in constraints] # noqa E501 # <<<<<<<<<<<<<< * * # continue solving sequentially on this process - */ +*/ { /* enter inner scope */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); @@ -20351,51 +18605,48 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED } else { __pyx_t_12 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_constraints); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 782, __pyx_L8_error) + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 782, __pyx_L8_error) } for (;;) { if (likely(!__pyx_t_13)) { if (likely(PyList_CheckExact(__pyx_t_5))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 782, __pyx_L8_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_12); __Pyx_INCREF(__pyx_t_3); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 782, __pyx_L8_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L8_error) - __Pyx_GOTREF(__pyx_t_3); - #endif + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_12); + ++__pyx_t_12; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 782, __pyx_L8_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_12); __Pyx_INCREF(__pyx_t_3); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 782, __pyx_L8_error) + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_12)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L8_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_12); #endif + ++__pyx_t_12; } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L8_error) } else { __pyx_t_3 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 782, __pyx_L8_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 782, __pyx_L8_error) + PyErr_Clear(); } break; } - __Pyx_GOTREF(__pyx_t_3); } + __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); @@ -20406,18 +18657,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_1); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + 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); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L8_error) + __Pyx_XGOTREF(__pyx_t_1); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L8_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L8_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -20426,7 +18681,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED __pyx_t_14 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); index = 0; __pyx_t_2 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed; __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; @@ -20446,34 +18701,33 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_vals, __pyx_t_1); __pyx_t_1 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CompilableFunctionConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L8_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = PyObject_IsInstance(__pyx_9genexpr11__pyx_v_constraint, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_compile_to_function); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L8_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = NULL; - __pyx_t_16 = 0; + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_compile_to_function); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 782, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_16 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_16 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_14); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_14, __pyx__function); + __pyx_t_16 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_9genexpr11__pyx_v_constraint}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + 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_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) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_3 = __pyx_t_1; __pyx_t_1 = 0; @@ -20484,10 +18738,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 782, __pyx_L8_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 782, __pyx_L8_error); __Pyx_INCREF(__pyx_9genexpr11__pyx_v_vals); __Pyx_GIVEREF(__pyx_9genexpr11__pyx_v_vals); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_9genexpr11__pyx_v_vals)) __PYX_ERR(0, 782, __pyx_L8_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_9genexpr11__pyx_v_vals) != (0)) __PYX_ERR(0, 782, __pyx_L8_error); __pyx_t_3 = 0; __pyx_t_3 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); @@ -20516,7 +18770,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * if process_mode: # <<<<<<<<<<<<<< * # if there are any CompilableFunctionConstraint, they must be compiled locally first * for var, constraints in constraint_lookup.items(): - */ +*/ } /* "constraint/solvers.py":785 @@ -20525,33 +18779,32 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * if is_valid(local_assignment, constraint_lookup[first_var], domains): # <<<<<<<<<<<<<< * return sequential_optimized_backtrack(local_assignment, remaining_vars, domains, constraint_lookup) * return [] - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_is_valid); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 785, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_constraint_lookup, __pyx_v_first_var); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 785, __pyx_L1_error) +*/ + __pyx_t_4 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_is_valid); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = NULL; - __pyx_t_16 = 0; + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_constraint_lookup, __pyx_v_first_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 785, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_16 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_16 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __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_4); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); + __pyx_t_16 = 0; } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_local_assignment, __pyx_t_5, __pyx_v_domains}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_16, 3+__pyx_t_16); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + 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_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; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -20563,31 +18816,30 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * return sequential_optimized_backtrack(local_assignment, remaining_vars, domains, constraint_lookup) # <<<<<<<<<<<<<< * return [] * - */ +*/ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sequential_optimized_backtrack); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 786, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; - __pyx_t_16 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_sequential_optimized_backtrack); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_16 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_16 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + assert(__pyx_t_5); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); + __pyx_t_16 = 0; } #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_4, __pyx_callargs+1-__pyx_t_16, 4+__pyx_t_16); + __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_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) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } if (!(likely(PyList_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_6))) __PYX_ERR(0, 786, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_6); @@ -20600,7 +18852,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * if is_valid(local_assignment, constraint_lookup[first_var], domains): # <<<<<<<<<<<<<< * return sequential_optimized_backtrack(local_assignment, remaining_vars, domains, constraint_lookup) * return [] - */ +*/ } /* "constraint/solvers.py":787 @@ -20608,7 +18860,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * return sequential_optimized_backtrack(local_assignment, remaining_vars, domains, constraint_lookup) * return [] # <<<<<<<<<<<<<< * - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); @@ -20622,7 +18874,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * def parallel_worker(args: tuple[bool, dict[Hashable, Domain], dict[Hashable, list[tuple[Constraint, Hashable]]], Hashable, any, list[Hashable]]) -> list[dict[Hashable, any]]: # noqa E501 # <<<<<<<<<<<<<< * """Worker function for parallel execution on first variable.""" * process_mode, domains, constraint_lookup, first_var, first_value, remaining_vars = args - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -20651,11 +18903,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED __Pyx_RefNannyFinishContext(); return __pyx_r; } - -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter *__pyx_freelist_10constraint_7solvers___pyx_scope_struct__getSolutionIter[8]; -static int __pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter = 0; -#endif +/* #### Code section: module_exttypes ### */ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct__getSolutionIter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; @@ -20664,8 +18912,8 @@ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct__getSolut o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter)))) { - o = (PyObject*)__pyx_freelist_10constraint_7solvers___pyx_scope_struct__getSolutionIter[--__pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter]; + 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)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct__getSolutionIter[--__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -20707,12 +18955,12 @@ 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_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter)))) { - __pyx_freelist_10constraint_7solvers___pyx_scope_struct__getSolutionIter[__pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter *)o); + 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)))) { + __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 { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -20726,6 +18974,10 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct__getSoluti static int __pyx_tp_traverse_10constraint_7solvers___pyx_scope_struct__getSolutionIter(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter *p = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_v_assignments) { e = (*v)(p->__pyx_v_assignments, a); if (e) return e; } @@ -20809,12 +19061,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct__getSolu #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -20855,13 +19102,11 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct__getSolu 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -20880,11 +19125,6 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct__getSolu }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter[8]; -static int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter = 0; -#endif - 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 @@ -20892,8 +19132,8 @@ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_1_getSolu o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__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)))) { - o = (PyObject*)__pyx_freelist_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter[--__pyx_freecount_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter]; + 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)))) { + 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]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -20933,12 +19173,12 @@ 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_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)))) { - __pyx_freelist_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter[__pyx_freecount_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter *)o); + 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)))) { + __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 { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -20952,6 +19192,10 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_1_getSolut static int __pyx_tp_traverse_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter *p = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_v_assignments) { e = (*v)(p->__pyx_v_assignments, a); if (e) return e; } @@ -21029,12 +19273,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSol #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -21075,13 +19314,11 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSol 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -21100,11 +19337,6 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSol }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList[8]; -static int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList = 0; -#endif - 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 @@ -21112,8 +19344,8 @@ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_2_getSolu o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__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)))) { - o = (PyObject*)__pyx_freelist_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList[--__pyx_freecount_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList]; + 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)))) { + 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]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -21143,12 +19375,12 @@ 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_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)))) { - __pyx_freelist_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList[__pyx_freecount_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *)o); + 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)))) { + __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 { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -21162,6 +19394,10 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_2_getSolut static int __pyx_tp_traverse_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *p = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_v_constraint_lookup) { e = (*v)(p->__pyx_v_constraint_lookup, a); if (e) return e; } @@ -21231,12 +19467,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSol #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -21277,13 +19508,11 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSol 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -21302,11 +19531,6 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSol }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_3_genexpr[8]; -static int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_3_genexpr = 0; -#endif - 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 @@ -21314,8 +19538,8 @@ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_3_genexpr o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__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)))) { - o = (PyObject*)__pyx_freelist_10constraint_7solvers___pyx_scope_struct_3_genexpr[--__pyx_freecount_10constraint_7solvers___pyx_scope_struct_3_genexpr]; + 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)))) { + 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]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -21344,12 +19568,12 @@ 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_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)))) { - __pyx_freelist_10constraint_7solvers___pyx_scope_struct_3_genexpr[__pyx_freecount_10constraint_7solvers___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr *)o); + 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)))) { + __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 { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -21363,6 +19587,10 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_3_genexpr( static int __pyx_tp_traverse_10constraint_7solvers___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_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; } @@ -21407,12 +19635,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexp #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -21453,13 +19676,11 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexp 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -21478,11 +19699,6 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexp }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_4_is_valid[8]; -static int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_4_is_valid = 0; -#endif - 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 @@ -21490,8 +19706,8 @@ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_4_is_vali o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__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)))) { - o = (PyObject*)__pyx_freelist_10constraint_7solvers___pyx_scope_struct_4_is_valid[--__pyx_freecount_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) & (int)(t->tp_basicsize == 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]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -21518,12 +19734,12 @@ 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_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)))) { - __pyx_freelist_10constraint_7solvers___pyx_scope_struct_4_is_valid[__pyx_freecount_10constraint_7solvers___pyx_scope_struct_4_is_valid++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *)o); + 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)))) { + __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 { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -21537,6 +19753,10 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_4_is_valid static int __pyx_tp_traverse_10constraint_7solvers___pyx_scope_struct_4_is_valid(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *p = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_v_assignment) { e = (*v)(p->__pyx_v_assignment, a); if (e) return e; } @@ -21588,12 +19808,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_val #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -21634,13 +19849,11 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_val 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -21659,11 +19872,6 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_val }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_5_genexpr[8]; -static int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_5_genexpr = 0; -#endif - 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 @@ -21671,8 +19879,8 @@ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_5_genexpr o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__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)))) { - o = (PyObject*)__pyx_freelist_10constraint_7solvers___pyx_scope_struct_5_genexpr[--__pyx_freecount_10constraint_7solvers___pyx_scope_struct_5_genexpr]; + 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)))) { + 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]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -21702,12 +19910,12 @@ 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_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)))) { - __pyx_freelist_10constraint_7solvers___pyx_scope_struct_5_genexpr[__pyx_freecount_10constraint_7solvers___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *)o); + 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)))) { + __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 { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -21721,6 +19929,10 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_5_genexpr( static int __pyx_tp_traverse_10constraint_7solvers___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_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; } @@ -21768,12 +19980,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexp #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -21814,13 +20021,11 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexp 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -21839,11 +20044,6 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexp }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_6_genexpr[8]; -static int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_6_genexpr = 0; -#endif - 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 @@ -21851,8 +20051,8 @@ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_6_genexpr o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__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)))) { - o = (PyObject*)__pyx_freelist_10constraint_7solvers___pyx_scope_struct_6_genexpr[--__pyx_freecount_10constraint_7solvers___pyx_scope_struct_6_genexpr]; + 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)))) { + 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]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -21880,12 +20080,12 @@ 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_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)))) { - __pyx_freelist_10constraint_7solvers___pyx_scope_struct_6_genexpr[__pyx_freecount_10constraint_7solvers___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr *)o); + 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)))) { + __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 { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -21899,6 +20099,10 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_6_genexpr( static int __pyx_tp_traverse_10constraint_7solvers___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_10constraint_7solvers___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; } @@ -21940,12 +20144,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexp #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -21986,13 +20185,11 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexp 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -22014,836 +20211,166 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexp static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; -#ifndef CYTHON_SMALL_CODE -#if defined(__clang__) - #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) -#else - #define CYTHON_SMALL_CODE -#endif -#endif -/* #### Code section: pystring_table ### */ +/* #### Code section: initfunc_declarations ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/ +/* #### Code section: init_module ### */ -static int __Pyx_CreateStringTabAndInitStrings(void) { - __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_Abstract_base_class_for_solvers, __pyx_k_Abstract_base_class_for_solvers, sizeof(__pyx_k_Abstract_base_class_for_solvers), 0, 0, 1, 0}, - {&__pyx_n_s_BacktrackingSolver, __pyx_k_BacktrackingSolver, sizeof(__pyx_k_BacktrackingSolver), 0, 0, 1, 1}, - {&__pyx_n_s_BacktrackingSolver___init, __pyx_k_BacktrackingSolver___init, sizeof(__pyx_k_BacktrackingSolver___init), 0, 0, 1, 1}, - {&__pyx_n_s_BacktrackingSolver_getSolution, __pyx_k_BacktrackingSolver_getSolution, sizeof(__pyx_k_BacktrackingSolver_getSolution), 0, 0, 1, 1}, - {&__pyx_n_s_BacktrackingSolver_getSolutionIt, __pyx_k_BacktrackingSolver_getSolutionIt, sizeof(__pyx_k_BacktrackingSolver_getSolutionIt), 0, 0, 1, 1}, - {&__pyx_n_s_BacktrackingSolver_getSolutionIt_2, __pyx_k_BacktrackingSolver_getSolutionIt_2, sizeof(__pyx_k_BacktrackingSolver_getSolutionIt_2), 0, 0, 1, 1}, - {&__pyx_n_s_BacktrackingSolver_getSolutions, __pyx_k_BacktrackingSolver_getSolutions, sizeof(__pyx_k_BacktrackingSolver_getSolutions), 0, 0, 1, 1}, - {&__pyx_kp_u_Can_t_happen, __pyx_k_Can_t_happen, sizeof(__pyx_k_Can_t_happen), 0, 1, 0, 0}, - {&__pyx_n_s_CompilableFunctionConstraint, __pyx_k_CompilableFunctionConstraint, sizeof(__pyx_k_CompilableFunctionConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_Constraint, __pyx_k_Constraint, sizeof(__pyx_k_Constraint), 0, 0, 1, 1}, - {&__pyx_n_s_Domain, __pyx_k_Domain, sizeof(__pyx_k_Domain), 0, 0, 1, 1}, - {&__pyx_n_s_FunctionConstraint, __pyx_k_FunctionConstraint, sizeof(__pyx_k_FunctionConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_FunctionType, __pyx_k_FunctionType, sizeof(__pyx_k_FunctionType), 0, 0, 1, 1}, - {&__pyx_n_s_Hashable, __pyx_k_Hashable, sizeof(__pyx_k_Hashable), 0, 0, 1, 1}, - {&__pyx_n_s_MinConflictsSolver, __pyx_k_MinConflictsSolver, sizeof(__pyx_k_MinConflictsSolver), 0, 0, 1, 1}, - {&__pyx_n_s_MinConflictsSolver___init, __pyx_k_MinConflictsSolver___init, sizeof(__pyx_k_MinConflictsSolver___init), 0, 0, 1, 1}, - {&__pyx_n_s_MinConflictsSolver_getSolution, __pyx_k_MinConflictsSolver_getSolution, sizeof(__pyx_k_MinConflictsSolver_getSolution), 0, 0, 1, 1}, - {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, - {&__pyx_n_s_OptimizedBacktrackingSolver, __pyx_k_OptimizedBacktrackingSolver, sizeof(__pyx_k_OptimizedBacktrackingSolver), 0, 0, 1, 1}, - {&__pyx_n_s_OptimizedBacktrackingSolver___in, __pyx_k_OptimizedBacktrackingSolver___in, sizeof(__pyx_k_OptimizedBacktrackingSolver___in), 0, 0, 1, 1}, - {&__pyx_n_s_OptimizedBacktrackingSolver_getS, __pyx_k_OptimizedBacktrackingSolver_getS, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS), 0, 0, 1, 1}, - {&__pyx_n_s_OptimizedBacktrackingSolver_getS_2, __pyx_k_OptimizedBacktrackingSolver_getS_2, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS_2), 0, 0, 1, 1}, - {&__pyx_n_s_OptimizedBacktrackingSolver_getS_3, __pyx_k_OptimizedBacktrackingSolver_getS_3, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS_3), 0, 0, 1, 1}, - {&__pyx_n_s_OptimizedBacktrackingSolver_getS_4, __pyx_k_OptimizedBacktrackingSolver_getS_4, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS_4), 0, 0, 1, 1}, - {&__pyx_n_s_OptimizedBacktrackingSolver_getS_5, __pyx_k_OptimizedBacktrackingSolver_getS_5, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS_5), 0, 0, 1, 1}, - {&__pyx_n_s_OptimizedBacktrackingSolver_getS_6, __pyx_k_OptimizedBacktrackingSolver_getS_6, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS_6), 0, 0, 1, 1}, - {&__pyx_n_s_ParallelSolver, __pyx_k_ParallelSolver, sizeof(__pyx_k_ParallelSolver), 0, 0, 1, 1}, - {&__pyx_n_s_ParallelSolver___init, __pyx_k_ParallelSolver___init, sizeof(__pyx_k_ParallelSolver___init), 0, 0, 1, 1}, - {&__pyx_n_s_ParallelSolver_getSolution, __pyx_k_ParallelSolver_getSolution, sizeof(__pyx_k_ParallelSolver_getSolution), 0, 0, 1, 1}, - {&__pyx_n_s_ParallelSolver_getSolutions, __pyx_k_ParallelSolver_getSolutions, sizeof(__pyx_k_ParallelSolver_getSolutions), 0, 0, 1, 1}, - {&__pyx_n_s_ParallelSolver_getSolutionsList, __pyx_k_ParallelSolver_getSolutionsList, sizeof(__pyx_k_ParallelSolver_getSolutionsList), 0, 0, 1, 1}, - {&__pyx_n_s_ParallelSolver_getSolutionsList_2, __pyx_k_ParallelSolver_getSolutionsList_2, sizeof(__pyx_k_ParallelSolver_getSolutionsList_2), 0, 0, 1, 1}, - {&__pyx_n_s_ParallelSolver_getSolutionsList_3, __pyx_k_ParallelSolver_getSolutionsList_3, sizeof(__pyx_k_ParallelSolver_getSolutionsList_3), 0, 0, 1, 1}, - {&__pyx_kp_s_Problem_solver_based_on_the_mini, __pyx_k_Problem_solver_based_on_the_mini, sizeof(__pyx_k_Problem_solver_based_on_the_mini), 0, 0, 1, 0}, - {&__pyx_kp_s_Problem_solver_that_executes_all, __pyx_k_Problem_solver_that_executes_all, sizeof(__pyx_k_Problem_solver_that_executes_all), 0, 0, 1, 0}, - {&__pyx_kp_s_Problem_solver_with_backtracking, __pyx_k_Problem_solver_with_backtracking, sizeof(__pyx_k_Problem_solver_with_backtracking), 0, 0, 1, 0}, - {&__pyx_kp_s_Problem_solver_with_backtracking_2, __pyx_k_Problem_solver_with_backtracking_2, sizeof(__pyx_k_Problem_solver_with_backtracking_2), 0, 0, 1, 0}, - {&__pyx_n_s_ProcessPoolExecutor, __pyx_k_ProcessPoolExecutor, sizeof(__pyx_k_ProcessPoolExecutor), 0, 0, 1, 1}, - {&__pyx_n_s_RecursiveBacktrackingSolver, __pyx_k_RecursiveBacktrackingSolver, sizeof(__pyx_k_RecursiveBacktrackingSolver), 0, 0, 1, 1}, - {&__pyx_n_s_RecursiveBacktrackingSolver___in, __pyx_k_RecursiveBacktrackingSolver___in, sizeof(__pyx_k_RecursiveBacktrackingSolver___in), 0, 0, 1, 1}, - {&__pyx_n_s_RecursiveBacktrackingSolver_getS, __pyx_k_RecursiveBacktrackingSolver_getS, sizeof(__pyx_k_RecursiveBacktrackingSolver_getS), 0, 0, 1, 1}, - {&__pyx_n_s_RecursiveBacktrackingSolver_getS_2, __pyx_k_RecursiveBacktrackingSolver_getS_2, sizeof(__pyx_k_RecursiveBacktrackingSolver_getS_2), 0, 0, 1, 1}, - {&__pyx_n_s_RecursiveBacktrackingSolver_recu, __pyx_k_RecursiveBacktrackingSolver_recu, sizeof(__pyx_k_RecursiveBacktrackingSolver_recu), 0, 0, 1, 1}, - {&__pyx_n_s_RecursiveBacktrackingSolver_recu_2, __pyx_k_RecursiveBacktrackingSolver_recu_2, sizeof(__pyx_k_RecursiveBacktrackingSolver_recu_2), 0, 0, 1, 1}, - {&__pyx_kp_s_Recursive_problem_solver_with_ba, __pyx_k_Recursive_problem_solver_with_ba, sizeof(__pyx_k_Recursive_problem_solver_with_ba), 0, 0, 1, 0}, - {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_n_s_Solver, __pyx_k_Solver, sizeof(__pyx_k_Solver), 0, 0, 1, 1}, - {&__pyx_n_s_Solver_getSolution, __pyx_k_Solver_getSolution, sizeof(__pyx_k_Solver_getSolution), 0, 0, 1, 1}, - {&__pyx_n_s_Solver_getSolutionIter, __pyx_k_Solver_getSolutionIter, sizeof(__pyx_k_Solver_getSolutionIter), 0, 0, 1, 1}, - {&__pyx_n_s_Solver_getSolutions, __pyx_k_Solver_getSolutions, sizeof(__pyx_k_Solver_getSolutions), 0, 0, 1, 1}, - {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, - {&__pyx_n_s_ThreadPoolExecutor, __pyx_k_ThreadPoolExecutor, sizeof(__pyx_k_ThreadPoolExecutor), 0, 0, 1, 1}, - {&__pyx_n_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 1}, - {&__pyx_n_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 1}, - {&__pyx_n_s__61, __pyx_k__61, sizeof(__pyx_k__61), 0, 0, 1, 1}, - {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, - {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, - {&__pyx_n_s_arcconstraints, __pyx_k_arcconstraints, sizeof(__pyx_k_arcconstraints), 0, 0, 1, 1}, - {&__pyx_n_s_arcs, __pyx_k_arcs, sizeof(__pyx_k_arcs), 0, 0, 1, 1}, - {&__pyx_n_s_arcsvariable, __pyx_k_arcsvariable, sizeof(__pyx_k_arcsvariable), 0, 0, 1, 1}, - {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, - {&__pyx_n_s_assignment, __pyx_k_assignment, sizeof(__pyx_k_assignment), 0, 0, 1, 1}, - {&__pyx_n_s_assignments, __pyx_k_assignments, sizeof(__pyx_k_assignments), 0, 0, 1, 1}, - {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, - {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, - {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, - {&__pyx_n_s_check, __pyx_k_check, sizeof(__pyx_k_check), 0, 0, 1, 1}, - {&__pyx_n_s_choice, __pyx_k_choice, sizeof(__pyx_k_choice), 0, 0, 1, 1}, - {&__pyx_n_s_chunksize, __pyx_k_chunksize, sizeof(__pyx_k_chunksize), 0, 0, 1, 1}, - {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, - {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, - {&__pyx_n_s_co_consts, __pyx_k_co_consts, sizeof(__pyx_k_co_consts), 0, 0, 1, 1}, - {&__pyx_n_s_code_object, __pyx_k_code_object, sizeof(__pyx_k_code_object), 0, 0, 1, 1}, - {&__pyx_n_s_collections_abc, __pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 0, 1, 1}, - {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1}, - {&__pyx_n_s_compile_to_function, __pyx_k_compile_to_function, sizeof(__pyx_k_compile_to_function), 0, 0, 1, 1}, - {&__pyx_n_s_concurrent_futures, __pyx_k_concurrent_futures, sizeof(__pyx_k_concurrent_futures), 0, 0, 1, 1}, - {&__pyx_n_s_conflicted, __pyx_k_conflicted, sizeof(__pyx_k_conflicted), 0, 0, 1, 1}, - {&__pyx_n_s_constraint, __pyx_k_constraint, sizeof(__pyx_k_constraint), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_constraints, __pyx_k_constraint_constraints, sizeof(__pyx_k_constraint_constraints), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_domain, __pyx_k_constraint_domain, sizeof(__pyx_k_constraint_domain), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_lookup, __pyx_k_constraint_lookup, sizeof(__pyx_k_constraint_lookup), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_solvers, __pyx_k_constraint_solvers, sizeof(__pyx_k_constraint_solvers), 0, 0, 1, 1}, - {&__pyx_kp_s_constraint_solvers_py, __pyx_k_constraint_solvers_py, sizeof(__pyx_k_constraint_solvers_py), 0, 0, 1, 0}, - {&__pyx_n_s_constraints, __pyx_k_constraints, sizeof(__pyx_k_constraints), 0, 0, 1, 1}, - {&__pyx_n_s_constraints_lookup, __pyx_k_constraints_lookup, sizeof(__pyx_k_constraints_lookup), 0, 0, 1, 1}, - {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, - {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, - {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, - {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, - {&__pyx_kp_s_dict_Hashable_Domain, __pyx_k_dict_Hashable_Domain, sizeof(__pyx_k_dict_Hashable_Domain), 0, 0, 1, 0}, - {&__pyx_kp_s_dict_Hashable_any, __pyx_k_dict_Hashable_any, sizeof(__pyx_k_dict_Hashable_any), 0, 0, 1, 0}, - {&__pyx_kp_s_dict_Hashable_list_tuple_Constra, __pyx_k_dict_Hashable_list_tuple_Constra, sizeof(__pyx_k_dict_Hashable_list_tuple_Constra), 0, 0, 1, 0}, - {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, - {&__pyx_n_s_doArc8, __pyx_k_doArc8, sizeof(__pyx_k_doArc8), 0, 0, 1, 1}, - {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, - {&__pyx_kp_u_doesn_t_provide_iteration, __pyx_k_doesn_t_provide_iteration, sizeof(__pyx_k_doesn_t_provide_iteration), 0, 1, 0, 0}, - {&__pyx_n_s_domain, __pyx_k_domain, sizeof(__pyx_k_domain), 0, 0, 1, 1}, - {&__pyx_n_s_domains, __pyx_k_domains, sizeof(__pyx_k_domains), 0, 0, 1, 1}, - {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, - {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, - {&__pyx_n_u_exec, __pyx_k_exec, sizeof(__pyx_k_exec), 0, 1, 0, 1}, - {&__pyx_n_s_executor, __pyx_k_executor, sizeof(__pyx_k_executor), 0, 0, 1, 1}, - {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, - {&__pyx_n_s_first_value, __pyx_k_first_value, sizeof(__pyx_k_first_value), 0, 0, 1, 1}, - {&__pyx_n_s_first_var, __pyx_k_first_var, sizeof(__pyx_k_first_var), 0, 0, 1, 1}, - {&__pyx_n_s_forwardcheck, __pyx_k_forwardcheck, sizeof(__pyx_k_forwardcheck), 0, 0, 1, 1}, - {&__pyx_n_s_forwardcheck_2, __pyx_k_forwardcheck_2, sizeof(__pyx_k_forwardcheck_2), 0, 0, 1, 1}, - {&__pyx_n_s_fromkeys, __pyx_k_fromkeys, sizeof(__pyx_k_fromkeys), 0, 0, 1, 1}, - {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, - {&__pyx_n_s_func_2, __pyx_k_func_2, sizeof(__pyx_k_func_2), 0, 0, 1, 1}, - {&__pyx_n_s_func_string, __pyx_k_func_string, sizeof(__pyx_k_func_string), 0, 0, 1, 1}, - {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, - {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, - {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, - {&__pyx_n_s_getArcs, __pyx_k_getArcs, sizeof(__pyx_k_getArcs), 0, 0, 1, 1}, - {&__pyx_n_s_getSolution, __pyx_k_getSolution, sizeof(__pyx_k_getSolution), 0, 0, 1, 1}, - {&__pyx_n_s_getSolutionIter, __pyx_k_getSolutionIter, sizeof(__pyx_k_getSolutionIter), 0, 0, 1, 1}, - {&__pyx_n_s_getSolutions, __pyx_k_getSolutions, sizeof(__pyx_k_getSolutions), 0, 0, 1, 1}, - {&__pyx_n_s_getSolutionsList, __pyx_k_getSolutionsList, sizeof(__pyx_k_getSolutionsList), 0, 0, 1, 1}, - {&__pyx_n_s_getSortedVariables, __pyx_k_getSortedVariables, sizeof(__pyx_k_getSortedVariables), 0, 0, 1, 1}, - {&__pyx_n_s_hideValue, __pyx_k_hideValue, sizeof(__pyx_k_hideValue), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, - {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, - {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, - {&__pyx_kp_u_is_an_abstract_class, __pyx_k_is_an_abstract_class, sizeof(__pyx_k_is_an_abstract_class), 0, 1, 0, 0}, - {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, - {&__pyx_n_s_is_valid, __pyx_k_is_valid, sizeof(__pyx_k_is_valid), 0, 0, 1, 1}, - {&__pyx_n_s_is_valid_locals_genexpr, __pyx_k_is_valid_locals_genexpr, sizeof(__pyx_k_is_valid_locals_genexpr), 0, 0, 1, 1}, - {&__pyx_n_s_is_valid_locals_genexpr_locals_g, __pyx_k_is_valid_locals_genexpr_locals_g, sizeof(__pyx_k_is_valid_locals_genexpr_locals_g), 0, 0, 1, 1}, - {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, - {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1}, - {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, - {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1}, - {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, - {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, - {&__pyx_n_s_list, __pyx_k_list, sizeof(__pyx_k_list), 0, 0, 1, 1}, - {&__pyx_kp_s_list_Hashable, __pyx_k_list_Hashable, sizeof(__pyx_k_list_Hashable), 0, 0, 1, 0}, - {&__pyx_kp_s_list_dict_Hashable_any, __pyx_k_list_dict_Hashable_any, sizeof(__pyx_k_list_dict_Hashable_any), 0, 0, 1, 0}, - {&__pyx_kp_s_list_tuple, __pyx_k_list_tuple, sizeof(__pyx_k_list_tuple), 0, 0, 1, 0}, - {&__pyx_kp_s_list_tuple_Constraint_Hashable, __pyx_k_list_tuple_Constraint_Hashable, sizeof(__pyx_k_list_tuple_Constraint_Hashable), 0, 0, 1, 0}, - {&__pyx_n_s_local_assignment, __pyx_k_local_assignment, sizeof(__pyx_k_local_assignment), 0, 0, 1, 1}, - {&__pyx_n_s_lst, __pyx_k_lst, sizeof(__pyx_k_lst), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1}, - {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, - {&__pyx_n_s_mincount, __pyx_k_mincount, sizeof(__pyx_k_mincount), 0, 0, 1, 1}, - {&__pyx_n_s_minvalues, __pyx_k_minvalues, sizeof(__pyx_k_minvalues), 0, 0, 1, 1}, - {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, - {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, - {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_kp_u_only_provides_all_solutions, __pyx_k_only_provides_all_solutions, sizeof(__pyx_k_only_provides_all_solutions), 0, 1, 0, 0}, - {&__pyx_n_s_otherdomain, __pyx_k_otherdomain, sizeof(__pyx_k_otherdomain), 0, 0, 1, 1}, - {&__pyx_n_s_othervalue, __pyx_k_othervalue, sizeof(__pyx_k_othervalue), 0, 0, 1, 1}, - {&__pyx_n_s_othervariable, __pyx_k_othervariable, sizeof(__pyx_k_othervariable), 0, 0, 1, 1}, - {&__pyx_n_s_parallel_pool, __pyx_k_parallel_pool, sizeof(__pyx_k_parallel_pool), 0, 0, 1, 1}, - {&__pyx_n_s_parallel_worker, __pyx_k_parallel_worker, sizeof(__pyx_k_parallel_worker), 0, 0, 1, 1}, - {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, - {&__pyx_n_s_popState, __pyx_k_popState, sizeof(__pyx_k_popState), 0, 0, 1, 1}, - {&__pyx_n_s_popitem, __pyx_k_popitem, sizeof(__pyx_k_popitem), 0, 0, 1, 1}, - {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, - {&__pyx_n_s_process_mode, __pyx_k_process_mode, sizeof(__pyx_k_process_mode), 0, 0, 1, 1}, - {&__pyx_n_s_process_mode_2, __pyx_k_process_mode_2, sizeof(__pyx_k_process_mode_2), 0, 0, 1, 1}, - {&__pyx_kp_u_provides_only_a_single_solution, __pyx_k_provides_only_a_single_solution, sizeof(__pyx_k_provides_only_a_single_solution), 0, 1, 0, 0}, - {&__pyx_n_s_pushState, __pyx_k_pushState, sizeof(__pyx_k_pushState), 0, 0, 1, 1}, - {&__pyx_n_s_pushdomains, __pyx_k_pushdomains, sizeof(__pyx_k_pushdomains), 0, 0, 1, 1}, - {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, - {&__pyx_n_s_queue, __pyx_k_queue, sizeof(__pyx_k_queue), 0, 0, 1, 1}, - {&__pyx_n_s_rand, __pyx_k_rand, sizeof(__pyx_k_rand), 0, 0, 1, 1}, - {&__pyx_n_s_rand_2, __pyx_k_rand_2, sizeof(__pyx_k_rand_2), 0, 0, 1, 1}, - {&__pyx_n_s_random, __pyx_k_random, sizeof(__pyx_k_random), 0, 0, 1, 1}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_recursiveBacktracking, __pyx_k_recursiveBacktracking, sizeof(__pyx_k_recursiveBacktracking), 0, 0, 1, 1}, - {&__pyx_n_s_remaining_vars, __pyx_k_remaining_vars, sizeof(__pyx_k_remaining_vars), 0, 0, 1, 1}, - {&__pyx_n_s_requires_pickling, __pyx_k_requires_pickling, sizeof(__pyx_k_requires_pickling), 0, 0, 1, 1}, - {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, - {&__pyx_n_s_results, __pyx_k_results, sizeof(__pyx_k_results), 0, 0, 1, 1}, - {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1}, - {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, - {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, - {&__pyx_n_s_sequential_optimized_backtrack, __pyx_k_sequential_optimized_backtrack, sizeof(__pyx_k_sequential_optimized_backtrack), 0, 0, 1, 1}, - {&__pyx_n_s_sequential_recursive_backtrack, __pyx_k_sequential_recursive_backtrack, sizeof(__pyx_k_sequential_recursive_backtrack), 0, 0, 1, 1}, - {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, - {&__pyx_n_s_setdefault, __pyx_k_setdefault, sizeof(__pyx_k_setdefault), 0, 0, 1, 1}, - {&__pyx_n_s_shuffle, __pyx_k_shuffle, sizeof(__pyx_k_shuffle), 0, 0, 1, 1}, - {&__pyx_n_s_single, __pyx_k_single, sizeof(__pyx_k_single), 0, 0, 1, 1}, - {&__pyx_n_s_solutions, __pyx_k_solutions, sizeof(__pyx_k_solutions), 0, 0, 1, 1}, - {&__pyx_n_s_sort, __pyx_k_sort, sizeof(__pyx_k_sort), 0, 0, 1, 1}, - {&__pyx_n_s_sorted, __pyx_k_sorted, sizeof(__pyx_k_sorted), 0, 0, 1, 1}, - {&__pyx_n_s_sorted_variables, __pyx_k_sorted_variables, sizeof(__pyx_k_sorted_variables), 0, 0, 1, 1}, - {&__pyx_n_s_sorted_vars, __pyx_k_sorted_vars, sizeof(__pyx_k_sorted_vars), 0, 0, 1, 1}, - {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, - {&__pyx_n_s_steps, __pyx_k_steps, sizeof(__pyx_k_steps), 0, 0, 1, 1}, - {&__pyx_n_s_steps_2, __pyx_k_steps_2, sizeof(__pyx_k_steps_2), 0, 0, 1, 1}, - {&__pyx_kp_u_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 1, 0, 0}, - {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, - {&__pyx_kp_s_tuple_bool_dict_Hashable_Domain, __pyx_k_tuple_bool_dict_Hashable_Domain, sizeof(__pyx_k_tuple_bool_dict_Hashable_Domain), 0, 0, 1, 0}, - {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1}, - {&__pyx_n_s_unassigned_vars, __pyx_k_unassigned_vars, sizeof(__pyx_k_unassigned_vars), 0, 0, 1, 1}, - {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, - {&__pyx_n_s_vals, __pyx_k_vals, sizeof(__pyx_k_vals), 0, 0, 1, 1}, - {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, - {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, - {&__pyx_n_s_var, __pyx_k_var, sizeof(__pyx_k_var), 0, 0, 1, 1}, - {&__pyx_n_s_variable, __pyx_k_variable, sizeof(__pyx_k_variable), 0, 0, 1, 1}, - {&__pyx_n_s_variable1, __pyx_k_variable1, sizeof(__pyx_k_variable1), 0, 0, 1, 1}, - {&__pyx_n_s_variable2, __pyx_k_variable2, sizeof(__pyx_k_variable2), 0, 0, 1, 1}, - {&__pyx_n_s_variables, __pyx_k_variables, sizeof(__pyx_k_variables), 0, 0, 1, 1}, - {&__pyx_n_s_vconstraints, __pyx_k_vconstraints, sizeof(__pyx_k_vconstraints), 0, 0, 1, 1}, - {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} - }; - return __Pyx_InitStrings(__pyx_string_tab); -} -/* #### Code section: cached_builtins ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 87, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 221, __pyx_L1_error) - __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 227, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 573, __pyx_L1_error) - __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 646, __pyx_L1_error) - __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(0, 668, __pyx_L1_error) - __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_n_s_compile); if (!__pyx_builtin_compile) __PYX_ERR(0, 704, __pyx_L1_error) +static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); return 0; - __pyx_L1_error:; - return -1; } -/* #### Code section: cached_constants ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { +static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "constraint/solvers.py":48 - * if domain: - * # changed = False - * for value in domain[:]: # <<<<<<<<<<<<<< - * assignments[variable] = value - * if otherdomain: - */ - __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice_); - __Pyx_GIVEREF(__pyx_slice_); - - /* "constraint/solvers.py":221 - * queue.append((variable, values, pushdomains)) - * - * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< - * - * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Can_t_happen); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - - /* "constraint/solvers.py":680 - * # execute in parallel - * parallel_pool = ProcessPoolExecutor if self._process_mode else ThreadPoolExecutor - * with parallel_pool() as executor: # <<<<<<<<<<<<<< - * # results = map(parallel_worker, args) # sequential - * results = executor.map(parallel_worker, args, chunksize=1) # parallel - */ - __pyx_tuple__5 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - - /* "constraint/solvers.py":13 - * - * - * def getArcs(domains: dict, constraints: list[tuple]) -> dict: # <<<<<<<<<<<<<< - * """Return a dictionary mapping pairs (arcs) of constrained variables. - * - */ - __pyx_tuple__8 = PyTuple_Pack(8, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_arcs, __pyx_n_s_x, __pyx_n_s_constraint, __pyx_n_s_variables, __pyx_n_s_variable1, __pyx_n_s_variable2); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getArcs, 13, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 13, __pyx_L1_error) - - /* "constraint/solvers.py":28 - * - * - * def doArc8(arcs: dict, domains: dict, assignments: dict) -> bool: # <<<<<<<<<<<<<< - * """Perform the ARC-8 arc checking algorithm and prune domains. - * - */ - __pyx_tuple__11 = PyTuple_Pack(15, __pyx_n_s_arcs, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_check, __pyx_n_s_variable, __pyx_n_s__10, __pyx_n_s_domain, __pyx_n_s_arcsvariable, __pyx_n_s_othervariable, __pyx_n_s_arcconstraints, __pyx_n_s_otherdomain, __pyx_n_s_value, __pyx_n_s_othervalue, __pyx_n_s_constraint, __pyx_n_s_variables); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 28, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); - __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_doArc8, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 28, __pyx_L1_error) - - /* "constraint/solvers.py":77 - * requires_pickling = False - * - * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< - * """Return one solution for the given problem. - * - */ - __pyx_tuple__13 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 77, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); - __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolution, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 77, __pyx_L1_error) - - /* "constraint/solvers.py":89 - * raise NotImplementedError(msg) - * - * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< - * """Return all solutions for the given problem. - * - */ - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolutions, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 89, __pyx_L1_error) - - /* "constraint/solvers.py":101 - * raise NotImplementedError(msg) - * - * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< - * """Return an iterator for the solutions of the given problem. - * - */ - __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolutionIter, 101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 101, __pyx_L1_error) + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} - /* "constraint/solvers.py":143 - * """ - * - * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_forwardcheck); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); - __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_init, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 143, __pyx_L1_error) - __pyx_tuple__19 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); +static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} - /* "constraint/solvers.py":153 - * self._forwardcheck = forwardcheck - * - * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * forwardcheck = self._forwardcheck - * assignments = {} - */ - __pyx_tuple__20 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_forwardcheck, __pyx_n_s_assignments, __pyx_n_s_queue, __pyx_n_s_lst, __pyx_n_s_item, __pyx_n_s_variable, __pyx_n_s_values, __pyx_n_s_pushdomains, __pyx_n_s_domain, __pyx_n_s_constraint, __pyx_n_s_variables, __pyx_n_s_variable, __pyx_n_s_x); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolutionIter, 153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 153, __pyx_L1_error) - - /* "constraint/solvers.py":223 - * raise RuntimeError("Can't happen") - * - * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * iter = self.getSolutionIter(domains, constraints, vconstraints) - * try: - */ - __pyx_tuple__21 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_iter); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 223, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); - __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolution, 223, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 223, __pyx_L1_error) - - /* "constraint/solvers.py":230 - * return None - * - * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * return list(self.getSolutionIter(domains, constraints, vconstraints)) - * - */ - __pyx_tuple__23 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); - __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolutions, 230, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 230, __pyx_L1_error) - - /* "constraint/solvers.py":266 - * """ - * - * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_init, 266, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 266, __pyx_L1_error) - - /* "constraint/solvers.py":276 - * self._forwardcheck = forwardcheck - * - * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * forwardcheck = self._forwardcheck - * assignments = {} - */ - __pyx_tuple__26 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_forwardcheck, __pyx_n_s_assignments, __pyx_n_s_sorted_variables, __pyx_n_s_queue, __pyx_n_s_variable, __pyx_n_s_values, __pyx_n_s_pushdomains, __pyx_n_s_domain, __pyx_n_s_constraint, __pyx_n_s_variables, __pyx_n_s_x); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 276, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); - __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolutionIter, 276, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 276, __pyx_L1_error) - - /* "constraint/solvers.py":344 - * raise RuntimeError("Can't happen") - * - * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 # <<<<<<<<<<<<<< - * """Optimized all-solutions finder that skips forwardchecking and returns the solutions in a list. - * - */ - __pyx_tuple__27 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_vconstraints, __pyx_n_s_assignments, __pyx_n_s_queue, __pyx_n_s_solutions, __pyx_n_s_sorted_variables, __pyx_n_s_variable, __pyx_n_s_values, __pyx_n_s_constraint, __pyx_n_s_variables); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); - __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolutionsList, 344, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 344, __pyx_L1_error) - - /* "constraint/solvers.py":401 - * queue.append((variable, values)) - * - * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * if self._forwardcheck: - * return list(self.getSolutionIter(domains, constraints, vconstraints)) - */ - __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolutions, 401, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 401, __pyx_L1_error) - - /* "constraint/solvers.py":406 - * return self.getSolutionsList(domains, vconstraints) - * - * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * iter = self.getSolutionIter(domains, constraints, vconstraints) - * try: - */ - __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolution, 406, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 406, __pyx_L1_error) - - /* "constraint/solvers.py":413 - * return None - * - * def getSortedVariables(self, domains: dict, vconstraints: dict) -> list: # <<<<<<<<<<<<<< - * """Sorts the list of variables on number of vconstraints to find unassigned variables quicker. - * - */ - __pyx_tuple__31 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_vconstraints, __pyx_n_s_lst, __pyx_n_s_variable, __pyx_n_s__10, __pyx_n_s_c); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); - __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSortedVariables, 413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 413, __pyx_L1_error) - - /* "constraint/solvers.py":456 - * """ - * - * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_init, 456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 456, __pyx_L1_error) - - /* "constraint/solvers.py":466 - * self._forwardcheck = forwardcheck - * - * def recursiveBacktracking(self, solutions, domains, vconstraints, assignments, single): # <<<<<<<<<<<<<< - * """Mix the Degree and Minimum Remaing Values (MRV) heuristics. - * - */ - __pyx_tuple__34 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_solutions, __pyx_n_s_domains, __pyx_n_s_vconstraints, __pyx_n_s_assignments, __pyx_n_s_single, __pyx_n_s_lst, __pyx_n_s_item, __pyx_n_s_variable, __pyx_n_s_forwardcheck, __pyx_n_s_pushdomains, __pyx_n_s_value, __pyx_n_s_domain, __pyx_n_s_constraint, __pyx_n_s_variables, __pyx_n_s_variable, __pyx_n_s_x); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 466, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); - __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_recursiveBacktracking, 466, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 466, __pyx_L1_error) - - /* "constraint/solvers.py":519 - * return solutions - * - * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * solutions = self.recursiveBacktracking([], domains, vconstraints, {}, True) - * return solutions and solutions[0] or None - */ - __pyx_tuple__36 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_solutions); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 519, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); - __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolution, 519, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 519, __pyx_L1_error) - - /* "constraint/solvers.py":523 - * return solutions and solutions[0] or None - * - * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * return self.recursiveBacktracking([], domains, vconstraints, {}, False) - * - */ - __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolutions, 523, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 523, __pyx_L1_error) - - /* "constraint/solvers.py":554 - * """ - * - * def __init__(self, steps=1000, rand=None): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_tuple__39 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_steps, __pyx_n_s_rand); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); - __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_init, 554, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 554, __pyx_L1_error) - __pyx_tuple__41 = PyTuple_Pack(2, ((PyObject *)__pyx_int_1000), Py_None); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); - - /* "constraint/solvers.py":566 - * self._rand = rand - * - * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * 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_tuple__42 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_choice, __pyx_n_s_shuffle, __pyx_n_s_assignments, __pyx_n_s_variable, __pyx_n_s__10, __pyx_n_s_conflicted, __pyx_n_s_lst, __pyx_n_s_constraint, __pyx_n_s_variables, __pyx_n_s_mincount, __pyx_n_s_minvalues, __pyx_n_s_value, __pyx_n_s_count); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__42); - __Pyx_GIVEREF(__pyx_tuple__42); - __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolution, 566, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 566, __pyx_L1_error) - - /* "constraint/solvers.py":644 - * """ # noqa E501 - * - * def __init__(self, process_mode=False): # <<<<<<<<<<<<<< - * """Initialization method. Set `process_mode` to True for using ProcessPool, otherwise uses ThreadPool.""" - * super().__init__() - */ - __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_process_mode); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__44); - __Pyx_GIVEREF(__pyx_tuple__44); - __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_init, 644, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 644, __pyx_L1_error) - __pyx_tuple__46 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__46); - __Pyx_GIVEREF(__pyx_tuple__46); - - /* "constraint/solvers.py":650 - * self.requires_pickling = process_mode - * - * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< - * """Return one solution for the given problem. - * - */ - __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolution, 650, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 650, __pyx_L1_error) - - /* "constraint/solvers.py":662 - * raise NotImplementedError(msg) - * - * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 # <<<<<<<<<<<<<< - * """Parallelized all-solutions finder using ProcessPoolExecutor for work-stealing.""" - * # Precompute constraints lookup per variable - */ - __pyx_tuple__48 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_vconstraints, __pyx_n_s_constraint_lookup, __pyx_n_s_sorted_vars, __pyx_n_s_first_var, __pyx_n_s_remaining_vars, __pyx_n_s_args, __pyx_n_s_solutions, __pyx_n_s_parallel_pool, __pyx_n_s_executor, __pyx_n_s_results, __pyx_n_s_result, __pyx_n_s_var, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 662, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__48); - __Pyx_GIVEREF(__pyx_tuple__48); - __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolutionsList, 662, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 662, __pyx_L1_error) - - /* "constraint/solvers.py":688 - * return solutions - * - * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * return self.getSolutionsList(domains, vconstraints) - * - */ - __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolutions, 688, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 688, __pyx_L1_error) - - /* "constraint/solvers.py":693 - * ### Helper functions for parallel solver - * - * def is_valid(assignment: dict[Hashable, any], constraints_lookup: list[tuple[Constraint, Hashable]], domains: dict[Hashable, Domain]) -> bool: # noqa E501 # <<<<<<<<<<<<<< - * """Check if all constraints are satisfied given the current assignment.""" - * return all( - */ - __pyx_tuple__51 = PyTuple_Pack(5, __pyx_n_s_assignment, __pyx_n_s_constraints_lookup, __pyx_n_s_domains, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__51); - __Pyx_GIVEREF(__pyx_tuple__51); - __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_is_valid, 693, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 693, __pyx_L1_error) - - /* "constraint/solvers.py":701 - * ) - * - * def compile_to_function(constraint: CompilableFunctionConstraint) -> FunctionConstraint: # <<<<<<<<<<<<<< - * """Compile a CompilableFunctionConstraint to a function, wrapped by a FunctionConstraint.""" - * func_string = constraint._func - */ - __pyx_tuple__53 = PyTuple_Pack(4, __pyx_n_s_constraint, __pyx_n_s_func_string, __pyx_n_s_code_object, __pyx_n_s_func_2); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__53); - __Pyx_GIVEREF(__pyx_tuple__53); - __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_compile_to_function, 701, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 701, __pyx_L1_error) - - /* "constraint/solvers.py":708 - * return FunctionConstraint(func) - * - * 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 # <<<<<<<<<<<<<< - * """Sequential recursive backtracking function for subproblems.""" - * if not unassigned_vars: - */ - __pyx_tuple__55 = PyTuple_Pack(8, __pyx_n_s_assignment, __pyx_n_s_unassigned_vars, __pyx_n_s_domains, __pyx_n_s_constraint_lookup, __pyx_n_s_var, __pyx_n_s_remaining_vars, __pyx_n_s_solutions, __pyx_n_s_value); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 708, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__55); - __Pyx_GIVEREF(__pyx_tuple__55); - __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_sequential_recursive_backtrack, 708, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 708, __pyx_L1_error) - - /* "constraint/solvers.py":724 - * return solutions - * - * def sequential_optimized_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 # <<<<<<<<<<<<<< - * """Sequential optimized backtracking (as in OptimizedBacktrackingSolver) function for subproblems.""" - * # Does not do forwardcheck for simplicity - */ - __pyx_tuple__57 = PyTuple_Pack(12, __pyx_n_s_assignment, __pyx_n_s_unassigned_vars, __pyx_n_s_domains, __pyx_n_s_constraint_lookup, __pyx_n_s_assignments, __pyx_n_s_sorted_variables, __pyx_n_s_queue, __pyx_n_s_solutions, __pyx_n_s_variable, __pyx_n_s_values, __pyx_n_s_constraint, __pyx_n_s_variables); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 724, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__57); - __Pyx_GIVEREF(__pyx_tuple__57); - __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_sequential_optimized_backtrack, 724, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 724, __pyx_L1_error) - - /* "constraint/solvers.py":774 - * - * - * def parallel_worker(args: tuple[bool, dict[Hashable, Domain], dict[Hashable, list[tuple[Constraint, Hashable]]], Hashable, any, list[Hashable]]) -> list[dict[Hashable, any]]: # noqa E501 # <<<<<<<<<<<<<< - * """Worker function for parallel execution on first variable.""" - * process_mode, domains, constraint_lookup, first_var, first_value, remaining_vars = args - */ - __pyx_tuple__59 = PyTuple_Pack(12, __pyx_n_s_args, __pyx_n_s_process_mode, __pyx_n_s_domains, __pyx_n_s_constraint_lookup, __pyx_n_s_first_var, __pyx_n_s_first_value, __pyx_n_s_remaining_vars, __pyx_n_s_local_assignment, __pyx_n_s_var, __pyx_n_s_constraints, __pyx_n_s_constraint, __pyx_n_s_vals); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__59); - __Pyx_GIVEREF(__pyx_tuple__59); - __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_parallel_worker, 774, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 774, __pyx_L1_error) - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} -/* #### Code section: init_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { - __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; - __pyx_umethod_PyDict_Type_get.method_name = &__pyx_n_s_get; - __pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type; - __pyx_umethod_PyDict_Type_keys.method_name = &__pyx_n_s_keys; - __pyx_umethod_PyDict_Type_setdefault.type = (PyObject*)&PyDict_Type; - __pyx_umethod_PyDict_Type_setdefault.method_name = &__pyx_n_s_setdefault; - __pyx_umethod_PyList_Type_copy.type = (PyObject*)&PyList_Type; - __pyx_umethod_PyList_Type_copy.method_name = &__pyx_n_s_copy; - __pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type; - __pyx_umethod_PyList_Type_pop.method_name = &__pyx_n_s_pop; - if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(0, 1, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_globals ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - return 0; -} -/* #### Code section: init_module ### */ - -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ - -static int __Pyx_modinit_global_init_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); - /*--- Global init code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_variable_export_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); - /*--- Variable export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_function_export_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); - /*--- Function export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_type_init_code(void) { +static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __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_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_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter) < 0) __PYX_ERR(0, 153, __pyx_L1_error) + __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) #else - __pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter = &__pyx_type_10constraint_7solvers___pyx_scope_struct__getSolutionIter; + __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_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter) < 0) __PYX_ERR(0, 153, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter->tp_print = 0; + 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_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter->tp_dictoffset && __pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __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_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_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter) < 0) __PYX_ERR(0, 276, __pyx_L1_error) + __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) #else - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter = &__pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter; + __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_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter) < 0) __PYX_ERR(0, 276, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter->tp_print = 0; + 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_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter->tp_dictoffset && __pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __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_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_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList) < 0) __PYX_ERR(0, 662, __pyx_L1_error) + __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) #else - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList = &__pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList; + __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_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList) < 0) __PYX_ERR(0, 662, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList->tp_print = 0; + 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_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList->tp_dictoffset && __pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __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_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_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 675, __pyx_L1_error) + __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) #else - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr = &__pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexpr; + __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_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 675, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr->tp_print = 0; + 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_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __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_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_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid) < 0) __PYX_ERR(0, 693, __pyx_L1_error) + __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) #else - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid = &__pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_valid; + __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_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid) < 0) __PYX_ERR(0, 693, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid->tp_print = 0; + 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_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid->tp_dictoffset && __pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __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_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_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 696, __pyx_L1_error) + __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) #else - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr = &__pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr; + __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_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 696, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr->tp_print = 0; + 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_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr->tp_dictoffset && __pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __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_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_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 698, __pyx_L1_error) + __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) #else - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr = &__pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr; + __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_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 698, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr->tp_print = 0; + 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_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr->tp_dictoffset && __pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif __Pyx_RefNannyFinishContext(); @@ -22853,38 +20380,45 @@ static int __Pyx_modinit_type_init_code(void) { return -1; } -static int __Pyx_modinit_type_import_code(void) { +static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_variable_import_code(void) { +static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_function_import_code(void) { +static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } - -#if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_solvers(PyObject* module); /*proto*/ 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}, + #endif + #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE + {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED}, + #endif {0, NULL} }; #endif @@ -22899,12 +20433,10 @@ namespace { PyModuleDef_HEAD_INIT, "solvers", __pyx_k_Module_containing_the_code_for_t, /* m_doc */ - #if CYTHON_PEP489_MULTI_PHASE_INIT - 0, /* m_size */ - #elif CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstate), /* m_size */ + #if CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstatetype), /* m_size */ #else - -1, /* m_size */ + (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT @@ -22925,51 +20457,71 @@ namespace { #ifdef __cplusplus } /* anonymous namespace */ #endif -#endif +/* PyModInitFuncType */ #ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#elif PY_MAJOR_VERSION < 3 -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" void -#else -#define __Pyx_PyMODINIT_FUNC void -#endif -#else -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * + #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #else -#define __Pyx_PyMODINIT_FUNC PyObject * -#endif + #ifdef __cplusplus + #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * + #else + #define __Pyx_PyMODINIT_FUNC PyObject * + #endif #endif - -#if PY_MAJOR_VERSION < 3 -__Pyx_PyMODINIT_FUNC initsolvers(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC initsolvers(void) -#else __Pyx_PyMODINIT_FUNC PyInit_solvers(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_solvers(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } -static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - #if PY_VERSION_HEX >= 0x030700A1 - static PY_INT64_T main_interpreter_id = -1; +/* ModuleCreationPEP489 */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 +static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { + { + PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think + if (!module) { + PyErr_Clear(); // just try the 3.8-3.12 version + module = PyImport_ImportModule("_xxsubinterpreters"); + if (!module) goto bad; + } + PyObject *current = PyObject_CallMethod(module, "get_current", NULL); + Py_DECREF(module); + if (!current) goto bad; + if (PyTuple_Check(current)) { + PyObject *new_current = PySequence_GetItem(current, 0); + Py_DECREF(current); + current = new_current; + if (!new_current) goto bad; + } + long long as_c_int = PyLong_AsLongLong(current); + Py_DECREF(current); + return as_c_int; + } + bad: + PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n"); + return -1; +} +#endif +#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 + 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 + PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId(); +#else PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); +#endif + if (unlikely(current_id == -1)) { + return -1; + } if (main_interpreter_id == -1) { main_interpreter_id = current_id; - return (unlikely(current_id == -1)) ? -1 : 0; - } else if (unlikely(main_interpreter_id != current_id)) - #else - static PyInterpreterState *main_interpreter = NULL; - PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; - if (!main_interpreter) { - main_interpreter = current_interpreter; - } else if (unlikely(main_interpreter != current_interpreter)) - #endif - { + return 0; + } else if (unlikely(main_interpreter_id != current_id)) { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); @@ -22977,21 +20529,14 @@ static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { } return 0; } -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) -#else -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { -#if CYTHON_COMPILING_IN_LIMITED_API - result = PyModule_AddObject(module, to_name, value); -#else result = PyDict_SetItemString(moddict, to_name, value); -#endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { @@ -23004,8 +20549,10 @@ static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); + #if !CYTHON_USE_MODULE_STATE if (__Pyx_check_single_interpreter()) return NULL; + #endif if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); @@ -23013,12 +20560,8 @@ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDe module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; -#if CYTHON_COMPILING_IN_LIMITED_API - moddict = module; -#else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; -#endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; @@ -23032,12 +20575,12 @@ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDe static CYTHON_SMALL_CODE int __pyx_pymod_exec_solvers(PyObject *__pyx_pyinit_module) #endif -#endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif + __pyx_mstatetype *__pyx_mstate = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; @@ -23055,36 +20598,37 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_solvers(PyObject *__pyx_pyinit_mod PyErr_SetString(PyExc_RuntimeError, "Module 'solvers' has already been imported. Re-initialisation is not supported."); return -1; } - #elif PY_MAJOR_VERSION >= 3 + #else if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_m = __pyx_pyinit_module; - Py_INCREF(__pyx_m); + __pyx_t_1 = __pyx_pyinit_module; + Py_INCREF(__pyx_t_1); #else - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("solvers", __pyx_methods, __pyx_k_Module_containing_the_code_for_t, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #if CYTHON_USE_MODULE_STATE { - int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "solvers" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_m = __pyx_t_1; #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED); #endif + __pyx_mstate = __pyx_mstate_global; CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_mstate->__pyx_d); + __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + 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) { @@ -23094,14 +20638,15 @@ if (!__Pyx_RefNanny) { Py_FatalError("failed to import 'refnanny' module"); } #endif - __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_solvers(void)", 0); + +__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(); #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __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) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif @@ -23117,48 +20662,34 @@ if (!__Pyx_RefNanny) { #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - PyEval_InitThreads(); - #endif /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants() < 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 PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif if (__pyx_module_is_main_constraint__solvers) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_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) } - #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "constraint.solvers")) { if (unlikely((PyDict_SetItemString(modules, "constraint.solvers", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } - #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 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() < 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(); - (void)__Pyx_modinit_variable_export_code(); - (void)__Pyx_modinit_function_export_code(); - if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - (void)__Pyx_modinit_type_import_code(); - (void)__Pyx_modinit_variable_import_code(); - (void)__Pyx_modinit_function_import_code(); + (void)__Pyx_modinit_global_init_code(__pyx_mstate); + (void)__Pyx_modinit_variable_export_code(__pyx_mstate); + (void)__Pyx_modinit_function_export_code(__pyx_mstate); + if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(__pyx_mstate); + (void)__Pyx_modinit_variable_import_code(__pyx_mstate); + (void)__Pyx_modinit_function_import_code(__pyx_mstate); /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /* "constraint/solvers.py":3 * """Module containing the code for the problem solvers.""" @@ -23166,10 +20697,10 @@ if (!__Pyx_RefNanny) { * import random # <<<<<<<<<<<<<< * from types import FunctionType * from constraint.domain import Domain - */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_random, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) +*/ + __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_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_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 @@ -23178,18 +20709,15 @@ if (!__Pyx_RefNanny) { * from types import FunctionType # <<<<<<<<<<<<<< * from constraint.domain import Domain * from constraint.constraints import Constraint, FunctionConstraint, CompilableFunctionConstraint - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) +*/ + __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_INCREF(__pyx_n_s_FunctionType); - __Pyx_GIVEREF(__pyx_n_s_FunctionType); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_FunctionType)) __PYX_ERR(0, 4, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_types, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) + __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_n_s_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) + __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) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FunctionType, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -23199,18 +20727,15 @@ if (!__Pyx_RefNanny) { * from constraint.domain import Domain # <<<<<<<<<<<<<< * from constraint.constraints import Constraint, FunctionConstraint, CompilableFunctionConstraint * from collections.abc import Hashable - */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) +*/ + __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_INCREF(__pyx_n_s_Domain); - __Pyx_GIVEREF(__pyx_n_s_Domain); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Domain)) __PYX_ERR(0, 5, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_constraint_domain, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __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) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + __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_d, __pyx_n_s_Domain, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + 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; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -23220,32 +20745,23 @@ if (!__Pyx_RefNanny) { * from constraint.constraints import Constraint, FunctionConstraint, CompilableFunctionConstraint # <<<<<<<<<<<<<< * from collections.abc import Hashable * - */ - __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) +*/ + __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_INCREF(__pyx_n_s_Constraint); - __Pyx_GIVEREF(__pyx_n_s_Constraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Constraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_FunctionConstraint); - __Pyx_GIVEREF(__pyx_n_s_FunctionConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_FunctionConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_CompilableFunctionConstraint); - __Pyx_GIVEREF(__pyx_n_s_CompilableFunctionConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_CompilableFunctionConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_constraint_constraints, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) + __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_n_s_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __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_d, __pyx_n_s_Constraint, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + 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_n_s_FunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __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_d, __pyx_n_s_FunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + 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_n_s_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __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) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CompilableFunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -23255,18 +20771,15 @@ if (!__Pyx_RefNanny) { * from collections.abc import Hashable # <<<<<<<<<<<<<< * * # for parallel solver - */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) +*/ + __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_INCREF(__pyx_n_s_Hashable); - __Pyx_GIVEREF(__pyx_n_s_Hashable); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Hashable)) __PYX_ERR(0, 7, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections_abc, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __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) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Hashable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __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_d, __pyx_n_s_Hashable, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + 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; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -23276,25 +20789,19 @@ if (!__Pyx_RefNanny) { * from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor # <<<<<<<<<<<<<< * * - */ - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) +*/ + __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_INCREF(__pyx_n_s_ProcessPoolExecutor); - __Pyx_GIVEREF(__pyx_n_s_ProcessPoolExecutor); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ProcessPoolExecutor)) __PYX_ERR(0, 10, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_ThreadPoolExecutor); - __Pyx_GIVEREF(__pyx_n_s_ThreadPoolExecutor); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_ThreadPoolExecutor)) __PYX_ERR(0, 10, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_concurrent_futures, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) + __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_n_s_ProcessPoolExecutor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __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_d, __pyx_n_s_ProcessPoolExecutor, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + 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_n_s_ThreadPoolExecutor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __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) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ThreadPoolExecutor, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -23304,17 +20811,17 @@ if (!__Pyx_RefNanny) { * def getArcs(domains: dict, constraints: list[tuple]) -> dict: # <<<<<<<<<<<<<< * """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_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 13, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 13, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_dict) < 0) __PYX_ERR(0, 13, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_1getArcs, 0, __pyx_n_s_getArcs, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __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, 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_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_d, __pyx_n_s_getArcs, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":28 @@ -23323,18 +20830,18 @@ if (!__Pyx_RefNanny) { * def doArc8(arcs: dict, domains: dict, assignments: dict) -> bool: # <<<<<<<<<<<<<< * """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_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arcs, __pyx_n_s_dict) < 0) __PYX_ERR(0, 28, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 28, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 28, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 28, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_3doArc8, 0, __pyx_n_s_doArc8, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) + 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); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_doArc8, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + 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 @@ -23343,8 +20850,8 @@ if (!__Pyx_RefNanny) { * class Solver: # <<<<<<<<<<<<<< * """Abstract base class for solvers.""" * - */ - __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Solver, __pyx_n_s_Solver, (PyObject *) NULL, __pyx_n_s_constraint_solvers, __pyx_kp_s_Abstract_base_class_for_solvers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) +*/ + __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); /* "constraint/solvers.py":75 @@ -23353,8 +20860,8 @@ if (!__Pyx_RefNanny) { * requires_pickling = False # <<<<<<<<<<<<<< * * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): - */ - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_requires_pickling, Py_False) < 0) __PYX_ERR(0, 75, __pyx_L1_error) +*/ + if (__Pyx_SetNameInClass(__pyx_t_3, __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 @@ -23362,17 +20869,17 @@ if (!__Pyx_RefNanny) { * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """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_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 77, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 77, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 77, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_6Solver_1getSolution, 0, __pyx_n_s_Solver_getSolution, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __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, 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_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_n_s_getSolution, __pyx_t_4) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_4) < 0) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/solvers.py":89 @@ -23381,17 +20888,17 @@ if (!__Pyx_RefNanny) { * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """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_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 89, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 89, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 89, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_6Solver_3getSolutions, 0, __pyx_n_s_Solver_getSolutions, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __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, 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); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_getSolutions, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error) + 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 @@ -23400,17 +20907,17 @@ if (!__Pyx_RefNanny) { * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """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_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 101, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 101, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 101, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_6Solver_5getSolutionIter, 0, __pyx_n_s_Solver_getSolutionIter, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __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, 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_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_n_s_getSolutionIter, __pyx_t_4) < 0) __PYX_ERR(0, 101, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_t_4) < 0) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/solvers.py":72 @@ -23419,10 +20926,10 @@ if (!__Pyx_RefNanny) { * class Solver: # <<<<<<<<<<<<<< * """Abstract base class for solvers.""" * - */ - __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Solver, __pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) +*/ + __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_d, __pyx_n_s_Solver, __pyx_t_4) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + 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; @@ -23432,19 +20939,17 @@ if (!__Pyx_RefNanny) { * class BacktrackingSolver(Solver): # <<<<<<<<<<<<<< * """Problem solver with backtracking capabilities. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 114, __pyx_L1_error) +*/ + __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_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error) + __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_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 114, __pyx_L1_error); - __pyx_t_3 = 0; + __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_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_BacktrackingSolver, __pyx_n_s_BacktrackingSolver, (PyObject *) NULL, __pyx_n_s_constraint_solvers, __pyx_kp_s_Problem_solver_with_backtracking); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L1_error) + __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_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) @@ -23457,11 +20962,11 @@ if (!__Pyx_RefNanny) { * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_1__init__, 0, __pyx_n_s_BacktrackingSolver___init, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error) +*/ + __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_tuple__19); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 143, __pyx_L1_error) + __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; /* "constraint/solvers.py":153 @@ -23470,17 +20975,17 @@ if (!__Pyx_RefNanny) { * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * 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_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 153, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 153, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 153, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_3getSolutionIter, 0, __pyx_n_s_BacktrackingSolver_getSolutionIt, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __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, 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_n_s_getSolutionIter, __pyx_t_6) < 0) __PYX_ERR(0, 153, __pyx_L1_error) + 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; /* "constraint/solvers.py":223 @@ -23489,17 +20994,17 @@ if (!__Pyx_RefNanny) { * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * 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_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 223, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 223, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 223, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_6getSolution, 0, __pyx_n_s_BacktrackingSolver_getSolution, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __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, 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_n_s_getSolution, __pyx_t_4) < 0) __PYX_ERR(0, 223, __pyx_L1_error) + 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; /* "constraint/solvers.py":230 @@ -23508,17 +21013,17 @@ if (!__Pyx_RefNanny) { * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * 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_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 230, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 230, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 230, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_8getSolutions, 0, __pyx_n_s_BacktrackingSolver_getSolutions, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 230, __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, 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_n_s_getSolutions, __pyx_t_6) < 0) __PYX_ERR(0, 230, __pyx_L1_error) + 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; /* "constraint/solvers.py":114 @@ -23527,10 +21032,10 @@ if (!__Pyx_RefNanny) { * class BacktrackingSolver(Solver): # <<<<<<<<<<<<<< * """Problem solver with backtracking capabilities. * - */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_BacktrackingSolver, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 114, __pyx_L1_error) +*/ + __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_d, __pyx_n_s_BacktrackingSolver, __pyx_t_6) < 0) __PYX_ERR(0, 114, __pyx_L1_error) + 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_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; @@ -23542,19 +21047,17 @@ if (!__Pyx_RefNanny) { * class OptimizedBacktrackingSolver(Solver): # <<<<<<<<<<<<<< * """Problem solver with backtracking capabilities, implementing several optimizations for increased performance. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) +*/ + __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_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error); - __pyx_t_3 = 0; + __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_n_s_OptimizedBacktrackingSolver, __pyx_n_s_OptimizedBacktrackingSolver, (PyObject *) NULL, __pyx_n_s_constraint_solvers, __pyx_kp_s_Problem_solver_with_backtracking_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) + __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_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) @@ -23567,11 +21070,11 @@ if (!__Pyx_RefNanny) { * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_1__init__, 0, __pyx_n_s_OptimizedBacktrackingSolver___in, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) +*/ + __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_tuple__19); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 266, __pyx_L1_error) + __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; /* "constraint/solvers.py":276 @@ -23580,17 +21083,17 @@ if (!__Pyx_RefNanny) { * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * 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_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 276, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 276, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 276, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_3getSolutionIter, 0, __pyx_n_s_OptimizedBacktrackingSolver_getS, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __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, 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_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_n_s_getSolutionIter, __pyx_t_4) < 0) __PYX_ERR(0, 276, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_t_4) < 0) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/solvers.py":344 @@ -23599,17 +21102,17 @@ if (!__Pyx_RefNanny) { * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 # <<<<<<<<<<<<<< * """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_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domains, __pyx_kp_s_dict_Hashable_Domain) < 0) __PYX_ERR(0, 344, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_vconstraints, __pyx_kp_s_dict_Hashable_list_tuple_Constra) < 0) __PYX_ERR(0, 344, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_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_n_s_OptimizedBacktrackingSolver_getS_3, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error) + 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); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_getSolutionsList, __pyx_t_2) < 0) __PYX_ERR(0, 344, __pyx_L1_error) + 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 @@ -23618,17 +21121,17 @@ if (!__Pyx_RefNanny) { * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * 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_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 401, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 401, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 401, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_8getSolutions, 0, __pyx_n_s_OptimizedBacktrackingSolver_getS_4, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __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, 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_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_n_s_getSolutions, __pyx_t_4) < 0) __PYX_ERR(0, 401, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_t_4) < 0) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/solvers.py":406 @@ -23637,17 +21140,17 @@ if (!__Pyx_RefNanny) { * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * 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_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 406, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 406, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 406, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_10getSolution, 0, __pyx_n_s_OptimizedBacktrackingSolver_getS_5, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __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, 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); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_getSolution, __pyx_t_2) < 0) __PYX_ERR(0, 406, __pyx_L1_error) + 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 @@ -23656,17 +21159,17 @@ if (!__Pyx_RefNanny) { * def getSortedVariables(self, domains: dict, vconstraints: dict) -> list: # <<<<<<<<<<<<<< * """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_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 413, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 413, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_list) < 0) __PYX_ERR(0, 413, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_12getSortedVariables, 0, __pyx_n_s_OptimizedBacktrackingSolver_getS_6, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __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, 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_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_n_s_getSortedVariables, __pyx_t_4) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_getSortedVariables, __pyx_t_4) < 0) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/solvers.py":234 @@ -23675,10 +21178,10 @@ if (!__Pyx_RefNanny) { * class OptimizedBacktrackingSolver(Solver): # <<<<<<<<<<<<<< * """Problem solver with backtracking capabilities, implementing several optimizations for increased performance. * - */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_OptimizedBacktrackingSolver, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error) +*/ + __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_d, __pyx_n_s_OptimizedBacktrackingSolver, __pyx_t_4) < 0) __PYX_ERR(0, 234, __pyx_L1_error) + 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -23690,19 +21193,17 @@ if (!__Pyx_RefNanny) { * class RecursiveBacktrackingSolver(Solver): # <<<<<<<<<<<<<< * """Recursive problem solver with backtracking capabilities. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) +*/ + __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_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L1_error) + __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_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error); - __pyx_t_3 = 0; + __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_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __pyx_n_s_RecursiveBacktrackingSolver, __pyx_n_s_RecursiveBacktrackingSolver, (PyObject *) NULL, __pyx_n_s_constraint_solvers, __pyx_kp_s_Recursive_problem_solver_with_ba); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error) + __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) @@ -23715,11 +21216,11 @@ if (!__Pyx_RefNanny) { * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_1__init__, 0, __pyx_n_s_RecursiveBacktrackingSolver___in, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 456, __pyx_L1_error) +*/ + __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_tuple__19); - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + __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; /* "constraint/solvers.py":466 @@ -23728,10 +21229,10 @@ if (!__Pyx_RefNanny) { * def recursiveBacktracking(self, solutions, domains, vconstraints, assignments, single): # <<<<<<<<<<<<<< * """Mix the Degree and Minimum Remaing Values (MRV) heuristics. * - */ - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_3recursiveBacktracking, 0, __pyx_n_s_RecursiveBacktrackingSolver_recu_2, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 466, __pyx_L1_error) +*/ + __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_n_s_recursiveBacktracking, __pyx_t_5) < 0) __PYX_ERR(0, 466, __pyx_L1_error) + 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; /* "constraint/solvers.py":519 @@ -23740,17 +21241,17 @@ if (!__Pyx_RefNanny) { * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * 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_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 519, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 519, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 519, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_5getSolution, 0, __pyx_n_s_RecursiveBacktrackingSolver_getS, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __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, 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_n_s_getSolution, __pyx_t_2) < 0) __PYX_ERR(0, 519, __pyx_L1_error) + 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; /* "constraint/solvers.py":523 @@ -23759,17 +21260,17 @@ if (!__Pyx_RefNanny) { * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * 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_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 523, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 523, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 523, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_7getSolutions, 0, __pyx_n_s_RecursiveBacktrackingSolver_getS_2, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __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, 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_n_s_getSolutions, __pyx_t_5) < 0) __PYX_ERR(0, 523, __pyx_L1_error) + 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; /* "constraint/solvers.py":428 @@ -23778,10 +21279,10 @@ if (!__Pyx_RefNanny) { * class RecursiveBacktrackingSolver(Solver): # <<<<<<<<<<<<<< * """Recursive problem solver with backtracking capabilities. * - */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_RecursiveBacktrackingSolver, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L1_error) +*/ + __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_d, __pyx_n_s_RecursiveBacktrackingSolver, __pyx_t_5) < 0) __PYX_ERR(0, 428, __pyx_L1_error) + 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_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -23793,19 +21294,17 @@ if (!__Pyx_RefNanny) { * class MinConflictsSolver(Solver): # <<<<<<<<<<<<<< * """Problem solver based on the minimum conflicts theory. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) +*/ + __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_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 527, __pyx_L1_error) + __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_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error); - __pyx_t_3 = 0; + __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_n_s_MinConflictsSolver, __pyx_n_s_MinConflictsSolver, (PyObject *) NULL, __pyx_n_s_constraint_solvers, __pyx_kp_s_Problem_solver_based_on_the_mini); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) + __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_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) @@ -23818,11 +21317,11 @@ if (!__Pyx_RefNanny) { * def __init__(self, steps=1000, rand=None): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18MinConflictsSolver_1__init__, 0, __pyx_n_s_MinConflictsSolver___init, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 554, __pyx_L1_error) +*/ + __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_tuple__41); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 554, __pyx_L1_error) + __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; /* "constraint/solvers.py":566 @@ -23831,17 +21330,17 @@ if (!__Pyx_RefNanny) { * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * 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_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 566, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 566, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 566, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18MinConflictsSolver_3getSolution, 0, __pyx_n_s_MinConflictsSolver_getSolution, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __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, 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_n_s_getSolution, __pyx_t_2) < 0) __PYX_ERR(0, 566, __pyx_L1_error) + 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; /* "constraint/solvers.py":527 @@ -23850,10 +21349,10 @@ if (!__Pyx_RefNanny) { * class MinConflictsSolver(Solver): # <<<<<<<<<<<<<< * """Problem solver based on the minimum conflicts theory. * - */ - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_MinConflictsSolver, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error) +*/ + __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_d, __pyx_n_s_MinConflictsSolver, __pyx_t_2) < 0) __PYX_ERR(0, 527, __pyx_L1_error) + 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_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -23865,19 +21364,17 @@ if (!__Pyx_RefNanny) { * class ParallelSolver(Solver): # <<<<<<<<<<<<<< * """Problem solver that executes all-solution solve in parallel (ProcessPool or ThreadPool mode). * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error) +*/ + __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_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error) + __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_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error); - __pyx_t_3 = 0; + __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_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_n_s_ParallelSolver, __pyx_n_s_ParallelSolver, (PyObject *) NULL, __pyx_n_s_constraint_solvers, __pyx_kp_s_Problem_solver_that_executes_all); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error) + __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_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) @@ -23892,14 +21389,12 @@ if (!__Pyx_RefNanny) { * def __init__(self, process_mode=False): # <<<<<<<<<<<<<< * """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_n_s_ParallelSolver___init, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 644, __pyx_L1_error) +*/ + __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); - __Pyx_INCREF(__pyx_t_6); PyList_Append(__pyx_t_4, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__46); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 644, __pyx_L1_error) + __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; /* "constraint/solvers.py":650 @@ -23908,17 +21403,17 @@ if (!__Pyx_RefNanny) { * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """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_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 650, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 650, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 650, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_3getSolution, 0, __pyx_n_s_ParallelSolver_getSolution, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 650, __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, 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_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_n_s_getSolution, __pyx_t_7) < 0) __PYX_ERR(0, 650, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_7) < 0) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "constraint/solvers.py":662 @@ -23927,17 +21422,17 @@ if (!__Pyx_RefNanny) { * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 # <<<<<<<<<<<<<< * """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_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_domains, __pyx_kp_s_dict_Hashable_Domain) < 0) __PYX_ERR(0, 662, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_vconstraints, __pyx_kp_s_dict_Hashable_list_tuple_Constra) < 0) __PYX_ERR(0, 662, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_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_n_s_ParallelSolver_getSolutionsList_3, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 662, __pyx_L1_error) + 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); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getSolutionsList, __pyx_t_6) < 0) __PYX_ERR(0, 662, __pyx_L1_error) + 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 @@ -23946,17 +21441,17 @@ if (!__Pyx_RefNanny) { * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * 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_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 688, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 688, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 688, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_7getSolutions, 0, __pyx_n_s_ParallelSolver_getSolutions, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 688, __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, 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_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_n_s_getSolutions, __pyx_t_7) < 0) __PYX_ERR(0, 688, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_t_7) < 0) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "constraint/solvers.py":607 @@ -23965,12 +21460,12 @@ if (!__Pyx_RefNanny) { * class ParallelSolver(Solver): # <<<<<<<<<<<<<< * """Problem solver that executes all-solution solve in parallel (ProcessPool or ThreadPool mode). * - */ - __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_ParallelSolver, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 607, __pyx_L1_error) +*/ + __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ParallelSolver, __pyx_t_7) < 0) __PYX_ERR(0, 607, __pyx_L1_error) + 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_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -23982,18 +21477,18 @@ if (!__Pyx_RefNanny) { * def is_valid(assignment: dict[Hashable, any], constraints_lookup: list[tuple[Constraint, Hashable]], domains: dict[Hashable, Domain]) -> bool: # noqa E501 # <<<<<<<<<<<<<< * """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_n_s_assignment, __pyx_kp_s_dict_Hashable_any) < 0) __PYX_ERR(0, 693, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_constraints_lookup, __pyx_kp_s_list_tuple_Constraint_Hashable) < 0) __PYX_ERR(0, 693, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_domains, __pyx_kp_s_dict_Hashable_Domain) < 0) __PYX_ERR(0, 693, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 693, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_5is_valid, 0, __pyx_n_s_is_valid, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 693, __pyx_L1_error) + 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_d, __pyx_n_s_is_valid, __pyx_t_5) < 0) __PYX_ERR(0, 693, __pyx_L1_error) + 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; /* "constraint/solvers.py":701 @@ -24002,16 +21497,16 @@ if (!__Pyx_RefNanny) { * def compile_to_function(constraint: CompilableFunctionConstraint) -> FunctionConstraint: # <<<<<<<<<<<<<< * """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_n_s_constraint, __pyx_n_s_CompilableFunctionConstraint) < 0) __PYX_ERR(0, 701, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_FunctionConstraint) < 0) __PYX_ERR(0, 701, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_7compile_to_function, 0, __pyx_n_s_compile_to_function, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 701, __pyx_L1_error) + 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_d, __pyx_n_s_compile_to_function, __pyx_t_3) < 0) __PYX_ERR(0, 701, __pyx_L1_error) + 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; /* "constraint/solvers.py":708 @@ -24020,19 +21515,19 @@ if (!__Pyx_RefNanny) { * 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 # <<<<<<<<<<<<<< * """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_n_s_assignment, __pyx_kp_s_dict_Hashable_any) < 0) __PYX_ERR(0, 708, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_unassigned_vars, __pyx_kp_s_list_Hashable) < 0) __PYX_ERR(0, 708, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_domains, __pyx_kp_s_dict_Hashable_Domain) < 0) __PYX_ERR(0, 708, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_constraint_lookup, __pyx_kp_s_dict_Hashable_list_tuple_Constra) < 0) __PYX_ERR(0, 708, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_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_n_s_sequential_recursive_backtrack, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 708, __pyx_L1_error) + 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_d, __pyx_n_s_sequential_recursive_backtrack, __pyx_t_5) < 0) __PYX_ERR(0, 708, __pyx_L1_error) + 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; /* "constraint/solvers.py":724 @@ -24041,19 +21536,19 @@ if (!__Pyx_RefNanny) { * def sequential_optimized_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 # <<<<<<<<<<<<<< * """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_n_s_assignment, __pyx_kp_s_dict_Hashable_any) < 0) __PYX_ERR(0, 724, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_unassigned_vars, __pyx_kp_s_list_Hashable) < 0) __PYX_ERR(0, 724, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_domains, __pyx_kp_s_dict_Hashable_Domain) < 0) __PYX_ERR(0, 724, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_constraint_lookup, __pyx_kp_s_dict_Hashable_list_tuple_Constra) < 0) __PYX_ERR(0, 724, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_kp_s_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_n_s_sequential_optimized_backtrack, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 724, __pyx_L1_error) + 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_d, __pyx_n_s_sequential_optimized_backtrack, __pyx_t_3) < 0) __PYX_ERR(0, 724, __pyx_L1_error) + 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; /* "constraint/solvers.py":774 @@ -24062,26 +21557,26 @@ if (!__Pyx_RefNanny) { * def parallel_worker(args: tuple[bool, dict[Hashable, Domain], dict[Hashable, list[tuple[Constraint, Hashable]]], Hashable, any, list[Hashable]]) -> list[dict[Hashable, any]]: # noqa E501 # <<<<<<<<<<<<<< * """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_n_s_args, __pyx_kp_s_tuple_bool_dict_Hashable_Domain) < 0) __PYX_ERR(0, 774, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_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_n_s_parallel_worker, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 774, __pyx_L1_error) + 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_d, __pyx_n_s_parallel_worker, __pyx_t_5) < 0) __PYX_ERR(0, 774, __pyx_L1_error) + 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; /* "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_d, __pyx_n_s_test, __pyx_t_5) < 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_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /*--- Wrapped vars code ---*/ @@ -24095,7 +21590,7 @@ if (!__Pyx_RefNanny) { __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); if (__pyx_m) { - if (__pyx_d && stringtab_initialized) { + if (__pyx_mstate->__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init constraint.solvers", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE @@ -24116,165 +21611,753 @@ if (!__Pyx_RefNanny) { __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; - #elif PY_MAJOR_VERSION >= 3 - return __pyx_m; #else - return; + return __pyx_m; #endif } -/* #### Code section: cleanup_globals ### */ -/* #### Code section: cleanup_module ### */ -/* #### Code section: main_method ### */ -/* #### Code section: utility_code_pragmas ### */ -#ifdef _MSC_VER -#pragma warning( push ) -/* Warning 4127: conditional expression is constant - * Cython uses constant conditional expressions to allow in inline functions to be optimized at - * compile-time, so this warning is not useful - */ -#pragma warning( disable : 4127 ) -#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_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: utility_code_def ### */ +/* #### Code section: cached_builtins ### */ -/* --- Runtime support code --- */ -/* Refnanny */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule(modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, "RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; +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) + return 0; + __pyx_L1_error:; + return -1; } -#endif +/* #### Code section: cached_constants ### */ -/* 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); -#if PY_MAJOR_VERSION >= 3 - 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 +static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); -/* 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 + /* "constraint/solvers.py":48 + * if domain: + * # changed = False + * for value in domain[:]: # <<<<<<<<<<<<<< + * assignments[variable] = value + * if otherdomain: +*/ + __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, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); -/* PyObjectGetAttrStr */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + /* "constraint/solvers.py":680 + * # execute in parallel + * parallel_pool = ProcessPoolExecutor if self._process_mode else ThreadPoolExecutor + * with parallel_pool() as executor: # <<<<<<<<<<<<<< + * # results = map(parallel_worker, args) # sequential + * results = executor.map(parallel_worker, args, chunksize=1) # parallel +*/ + __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, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); + + /* "constraint/solvers.py":143 + * """ + * + * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(1, ((PyObject*)Py_True)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); + + /* "constraint/solvers.py":554 + * """ + * + * def __init__(self, steps=1000, rand=None): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(2, ((PyObject*)__pyx_mstate_global->__pyx_int_1000), Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); + + /* "constraint/solvers.py":644 + * """ # noqa E501 + * + * def __init__(self, process_mode=False): # <<<<<<<<<<<<<< + * """Initialization method. Set `process_mode` to True for using ProcessPool, otherwise uses ThreadPool.""" + * super().__init__() +*/ + __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]); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +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) + 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; +/* 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 *tuple_dedup_map +); + + +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}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 162, 14}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 276, 12}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 425, 14}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 480, 14}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 675, 2}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 668, 14}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 698, 2}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 696, 2}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 13, 107}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 28, 255}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 77, 37}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 89, 37}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 101, 37}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 143, 15}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 223, 48}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 230, 32}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 266, 15}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 344, 243}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 401, 53}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 406, 48}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 413, 78}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 456, 15}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 466, 296}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 519, 49}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 523, 32}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 554, 23}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 566, 319}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 644, 30}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 650, 37}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 662, 167}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 688, 26}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 693, 29}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 701, 57}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 708, 146}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 724, 245}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 774, 186}; + 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; + } + Py_DECREF(tuple_dedup_map); + return 0; + bad: + Py_DECREF(tuple_dedup_map); + return -1; +} +/* #### Code section: init_globals ### */ + +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) + + /* 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 + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cleanup_globals ### */ +/* #### Code section: cleanup_module ### */ +/* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#ifdef _MSC_VER +#pragma warning( push ) +/* Warning 4127: conditional expression is constant + * Cython uses constant conditional expressions to allow in inline functions to be optimized at + * compile-time, so this warning is not useful + */ +#pragma warning( disable : 4127 ) +#endif + + + +/* #### Code section: utility_code_def ### */ + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#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= 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 */ +#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); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ -#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -24284,11 +22367,11 @@ static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; -#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 +#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 && PY_VERSION_HEX >= 0x030700B1 +#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); @@ -24304,20 +22387,36 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif } return result; } /* TupleAndListFromArray */ -#if CYTHON_COMPILING_IN_CPYTHON +#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; @@ -24331,8 +22430,7 @@ __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { - Py_INCREF(__pyx_empty_tuple); - return __pyx_empty_tuple; + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; @@ -24355,7 +22453,8 @@ __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ + !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { @@ -24402,55 +22501,39 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL return PyObject_RichCompareBool(s1, s2, equals); #else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; + Py_ssize_t length, length2; int kind; void *data1, *data2; + #if !CYTHON_COMPILING_IN_LIMITED_API if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; + #endif length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length < 0)) return -1; + #endif + length2 = __Pyx_PyUnicode_GET_LENGTH(s2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length2 < 0)) return -1; + #endif + if (length != length2) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; - #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; - #else - hash1 = ((PyUnicodeObject*)s1)->hash; - hash2 = ((PyUnicodeObject*)s2)->hash; - #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } @@ -24468,9 +22551,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { @@ -24480,9 +22560,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -24490,14 +22567,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int return result; } return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ); return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_NE); #endif } @@ -24506,14 +22577,25 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { - Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(n == -1)) return NULL; + #endif for (i = 0; i < n; i++) { - if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + if (s == namei) return kwvalues[i]; } for (i = 0; i < n; i++) { - int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; @@ -24521,15 +22603,26 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO } return NULL; } -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { - Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); + Py_ssize_t i, nkwargs; PyObject *dict; +#if !CYTHON_ASSUME_SAFE_SIZE + nkwargs = PyTuple_Size(kwnames); + if (unlikely(nkwargs < 0)) return NULL; +#else + nkwargs = PyTuple_GET_SIZE(kwnames); +#endif dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif } -/* ParseKeywords */ -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); - while (1) { - Py_XDECREF(key); key = NULL; - Py_XDECREF(value); value = NULL; - if (kwds_is_tuple) { - Py_ssize_t size; -#if CYTHON_ASSUME_SAFE_MACROS - size = PyTuple_GET_SIZE(kwds); -#else - size = PyTuple_Size(kwds); - if (size < 0) goto bad; -#endif - if (pos >= size) break; -#if CYTHON_AVOID_BORROWED_REFS - key = __Pyx_PySequence_ITEM(kwds, pos); - if (!key) goto bad; -#elif CYTHON_ASSUME_SAFE_MACROS - key = PyTuple_GET_ITEM(kwds, pos); -#else - key = PyTuple_GetItem(kwds, pos); - if (!key) goto bad; -#endif - value = kwvalues[pos]; - pos++; +/* 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 (!PyDict_Next(kwds, &pos, &key, &value)) break; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); -#endif + 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; } - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(value); - Py_DECREF(key); + } + 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 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); + self = __Pyx_CyOrPyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} #endif - key = NULL; - value = NULL; - continue; - } -#if !CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); + +/* PyObjectFastCall */ +#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; + PyObject *result = 0; + size_t i; + argstuple = PyTuple_New((Py_ssize_t)nargs); + if (unlikely(!argstuple)) return NULL; + for (i = 0; i < nargs; i++) { + Py_INCREF(args[i]); + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad; + } + result = __Pyx_PyObject_Call(func, argstuple, kwargs); + bad: + Py_DECREF(argstuple); + return result; +} #endif - Py_INCREF(value); - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; +#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API + #if PY_VERSION_HEX < 0x03090000 + #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable) + #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 (__Pyx_CyFunction_CheckExact(callable)) { + return __Pyx_CyFunction_func_vectorcall(callable); + } + #endif + if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) { + return NULL; + } + assert(PyCallable_Check(callable)); + Py_ssize_t offset = tp->tp_vectorcall_offset; + assert(offset > 0); + vectorcallfunc ptr; + memcpy(&ptr, (char *) callable + offset, sizeof(ptr)); + return ptr; +} + #else + #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable) + #endif #endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = ( - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key) - ); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) { + Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); +#if CYTHON_COMPILING_IN_CPYTHON + if (nargs == 0 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) + return __Pyx_PyObject_CallMethO(func, NULL); + } + else if (nargs == 1 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) + return __Pyx_PyObject_CallMethO(func, args[0]); + } #endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + #if PY_VERSION_HEX < 0x030800B1 + #if CYTHON_FAST_PYCCALL + if (PyCFunction_Check(func)) { + if (kwargs) { + return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { - goto invalid_keyword; + return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } - Py_XDECREF(key); - Py_XDECREF(value); - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - #if PY_MAJOR_VERSION < 3 - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - PyErr_Format(PyExc_TypeError, - "%s() got an unexpected keyword argument '%U'", - function_name, key); + if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { + return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); + } #endif -bad: - Py_XDECREF(key); - Py_XDECREF(value); - return -1; -} - -/* ArgTypeTest */ -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) -{ - __Pyx_TypeName type_name; - __Pyx_TypeName obj_type_name; - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } - else if (exact) { - #if PY_MAJOR_VERSION == 2 - if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #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); #endif } - else { - if (likely(__Pyx_TypeCheck(obj, type))) return 1; + if (nargs == 0) { + return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs); } - type_name = __Pyx_PyType_GetName(type); - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME - ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); - __Pyx_DECREF_TypeName(type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return 0; + #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API + return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); + #else + return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); + #endif } -/* RaiseTooManyValuesToUnpack */ -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); +/* UnpackUnboundCMethod */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; + PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); + if (unlikely(!selfless_args)) return NULL; + result = PyObject_Call(method, selfless_args, kwargs); + Py_DECREF(selfless_args); + return result; } - -/* RaiseNeedMoreValuesToUnpack */ -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"); +#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000 +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { + return _PyObject_Vectorcall + (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames); } - -/* IterFinish */ -static CYTHON_INLINE int __Pyx_IterFinish(void) { - PyObject* exc_type; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - exc_type = __Pyx_PyErr_CurrentExceptionType(); - if (unlikely(exc_type)) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) - return -1; - __Pyx_PyErr_Clear(); - return 0; - } - return 0; +#else +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + return +#if PY_VERSION_HEX < 0x03090000 + _PyObject_Vectorcall +#else + PyObject_Vectorcall +#endif + (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames); } - -/* UnpackItemEndCheck */ -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { - if (unlikely(retval)) { - Py_DECREF(retval); - __Pyx_RaiseTooManyValuesError(expected); +#endif +static PyMethodDef __Pyx_UnboundCMethod_Def = { + "CythonUnboundCMethod", + __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 + METH_VARARGS | METH_KEYWORDS, +#else + METH_FASTCALL | METH_KEYWORDS, +#endif + NULL +}; +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method, *result=NULL; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) return -1; + result = method; +#if CYTHON_COMPILING_IN_CPYTHON + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } else +#endif +#if CYTHON_COMPILING_IN_PYPY +#else + if (PyCFunction_Check(method)) +#endif + { + PyObject *self; + int self_found; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + self = PyObject_GetAttrString(method, "__self__"); + if (!self) { + PyErr_Clear(); + } +#else + self = PyCFunction_GET_SELF(method); +#endif + self_found = (self && self != Py_None); +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + Py_XDECREF(self); +#endif + if (self_found) { + PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); + if (unlikely(!unbound_method)) return -1; + Py_DECREF(method); + result = unbound_method; + } } - return __Pyx_IterFinish(); +#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if (unlikely(target->method)) { + Py_DECREF(result); + } else +#endif + target->method = result; + return 0; } -/* PyFunctionFastCall */ -#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **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++; +/* CallUnboundCMethod2 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { + int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); + if (likely(was_initialized == 2 && cfunc->func)) { + PyObject *args[2] = {arg1, arg2}; + if (cfunc->flag == METH_FASTCALL) { + return __Pyx_CallCFunctionFast(cfunc, self, args, 2); + } + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL); } - result = PyEval_EvalFrameEx(f,0); - ++tstate->recursion_depth; - Py_DECREF(f); - --tstate->recursion_depth; +#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__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2); + } +#endif + PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); + __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); return result; } -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **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; -#if PY_MAJOR_VERSION >= 3 - PyObject *kwdefs; #endif - 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 PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { - return NULL; +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + PyObject *result = NULL; + PyObject *args = PyTuple_New(2); + if (unlikely(!args)) return NULL; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + if (cfunc->flag & METH_KEYWORDS) + result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); + else + result = __Pyx_CallCFunction(cfunc, self, args); + Py_DECREF(args); + return result; } - #else - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { - return NULL; +#endif + { + PyObject *args[4] = {NULL, self, arg1, arg2}; + return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + } +} + +/* ParseKeywords */ +static int __Pyx_ValidateDuplicatePosArgs( + PyObject *kwds, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + const char* function_name) +{ + PyObject ** const *name = argnames; + while (name != first_kw_arg) { + PyObject *key = **name; + int found = PyDict_Contains(kwds, key); + if (unlikely(found)) { + if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; + } + name++; + } + return 0; +bad: + return -1; +} +#if CYTHON_USE_UNICODE_INTERNALS +static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) { + int kind; + Py_ssize_t len = PyUnicode_GET_LENGTH(s1); + if (len != PyUnicode_GET_LENGTH(s2)) return 0; + kind = PyUnicode_KIND(s1); + if (kind != PyUnicode_KIND(s2)) return 0; + const void *data1 = PyUnicode_DATA(s1); + const void *data2 = PyUnicode_DATA(s2); + return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0); +} +#endif +static int __Pyx_MatchKeywordArg_str( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + PyObject ** const *name; + #if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t key_hash = ((PyASCIIObject*)key)->hash; + if (unlikely(key_hash == -1)) { + key_hash = PyObject_Hash(key); + if (unlikely(key_hash == -1)) + goto bad; } #endif - if ( -#if PY_MAJOR_VERSION >= 3 - co->co_kwonlyargcount == 0 && -#endif - 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; + name = first_kw_arg; + while (*name) { + PyObject *name_str = **name; + #if CYTHON_USE_UNICODE_INTERNALS + if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) { + *index_found = (size_t) (name - argnames); + return 1; } - 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; + #else + #if CYTHON_ASSUME_SAFE_SIZE + if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) + #endif + { + int cmp = PyUnicode_Compare(name_str, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + *index_found = (size_t) (name - argnames); + return 1; + } } + #endif + name++; } - if (kwargs != NULL) { - Py_ssize_t pos, i; - kwtuple = PyTuple_New(2 * nk); - if (kwtuple == NULL) { - result = NULL; - goto done; + name = argnames; + while (name != first_kw_arg) { + PyObject *name_str = **name; + #if CYTHON_USE_UNICODE_INTERNALS + if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) { + if (__Pyx_UnicodeKeywordsEqual(name_str, key)) + goto arg_passed_twice; } - 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; + #else + #if CYTHON_ASSUME_SAFE_SIZE + if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) + #endif + { + if (unlikely(name_str == key)) goto arg_passed_twice; + int cmp = PyUnicode_Compare(name_str, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; } - nk = i / 2; + #endif + name++; } - else { - kwtuple = NULL; - k = NULL; + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +bad: + return -1; +} +static int __Pyx_MatchKeywordArg_nostr( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + PyObject ** const *name; + if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; + name = first_kw_arg; + while (*name) { + int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); + if (cmp == 1) { + *index_found = (size_t) (name - argnames); + return 1; + } + if (unlikely(cmp == -1)) goto bad; + name++; } - closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 - kwdefs = PyFunction_GET_KW_DEFAULTS(func); -#endif - if (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); + name = argnames; + while (name != first_kw_arg) { + int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); + if (unlikely(cmp != 0)) { + if (cmp == 1) goto arg_passed_twice; + else goto bad; + } + name++; } - else { - d = NULL; - nd = 0; + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +bad: + return -1; +} +static CYTHON_INLINE int __Pyx_MatchKeywordArg( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + return likely(PyUnicode_CheckExact(key)) ? + __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) : + __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name); +} +static void __Pyx_RejectUnknownKeyword( + PyObject *kwds, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + const char *function_name) +{ + Py_ssize_t pos = 0; + PyObject *key = NULL; + __Pyx_BEGIN_CRITICAL_SECTION(kwds); + while (PyDict_Next(kwds, &pos, &key, NULL)) { + 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) { + if (cmp == 0) { + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif + break; + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif + } } -#if PY_MAJOR_VERSION >= 3 - result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, kwdefs, closure); -#else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, closure); -#endif - Py_XDECREF(kwtuple); -done: - Py_LeaveRecursiveCall(); - return result; + __Pyx_END_CRITICAL_SECTION(); + assert(PyErr_Occurred()); } -#endif - -/* PyObjectCall */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = Py_TYPE(func)->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; +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) +{ + PyObject** const *name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + Py_ssize_t extracted = 0; +#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) + if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; +#endif + name = first_kw_arg; + while (*name && num_kwargs > extracted) { + PyObject * key = **name; + PyObject *value; + int found = 0; + #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + found = PyDict_GetItemRef(kwds, key, &value); + #else + value = PyDict_GetItemWithError(kwds, key); + if (value) { + Py_INCREF(value); + found = 1; + } else { + if (unlikely(PyErr_Occurred())) goto bad; + } + #endif + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + extracted++; + } + name++; + } + if (num_kwargs > extracted) { + if (ignore_unknown_kwargs) { + if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1)) + goto bad; + } else { + __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name); + goto bad; + } + } + return 0; +bad: + return -1; +} +static int __Pyx_ParseKeywordDictToDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject** const *name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + Py_ssize_t len; +#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) + if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; +#endif + if (PyDict_Update(kwds2, kwds) < 0) goto bad; + name = first_kw_arg; + while (*name) { + PyObject *key = **name; + PyObject *value; +#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop)) + int found = PyDict_Pop(kwds2, key, &value); + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + } +#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + int found = PyDict_GetItemRef(kwds2, key, &value); + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad; + } +#else + #if CYTHON_COMPILING_IN_CPYTHON + value = _PyDict_Pop(kwds2, key, kwds2); #else - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) - return NULL; + value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2); #endif - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); + if (value == kwds2) { + Py_DECREF(value); + } else { + if (unlikely(!value)) goto bad; + values[name-argnames] = value; + } +#endif + name++; } - return result; + len = PyDict_Size(kwds2); + if (len > 0) { + return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name); + } else if (unlikely(len == -1)) { + goto bad; + } + return 0; +bad: + return -1; } +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) +{ + PyObject *key = NULL; + PyObject** const * name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) { +#if CYTHON_AVOID_BORROWED_REFS + key = __Pyx_PySequence_ITEM(kwds, pos); +#else + key = __Pyx_PyTuple_GET_ITEM(kwds, pos); #endif - -/* PyObjectCallMethO */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { - PyObject *self, *result; - PyCFunction cfunc; - cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); - self = __Pyx_CyOrPyCFunction_GET_SELF(func); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) - return NULL; - #endif - result = cfunc(self, arg); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); +#if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!key)) goto bad; +#endif + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + PyObject *value = kwvalues[pos]; + values[name-argnames] = __Pyx_NewRef(value); + } else { + size_t index_found = 0; + int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); + if (cmp == 1) { + PyObject *value = kwvalues[pos]; + values[index_found] = __Pyx_NewRef(value); + } else { + if (unlikely(cmp == -1)) goto bad; + if (kwds2) { + PyObject *value = kwvalues[pos]; + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else if (!ignore_unknown_kwargs) { + goto invalid_keyword; + } + } + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + key = NULL; + #endif } - return result; + return 0; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + goto bad; +bad: + #if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(key); + #endif + return -1; +} +static 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) +{ + if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) + return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); + else if (kwds2) + return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name); + else + return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); } -#endif -/* PyObjectFastCall */ -#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API -static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { - PyObject *argstuple; - PyObject *result = 0; - size_t i; - argstuple = PyTuple_New((Py_ssize_t)nargs); - if (unlikely(!argstuple)) return NULL; - for (i = 0; i < nargs; i++) { - Py_INCREF(args[i]); - if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; +/* RaiseArgTupleInvalid */ +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) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; } - result = __Pyx_PyObject_Call(func, argstuple, kwargs); - bad: - Py_DECREF(argstuple); - return result; -} -#endif -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { - Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); -#if CYTHON_COMPILING_IN_CPYTHON - if (nargs == 0 && kwargs == NULL) { - if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) - return __Pyx_PyObject_CallMethO(func, NULL); + if (exact) { + more_or_less = "exactly"; } - else if (nargs == 1 && kwargs == NULL) { - if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) - return __Pyx_PyObject_CallMethO(func, args[0]); + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + __Pyx_TypeName type_name; + __Pyx_TypeName obj_type_name; + PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode; + int from_annotation_subclass = 0; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 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); + else if (!exact) { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } else if (exact == 2) { + if (__Pyx_TypeCheck(obj, type)) { + from_annotation_subclass = 1; + extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately; } } - #if PY_VERSION_HEX >= 0x030700A1 - if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { - return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); - } - #endif - #endif - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(func)) { - return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); + type_name = __Pyx_PyType_GetFullyQualifiedName(type); + obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME + ", got " __Pyx_FMT_TYPENAME ")" +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + "%s%U" +#endif + , name, type_name, obj_type_name +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + , (from_annotation_subclass ? ". " : ""), extra_info +#endif + ); +#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + if (exact == 2 && from_annotation_subclass) { + PyObject *res; + PyObject *vargs[2]; + vargs[0] = PyErr_GetRaisedException(); + vargs[1] = extra_info; + res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL); + Py_XDECREF(res); + PyErr_SetRaisedException(vargs[0]); } - #endif - #endif - if (kwargs == NULL) { - #if CYTHON_VECTORCALL - #if PY_VERSION_HEX < 0x03090000 - vectorcallfunc f = _PyVectorcall_Function(func); - #else - vectorcallfunc f = PyVectorcall_Function(func); - #endif - if (f) { - return f(func, args, (size_t)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, (size_t)nargs, NULL); - } - #endif +#endif + __Pyx_DECREF_TypeName(type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} + +/* RaiseTooManyValuesToUnpack */ +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); +} + +/* RaiseNeedMoreValuesToUnpack */ +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"); +} + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { + PyObject* exc_type; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + exc_type = __Pyx_PyErr_CurrentExceptionType(); + if (unlikely(exc_type)) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) + return -1; + __Pyx_PyErr_Clear(); + return 0; } - if (nargs == 0) { - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + return 0; +} + +/* UnpackItemEndCheck */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; } - #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API - return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); - #else - return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); - #endif + return __Pyx_IterFinish(); } /* PyObjectCall2Args */ @@ -25088,18 +23547,12 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) -#elif PY_MAJOR_VERSION >= 3 +#else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif -#else - #ifdef __Pyx_CyFunction_USED - if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) - #else - if (likely(PyFunction_Check(descr))) - #endif #endif { meth_found = 1; @@ -25137,15 +23590,10 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me *method = descr; return 0; } - type_name = __Pyx_PyType_GetName(tp); + type_name = __Pyx_PyType_GetFullyQualifiedName(tp); PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(name)); -#endif __Pyx_DECREF_TypeName(type_name); return 0; #else @@ -25167,7 +23615,7 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me } /* PyObjectCallMethod1 */ -#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) +#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); @@ -25175,7 +23623,7 @@ 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 >= 0x030C00A2 +#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; @@ -25187,142 +23635,24 @@ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); - return result; - } - if (unlikely(!method)) return NULL; - return __Pyx__PyObject_CallMethod1(method, arg); -#endif -} - -/* append */ -static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { - if (likely(PyList_CheckExact(L))) { - if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; - } else { - PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); - if (unlikely(!retval)) - return -1; - Py_DECREF(retval); - } - return 0; -} - -/* UnpackUnboundCMethod */ -static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { - PyObject *result; - PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); - if (unlikely(!selfless_args)) return NULL; - result = PyObject_Call(method, selfless_args, kwargs); - Py_DECREF(selfless_args); - return result; -} -static PyMethodDef __Pyx_UnboundCMethod_Def = { - "CythonUnboundCMethod", - __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), - METH_VARARGS | METH_KEYWORDS, - NULL -}; -static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { - PyObject *method; - method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); - if (unlikely(!method)) - return -1; - target->method = method; -#if CYTHON_COMPILING_IN_CPYTHON - #if PY_MAJOR_VERSION >= 3 - if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) - #else - if (likely(!__Pyx_CyOrPyCFunction_Check(method))) - #endif - { - PyMethodDescrObject *descr = (PyMethodDescrObject*) method; - target->func = descr->d_method->ml_meth; - target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); - } else -#endif -#if CYTHON_COMPILING_IN_PYPY -#else - if (PyCFunction_Check(method)) -#endif - { - PyObject *self; - int self_found; -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - self = PyObject_GetAttrString(method, "__self__"); - if (!self) { - PyErr_Clear(); - } -#else - self = PyCFunction_GET_SELF(method); -#endif - self_found = (self && self != Py_None); -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - Py_XDECREF(self); -#endif - if (self_found) { - PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); - if (unlikely(!unbound_method)) return -1; - Py_DECREF(method); - target->method = unbound_method; - } - } - return 0; -} - -/* CallUnboundCMethod2 */ -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 -static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { - if (likely(cfunc->func)) { - PyObject *args[2] = {arg1, arg2}; - if (cfunc->flag == METH_FASTCALL) { - #if PY_VERSION_HEX >= 0x030700A0 - return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2); - #else - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); - #endif - } - #if PY_VERSION_HEX >= 0x030700A0 - if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); - #endif - } - return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); -} -#endif -static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ - PyObject *args, *result = NULL; - if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; -#if CYTHON_COMPILING_IN_CPYTHON - if (cfunc->func && (cfunc->flag & METH_VARARGS)) { - args = PyTuple_New(2); - if (unlikely(!args)) goto bad; - Py_INCREF(arg1); - PyTuple_SET_ITEM(args, 0, arg1); - Py_INCREF(arg2); - PyTuple_SET_ITEM(args, 1, arg2); - if (cfunc->flag & METH_KEYWORDS) - result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); - else - result = (*cfunc->func)(self, args); - } else { - args = PyTuple_New(3); - if (unlikely(!args)) goto bad; - Py_INCREF(self); - PyTuple_SET_ITEM(args, 0, self); - Py_INCREF(arg1); - PyTuple_SET_ITEM(args, 1, arg1); - Py_INCREF(arg2); - PyTuple_SET_ITEM(args, 2, arg2); - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + return result; } -#else - args = PyTuple_Pack(3, self, arg1, arg2); - if (unlikely(!args)) goto bad; - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + if (unlikely(!method)) return NULL; + return __Pyx__PyObject_CallMethod1(method, arg); #endif -bad: - Py_XDECREF(args); - return result; +} + +/* append */ +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + if (likely(PyList_CheckExact(L))) { + if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; + } else { + PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_mstate_global->__pyx_n_u_append, x); + if (unlikely(!retval)) + return -1; + Py_DECREF(retval); + } + return 0; } /* dict_setdefault */ @@ -25330,67 +23660,52 @@ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *ke int is_safe_type) { PyObject* value; CYTHON_MAYBE_UNUSED_VAR(is_safe_type); -#if PY_VERSION_HEX >= 0x030400A0 - if ((1)) { - value = PyDict_SetDefault(d, key, default_value); - if (unlikely(!value)) return NULL; - Py_INCREF(value); -#else - if (is_safe_type == 1 || (is_safe_type == -1 && -#if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) - (PyUnicode_CheckExact(key) || PyString_CheckExact(key) || PyLong_CheckExact(key)))) { - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (unlikely(PyErr_Occurred())) - return NULL; - if (unlikely(PyDict_SetItem(d, key, default_value) == -1)) - return NULL; - value = default_value; - } - Py_INCREF(value); +#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); #else - (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key) || PyLong_CheckExact(key)))) { - value = PyDict_GetItem(d, key); - if (unlikely(!value)) { - if (unlikely(PyDict_SetItem(d, key, default_value) == -1)) - return NULL; - value = default_value; - } - Py_INCREF(value); -#endif + value = PyDict_SetDefault(d, key, default_value); + if (unlikely(!value)) return NULL; + Py_INCREF(value); #endif - } else { - value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_setdefault, d, key, default_value); - } return value; } +/* PyObjectFastCallMethod */ +#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000 +static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) { + PyObject *result; + PyObject *attr = PyObject_GetAttr(args[0], name); + if (unlikely(!attr)) + return NULL; + result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1); + Py_DECREF(attr); + return result; +} +#endif + /* DictGetItem */ - #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (!PyErr_Occurred()) { - if (unlikely(PyTuple_Check(key))) { - PyObject* args = PyTuple_Pack(1, key); - if (likely(args)) { - PyErr_SetObject(PyExc_KeyError, args); - Py_DECREF(args); - } - } else { - PyErr_SetObject(PyExc_KeyError, key); + if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error + if (unlikely(PyTuple_Check(key))) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) { + PyErr_SetObject(PyExc_KeyError, args); + Py_DECREF(args); } + } else { + PyErr_SetObject(PyExc_KeyError, key); } - return NULL; } - Py_INCREF(value); return value; } #endif /* GetItemInt */ - static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); @@ -25400,7 +23715,7 @@ static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { 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_AVOID_BORROWED_REFS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); @@ -25410,7 +23725,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_ Py_INCREF(r); return r; } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif @@ -25418,7 +23733,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_ 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_AVOID_BORROWED_REFS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); @@ -25428,7 +23743,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize Py_INCREF(r); return r; } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif @@ -25436,13 +23751,11 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize 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_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS 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))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; + return __Pyx_PyList_GetItemRef(o, n); } } else if (PyTuple_CheckExact(o)) { @@ -25456,7 +23769,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { - PyObject *r, *key = PyInt_FromSsize_t(i); + PyObject *r, *key = PyLong_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); @@ -25481,11 +23794,11 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, return PySequence_GetItem(o, i); } #endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); } /* ObjectGetItem */ - #if CYTHON_USE_TYPE_SLOTS +#if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; @@ -25494,7 +23807,7 @@ static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { - __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); + __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); @@ -25505,7 +23818,7 @@ 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))) { - PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem); if (!meth) { PyErr_Clear(); } else { @@ -25514,7 +23827,7 @@ static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { return result; } } - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + 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); @@ -25535,56 +23848,14 @@ static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { #endif /* SliceObject */ - static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, +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) { + int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS - PyMappingMethods* mp; -#if PY_MAJOR_VERSION < 3 - PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; - if (likely(ms && ms->sq_slice)) { - if (!has_cstart) { - if (_py_start && (*_py_start != Py_None)) { - cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); - if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstart = 0; - } - if (!has_cstop) { - if (_py_stop && (*_py_stop != Py_None)) { - cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); - if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstop = PY_SSIZE_T_MAX; - } - if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { - Py_ssize_t l = ms->sq_length(obj); - if (likely(l >= 0)) { - if (cstop < 0) { - cstop += l; - if (cstop < 0) cstop = 0; - } - if (cstart < 0) { - cstart += l; - if (cstart < 0) cstart = 0; - } - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - goto bad; - PyErr_Clear(); - } - } - return ms->sq_slice(obj, cstart, cstop); - } -#else - CYTHON_UNUSED_VAR(wraparound); -#endif - mp = Py_TYPE(obj)->tp_as_mapping; + PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) -#else - CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; @@ -25598,7 +23869,7 @@ static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { py_start = *_py_start; } else { if (has_cstart) { - owned_start = py_start = PyInt_FromSsize_t(cstart); + owned_start = py_start = PyLong_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; @@ -25607,7 +23878,7 @@ static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { py_stop = *_py_stop; } else { if (has_cstop) { - owned_stop = py_stop = PyInt_FromSsize_t(cstop); + owned_stop = py_stop = PyLong_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; @@ -25630,7 +23901,7 @@ static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { } return result; } - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + 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); @@ -25639,7 +23910,7 @@ static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { } /* UnicodeConcatInPlace */ - # if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +# if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_unicode_modifiable(PyObject *unicode) { @@ -25703,58 +23974,6 @@ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_le #endif /* RaiseException */ - #if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - __Pyx_PyThreadState_declare - CYTHON_UNUSED_VAR(cause); - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { @@ -25839,9 +24058,9 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { - #if PY_VERSION_HEX >= 0x030C00A6 +#if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); - #elif CYTHON_FAST_THREAD_STATE +#elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -25861,30 +24080,25 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_XDECREF(owned_instance); return; } -#endif /* PyObjectSetAttrStr */ - #if CYTHON_USE_TYPE_SLOTS +#if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_setattr)) - return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); -#endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* PyObjectCallNoArg */ - static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +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 */ - static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { @@ -25900,28 +24114,53 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr } /* RaiseNoneIterError */ - static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* UnpackTupleError */ - static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { +static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); - } else if (PyTuple_GET_SIZE(t) < index) { - __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { - __Pyx_RaiseTooManyValuesError(index); + Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(t); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(size < 0)) return; + #endif + if (size < index) { + __Pyx_RaiseNeedMoreValuesError(size); + } else { + __Pyx_RaiseTooManyValuesError(index); + } } } /* UnpackTuple2 */ - static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( +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))) { + Py_ssize_t size; + if (has_known_size) { + return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple); + } + size = __Pyx_PyTuple_GET_SIZE(tuple); + if (likely(size == 2)) { + return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple); + } + if (size >= 0) { + __Pyx_UnpackTupleError(tuple, 2); + } + return -1; + } else { + return __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple); + } +} +static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { PyObject *value1 = NULL, *value2 = NULL; -#if CYTHON_COMPILING_IN_PYPY - value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; - value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; +#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS + value1 = __Pyx_PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; + value2 = __Pyx_PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); @@ -25932,7 +24171,7 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr *pvalue1 = value1; *pvalue2 = value2; return 0; -#if CYTHON_COMPILING_IN_PYPY +#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS bad: Py_XDECREF(value1); Py_XDECREF(value2); @@ -25968,7 +24207,7 @@ static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyOb } /* dict_iter */ - #if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 +#if CYTHON_COMPILING_IN_PYPY #include #endif static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, @@ -25980,7 +24219,7 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; -#elif PY_MAJOR_VERSION >= 3 +#else static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; PyObject **pp = NULL; if (method_name) { @@ -26015,53 +24254,102 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di } return PyObject_GetIter(iterable); } -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 (source_is_dict) { - PyObject *key, *value; - if (unlikely(orig_length != PyDict_Size(iter_obj))) { - PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); +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) { + PyObject *key, *value; + if (unlikely(orig_length != PyDict_Size(iter_obj))) { + PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); + return -1; + } + if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { + return 0; + } + if (pitem) { + PyObject* tuple = PyTuple_New(2); + if (unlikely(!tuple)) { return -1; } - if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { - return 0; + Py_INCREF(key); + Py_INCREF(value); + #if CYTHON_ASSUME_SAFE_MACROS + PyTuple_SET_ITEM(tuple, 0, key); + PyTuple_SET_ITEM(tuple, 1, value); + #else + if (unlikely(PyTuple_SetItem(tuple, 0, key) < 0)) { + Py_DECREF(value); + Py_DECREF(tuple); + return -1; } - if (pitem) { - PyObject* tuple = PyTuple_New(2); - if (unlikely(!tuple)) { - return -1; - } + if (unlikely(PyTuple_SetItem(tuple, 1, value) < 0)) { + Py_DECREF(tuple); + return -1; + } + #endif + *pitem = tuple; + } else { + if (pkey) { Py_INCREF(key); + *pkey = key; + } + if (pvalue) { Py_INCREF(value); - PyTuple_SET_ITEM(tuple, 0, key); - PyTuple_SET_ITEM(tuple, 1, value); - *pitem = tuple; - } else { - if (pkey) { - Py_INCREF(key); - *pkey = key; - } - if (pvalue) { - Py_INCREF(value); - *pvalue = value; - } + *pvalue = value; } - return 1; + } + return 1; +} +#endif +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 (source_is_dict) { + int result; +#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_BEGIN_CRITICAL_SECTION(iter_obj); +#endif + result = __Pyx_dict_iter_next_source_is_dict(iter_obj, orig_length, ppos, pkey, pvalue, pitem); +#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_END_CRITICAL_SECTION(); +#endif + return result; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; - if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; + Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(iter_obj); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(tuple_size < 0)) return -1; + #endif + if (unlikely(pos >= tuple_size)) return 0; *ppos = pos + 1; + #if CYTHON_ASSUME_SAFE_MACROS next_item = PyTuple_GET_ITEM(iter_obj, pos); + #else + next_item = PyTuple_GetItem(iter_obj, pos); + if (unlikely(!next_item)) return -1; + #endif Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; - if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; + Py_ssize_t list_size = __Pyx_PyList_GET_SIZE(iter_obj); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(list_size < 0)) return -1; + #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); + if (unlikely(!next_item)) return -1; + Py_INCREF(next_item); + #endif } else #endif { @@ -26084,7 +24372,6 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( } /* FixUpExtensionType */ - #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); @@ -26154,23 +24441,33 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject #endif return 0; } -#endif /* FetchSharedCythonModule */ - static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); +static PyObject *__Pyx_FetchSharedCythonABIModule(void) { + return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME); } /* FetchCommonType */ - static int __Pyx_VerifyCachedType(PyObject *cached_type, +static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, - Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { + Py_ssize_t basicsize; if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_basicsize; + py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); + if (unlikely(!py_basicsize)) return -1; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = NULL; + if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1; +#else + basicsize = ((PyTypeObject*) cached_type)->tp_basicsize; +#endif if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", @@ -26179,80 +24476,51 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject } return 0; } -#if !CYTHON_USE_TYPE_SPECS -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { - PyObject* abi_module; - const char* object_name; - PyTypeObject *cached_type = NULL; - abi_module = __Pyx_FetchSharedCythonABIModule(); - if (!abi_module) return NULL; - object_name = strrchr(type->tp_name, '.'); - object_name = object_name ? object_name+1 : type->tp_name; - cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); - if (cached_type) { - if (__Pyx_VerifyCachedType( - (PyObject *)cached_type, - object_name, - cached_type->tp_basicsize, - type->tp_basicsize) < 0) { - goto bad; - } - goto done; - } - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); - if (PyType_Ready(type) < 0) goto bad; - if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) - goto bad; - Py_INCREF(type); - cached_type = type; -done: - Py_DECREF(abi_module); - return cached_type; -bad: - Py_XDECREF(cached_type); - cached_type = NULL; - goto done; -} -#else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { - PyObject *abi_module, *cached_type = NULL; + PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name; + int get_item_ref_result; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; + py_object_name = PyUnicode_FromString(object_name); + if (!py_object_name) return NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); - if (!abi_module) return NULL; - cached_type = PyObject_GetAttrString(abi_module, object_name); - if (cached_type) { - Py_ssize_t basicsize; -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *py_basicsize; - py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); - if (unlikely(!py_basicsize)) goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; -#else - basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; -#endif + if (!abi_module) goto done; + abi_module_dict = PyModule_GetDict(abi_module); + if (!abi_module_dict) goto done; + get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type); + if (get_item_ref_result == 1) { if (__Pyx_VerifyCachedType( cached_type, object_name, - basicsize, spec->basicsize) < 0) { goto bad; } goto done; + } else if (unlikely(get_item_ref_result == -1)) { + goto bad; } - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(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; - if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; + new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type, 1); + if (unlikely(new_cached_type != cached_type)) { + if (unlikely(!new_cached_type)) goto bad; + Py_DECREF(cached_type); + cached_type = new_cached_type; + if (__Pyx_VerifyCachedType( + cached_type, + object_name, + spec->basicsize) < 0) { + goto bad; + } + goto done; + } else { + Py_DECREF(new_cached_type); + } done: - Py_DECREF(abi_module); + Py_XDECREF(abi_module); + Py_DECREF(py_object_name); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: @@ -26260,10 +24528,54 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec cached_type = NULL; goto done; } + +/* CallTypeTraverse */ +#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) { + #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 + if (__Pyx_get_runtime_version() < 0x03090000) return 0; + #endif + if (!always_call) { + PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*); + unsigned long flags = PyType_GetFlags(base); + if (flags & Py_TPFLAGS_HEAPTYPE) { + return 0; + } + } + Py_VISIT((PyObject*)Py_TYPE(o)); + return 0; +} +#endif + +/* PyMethodNew */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + PyObject *result; + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + { + PyObject *args[] = {func, self}; + result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL); + } + #else + result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL); + #endif + return result; +} +#else +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} #endif /* PyVectorcallFastCallDict */ - #if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; @@ -26274,7 +24586,12 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector size_t j; PyObject *key, *value; unsigned long keys_are_strings; + #if !CYTHON_ASSUME_SAFE_SIZE + Py_ssize_t nkw = PyDict_Size(kw); + if (unlikely(nkw == -1)) return NULL; + #else Py_ssize_t nkw = PyDict_GET_SIZE(kw); + #endif newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); @@ -26290,10 +24607,19 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { - keys_are_strings &= Py_TYPE(key)->tp_flags; + 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 PyTuple_SET_ITEM(kwnames, i, key); + #endif kwvalues[i] = value; i++; } @@ -26311,25 +24637,55 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { - if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { + Py_ssize_t kw_size = + likely(kw == NULL) ? + 0 : +#if !CYTHON_ASSUME_SAFE_SIZE + PyDict_Size(kw); +#else + PyDict_GET_SIZE(kw); +#endif + if (kw_size == 0) { return vc(func, args, nargs, NULL); } +#if !CYTHON_ASSUME_SAFE_SIZE + else if (unlikely(kw_size == -1)) { + return NULL; + } +#endif return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ - #if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } - return 0; + return 0; +} +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) { + if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) { + int result; + PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func); + if (unlikely(!newFunc)) { + PyErr_Clear(); // It's only an optimization, so don't throw an error + return 0; + } + result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc); + Py_DECREF(newFunc); + return result; + } + return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc); } #else -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) { + if (PyMethod_Check(func)) { + func = PyMethod_GET_FUNCTION(func); + } return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif @@ -26345,20 +24701,15 @@ static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* #endif } static PyObject * -__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) +__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op) { - CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { -#if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#else - op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#endif if (unlikely(op->func_doc == NULL)) return NULL; } else { @@ -26370,6 +24721,15 @@ __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) Py_INCREF(op->func_doc); return op->func_doc; } +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { + PyObject *result; + CYTHON_UNUSED_VAR(closure); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_doc_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { @@ -26378,20 +24738,19 @@ __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *cont value = Py_None; } Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_doc, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op) { - CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); -#elif PY_MAJOR_VERSION >= 3 - op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else - op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; @@ -26399,53 +24758,60 @@ __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) Py_INCREF(op->func_name); return op->func_name; } +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +{ + PyObject *result = NULL; + CYTHON_UNUSED_VAR(context); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_name_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_name, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); + PyObject *result; + __Pyx_BEGIN_CRITICAL_SECTION(op); Py_INCREF(op->func_qualname); - return op->func_qualname; + result = op->func_qualname; + __Pyx_END_CRITICAL_SECTION(); + return result; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_qualname, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) +__Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op) { - CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) @@ -26454,6 +24820,16 @@ __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) 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) { @@ -26469,7 +24845,9 @@ __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *con return -1; } Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_dict, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * @@ -26530,13 +24908,14 @@ __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { +__Pyx_CyFunction_get_defaults_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_tuple; - CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; @@ -26548,6 +24927,15 @@ __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { Py_INCREF(result); return result; } +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = NULL; + CYTHON_UNUSED_VAR(context); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_defaults_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); @@ -26561,13 +24949,14 @@ __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, voi PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { +__Pyx_CyFunction_get_kwdefaults_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_kwdict; - CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; @@ -26579,6 +24968,15 @@ __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { Py_INCREF(result); return result; } +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result; + CYTHON_UNUSED_VAR(context); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_kwdefaults_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); @@ -26590,13 +24988,14 @@ __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, vo return -1; } Py_XINCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_annotations, value); + __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * -__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { +__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; - CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; @@ -26606,16 +25005,19 @@ __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { return result; } static PyObject * -__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { - int is_coroutine; +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { + PyObject *result; CYTHON_UNUSED_VAR(context); - if (op->func_is_coroutine) { - return __Pyx_NewRef(op->func_is_coroutine); - } - is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; -#if PY_VERSION_HEX >= 0x03050000 + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_annotations_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} +static PyObject * +__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { + int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; if (is_coroutine) { - PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; + PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); @@ -26628,20 +25030,68 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { return NULL; } #endif - module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); + module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; - op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); + is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); - if (likely(op->func_is_coroutine)) { - return __Pyx_NewRef(op->func_is_coroutine); + if (likely(is_coroutine_value)) { + return is_coroutine_value; } ignore: PyErr_Clear(); } + return __Pyx_PyBool_FromLong(is_coroutine); +} +static PyObject * +__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { + PyObject *result; + CYTHON_UNUSED_VAR(context); + if (op->func_is_coroutine) { + return __Pyx_NewRef(op->func_is_coroutine); + } + result = __Pyx_CyFunction_get_is_coroutine_value(op); + if (unlikely(!result)) + return NULL; + __Pyx_BEGIN_CRITICAL_SECTION(op); + if (op->func_is_coroutine) { + Py_DECREF(result); + result = __Pyx_NewRef(op->func_is_coroutine); + } else { + op->func_is_coroutine = __Pyx_NewRef(result); + } + __Pyx_END_CRITICAL_SECTION(); + return result; +} +static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, message, size); + Py_DECREF(py_name); +#else + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + name, message, size); +#endif +} +static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s", + py_name, message); + Py_DECREF(py_name); +#else + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s", + name, message); #endif - op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); - return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * @@ -26656,24 +25106,24 @@ __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *c } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { - {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, - {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, - {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, + {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"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}, + {"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}, + {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {"__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}, + {"_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}, #endif @@ -26681,23 +25131,19 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, + {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif -#if CYTHON_USE_TYPE_SPECS - {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, + {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API + {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else -#if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, -#endif -#endif + {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API + {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, + {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} @@ -26705,19 +25151,19 @@ static PyMemberDef __pyx_CyFunction_members[] = { static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { + PyObject *result = NULL; CYTHON_UNUSED_VAR(args); -#if PY_MAJOR_VERSION >= 3 + __Pyx_BEGIN_CRITICAL_SECTION(m); Py_INCREF(m->func_qualname); - return m->func_qualname; -#else - return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); -#endif + result = m->func_qualname; + __Pyx_END_CRITICAL_SECTION(); + return result; } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) @@ -26759,8 +25205,6 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef * Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; - op->defaults_pyobjects = 0; - op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; @@ -26822,14 +25266,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_XDECREF(pydefaults[i]); - PyObject_Free(m->defaults); - m->defaults = NULL; - } + Py_CLEAR(m->defaults); return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) @@ -26846,6 +25283,10 @@ static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { + { + int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg); + if (e) return e; + } Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); @@ -26853,40 +25294,33 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); - Py_VISIT(m->func_name); - Py_VISIT(m->func_qualname); + __Pyx_VISIT_CONST(m->func_name); + __Pyx_VISIT_CONST(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); - Py_VISIT(m->func_code); + __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_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_VISIT(pydefaults[i]); - } + Py_VISIT(m->defaults); return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { -#if PY_MAJOR_VERSION >= 3 - return PyUnicode_FromFormat("", + PyObject *repr; + __Pyx_BEGIN_CRITICAL_SECTION(op); + repr = PyUnicode_FromFormat("", op->func_qualname, (void *)op); -#else - return PyString_FromFormat("", - PyString_AsString(op->func_qualname), (void *)op); -#endif + __Pyx_END_CRITICAL_SECTION(); + return repr; } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; - PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); @@ -26905,10 +25339,10 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: - return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); @@ -26916,24 +25350,15 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif if (likely(size == 0)) return (*meth)(self, NULL); -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes no arguments", size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); @@ -26952,18 +25377,9 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif return result; } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes exactly one argument", size); return NULL; } break; @@ -26971,16 +25387,8 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", - py_name); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", - f->m_ml->ml_name); -#endif + __Pyx_CyFunction_raise_type_error( + (__pyx_CyFunctionObject*)func, "takes no keyword arguments"); return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { @@ -26997,10 +25405,10 @@ 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 +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; @@ -27012,11 +25420,11 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P Py_ssize_t argc; PyObject *new_args; PyObject *self; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); - if (unlikely(!argc) < 0) return NULL; + if (unlikely(argc < 0)) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) @@ -27024,14 +25432,9 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); -#if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); -#else - PyErr_SetString(PyExc_TypeError, - "unbound method needs an argument"); -#endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); @@ -27041,21 +25444,21 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P } return result; } -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { - PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", - ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + __Pyx_CyFunction_raise_type_error( + cyfunc, "needs an argument"); return -1; } ret = 1; } - if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) { + __Pyx_CyFunction_raise_type_error( + cyfunc, "takes no keyword arguments"); return -1; } return ret; @@ -27063,13 +25466,18 @@ 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; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #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); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; @@ -27077,29 +25485,38 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } if (unlikely(nargs != 0)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes no arguments", nargs); return NULL; } - return def->ml_meth(self, NULL); + return meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #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); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; @@ -27107,29 +25524,38 @@ static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } if (unlikely(nargs != 1)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes exactly one argument", nargs); return NULL; } - return def->ml_meth(self, args[0]); + return meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #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); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; @@ -27137,17 +25563,21 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } - return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); + return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; @@ -27155,6 +25585,12 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; @@ -27162,15 +25598,19 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } - return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); + return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, (size_t)nargs, kwnames); } #endif -#if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, @@ -27190,121 +25630,32 @@ static PyType_Spec __pyx_CyFunctionType_spec = { #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif -#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) +#if CYTHON_METH_FASTCALL +#if defined(Py_TPFLAGS_HAVE_VECTORCALL) + Py_TPFLAGS_HAVE_VECTORCALL | +#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, - __pyx_CyFunctionType_slots -}; -#else -static PyTypeObject __pyx_CyFunctionType_type = { - PyVarObject_HEAD_INIT(0, 0) - __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", - sizeof(__pyx_CyFunctionObject), - 0, - (destructor) __Pyx_CyFunction_dealloc, -#if !CYTHON_METH_FASTCALL - 0, -#elif CYTHON_BACKPORT_VECTORCALL - (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), -#else - offsetof(PyCFunctionObject, vectorcall), -#endif - 0, - 0, -#if PY_MAJOR_VERSION < 3 - 0, -#else - 0, -#endif - (reprfunc) __Pyx_CyFunction_repr, - 0, - 0, - 0, - 0, - __Pyx_CyFunction_CallAsMethod, - 0, - 0, - 0, - 0, -#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR - Py_TPFLAGS_METHOD_DESCRIPTOR | -#endif -#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL - _Py_TPFLAGS_HAVE_VECTORCALL | +#endif // CYTHON_METH_FASTCALL +#if PY_VERSION_HEX >= 0x030A0000 + Py_TPFLAGS_IMMUTABLETYPE | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, - 0, - (traverseproc) __Pyx_CyFunction_traverse, - (inquiry) __Pyx_CyFunction_clear, - 0, -#if PY_VERSION_HEX < 0x030500A0 - offsetof(__pyx_CyFunctionObject, func_weakreflist), -#else - offsetof(PyCFunctionObject, m_weakreflist), -#endif - 0, - 0, - __pyx_CyFunction_methods, - __pyx_CyFunction_members, - __pyx_CyFunction_getsets, - 0, - 0, - __Pyx_PyMethod_New, - 0, - offsetof(__pyx_CyFunctionObject, func_dict), - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, -#if PY_VERSION_HEX >= 0x030400a1 - 0, -#endif -#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, -#endif -#if __PYX_NEED_TP_PRINT_SLOT - 0, -#endif -#if PY_VERSION_HEX >= 0x030C0000 - 0, -#endif -#if PY_VERSION_HEX >= 0x030d00A4 - 0, -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, -#endif + __pyx_CyFunctionType_slots }; -#endif static int __pyx_CyFunction_init(PyObject *module) { -#if CYTHON_USE_TYPE_SPECS - __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); -#else - CYTHON_UNUSED_VAR(module); - __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); -#endif - if (unlikely(__pyx_CyFunctionType == NULL)) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); + mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); + if (unlikely(mstate->__pyx_CyFunctionType == NULL)) { return -1; } return 0; } -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults = PyObject_Malloc(size); + m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type); if (unlikely(!m->defaults)) - return PyErr_NoMemory(); - memset(m->defaults, 0, size); - m->defaults_pyobjects = pyobjects; - m->defaults_size = size; + return NULL; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { @@ -27324,10 +25675,10 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py } /* CythonFunction */ - static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( - PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_mstate_global->__pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { @@ -27336,44 +25687,111 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py return op; } +/* PyObjectVectorCallKwBuilder */ +#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); + args[n] = value; + return 0; +} +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_VectorcallBuilder_AddArgStr; + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n); +} +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + PyObject *pyKey = PyUnicode_FromString(key); + if (!pyKey) return -1; + return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n); +} +#else // CYTHON_VECTORCALL +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) { + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return PyDict_SetItem(builder, key, value); +} +#endif + +/* PyObjectVectorCallMethodKwBuilder */ +#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000 +static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) { + PyObject *result; + PyObject *obj = PyObject_GetAttr(args[0], name); + if (unlikely(!obj)) + return NULL; + result = __Pyx_Object_Vectorcall_CallFromBuilder(obj, args+1, nargsf-1, kwnames); + Py_DECREF(obj); + return result; +} +#endif + /* CallUnboundCMethod0 */ - static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { - PyObject *args, *result = NULL; - if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; -#if CYTHON_ASSUME_SAFE_MACROS - args = PyTuple_New(1); - if (unlikely(!args)) goto bad; - Py_INCREF(self); - PyTuple_SET_ITEM(args, 0, self); -#else - args = PyTuple_Pack(1, self); - if (unlikely(!args)) goto bad; +#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 - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); - Py_DECREF(args); -bad: +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) { +static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) { if (__Pyx_IS_TYPE(L, &PySet_Type)) { return PySet_Pop(L); } - return __Pyx_PyObject_CallMethod0(L, __pyx_n_s_pop); + return __Pyx_PyObject_CallMethod0(L, __pyx_mstate_global->__pyx_n_u_pop); } -#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L) { if (likely(PyList_GET_SIZE(L) > (((PyListObject*)L)->allocated >> 1))) { __Pyx_SET_SIZE(L, Py_SIZE(L) - 1); return PyList_GET_ITEM(L, PyList_GET_SIZE(L)); } - return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_pop, L); + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyList_Type_pop, L); } #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE +#if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) @@ -27382,14 +25800,9 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030C00A6 + #if PY_VERSION_HEX >= 0x030C0000 local_value = tstate->current_exception; tstate->current_exception = 0; - if (likely(local_value)) { - local_type = (PyObject*) Py_TYPE(local_value); - Py_INCREF(local_type); - local_tb = PyException_GetTraceback(local_value); - } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; @@ -27398,24 +25811,30 @@ 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 + local_value = PyErr_GetRaisedException(); #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif +#if __PYX_LIMITED_VERSION_HEX > 0x030C0000 + if (likely(local_value)) { + local_type = (PyObject*) Py_TYPE(local_value); + Py_INCREF(local_type); + local_tb = PyException_GetTraceback(local_value); + } +#else PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 - if (unlikely(tstate->current_exception)) -#elif CYTHON_FAST_THREAD_STATE +#if CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; - #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } - #endif +#endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000 Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); @@ -27453,10 +25872,16 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); +#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000 + PyErr_SetHandledException(local_value); + Py_XDECREF(local_value); + Py_XDECREF(local_type); + Py_XDECREF(local_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; +#if __PYX_LIMITED_VERSION_HEX <= 0x030C0000 bad: *type = 0; *value = 0; @@ -27465,40 +25890,73 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; +#endif } /* pep479 */ - static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { - PyObject *exc, *val, *tb, *cur_exc; +static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { + PyObject *exc, *val, *tb, *cur_exc, *new_exc; __Pyx_PyThreadState_declare - #ifdef __Pyx_StopAsyncIteration_USED int is_async_stopiteration = 0; - #endif CYTHON_MAYBE_UNUSED_VAR(in_async_gen); - cur_exc = PyErr_Occurred(); + __Pyx_PyThreadState_assign + cur_exc = __Pyx_PyErr_CurrentExceptionType(); if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) { - #ifdef __Pyx_StopAsyncIteration_USED - if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) { + if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopAsyncIteration))) { is_async_stopiteration = 1; - } else - #endif + } else { return; + } } - __Pyx_PyThreadState_assign __Pyx_GetException(&exc, &val, &tb); Py_XDECREF(exc); - Py_XDECREF(val); Py_XDECREF(tb); - PyErr_SetString(PyExc_RuntimeError, - #ifdef __Pyx_StopAsyncIteration_USED + new_exc = PyObject_CallFunction(PyExc_RuntimeError, "s", is_async_stopiteration ? "async generator raised StopAsyncIteration" : in_async_gen ? "async generator raised StopIteration" : - #endif "generator raised StopIteration"); + if (!new_exc) { + Py_XDECREF(val); + return; + } + PyException_SetCause(new_exc, val); // steals ref to val + PyErr_SetObject(PyExc_RuntimeError, new_exc); +} + +/* IterNextPlain */ +#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)) + __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next); + return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache; +} +#endif +static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) { +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + PyObject *result; + PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI(); + if (unlikely(!next)) return NULL; + result = PyObject_CallFunctionObjArgs(next, iterator, NULL); + return result; +#else + (void)__Pyx_GetBuiltinName; // only for early limited API + iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator); + assert(iternext); + return iternext(iterator); +#endif } /* IterNext */ - static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) { +#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 __Pyx_PyThreadState_assign @@ -27518,44 +25976,42 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) return NULL; } static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) { - __Pyx_TypeName iterator_type_name = __Pyx_PyType_GetName(Py_TYPE(iterator)); + __Pyx_TypeName iterator_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(iterator)); PyErr_Format(PyExc_TypeError, __Pyx_FMT_TYPENAME " object is not an iterator", iterator_type_name); __Pyx_DECREF_TypeName(iterator_type_name); } static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) { PyObject* next; - iternextfunc iternext = Py_TYPE(iterator)->tp_iternext; +#if !CYTHON_COMPILING_IN_LIMITED_API + iternextfunc iternext = __Pyx_PyObject_TryGetSlot(iterator, tp_iternext, iternextfunc); if (likely(iternext)) { -#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY next = iternext(iterator); if (likely(next)) return next; -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 if (unlikely(iternext == &_PyObject_NextNotImplemented)) return NULL; + #endif + } else if (CYTHON_USE_TYPE_SLOTS) { + __Pyx_PyIter_Next_ErrorNoIterator(iterator); + return NULL; + } else #endif -#else - next = PyIter_Next(iterator); - if (likely(next)) - return next; -#endif - } else if (CYTHON_USE_TYPE_SLOTS || unlikely(!PyIter_Check(iterator))) { + if (unlikely(!PyIter_Check(iterator))) { __Pyx_PyIter_Next_ErrorNoIterator(iterator); return NULL; - } -#if !CYTHON_USE_TYPE_SLOTS - else { - next = PyIter_Next(iterator); + } else { + next = defval ? PyIter_Next(iterator) : __Pyx_PyIter_Next_Plain(iterator); if (likely(next)) return next; } -#endif return __Pyx_PyIter_Next2Default(defval); } +#endif /* GetTopmostException */ - #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { @@ -27570,7 +26026,7 @@ __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) #endif /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE +#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); @@ -27637,7 +26093,7 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject #endif /* PyDictVersioning */ - #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#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; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; @@ -27663,40 +26119,33 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN #endif /* GetModuleGlobalName */ - #if CYTHON_USE_DICT_VERSIONS +#if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 - result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } else if (unlikely(PyErr_Occurred())) { - return NULL; - } -#elif CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { + if (!PyErr_Occurred()) + PyErr_SetNone(PyExc_NameError); return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } -#else - result = PyDict_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + PyErr_Clear(); +#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear(); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { - return __Pyx_NewRef(result); + return result; } -#endif #else - result = PyObject_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } @@ -27706,197 +26155,148 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) } /* py_dict_keys */ - static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) { - if (PY_MAJOR_VERSION >= 3) - return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_keys, d); - else - return PyDict_Keys(d); +static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) { + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_keys, d); } -/* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { - CYTHON_MAYBE_UNUSED_VAR(intval); +/* PyLongBinop */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_Fallback___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, int inplace) { + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#if CYTHON_USE_PYLONG_INTERNALS +static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long x; - long a = PyInt_AS_LONG(op1); - - x = (long)((unsigned long)a + (unsigned long)b); - if (likely((x^a) >= 0 || (x^b) >= 0)) - return PyInt_FromLong(x); - return PyLong_Type.tp_as_number->nb_add(op1, op2); - } - #endif - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(PyLong_CheckExact(op1))) { - const long b = intval; - long a, x; + const long b = intval; + long a, x; #ifdef HAVE_LONG_LONG - const PY_LONG_LONG llb = intval; - PY_LONG_LONG lla, llx; + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; #endif - if (unlikely(__Pyx_PyLong_IsZero(op1))) { - return __Pyx_NewRef(op2); - } - if (likely(__Pyx_PyLong_IsCompact(op1))) { - a = __Pyx_PyLong_CompactValue(op1); - } 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 - } 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 - } - 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; - 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 - } - 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 - } - CYTHON_FALLTHROUGH; - default: return PyLong_Type.tp_as_number->nb_add(op1, op2); - } + if (unlikely(__Pyx_PyLong_IsZero(op1))) { + return __Pyx_NewRef(op2); + } + if (likely(__Pyx_PyLong_IsCompact(op1))) { + a = __Pyx_PyLong_CompactValue(op1); + } 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 + } 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 + } + 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; + 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 + } + 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 + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } - x = a + b; - return PyLong_FromLong(x); + } + x = a + b; + return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG - long_long: - llx = lla + llb; - return PyLong_FromLongLong(llx); + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); #endif + return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace); + + +} +#endif +static PyObject* __Pyx_Float___Pyx_PyLong_AddObjC(PyObject *float_val, long intval, int zerodivision_check) { + CYTHON_UNUSED_VAR(zerodivision_check); + const long b = intval; + double a = __Pyx_PyFloat_AS_DOUBLE(float_val); + double result; - + result = ((double)a) + (double)b; + return PyFloat_FromDouble(result); +} +static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_UNUSED_VAR(zerodivision_check); + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + return __Pyx_Unpacked___Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check); } #endif if (PyFloat_CheckExact(op1)) { - const long b = intval; -#if CYTHON_COMPILING_IN_LIMITED_API - double a = __pyx_PyFloat_AsDouble(op1); -#else - double a = PyFloat_AS_DOUBLE(op1); -#endif - double result; - - PyFPE_START_PROTECT("add", return NULL) - result = ((double)a) + (double)b; - PyFPE_END_PROTECT(result) - return PyFloat_FromDouble(result); + return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check); } - return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); + return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace); } #endif /* SliceObject */ - static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, +static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, 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) { + int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS - PyMappingMethods* mp; -#if PY_MAJOR_VERSION < 3 - PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; - if (likely(ms && ms->sq_ass_slice)) { - if (!has_cstart) { - if (_py_start && (*_py_start != Py_None)) { - cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); - if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstart = 0; - } - if (!has_cstop) { - if (_py_stop && (*_py_stop != Py_None)) { - cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); - if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstop = PY_SSIZE_T_MAX; - } - if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { - Py_ssize_t l = ms->sq_length(obj); - if (likely(l >= 0)) { - if (cstop < 0) { - cstop += l; - if (cstop < 0) cstop = 0; - } - if (cstart < 0) { - cstart += l; - if (cstart < 0) cstart = 0; - } - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - goto bad; - PyErr_Clear(); - } - } - return ms->sq_ass_slice(obj, cstart, cstop, value); - } -#else - CYTHON_UNUSED_VAR(wraparound); -#endif - mp = Py_TYPE(obj)->tp_as_mapping; + PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_ass_subscript)) -#else - CYTHON_UNUSED_VAR(wraparound); #endif { int result; @@ -27910,7 +26310,7 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, py_start = *_py_start; } else { if (has_cstart) { - owned_start = py_start = PyInt_FromSsize_t(cstart); + owned_start = py_start = PyLong_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; @@ -27919,7 +26319,7 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, py_stop = *_py_stop; } else { if (has_cstop) { - owned_stop = py_stop = PyInt_FromSsize_t(cstop); + owned_stop = py_stop = PyLong_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; @@ -27942,7 +26342,7 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, } return result; } - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object does not support slice %.10s", obj_type_name, value ? "assignment" : "deletion"); @@ -27952,71 +26352,72 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, } /* RaiseClosureNameError */ - static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { +static void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } /* RaiseUnboundLocalError */ - static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { +static void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } /* CallUnboundCMethod1 */ - #if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { - if (likely(cfunc->func)) { + int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); + if (likely(was_initialized == 2 && cfunc->func)) { int flag = cfunc->flag; if (flag == METH_O) { - return (*(cfunc->func))(self, arg); - } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) { - #if PY_VERSION_HEX >= 0x030700A0 - return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); - #else - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); - #endif - } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) { - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + return __Pyx_CallCFunction(cfunc, self, arg); + } else if (flag == METH_FASTCALL) { + return __Pyx_CallCFunctionFast(cfunc, self, &arg, 1); + } else if (flag == (METH_FASTCALL | METH_KEYWORDS)) { + return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, &arg, 1, NULL); } } - return __Pyx__CallUnboundCMethod1(cfunc, self, arg); +#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__CallUnboundCMethod1(&tmp_cfunc, self, arg); + } +#endif + PyObject* result = __Pyx__CallUnboundCMethod1(cfunc, self, arg); + __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); + return result; } #endif static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ - PyObject *args, *result = NULL; + PyObject *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { - args = PyTuple_New(1); - if (unlikely(!args)) goto bad; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); if (cfunc->flag & METH_KEYWORDS) - result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); else - result = (*cfunc->func)(self, args); - } else { - args = PyTuple_New(2); - if (unlikely(!args)) goto bad; - Py_INCREF(self); - PyTuple_SET_ITEM(args, 0, self); - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 1, arg); - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); - } -#else - args = PyTuple_Pack(2, self, arg); - if (unlikely(!args)) goto bad; - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + result = __Pyx_CallCFunction(cfunc, self, args); + Py_DECREF(args); + } else #endif -bad: - Py_XDECREF(args); + { + result = __Pyx_PyObject_Call2Args(cfunc->method, self, arg); + } return result; } /* dict_getitem_default */ - static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { +static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { PyObject* value; -#if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000 value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (unlikely(PyErr_Occurred())) @@ -28026,7 +26427,7 @@ static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObje Py_INCREF(value); if ((1)); #else - if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { + if (PyBytes_CheckExact(key) || PyUnicode_CheckExact(key) || PyLong_CheckExact(key)) { value = PyDict_GetItem(d, key); if (unlikely(!value)) { value = default_value; @@ -28036,18 +26437,18 @@ static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObje #endif else { if (default_value == Py_None) - value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key); + value = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key); else - value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value); + value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key, default_value); } return value; } /* RaiseUnexpectedTypeError */ - static int +static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) { - __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, expected, obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); @@ -28055,7 +26456,7 @@ __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) } /* SliceTupleAndList */ - #if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) { Py_ssize_t start = *_start, stop = *_stop, length = *_length; if (start < 0) { @@ -28071,7 +26472,13 @@ static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop *_start = start; *_stop = stop; } -static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice( +static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice( + PyObject* src, Py_ssize_t start, Py_ssize_t stop) { + Py_ssize_t length = PyTuple_GET_SIZE(src); + __Pyx_crop_slice(&start, &stop, &length); + return __Pyx_PyTuple_FromArray(((PyTupleObject*)src)->ob_item + start, length); +} +static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice_locked( PyObject* src, Py_ssize_t start, Py_ssize_t stop) { Py_ssize_t length = PyList_GET_SIZE(src); __Pyx_crop_slice(&start, &stop, &length); @@ -28080,23 +26487,21 @@ static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice( } return __Pyx_PyList_FromArray(((PyListObject*)src)->ob_item + start, length); } -static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice( +static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice( PyObject* src, Py_ssize_t start, Py_ssize_t stop) { - Py_ssize_t length = PyTuple_GET_SIZE(src); - __Pyx_crop_slice(&start, &stop, &length); - return __Pyx_PyTuple_FromArray(((PyTupleObject*)src)->ob_item + start, length); + PyObject *result; + __Pyx_BEGIN_CRITICAL_SECTION(src); + result = __Pyx_PyList_GetSlice_locked(src, start, stop); + __Pyx_END_CRITICAL_SECTION(); + return result; } -#endif +#endif // CYTHON_COMPILING_IN_CPYTHON /* PyObjectLookupSpecial */ - #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS +#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; PyTypeObject *tp = Py_TYPE(obj); -#if PY_MAJOR_VERSION < 3 - if (unlikely(PyInstance_Check(obj))) - return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); -#endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; @@ -28113,35 +26518,32 @@ static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyOb #endif /* GetAttr */ - static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS -#if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) -#else - if (likely(PyString_Check(n))) -#endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* Globals */ - static PyObject* __Pyx_Globals(void) { - return __Pyx_NewRef(__pyx_d); +static PyObject* __Pyx_Globals(void) { + return __Pyx_NewRef(__pyx_mstate_global->__pyx_d); } /* ValidateBasesTuple */ - #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS +#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; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); - if (n < 0) return -1; + if (unlikely(n < 0)) return -1; #endif for (i = 1; i < n; i++) { + PyTypeObject *b; #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; @@ -28150,23 +26552,11 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; -#endif - PyTypeObject *b; -#if PY_MAJOR_VERSION < 3 - if (PyClass_Check(b0)) - { - PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", - PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); -#if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); -#endif - return -1; - } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { - __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); @@ -28178,7 +26568,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; -#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY +#if CYTHON_USE_TYPE_SLOTS b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); @@ -28189,7 +26579,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #endif if (b_dictoffset) { { - __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " @@ -28198,7 +26588,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs type_name, b_name); __Pyx_DECREF_TypeName(b_name); } -#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) +#if !CYTHON_USE_TYPE_SLOTS dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS @@ -28216,8 +26606,18 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #endif /* PyType_Ready */ - static int __Pyx_PyType_Ready(PyTypeObject *t) { -#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) +CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) { + while (t) { + PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); + if (bases) { + return 1; + } + t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*); + } + return 0; +} +static int __Pyx_PyType_Ready(PyTypeObject *t) { +#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; @@ -28225,10 +26625,13 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs return PyType_Ready(t); #else int r; + if (!__Pyx_PyType_HasMultipleInheritance(t)) { + return PyType_Ready(t); + } PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; -#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) +#if !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 @@ -28237,12 +26640,13 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #else PyObject *ret, *py_status; PyObject *gc = NULL; - #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) - gc = PyImport_GetModule(__pyx_kp_u_gc); + #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\ + !CYTHON_COMPILING_IN_GRAAL + gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc); #endif - if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); + if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc); if (unlikely(!gc)) return -1; - py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); + py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; @@ -28250,7 +26654,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; @@ -28269,7 +26673,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); -#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) +#if !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) @@ -28278,7 +26682,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); @@ -28297,114 +26701,51 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #endif } -/* PyObject_GenericGetAttrNoDict */ - #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { - __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); - PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", - type_name, attr_name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(attr_name)); -#endif - __Pyx_DECREF_TypeName(type_name); - return NULL; -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { - PyObject *descr; - PyTypeObject *tp = Py_TYPE(obj); - if (unlikely(!PyString_Check(attr_name))) { - return PyObject_GenericGetAttr(obj, attr_name); - } - assert(!tp->tp_dictoffset); - descr = _PyType_Lookup(tp, attr_name); - if (unlikely(!descr)) { - return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); - } - Py_INCREF(descr); - #if PY_MAJOR_VERSION < 3 - if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) - #endif - { - descrgetfunc f = Py_TYPE(descr)->tp_descr_get; - if (unlikely(f)) { - PyObject *res = f(descr, obj, (PyObject *)tp); - Py_DECREF(descr); - return res; - } - } - return descr; -} -#endif - /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; - #if PY_MAJOR_VERSION < 3 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (unlikely(!py_import)) - goto bad; - if (!from_list) { - empty_list = PyList_New(0); - if (unlikely(!empty_list)) - goto bad; - from_list = empty_list; - } - #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, 1); - if (unlikely(!module)) { - if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_MAJOR_VERSION < 3 - PyObject *py_level = PyInt_FromLong(level); - if (unlikely(!py_level)) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); - Py_DECREF(py_level); - #else + if (level == -1) { + const char* package_sep = strchr(__Pyx_MODULE_NAME, '.'); + if (package_sep != (0)) { module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, level); - #endif + name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, 1); + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } } + level = 0; + } + if (!module) { + module = PyImport_ImportModuleLevelObject( + name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, level); } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_import); - #endif return module; } /* ImportDottedModule */ - #if PY_MAJOR_VERSION >= 3 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 (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { +#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); @@ -28416,28 +26757,18 @@ static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( -#if PY_MAJOR_VERSION < 3 - PyExc_ImportError, - "No module named '%s'", PyString_AS_STRING(partial_name)); -#else -#if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, -#else - PyExc_ImportError, -#endif "No module named '%U'", partial_name); -#endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } -#endif -#if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; -#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) +#if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ + CYTHON_COMPILING_IN_GRAAL PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; @@ -28448,17 +26779,21 @@ static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { #endif return imported_module; } -#endif -#if PY_MAJOR_VERSION >= 3 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 = PySequence_ITEM(parts_tuple, i); + 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) @@ -28472,20 +26807,7 @@ static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject * } return module; } -#endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if PY_MAJOR_VERSION < 3 - PyObject *module, *from_list, *star = __pyx_n_s__6; - CYTHON_UNUSED_VAR(parts_tuple); - from_list = PyList_New(1); - if (unlikely(!from_list)) - return NULL; - Py_INCREF(star); - PyList_SET_ITEM(from_list, 0, star); - module = __Pyx_Import(name, from_list, 0); - Py_DECREF(from_list); - return module; -#else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) @@ -28497,15 +26819,14 @@ static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); -#endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 +#if CYTHON_COMPILING_IN_CPYTHON PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { - PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); + PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_mstate_global->__pyx_n_u_spec); if (likely(spec)) { - PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); + 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; @@ -28525,8 +26846,27 @@ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) 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_kp_u_); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } - #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ + CYTHON_COMPILING_IN_GRAAL { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) @@ -28558,20 +26899,15 @@ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) Py_XDECREF(module_name); } if (unlikely(!value)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif + PyErr_Format(PyExc_ImportError, "cannot import name %S", name); } return value; } /* CalculateMetaclass */ - static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); @@ -28586,10 +26922,6 @@ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); -#if PY_MAJOR_VERSION < 3 - if (tmptype == &PyClass_Type) - continue; -#endif if (!metaclass) { metaclass = tmptype; continue; @@ -28608,22 +26940,18 @@ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) return NULL; } if (!metaclass) { -#if PY_MAJOR_VERSION < 3 - metaclass = &PyClass_Type; -#else metaclass = &PyType_Type; -#endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* Py3ClassCreate */ - static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { - PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); + PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_mstate_global->__pyx_n_u_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); @@ -28638,148 +26966,14 @@ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) } if (unlikely(!ns)) return NULL; - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; -#if PY_VERSION_HEX >= 0x03030000 - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; -#else - CYTHON_MAYBE_UNUSED_VAR(qualname); -#endif - if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } -#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS -static int __Pyx_SetNamesPEP487(PyObject *type_obj) { - PyTypeObject *type = (PyTypeObject*) type_obj; - PyObject *names_to_set, *key, *value, *set_name, *tmp; - Py_ssize_t i = 0; -#if CYTHON_USE_TYPE_SLOTS - names_to_set = PyDict_Copy(type->tp_dict); -#else - { - PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict_2); - names_to_set = NULL; - if (likely(d)) { - PyObject *names_to_set = PyDict_New(); - int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; - Py_DECREF(d); - if (unlikely(ret < 0)) - Py_CLEAR(names_to_set); - } - } -#endif - if (unlikely(names_to_set == NULL)) - goto bad; - while (PyDict_Next(names_to_set, &i, &key, &value)) { - set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); - if (unlikely(set_name != NULL)) { - tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); - Py_DECREF(set_name); - if (unlikely(tmp == NULL)) { - __Pyx_TypeName value_type_name = - __Pyx_PyType_GetName(Py_TYPE(value)); - __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); - PyErr_Format(PyExc_RuntimeError, -#if PY_MAJOR_VERSION >= 3 - "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", - value_type_name, key, type_name); -#else - "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", - value_type_name, - PyString_Check(key) ? PyString_AS_STRING(key) : "?", - type_name); -#endif - goto bad; - } else { - Py_DECREF(tmp); - } - } - else if (unlikely(PyErr_Occurred())) { - goto bad; - } - } - Py_DECREF(names_to_set); - return 0; -bad: - Py_XDECREF(names_to_set); - return -1; -} -static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { -#if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - PyTypeObject *type = (PyTypeObject*) type_obj; - PyObject *mro = type->tp_mro; - Py_ssize_t i, nbases; - if (unlikely(!mro)) goto done; - (void) &__Pyx_GetBuiltinName; - Py_INCREF(mro); - nbases = PyTuple_GET_SIZE(mro); - assert(PyTuple_GET_ITEM(mro, 0) == type_obj); - for (i = 1; i < nbases-1; i++) { - PyObject *base, *dict, *meth; - base = PyTuple_GET_ITEM(mro, i); - dict = ((PyTypeObject *)base)->tp_dict; - meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); - if (unlikely(meth)) { - descrgetfunc f = Py_TYPE(meth)->tp_descr_get; - PyObject *res; - Py_INCREF(meth); - if (likely(f)) { - res = f(meth, NULL, type_obj); - Py_DECREF(meth); - if (unlikely(!res)) goto bad; - meth = res; - } - res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); - Py_DECREF(meth); - if (unlikely(!res)) goto bad; - Py_DECREF(res); - goto done; - } else if (unlikely(PyErr_Occurred())) { - goto bad; - } - } -done: - Py_XDECREF(mro); - return type_obj; -bad: - Py_XDECREF(mro); - Py_DECREF(type_obj); - return NULL; -#else - PyObject *super_type, *super, *func, *res; -#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) - super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); -#else - super_type = (PyObject*) &PySuper_Type; - (void) &__Pyx_GetBuiltinName; -#endif - super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; -#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) - Py_XDECREF(super_type); -#endif - if (unlikely(!super)) { - Py_CLEAR(type_obj); - goto done; - } - func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); - Py_DECREF(super); - if (likely(!func)) { - if (unlikely(PyErr_Occurred())) - Py_CLEAR(type_obj); - goto done; - } - res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); - Py_DECREF(func); - if (unlikely(!res)) - Py_CLEAR(type_obj); - Py_XDECREF(res); -done: - return type_obj; -#endif -} -#endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { @@ -28787,7 +26981,7 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { - owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { @@ -28803,37 +26997,36 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj return NULL; owned_metaclass = metaclass; } - result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, -#if PY_VERSION_HEX < 0x030600A4 - (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw -#else - mkw -#endif - ); + result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_XDECREF(owned_metaclass); -#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS - if (likely(result) && likely(PyType_Check(result))) { - if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { - Py_CLEAR(result); - } else { - result = __Pyx_InitSubclassPEP487(result, mkw); - } - } -#else - (void) &__Pyx_GetBuiltinName; -#endif return result; } /* Py3UpdateBases */ - static PyObject* +static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; - PyObject *base, *meth, *new_base, *result, *new_bases = NULL; + PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL; +#if CYTHON_ASSUME_SAFE_SIZE size_bases = PyTuple_GET_SIZE(bases); +#else + size_bases = PyTuple_Size(bases); + if (size_bases < 0) return NULL; +#endif for (i = 0; i < size_bases; i++) { - base = PyTuple_GET_ITEM(bases, i); +#if CYTHON_AVOID_BORROWED_REFS + Py_CLEAR(base); +#endif +#if CYTHON_ASSUME_SAFE_MACROS + base = PyTuple_GET_ITEM(bases, i); +#else + base = PyTuple_GetItem(bases, i); + if (!base) goto error; +#endif +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(base); +#endif if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { @@ -28842,7 +27035,7 @@ __Pyx_PEP560_update_bases(PyObject *bases) } continue; } - meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); + meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } @@ -28870,12 +27063,25 @@ __Pyx_PEP560_update_bases(PyObject *bases) goto error; } for (j = 0; j < i; j++) { - base = PyTuple_GET_ITEM(bases, j); - PyList_SET_ITEM(new_bases, j, base); - Py_INCREF(base); + PyObject *base_from_list; +#if CYTHON_ASSUME_SAFE_MACROS + base_from_list = PyTuple_GET_ITEM(bases, j); + PyList_SET_ITEM(new_bases, j, base_from_list); + Py_INCREF(base_from_list); +#else + base_from_list = PyTuple_GetItem(bases, j); + if (!base_from_list) goto error; + Py_INCREF(base_from_list); + if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error; +#endif } } +#if CYTHON_ASSUME_SAFE_SIZE j = PyList_GET_SIZE(new_bases); +#else + j = PyList_Size(new_bases); + if (j < 0) goto error; +#endif if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } @@ -28887,26 +27093,35 @@ __Pyx_PEP560_update_bases(PyObject *bases) } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); +#if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(base); +#endif return result; error: Py_XDECREF(new_bases); +#if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(base); +#endif return NULL; } /* CyFunctionClassCell */ - static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj) { - Py_ssize_t i, count = PyList_GET_SIZE(cyfunctions); +static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj) { + Py_ssize_t i, count = __Pyx_PyList_GET_SIZE(cyfunctions); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(count < 0)) return -1; + #endif for (i = 0; i < count; i++) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS PyList_GET_ITEM(cyfunctions, i); #else - PySequence_ITEM(cyfunctions, i); + __Pyx_PySequence_ITEM(cyfunctions, i); if (unlikely(!m)) return -1; #endif __Pyx_CyFunction_SetClassObj(m, classobj); -#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) +#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS) Py_DECREF((PyObject*)m); #endif } @@ -28914,7 +27129,7 @@ __Pyx_PEP560_update_bases(PyObject *bases) } /* CLineInTraceback */ - #ifndef CYTHON_CLINE_IN_TRACEBACK +#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; @@ -28922,22 +27137,26 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); - if (unlikely(!__pyx_cython_runtime)) { + 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_cython_runtime); + cython_runtime_dict = _PyObject_GetDictPtr(__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_n_s_cline_in_traceback)) + __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_cython_runtime, __pyx_n_s_cline_in_traceback); + 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(); @@ -28946,18 +27165,18 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { } if (!use_cline) { c_line = 0; - (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + (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)) { c_line = 0; } + Py_XDECREF(use_cline); __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ - #if !CYTHON_COMPILING_IN_LIMITED_API 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) { @@ -28979,67 +27198,106 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co return mid + 1; } } -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; +static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) { + __Pyx_CachedCodeObjectType* code_object; int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + if (unlikely(!code_line) || unlikely(!code_cache->entries)) { return NULL; } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); + if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) { return NULL; } - code_object = __pyx_code_cache.entries[pos].code_object; + code_object = code_cache->entries[pos].code_object; Py_INCREF(code_object); return code_object; } -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) { +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS + (void)__pyx__find_code_object; + return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss. +#else + struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count); + if (old_count < 0) { + __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); + return NULL; + } +#endif + __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line); +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); +#endif + return result; +#endif +} +static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object) +{ int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + __Pyx_CodeObjectCacheEntry* entries = code_cache->entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; + code_cache->entries = entries; + code_cache->max_count = 64; + code_cache->count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; + pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); + if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) { + __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object; entries[pos].code_object = code_object; + Py_INCREF(code_object); Py_DECREF(tmp); return; } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; + if (code_cache->count == code_cache->max_count) { + int new_max = code_cache->max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; + code_cache->entries = entries; + code_cache->max_count = new_max; } - for (i=__pyx_code_cache.count; i>pos; i--) { + for (i=code_cache->count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; - __pyx_code_cache.count++; + code_cache->count++; Py_INCREF(code_object); } +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) { +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS + (void)__pyx__insert_code_object; + return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail. +#else + struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_nonatomic_int_type expected = 0; + if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) { + return; + } +#endif + __pyx__insert_code_object(code_cache, code_line, code_object); +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN); #endif +#endif +} /* AddTraceback */ - #include "compile.h" +#include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) @@ -29056,35 +27314,12 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { - PyObject *result; - result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); - #if __PYX_LIMITED_VERSION_HEX < 0x030780000 - { - PyObject *compiled = NULL, *result = NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; - compiled = Py_CompileString( - "out = type(code)(\n" - " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" - " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" - " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" - " code.co_lnotab)\n", "", Py_file_input); - if (!compiled) return NULL; - result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); - Py_DECREF(compiled); - if (!result) PyErr_Print(); - Py_DECREF(result); - result = PyDict_GetItemString(scratch_dict, "out"); - if (result) Py_INCREF(result); - return result; - } - #else return NULL; - #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { @@ -29097,20 +27332,26 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); - code_object = Py_CompileString("_getframe()", filename, Py_eval_input); - 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 (unlikely(!py_funcname)) goto bad; - dict = PyDict_New(); - if (unlikely(!dict)) goto bad; - { - PyObject *old_code_object = code_object; - code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); - Py_DECREF(old_code_object); + code_object = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!code_object) { + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + 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 (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, code_object); + } else { + dict = PyDict_New(); } - if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; @@ -29136,58 +27377,17 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; - #if PY_MAJOR_VERSION < 3 - PyObject *py_srcfile = NULL; - py_srcfile = PyString_FromString(filename); - if (!py_srcfile) goto bad; - #endif if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - if (!py_funcname) goto bad; - #endif } - #if PY_MAJOR_VERSION < 3 - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - #else py_code = PyCode_NewEmpty(filename, funcname, py_line); - #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_srcfile); - #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -29218,7 +27418,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ + __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; @@ -29231,7 +27431,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -29243,17 +27443,17 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG +#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); @@ -29274,25 +27474,25 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + PyObject *from_bytes, *result = NULL, *kwds = NULL; + PyObject *py_bytes = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - if (!is_unsigned) { - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + { + PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; + if (!is_unsigned) { + kwds = __Pyx_MakeVectorcallBuilderKwds(1); + if (!kwds) goto limited_bad; + if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; + } + result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } - result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); - Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); @@ -29302,23 +27502,46 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } /* FormatTypeName */ - #if CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 static __Pyx_TypeName -__Pyx_PyType_GetName(PyTypeObject* tp) +__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp) { - PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_n_s_name); - if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { - PyErr_Clear(); - Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__61); + PyObject *module = NULL, *name = NULL, *result = NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030b0000 + name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_mstate_global->__pyx_n_u_qualname); + #else + name = PyType_GetQualName(tp); + #endif + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad; + module = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_mstate_global->__pyx_n_u_module); + if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad; + if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) { + result = name; + name = NULL; + goto done; } - return name; + result = PyUnicode_FromFormat("%U.%U", module, name); + if (unlikely(result == NULL)) goto bad; + done: + Py_XDECREF(name); + Py_XDECREF(module); + return result; + bad: + PyErr_Clear(); + if (name) { + result = name; + name = NULL; + } else { + result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__2); + } + goto done; } #endif /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ +#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)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) @@ -29340,7 +27563,7 @@ __Pyx_PyType_GetName(PyTypeObject* tp) } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -29350,24 +27573,11 @@ __Pyx_PyType_GetName(PyTypeObject* tp) #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(long) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + val = __Pyx_PyLong_As_long(tmp); Py_DECREF(tmp); return val; } @@ -29607,7 +27817,7 @@ __Pyx_PyType_GetName(PyTypeObject* tp) } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -29617,24 +27827,11 @@ __Pyx_PyType_GetName(PyTypeObject* tp) #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); + val = __Pyx_PyLong_As_int(tmp); Py_DECREF(tmp); return val; } @@ -29874,7 +28071,7 @@ __Pyx_PyType_GetName(PyTypeObject* tp) } /* FastTypeChecks */ - #if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); @@ -29914,29 +28111,6 @@ static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } -#if PY_MAJOR_VERSION == 2 -static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { - PyObject *exception, *value, *tb; - int res; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&exception, &value, &tb); - res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - if (!res) { - res = PyObject_IsSubclass(err, exc_type2); - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - } - __Pyx_ErrRestore(exception, value, tb); - return res; -} -#else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); @@ -29944,21 +28118,15 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } -#endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00a4 @@ -30043,15 +28211,77 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, } #endif +/* ReturnWithStopIteration */ +static void __Pyx__ReturnWithStopIteration(PyObject* value, int async); +static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext) { + if (value == Py_None) { + if (async || !iternext) + PyErr_SetNone(async ? PyExc_StopAsyncIteration : PyExc_StopIteration); + return; + } + __Pyx__ReturnWithStopIteration(value, async); +} +static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) { +#if CYTHON_COMPILING_IN_CPYTHON + __Pyx_PyThreadState_declare +#endif + PyObject *exc; + PyObject *exc_type = async ? PyExc_StopAsyncIteration : PyExc_StopIteration; +#if CYTHON_COMPILING_IN_CPYTHON + if ((PY_VERSION_HEX >= (0x030C00A6)) || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) { + if (PY_VERSION_HEX >= (0x030e00A1)) { + exc = __Pyx_PyObject_CallOneArg(exc_type, value); + } else { + PyObject *args_tuple = PyTuple_New(1); + if (unlikely(!args_tuple)) return; + Py_INCREF(value); + PyTuple_SET_ITEM(args_tuple, 0, value); + exc = PyObject_Call(exc_type, args_tuple, NULL); + Py_DECREF(args_tuple); + } + if (unlikely(!exc)) return; + } else { + Py_INCREF(value); + exc = value; + } + #if CYTHON_FAST_THREAD_STATE + __Pyx_PyThreadState_assign + #if CYTHON_USE_EXC_INFO_STACK + if (!__pyx_tstate->exc_info->exc_value) + #else + if (!__pyx_tstate->exc_type) + #endif + { + Py_INCREF(exc_type); + __Pyx_ErrRestore(exc_type, exc, NULL); + return; + } + #endif +#else + exc = __Pyx_PyObject_CallOneArg(exc_type, value); + if (unlikely(!exc)) return; +#endif + PyErr_SetObject(exc_type, exc); + Py_DECREF(exc); +} + /* CoroutineBase */ - #include +#if !CYTHON_COMPILING_IN_LIMITED_API +#include #if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif -#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +#endif // CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void +__Pyx_Coroutine_Undelegate(__pyx_CoroutineObject *gen) { +#if CYTHON_USE_AM_SEND + gen->yieldfrom_am_send = NULL; +#endif + Py_CLEAR(gen->yieldfrom); +} static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) { PyObject *et, *ev, *tb; PyObject *value = NULL; @@ -30069,20 +28299,35 @@ static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyO Py_INCREF(Py_None); value = Py_None; } -#if PY_VERSION_HEX >= 0x030300A0 else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) { + #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL + value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value); + if (unlikely(!value)) goto limited_api_failure; + #else value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); + #endif Py_DECREF(ev); } -#endif else if (unlikely(PyTuple_Check(ev))) { - if (PyTuple_GET_SIZE(ev) >= 1) { + Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(ev); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(tuple_size < 0)) { + Py_XDECREF(tb); + Py_DECREF(ev); + Py_DECREF(et); + return -1; + } + #endif + if (tuple_size >= 1) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS value = PyTuple_GET_ITEM(ev, 0); Py_INCREF(value); -#else +#elif CYTHON_ASSUME_SAFE_MACROS value = PySequence_ITEM(ev, 0); +#else + value = PySequence_GetItem(ev, 0); + if (!value) goto limited_api_failure; #endif } else { Py_INCREF(Py_None); @@ -30110,27 +28355,35 @@ static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyO } Py_XDECREF(tb); Py_DECREF(et); -#if PY_VERSION_HEX >= 0x030300A0 +#if CYTHON_COMPILING_IN_LIMITED_API + value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value); +#else value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); +#endif Py_DECREF(ev); -#else - { - PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); - Py_DECREF(ev); - if (likely(args)) { - value = PySequence_GetItem(args, 0); - Py_DECREF(args); - } - if (unlikely(!value)) { - __Pyx_ErrRestore(NULL, NULL, NULL); - Py_INCREF(Py_None); - value = Py_None; - } +#if CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!value)) return -1; +#endif + *pvalue = value; + return 0; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL || !CYTHON_ASSUME_SAFE_MACROS + limited_api_failure: + Py_XDECREF(et); + Py_XDECREF(tb); + Py_XDECREF(ev); + return -1; +#endif +} +static CYTHON_INLINE +__Pyx_PySendResult __Pyx_Coroutine_status_from_result(PyObject **retval) { + if (*retval) { + return PYGEN_NEXT; + } else if (likely(__Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, retval) == 0)) { + return PYGEN_RETURN; + } else { + return PYGEN_ERROR; } -#endif - *pvalue = value; - return 0; } static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { @@ -30167,26 +28420,7 @@ static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) { } PyErr_SetString(PyExc_ValueError, msg); } -#define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) -static void __Pyx__Coroutine_NotStartedError(PyObject *gen) { - const char *msg; - CYTHON_MAYBE_UNUSED_VAR(gen); - if ((0)) { - #ifdef __Pyx_Coroutine_USED - } else if (__Pyx_Coroutine_Check(gen)) { - msg = "can't send non-None value to a just-started coroutine"; - #endif - #ifdef __Pyx_AsyncGen_USED - } else if (__Pyx_AsyncGen_CheckExact(gen)) { - msg = "can't send non-None value to a just-started async generator"; - #endif - } else { - msg = "can't send non-None value to a just-started generator"; - } - PyErr_SetString(PyExc_TypeError, msg); -} -#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) -static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { +static void __Pyx_Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { CYTHON_MAYBE_UNUSED_VAR(gen); CYTHON_MAYBE_UNUSED_VAR(closing); #ifdef __Pyx_Coroutine_USED @@ -30197,26 +28431,22 @@ static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *val if (value) { #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) - PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); + PyErr_SetNone(PyExc_StopAsyncIteration); else #endif PyErr_SetNone(PyExc_StopIteration); } } static -PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { +__Pyx_PySendResult __Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, PyObject **result, int closing) { __Pyx_PyThreadState_declare PyThreadState *tstate; __Pyx_ExcInfoStruct *exc_state; PyObject *retval; - assert(!self->is_running); - if (unlikely(self->resume_label == 0)) { - if (unlikely(value && value != Py_None)) { - return __Pyx_Coroutine_NotStartedError((PyObject*)self); - } - } + assert(__Pyx_Coroutine_get_is_running(self)); // Callers should ensure is_running if (unlikely(self->resume_label == -1)) { - return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + return PYGEN_ERROR; } #if CYTHON_FAST_THREAD_STATE __Pyx_PyThreadState_assign @@ -30226,7 +28456,7 @@ PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, i #endif exc_state = &self->gi_exc_state; if (exc_state->exc_value) { - #if CYTHON_COMPILING_IN_PYPY + #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY #else PyObject *exc_tb; #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON @@ -30263,19 +28493,21 @@ PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, i __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); } #endif - self->is_running = 1; retval = self->body(self, tstate, value); - self->is_running = 0; #if CYTHON_USE_EXC_INFO_STACK exc_state = &self->gi_exc_state; tstate->exc_info = exc_state->previous_item; exc_state->previous_item = NULL; __Pyx_Coroutine_ResetFrameBackpointer(exc_state); #endif - return retval; + *result = retval; + if (self->resume_label == -1) { + return likely(retval) ? PYGEN_RETURN : PYGEN_ERROR; + } + return PYGEN_NEXT; } static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { -#if CYTHON_COMPILING_IN_PYPY +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(exc_state); #else PyObject *exc_tb; @@ -30295,24 +28527,22 @@ static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStr } #endif } -static CYTHON_INLINE -PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) { +#define __Pyx_Coroutine_MethodReturnFromResult(gen, result, retval, iternext)\ + ((result) == PYGEN_NEXT ? (retval) : __Pyx__Coroutine_MethodReturnFromResult(gen, result, retval, iternext)) +static PyObject * +__Pyx__Coroutine_MethodReturnFromResult(PyObject* gen, __Pyx_PySendResult result, PyObject *retval, int iternext) { CYTHON_MAYBE_UNUSED_VAR(gen); - if (unlikely(!retval)) { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - if (!__Pyx_PyErr_Occurred()) { - PyObject *exc = PyExc_StopIteration; - #ifdef __Pyx_AsyncGen_USED - if (__Pyx_AsyncGen_CheckExact(gen)) - exc = __Pyx_PyExc_StopAsyncIteration; - #endif - __Pyx_PyErr_SetNone(exc); - } + if (likely(result == PYGEN_RETURN)) { + int is_async = 0; + #ifdef __Pyx_AsyncGen_USED + is_async = __Pyx_AsyncGen_CheckExact(gen); + #endif + __Pyx_ReturnWithStopIteration(retval, is_async, iternext); + Py_XDECREF(retval); } - return retval; + return NULL; } -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) +#if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { #if PY_VERSION_HEX <= 0x030A00A1 @@ -30349,25 +28579,58 @@ PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { #endif } #endif -static CYTHON_INLINE -PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { - PyObject *ret; +static CYTHON_INLINE __Pyx_PySendResult +__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen, PyObject** retval) { + __Pyx_PySendResult result; PyObject *val = NULL; + assert(__Pyx_Coroutine_get_is_running(gen)); __Pyx_Coroutine_Undelegate(gen); __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); - ret = __Pyx_Coroutine_SendEx(gen, val, 0); + result = __Pyx_Coroutine_SendEx(gen, val, retval, 0); Py_XDECREF(val); - return ret; + return result; +} +#if CYTHON_USE_AM_SEND +static __Pyx_PySendResult +__Pyx_Coroutine_SendToDelegate(__pyx_CoroutineObject *gen, __Pyx_pyiter_sendfunc gen_am_send, PyObject *value, PyObject **retval) { + PyObject *ret = NULL; + __Pyx_PySendResult delegate_result, result; + assert(__Pyx_Coroutine_get_is_running(gen)); + delegate_result = gen_am_send(gen->yieldfrom, value, &ret); + if (delegate_result == PYGEN_NEXT) { + assert (ret != NULL); + *retval = ret; + return PYGEN_NEXT; + } + assert (delegate_result != PYGEN_ERROR || ret == NULL); + __Pyx_Coroutine_Undelegate(gen); + result = __Pyx_Coroutine_SendEx(gen, ret, retval, 0); + Py_XDECREF(ret); + return result; } +#endif static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { - PyObject *retval; + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_AmSend(self, value, &retval); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0); +} +static __Pyx_PySendResult +__Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval) { + __Pyx_PySendResult result; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) - return __Pyx_Coroutine_AlreadyRunningError(gen); - if (yf) { + if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { + *retval = __Pyx_Coroutine_AlreadyRunningError(gen); + return PYGEN_ERROR; + } + #if CYTHON_USE_AM_SEND + if (gen->yieldfrom_am_send) { + result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, value, retval); + } else + #endif + if (gen->yieldfrom) { + PyObject *yf = gen->yieldfrom; PyObject *ret; - gen->is_running = 1; + #if !CYTHON_USE_AM_SEND #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, value); @@ -30383,66 +28646,67 @@ static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { ret = __Pyx_async_gen_asend_send(yf, value); } else #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + #if CYTHON_COMPILING_IN_CPYTHON if (PyGen_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else - #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyCoro_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif + #endif { - if (value == Py_None) - ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + #if !CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x03080000 + if (value == Py_None && PyIter_Check(yf)) + ret = __Pyx_PyIter_Next_Plain(yf); else - ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); + #endif + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_mstate_global->__pyx_n_u_send, value); } - gen->is_running = 0; if (likely(ret)) { - return ret; + __Pyx_Coroutine_unset_is_running(gen); + *retval = ret; + return PYGEN_NEXT; } - retval = __Pyx_Coroutine_FinishDelegation(gen); + result = __Pyx_Coroutine_FinishDelegation(gen, retval); } else { - retval = __Pyx_Coroutine_SendEx(gen, value, 0); + result = __Pyx_Coroutine_SendEx(gen, value, retval, 0); } - return __Pyx_Coroutine_MethodReturn(self, retval); + __Pyx_Coroutine_unset_is_running(gen); + return result; } static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { + __Pyx_PySendResult result; PyObject *retval = NULL; - int err = 0; + CYTHON_UNUSED_VAR(gen); + assert(__Pyx_Coroutine_get_is_running(gen)); #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; + result = __Pyx_Coroutine_Close(yf, &retval); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; + result = __Pyx_Coroutine_Close(yf, &retval); } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { - retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); - if (!retval) - return -1; + result = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf); } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { retval = __Pyx_async_gen_asend_close(yf, NULL); + result = PYGEN_RETURN; } else if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { retval = __Pyx_async_gen_athrow_close(yf, NULL); + result = PYGEN_RETURN; } else #endif { PyObject *meth; - gen->is_running = 1; - meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close); + result = PYGEN_RETURN; + meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_close); if (unlikely(!meth)) { if (unlikely(PyErr_Occurred())) { PyErr_WriteUnraisable(yf); @@ -30450,57 +28714,77 @@ static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { } else { retval = __Pyx_PyObject_CallNoArg(meth); Py_DECREF(meth); - if (unlikely(!retval)) - err = -1; + if (unlikely(!retval)) { + result = PYGEN_ERROR; + } } - gen->is_running = 0; } Py_XDECREF(retval); - return err; + return result == PYGEN_ERROR ? -1 : 0; } static PyObject *__Pyx_Generator_Next(PyObject *self) { + __Pyx_PySendResult result; + PyObject *retval = NULL; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) + if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { return __Pyx_Coroutine_AlreadyRunningError(gen); - if (yf) { + } + #if CYTHON_USE_AM_SEND + if (gen->yieldfrom_am_send) { + result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, Py_None, &retval); + } else + #endif + if (gen->yieldfrom) { + PyObject *yf = gen->yieldfrom; PyObject *ret; - gen->is_running = 1; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Generator_Next(yf); } else #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) - if (PyGen_CheckExact(yf)) { - ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); - } else - #endif #ifdef __Pyx_Coroutine_USED - if (__Pyx_Coroutine_Check(yf)) { + if (__Pyx_Coroutine_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, Py_None); } else #endif - ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); - gen->is_running = 0; + #if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX < 0x030A00A3 || !CYTHON_USE_AM_SEND) + if (PyGen_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); + } else + #endif + ret = __Pyx_PyIter_Next_Plain(yf); if (likely(ret)) { + __Pyx_Coroutine_unset_is_running(gen); return ret; } - return __Pyx_Coroutine_FinishDelegation(gen); + result = __Pyx_Coroutine_FinishDelegation(gen, &retval); + } else { + result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0); } - return __Pyx_Coroutine_SendEx(gen, Py_None, 0); + __Pyx_Coroutine_unset_is_running(gen); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 1); } static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) { + PyObject *retval = NULL; + __Pyx_PySendResult result; CYTHON_UNUSED_VAR(arg); - return __Pyx_Coroutine_Close(self); + result = __Pyx_Coroutine_Close(self, &retval); + if (unlikely(result == PYGEN_ERROR)) + return NULL; + Py_XDECREF(retval); + Py_RETURN_NONE; } -static PyObject *__Pyx_Coroutine_Close(PyObject *self) { +static __Pyx_PySendResult +__Pyx_Coroutine_Close(PyObject *self, PyObject **retval) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject *retval, *raised_exception; - PyObject *yf = gen->yieldfrom; + __Pyx_PySendResult result; + PyObject *yf; int err = 0; - if (unlikely(gen->is_running)) - return __Pyx_Coroutine_AlreadyRunningError(gen); + if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { + *retval = __Pyx_Coroutine_AlreadyRunningError(gen); + return PYGEN_ERROR; + } + yf = gen->yieldfrom; if (yf) { Py_INCREF(yf); err = __Pyx_Coroutine_CloseIter(gen, yf); @@ -30509,10 +28793,25 @@ static PyObject *__Pyx_Coroutine_Close(PyObject *self) { } if (err == 0) PyErr_SetNone(PyExc_GeneratorExit); - retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); - if (unlikely(retval)) { + result = __Pyx_Coroutine_SendEx(gen, NULL, retval, 1); + if (result == PYGEN_ERROR) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_Coroutine_unset_is_running(gen); + if (!__Pyx_PyErr_Occurred()) { + return PYGEN_RETURN; + } else if (likely(__Pyx_PyErr_ExceptionMatches2(PyExc_GeneratorExit, PyExc_StopIteration))) { + __Pyx_PyErr_Clear(); + return PYGEN_RETURN; + } + return PYGEN_ERROR; + } else if (likely(result == PYGEN_RETURN && *retval == Py_None)) { + __Pyx_Coroutine_unset_is_running(gen); + return PYGEN_RETURN; + } else { const char *msg; - Py_DECREF(retval); + Py_DECREF(*retval); + *retval = NULL; if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check(self)) { @@ -30520,33 +28819,25 @@ static PyObject *__Pyx_Coroutine_Close(PyObject *self) { #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(self)) { -#if PY_VERSION_HEX < 0x03060000 - msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; -#else msg = "async generator ignored GeneratorExit"; -#endif #endif } else { msg = "generator ignored GeneratorExit"; } PyErr_SetString(PyExc_RuntimeError, msg); - return NULL; - } - raised_exception = PyErr_Occurred(); - if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { - if (raised_exception) PyErr_Clear(); - Py_INCREF(Py_None); - return Py_None; + __Pyx_Coroutine_unset_is_running(gen); + return PYGEN_ERROR; } - return NULL; } static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, PyObject *args, int close_on_genexit) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) + PyObject *yf; + if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) return __Pyx_Coroutine_AlreadyRunningError(gen); + yf = gen->yieldfrom; if (yf) { + __Pyx_PySendResult result; PyObject *ret; Py_INCREF(yf); if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { @@ -30554,10 +28845,9 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject Py_DECREF(yf); __Pyx_Coroutine_Undelegate(gen); if (err < 0) - return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); + goto propagate_exception; goto throw_here; } - gen->is_running = 1; if (0 #ifdef __Pyx_Generator_USED || __Pyx_Generator_CheckExact(yf) @@ -30572,15 +28862,14 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); #endif } else { - PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw); + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_throw); if (unlikely(!meth)) { Py_DECREF(yf); if (unlikely(PyErr_Occurred())) { - gen->is_running = 0; + __Pyx_Coroutine_unset_is_running(gen); return NULL; } __Pyx_Coroutine_Undelegate(gen); - gen->is_running = 0; goto throw_here; } if (likely(args)) { @@ -30591,22 +28880,30 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject } Py_DECREF(meth); } - gen->is_running = 0; Py_DECREF(yf); - if (!ret) { - ret = __Pyx_Coroutine_FinishDelegation(gen); + if (ret) { + __Pyx_Coroutine_unset_is_running(gen); + return ret; } - return __Pyx_Coroutine_MethodReturn(self, ret); + result = __Pyx_Coroutine_FinishDelegation(gen, &ret); + __Pyx_Coroutine_unset_is_running(gen); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, ret, 0); } throw_here: __Pyx_Raise(typ, val, tb, NULL); - return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); +propagate_exception: + { + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, NULL, &retval, 0); + __Pyx_Coroutine_unset_is_running(gen); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0); + } } static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { PyObject *typ; PyObject *val = NULL; PyObject *tb = NULL; - if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))) + if (unlikely(!PyArg_UnpackTuple(args, "throw", 1, 3, &typ, &val, &tb))) return NULL; return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); } @@ -30621,6 +28918,10 @@ static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct * return 0; } static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { + { + int e = __Pyx_call_type_traverse((PyObject*)gen, 1, visit, arg); + if (e) return e; + } Py_VISIT(gen->closure); Py_VISIT(gen->classobj); Py_VISIT(gen->yieldfrom); @@ -30630,7 +28931,7 @@ static int __Pyx_Coroutine_clear(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; Py_CLEAR(gen->closure); Py_CLEAR(gen->classobj); - Py_CLEAR(gen->yieldfrom); + __Pyx_Coroutine_Undelegate(gen); __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { @@ -30651,10 +28952,13 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) { PyObject_ClearWeakRefs(self); if (gen->resume_label >= 0) { PyObject_GC_Track(self); -#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE +#if CYTHON_USE_TP_FINALIZE if (unlikely(PyObject_CallFinalizerFromDealloc(self))) #else - Py_TYPE(gen)->tp_del(self); + { + destructor del = __Pyx_PyObject_GetSlot(gen, tp_del, destructor); + if (del) del(self); + } if (unlikely(Py_REFCNT(self) > 0)) #endif { @@ -30673,6 +28977,7 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) { __Pyx_Coroutine_clear(self); __Pyx_PyHeapTypeObject_GC_Del(gen); } +#if CYTHON_USE_TP_FINALIZE static void __Pyx_Coroutine_del(PyObject *self) { PyObject *error_type, *error_value, *error_traceback; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; @@ -30680,10 +28985,6 @@ static void __Pyx_Coroutine_del(PyObject *self) { if (gen->resume_label < 0) { return; } -#if !CYTHON_USE_TP_FINALIZE - assert(self->ob_refcnt == 0); - __Pyx_SET_REFCNT(self, 1); -#endif __Pyx_PyThreadState_assign __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); #ifdef __Pyx_AsyncGen_USED @@ -30709,66 +29010,23 @@ static void __Pyx_Coroutine_del(PyObject *self) { #endif { PyObject_GC_UnTrack(self); -#if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) PyErr_WriteUnraisable(self); -#else - {PyObject *msg; - char *cmsg; - #if CYTHON_COMPILING_IN_PYPY - msg = NULL; - cmsg = (char*) "coroutine was never awaited"; - #else - char *cname; - PyObject *qualname; - qualname = gen->gi_qualname; - cname = PyString_AS_STRING(qualname); - msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); - if (unlikely(!msg)) { - PyErr_Clear(); - cmsg = (char*) "coroutine was never awaited"; - } else { - cmsg = PyString_AS_STRING(msg); - } - #endif - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) - PyErr_WriteUnraisable(self); - Py_XDECREF(msg);} -#endif PyObject_GC_Track(self); } #endif } else { - PyObject *res = __Pyx_Coroutine_Close(self); - if (unlikely(!res)) { - if (PyErr_Occurred()) - PyErr_WriteUnraisable(self); + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_Close(self, &retval); + if (result == PYGEN_ERROR) { + PyErr_WriteUnraisable(self); } else { - Py_DECREF(res); + Py_XDECREF(retval); } } __Pyx_ErrRestore(error_type, error_value, error_traceback); -#if !CYTHON_USE_TP_FINALIZE - assert(Py_REFCNT(self) > 0); - if (likely(--self->ob_refcnt == 0)) { - return; - } - { - Py_ssize_t refcnt = Py_REFCNT(self); - _Py_NewReference(self); - __Pyx_SET_REFCNT(self, refcnt); - } -#if CYTHON_COMPILING_IN_CPYTHON - assert(PyType_IS_GC(Py_TYPE(self)) && - _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); - _Py_DEC_REFTOTAL; -#endif -#ifdef COUNT_ALLOCS - --Py_TYPE(self)->tp_frees; - --Py_TYPE(self)->tp_allocs; -#endif -#endif } +#endif static PyObject * __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context) { @@ -30782,12 +29040,7 @@ static int __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; @@ -30809,12 +29062,7 @@ static int __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; @@ -30824,26 +29072,53 @@ __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void return 0; } static PyObject * -__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) +__Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self) { - PyObject *frame = self->gi_frame; - CYTHON_UNUSED_VAR(context); +#if !CYTHON_COMPILING_IN_LIMITED_API + PyObject *frame; + #if PY_VERSION_HEX >= 0x030d0000 + Py_BEGIN_CRITICAL_SECTION(self); + #endif + frame = self->gi_frame; if (!frame) { if (unlikely(!self->gi_code)) { Py_RETURN_NONE; } + PyObject *globals = PyDict_New(); + if (unlikely(!globals)) return NULL; frame = (PyObject *) PyFrame_New( PyThreadState_Get(), /*PyThreadState *tstate,*/ (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ + globals, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); + Py_DECREF(globals); if (unlikely(!frame)) return NULL; - self->gi_frame = frame; + if (unlikely(self->gi_frame)) { + Py_DECREF(frame); + frame = self->gi_frame; + } else { + self->gi_frame = frame; + } } Py_INCREF(frame); + #if PY_VERSION_HEX >= 0x030d0000 + Py_END_CRITICAL_SECTION(); + #endif return frame; +#else + CYTHON_UNUSED_VAR(self); + Py_RETURN_NONE; +#endif +} +static PyObject * +__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) { + CYTHON_UNUSED_VAR(context); + PyObject *frame = self->gi_frame; + if (frame) + return __Pyx_NewRef(frame); + return __Pyx__Coroutine_get_frame(self); } static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, @@ -30863,7 +29138,8 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( gen->resume_label = 0; gen->classobj = NULL; gen->yieldfrom = NULL; - #if PY_VERSION_HEX >= 0x030B00a4 + gen->yieldfrom_am_send = NULL; + #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_LIMITED_API gen->gi_exc_state.exc_value = NULL; #else gen->gi_exc_state.exc_type = NULL; @@ -30884,273 +29160,173 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( gen->gi_code = code; gen->gi_frame = NULL; PyObject_GC_Track(gen); - return gen; -} - -/* PatchModuleWithCoroutine */ - static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - int result; - PyObject *globals, *result_obj; - globals = PyDict_New(); if (unlikely(!globals)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_coroutine_type", - #ifdef __Pyx_Coroutine_USED - (PyObject*)__pyx_CoroutineType); - #else - Py_None); - #endif - if (unlikely(result < 0)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_generator_type", - #ifdef __Pyx_Generator_USED - (PyObject*)__pyx_GeneratorType); - #else - Py_None); - #endif - if (unlikely(result < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; - result_obj = PyRun_String(py_code, Py_file_input, globals, globals); - if (unlikely(!result_obj)) goto ignore; - Py_DECREF(result_obj); - Py_DECREF(globals); - return module; -ignore: - Py_XDECREF(globals); - PyErr_WriteUnraisable(module); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { - Py_DECREF(module); - module = NULL; - } -#else - py_code++; -#endif - return module; -} - -/* PatchGeneratorABC */ - #ifndef CYTHON_REGISTER_ABCS -#define CYTHON_REGISTER_ABCS 1 -#endif -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) -static PyObject* __Pyx_patch_abc_module(PyObject *module); -static PyObject* __Pyx_patch_abc_module(PyObject *module) { - module = __Pyx_Coroutine_patch_module( - module, "" -"if _cython_generator_type is not None:\n" -" try: Generator = _module.Generator\n" -" except AttributeError: pass\n" -" else: Generator.register(_cython_generator_type)\n" -"if _cython_coroutine_type is not None:\n" -" try: Coroutine = _module.Coroutine\n" -" except AttributeError: pass\n" -" else: Coroutine.register(_cython_coroutine_type)\n" - ); - return module; -} -#endif -static int __Pyx_patch_abc(void) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - static int abc_patched = 0; - if (CYTHON_REGISTER_ABCS && !abc_patched) { - PyObject *module; - module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); - if (unlikely(!module)) { - PyErr_WriteUnraisable(NULL); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, - ((PY_MAJOR_VERSION >= 3) ? - "Cython module failed to register with collections.abc module" : - "Cython module failed to register with collections module"), 1) < 0)) { - return -1; - } - } else { - module = __Pyx_patch_abc_module(module); - abc_patched = 1; - if (unlikely(!module)) - return -1; - Py_DECREF(module); - } - module = PyImport_ImportModule("backports_abc"); - if (module) { - module = __Pyx_patch_abc_module(module); - Py_XDECREF(module); - } - if (!module) { - PyErr_Clear(); - } - } -#else - if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); -#endif - return 0; -} - -/* Generator */ - static PyMethodDef __pyx_Generator_methods[] = { - {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, - (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, - {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, - (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, - {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, - (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, - {0, 0, 0, 0} -}; -static PyMemberDef __pyx_Generator_memberlist[] = { - {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, - {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, - (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, - {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, - {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, -#if CYTHON_USE_TYPE_SPECS - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, -#endif - {0, 0, 0, 0, 0} -}; -static PyGetSetDef __pyx_Generator_getsets[] = { - {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, - (char*) PyDoc_STR("name of the generator"), 0}, - {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, - (char*) PyDoc_STR("qualified name of the generator"), 0}, - {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, - (char*) PyDoc_STR("Frame of the generator"), 0}, - {0, 0, 0, 0, 0} -}; -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_GeneratorType_slots[] = { - {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc}, - {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse}, - {Py_tp_iter, (void *)PyObject_SelfIter}, - {Py_tp_iternext, (void *)__Pyx_Generator_Next}, - {Py_tp_methods, (void *)__pyx_Generator_methods}, - {Py_tp_members, (void *)__pyx_Generator_memberlist}, - {Py_tp_getset, (void *)__pyx_Generator_getsets}, - {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict}, -#if CYTHON_USE_TP_FINALIZE - {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, -#endif - {0, 0}, -}; -static PyType_Spec __pyx_GeneratorType_spec = { - __PYX_TYPE_MODULE_PREFIX "generator", - sizeof(__pyx_CoroutineObject), - 0, - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, - __pyx_GeneratorType_slots -}; -#else -static PyTypeObject __pyx_GeneratorType_type = { - PyVarObject_HEAD_INIT(0, 0) - __PYX_TYPE_MODULE_PREFIX "generator", - sizeof(__pyx_CoroutineObject), - 0, - (destructor) __Pyx_Coroutine_dealloc, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, - 0, - (traverseproc) __Pyx_Coroutine_traverse, - 0, - 0, - offsetof(__pyx_CoroutineObject, gi_weakreflist), - 0, - (iternextfunc) __Pyx_Generator_Next, - __pyx_Generator_methods, - __pyx_Generator_memberlist, - __pyx_Generator_getsets, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, -#if CYTHON_USE_TP_FINALIZE - 0, -#else - __Pyx_Coroutine_del, + 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 + result = gen->is_running; + gen->is_running = 1; + #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_END_CRITICAL_SECTION(); + #endif + 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 + assert(gen->is_running); + gen->is_running = 0; + #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_END_CRITICAL_SECTION(); + #endif +} +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 + result = gen->is_running; + #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_END_CRITICAL_SECTION(); + #endif + return result; +} +static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure) { + CYTHON_UNUSED_VAR(closure); + char result = __Pyx_Coroutine_get_is_running((__pyx_CoroutineObject*)gen); + if (result) Py_RETURN_TRUE; + else Py_RETURN_FALSE; +} +#if __PYX_HAS_PY_AM_SEND == 2 +static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send) { + Py_ssize_t ptr_offset = (char*)(type->tp_as_async) - (char*)type; + if (ptr_offset < 0 || ptr_offset > type->tp_basicsize) { + return; + } + memcpy((void*)static_amsend_methods, (void*)(type->tp_as_async), sizeof(*type->tp_as_async)); + static_amsend_methods->am_send = am_send; + type->tp_as_async = __Pyx_SlotTpAsAsync(static_amsend_methods); +} #endif - 0, + +/* Generator */ +static PyMethodDef __pyx_Generator_methods[] = { + {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, + PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, + {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, + PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, + {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, + PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, + {0, 0, 0, 0} +}; +static PyMemberDef __pyx_Generator_memberlist[] = { + {"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, + 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}, + {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, + {0, 0, 0, 0, 0} +}; +static PyGetSetDef __pyx_Generator_getsets[] = { + {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, + PyDoc_STR("name of the generator"), 0}, + {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, + PyDoc_STR("qualified name of the generator"), 0}, + {"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, + PyDoc_STR("Frame of the generator"), 0}, + {"gi_running", __Pyx_Coroutine_get_is_running_getter, NULL, NULL, NULL}, + {0, 0, 0, 0, 0} +}; +static PyType_Slot __pyx_GeneratorType_slots[] = { + {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc}, + {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse}, + {Py_tp_iter, (void *)PyObject_SelfIter}, + {Py_tp_iternext, (void *)__Pyx_Generator_Next}, + {Py_tp_methods, (void *)__pyx_Generator_methods}, + {Py_tp_members, (void *)__pyx_Generator_memberlist}, + {Py_tp_getset, (void *)__pyx_Generator_getsets}, + {Py_tp_getattro, (void *) PyObject_GenericGetAttr}, #if CYTHON_USE_TP_FINALIZE - __Pyx_Coroutine_del, -#elif PY_VERSION_HEX >= 0x030400a1 - 0, -#endif -#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, -#endif -#if __PYX_NEED_TP_PRINT_SLOT - 0, -#endif -#if PY_VERSION_HEX >= 0x030C0000 - 0, + {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, #endif -#if PY_VERSION_HEX >= 0x030d00A4 - 0, +#if __PYX_HAS_PY_AM_SEND == 1 + {Py_am_send, (void *)__Pyx_Coroutine_AmSend}, #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + {0, 0}, +}; +static PyType_Spec __pyx_GeneratorType_spec = { + __PYX_TYPE_MODULE_PREFIX "generator", + sizeof(__pyx_CoroutineObject), 0, +#if PY_VERSION_HEX >= 0x030A0000 + Py_TPFLAGS_IMMUTABLETYPE | #endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE | __Pyx_TPFLAGS_HAVE_AM_SEND, + __pyx_GeneratorType_slots }; +#if __PYX_HAS_PY_AM_SEND == 2 +static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async; #endif static int __pyx_Generator_init(PyObject *module) { -#if CYTHON_USE_TYPE_SPECS - __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); -#else - CYTHON_UNUSED_VAR(module); - __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; - __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; - __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); -#endif - if (unlikely(!__pyx_GeneratorType)) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); + mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); + if (unlikely(!mstate->__pyx_GeneratorType)) { return -1; } +#if __PYX_HAS_PY_AM_SEND == 2 + __Pyx_SetBackportTypeAmSend(mstate->__pyx_GeneratorType, &__pyx_Generator_as_async, &__Pyx_Coroutine_AmSend); +#endif return 0; } +static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *retval = NULL; + if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { + return __Pyx_Coroutine_AlreadyRunningError(gen); + } + __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0); + __Pyx_Coroutine_unset_is_running(gen); + (void) result; + assert (result == PYGEN_RETURN || result == PYGEN_ERROR); + assert ((result == PYGEN_RETURN && retval != NULL) || (result == PYGEN_ERROR && retval == NULL)); + return retval; +} -/* CheckBinaryVersion */ - static unsigned long __Pyx_get_runtime_version(void) { -#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 +/* GetRuntimeVersion */ +static unsigned long __Pyx_get_runtime_version(void) { +#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 return Py_Version & ~0xFFUL; #else - 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'); + 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; } - version += factor * digit; - if (rt_version[i] != '.') - break; - digit = 0; - factor >>= 8; - ++i; + __Pyx_cached_runtime_version = version; } - return 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; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) @@ -31173,45 +29349,165 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt } } -/* InitStrings */ - #if PY_MAJOR_VERSION >= 3 -static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { - if (t.is_unicode | t.is_str) { - if (t.intern) { - *str = PyUnicode_InternFromString(t.s); - } else if (t.encoding) { - *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); +/* NewCodeObj */ +#if CYTHON_COMPILING_IN_LIMITED_API + static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030b0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); } else { - *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } - } else { - *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; } - if (!*str) - return -1; - if (PyObject_Hash(*str) == -1) - return -1; - return 0; -} +#elif PY_VERSION_HEX >= 0x030B0000 + static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + 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); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !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 + #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION >= 3 - __Pyx_InitString(*t, t->p); - #else +static PyObject* __Pyx_PyCode_New( + const __Pyx_PyCode_New_function_description descr, + PyObject * const *varnames, + PyObject *filename, + PyObject *funcname, + const char *line_table, + PyObject *tuple_dedup_map +) { + PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_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; + for (Py_ssize_t i=0; i < var_count; i++) { + Py_INCREF(varnames[i]); + if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done; + } + #if CYTHON_COMPILING_IN_LIMITED_API + varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple); + if (!varnames_tuple_dedup) { + if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done; + varnames_tuple_dedup = varnames_tuple; + } + #else + varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple); + if (unlikely(!varnames_tuple_dedup)) goto done; + #endif + #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; + code_bytes = PyBytes_FromStringAndSize(NULL, code_len); + if (unlikely(!code_bytes)) goto done; + char* c_code_bytes = PyBytes_AsString(code_bytes); + if (unlikely(!c_code_bytes)) goto done; + memset(c_code_bytes, 0, (size_t) code_len); + } + code_obj = (PyObject*) __Pyx__PyCode_New( + (int) descr.argcount, + (int) descr.num_posonly_args, + (int) descr.num_kwonly_args, + (int) descr.nlocals, + 0, + (int) descr.flags, + code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + varnames_tuple_dedup, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + filename, + funcname, + (int) descr.first_line, + (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table_bytes) ? line_table_bytes : __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 + Py_DECREF(varnames_tuple); + 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) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); + 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 { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + str = PyBytes_FromStringAndSize(t->s, t->n - 1); } - if (!*t->p) + if (!str) return -1; - if (PyObject_Hash(*t->p) == -1) + *target = str; + if (PyObject_Hash(str) == -1) return -1; - #endif ++t; + ++target; } return 0; } @@ -31239,31 +29535,30 @@ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#if !CYTHON_PEP393_ENABLED -static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } + const char* result; + Py_ssize_t unicode_length; + CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 + if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL; + #else + result = PyUnicode_AsUTF8AndSize(o, length); + #endif + #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + unicode_length = PyUnicode_GetLength(o); + if (unlikely(unicode_length < 0)) return NULL; + if (unlikely(unicode_length != *length)) { + PyUnicode_AsASCIIString(o); + return NULL; } + #endif + return result; } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -} #else -static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); @@ -31275,25 +29570,25 @@ static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py #else return PyUnicode_AsUTF8AndSize(o, length); #endif -} #endif +} #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + if (PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif -#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { +#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))) *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); - } else +#else + *length = PyByteArray_Size(o); + if (*length == -1) return NULL; + return PyByteArray_AsString(o); #endif + } else { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); @@ -31316,9 +29611,8 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { Py_DECREF(x); return retval; } -static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { - __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); -#if PY_MAJOR_VERSION >= 3 +static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result)); if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " @@ -31332,74 +29626,44 @@ static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const __Pyx_DECREF_TypeName(result_type_name); return result; } -#endif PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", - type_name, type_name, result_type_name); + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")", + result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif - const char *name = NULL; PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x) || PyLong_Check(x))) -#else if (likely(PyLong_Check(x))) -#endif - return __Pyx_NewRef(x); + return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; - #if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = m->nb_int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = m->nb_long(x); - } - #else if (likely(m && m->nb_int)) { - name = "int"; - res = m->nb_int(x); + res = m->nb_int(x); } - #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { - res = PyNumber_Int(x); + res = PyNumber_Long(x); } #endif if (likely(res)) { -#if PY_MAJOR_VERSION < 3 - if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { -#else - if (unlikely(!PyLong_CheckExact(res))) { -#endif - return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); - } + if (unlikely(!PyLong_CheckExact(res))) { + return __Pyx_PyNumber_LongWrongResultType(res); + } } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); + PyErr_SetString(PyExc_TypeError, + "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(b); - } -#endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { @@ -31445,34 +29709,349 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { } x = PyNumber_Index(b); if (!x) return -1; - ival = PyInt_AsSsize_t(x); + ival = PyLong_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); -#if PY_MAJOR_VERSION < 3 - } else if (likely(PyInt_CheckExact(o))) { - return PyInt_AS_LONG(o); -#endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; - ival = PyInt_AsLong(x); + ival = PyLong_AsLong(x); Py_DECREF(x); return ival; } } +static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) { + CYTHON_UNUSED_VAR(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); } -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { + return PyLong_FromSize_t(ival); +} + + +/* MultiPhaseInitModuleState */ +#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE +#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000) + #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1 +#else + #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0 +#endif +#endif +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS +#error "Module state with PEP489 requires atomics. Currently that's one of\ + C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics" +#endif +#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +#define __Pyx_ModuleStateLookup_Lock() +#define __Pyx_ModuleStateLookup_Unlock() +#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000 +static PyMutex __Pyx_ModuleStateLookup_mutex = {0}; +#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(__cplusplus) && __cplusplus >= 201103L +#include +static std::mutex __Pyx_ModuleStateLookup_mutex; +#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock() +#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock() +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__) +#include +static mtx_t __Pyx_ModuleStateLookup_mutex; +static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT; +static void __Pyx_ModuleStateLookup_initialize_mutex(void) { + mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain); +} +#define __Pyx_ModuleStateLookup_Lock()\ + call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\ + mtx_lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(HAVE_PTHREAD_H) +#include +static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER; +#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(_WIN32) +#include // synchapi.h on its own doesn't work +static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT; +#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) +#else +#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\ + Requires C standard >= C11, or C++ standard >= C++11,\ + or pthreads, or the Windows 32 API, or Python >= 3.13." +#endif +typedef struct { + int64_t id; + PyObject *module; +} __Pyx_InterpreterIdAndModule; +typedef struct { + char interpreter_id_as_index; + Py_ssize_t count; + Py_ssize_t allocated; + __Pyx_InterpreterIdAndModule table[1]; +} __Pyx_ModuleStateLookupData; +#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32 +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0; +#endif +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0; +#else +static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL; +#endif +static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound( + __Pyx_InterpreterIdAndModule* table, + Py_ssize_t count, + int64_t interpreterId) { + __Pyx_InterpreterIdAndModule* begin = table; + __Pyx_InterpreterIdAndModule* end = begin + count; + if (begin->id == interpreterId) { + return begin; + } + while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { + __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2; + if (halfway->id == interpreterId) { + return halfway; + } + if (halfway->id < interpreterId) { + begin = halfway; + } else { + end = halfway; + } + } + for (; begin < end; ++begin) { + if (begin->id >= interpreterId) return begin; + } + return begin; +} +static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return NULL; +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); + { + __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); + if (likely(data)) { + __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data); + if (likely(data == new_data)) { + goto read_finished; + } + } + __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); + __Pyx_ModuleStateLookup_Lock(); + __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter); + data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); + __Pyx_ModuleStateLookup_Unlock(); + } + read_finished:; +#else + __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data; +#endif + __Pyx_InterpreterIdAndModule* found = NULL; + if (unlikely(!data)) goto end; + if (data->interpreter_id_as_index) { + if (interpreter_id < data->count) { + found = data->table+interpreter_id; + } + } else { + found = __Pyx_State_FindModuleStateLookupTableLowerBound( + data->table, data->count, interpreter_id); + } + end: + { + PyObject *result=NULL; + if (found && found->id == interpreter_id) { + result = found->module; + } +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); +#endif + return result; + } } - +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) { + while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0); +} +#else +#define __Pyx_ModuleStateLookup_wait_until_no_readers() +#endif +static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) { + Py_ssize_t to_allocate = (*old_data)->allocated; + while (to_allocate <= interpreter_id) { + if (to_allocate == 0) to_allocate = 1; + else to_allocate *= 2; + } + __Pyx_ModuleStateLookupData *new_data = *old_data; + if (to_allocate != (*old_data)->allocated) { + new_data = (__Pyx_ModuleStateLookupData *)realloc( + *old_data, + sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); + if (!new_data) { + PyErr_NoMemory(); + return -1; + } + for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) { + new_data->table[i].id = i; + new_data->table[i].module = NULL; + } + new_data->allocated = to_allocate; + } + new_data->table[interpreter_id].module = module; + if (new_data->count < interpreter_id+1) { + new_data->count = interpreter_id+1; + } + *old_data = new_data; + return 0; +} +static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) { + __Pyx_InterpreterIdAndModule *read = data->table; + __Pyx_InterpreterIdAndModule *write = data->table; + __Pyx_InterpreterIdAndModule *end = read + data->count; + for (; readmodule) { + write->id = read->id; + write->module = read->module; + ++write; + } + } + data->count = write - data->table; + for (; writeid = 0; + write->module = NULL; + } + data->interpreter_id_as_index = 0; +} +static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return -1; + int result = 0; + __Pyx_ModuleStateLookup_Lock(); +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *) + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); +#else + __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data; +#endif + __Pyx_ModuleStateLookupData *new_data = old_data; + if (!new_data) { + new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData)); + if (!new_data) { + result = -1; + PyErr_NoMemory(); + goto end; + } + new_data->allocated = 1; + new_data->interpreter_id_as_index = 1; + } + __Pyx_ModuleStateLookup_wait_until_no_readers(); + if (new_data->interpreter_id_as_index) { + if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { + result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id); + goto end; + } + __Pyx_State_ConvertFromInterpIdAsIndex(new_data); + } + { + Py_ssize_t insert_at = 0; + { + __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( + new_data->table, new_data->count, interpreter_id); + assert(lower_bound); + insert_at = lower_bound - new_data->table; + if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) { + lower_bound->module = module; + goto end; // already in table, nothing more to do + } + } + if (new_data->count+1 >= new_data->allocated) { + Py_ssize_t to_allocate = (new_data->count+1)*2; + new_data = + (__Pyx_ModuleStateLookupData*)realloc( + new_data, + sizeof(__Pyx_ModuleStateLookupData) + + (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); + if (!new_data) { + result = -1; + new_data = old_data; + PyErr_NoMemory(); + goto end; + } + new_data->allocated = to_allocate; + } + ++new_data->count; + int64_t last_id = interpreter_id; + PyObject *last_module = module; + for (Py_ssize_t i=insert_at; icount; ++i) { + int64_t current_id = new_data->table[i].id; + new_data->table[i].id = last_id; + last_id = current_id; + PyObject *current_module = new_data->table[i].module; + new_data->table[i].module = last_module; + last_module = current_module; + } + } + end: +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data); +#else + __Pyx_ModuleStateLookup_data = new_data; +#endif + __Pyx_ModuleStateLookup_Unlock(); + return result; +} +static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return -1; + __Pyx_ModuleStateLookup_Lock(); +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *) + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); +#else + __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data; +#endif + if (data->interpreter_id_as_index) { + if (interpreter_id < data->count) { + data->table[interpreter_id].module = NULL; + } + goto done; + } + { + __Pyx_ModuleStateLookup_wait_until_no_readers(); + __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( + data->table, data->count, interpreter_id); + if (!lower_bound) goto done; + if (lower_bound->id != interpreter_id) goto done; + __Pyx_InterpreterIdAndModule *end = data->table+data->count; + for (;lower_boundid = (lower_bound+1)->id; + lower_bound->module = (lower_bound+1)->module; + } + } + --data->count; + if (data->count == 0) { + free(data); + data = NULL; + } + done: +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data); +#else + __Pyx_ModuleStateLookup_data = data; +#endif + __Pyx_ModuleStateLookup_Unlock(); + return 0; +} +#endif /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER From c5421cb621ecef4316fe0ac392ca1900b2d21bd3 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Fri, 30 May 2025 19:33:55 +0200 Subject: [PATCH 10/87] Amended changelog and bumped version --- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1da6ae..41d9fb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ 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.3.0 + +- Released: TBD +- Issues / Enhancements: + - Python-Constraint now has an entirely new type of built-in constraints, allowing comparisons with variables on both sides to be evaluated much more efficiently. + - Tests have been extended to reflect changes. + - Various minor bugs have been resolved. + ### Version 2.2.0 - Released: 2025-03-25 diff --git a/pyproject.toml b/pyproject.toml index fc735aa..ca30069 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ 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.2.3" # adhere to PEP440 versioning: https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#id55 +version = "2.3.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"}, From 225866ba4c59dc3f55cd6b55ee040311f9d14b2e Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Fri, 30 May 2025 19:34:38 +0200 Subject: [PATCH 11/87] Extended tests to test for VariableExactSumConstraint --- tests/test_parser.py | 13 ++++++++++--- tests/test_solvers.py | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/tests/test_parser.py b/tests/test_parser.py index 96c6852..cbb8551 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -1,4 +1,4 @@ -from constraint import compile_to_constraints, parse_restrictions, Constraint, FunctionConstraint, CompilableFunctionConstraint, MinProdConstraint, MaxProdConstraint +from constraint import compile_to_constraints, parse_restrictions, Constraint, FunctionConstraint, CompilableFunctionConstraint, MinProdConstraint, MaxProdConstraint, ExactSumConstraint, VariableExactSumConstraint from collections.abc import Iterable def test_parse_restrictions(): @@ -37,8 +37,15 @@ def test_parse_restrictions(): def test_compile_to_constraints(): domains = {"x": [50, 100], "y": [0, 1]} - constraints = ["x != 320", "y == 0 or x % 32 != 0", "50 <= x * y < 100"] - expected_constraint_types = [FunctionConstraint, FunctionConstraint, MinProdConstraint, MaxProdConstraint] + constraints = ["x != 320", "y == 0 or x % 32 != 0", "50 <= x * y < 100", "x == 100", "x == x+y"] + expected_constraint_types = [ + FunctionConstraint, + FunctionConstraint, + MinProdConstraint, + MaxProdConstraint, + ExactSumConstraint, + VariableExactSumConstraint, + ] compiled = compile_to_constraints(constraints, domains, picklable=False) for r, vals, r_str in compiled: diff --git a/tests/test_solvers.py b/tests/test_solvers.py index df80f52..af1228b 100644 --- a/tests/test_solvers.py +++ b/tests/test_solvers.py @@ -133,3 +133,43 @@ def test_parallel_solver_process_mode(): problem.addConstraint(FunctionConstraint(lambda x, y: 1 <= x * y <= 2)) 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()] + base_solution = None + # variables = ['A','B','E','F','G','H','M'] + variables = ['B','E','G'] + + def create_problem(solver): + print(f"Creating problem with solver: {solver}") + problem = Problem(solver) + values = range(10, 200) + problem.addVariables(variables.copy(), values) + # problem.addConstraint("H == 10*A-491") + problem.addConstraint("B == E+G") + # problem.addConstraint("G == B-M") + # problem.addConstraint("H == F*F") + # problem.addConstraint("M == 351-2*E") + return problem + + for solver in solvers: + problem = create_problem(solver) + if isinstance(solver, MinConflictsSolver): + assert base_solution is not None, "Base solution must be defined before using MinConflictsSolver" + solution = problem.getSolution() # MinConflictsSolver provides only one solution + # check that the solution is in the list of possible solutions + assert solution is not None, f"No solution found for {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}" + + # Check consistency with the base solution + if base_solution is None: + 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 From 70ec6214f01efaa566d38b71566bb45c471f9b0b Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Wed, 4 Jun 2025 15:58:12 +0200 Subject: [PATCH 12/87] Implemented a VariableMinSumConstraint --- constraint/constraints.py | 71 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/constraint/constraints.py b/constraint/constraints.py index c864cd4..bf3bb6d 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -608,6 +608,77 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar sum = round(sum, 10) return sum >= minsum +class VariableMinSumConstraint(Constraint): + """Constraint enforcing that the sum of variables sum at least to the value of another variable. + + Example: + >>> problem = Problem() + >>> problem.addVariables(["a", "b", "c"], [1, 2, 3]) + >>> problem.addConstraint(VariableMinSumConstraint('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)]] + """ + + def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): + """Initialization method. + + Args: + target_var (Variable): The target variable to sum to. + sum_vars (sequence of Variables): The variables to sum up. + multipliers (sequence of numbers): If given, variable values + (except the last) will be multiplied by the given factors before being + summed to match the last variable. + """ + self.target_var = target_var + self.sum_vars = sum_vars + 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." + 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) + + multipliers = self._multipliers + + 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) + 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) + + def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + multipliers = self._multipliers + + if self.target_var not in assignments: + return True # can't evaluate without target, defer to later + + target_value = assignments[self.target_var] + sum_value = 0 + + if multipliers: + 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 + else: + 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 + + if isinstance(sum_value, float): + sum_value = round(sum_value, 10) + + return sum_value >= target_value + class MaxProdConstraint(Constraint): """Constraint enforcing that values of given variables create a product up to at most a given amount.""" From 15c207a15c251621b88f40bd85b91315487b754a Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Thu, 5 Jun 2025 17:59:33 +0200 Subject: [PATCH 13/87] Updated doctest solution --- constraint/constraints.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/constraint/constraints.py b/constraint/constraints.py index bf3bb6d..7c7d1a5 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -613,10 +613,10 @@ class VariableMinSumConstraint(Constraint): Example: >>> problem = Problem() - >>> problem.addVariables(["a", "b", "c"], [1, 2, 3]) + >>> problem.addVariables(["a", "b", "c"], [1, 4]) >>> problem.addConstraint(VariableMinSumConstraint('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)]] + [[('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)]] """ def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): From 6843eebb394a92488d92b4bf1be695336fb92b84 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Thu, 5 Jun 2025 18:21:57 +0200 Subject: [PATCH 14/87] Implemented the VariableMaxSumConstraint --- constraint/constraints.py | 71 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/constraint/constraints.py b/constraint/constraints.py index 7c7d1a5..08c9e6e 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -646,7 +646,6 @@ def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple 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) 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]): @@ -679,6 +678,76 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar return sum_value >= target_value +class VariableMaxSumConstraint(Constraint): + """Constraint enforcing that the sum of variables sum at most to the value of another variable. + + Example: + >>> problem = Problem() + >>> problem.addVariables(["a", "b", "c"], [1, 3, 4]) + >>> 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)]] + """ + + def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): + """Initialization method. + + Args: + target_var (Variable): The target variable to sum to. + sum_vars (sequence of Variables): The variables to sum up. + multipliers (sequence of numbers): If given, variable values + (except the last) will be multiplied by the given factors before being + summed to match the last variable. + """ + self.target_var = target_var + self.sum_vars = sum_vars + 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." + 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) + + multipliers = self._multipliers + + 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[:]: + 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 + multipliers = self._multipliers + + if self.target_var not in assignments: + return True # can't evaluate without target, defer to later + + target_value = assignments[self.target_var] + sum_value = 0 + + if multipliers: + 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 + else: + 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 + + if isinstance(sum_value, float): + sum_value = round(sum_value, 10) + + return sum_value <= target_value + class MaxProdConstraint(Constraint): """Constraint enforcing that values of given variables create a product up to at most a given amount.""" From cdf2a0c46af8545c243b7cf5765ed7c3035145c8 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Thu, 5 Jun 2025 18:22:25 +0200 Subject: [PATCH 15/87] Implemented parsing for the VariableMinSum and VariableMaxSum constraints --- constraint/parser.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/constraint/parser.py b/constraint/parser.py index be6269d..34441df 100644 --- a/constraint/parser.py +++ b/constraint/parser.py @@ -7,13 +7,15 @@ AllEqualConstraint, Constraint, ExactSumConstraint, - MaxProdConstraint, + MinSumConstraint, MaxSumConstraint, MinProdConstraint, - MinSumConstraint, + MaxProdConstraint, FunctionConstraint, CompilableFunctionConstraint, VariableExactSumConstraint, + VariableMinSumConstraint, + VariableMaxSumConstraint, # TODO implement parsing for these constraints: # InSetConstraint, # NotInSetConstraint, @@ -94,21 +96,23 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # 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 + # either the left or right side of the equation must evaluate to a constant number, otherwise we use a VariableConstraint 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, use the VariableConstraints + # if both sides are parameters, try to use the VariableConstraints variable_supported_operators = ['+'] variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] if all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): variables_on_left = len(right) == 1 if comparator == "==": - # if both sides are parameters, use the VariableExactSumConstraint - if variables_on_left: - return VariableExactSumConstraint(variables[-1], variables[:-1]) - else: - return VariableExactSumConstraint(variables[0], variables[1:]) + 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 + 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:]) # left_num and right_num can't be both None or both a constant return None From b75f2657d2f8e14685e10b8f02fa11d48941f800 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Thu, 5 Jun 2025 18:35:12 +0200 Subject: [PATCH 16/87] Extended multi-variable parsing to multiple operators --- constraint/parser.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/constraint/parser.py b/constraint/parser.py index 34441df..df1eec7 100644 --- a/constraint/parser.py +++ b/constraint/parser.py @@ -103,16 +103,20 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # if both sides are parameters, try to use the VariableConstraints variable_supported_operators = ['+'] variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] - if all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): + # find all unique variable_supported_operators in the restriction, can have at most one + unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) + # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None + if len(unique_operators) == 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): variables_on_left = len(right) == 1 - 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 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:]) + if 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 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:]) # left_num and right_num can't be both None or both a constant return None @@ -161,7 +165,7 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # check which operator is applied on the variables operator = operators_found[0] if not all(o == operator for o in operators_found): - # if the operator is inconsistent (e.g. 'x + y * z == 3'), return None + # if there is a mix of operators (e.g. 'x + y * z == 3'), return None return None # split the string on the comparison From 77b5ce60599915fe0f1179369394d9fc4d935614 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Thu, 5 Jun 2025 18:59:39 +0200 Subject: [PATCH 17/87] Added support for variable-only constraints where we have no operator --- constraint/parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/constraint/parser.py b/constraint/parser.py index df1eec7..c4fcb2b 100644 --- a/constraint/parser.py +++ b/constraint/parser.py @@ -106,9 +106,9 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # find all unique variable_supported_operators in the restriction, can have at most one unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None - if len(unique_operators) == 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): + if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): variables_on_left = len(right) == 1 - if unique_operators[0] == "+": + if unique_operators[0] == "+" or len(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 == "<=": From 5665342e4206c94f754b7505e5b66b766409f46f Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Sat, 7 Jun 2025 08:35:00 +0200 Subject: [PATCH 18/87] Implemented restriction rewriting from minus to summation --- constraint/parser.py | 35 ++++++++++++++++++++++++++++++++++- tests/test_parser.py | 3 ++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/constraint/parser.py b/constraint/parser.py index c4fcb2b..cf9f9ba 100644 --- a/constraint/parser.py +++ b/constraint/parser.py @@ -85,6 +85,39 @@ def to_numeric_constraint( # split the string on the comparison and remove leading and trailing whitespace left, right = tuple(s.strip() for s in restriction.split(comparator)) + # if we have an inverse operation, rewrite to the other side + supported_operators = ["**", "*", "+", "-", "/"] + unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) + unique_operators_right = set(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" + if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: + # if there are operators on both sides, we can't handle this yet + return None + 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_variable = re.search(regex_match_variable, left if variables_on_left else right) + if swapped_side_first_variable is None: + # if there is no variable on the left side, we can't handle this yet + raise ValueError(unique_operators_left, unique_operators_right, left, right) + return None + else: + swapped_side_first_variable = swapped_side_first_variable.group(0) + 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_variable):] + left_swap = right_remainder.replace("-", "+") + restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" + else: + # e.g. "B-M == G" becomes "B == G+M" + left_remainder = left[len(swapped_side_first_variable):] + right_swap = left_remainder.replace("-", "+") + restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" + + # we have a potentially rewritten restriction, split again + left, right = tuple(s.strip() for s in restriction.split(comparator)) + # find out which side is the constant number def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: try: @@ -108,7 +141,7 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): variables_on_left = len(right) == 1 - if unique_operators[0] == "+" or len(unique_operators) == 0: + if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": if comparator == "==": return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 elif comparator == "<=": diff --git a/tests/test_parser.py b/tests/test_parser.py index cbb8551..b7cf345 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -37,7 +37,7 @@ def test_parse_restrictions(): def test_compile_to_constraints(): domains = {"x": [50, 100], "y": [0, 1]} - constraints = ["x != 320", "y == 0 or x % 32 != 0", "50 <= x * y < 100", "x == 100", "x == x+y"] + constraints = ["x != 320", "y == 0 or x % 32 != 0", "50 <= x * y < 100", "x == 100", "x == x+y", "100 == x-y"] expected_constraint_types = [ FunctionConstraint, FunctionConstraint, @@ -45,6 +45,7 @@ def test_compile_to_constraints(): MaxProdConstraint, ExactSumConstraint, VariableExactSumConstraint, + ExactSumConstraint, ] compiled = compile_to_constraints(constraints, domains, picklable=False) From e56481054874eb2e405cd09ba1d4cd50ce87223d Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Sat, 7 Jun 2025 09:51:50 +0200 Subject: [PATCH 19/87] Implemented an ExactProdConstraint and improved MaxProdConstraint --- constraint/constraints.py | 86 ++++++++++++++++++++++++++++++++++++--- constraint/parser.py | 17 +++++++- 2 files changed, 95 insertions(+), 8 deletions(-) diff --git a/constraint/constraints.py b/constraint/constraints.py index 08c9e6e..cf1092d 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -749,6 +749,73 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar return sum_value <= target_value +class ExactProdConstraint(Constraint): + """Constraint enforcing that values of given variables create a product of exactly a given amount.""" + + def __init__(self, exactprod: Union[int, float]): + """Instantiate an ExactProdConstraint. + + Args: + exactprod: Value to be considered as the product + """ + self._exactprod = exactprod + + 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 values less than 1 in the associated variables + self._variable_contains_lt1: list[bool] = list() + 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): + if contains_lt1 is True: + if variable_with_lt1 is not None: + # if more than one associated variables contain less than 1, we can't prune + return + variable_with_lt1 = variable + + # 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: + continue + domain = domains[variable] + for value in domain[:]: + if value > exactprod: + 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 + exactprod = self._exactprod + prod = 1 + missing = False + missing_lt1 = False + for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + if variable in assignments: + prod *= assignments[variable] + else: + missing = True + if not missing_lt1: + missing_lt1 = contains_lt1 + if isinstance(prod, float): + prod = round(prod, 10) + if not missing and prod != exactprod or (not missing_lt1 and prod > exactprod): + return False + if forwardcheck and not missing_lt1: + for variable in variables: + if variable not in assignments: + domain = domains[variable] + for value in domain[:]: + if prod * value > exactprod: + domain.hideValue(value) + if not domain: + return False + return True + + class MaxProdConstraint(Constraint): """Constraint enforcing that values of given variables create a product up to at most a given amount.""" @@ -764,11 +831,12 @@ def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple Constraint.preProcess(self, variables, domains, constraints, vconstraints) # check if there are any values less than 1 in the associated variables - variable_contains_lt1: list[bool] = list() + self._variable_contains_lt1: list[bool] = list() variable_with_lt1 = None for variable in variables: contains_lt1 = any(value < 1 for value in domains[variable]) - variable_contains_lt1.append(contains_lt1) + self._variable_contains_lt1.append(contains_lt1) + for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): if contains_lt1 is True: if variable_with_lt1 is not None: # if more than one associated variables contain less than 1, we can't prune @@ -790,14 +858,20 @@ def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 maxprod = self._maxprod prod = 1 - for variable in variables: + missing = False + missing_lt1 = False + for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): if variable in assignments: prod *= assignments[variable] + else: + missing = True + if not missing_lt1: + missing_lt1 = contains_lt1 if isinstance(prod, float): prod = round(prod, 10) - if prod > maxprod: + if (not missing or not missing_lt1) and prod > maxprod: return False - if forwardcheck: + if forwardcheck and not missing_lt1: for variable in variables: if variable not in assignments: domain = domains[variable] @@ -823,7 +897,7 @@ def __init__(self, minprod: Union[int, float]): def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 Constraint.preProcess(self, variables, domains, constraints, vconstraints) - # prune the associated variables of values > maxprod + # prune the associated variables of values > minprod minprod = self._minprod for variable in variables: domain = domains[variable] diff --git a/constraint/parser.py b/constraint/parser.py index cf9f9ba..c1c19cc 100644 --- a/constraint/parser.py +++ b/constraint/parser.py @@ -9,6 +9,7 @@ ExactSumConstraint, MinSumConstraint, MaxSumConstraint, + ExactProdConstraint, MinProdConstraint, MaxProdConstraint, FunctionConstraint, @@ -99,7 +100,6 @@ def to_numeric_constraint( swapped_side_first_variable = re.search(regex_match_variable, left if variables_on_left else right) if swapped_side_first_variable is None: # if there is no variable on the left side, we can't handle this yet - raise ValueError(unique_operators_left, unique_operators_right, left, right) return None else: swapped_side_first_variable = swapped_side_first_variable.group(0) @@ -114,6 +114,17 @@ def to_numeric_constraint( left_remainder = left[len(swapped_side_first_variable):] right_swap = left_remainder.replace("-", "+") restriction = f"{swapped_side_first_variable}{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_variable):] + left_swap = right_remainder.replace("/", "*") + restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" + else: + # e.g. "B/M == G" becomes "B == G*M" + left_remainder = left[len(swapped_side_first_variable):] + right_swap = left_remainder.replace("/", "*") + restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" # we have a potentially rewritten restriction, split again left, right = tuple(s.strip() for s in restriction.split(comparator)) @@ -210,7 +221,9 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # power operations are not (yet) supported, added to avoid matching the double asterisk return None elif operator == "*": - if comparator == "<=" or (comparator == "<" and number_is_int): + if comparator == "==": + return ExactProdConstraint(number) + elif comparator == "<=" or (comparator == "<" and number_is_int): return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) elif comparator == ">=" or (comparator == ">" and number_is_int): return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) From 11ac44fb9b56f28c7fc8d691c5b63359ce357319 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Sun, 8 Jun 2025 13:53:41 +0200 Subject: [PATCH 20/87] Added docstring tests to constraints, moved and improved MaxSumConstraint --- constraint/constraints.py | 233 +++++++++++++++++++++----------------- 1 file changed, 129 insertions(+), 104 deletions(-) diff --git a/constraint/constraints.py b/constraint/constraints.py index cf1092d..757f9b1 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -274,105 +274,6 @@ def __call__( # noqa: D102 return True -class MaxSumConstraint(Constraint): - """Constraint enforcing that values of given variables sum up to a given amount. - - Example: - >>> problem = Problem() - >>> problem.addVariables(["a", "b"], [1, 2]) - >>> 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)]] - """ - - def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): - """Initialization method. - - Args: - maxsum (number): Value to be considered as the maximum sum - multipliers (sequence of numbers): If given, variable values - will be multiplied by the given factors before being - summed to be checked - """ - self._maxsum = maxsum - self._multipliers = multipliers - - 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 - 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) - - def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - multipliers = self._multipliers - maxsum = self._maxsum - sum = 0 - if multipliers: - for variable, multiplier in zip(variables, multipliers): - if variable in assignments: - sum += assignments[variable] * multiplier - if isinstance(sum, float): - sum = round(sum, 10) - if sum > maxsum: - return False - if forwardcheck: - for variable, multiplier in zip(variables, multipliers): - if variable not in assignments: - domain = domains[variable] - for value in domain[:]: - if sum + value * multiplier > maxsum: - domain.hideValue(value) - if not domain: - return False - else: - for variable in variables: - if variable in assignments: - sum += assignments[variable] - if isinstance(sum, float): - sum = round(sum, 10) - if sum > maxsum: - return False - if forwardcheck: - for variable in variables: - if variable not in assignments: - domain = domains[variable] - for value in domain[:]: - if sum + value > maxsum: - domain.hideValue(value) - if not domain: - return False - return True - - class ExactSumConstraint(Constraint): """Constraint enforcing that values of given variables sum exactly to a given amount. @@ -617,7 +518,7 @@ 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)]] - """ + """ # noqa: E501 def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): """Initialization method. @@ -678,6 +579,106 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar return sum_value >= target_value + +class MaxSumConstraint(Constraint): + """Constraint enforcing that values of given variables sum up to a given amount. + + Example: + >>> problem = Problem() + >>> problem.addVariables(["a", "b"], [1, 2]) + >>> 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)]] + """ + + def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): + """Initialization method. + + Args: + maxsum (number): Value to be considered as the maximum sum + multipliers (sequence of numbers): If given, variable values + will be multiplied by the given factors before being + summed to be checked + """ + self._maxsum = maxsum + self._multipliers = multipliers + + 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 + 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) + + def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + multipliers = self._multipliers + maxsum = self._maxsum + sum = 0 + if multipliers: + for variable, multiplier in zip(variables, multipliers): + if variable in assignments: + sum += assignments[variable] * multiplier + if isinstance(sum, float): + sum = round(sum, 10) + if sum > maxsum: + return False + if forwardcheck: + for variable, multiplier in zip(variables, multipliers): + if variable not in assignments: + domain = domains[variable] + for value in domain[:]: + if sum + value * multiplier > maxsum: + domain.hideValue(value) + if not domain: + return False + else: + for variable in variables: + if variable in assignments: + sum += assignments[variable] + if isinstance(sum, float): + sum = round(sum, 10) + if sum > maxsum: + return False + if forwardcheck: + for variable in variables: + if variable not in assignments: + domain = domains[variable] + for value in domain[:]: + if sum + value > maxsum: + domain.hideValue(value) + if not domain: + return False + return True + + class VariableMaxSumConstraint(Constraint): """Constraint enforcing that the sum of variables sum at most to the value of another variable. @@ -687,7 +688,7 @@ 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)]] - """ + """ # noqa: E501 def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): """Initialization method. @@ -750,7 +751,15 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar class ExactProdConstraint(Constraint): - """Constraint enforcing that values of given variables create a product of exactly a given amount.""" + """Constraint enforcing that values of given variables create a product of exactly a given amount. + + Example: + >>> problem = Problem() + >>> problem.addVariables(["a", "b"], [1, 2]) + >>> problem.addConstraint(ExactProdConstraint(2)) + >>> sorted(sorted(x.items()) for x in problem.getSolutions()) + [[('a', 1), ('b', 2)], [('a', 2), ('b', 1)]] + """ def __init__(self, exactprod: Union[int, float]): """Instantiate an ExactProdConstraint. @@ -817,7 +826,15 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar class MaxProdConstraint(Constraint): - """Constraint enforcing that values of given variables create a product up to at most a given amount.""" + """Constraint enforcing that values of given variables create a product up to at most a given amount. + + Example: + >>> problem = Problem() + >>> problem.addVariables(["a", "b"], [1, 2]) + >>> 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)]] + """ def __init__(self, maxprod: Union[int, float]): """Instantiate a MaxProdConstraint. @@ -884,7 +901,15 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar class MinProdConstraint(Constraint): - """Constraint enforcing that values of given variables create a product up to at least a given amount.""" + """Constraint enforcing that values of given variables create a product up to at least a given amount. + + Example: + >>> problem = Problem() + >>> problem.addVariables(["a", "b"], [1, 2]) + >>> 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)]] + """ def __init__(self, minprod: Union[int, float]): """Instantiate a MinProdConstraint. From e84c304ed3d23a46fd88d8cdbab0cae1724f7f41 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Sun, 8 Jun 2025 13:54:38 +0200 Subject: [PATCH 21/87] Recythonized and fixes for linting --- constraint/constraints.c | 27473 ++++++++++++++++++++++++------------- constraint/parser.c | 12518 ++++++++++------- constraint/parser.py | 6 +- 3 files changed, 25354 insertions(+), 14643 deletions(-) diff --git a/constraint/constraints.c b/constraint/constraints.c index 82eca75..1cde216 100644 --- a/constraint/constraints.c +++ b/constraint/constraints.c @@ -1496,11 +1496,18 @@ static const char* const __pyx_f[] = { /*--- Type declarations ---*/ struct __pyx_defaults; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr; -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr; -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr; -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_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_10_genexpr; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr; /* "constraint/constraints.py":63 * vconstraints[variable].remove((self, variables)) @@ -1515,58 +1522,108 @@ struct __pyx_defaults { }; -/* "constraint/constraints.py":307 - * 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":392 + * 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__genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; - PyObject *__pyx_v_value; + PyObject *__pyx_v_m; +}; + + +/* "constraint/constraints.py":395 + * 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_1_preProcess { + PyObject_HEAD + PyObject *__pyx_v_domains; + PyObject *__pyx_v_var; +}; + + +/* "constraint/constraints.py":409 + * 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[:]: +*/ +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr { + PyObject_HEAD + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess *__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 *); +}; + + +/* "constraint/constraints.py":410 + * 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]): +*/ +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr { + PyObject_HEAD + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess *__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 *); }; -/* "constraint/constraints.py":491 +/* "constraint/constraints.py":539 * 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_1_genexpr { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_m; }; -/* "constraint/constraints.py":494 +/* "constraint/constraints.py":542 * 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_2_preProcess { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess { PyObject_HEAD PyObject *__pyx_v_domains; PyObject *__pyx_v_var; }; -/* "constraint/constraints.py":508 +/* "constraint/constraints.py":550 * 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) + * 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]): */ -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr { PyObject_HEAD - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *__pyx_outer_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_v; PyObject *__pyx_t_0; @@ -1575,16 +1632,58 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr { }; -/* "constraint/constraints.py":509 +/* "constraint/constraints.py":613 + * 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":709 + * 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 { + PyObject_HEAD + PyObject *__pyx_genexpr_arg_0; + PyObject *__pyx_v_m; +}; + + +/* "constraint/constraints.py":712 + * 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 { + PyObject_HEAD + PyObject *__pyx_v_domains; + PyObject *__pyx_v_var; +}; + + +/* "constraint/constraints.py":720 + * 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) # <<<<<<<<<<<<<< + * 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_4_genexpr { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr { PyObject_HEAD - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *__pyx_outer_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_v; PyObject *__pyx_t_0; @@ -1593,14 +1692,28 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr { }; -/* "constraint/constraints.py":630 +/* "constraint/constraints.py":779 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< - * variable_contains_lt1.append(contains_lt1) - * if contains_lt1 is True: + * 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_11_genexpr { + PyObject_HEAD + PyObject *__pyx_genexpr_arg_0; + PyObject *__pyx_v_value; +}; + + +/* "constraint/constraints.py":854 + * 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_5_genexpr { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_value; @@ -2086,20 +2199,6 @@ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* s return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } -/* RaiseUnboundLocalError.proto */ -static void __Pyx_RaiseUnboundLocalError(const char *varname); - -/* GetException.proto */ -#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); -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); -#endif - -/* pep479.proto */ -static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); - /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) @@ -2147,6 +2246,20 @@ static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_ve static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif +/* RaiseUnboundLocalError.proto */ +static void __Pyx_RaiseUnboundLocalError(const char *varname); + +/* GetException.proto */ +#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); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* pep479.proto */ +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) static int __pyx_assertions_enabled_flag; @@ -2188,6 +2301,15 @@ static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *k #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif +/* PyObjectCallMethod1.proto */ +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); + +/* PyLongCompare.proto */ +static CYTHON_INLINE int __Pyx_PyLong_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); + /* 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 @@ -2497,9 +2619,6 @@ static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator); static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void); #endif -/* PyObjectCallMethod1.proto */ -static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); - /* ReturnWithStopIteration.proto */ static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext); @@ -2662,14 +2781,15 @@ static PyObject *__pyx_builtin_RuntimeError; 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_m[] = "m"; static const char __pyx_k_n[] = "n"; 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[] = "\250!"; -static const char __pyx_k__4[] = "\240\021"; +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_doc[] = "__doc__"; static const char __pyx_k_get[] = "get"; @@ -2709,6 +2829,7 @@ static const char __pyx_k_set_2[] = "_set"; 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_append[] = "append"; static const char __pyx_k_domain[] = "domain"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_func_2[] = "_func"; @@ -2743,6 +2864,7 @@ 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_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_maxprod_2[] = "_maxprod"; @@ -2763,6 +2885,8 @@ 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_exactprod_2[] = "_exactprod"; +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"; @@ -2796,10 +2920,11 @@ 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_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_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__"; @@ -2815,6 +2940,8 @@ 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__"; @@ -2825,6 +2952,8 @@ static const char __pyx_k_M_N_L_A_1_3a_Cs_Rs_J_b_3c[] = "\320\004#\240?\260*\270 static const char __pyx_k_NotInSetConstraint___call[] = "NotInSetConstraint.__call__"; static const char __pyx_k_NotInSetConstraint___init[] = "NotInSetConstraint.__init__"; 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__"; @@ -2843,14 +2972,17 @@ static const char __pyx_k_SomeNotInSetConstraint___call[] = "SomeNotInSetConstra static const char __pyx_k_SomeNotInSetConstraint___init[] = "SomeNotInSetConstraint.__init__"; 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_L_y_1_1A_QfA_5_q_5_1[] = "\320\004\"\320\"5\3205H\310\006\310a\330\010\022\220$\220a\330\010\017\210q\330\010\014\210L\230\001\330\014\017\210y\230\003\2301\330\020\030\230\013\2401\240A\330\010\013\210:\220Q\220f\230A\330\014\023\2205\230\001\230\026\230q\330\010\013\2105\220\002\220!\330\014\023\2201\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\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_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_D_q_a_J_c_T_y_1_1A_4q_QfA[] = "\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\2204\220q\330\024\"\240!\330\010\013\210:\220Q\220f\230A\330\014\023\2205\230\001\230\026\230q\330\010\013\2104\210x\220t\2305\240\003\240:\250T\260\024\260\\\300\024\300U\310\"\310A\330\014\023\2201\330\010\013\210=\230\004\230D\240\001\330\014\020\220\014\230A\330\020\023\2209\230G\2401\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_a_q_a_J_c_T_y_1_1A_4q_QfA[] = "\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\2204\220q\330\024\"\240!\330\010\013\210:\220Q\220f\230A\330\014\023\2205\230\001\230\026\230q\330\010\014\210D\220\010\230\003\2304\230}\250D\260\005\260R\260q\330\014\023\2201\330\010\013\210=\230\004\230D\240\001\330\014\020\220\014\230A\330\020\023\2209\230G\2401\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_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_1_A_L_gQ_Cq_WA_A[] = "\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\360\006\000\t1\260\001\330\010\034\230A\330\010\014\210L\230\001\330\014\036\230g\240Q\330\014!\240\027\250\001\250\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_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"; @@ -2858,6 +2990,11 @@ static const char __pyx_k_77JJeef_QfKy_Q_d_4q_1_1Kq_IV1_v[] = "\320\004$\320$7\3 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_VariableMaxSumConstraint___call[] = "VariableMaxSumConstraint.__call__"; +static const char __pyx_k_VariableMaxSumConstraint___init[] = "VariableMaxSumConstraint.__init__..genexpr"; +static const char __pyx_k_VariableMinSumConstraint___call[] = "VariableMinSumConstraint.__call__"; +static const char __pyx_k_VariableMinSumConstraint___init[] = "VariableMinSumConstraint.__init__..genexpr"; +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."; @@ -2868,6 +3005,7 @@ static const char __pyx_k_Constraint_enforcing_that_at_lea[] = "Constraint enfor 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."; @@ -2876,18 +3014,28 @@ static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note that Cython 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_VariableMaxSumConstraint_preProc[] = "VariableMaxSumConstraint.preProcess..genexpr"; +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_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 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_4[] = "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_5[] = "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_6[] = "Constraint enforcing that values of given variables create a product up to at most a given amount."; -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."; -static const char __pyx_k_Constraint_enforcing_that_values_8[] = "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_Constraint_enforcing_that_values_9[] = "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 "; +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 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_8[] = "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_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_VariableExactSumConstraint___ini_2[] = "VariableExactSumConstraint.__init__"; static const char __pyx_k_VariableExactSumConstraint_prePr_2[] = "VariableExactSumConstraint.preProcess"; +static const char __pyx_k_VariableMaxSumConstraint_preProc_2[] = "VariableMaxSumConstraint.preProcess"; +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 */ @@ -2903,10 +3051,6 @@ static PyObject *__pyx_pf_10constraint_11constraints_6__defaults__(CYTHON_UNUSED 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_8__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_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_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 */ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_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 */ @@ -2918,6 +3062,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain 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_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 */ +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); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_10preProcess_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ +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); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_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_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_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_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 */ @@ -2937,11 +3099,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ 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_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_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_preProcess(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*/ +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +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_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_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ /* SmallCodeConfig */ @@ -2982,25 +3151,39 @@ typedef struct { #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_genexpr; - PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_2_preProcess; + PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_1_preProcess; + PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr; PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr; PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr; - PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_5_genexpr; + 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_10_genexpr; + PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr; + PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_12_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_genexpr; - PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_preProcess; + PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess; + PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_genexpr; PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr; PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr; - PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_genexpr; + 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_10_genexpr; + PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr; + PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; __Pyx_CachedCFunction __pyx_umethod_PyList_Type__remove; PyObject *__pyx_slice[1]; PyObject *__pyx_tuple[4]; - PyObject *__pyx_codeobj_tab[41]; - PyObject *__pyx_string_tab[193]; + PyObject *__pyx_codeobj_tab[55]; + PyObject *__pyx_string_tab[217]; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_10; @@ -3012,13 +3195,13 @@ int __pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr; #endif #if CYTHON_USE_FREELISTS -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_1_genexpr[8]; -int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_1_preProcess[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_preProcess; #endif #if CYTHON_USE_FREELISTS -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_2_preProcess[8]; -int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_2_preProcess; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_2_genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_2_genexpr; #endif #if CYTHON_USE_FREELISTS @@ -3032,8 +3215,43 @@ int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_4_genexpr; #endif #if CYTHON_USE_FREELISTS -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_5_genexpr[8]; -int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_5_genexpr; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_5_preProcess[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_5_preProcess; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_6_genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_6_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_7_genexpr[8]; +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; +#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; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_10_genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_10_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_11_genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_11_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_12_genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_12_genexpr; #endif /* CachedMethodType.module_state_decls */ #if CYTHON_COMPILING_IN_LIMITED_API @@ -3091,181 +3309,205 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_su __pyx_string_tab[17] -#define __pyx_kp_u_Constraint_enforcing_that_values __pyx_string_tab[18] -#define __pyx_kp_u_Constraint_enforcing_that_values_2 __pyx_string_tab[19] -#define __pyx_kp_u_Constraint_enforcing_that_values_3 __pyx_string_tab[20] -#define __pyx_kp_u_Constraint_enforcing_that_values_4 __pyx_string_tab[21] -#define __pyx_kp_u_Constraint_enforcing_that_values_5 __pyx_string_tab[22] -#define __pyx_kp_u_Constraint_enforcing_that_values_6 __pyx_string_tab[23] -#define __pyx_kp_u_Constraint_enforcing_that_values_7 __pyx_string_tab[24] -#define __pyx_kp_u_Constraint_enforcing_that_values_8 __pyx_string_tab[25] -#define __pyx_kp_u_Constraint_enforcing_that_values_9 __pyx_string_tab[26] -#define __pyx_n_u_Constraint_forwardCheck __pyx_string_tab[27] -#define __pyx_n_u_Constraint_preProcess __pyx_string_tab[28] -#define __pyx_kp_u_Constraint_which_wraps_a_functio __pyx_string_tab[29] -#define __pyx_n_u_ExactSumConstraint __pyx_string_tab[30] -#define __pyx_n_u_ExactSumConstraint___call __pyx_string_tab[31] -#define __pyx_n_u_ExactSumConstraint___init __pyx_string_tab[32] -#define __pyx_n_u_ExactSumConstraint_preProcess __pyx_string_tab[33] -#define __pyx_n_u_FunctionConstraint __pyx_string_tab[34] -#define __pyx_n_u_FunctionConstraint___call __pyx_string_tab[35] -#define __pyx_n_u_FunctionConstraint___init __pyx_string_tab[36] -#define __pyx_n_u_InSetConstraint __pyx_string_tab[37] -#define __pyx_n_u_InSetConstraint___call __pyx_string_tab[38] -#define __pyx_n_u_InSetConstraint___init __pyx_string_tab[39] -#define __pyx_n_u_InSetConstraint_preProcess __pyx_string_tab[40] -#define __pyx_kp_u_Last_multiplier_must_be_1_as_it __pyx_string_tab[41] -#define __pyx_n_u_MaxProdConstraint __pyx_string_tab[42] -#define __pyx_n_u_MaxProdConstraint___call __pyx_string_tab[43] -#define __pyx_n_u_MaxProdConstraint___init __pyx_string_tab[44] -#define __pyx_n_u_MaxProdConstraint_preProcess __pyx_string_tab[45] -#define __pyx_n_u_MaxProdConstraint_preProcess_loc __pyx_string_tab[46] -#define __pyx_n_u_MaxSumConstraint __pyx_string_tab[47] -#define __pyx_n_u_MaxSumConstraint___call __pyx_string_tab[48] -#define __pyx_n_u_MaxSumConstraint___init __pyx_string_tab[49] -#define __pyx_n_u_MaxSumConstraint_preProcess __pyx_string_tab[50] -#define __pyx_n_u_MaxSumConstraint_preProcess_loca __pyx_string_tab[51] -#define __pyx_n_u_MinProdConstraint __pyx_string_tab[52] -#define __pyx_n_u_MinProdConstraint___call __pyx_string_tab[53] -#define __pyx_n_u_MinProdConstraint___init __pyx_string_tab[54] -#define __pyx_n_u_MinProdConstraint_preProcess __pyx_string_tab[55] -#define __pyx_n_u_MinSumConstraint __pyx_string_tab[56] -#define __pyx_n_u_MinSumConstraint___call __pyx_string_tab[57] -#define __pyx_n_u_MinSumConstraint___init __pyx_string_tab[58] -#define __pyx_kp_u_Multipliers_must_be_numbers __pyx_string_tab[59] -#define __pyx_kp_u_Multipliers_must_match_sum_varia __pyx_string_tab[60] -#define __pyx_n_u_NotImplementedError __pyx_string_tab[61] -#define __pyx_n_u_NotInSetConstraint __pyx_string_tab[62] -#define __pyx_n_u_NotInSetConstraint___call __pyx_string_tab[63] -#define __pyx_n_u_NotInSetConstraint___init __pyx_string_tab[64] -#define __pyx_n_u_NotInSetConstraint_preProcess __pyx_string_tab[65] -#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[66] -#define __pyx_n_u_Optional __pyx_string_tab[67] -#define __pyx_kp_u_Optional_Sequence __pyx_string_tab[68] -#define __pyx_n_u_RuntimeError __pyx_string_tab[69] -#define __pyx_n_u_Sequence __pyx_string_tab[70] -#define __pyx_n_u_SomeInSetConstraint __pyx_string_tab[71] -#define __pyx_n_u_SomeInSetConstraint___call __pyx_string_tab[72] -#define __pyx_n_u_SomeInSetConstraint___init __pyx_string_tab[73] -#define __pyx_n_u_SomeNotInSetConstraint __pyx_string_tab[74] -#define __pyx_n_u_SomeNotInSetConstraint___call __pyx_string_tab[75] -#define __pyx_n_u_SomeNotInSetConstraint___init __pyx_string_tab[76] -#define __pyx_n_u_Unassigned __pyx_string_tab[77] -#define __pyx_n_u_Union __pyx_string_tab[78] -#define __pyx_kp_u_Union_int_float __pyx_string_tab[79] -#define __pyx_n_u_VariableExactSumConstraint __pyx_string_tab[80] -#define __pyx_n_u_VariableExactSumConstraint___cal __pyx_string_tab[81] -#define __pyx_n_u_VariableExactSumConstraint___ini __pyx_string_tab[82] -#define __pyx_n_u_VariableExactSumConstraint___ini_2 __pyx_string_tab[83] -#define __pyx_n_u_VariableExactSumConstraint_prePr __pyx_string_tab[84] -#define __pyx_n_u_VariableExactSumConstraint_prePr_2 __pyx_string_tab[85] -#define __pyx_kp_u_Wrapper_function_for_picklable_s __pyx_string_tab[86] -#define __pyx_kp_u__2 __pyx_string_tab[87] -#define __pyx_kp_u_add_note __pyx_string_tab[88] -#define __pyx_n_u_assigned __pyx_string_tab[89] -#define __pyx_n_u_assigned_2 __pyx_string_tab[90] -#define __pyx_n_u_assignments __pyx_string_tab[91] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[92] -#define __pyx_n_u_bool __pyx_string_tab[93] -#define __pyx_n_u_call __pyx_string_tab[94] -#define __pyx_n_u_class_getitem __pyx_string_tab[95] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[96] -#define __pyx_n_u_close __pyx_string_tab[97] -#define __pyx_n_u_collections_abc __pyx_string_tab[98] -#define __pyx_n_u_constraint_constraints __pyx_string_tab[99] -#define __pyx_kp_u_constraint_constraints_py __pyx_string_tab[100] -#define __pyx_n_u_constraint_domain __pyx_string_tab[101] -#define __pyx_n_u_constraints __pyx_string_tab[102] -#define __pyx_n_u_contains_lt1 __pyx_string_tab[103] -#define __pyx_n_u_contains_negative __pyx_string_tab[104] -#define __pyx_n_u_dict __pyx_string_tab[105] -#define __pyx_kp_u_disable __pyx_string_tab[106] -#define __pyx_n_u_doc __pyx_string_tab[107] -#define __pyx_n_u_domain __pyx_string_tab[108] -#define __pyx_n_u_domains __pyx_string_tab[109] -#define __pyx_kp_u_enable __pyx_string_tab[110] -#define __pyx_n_u_exact __pyx_string_tab[111] -#define __pyx_n_u_exact_2 __pyx_string_tab[112] -#define __pyx_n_u_exactsum __pyx_string_tab[113] -#define __pyx_n_u_exactsum_2 __pyx_string_tab[114] -#define __pyx_n_u_forwardCheck __pyx_string_tab[115] -#define __pyx_n_u_forwardcheck __pyx_string_tab[116] -#define __pyx_n_u_found __pyx_string_tab[117] -#define __pyx_n_u_func __pyx_string_tab[118] -#define __pyx_n_u_func_2 __pyx_string_tab[119] -#define __pyx_n_u_func_3 __pyx_string_tab[120] -#define __pyx_kp_u_gc __pyx_string_tab[121] -#define __pyx_n_u_genexpr __pyx_string_tab[122] -#define __pyx_n_u_get __pyx_string_tab[123] -#define __pyx_n_u_hideValue __pyx_string_tab[124] -#define __pyx_n_u_index __pyx_string_tab[125] -#define __pyx_n_u_init __pyx_string_tab[126] -#define __pyx_n_u_is_coroutine __pyx_string_tab[127] -#define __pyx_kp_u_isenabled __pyx_string_tab[128] -#define __pyx_kp_u_list_tuple __pyx_string_tab[129] -#define __pyx_n_u_m __pyx_string_tab[130] -#define __pyx_n_u_main __pyx_string_tab[131] -#define __pyx_n_u_max __pyx_string_tab[132] -#define __pyx_n_u_maxprod __pyx_string_tab[133] -#define __pyx_n_u_maxprod_2 __pyx_string_tab[134] -#define __pyx_n_u_maxsum __pyx_string_tab[135] -#define __pyx_n_u_maxsum_2 __pyx_string_tab[136] -#define __pyx_n_u_metaclass __pyx_string_tab[137] -#define __pyx_n_u_min __pyx_string_tab[138] -#define __pyx_n_u_minprod __pyx_string_tab[139] -#define __pyx_n_u_minprod_2 __pyx_string_tab[140] -#define __pyx_n_u_minsum __pyx_string_tab[141] -#define __pyx_n_u_minsum_2 __pyx_string_tab[142] -#define __pyx_n_u_missing __pyx_string_tab[143] -#define __pyx_n_u_module __pyx_string_tab[144] -#define __pyx_n_u_mro_entries __pyx_string_tab[145] -#define __pyx_n_u_multiplier __pyx_string_tab[146] -#define __pyx_n_u_multipliers __pyx_string_tab[147] -#define __pyx_n_u_multipliers_2 __pyx_string_tab[148] -#define __pyx_n_u_n __pyx_string_tab[149] -#define __pyx_n_u_n_2 __pyx_string_tab[150] -#define __pyx_n_u_name __pyx_string_tab[151] -#define __pyx_n_u_next __pyx_string_tab[152] -#define __pyx_n_u_others_max __pyx_string_tab[153] -#define __pyx_n_u_others_min __pyx_string_tab[154] -#define __pyx_n_u_parms __pyx_string_tab[155] -#define __pyx_n_u_pop __pyx_string_tab[156] -#define __pyx_n_u_preProcess __pyx_string_tab[157] -#define __pyx_n_u_prepare __pyx_string_tab[158] -#define __pyx_n_u_prod __pyx_string_tab[159] -#define __pyx_n_u_qualname __pyx_string_tab[160] -#define __pyx_n_u_remove __pyx_string_tab[161] -#define __pyx_n_u_round __pyx_string_tab[162] -#define __pyx_n_u_seen __pyx_string_tab[163] -#define __pyx_n_u_self __pyx_string_tab[164] -#define __pyx_n_u_send __pyx_string_tab[165] -#define __pyx_n_u_set __pyx_string_tab[166] -#define __pyx_n_u_set_2 __pyx_string_tab[167] -#define __pyx_n_u_singlevalue __pyx_string_tab[168] -#define __pyx_n_u_str __pyx_string_tab[169] -#define __pyx_n_u_sum __pyx_string_tab[170] -#define __pyx_n_u_sum_value __pyx_string_tab[171] -#define __pyx_n_u_sum_vars __pyx_string_tab[172] -#define __pyx_n_u_target_value __pyx_string_tab[173] -#define __pyx_n_u_target_var __pyx_string_tab[174] -#define __pyx_n_u_temp_sum __pyx_string_tab[175] -#define __pyx_n_u_test __pyx_string_tab[176] -#define __pyx_n_u_throw __pyx_string_tab[177] -#define __pyx_n_u_typing __pyx_string_tab[178] -#define __pyx_n_u_unassigned __pyx_string_tab[179] -#define __pyx_n_u_unassignedvariable __pyx_string_tab[180] -#define __pyx_n_u_v __pyx_string_tab[181] -#define __pyx_n_u_value __pyx_string_tab[182] -#define __pyx_n_u_var __pyx_string_tab[183] -#define __pyx_n_u_variable __pyx_string_tab[184] -#define __pyx_n_u_variable_contains_lt1 __pyx_string_tab[185] -#define __pyx_n_u_variable_contains_negative __pyx_string_tab[186] -#define __pyx_n_u_variable_with_lt1 __pyx_string_tab[187] -#define __pyx_n_u_variable_with_negative __pyx_string_tab[188] -#define __pyx_n_u_variables __pyx_string_tab[189] -#define __pyx_n_u_vconstraints __pyx_string_tab[190] -#define __pyx_n_u_x __pyx_string_tab[191] -#define __pyx_n_u_zip __pyx_string_tab[192] +#define __pyx_kp_u_Constraint_enforcing_that_the_su_2 __pyx_string_tab[18] +#define __pyx_kp_u_Constraint_enforcing_that_the_su_3 __pyx_string_tab[19] +#define __pyx_kp_u_Constraint_enforcing_that_values __pyx_string_tab[20] +#define __pyx_kp_u_Constraint_enforcing_that_values_10 __pyx_string_tab[21] +#define __pyx_kp_u_Constraint_enforcing_that_values_2 __pyx_string_tab[22] +#define __pyx_kp_u_Constraint_enforcing_that_values_3 __pyx_string_tab[23] +#define __pyx_kp_u_Constraint_enforcing_that_values_4 __pyx_string_tab[24] +#define __pyx_kp_u_Constraint_enforcing_that_values_5 __pyx_string_tab[25] +#define __pyx_kp_u_Constraint_enforcing_that_values_6 __pyx_string_tab[26] +#define __pyx_kp_u_Constraint_enforcing_that_values_7 __pyx_string_tab[27] +#define __pyx_kp_u_Constraint_enforcing_that_values_8 __pyx_string_tab[28] +#define __pyx_kp_u_Constraint_enforcing_that_values_9 __pyx_string_tab[29] +#define __pyx_n_u_Constraint_forwardCheck __pyx_string_tab[30] +#define __pyx_n_u_Constraint_preProcess __pyx_string_tab[31] +#define __pyx_kp_u_Constraint_which_wraps_a_functio __pyx_string_tab[32] +#define __pyx_n_u_ExactProdConstraint __pyx_string_tab[33] +#define __pyx_n_u_ExactProdConstraint___call __pyx_string_tab[34] +#define __pyx_n_u_ExactProdConstraint___init __pyx_string_tab[35] +#define __pyx_n_u_ExactProdConstraint_preProcess __pyx_string_tab[36] +#define __pyx_n_u_ExactProdConstraint_preProcess_l __pyx_string_tab[37] +#define __pyx_n_u_ExactSumConstraint __pyx_string_tab[38] +#define __pyx_n_u_ExactSumConstraint___call __pyx_string_tab[39] +#define __pyx_n_u_ExactSumConstraint___init __pyx_string_tab[40] +#define __pyx_n_u_ExactSumConstraint_preProcess __pyx_string_tab[41] +#define __pyx_n_u_FunctionConstraint __pyx_string_tab[42] +#define __pyx_n_u_FunctionConstraint___call __pyx_string_tab[43] +#define __pyx_n_u_FunctionConstraint___init __pyx_string_tab[44] +#define __pyx_n_u_InSetConstraint __pyx_string_tab[45] +#define __pyx_n_u_InSetConstraint___call __pyx_string_tab[46] +#define __pyx_n_u_InSetConstraint___init __pyx_string_tab[47] +#define __pyx_n_u_InSetConstraint_preProcess __pyx_string_tab[48] +#define __pyx_kp_u_Last_multiplier_must_be_1_as_it __pyx_string_tab[49] +#define __pyx_n_u_MaxProdConstraint __pyx_string_tab[50] +#define __pyx_n_u_MaxProdConstraint___call __pyx_string_tab[51] +#define __pyx_n_u_MaxProdConstraint___init __pyx_string_tab[52] +#define __pyx_n_u_MaxProdConstraint_preProcess __pyx_string_tab[53] +#define __pyx_n_u_MaxProdConstraint_preProcess_loc __pyx_string_tab[54] +#define __pyx_n_u_MaxSumConstraint __pyx_string_tab[55] +#define __pyx_n_u_MaxSumConstraint___call __pyx_string_tab[56] +#define __pyx_n_u_MaxSumConstraint___init __pyx_string_tab[57] +#define __pyx_n_u_MaxSumConstraint_preProcess __pyx_string_tab[58] +#define __pyx_n_u_MaxSumConstraint_preProcess_loca __pyx_string_tab[59] +#define __pyx_n_u_MinProdConstraint __pyx_string_tab[60] +#define __pyx_n_u_MinProdConstraint___call __pyx_string_tab[61] +#define __pyx_n_u_MinProdConstraint___init __pyx_string_tab[62] +#define __pyx_n_u_MinProdConstraint_preProcess __pyx_string_tab[63] +#define __pyx_n_u_MinSumConstraint __pyx_string_tab[64] +#define __pyx_n_u_MinSumConstraint___call __pyx_string_tab[65] +#define __pyx_n_u_MinSumConstraint___init __pyx_string_tab[66] +#define __pyx_kp_u_Multipliers_must_be_numbers __pyx_string_tab[67] +#define __pyx_kp_u_Multipliers_must_match_sum_varia __pyx_string_tab[68] +#define __pyx_n_u_NotImplementedError __pyx_string_tab[69] +#define __pyx_n_u_NotInSetConstraint __pyx_string_tab[70] +#define __pyx_n_u_NotInSetConstraint___call __pyx_string_tab[71] +#define __pyx_n_u_NotInSetConstraint___init __pyx_string_tab[72] +#define __pyx_n_u_NotInSetConstraint_preProcess __pyx_string_tab[73] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[74] +#define __pyx_n_u_Optional __pyx_string_tab[75] +#define __pyx_kp_u_Optional_Sequence __pyx_string_tab[76] +#define __pyx_n_u_RuntimeError __pyx_string_tab[77] +#define __pyx_n_u_Sequence __pyx_string_tab[78] +#define __pyx_n_u_SomeInSetConstraint __pyx_string_tab[79] +#define __pyx_n_u_SomeInSetConstraint___call __pyx_string_tab[80] +#define __pyx_n_u_SomeInSetConstraint___init __pyx_string_tab[81] +#define __pyx_n_u_SomeNotInSetConstraint __pyx_string_tab[82] +#define __pyx_n_u_SomeNotInSetConstraint___call __pyx_string_tab[83] +#define __pyx_n_u_SomeNotInSetConstraint___init __pyx_string_tab[84] +#define __pyx_n_u_Unassigned __pyx_string_tab[85] +#define __pyx_n_u_Union __pyx_string_tab[86] +#define __pyx_kp_u_Union_int_float __pyx_string_tab[87] +#define __pyx_n_u_VariableExactSumConstraint __pyx_string_tab[88] +#define __pyx_n_u_VariableExactSumConstraint___cal __pyx_string_tab[89] +#define __pyx_n_u_VariableExactSumConstraint___ini __pyx_string_tab[90] +#define __pyx_n_u_VariableExactSumConstraint___ini_2 __pyx_string_tab[91] +#define __pyx_n_u_VariableExactSumConstraint_prePr __pyx_string_tab[92] +#define __pyx_n_u_VariableExactSumConstraint_prePr_2 __pyx_string_tab[93] +#define __pyx_n_u_VariableMaxSumConstraint __pyx_string_tab[94] +#define __pyx_n_u_VariableMaxSumConstraint___call __pyx_string_tab[95] +#define __pyx_n_u_VariableMaxSumConstraint___init __pyx_string_tab[96] +#define __pyx_n_u_VariableMaxSumConstraint___init_2 __pyx_string_tab[97] +#define __pyx_n_u_VariableMaxSumConstraint_preProc __pyx_string_tab[98] +#define __pyx_n_u_VariableMaxSumConstraint_preProc_2 __pyx_string_tab[99] +#define __pyx_n_u_VariableMinSumConstraint __pyx_string_tab[100] +#define __pyx_n_u_VariableMinSumConstraint___call __pyx_string_tab[101] +#define __pyx_n_u_VariableMinSumConstraint___init __pyx_string_tab[102] +#define __pyx_n_u_VariableMinSumConstraint___init_2 __pyx_string_tab[103] +#define __pyx_n_u_VariableMinSumConstraint_preProc __pyx_string_tab[104] +#define __pyx_n_u_VariableMinSumConstraint_preProc_2 __pyx_string_tab[105] +#define __pyx_kp_u_Wrapper_function_for_picklable_s __pyx_string_tab[106] +#define __pyx_kp_u__2 __pyx_string_tab[107] +#define __pyx_kp_u_add_note __pyx_string_tab[108] +#define __pyx_n_u_append __pyx_string_tab[109] +#define __pyx_n_u_assigned __pyx_string_tab[110] +#define __pyx_n_u_assigned_2 __pyx_string_tab[111] +#define __pyx_n_u_assignments __pyx_string_tab[112] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[113] +#define __pyx_n_u_bool __pyx_string_tab[114] +#define __pyx_n_u_call __pyx_string_tab[115] +#define __pyx_n_u_class_getitem __pyx_string_tab[116] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[117] +#define __pyx_n_u_close __pyx_string_tab[118] +#define __pyx_n_u_collections_abc __pyx_string_tab[119] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[120] +#define __pyx_kp_u_constraint_constraints_py __pyx_string_tab[121] +#define __pyx_n_u_constraint_domain __pyx_string_tab[122] +#define __pyx_n_u_constraints __pyx_string_tab[123] +#define __pyx_n_u_contains_lt1 __pyx_string_tab[124] +#define __pyx_n_u_contains_negative __pyx_string_tab[125] +#define __pyx_n_u_dict __pyx_string_tab[126] +#define __pyx_kp_u_disable __pyx_string_tab[127] +#define __pyx_n_u_doc __pyx_string_tab[128] +#define __pyx_n_u_domain __pyx_string_tab[129] +#define __pyx_n_u_domains __pyx_string_tab[130] +#define __pyx_kp_u_enable __pyx_string_tab[131] +#define __pyx_n_u_exact __pyx_string_tab[132] +#define __pyx_n_u_exact_2 __pyx_string_tab[133] +#define __pyx_n_u_exactprod __pyx_string_tab[134] +#define __pyx_n_u_exactprod_2 __pyx_string_tab[135] +#define __pyx_n_u_exactsum __pyx_string_tab[136] +#define __pyx_n_u_exactsum_2 __pyx_string_tab[137] +#define __pyx_n_u_forwardCheck __pyx_string_tab[138] +#define __pyx_n_u_forwardcheck __pyx_string_tab[139] +#define __pyx_n_u_found __pyx_string_tab[140] +#define __pyx_n_u_func __pyx_string_tab[141] +#define __pyx_n_u_func_2 __pyx_string_tab[142] +#define __pyx_n_u_func_3 __pyx_string_tab[143] +#define __pyx_kp_u_gc __pyx_string_tab[144] +#define __pyx_n_u_genexpr __pyx_string_tab[145] +#define __pyx_n_u_get __pyx_string_tab[146] +#define __pyx_n_u_hideValue __pyx_string_tab[147] +#define __pyx_n_u_index __pyx_string_tab[148] +#define __pyx_n_u_init __pyx_string_tab[149] +#define __pyx_n_u_is_coroutine __pyx_string_tab[150] +#define __pyx_kp_u_isenabled __pyx_string_tab[151] +#define __pyx_kp_u_list_tuple __pyx_string_tab[152] +#define __pyx_n_u_m __pyx_string_tab[153] +#define __pyx_n_u_main __pyx_string_tab[154] +#define __pyx_n_u_max __pyx_string_tab[155] +#define __pyx_n_u_maxprod __pyx_string_tab[156] +#define __pyx_n_u_maxprod_2 __pyx_string_tab[157] +#define __pyx_n_u_maxsum __pyx_string_tab[158] +#define __pyx_n_u_maxsum_2 __pyx_string_tab[159] +#define __pyx_n_u_metaclass __pyx_string_tab[160] +#define __pyx_n_u_min __pyx_string_tab[161] +#define __pyx_n_u_minprod __pyx_string_tab[162] +#define __pyx_n_u_minprod_2 __pyx_string_tab[163] +#define __pyx_n_u_minsum __pyx_string_tab[164] +#define __pyx_n_u_minsum_2 __pyx_string_tab[165] +#define __pyx_n_u_missing __pyx_string_tab[166] +#define __pyx_n_u_missing_lt1 __pyx_string_tab[167] +#define __pyx_n_u_module __pyx_string_tab[168] +#define __pyx_n_u_mro_entries __pyx_string_tab[169] +#define __pyx_n_u_multiplier __pyx_string_tab[170] +#define __pyx_n_u_multipliers __pyx_string_tab[171] +#define __pyx_n_u_multipliers_2 __pyx_string_tab[172] +#define __pyx_n_u_n __pyx_string_tab[173] +#define __pyx_n_u_n_2 __pyx_string_tab[174] +#define __pyx_n_u_name __pyx_string_tab[175] +#define __pyx_n_u_next __pyx_string_tab[176] +#define __pyx_n_u_others_max __pyx_string_tab[177] +#define __pyx_n_u_others_min __pyx_string_tab[178] +#define __pyx_n_u_parms __pyx_string_tab[179] +#define __pyx_n_u_pop __pyx_string_tab[180] +#define __pyx_n_u_preProcess __pyx_string_tab[181] +#define __pyx_n_u_prepare __pyx_string_tab[182] +#define __pyx_n_u_prod __pyx_string_tab[183] +#define __pyx_n_u_qualname __pyx_string_tab[184] +#define __pyx_n_u_remove __pyx_string_tab[185] +#define __pyx_n_u_round __pyx_string_tab[186] +#define __pyx_n_u_seen __pyx_string_tab[187] +#define __pyx_n_u_self __pyx_string_tab[188] +#define __pyx_n_u_send __pyx_string_tab[189] +#define __pyx_n_u_set __pyx_string_tab[190] +#define __pyx_n_u_set_2 __pyx_string_tab[191] +#define __pyx_n_u_singlevalue __pyx_string_tab[192] +#define __pyx_n_u_str __pyx_string_tab[193] +#define __pyx_n_u_sum __pyx_string_tab[194] +#define __pyx_n_u_sum_value __pyx_string_tab[195] +#define __pyx_n_u_sum_vars __pyx_string_tab[196] +#define __pyx_n_u_target_value __pyx_string_tab[197] +#define __pyx_n_u_target_var __pyx_string_tab[198] +#define __pyx_n_u_temp_sum __pyx_string_tab[199] +#define __pyx_n_u_test __pyx_string_tab[200] +#define __pyx_n_u_throw __pyx_string_tab[201] +#define __pyx_n_u_typing __pyx_string_tab[202] +#define __pyx_n_u_unassigned __pyx_string_tab[203] +#define __pyx_n_u_unassignedvariable __pyx_string_tab[204] +#define __pyx_n_u_v __pyx_string_tab[205] +#define __pyx_n_u_value __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_variable_contains_lt1 __pyx_string_tab[209] +#define __pyx_n_u_variable_contains_negative __pyx_string_tab[210] +#define __pyx_n_u_variable_with_lt1 __pyx_string_tab[211] +#define __pyx_n_u_variable_with_negative __pyx_string_tab[212] +#define __pyx_n_u_variables __pyx_string_tab[213] +#define __pyx_n_u_vconstraints __pyx_string_tab[214] +#define __pyx_n_u_x __pyx_string_tab[215] +#define __pyx_n_u_zip __pyx_string_tab[216] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3290,20 +3532,34 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_defaults); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_preProcess); - Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_2_preProcess); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_1_preProcess); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_5_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr); + 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_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); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_12_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<41; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<193; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<55; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<217; ++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); @@ -3331,20 +3587,34 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_defaults); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_preProcess); - Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_2_preProcess); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_1_preProcess); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_5_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr); + 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_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); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_12_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<41; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<193; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<55; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<217; ++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); @@ -7039,22 +7309,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call /* "constraint/constraints.py":288 * """ * - * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_16MaxSumConstraint_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_18ExactSumConstraint_1__init__(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_16MaxSumConstraint___init__, "Initialization method.\n\n Args:\n maxsum (number): Value to be considered as the maximum sum\n multipliers (sequence of numbers): If given, variable values\n will be multiplied by the given factors before being\n summed to be checked\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_16MaxSumConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_16MaxSumConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_16MaxSumConstraint___init__}; -static PyObject *__pyx_pw_10constraint_11constraints_16MaxSumConstraint_1__init__(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_18ExactSumConstraint___init__, "Initialization method.\n\n Args:\n exactsum (number): Value to be considered as the exact sum\n multipliers (sequence of numbers): If given, variable values\n will be multiplied by the given factors before being\n summed to be checked\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_18ExactSumConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18ExactSumConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_18ExactSumConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_18ExactSumConstraint_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -7062,7 +7332,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_maxsum = 0; + PyObject *__pyx_v_exactsum = 0; PyObject *__pyx_v_multipliers = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; @@ -7084,7 +7354,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #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_maxsum,&__pyx_mstate_global->__pyx_n_u_multipliers,0}; + 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, 288, __pyx_L3_error) if (__pyx_kwds_len > 0) { @@ -7127,7 +7397,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); } __pyx_v_self = values[0]; - __pyx_v_maxsum = values[1]; + __pyx_v_exactsum = values[1]; __pyx_v_multipliers = values[2]; } goto __pyx_L6_skip; @@ -7139,11 +7409,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds 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.MaxSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.ExactSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_maxsum, __pyx_v_multipliers); + __pyx_r = __pyx_pf_10constraint_11constraints_18ExactSumConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_exactsum, __pyx_v_multipliers); /* function exit code */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -7153,7 +7423,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -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) { +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 int __pyx_lineno = 0; @@ -7164,15 +7434,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ /* "constraint/constraints.py":297 * summed to be checked * """ - * self._maxsum = maxsum # <<<<<<<<<<<<<< + * self._exactsum = exactsum # <<<<<<<<<<<<<< * self._multipliers = multipliers * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxsum_2, __pyx_v_maxsum) < 0) __PYX_ERR(0, 297, __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, 297, __pyx_L1_error) /* "constraint/constraints.py":298 * """ - * self._maxsum = maxsum + * self._exactsum = exactsum * self._multipliers = multipliers # <<<<<<<<<<<<<< * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 @@ -7182,7 +7452,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ /* "constraint/constraints.py":288 * """ * - * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -7191,7 +7461,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.MaxSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.ExactSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -7204,19 +7474,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * + * multipliers = self._multipliers */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_16MaxSumConstraint_3preProcess(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_18ExactSumConstraint_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_16MaxSumConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_16MaxSumConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_16MaxSumConstraint_3preProcess(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_18ExactSumConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18ExactSumConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_18ExactSumConstraint_3preProcess(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -7310,14 +7580,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds 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.MaxSumConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.ExactSumConstraint.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, 300, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 300, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 300, __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); + __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 */ goto __pyx_L0; @@ -7335,203 +7605,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10preProcess_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "constraint/constraints.py":307 - * 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__genexpr *__pyx_cur_scope; +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) { + PyObject *__pyx_v_multipliers = NULL; + PyObject *__pyx_v_exactsum = NULL; + PyObject *__pyx_v_variable = NULL; + PyObject *__pyx_v_multiplier = NULL; + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_value = NULL; 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__genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct__genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); - 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, 307, __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_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_MaxSumConstraint_preProcess_loca, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 307, __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_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__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, 307, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 307, __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, 307, __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, 307, __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, 307, __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, 307, __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, 307, __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, 307, __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, 307, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 307, __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":300 - * 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_multiplier = NULL; - PyObject *__pyx_v_domain = NULL; - PyObject *__pyx_v_value = NULL; - PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10preProcess_2generator = 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 *); - int __pyx_t_8; - int __pyx_t_9; - 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 *); + 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)(PyObject *); + Py_ssize_t __pyx_t_11; + PyObject *(*__pyx_t_12)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -7541,8 +7636,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * * 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 + * 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, 301, __pyx_L1_error) @@ -7572,224 +7667,46 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":304 - * - * # 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: + /* "constraint/constraints.py":302 + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * multipliers = self._multipliers # <<<<<<<<<<<<<< + * exactsum = self._exactsum + * if multipliers: */ - __pyx_t_1 = PyList_New(0); 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_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_variable_contains_negative = ((PyObject*)__pyx_t_1); + __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":305 - * # 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":303 + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * multipliers = self._multipliers + * exactsum = self._exactsum # <<<<<<<<<<<<<< + * if multipliers: + * for variable, multiplier in zip(variables, multipliers): */ - __Pyx_INCREF(Py_None); - __pyx_v_variable_with_negative = Py_None; + __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, 303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_exactsum = __pyx_t_1; + __pyx_t_1 = 0; - /* "constraint/constraints.py":306 - * 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":304 + * multipliers = self._multipliers + * exactsum = self._exactsum + * if multipliers: # <<<<<<<<<<<<<< + * for variable, multiplier in zip(variables, multipliers): + * 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; - } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __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, 306, __pyx_L1_error) - } - for (;;) { - 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, 306, __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_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, 306, __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_1, __pyx_t_6)); - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); - #endif - ++__pyx_t_6; - } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __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, 306, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 304, __pyx_L1_error) + if (__pyx_t_6) { - /* "constraint/constraints.py":307 - * 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: -*/ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __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, 307, __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, 307, __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; - - /* "constraint/constraints.py":308 - * 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: -*/ - __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, 308, __pyx_L1_error) - - /* "constraint/constraints.py":309 - * 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, 309, __pyx_L1_error) - if (__pyx_t_9) { - - /* "constraint/constraints.py":310 - * 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 -*/ - __pyx_t_9 = (__pyx_v_variable_with_negative != Py_None); - if (__pyx_t_9) { - - /* "constraint/constraints.py":312 - * if variable_with_negative is not None: - * # if more than one associated variables contain negative, we can't prune - * return # <<<<<<<<<<<<<< - * variable_with_negative = variable - * -*/ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - - /* "constraint/constraints.py":310 - * 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":313 - * # if more than one associated variables contain negative, we can't prune - * return - * variable_with_negative = variable # <<<<<<<<<<<<<< - * - * # 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":309 - * 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":306 - * 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) -*/ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "constraint/constraints.py":316 - * - * # 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, 316, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_multipliers = __pyx_t_1; - __pyx_t_1 = 0; - - /* "constraint/constraints.py":317 - * # 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, 317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_maxsum = __pyx_t_1; - __pyx_t_1 = 0; - - /* "constraint/constraints.py":318 - * 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, 318, __pyx_L1_error) - if (__pyx_t_9) { - - /* "constraint/constraints.py":319 - * maxsum = self._maxsum + /* "constraint/constraints.py":305 + * exactsum = self._exactsum * 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[:]: */ __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_builtin_zip); @@ -7800,53 +7717,53 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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, 319, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __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_6 = 0; - __pyx_t_7 = NULL; + __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, 319, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __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, 319, __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, 305, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_7)) { + 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, 319, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 305, __pyx_L1_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_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_7); + ++__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, 319, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 305, __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_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6)); + __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_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, 319, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_7(__pyx_t_2); + __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, 319, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 305, __pyx_L1_error) PyErr_Clear(); } break; @@ -7859,7 +7776,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 319, __pyx_L1_error) + __PYX_ERR(0, 305, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -7869,148 +7786,110 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __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, 319, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __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_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 319, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 305, __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_10); - index = 0; __pyx_t_4 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed; + __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_11(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed; + 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_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 319, __pyx_L1_error) - __pyx_t_11 = NULL; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - goto __pyx_L12_unpacking_done; - __pyx_L11_unpacking_failed:; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_11 = NULL; + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 305, __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; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 319, __pyx_L1_error) - __pyx_L12_unpacking_done:; + __PYX_ERR(0, 305, __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_multiplier, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":320 - * 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, 320, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 320, __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":321 - * 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":320 + /* "constraint/constraints.py":306 * 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":322 - * if variable_with_negative is not None and variable_with_negative != variable: - * continue * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: - * if value * multiplier > maxsum: + * if value * multiplier > exactsum: */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":323 - * continue + /* "constraint/constraints.py":307 + * for variable, multiplier in zip(variables, multipliers): * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< - * if value * multiplier > maxsum: + * 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, 323, __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, 307, __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; + __pyx_t_11 = 0; + __pyx_t_12 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __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, 323, __pyx_L1_error) + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 307, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_14)) { + 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, 323, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 307, __pyx_L1_error) #endif - if (__pyx_t_13 >= __pyx_temp) break; + if (__pyx_t_11 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_13); - ++__pyx_t_13; + __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, 323, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 307, __pyx_L1_error) #endif - if (__pyx_t_13 >= __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_13)); + __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_13); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); #endif - ++__pyx_t_13; + ++__pyx_t_11; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_14(__pyx_t_3); + __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, 323, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 307, __pyx_L1_error) PyErr_Clear(); } break; @@ -8020,24 +7899,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":324 + /* "constraint/constraints.py":308 * domain = domains[variable] * for value in domain[:]: - * if value * multiplier > maxsum: # <<<<<<<<<<<<<< + * 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, 324, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __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, 324, __pyx_L1_error) + __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, 308, __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, 324, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_9) { + if (__pyx_t_6) { - /* "constraint/constraints.py":325 + /* "constraint/constraints.py":309 * for value in domain[:]: - * if value * multiplier > maxsum: + * if value * multiplier > exactsum: * domain.remove(value) # <<<<<<<<<<<<<< * else: * for variable in variables: @@ -8049,102 +7928,101 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc 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, 325, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":324 + /* "constraint/constraints.py":308 * domain = domains[variable] * for value in domain[:]: - * if value * multiplier > maxsum: # <<<<<<<<<<<<<< + * if value * multiplier > exactsum: # <<<<<<<<<<<<<< * domain.remove(value) * else: */ } - /* "constraint/constraints.py":323 - * continue + /* "constraint/constraints.py":307 + * for variable, multiplier in zip(variables, multipliers): * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< - * if value * multiplier > maxsum: + * if value * multiplier > exactsum: * domain.remove(value) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":319 - * maxsum = self._maxsum + /* "constraint/constraints.py":305 + * exactsum = self._exactsum * 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[:]: */ - __pyx_L9_continue:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":318 + /* "constraint/constraints.py":304 * multipliers = self._multipliers - * maxsum = self._maxsum + * exactsum = self._exactsum * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): - * if variable_with_negative is not None and variable_with_negative != variable: + * domain = domains[variable] */ - goto __pyx_L8; + goto __pyx_L3; } - /* "constraint/constraints.py":327 + /* "constraint/constraints.py":311 * 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[:]: */ /*else*/ { 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_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, 327, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __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, 327, __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, 311, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_7)) { + 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, 327, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 311, __pyx_L1_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_GetItemRef(__pyx_t_2, __pyx_t_7); + ++__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, 327, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 311, __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_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6)); + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); #endif - ++__pyx_t_6; + ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 327, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_7(__pyx_t_2); + __pyx_t_3 = __pyx_t_8(__pyx_t_2); 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, 327, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 311, __pyx_L1_error) PyErr_Clear(); } break; @@ -8154,109 +8032,71 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":328 - * 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, 328, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 328, __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":329 - * 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":328 + /* "constraint/constraints.py":312 * else: * for variable in variables: - * if variable_with_negative is not None and variable_with_negative != variable: # <<<<<<<<<<<<<< - * continue - * domain = domains[variable] -*/ - } - - /* "constraint/constraints.py":330 - * if variable_with_negative is not None and variable_with_negative != variable: - * continue * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: - * if value > maxsum: + * if value > exactsum: */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":331 - * continue + /* "constraint/constraints.py":313 + * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< - * if value > maxsum: + * 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, 331, __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, 313, __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_13 = 0; - __pyx_t_14 = NULL; + __pyx_t_11 = 0; + __pyx_t_12 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __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, 331, __pyx_L1_error) + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 313, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { - if (likely(!__pyx_t_14)) { + 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, 331, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 313, __pyx_L1_error) #endif - if (__pyx_t_13 >= __pyx_temp) break; + if (__pyx_t_11 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_13); - ++__pyx_t_13; + __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, 331, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 313, __pyx_L1_error) #endif - if (__pyx_t_13 >= __pyx_temp) break; + 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_13)); + __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_13); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); #endif - ++__pyx_t_13; + ++__pyx_t_11; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_14(__pyx_t_4); + __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, 331, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 313, __pyx_L1_error) PyErr_Clear(); } break; @@ -8266,24 +8106,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":332 + /* "constraint/constraints.py":314 * domain = domains[variable] * for value in domain[:]: - * if value > maxsum: # <<<<<<<<<<<<<< + * if value > exactsum: # <<<<<<<<<<<<<< * 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, 332, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 332, __pyx_L1_error) + __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, 314, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_9) { + if (__pyx_t_6) { - /* "constraint/constraints.py":333 + /* "constraint/constraints.py":315 * for value in domain[:]: - * if value > maxsum: + * if value > exactsum: * domain.remove(value) # <<<<<<<<<<<<<< * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 */ __pyx_t_1 = __pyx_v_domain; __Pyx_INCREF(__pyx_t_1); @@ -8292,49 +8132,48 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc 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, 333, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":332 + /* "constraint/constraints.py":314 * domain = domains[variable] * for value in domain[:]: - * if value > maxsum: # <<<<<<<<<<<<<< + * if value > exactsum: # <<<<<<<<<<<<<< * domain.remove(value) * */ } - /* "constraint/constraints.py":331 - * continue + /* "constraint/constraints.py":313 + * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< - * if value > maxsum: + * if value > exactsum: * domain.remove(value) */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":327 + /* "constraint/constraints.py":311 * 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[:]: */ - __pyx_L21_continue:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_L8:; + __pyx_L3:; /* "constraint/constraints.py":300 * 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 */ /* function exit code */ @@ -8345,43 +8184,39 @@ 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_10); - __Pyx_AddTraceback("constraint.constraints.MaxSumConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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_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_exactsum); + __Pyx_XDECREF(__pyx_v_variable); __Pyx_XDECREF(__pyx_v_multiplier); __Pyx_XDECREF(__pyx_v_domain); __Pyx_XDECREF(__pyx_v_value); - __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10preProcess_2generator); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":335 +/* "constraint/constraints.py":317 * domain.remove(value) * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers - * maxsum = self._maxsum + * exactsum = self._exactsum */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_16MaxSumConstraint_5__call__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_18ExactSumConstraint_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_16MaxSumConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_16MaxSumConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_16MaxSumConstraint_5__call__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_18ExactSumConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18ExactSumConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_18ExactSumConstraint_5__call__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -8415,53 +8250,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, 335, __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, 335, __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, 335, __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, 335, __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, 335, __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, 335, __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, "__call__", 0) < 0) __PYX_ERR(0, 335, __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, 317, __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, 335, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 317, __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, 335, __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, 335, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __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, 335, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __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, 335, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 317, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 335, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 317, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -8475,20 +8310,20 @@ 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, 335, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 317, __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.MaxSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.ExactSumConstraint.__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, 335, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 335, __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); + 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_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 317, __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 */ goto __pyx_L0; @@ -8507,10 +8342,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -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) { +static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_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_multipliers = NULL; - PyObject *__pyx_v_maxsum = NULL; + PyObject *__pyx_v_exactsum = NULL; PyObject *__pyx_v_sum = NULL; + int __pyx_v_missing; PyObject *__pyx_v_variable = NULL; PyObject *__pyx_v_multiplier = NULL; PyObject *__pyx_v_domain = NULL; @@ -8527,60 +8363,69 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ 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":336 + /* "constraint/constraints.py":318 * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * multipliers = self._multipliers # <<<<<<<<<<<<<< - * maxsum = self._maxsum + * 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, 336, __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, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":337 - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + /* "constraint/constraints.py":319 + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * multipliers = self._multipliers - * maxsum = self._maxsum # <<<<<<<<<<<<<< + * exactsum = self._exactsum # <<<<<<<<<<<<<< * sum = 0 - * if multipliers: + * missing = False */ - __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, 337, __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, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_maxsum = __pyx_t_1; + __pyx_v_exactsum = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":338 + /* "constraint/constraints.py":320 * multipliers = self._multipliers - * maxsum = self._maxsum + * exactsum = self._exactsum * sum = 0 # <<<<<<<<<<<<<< + * missing = False * if multipliers: - * for variable, multiplier in zip(variables, multipliers): */ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":339 - * maxsum = self._maxsum + /* "constraint/constraints.py":321 + * exactsum = self._exactsum + * sum = 0 + * missing = False # <<<<<<<<<<<<<< + * if multipliers: + * for variable, multiplier in zip(variables, multipliers): +*/ + __pyx_v_missing = 0; + + /* "constraint/constraints.py":322 * sum = 0 + * missing = 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, 339, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 322, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":340 - * sum = 0 + /* "constraint/constraints.py":323 + * missing = False * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable in assignments: @@ -8595,7 +8440,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __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_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, 340, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -8603,9 +8448,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __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, 340, __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, 323, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -8614,7 +8459,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 340, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 323, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -8624,7 +8469,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 340, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 323, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -8635,13 +8480,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_7(__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, 340, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 323, __pyx_L1_error) PyErr_Clear(); } break; @@ -8654,7 +8499,7 @@ 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, 340, __pyx_L1_error) + __PYX_ERR(0, 323, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8664,22 +8509,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 340, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 323, __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, 340, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 323, __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, 340, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 323, __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); @@ -8687,7 +8532,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_GOTREF(__pyx_t_3); 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, 340, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 323, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; @@ -8695,7 +8540,7 @@ 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, 340, __pyx_L1_error) + __PYX_ERR(0, 323, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); @@ -8703,45 +8548,58 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":341 + /* "constraint/constraints.py":324 * 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, 341, __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, 324, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":342 + /* "constraint/constraints.py":325 * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< - * if isinstance(sum, float): - * sum = round(sum, 10) + * else: + * missing = True */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __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, 342, __pyx_L1_error) + __pyx_t_8 = PyNumber_Multiply(__pyx_t_1, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 325, __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, 342, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __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":341 + /* "constraint/constraints.py":324 * if multipliers: * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * multiplier + * else: +*/ + goto __pyx_L8; + } + + /* "constraint/constraints.py":327 + * sum += assignments[variable] * multiplier + * else: + * missing = True # <<<<<<<<<<<<<< * if isinstance(sum, float): + * sum = round(sum, 10) */ + /*else*/ { + __pyx_v_missing = 1; } + __pyx_L8:; - /* "constraint/constraints.py":340 - * sum = 0 + /* "constraint/constraints.py":323 + * missing = False * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable in assignments: @@ -8750,21 +8608,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":343 - * if variable in assignments: - * sum += assignments[variable] * multiplier + /* "constraint/constraints.py":328 + * else: + * missing = True * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) - * if sum > maxsum: + * if sum > exactsum: */ __pyx_t_2 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_2) { - /* "constraint/constraints.py":344 - * sum += assignments[variable] * multiplier + /* "constraint/constraints.py":329 + * missing = True * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< - * if sum > maxsum: + * if sum > exactsum: * return False */ __pyx_t_1 = NULL; @@ -8776,38 +8634,38 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __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, 344, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":343 - * if variable in assignments: - * sum += assignments[variable] * multiplier + /* "constraint/constraints.py":328 + * else: + * missing = True * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) - * if sum > maxsum: + * if sum > exactsum: */ } - /* "constraint/constraints.py":345 + /* "constraint/constraints.py":330 * if isinstance(sum, float): * sum = round(sum, 10) - * if sum > maxsum: # <<<<<<<<<<<<<< + * if sum > exactsum: # <<<<<<<<<<<<<< * return False - * if forwardcheck: + * if forwardcheck and missing: */ - __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, 345, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 345, __pyx_L1_error) + __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, 330, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":346 + /* "constraint/constraints.py":331 * sum = round(sum, 10) - * if sum > maxsum: + * if sum > exactsum: * return False # <<<<<<<<<<<<<< - * if forwardcheck: + * if forwardcheck and missing: * for variable, multiplier in zip(variables, multipliers): */ __Pyx_XDECREF(__pyx_r); @@ -8815,28 +8673,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":345 + /* "constraint/constraints.py":330 * if isinstance(sum, float): * sum = round(sum, 10) - * if sum > maxsum: # <<<<<<<<<<<<<< + * if sum > exactsum: # <<<<<<<<<<<<<< * return False - * if forwardcheck: + * if forwardcheck and missing: */ } - /* "constraint/constraints.py":347 - * if sum > maxsum: + /* "constraint/constraints.py":332 + * if sum > exactsum: * return False - * if forwardcheck: # <<<<<<<<<<<<<< + * if forwardcheck and missing: # <<<<<<<<<<<<<< * 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, 347, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 332, __pyx_L1_error) + if (__pyx_t_11) { + } else { + __pyx_t_2 = __pyx_t_11; + goto __pyx_L13_bool_binop_done; + } + __pyx_t_2 = __pyx_v_missing; + __pyx_L13_bool_binop_done:; if (__pyx_t_2) { - /* "constraint/constraints.py":348 + /* "constraint/constraints.py":333 * return False - * if forwardcheck: + * if forwardcheck and missing: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] @@ -8850,7 +8715,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __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, 348, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { @@ -8858,9 +8723,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __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, 348, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __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, 348, __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, 333, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -8869,7 +8734,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_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, 348, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 333, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -8879,7 +8744,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 348, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 333, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -8890,13 +8755,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 348, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __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, 348, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 333, __pyx_L1_error) PyErr_Clear(); } break; @@ -8909,7 +8774,7 @@ 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, 348, __pyx_L1_error) + __PYX_ERR(0, 333, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8919,120 +8784,120 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 348, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); } #else - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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; + 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_L15_unpacking_failed; + 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, 348, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 333, __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_L18_unpacking_done; + __pyx_L17_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, 348, __pyx_L1_error) - __pyx_L16_unpacking_done:; + __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_L18_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; - /* "constraint/constraints.py":349 - * if forwardcheck: + /* "constraint/constraints.py":334 + * if forwardcheck and missing: * 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, 349, __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, 334, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":350 + /* "constraint/constraints.py":335 * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: - * if sum + value * multiplier > maxsum: + * 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, 350, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":351 + /* "constraint/constraints.py":336 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< - * if sum + value * multiplier > maxsum: + * 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, 351, __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, 336, __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_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, 351, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __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, 351, __pyx_L1_error) + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 336, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { - if (likely(!__pyx_t_12)) { + 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, 351, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 336, __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_4 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12); + ++__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, 351, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 336, __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_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); #endif - ++__pyx_t_11; + ++__pyx_t_12; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_12(__pyx_t_3); + __pyx_t_4 = __pyx_t_13(__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, 351, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 336, __pyx_L1_error) PyErr_Clear(); } break; @@ -9042,27 +8907,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":352 + /* "constraint/constraints.py":337 * domain = domains[variable] * for value in domain[:]: - * if sum + value * multiplier > maxsum: # <<<<<<<<<<<<<< + * 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, 352, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __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, 352, __pyx_L1_error) + __pyx_t_8 = PyNumber_Add(__pyx_v_sum, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __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, 352, __pyx_L1_error) + __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, 337, __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, 352, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":353 + /* "constraint/constraints.py":338 * for value in domain[:]: - * if sum + value * multiplier > maxsum: + * if sum + value * multiplier > exactsum: * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False @@ -9074,42 +8939,42 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ 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, 353, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":352 + /* "constraint/constraints.py":337 * domain = domains[variable] * for value in domain[:]: - * if sum + value * multiplier > maxsum: # <<<<<<<<<<<<<< + * if sum + value * multiplier > exactsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ } - /* "constraint/constraints.py":351 + /* "constraint/constraints.py":336 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< - * if sum + value * multiplier > maxsum: + * if sum + value * multiplier > exactsum: * domain.hideValue(value) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":354 - * if sum + value * multiplier > maxsum: + /* "constraint/constraints.py":339 + * 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, 354, __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, 339, __pyx_L1_error) + __pyx_t_11 = (!__pyx_t_2); + if (__pyx_t_11) { - /* "constraint/constraints.py":355 + /* "constraint/constraints.py":340 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -9122,8 +8987,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":354 - * if sum + value * multiplier > maxsum: + /* "constraint/constraints.py":339 + * if sum + value * multiplier > exactsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False @@ -9131,8 +8996,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":349 - * if forwardcheck: + /* "constraint/constraints.py":334 + * if forwardcheck and missing: * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] @@ -9140,9 +9005,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":348 + /* "constraint/constraints.py":333 * return False - * if forwardcheck: + * if forwardcheck and missing: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] @@ -9150,18 +9015,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":347 - * if sum > maxsum: + /* "constraint/constraints.py":332 + * if sum > exactsum: * return False - * if forwardcheck: # <<<<<<<<<<<<<< + * if forwardcheck and missing: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: */ } - /* "constraint/constraints.py":339 - * maxsum = self._maxsum + /* "constraint/constraints.py":322 * sum = 0 + * missing = False * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: @@ -9169,7 +9034,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ goto __pyx_L3; } - /* "constraint/constraints.py":357 + /* "constraint/constraints.py":342 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -9182,9 +9047,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __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, 357, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __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, 357, __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, 342, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -9192,7 +9057,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_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, 357, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 342, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -9202,7 +9067,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 357, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 342, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -9213,13 +9078,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __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, 357, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 342, __pyx_L1_error) PyErr_Clear(); } break; @@ -9229,41 +9094,54 @@ 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":358 + /* "constraint/constraints.py":343 * 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, 358, __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, 343, __pyx_L1_error) + if (__pyx_t_11) { - /* "constraint/constraints.py":359 + /* "constraint/constraints.py":344 * for variable in variables: * if variable in assignments: * sum += assignments[variable] # <<<<<<<<<<<<<< - * if isinstance(sum, float): - * sum = round(sum, 10) + * else: + * missing = True */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __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, 359, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __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; - /* "constraint/constraints.py":358 + /* "constraint/constraints.py":343 * else: * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] + * else: +*/ + goto __pyx_L28; + } + + /* "constraint/constraints.py":346 + * sum += assignments[variable] + * else: + * missing = True # <<<<<<<<<<<<<< * if isinstance(sum, float): + * sum = round(sum, 10) */ + /*else*/ { + __pyx_v_missing = 1; } + __pyx_L28:; - /* "constraint/constraints.py":357 + /* "constraint/constraints.py":342 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -9273,21 +9151,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":360 - * if variable in assignments: - * sum += assignments[variable] + /* "constraint/constraints.py":347 + * else: + * missing = True * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) - * if sum > maxsum: + * if sum > exactsum: */ - __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":361 - * sum += assignments[variable] + /* "constraint/constraints.py":348 + * missing = True * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< - * if sum > maxsum: + * if sum > exactsum: * return False */ __pyx_t_4 = NULL; @@ -9299,38 +9177,38 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __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, 361, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":360 - * if variable in assignments: - * sum += assignments[variable] + /* "constraint/constraints.py":347 + * else: + * missing = True * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) - * if sum > maxsum: + * if sum > exactsum: */ } - /* "constraint/constraints.py":362 + /* "constraint/constraints.py":349 * if isinstance(sum, float): * sum = round(sum, 10) - * if sum > maxsum: # <<<<<<<<<<<<<< + * if sum > exactsum: # <<<<<<<<<<<<<< * return False - * if forwardcheck: + * if forwardcheck and missing: */ - __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, 362, __pyx_L1_error) - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 362, __pyx_L1_error) + __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, 349, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); 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_13) { + if (__pyx_t_11) { - /* "constraint/constraints.py":363 + /* "constraint/constraints.py":350 * sum = round(sum, 10) - * if sum > maxsum: + * if sum > exactsum: * return False # <<<<<<<<<<<<<< - * if forwardcheck: + * if forwardcheck and missing: * for variable in variables: */ __Pyx_XDECREF(__pyx_r); @@ -9338,28 +9216,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":362 + /* "constraint/constraints.py":349 * if isinstance(sum, float): * sum = round(sum, 10) - * if sum > maxsum: # <<<<<<<<<<<<<< + * if sum > exactsum: # <<<<<<<<<<<<<< * return False - * if forwardcheck: + * if forwardcheck and missing: */ } - /* "constraint/constraints.py":364 - * if sum > maxsum: + /* "constraint/constraints.py":351 + * if sum > exactsum: * return False - * if forwardcheck: # <<<<<<<<<<<<<< + * if forwardcheck and missing: # <<<<<<<<<<<<<< * 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, 364, __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, 351, __pyx_L1_error) + if (__pyx_t_2) { + } else { + __pyx_t_11 = __pyx_t_2; + goto __pyx_L33_bool_binop_done; + } + __pyx_t_11 = __pyx_v_missing; + __pyx_L33_bool_binop_done:; + if (__pyx_t_11) { - /* "constraint/constraints.py":365 + /* "constraint/constraints.py":352 * return False - * if forwardcheck: + * if forwardcheck and missing: * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] @@ -9369,9 +9254,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __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, 365, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __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, 365, __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, 352, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -9379,7 +9264,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_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, 365, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 352, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -9389,7 +9274,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 365, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 352, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -9400,13 +9285,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 352, __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, 365, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 352, __pyx_L1_error) PyErr_Clear(); } break; @@ -9416,81 +9301,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":366 - * if forwardcheck: + /* "constraint/constraints.py":353 + * if forwardcheck and missing: * 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, 366, __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, 353, __pyx_L1_error) + if (__pyx_t_11) { - /* "constraint/constraints.py":367 + /* "constraint/constraints.py":354 * for variable in variables: * if variable not in assignments: * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: - * if sum + value > maxsum: + * if sum + value > exactsum: */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 367, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":368 + /* "constraint/constraints.py":355 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< - * if sum + value > maxsum: + * 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, 368, __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, 355, __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_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, 368, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __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, 368, __pyx_L1_error) + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 355, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { - if (likely(!__pyx_t_12)) { + if (likely(!__pyx_t_13)) { 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, 368, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 355, __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_GetItemRef(__pyx_t_4, __pyx_t_12); + ++__pyx_t_12; } 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, 368, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 355, __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_4, __pyx_t_12)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12); #endif - ++__pyx_t_11; + ++__pyx_t_12; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_12(__pyx_t_4); + __pyx_t_3 = __pyx_t_13(__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, 368, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 355, __pyx_L1_error) PyErr_Clear(); } break; @@ -9500,24 +9385,24 @@ 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":369 + /* "constraint/constraints.py":356 * domain = domains[variable] * for value in domain[:]: - * if sum + value > maxsum: # <<<<<<<<<<<<<< + * 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, 369, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_v_sum, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __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, 369, __pyx_L1_error) + __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, 356, __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, 369, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__pyx_t_13) { + if (__pyx_t_11) { - /* "constraint/constraints.py":370 + /* "constraint/constraints.py":357 * for value in domain[:]: - * if sum + value > maxsum: + * if sum + value > exactsum: * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False @@ -9529,47 +9414,47 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ 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, 370, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":369 + /* "constraint/constraints.py":356 * domain = domains[variable] * for value in domain[:]: - * if sum + value > maxsum: # <<<<<<<<<<<<<< + * if sum + value > exactsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ } - /* "constraint/constraints.py":368 + /* "constraint/constraints.py":355 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< - * if sum + value > maxsum: + * if sum + value > exactsum: * domain.hideValue(value) */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":371 - * if sum + value > maxsum: + /* "constraint/constraints.py":358 + * if sum + value > exactsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False - * return True + * if missing: */ - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 371, __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, 358, __pyx_L1_error) + __pyx_t_2 = (!__pyx_t_11); if (__pyx_t_2) { - /* "constraint/constraints.py":372 + /* "constraint/constraints.py":359 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< - * return True - * + * if missing: + * return sum <= exactsum */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); @@ -9577,17 +9462,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":371 - * if sum + value > maxsum: + /* "constraint/constraints.py":358 + * if sum + value > exactsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False - * return True + * if missing: */ } - /* "constraint/constraints.py":366 - * if forwardcheck: + /* "constraint/constraints.py":353 + * if forwardcheck and missing: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] @@ -9595,9 +9480,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":365 + /* "constraint/constraints.py":352 * return False - * if forwardcheck: + * if forwardcheck and missing: * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] @@ -9605,10 +9490,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":364 - * if sum > maxsum: + /* "constraint/constraints.py":351 + * if sum > exactsum: * return False - * if forwardcheck: # <<<<<<<<<<<<<< + * if forwardcheck and missing: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: */ @@ -9616,24 +9501,58 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __pyx_L3:; - /* "constraint/constraints.py":373 + /* "constraint/constraints.py":360 * if not domain: * return False - * return True # <<<<<<<<<<<<<< - * + * if missing: # <<<<<<<<<<<<<< + * return sum <= exactsum + * else: +*/ + if (__pyx_v_missing) { + + /* "constraint/constraints.py":361 + * return False + * if missing: + * return sum <= 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, 361, __pyx_L1_error) + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "constraint/constraints.py":360 + * if not domain: + * return False + * if missing: # <<<<<<<<<<<<<< + * return sum <= exactsum + * else: +*/ + } + + /* "constraint/constraints.py":363 + * return sum <= exactsum + * else: + * return sum == exactsum # <<<<<<<<<<<<<< * + * class VariableExactSumConstraint(Constraint): */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; + /*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, 363, __pyx_L1_error) + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } - /* "constraint/constraints.py":335 + /* "constraint/constraints.py":317 * domain.remove(value) * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers - * maxsum = self._maxsum + * exactsum = self._exactsum */ /* function exit code */ @@ -9643,11 +9562,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("constraint.constraints.MaxSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.ExactSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_multipliers); - __Pyx_XDECREF(__pyx_v_maxsum); + __Pyx_XDECREF(__pyx_v_exactsum); __Pyx_XDECREF(__pyx_v_sum); __Pyx_XDECREF(__pyx_v_variable); __Pyx_XDECREF(__pyx_v_multiplier); @@ -9658,25 +9577,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ return __pyx_r; } -/* "constraint/constraints.py":387 +/* "constraint/constraints.py":376 * """ * - * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_18ExactSumConstraint_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_1__init__(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_18ExactSumConstraint___init__, "Initialization method.\n\n Args:\n exactsum (number): Value to be considered as the exact sum\n multipliers (sequence of numbers): If given, variable values\n will be multiplied by the given factors before being\n summed to be checked\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_18ExactSumConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18ExactSumConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_18ExactSumConstraint___init__}; -static PyObject *__pyx_pw_10constraint_11constraints_18ExactSumConstraint_1__init__(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_26VariableExactSumConstraint___init__, "Initialization method.\n\n Args:\n target_var (Variable): The target variable to sum to.\n sum_vars (sequence of Variables): The variables to sum up.\n multipliers (sequence of numbers): If given, variable values\n (except the last) will be multiplied by the given factors before being\n summed to match the last variable.\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_26VariableExactSumConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_26VariableExactSumConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -9684,13 +9603,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_exactsum = 0; + PyObject *__pyx_v_target_var = 0; + PyObject *__pyx_v_sum_vars = 0; PyObject *__pyx_v_multipliers = 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}; + PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -9706,869 +9626,438 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #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_exactsum,&__pyx_mstate_global->__pyx_n_u_multipliers,0}; + 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, 387, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 376, __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, 376, __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, 387, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 376, __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, 387, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 376, __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, 387, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 376, __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, 387, __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, 387, __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, 376, __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, 376, __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, 376, __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, 387, __pyx_L3_error) - CYTHON_FALLTHROUGH; - case 2: + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 376, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 387, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 376, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 387, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 376, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); + if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None)); } __pyx_v_self = values[0]; - __pyx_v_exactsum = values[1]; - __pyx_v_multipliers = values[2]; + __pyx_v_target_var = ((PyObject*)values[1]); + __pyx_v_sum_vars = values[2]; + __pyx_v_multipliers = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 376, __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.ExactSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_18ExactSumConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_exactsum, __pyx_v_multipliers); - - /* 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_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 - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "constraint/constraints.py":396 - * summed to be checked - * """ - * self._exactsum = exactsum # <<<<<<<<<<<<<< - * self._multipliers = multipliers - * -*/ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exactsum_2, __pyx_v_exactsum) < 0) __PYX_ERR(0, 396, __pyx_L1_error) - - /* "constraint/constraints.py":397 - * """ - * self._exactsum = exactsum - * self._multipliers = multipliers # <<<<<<<<<<<<<< - * - * 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, 397, __pyx_L1_error) - - /* "constraint/constraints.py":387 - * """ - * - * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< - * """Initialization method. - * -*/ + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 376, __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 */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.ExactSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __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:; - __Pyx_XGIVEREF(__pyx_r); + 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_26VariableExactSumConstraint_8__init___2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":399 - * self._multipliers = multipliers +/* "constraint/constraints.py":392 + * 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." * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * multipliers = self._multipliers */ -/* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_18ExactSumConstraint_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_18ExactSumConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18ExactSumConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_18ExactSumConstraint_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}; +static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_8__init___genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__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("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, 399, __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, 399, __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, 399, __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, 399, __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, 399, __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, 399, __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, 399, __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, 399, __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, 399, __pyx_L3_error) - values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 399, __pyx_L3_error) - values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 399, __pyx_L3_error) - values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 399, __pyx_L3_error) - values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 399, __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]); + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct__genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + 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, 392, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 399, __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_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_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, 392, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; } - __Pyx_AddTraceback("constraint.constraints.ExactSumConstraint.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, 399, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 399, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 399, __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 */ - goto __pyx_L0; __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.__init__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __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_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -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) { - PyObject *__pyx_v_multipliers = NULL; - PyObject *__pyx_v_exactsum = NULL; - PyObject *__pyx_v_variable = NULL; - PyObject *__pyx_v_multiplier = NULL; - PyObject *__pyx_v_domain = NULL; - PyObject *__pyx_v_value = NULL; +static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_8__init___2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; - size_t __pyx_t_5; + int __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)(PyObject *); - Py_ssize_t __pyx_t_11; - PyObject *(*__pyx_t_12)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("preProcess", 0); - - /* "constraint/constraints.py":400 - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< - * multipliers = self._multipliers - * 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, 400, __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, 400, __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(__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, 400, __pyx_L1_error) + __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, 392, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 392, __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, 392, __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, 392, __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, 392, __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, 392, __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, 392, __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, 392, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_m); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_m, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_6 = PyLong_Check(__pyx_cur_scope->__pyx_v_m); + if (!__pyx_t_6) { + } else { + __pyx_t_5 = __pyx_t_6; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_6 = PyFloat_Check(__pyx_cur_scope->__pyx_v_m); + __pyx_t_5 = __pyx_t_6; + __pyx_L7_bool_binop_done:; + __pyx_t_6 = (!__pyx_t_5); + if (__pyx_t_6) { + __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); - /* "constraint/constraints.py":401 - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * multipliers = self._multipliers # <<<<<<<<<<<<<< - * exactsum = self._exactsum - * if multipliers: + /* 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":376 + * """ + * + * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * """Initialization method. + * */ - __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, 401, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_multipliers = __pyx_t_1; - __pyx_t_1 = 0; - /* "constraint/constraints.py":402 - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * multipliers = self._multipliers - * exactsum = self._exactsum # <<<<<<<<<<<<<< +static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstraint___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_26VariableExactSumConstraint_8__init___2generator = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "constraint/constraints.py":386 + * 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, 386, __pyx_L1_error) + + /* "constraint/constraints.py":387 + * """ + * 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, 387, __pyx_L1_error) + + /* "constraint/constraints.py":388 + * self.target_var = target_var + * self.sum_vars = sum_vars + * self._multipliers = multipliers # <<<<<<<<<<<<<< + * * if multipliers: - * for variable, multiplier in zip(variables, multipliers): */ - __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, 402, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_exactsum = __pyx_t_1; - __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2, __pyx_v_multipliers) < 0) __PYX_ERR(0, 388, __pyx_L1_error) - /* "constraint/constraints.py":403 - * multipliers = self._multipliers - * exactsum = self._exactsum + /* "constraint/constraints.py":390 + * self._multipliers = multipliers + * * if multipliers: # <<<<<<<<<<<<<< - * for variable, multiplier in zip(variables, multipliers): - * domain = domains[variable] + * 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_6 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 403, __pyx_L1_error) - if (__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 390, __pyx_L1_error) + if (__pyx_t_1) { - /* "constraint/constraints.py":404 - * exactsum = self._exactsum + /* "constraint/constraints.py":391 + * * if multipliers: - * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: + * 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." */ - __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_2 = __pyx_builtin_zip; - __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, 404, __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, 404, __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, 404, __pyx_L1_error) + #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, 391, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 391, __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, 391, __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, 404, __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_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, 404, __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, 404, __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, 404, __pyx_L1_error) - PyErr_Clear(); - } - break; - } + #else + if ((1)); else __PYX_ERR(0, 391, __pyx_L1_error) + #endif + + /* "constraint/constraints.py":392 + * 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." + * +*/ + #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, 392, __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, 392, __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, 392, __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, 392, __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; - 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, 404, __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_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, 404, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __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, 404, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __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, 404, __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_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 404, __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; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 404, __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_multiplier, __pyx_t_3); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":405 - * 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, 405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); - __pyx_t_1 = 0; - - /* "constraint/constraints.py":406 - * 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, 406, __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, 406, __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, 406, __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, 406, __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, 406, __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, 406, __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, 406, __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":407 - * 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, 407, __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, 407, __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, 407, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - - /* "constraint/constraints.py":408 - * 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, 408, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "constraint/constraints.py":407 - * domain = domains[variable] - * for value in domain[:]: - * if value * multiplier > exactsum: # <<<<<<<<<<<<<< - * domain.remove(value) - * else: -*/ - } + } + #else + if ((1)); else __PYX_ERR(0, 392, __pyx_L1_error) + #endif - /* "constraint/constraints.py":406 - * for variable, multiplier in zip(variables, multipliers): - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value * multiplier > exactsum: - * domain.remove(value) + /* "constraint/constraints.py":393 + * 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." # <<<<<<<<<<<<<< + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 */ + #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); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 393, __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, 393, __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, 393, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "constraint/constraints.py":404 - * 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; + #else + if ((1)); else __PYX_ERR(0, 393, __pyx_L1_error) + #endif - /* "constraint/constraints.py":403 - * multipliers = self._multipliers - * exactsum = self._exactsum + /* "constraint/constraints.py":390 + * self._multipliers = multipliers + * * if multipliers: # <<<<<<<<<<<<<< - * for variable, multiplier in zip(variables, multipliers): - * domain = domains[variable] + * 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." */ - goto __pyx_L3; } - /* "constraint/constraints.py":410 - * domain.remove(value) - * else: - * for variable in variables: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: -*/ - /*else*/ { - 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_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, 410, __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, 410, __pyx_L1_error) - } - 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, 410, __pyx_L1_error) - #endif - if (__pyx_t_7 >= __pyx_temp) break; - } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_7); - ++__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, 410, __pyx_L1_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)); - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); - #endif - ++__pyx_t_7; - } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L1_error) - } else { - __pyx_t_3 = __pyx_t_8(__pyx_t_2); - 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, 410, __pyx_L1_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":411 - * 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, 411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":412 - * 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, 412, __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; - } else { - __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __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, 412, __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))) { - { - 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) - #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, 412, __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, 412, __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, 412, __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":413 - * 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, 413, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 413, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - - /* "constraint/constraints.py":414 - * for value in domain[:]: - * if value > exactsum: - * 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, 414, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "constraint/constraints.py":413 - * domain = domains[variable] - * for value in domain[:]: - * if value > exactsum: # <<<<<<<<<<<<<< - * domain.remove(value) - * -*/ - } - - /* "constraint/constraints.py":412 - * for variable in variables: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value > exactsum: - * domain.remove(value) -*/ - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "constraint/constraints.py":410 - * domain.remove(value) - * else: - * for variable in variables: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: -*/ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_L3:; - - /* "constraint/constraints.py":399 - * 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":376 + * """ + * + * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * """Initialization method. + * */ /* 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_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.__init__", __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_XDECREF(__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_8__init___2generator); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":416 - * domain.remove(value) +/* "constraint/constraints.py":395 + * 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) * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * multipliers = self._multipliers - * exactsum = self._exactsum */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_18ExactSumConstraint_5__call__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_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_18ExactSumConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18ExactSumConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_18ExactSumConstraint_5__call__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_26VariableExactSumConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_3preProcess(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -10578,8 +10067,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds PyObject *__pyx_v_self = 0; PyObject *__pyx_v_variables = 0; PyObject *__pyx_v_domains = 0; - PyObject *__pyx_v_assignments = 0; - PyObject *__pyx_v_forwardcheck = 0; + PyObject *__pyx_v_constraints = 0; + PyObject *__pyx_v_vconstraints = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -10590,7 +10079,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + __Pyx_RefNannySetupContext("preProcess (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -10600,82 +10089,76 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #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,0}; + 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, 416, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 395, __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, 416, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 395, __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, 416, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 395, __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, 416, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 395, __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, 416, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 395, __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, 416, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 395, __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, 416, __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, 416, __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, 395, __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, 395, __pyx_L3_error) } } + } else if (unlikely(__pyx_nargs != 5)) { + goto __pyx_L5_argtuple_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, 416, __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, 416, __pyx_L3_error) - values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 416, __pyx_L3_error) - values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 416, __pyx_L3_error) - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 416, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_error; - } - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 395, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 395, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 395, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 395, __pyx_L3_error) + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 395, __pyx_L3_error) } __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_v_constraints = ((PyObject*)values[3]); + __pyx_v_vconstraints = ((PyObject*)values[4]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 416, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 395, __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.ExactSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.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, 416, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 416, __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); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 395, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 395, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 395, __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 */ goto __pyx_L0; @@ -10693,1261 +10176,1216 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_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_multipliers = NULL; - PyObject *__pyx_v_exactsum = NULL; - PyObject *__pyx_v_sum = NULL; - int __pyx_v_missing; - PyObject *__pyx_v_variable = NULL; - PyObject *__pyx_v_multiplier = NULL; - PyObject *__pyx_v_domain = NULL; - PyObject *__pyx_v_value = NULL; +/* "constraint/constraints.py":409 + * 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[:]: +*/ + +static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_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_2_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + 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, 409, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_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_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, 409, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.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_26VariableExactSumConstraint_10preProcess_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; - size_t __pyx_t_5; - Py_ssize_t __pyx_t_6; - PyObject *(*__pyx_t_7)(PyObject *); + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *(*__pyx_t_10)(PyObject *); - int __pyx_t_11; - Py_ssize_t __pyx_t_12; - PyObject *(*__pyx_t_13)(PyObject *); + size_t __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 0); - - /* "constraint/constraints.py":417 - * - * 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, 417, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_multipliers = __pyx_t_1; - __pyx_t_1 = 0; - - /* "constraint/constraints.py":418 - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - * multipliers = self._multipliers - * exactsum = self._exactsum # <<<<<<<<<<<<<< - * sum = 0 - * missing = False -*/ - __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, 418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_exactsum = __pyx_t_1; - __pyx_t_1 = 0; - - /* "constraint/constraints.py":419 - * multipliers = self._multipliers - * exactsum = self._exactsum - * sum = 0 # <<<<<<<<<<<<<< - * missing = False - * if multipliers: -*/ - __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); - __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; - - /* "constraint/constraints.py":420 - * exactsum = self._exactsum - * sum = 0 - * missing = False # <<<<<<<<<<<<<< - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): -*/ - __pyx_v_missing = 0; - - /* "constraint/constraints.py":421 - * sum = 0 - * missing = 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, 421, __pyx_L1_error) - if (__pyx_t_2) { - - /* "constraint/constraints.py":422 - * missing = False - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< - * if variable in assignments: - * sum += assignments[variable] * multiplier -*/ + __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, 409, __pyx_L1_error) + } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 409, __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; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_4 = __pyx_builtin_zip; - __pyx_t_5 = 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_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, 422, __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; - } else { - __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __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, 422, __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))) { - { - 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, 422, __pyx_L1_error) - #endif - if (__pyx_t_6 >= __pyx_temp) break; - } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_6); - ++__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, 422, __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_4, __pyx_t_6)); - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); + } 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, 409, __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, 409, __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, 409, __pyx_L1_error) #endif - ++__pyx_t_6; + if (__pyx_t_2 >= __pyx_temp) break; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + ++__pyx_t_2; } else { - __pyx_t_1 = __pyx_t_7(__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, 422, __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, 422, __pyx_L1_error) + { + 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, 409, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; } #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_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, 422, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 422, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_8); - } + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __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, 422, __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_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, 422, __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; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 422, __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_multiplier, __pyx_t_8); - __pyx_t_8 = 0; - - /* "constraint/constraints.py":423 - * 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, 423, __pyx_L1_error) - if (__pyx_t_2) { - - /* "constraint/constraints.py":424 - * for variable, multiplier in zip(variables, multipliers): - * if variable in assignments: - * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< - * else: - * missing = True -*/ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __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, 424, __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, 424, __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":423 - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): - * if variable in assignments: # <<<<<<<<<<<<<< - * sum += assignments[variable] * multiplier - * else: -*/ - goto __pyx_L8; + ++__pyx_t_2; } - - /* "constraint/constraints.py":426 - * sum += assignments[variable] * multiplier - * else: - * missing = True # <<<<<<<<<<<<<< - * if isinstance(sum, float): - * sum = round(sum, 10) -*/ - /*else*/ { - __pyx_v_missing = 1; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __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, 409, __pyx_L1_error) + PyErr_Clear(); + } + break; } - __pyx_L8:; - - /* "constraint/constraints.py":422 - * missing = False - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< - * if variable in assignments: - * sum += assignments[variable] * multiplier -*/ } + __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_var)) { __Pyx_RaiseClosureNameError("var"); __PYX_ERR(0, 409, __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, 409, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "constraint/constraints.py":427 - * else: - * missing = True - * if isinstance(sum, float): # <<<<<<<<<<<<<< - * sum = round(sum, 10) - * if sum > exactsum: -*/ - __pyx_t_2 = PyFloat_Check(__pyx_v_sum); - if (__pyx_t_2) { - - /* "constraint/constraints.py":428 - * missing = True - * if isinstance(sum, float): - * sum = round(sum, 10) # <<<<<<<<<<<<<< - * if sum > exactsum: - * return False -*/ - __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_8 = __pyx_builtin_round; - __pyx_t_5 = 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, 428, __pyx_L1_error) + 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, 409, __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, 409, __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, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = 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)); + __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, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_4); + __pyx_r = __pyx_t_4; __pyx_t_4 = 0; - - /* "constraint/constraints.py":427 - * else: - * missing = True - * if isinstance(sum, float): # <<<<<<<<<<<<<< - * sum = round(sum, 10) - * if sum > exactsum: -*/ + __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, 409, __pyx_L1_error) } + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "constraint/constraints.py":429 - * if isinstance(sum, float): - * sum = round(sum, 10) - * if sum > exactsum: # <<<<<<<<<<<<<< - * return False - * if forwardcheck and missing: -*/ - __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, 429, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 429, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_2) { + /* 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); + __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); + } + __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_11constraints_26VariableExactSumConstraint_10preProcess_5generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - /* "constraint/constraints.py":430 - * sum = round(sum, 10) - * if sum > exactsum: - * return False # <<<<<<<<<<<<<< - * if forwardcheck and missing: - * for variable, multiplier in zip(variables, multipliers): +/* "constraint/constraints.py":410 + * 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_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - /* "constraint/constraints.py":429 - * if isinstance(sum, float): - * sum = round(sum, 10) - * if sum > exactsum: # <<<<<<<<<<<<<< - * return False - * if forwardcheck and missing: -*/ - } +static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_3genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10constraint_11constraints___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_11constraints___pyx_scope_struct_3_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + 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, 410, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_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_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, 410, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } - /* "constraint/constraints.py":431 - * if sum > exactsum: - * return False - * if forwardcheck and missing: # <<<<<<<<<<<<<< - * 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, 431, __pyx_L1_error) - if (__pyx_t_11) { + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.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_26VariableExactSumConstraint_10preProcess_5generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_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; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + size_t __pyx_t_9; + 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, 410, __pyx_L1_error) + } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 410, __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_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) + } + 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, 410, __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, 410, __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, 410, __pyx_L1_error) } else { - __pyx_t_2 = __pyx_t_11; - goto __pyx_L13_bool_binop_done; + __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) + PyErr_Clear(); + } + break; + } } - __pyx_t_2 = __pyx_v_missing; - __pyx_L13_bool_binop_done:; - if (__pyx_t_2) { - - /* "constraint/constraints.py":432 - * return False - * if forwardcheck and missing: - * 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_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_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) + __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, 410, __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_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; { - 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, 432, __pyx_L1_error) + 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)); + __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) __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, 432, __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, 432, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - for (;;) { - 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, 432, __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_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, 432, __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_1, __pyx_t_6)); - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + __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, 410, __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); + __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); + } + __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":395 + * 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) + * +*/ + +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) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess *__pyx_cur_scope; + PyObject *__pyx_v_multipliers = NULL; + PyObject *__pyx_v_multiplier = NULL; + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_others_min = NULL; + PyObject *__pyx_v_others_max = NULL; + PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_2generator1 = 0; + PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_5generator2 = 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; + int __pyx_t_6; + 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_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_1_preProcess *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_preProcess(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess, __pyx_mstate_global->__pyx_empty_tuple, NULL); + 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, 395, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_v_domains = __pyx_v_domains; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_domains); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_domains); + + /* "constraint/constraints.py":396 + * + * 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_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __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, 396, __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_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_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, 396, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":398 + * 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, 398, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_multipliers = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":400 + * 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, 400, __pyx_L1_error) + if (__pyx_t_6) { + + /* "constraint/constraints.py":401 + * + * if multipliers: + * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< + * domain = domains[var] + * 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, 401, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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)); + __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, 401, __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, 401, __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, 401, __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, 401, __pyx_L1_error) #endif - ++__pyx_t_6; + if (__pyx_t_7 >= __pyx_temp) break; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_7); + ++__pyx_t_7; } 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, 432, __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; - 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, 432, __pyx_L1_error) + { + 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, 401, __pyx_L1_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; } #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); - } else { - __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 432, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - } + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7)); #else - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 432, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); #endif - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 432, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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, 432, __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:; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_10 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 432, __pyx_L1_error) - __pyx_L18_unpacking_done:; + ++__pyx_t_7; } - __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; - - /* "constraint/constraints.py":433 - * if forwardcheck and missing: - * 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, 433, __pyx_L1_error) - if (__pyx_t_2) { + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __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, 401, __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, 401, __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_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __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, 401, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __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, 401, __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; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 401, __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; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 401, __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_t_4 = 0; - /* "constraint/constraints.py":434 - * for variable, multiplier in zip(variables, multipliers): - * if variable not in assignments: - * domain = domains[variable] # <<<<<<<<<<<<<< - * for value in domain[:]: - * if sum + value * multiplier > exactsum: + /* "constraint/constraints.py":402 + * 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_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); - __pyx_t_4 = 0; + __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, 402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":435 - * if variable not in assignments: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if sum + value * multiplier > exactsum: - * domain.hideValue(value) + /* "constraint/constraints.py":403 + * 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_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, 435, __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_12 = 0; - __pyx_t_13 = NULL; + __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, 403, __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_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, 403, __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, 403, __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))) { + { + 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, 403, __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_11; } else { - __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 435, __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, 435, __pyx_L1_error) + { + 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, 403, __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)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); + #endif + ++__pyx_t_11; } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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, 435, __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_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, 435, __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)); - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); - #endif - ++__pyx_t_12; - } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error) - } else { - __pyx_t_4 = __pyx_t_13(__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) - PyErr_Clear(); - } - break; - } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 403, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_12(__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, 403, __pyx_L1_error) + PyErr_Clear(); } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); - __pyx_t_4 = 0; + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":436 - * domain = domains[variable] - * for value in domain[:]: - * if sum + value * multiplier > exactsum: # <<<<<<<<<<<<<< - * domain.hideValue(value) - * if not domain: + /* "constraint/constraints.py":404 + * domain = domains[var] + * for value in domain[:]: + * if value * multiplier > max(domains[self.target_var]): # <<<<<<<<<<<<<< + * domain.remove(value) + * else: */ - __pyx_t_4 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __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, 436, __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, 436, __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, 436, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_2) { + __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __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, 404, __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, 404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 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)); + __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, 404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } + __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, 404, __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, 404, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_6) { - /* "constraint/constraints.py":437 - * for value in domain[:]: - * if sum + value * multiplier > exactsum: - * domain.hideValue(value) # <<<<<<<<<<<<<< - * if not domain: - * return False + /* "constraint/constraints.py":405 + * for value in domain[:]: + * if value * multiplier > max(domains[self.target_var]): + * domain.remove(value) # <<<<<<<<<<<<<< + * else: + * for var in self.sum_vars: */ - __pyx_t_8 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_8); - __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_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, 437, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_3); + __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, 405, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + } + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "constraint/constraints.py":436 - * domain = domains[variable] - * for value in domain[:]: - * if sum + value * multiplier > exactsum: # <<<<<<<<<<<<<< - * domain.hideValue(value) - * if not domain: -*/ - } - - /* "constraint/constraints.py":435 - * if variable not in assignments: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if sum + value * multiplier > exactsum: - * domain.hideValue(value) -*/ - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "constraint/constraints.py":438 - * 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, 438, __pyx_L1_error) - __pyx_t_11 = (!__pyx_t_2); - if (__pyx_t_11) { - - /* "constraint/constraints.py":439 - * domain.hideValue(value) - * if not domain: - * return False # <<<<<<<<<<<<<< - * else: - * for variable in variables: -*/ - __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":438 - * if sum + value * multiplier > exactsum: - * domain.hideValue(value) - * if not domain: # <<<<<<<<<<<<<< - * return False + /* "constraint/constraints.py":404 + * domain = domains[var] + * for value in domain[:]: + * if value * multiplier > max(domains[self.target_var]): # <<<<<<<<<<<<<< + * domain.remove(value) * else: -*/ - } - - /* "constraint/constraints.py":433 - * if forwardcheck and missing: - * for variable, multiplier in zip(variables, multipliers): - * if variable not in assignments: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: */ } - /* "constraint/constraints.py":432 - * return False - * if forwardcheck and missing: - * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< - * if variable not in assignments: - * domain = domains[variable] + /* "constraint/constraints.py":403 + * 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":431 - * if sum > exactsum: - * return False - * if forwardcheck and missing: # <<<<<<<<<<<<<< - * for variable, multiplier in zip(variables, multipliers): - * if variable not in assignments: + /* "constraint/constraints.py":401 + * + * if multipliers: + * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< + * domain = domains[var] + * for value in domain[:]: */ } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":421 - * sum = 0 - * missing = False + /* "constraint/constraints.py":400 + * multipliers = self._multipliers + * * if multipliers: # <<<<<<<<<<<<<< - * for variable, multiplier in zip(variables, multipliers): - * if variable in assignments: + * for var, multiplier in zip(self.sum_vars, multipliers): + * domain = domains[var] */ goto __pyx_L3; } - /* "constraint/constraints.py":441 - * return False + /* "constraint/constraints.py":407 + * domain.remove(value) * else: - * for variable in variables: # <<<<<<<<<<<<<< - * if variable in assignments: - * sum += assignments[variable] + * for var in self.sum_vars: # <<<<<<<<<<<<<< + * domain = domains[var] + * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) */ /*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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __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_7 = 0; + __pyx_t_8 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __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, 441, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __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, 407, __pyx_L1_error) } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + 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, 441, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 407, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_7); + ++__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_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 441, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 407, __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_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); + __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); #endif - ++__pyx_t_6; + ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_7(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { + __pyx_t_2 = __pyx_t_8(__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, 441, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 407, __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_2); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_var); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_var, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/constraints.py":442 + /* "constraint/constraints.py":408 * else: - * for variable in variables: - * if variable in assignments: # <<<<<<<<<<<<<< - * sum += assignments[variable] - * 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_11 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 442, __pyx_L1_error) - if (__pyx_t_11) { + __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, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/constraints.py":443 - * for variable in variables: - * if variable in assignments: - * sum += assignments[variable] # <<<<<<<<<<<<<< - * else: - * missing = True + /* "constraint/constraints.py":409 + * 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_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __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, 443, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __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, 409, __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, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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; - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_4); - __pyx_t_4 = 0; - - /* "constraint/constraints.py":442 - * else: - * for variable in variables: - * if variable in assignments: # <<<<<<<<<<<<<< - * sum += assignments[variable] - * else: -*/ - goto __pyx_L28; - } - - /* "constraint/constraints.py":445 - * sum += assignments[variable] - * else: - * missing = True # <<<<<<<<<<<<<< - * if isinstance(sum, float): - * sum = round(sum, 10) -*/ - /*else*/ { - __pyx_v_missing = 1; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_L28:; - - /* "constraint/constraints.py":441 - * return False - * else: - * for variable in variables: # <<<<<<<<<<<<<< - * if variable in assignments: - * sum += assignments[variable] -*/ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "constraint/constraints.py":446 - * else: - * missing = True - * if isinstance(sum, float): # <<<<<<<<<<<<<< - * sum = round(sum, 10) - * if sum > exactsum: -*/ - __pyx_t_11 = PyFloat_Check(__pyx_v_sum); - if (__pyx_t_11) { + __Pyx_XDECREF_SET(__pyx_v_others_min, __pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/constraints.py":447 - * missing = True - * if isinstance(sum, float): - * sum = round(sum, 10) # <<<<<<<<<<<<<< - * if sum > exactsum: - * return False + /* "constraint/constraints.py":410 + * 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_4 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_3 = __pyx_builtin_round; + __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, 410, __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, 410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_5 = 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, 447, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_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, 410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_others_max, __pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/constraints.py":446 - * else: - * missing = True - * if isinstance(sum, float): # <<<<<<<<<<<<<< - * sum = round(sum, 10) - * if sum > exactsum: -*/ - } - - /* "constraint/constraints.py":448 - * if isinstance(sum, float): - * sum = round(sum, 10) - * if sum > exactsum: # <<<<<<<<<<<<<< - * return False - * if forwardcheck and missing: -*/ - __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, 448, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_11) { - - /* "constraint/constraints.py":449 - * sum = round(sum, 10) - * if sum > exactsum: - * return False # <<<<<<<<<<<<<< - * if forwardcheck and missing: - * for variable in variables: -*/ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - - /* "constraint/constraints.py":448 - * if isinstance(sum, float): - * sum = round(sum, 10) - * if sum > exactsum: # <<<<<<<<<<<<<< - * return False - * if forwardcheck and missing: -*/ - } - - /* "constraint/constraints.py":450 - * if sum > exactsum: - * return False - * if forwardcheck and missing: # <<<<<<<<<<<<<< - * 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, 450, __pyx_L1_error) - if (__pyx_t_2) { - } else { - __pyx_t_11 = __pyx_t_2; - goto __pyx_L33_bool_binop_done; - } - __pyx_t_11 = __pyx_v_missing; - __pyx_L33_bool_binop_done:; - if (__pyx_t_11) { - - /* "constraint/constraints.py":451 - * return False - * if forwardcheck and missing: - * for variable in variables: # <<<<<<<<<<<<<< - * if variable not in assignments: - * domain = domains[variable] + /* "constraint/constraints.py":411 + * 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) */ - 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_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, 411, __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_11 = 0; + __pyx_t_12 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __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, 451, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 411, __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, 411, __pyx_L1_error) } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(!__pyx_t_12)) { + if (likely(PyList_CheckExact(__pyx_t_15))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_15); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 451, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 411, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_11 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_15, __pyx_t_11); + ++__pyx_t_11; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_15); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 451, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 411, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + 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_1, __pyx_t_6)); + __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_11)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_15, __pyx_t_11); #endif - ++__pyx_t_6; + ++__pyx_t_11; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_7(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { + __pyx_t_2 = __pyx_t_12(__pyx_t_15); + 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, 451, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 411, __pyx_L1_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":452 - * if forwardcheck and missing: - * 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, 452, __pyx_L1_error) - if (__pyx_t_11) { + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/constraints.py":453 - * for variable in variables: - * if variable not in assignments: - * domain = domains[variable] # <<<<<<<<<<<<<< - * for value in domain[:]: - * if sum + value > exactsum: + /* "constraint/constraints.py":412 + * 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_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_v_value, __pyx_v_others_min); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __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, 412, __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, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __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; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __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, 412, __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, 412, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_6) { - /* "constraint/constraints.py":454 - * if variable not in assignments: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if sum + value > exactsum: - * domain.hideValue(value) + /* "constraint/constraints.py":413 + * 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]): + * 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, 454, __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_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, 454, __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, 454, __pyx_L1_error) + __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_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_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (likely(!__pyx_t_13)) { - 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, 454, __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_12; - } 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, 454, __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)); - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12); - #endif - ++__pyx_t_12; - } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) - } else { - __pyx_t_3 = __pyx_t_13(__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, 454, __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":455 - * 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, 455, __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, 455, __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, 455, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__pyx_t_11) { + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "constraint/constraints.py":456 - * for value in domain[:]: - * if sum + value > exactsum: - * domain.hideValue(value) # <<<<<<<<<<<<<< - * if not domain: - * return False + /* "constraint/constraints.py":412 + * 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_3 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_5 = 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, 456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } - /* "constraint/constraints.py":455 - * domain = domains[variable] - * for value in domain[:]: - * if sum + value > exactsum: # <<<<<<<<<<<<<< - * domain.hideValue(value) - * if not domain: + /* "constraint/constraints.py":414 + * if value + others_min > max(domains[self.target_var]): + * domain.remove(value) + * if value + others_max < min(domains[self.target_var]): # <<<<<<<<<<<<<< + * domain.remove(value) + * */ - } - - /* "constraint/constraints.py":454 - * if variable not in assignments: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if sum + value > exactsum: - * domain.hideValue(value) -*/ - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "constraint/constraints.py":457 - * 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, 457, __pyx_L1_error) - __pyx_t_2 = (!__pyx_t_11); - if (__pyx_t_2) { - - /* "constraint/constraints.py":458 - * domain.hideValue(value) - * if not domain: - * return False # <<<<<<<<<<<<<< - * if missing: - * return sum <= exactsum -*/ - __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_t_13 = PyNumber_Add(__pyx_v_value, __pyx_v_others_max); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 414, __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, 414, __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, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_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, 414, __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, 414, __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, 414, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_6) { - /* "constraint/constraints.py":457 - * if sum + value > exactsum: - * domain.hideValue(value) - * if not domain: # <<<<<<<<<<<<<< - * return False - * if missing: + /* "constraint/constraints.py":415 + * domain.remove(value) + * 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_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_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_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); } + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "constraint/constraints.py":452 - * if forwardcheck and missing: - * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: + /* "constraint/constraints.py":414 + * if value + others_min > max(domains[self.target_var]): + * domain.remove(value) + * if value + others_max < min(domains[self.target_var]): # <<<<<<<<<<<<<< + * domain.remove(value) + * */ } - /* "constraint/constraints.py":451 - * return False - * if forwardcheck and missing: - * for variable in variables: # <<<<<<<<<<<<<< - * if variable not in assignments: - * domain = domains[variable] + /* "constraint/constraints.py":411 + * 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "constraint/constraints.py":450 - * if sum > exactsum: - * return False - * if forwardcheck and missing: # <<<<<<<<<<<<<< - * for variable in variables: - * if variable not in assignments: + /* "constraint/constraints.py":407 + * domain.remove(value) + * 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) */ } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L3:; - /* "constraint/constraints.py":459 - * if not domain: - * return False - * if missing: # <<<<<<<<<<<<<< - * return sum <= exactsum - * else: -*/ - if (__pyx_v_missing) { - - /* "constraint/constraints.py":460 - * return False - * if missing: - * return sum <= 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, 460, __pyx_L1_error) - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "constraint/constraints.py":459 - * if not domain: - * return False - * if missing: # <<<<<<<<<<<<<< - * return sum <= exactsum - * else: -*/ - } - - /* "constraint/constraints.py":462 - * return sum <= exactsum - * else: - * return sum == exactsum # <<<<<<<<<<<<<< + /* "constraint/constraints.py":395 + * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." * - * class VariableExactSumConstraint(Constraint): -*/ - /*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, 462, __pyx_L1_error) - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - } - - /* "constraint/constraints.py":416 - * domain.remove(value) + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * multipliers = self._multipliers - * exactsum = self._exactsum */ /* 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_8); __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("constraint.constraints.ExactSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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:; __Pyx_XDECREF(__pyx_v_multipliers); - __Pyx_XDECREF(__pyx_v_exactsum); - __Pyx_XDECREF(__pyx_v_sum); - __Pyx_XDECREF(__pyx_v_variable); __Pyx_XDECREF(__pyx_v_multiplier); __Pyx_XDECREF(__pyx_v_domain); __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_others_min); + __Pyx_XDECREF(__pyx_v_others_max); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_2generator1); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_5generator2); + __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":475 - * """ +/* "constraint/constraints.py":417 + * domain.remove(value) * - * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< - * """Initialization method. + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * multipliers = self._multipliers * */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_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*/ -PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_26VariableExactSumConstraint___init__, "Initialization method.\n\n Args:\n target_var (Variable): The target variable to sum to.\n sum_vars (sequence of Variables): The variables to sum up.\n multipliers (sequence of numbers): If given, variable values\n (except the last) will be multiplied by the given factors before being\n summed to match the last variable.\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_26VariableExactSumConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_26VariableExactSumConstraint___init__}; -static PyObject *__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_1__init__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_26VariableExactSumConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_5__call__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -11955,20 +11393,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_target_var = 0; - PyObject *__pyx_v_sum_vars = 0; - PyObject *__pyx_v_multipliers = 0; + CYTHON_UNUSED PyObject *__pyx_v_variables = 0; + PyObject *__pyx_v_domains = 0; + PyObject *__pyx_v_assignments = 0; + PyObject *__pyx_v_forwardcheck = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[4] = {0,0,0,0}; + 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("__init__ (wrapper)", 0); + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -11978,74 +11417,82 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #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_target_var,&__pyx_mstate_global->__pyx_n_u_sum_vars,&__pyx_mstate_global->__pyx_n_u_multipliers,0}; + 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, 475, __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 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 417, __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, 475, __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, 475, __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, 475, __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, 475, __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, 475, __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, 475, __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, 417, __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, 417, __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, 417, __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, 475, __pyx_L3_error) - CYTHON_FALLTHROUGH; - case 3: + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 417, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 475, __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, 475, __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, 475, __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; } - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None)); + if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); } __pyx_v_self = values[0]; - __pyx_v_target_var = ((PyObject*)values[1]); - __pyx_v_sum_vars = values[2]; - __pyx_v_multipliers = values[3]; + __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("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 475, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 417, __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.VariableExactSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __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, 475, __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); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 417, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 417, __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 */ goto __pyx_L0; @@ -12063,718 +11510,7031 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_8__init___2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "constraint/constraints.py":491 - * 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." - * -*/ -static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_8__init___genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *__pyx_cur_scope; +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) { + PyObject *__pyx_v_multipliers = NULL; + PyObject *__pyx_v_target_value = NULL; + PyObject *__pyx_v_sum_value = NULL; + int __pyx_v_missing; + PyObject *__pyx_v_var = NULL; + PyObject *__pyx_v_multiplier = NULL; + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_temp_sum = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + 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 *); + 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_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_1_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 491, __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_26VariableExactSumConstraint_8__init___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___ini, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 491, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } + __Pyx_RefNannySetupContext("__call__", 0); - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.__init__.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; -} + /* "constraint/constraints.py":418 + * + * 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, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_multipliers = __pyx_t_1; + __pyx_t_1 = 0; -static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_8__init___2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_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_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, 491, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 491, __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, 491, __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, 491, __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, 491, __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, 491, __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, 491, __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, 491, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_m); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_m, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_6 = PyLong_Check(__pyx_cur_scope->__pyx_v_m); - if (!__pyx_t_6) { - } else { - __pyx_t_5 = __pyx_t_6; - goto __pyx_L7_bool_binop_done; - } - __pyx_t_6 = PyFloat_Check(__pyx_cur_scope->__pyx_v_m); - __pyx_t_5 = __pyx_t_6; - __pyx_L7_bool_binop_done:; - __pyx_t_6 = (!__pyx_t_5); - if (__pyx_t_6) { - __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":420 + * 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, 420, __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, 420, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /*else*/ { + if (__pyx_t_2) { + + /* "constraint/constraints.py":421 + * + * if self.target_var not in assignments: + * return True # can't evaluate without target, defer to later # <<<<<<<<<<<<<< + * + * target_value = assignments[self.target_var] +*/ __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_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":475 - * """ + /* "constraint/constraints.py":420 + * multipliers = self._multipliers * - * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< - * """Initialization method. + * if self.target_var not in assignments: # <<<<<<<<<<<<<< + * return True # can't evaluate without target, defer to later * */ + } -static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstraint___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_26VariableExactSumConstraint_8__init___2generator1 = 0; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - Py_ssize_t __pyx_t_2; - Py_ssize_t __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "constraint/constraints.py":485 - * summed to match the last variable. - * """ - * self.target_var = target_var # <<<<<<<<<<<<<< - * self.sum_vars = sum_vars - * self._multipliers = multipliers + /* "constraint/constraints.py":423 + * return True # can't evaluate without target, defer to later + * + * target_value = assignments[self.target_var] # <<<<<<<<<<<<<< + * sum_value = 0 + * missing = False */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_v_target_var) < 0) __PYX_ERR(0, 485, __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, 423, __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, 423, __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":486 - * """ - * self.target_var = target_var - * self.sum_vars = sum_vars # <<<<<<<<<<<<<< - * self._multipliers = multipliers + /* "constraint/constraints.py":424 + * + * target_value = assignments[self.target_var] + * sum_value = 0 # <<<<<<<<<<<<<< + * missing = False * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars, __pyx_v_sum_vars) < 0) __PYX_ERR(0, 486, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_sum_value = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":487 - * self.target_var = target_var - * self.sum_vars = sum_vars - * self._multipliers = multipliers # <<<<<<<<<<<<<< + /* "constraint/constraints.py":425 + * target_value = assignments[self.target_var] + * sum_value = 0 + * missing = False # <<<<<<<<<<<<<< * * if multipliers: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2, __pyx_v_multipliers) < 0) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_v_missing = 0; - /* "constraint/constraints.py":489 - * self._multipliers = multipliers + /* "constraint/constraints.py":427 + * missing = False * * 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." + * for var, multiplier in zip(self.sum_vars, multipliers): + * if var in assignments: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 489, __pyx_L1_error) - if (__pyx_t_1) { + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 427, __pyx_L1_error) + if (__pyx_t_2) { - /* "constraint/constraints.py":490 + /* "constraint/constraints.py":428 * * 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." -*/ - #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, 490, __pyx_L1_error) - __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 490, __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, 490, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 490, __pyx_L1_error) - #endif - - /* "constraint/constraints.py":491 - * 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." - * + * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< + * if var in assignments: + * sum_value += assignments[var] * multiplier */ - #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, 491, __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, 491, __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, 491, __pyx_L1_error) + __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, 428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = 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)); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __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, 491, __pyx_L1_error) - } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - #else - if ((1)); else __PYX_ERR(0, 491, __pyx_L1_error) - #endif - - /* "constraint/constraints.py":492 - * 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." # <<<<<<<<<<<<<< - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 + 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, 428, __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, 428, __pyx_L1_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, 428, __pyx_L1_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_7); + ++__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, 428, __pyx_L1_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, 428, __pyx_L1_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, 428, __pyx_L1_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, 428, __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_INCREF(__pyx_t_1); + } else { + __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_1); + } + #else + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #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, 428, __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; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_10 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L8_unpacking_done; + __pyx_L7_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, 428, __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_t_1 = 0; + + /* "constraint/constraints.py":429 + * if multipliers: + * for var, multiplier in zip(self.sum_vars, multipliers): + * if var in assignments: # <<<<<<<<<<<<<< + * sum_value += assignments[var] * multiplier + * else: */ - #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); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 492, __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, 492, __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, 492, __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, 429, __pyx_L1_error) + if (__pyx_t_2) { + + /* "constraint/constraints.py":430 + * 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, 430, __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, 430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __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, 430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); + __pyx_t_3 = 0; + + /* "constraint/constraints.py":429 + * if multipliers: + * for var, multiplier in zip(self.sum_vars, multipliers): + * if var in assignments: # <<<<<<<<<<<<<< + * sum_value += assignments[var] * multiplier + * else: +*/ + goto __pyx_L9; + } + + /* "constraint/constraints.py":432 + * sum_value += assignments[var] * multiplier + * else: + * missing = True # <<<<<<<<<<<<<< + * else: + * for var in self.sum_vars: +*/ + /*else*/ { + __pyx_v_missing = 1; } + __pyx_L9:; + + /* "constraint/constraints.py":428 + * + * if multipliers: + * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< + * if var in assignments: + * sum_value += assignments[var] * multiplier +*/ } - #else - if ((1)); else __PYX_ERR(0, 492, __pyx_L1_error) - #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":489 - * self._multipliers = multipliers + /* "constraint/constraints.py":427 + * missing = False * * 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." + * for var, multiplier in zip(self.sum_vars, multipliers): + * if var in assignments: */ + goto __pyx_L4; } - /* "constraint/constraints.py":475 - * """ - * - * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< - * """Initialization method. - * + /* "constraint/constraints.py":434 + * missing = True + * else: + * for var in self.sum_vars: # <<<<<<<<<<<<<< + * if var in assignments: + * 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, 434, __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; + } else { + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __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, 434, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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, 434, __pyx_L1_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_7); + ++__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, 434, __pyx_L1_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_3, __pyx_t_7)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); + #endif + ++__pyx_t_7; + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error) + } else { + __pyx_t_4 = __pyx_t_8(__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, 434, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); + __pyx_t_4 = 0; - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_8__init___2generator1); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "constraint/constraints.py":435 + * 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, 435, __pyx_L1_error) + if (__pyx_t_2) { -/* "constraint/constraints.py":494 - * 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":436 + * 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, 436, __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, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_1); + __pyx_t_1 = 0; -/* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_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_26VariableExactSumConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_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, 494, __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, 494, __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, 494, __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, 494, __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, 494, __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, 494, __pyx_L3_error) - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; + /* "constraint/constraints.py":435 + * else: + * for var in self.sum_vars: + * if var in assignments: # <<<<<<<<<<<<<< + * sum_value += assignments[var] + * else: +*/ + goto __pyx_L13; } - 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, 494, __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, 494, __pyx_L3_error) } + + /* "constraint/constraints.py":438 + * sum_value += assignments[var] + * else: + * sum_value += min(domains[var]) # use min value if not assigned # <<<<<<<<<<<<<< + * missing = True + * +*/ + /*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, 438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_6 = 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)); + __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, 438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 438, __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; + + /* "constraint/constraints.py":439 + * else: + * sum_value += min(domains[var]) # use min value if not assigned + * missing = True # <<<<<<<<<<<<<< + * + * if isinstance(sum_value, float): +*/ + __pyx_v_missing = 1; } - } 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, 494, __pyx_L3_error) - values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 494, __pyx_L3_error) - values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 494, __pyx_L3_error) - values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 494, __pyx_L3_error) - values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 494, __pyx_L3_error) + __pyx_L13:; + + /* "constraint/constraints.py":434 + * missing = True + * else: + * for var in self.sum_vars: # <<<<<<<<<<<<<< + * if var in assignments: + * sum_value += assignments[var] +*/ } - __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, 494, __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_3); __pyx_t_3 = 0; } - __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.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, 494, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 494, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 494, __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); + __pyx_L4:; - /* 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_26VariableExactSumConstraint_10preProcess_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + /* "constraint/constraints.py":441 + * missing = True + * + * if isinstance(sum_value, float): # <<<<<<<<<<<<<< + * sum_value = round(sum_value, 10) + * +*/ + __pyx_t_2 = PyFloat_Check(__pyx_v_sum_value); + if (__pyx_t_2) { -/* "constraint/constraints.py":508 - * 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[:]: + /* "constraint/constraints.py":442 + * + * 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; + { + 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, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); + __pyx_t_3 = 0; -static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_11constraints___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_11constraints___pyx_scope_struct_3_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); - 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, 508, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_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_26VariableExactSumConstraint_10preProcess_2generator2, ((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, 508, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; + /* "constraint/constraints.py":441 + * missing = True + * + * if isinstance(sum_value, float): # <<<<<<<<<<<<<< + * sum_value = round(sum_value, 10) + * +*/ } - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.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; -} + /* "constraint/constraints.py":444 + * sum_value = round(sum_value, 10) + * + * if missing: # <<<<<<<<<<<<<< + * # Partial assignments: only check feasibility + * if sum_value > target_value: +*/ + if (__pyx_v_missing) { -static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_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; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - size_t __pyx_t_9; - 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, 508, __pyx_L1_error) - } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 508, __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, 508, __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, 508, __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, 508, __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; + /* "constraint/constraints.py":446 + * 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, 446, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "constraint/constraints.py":447 + * # Partial assignments: only check feasibility + * if sum_value > target_value: + * return False # <<<<<<<<<<<<<< + * if forwardcheck: + * for var in self.sum_vars: +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "constraint/constraints.py":446 + * if missing: + * # Partial assignments: only check feasibility + * if sum_value > target_value: # <<<<<<<<<<<<<< + * return False + * if forwardcheck: +*/ + } + + /* "constraint/constraints.py":448 + * 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, 448, __pyx_L1_error) + if (__pyx_t_2) { + + /* "constraint/constraints.py":449 + * 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, 449, __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; } 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, 508, __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; + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __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, 449, __pyx_L1_error) } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 508, __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, 508, __pyx_L1_error) - PyErr_Clear(); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 449, __pyx_L1_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_7); + ++__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, 449, __pyx_L1_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_1, __pyx_t_7)); + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); + #endif + ++__pyx_t_7; + } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L1_error) + } else { + __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, 449, __pyx_L1_error) + PyErr_Clear(); + } + break; + } } - 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_var)) { __Pyx_RaiseClosureNameError("var"); __PYX_ERR(0, 508, __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, 508, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 508, __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, 508, __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, 508, __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, 508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = 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)); - __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, 508, __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, 508, __pyx_L1_error) - } - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); + __pyx_t_3 = 0; - /* 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); - __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); - } - __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_11constraints_26VariableExactSumConstraint_10preProcess_5generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + /* "constraint/constraints.py":450 + * 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, 450, __pyx_L1_error) + if (__pyx_t_2) { -/* "constraint/constraints.py":509 - * 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]): + /* "constraint/constraints.py":451 + * 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, 451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); + __pyx_t_3 = 0; -static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_3genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_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_4_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); - 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, 509, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_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_26VariableExactSumConstraint_10preProcess_5generator3, ((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_VariableExactSumConstraint_prePr, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 509, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } + /* "constraint/constraints.py":452 + * 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, 452, __pyx_L1_error) + if (__pyx_t_2) { + + /* "constraint/constraints.py":453 + * 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, 453, __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_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, 453, __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, 453, __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))) { + { + 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, 453, __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_11; + } 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, 453, __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)); + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_11); + #endif + ++__pyx_t_11; + } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) + } else { + __pyx_t_3 = __pyx_t_12(__pyx_t_5); + 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, 453, __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":454 + * 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, 454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __pyx_t_4; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_6 = 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, 454, __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, 454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __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, 454, __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, 454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_temp_sum, __pyx_t_4); + __pyx_t_4 = 0; + + /* "constraint/constraints.py":455 + * 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, 455, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 455, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_2) { + + /* "constraint/constraints.py":456 + * temp_sum = sum_value + (value * multipliers[self.sum_vars.index(var)]) + * if temp_sum > target_value: + * domain.hideValue(value) # <<<<<<<<<<<<<< + * else: + * for value in domain[:]: +*/ + __pyx_t_3 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_6 = 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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":455 + * for value in domain[:]: + * temp_sum = sum_value + (value * multipliers[self.sum_vars.index(var)]) + * if temp_sum > target_value: # <<<<<<<<<<<<<< + * domain.hideValue(value) + * else: +*/ + } + + /* "constraint/constraints.py":453 + * 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "constraint/constraints.py":452 + * 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)]) +*/ + goto __pyx_L22; + } + + /* "constraint/constraints.py":458 + * domain.hideValue(value) + * else: + * for value in domain[:]: # <<<<<<<<<<<<<< + * temp_sum = sum_value + value + * if temp_sum > 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, 458, __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_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, 458, __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, 458, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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, 458, __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_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, 458, __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)); + #else + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); + #endif + ++__pyx_t_11; + } + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 458, __pyx_L1_error) + } else { + __pyx_t_5 = __pyx_t_12(__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, 458, __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":459 + * 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, 459, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_temp_sum, __pyx_t_5); + __pyx_t_5 = 0; + + /* "constraint/constraints.py":460 + * for value in domain[:]: + * temp_sum = sum_value + value + * if temp_sum > 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, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 460, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_2) { + + /* "constraint/constraints.py":461 + * temp_sum = sum_value + value + * if temp_sum > 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; + { + 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, 461, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "constraint/constraints.py":460 + * for value in domain[:]: + * temp_sum = sum_value + value + * if temp_sum > target_value: # <<<<<<<<<<<<<< + * domain.hideValue(value) + * if not domain: +*/ + } + + /* "constraint/constraints.py":458 + * domain.hideValue(value) + * else: + * for value in domain[:]: # <<<<<<<<<<<<<< + * temp_sum = sum_value + value + * if temp_sum > target_value: +*/ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_L22:; + + /* "constraint/constraints.py":462 + * if temp_sum > 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, 462, __pyx_L1_error) + __pyx_t_13 = (!__pyx_t_2); + if (__pyx_t_13) { + + /* "constraint/constraints.py":463 + * domain.hideValue(value) + * if not domain: + * return False # <<<<<<<<<<<<<< + * return True + * else: +*/ + __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":462 + * if temp_sum > target_value: + * domain.hideValue(value) + * if not domain: # <<<<<<<<<<<<<< + * return False + * return True +*/ + } + + /* "constraint/constraints.py":450 + * if forwardcheck: + * for var in self.sum_vars: + * if var not in assignments: # <<<<<<<<<<<<<< + * domain = domains[var] + * if multipliers: +*/ + } + + /* "constraint/constraints.py":449 + * return False + * if forwardcheck: + * for var in self.sum_vars: # <<<<<<<<<<<<<< + * if var not in assignments: + * domain = domains[var] +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":448 + * if sum_value > target_value: + * return False + * if forwardcheck: # <<<<<<<<<<<<<< + * for var in self.sum_vars: + * if var not in assignments: +*/ + } + + /* "constraint/constraints.py":464 + * if not domain: + * return False + * return True # <<<<<<<<<<<<<< + * else: + * return sum_value == target_value +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "constraint/constraints.py":444 + * sum_value = round(sum_value, 10) + * + * if missing: # <<<<<<<<<<<<<< + * # Partial assignments: only check feasibility + * if sum_value > target_value: +*/ + } + + /* "constraint/constraints.py":466 + * return True + * else: + * return sum_value == target_value # <<<<<<<<<<<<<< + * + * +*/ + /*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, 466, __pyx_L1_error) + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "constraint/constraints.py":417 + * domain.remove(value) + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * multipliers = self._multipliers + * +*/ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_multipliers); + __Pyx_XDECREF(__pyx_v_target_value); + __Pyx_XDECREF(__pyx_v_sum_value); + __Pyx_XDECREF(__pyx_v_var); + __Pyx_XDECREF(__pyx_v_multiplier); + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_temp_sum); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":480 + * """ + * + * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_16MinSumConstraint_1__init__(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_16MinSumConstraint___init__, "Initialization method.\n\n Args:\n minsum (number): Value to be considered as the minimum sum\n multipliers (sequence of numbers): If given, variable values\n will be multiplied by the given factors before being\n summed to be checked\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_16MinSumConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_16MinSumConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_16MinSumConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_16MinSumConstraint_1__init__(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_minsum = 0; + PyObject *__pyx_v_multipliers = 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("__init__ (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_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, 480, __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, 480, __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, 480, __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, 480, __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, 480, __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, 480, __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, 480, __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, 480, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 480, __pyx_L3_error) + break; + default: goto __pyx_L5_argtuple_error; + } + if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); + } + __pyx_v_self = values[0]; + __pyx_v_minsum = values[1]; + __pyx_v_multipliers = values[2]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 480, __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.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10constraint_11constraints_16MinSumConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_minsum, __pyx_v_multipliers); + + /* 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_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 + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "constraint/constraints.py":489 + * summed to be checked + * """ + * self._minsum = minsum # <<<<<<<<<<<<<< + * self._multipliers = multipliers + * +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_minsum_2, __pyx_v_minsum) < 0) __PYX_ERR(0, 489, __pyx_L1_error) + + /* "constraint/constraints.py":490 + * """ + * self._minsum = minsum + * self._multipliers = multipliers # <<<<<<<<<<<<<< + * + * 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, 490, __pyx_L1_error) + + /* "constraint/constraints.py":480 + * """ + * + * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.MinSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":492 + * self._multipliers = multipliers + * + * 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: +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_16MinSumConstraint_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_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, +#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; + CYTHON_UNUSED PyObject *__pyx_v_domains = 0; + PyObject *__pyx_v_assignments = 0; + CYTHON_UNUSED PyObject *__pyx_v_forwardcheck = 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("__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,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, 492, __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, 492, __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, 492, __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, 492, __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, 492, __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, 492, __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, 492, __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, 492, __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, 492, __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, 492, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 492, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 492, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 492, __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, 492, __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.__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, 492, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 492, __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); + + /* 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_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; + PyObject *__pyx_v_multipliers = NULL; + PyObject *__pyx_v_minsum = NULL; + PyObject *__pyx_v_sum = 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; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *(*__pyx_t_10)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "constraint/constraints.py":494 + * 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, 494, __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, 494, __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, 494, __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, 494, __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, 494, __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, 494, __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":495 + * # 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, 495, __pyx_L1_error) + if (__pyx_t_5) { + + /* "constraint/constraints.py":496 + * 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":495 + * # check if each variable is in the assignments + * for variable in variables: + * if variable not in assignments: # <<<<<<<<<<<<<< + * return True + * +*/ + } + + /* "constraint/constraints.py":494 + * 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":499 + * + * # with each variable assigned, sum the values + * 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, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_multipliers = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":500 + * # with each variable assigned, sum the values + * multipliers = self._multipliers + * minsum = self._minsum # <<<<<<<<<<<<<< + * sum = 0 + * if multipliers: +*/ + __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, 500, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_minsum = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":501 + * multipliers = self._multipliers + * minsum = self._minsum + * sum = 0 # <<<<<<<<<<<<<< + * if multipliers: + * for variable, multiplier in zip(variables, multipliers): +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; + + /* "constraint/constraints.py":502 + * minsum = self._minsum + * sum = 0 + * if multipliers: # <<<<<<<<<<<<<< + * for variable, multiplier in zip(variables, multipliers): + * sum += assignments[variable] * multiplier +*/ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 502, __pyx_L1_error) + if (__pyx_t_5) { + + /* "constraint/constraints.py":503 + * sum = 0 + * if multipliers: + * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< + * sum += assignments[variable] * multiplier + * else: +*/ + __pyx_t_4 = NULL; + __Pyx_INCREF(__pyx_builtin_zip); + __pyx_t_6 = __pyx_builtin_zip; + __pyx_t_7 = 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, 503, __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; + } else { + __pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 503, __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, 503, __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))) { + { + 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, 503, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_2); + ++__pyx_t_2; + } 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, 503, __pyx_L1_error) + #endif + 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_6, __pyx_t_2)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_2); + #endif + ++__pyx_t_2; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_3(__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, 503, __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, 503, __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_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, 503, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 503, __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, 503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 503, __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, 503, __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; + __Pyx_GOTREF(__pyx_t_8); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 503, __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:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 503, __pyx_L1_error) + __pyx_L11_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); + __pyx_t_8 = 0; + + /* "constraint/constraints.py":504 + * if multipliers: + * for variable, multiplier in zip(variables, multipliers): + * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< + * 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, 504, __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, 504, __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, 504, __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":503 + * sum = 0 + * if multipliers: + * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< + * sum += assignments[variable] * multiplier + * else: +*/ + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "constraint/constraints.py":502 + * minsum = self._minsum + * sum = 0 + * if multipliers: # <<<<<<<<<<<<<< + * for variable, multiplier in zip(variables, multipliers): + * sum += assignments[variable] * multiplier +*/ + goto __pyx_L7; + } + + /* "constraint/constraints.py":506 + * sum += assignments[variable] * multiplier + * else: + * for variable in variables: # <<<<<<<<<<<<<< + * sum += assignments[variable] + * if isinstance(sum, float): +*/ + /*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; + } else { + __pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 506, __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, 506, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_6))) { + { + 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, 506, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_2); + ++__pyx_t_2; + } 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, 506, __pyx_L1_error) + #endif + 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_6, __pyx_t_2)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_2); + #endif + ++__pyx_t_2; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 506, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_3(__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, 506, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":507 + * else: + * for variable in variables: + * sum += assignments[variable] # <<<<<<<<<<<<<< + * 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, 507, __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, 507, __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":506 + * sum += assignments[variable] * multiplier + * else: + * for variable in variables: # <<<<<<<<<<<<<< + * sum += assignments[variable] + * if isinstance(sum, float): +*/ + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_L7:; + + /* "constraint/constraints.py":508 + * for variable in variables: + * sum += assignments[variable] + * if isinstance(sum, float): # <<<<<<<<<<<<<< + * sum = round(sum, 10) + * return sum >= minsum +*/ + __pyx_t_5 = PyFloat_Check(__pyx_v_sum); + if (__pyx_t_5) { + + /* "constraint/constraints.py":509 + * sum += assignments[variable] + * if isinstance(sum, float): + * sum = round(sum, 10) # <<<<<<<<<<<<<< + * return sum >= minsum + * +*/ + __pyx_t_8 = NULL; + __Pyx_INCREF(__pyx_builtin_round); + __pyx_t_1 = __pyx_builtin_round; + __pyx_t_7 = 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_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, 509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_6); + __pyx_t_6 = 0; + + /* "constraint/constraints.py":508 + * for variable in variables: + * sum += assignments[variable] + * if isinstance(sum, float): # <<<<<<<<<<<<<< + * sum = round(sum, 10) + * return sum >= minsum +*/ + } + + /* "constraint/constraints.py":510 + * if isinstance(sum, float): + * sum = round(sum, 10) + * return sum >= minsum # <<<<<<<<<<<<<< + * + * 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, 510, __pyx_L1_error) + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "constraint/constraints.py":492 + * self._multipliers = multipliers + * + * 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: +*/ + + /* 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_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_multiplier); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":523 + * """ # noqa: E501 + * + * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_24VariableMinSumConstraint_1__init__(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_24VariableMinSumConstraint___init__, "Initialization method.\n\n Args:\n target_var (Variable): The target variable to sum to.\n sum_vars (sequence of Variables): The variables to sum up.\n multipliers (sequence of numbers): If given, variable values\n (except the last) will be multiplied by the given factors before being\n summed to match the last variable.\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_24VariableMinSumConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_24VariableMinSumConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_24VariableMinSumConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_24VariableMinSumConstraint_1__init__(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_target_var = 0; + PyObject *__pyx_v_sum_vars = 0; + PyObject *__pyx_v_multipliers = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {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("__init__ (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_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, 523, __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, 523, __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, 523, __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, 523, __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, 523, __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, 523, __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, 523, __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, 523, __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, 523, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 523, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 523, __pyx_L3_error) + break; + default: goto __pyx_L5_argtuple_error; + } + if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None)); + } + __pyx_v_self = values[0]; + __pyx_v_target_var = ((PyObject*)values[1]); + __pyx_v_sum_vars = values[2]; + __pyx_v_multipliers = values[3]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 523, __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.VariableMinSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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, 523, __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 */ + 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_24VariableMinSumConstraint_8__init___2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "constraint/constraints.py":539 + * 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." + * +*/ + +static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_8__init___genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_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_4_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + 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, 539, __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_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, 539, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.VariableMinSumConstraint.__init__.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_24VariableMinSumConstraint_8__init___2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_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_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, 539, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 539, __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, 539, __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, 539, __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, 539, __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, 539, __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, 539, __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, 539, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_m); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_m, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_6 = PyLong_Check(__pyx_cur_scope->__pyx_v_m); + if (!__pyx_t_6) { + } else { + __pyx_t_5 = __pyx_t_6; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_6 = PyFloat_Check(__pyx_cur_scope->__pyx_v_m); + __pyx_t_5 = __pyx_t_6; + __pyx_L7_bool_binop_done:; + __pyx_t_6 = (!__pyx_t_5); + if (__pyx_t_6) { + __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_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":523 + * """ # noqa: E501 + * + * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + +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) { + PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_8__init___2generator3 = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "constraint/constraints.py":533 + * 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, 533, __pyx_L1_error) + + /* "constraint/constraints.py":534 + * """ + * 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, 534, __pyx_L1_error) + + /* "constraint/constraints.py":535 + * 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, 535, __pyx_L1_error) + + /* "constraint/constraints.py":537 + * 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, 537, __pyx_L1_error) + if (__pyx_t_1) { + + /* "constraint/constraints.py":538 + * + * 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." +*/ + #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, 538, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 538, __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, 538, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 538, __pyx_L1_error) + #endif + + /* "constraint/constraints.py":539 + * 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." + * +*/ + #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, 539, __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, 539, __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, 539, __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, 539, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 539, __pyx_L1_error) + #endif + + /* "constraint/constraints.py":540 + * 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." # <<<<<<<<<<<<<< + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 +*/ + #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); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 540, __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, 540, __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, 540, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 540, __pyx_L1_error) + #endif + + /* "constraint/constraints.py":537 + * 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." +*/ + } + + /* "constraint/constraints.py":523 + * """ # noqa: E501 + * + * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("constraint.constraints.VariableMinSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_8__init___2generator3); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":542 + * 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) + * +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_24VariableMinSumConstraint_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_24VariableMinSumConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_24VariableMinSumConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_24VariableMinSumConstraint_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, 542, __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, 542, __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, 542, __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, 542, __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, 542, __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, 542, __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, 542, __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, 542, __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, 542, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 542, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 542, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 542, __pyx_L3_error) + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 542, __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, 542, __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.VariableMinSumConstraint.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, 542, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 542, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 542, __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 */ + 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_24VariableMinSumConstraint_10preProcess_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "constraint/constraints.py":550 + * 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[:]: + * if value + others_max < min(domains[self.target_var]): +*/ + +static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_10preProcess_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_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_6_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_6_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + 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, 550, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_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_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, 550, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.VariableMinSumConstraint.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_24VariableMinSumConstraint_10preProcess_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_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; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + size_t __pyx_t_9; + 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, 550, __pyx_L1_error) + } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 550, __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, 550, __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, 550, __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, 550, __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, 550, __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, 550, __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, 550, __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_var)) { __Pyx_RaiseClosureNameError("var"); __PYX_ERR(0, 550, __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, 550, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 550, __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, 550, __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, 550, __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, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = 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)); + __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, 550, __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, 550, __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); + __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); + } + __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":542 + * 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) + * +*/ + +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) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *__pyx_cur_scope; + PyObject *__pyx_v_multipliers = NULL; + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_others_max = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_10preProcess_2generator4 = 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; + int __pyx_t_6; + int __pyx_t_7; + 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 *); + 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_5_preProcess *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_preProcess(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess, __pyx_mstate_global->__pyx_empty_tuple, NULL); + 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, 542, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_v_domains = __pyx_v_domains; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_domains); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_domains); + + /* "constraint/constraints.py":543 + * + * 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_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 543, __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, 543, __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_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_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, 543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":545 + * 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, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_multipliers = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":547 + * 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, 547, __pyx_L1_error) + __pyx_t_7 = (!__pyx_t_6); + if (__pyx_t_7) { + + /* "constraint/constraints.py":548 + * + * 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, 548, __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, 548, __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, 548, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_9)) { + 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, 548, __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_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, 548, __pyx_L1_error) + #endif + if (__pyx_t_8 >= __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_8)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_8); + #endif + ++__pyx_t_8; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __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, 548, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_var); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_var, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":549 + * 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, 549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":550 + * 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[:]: + * 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, 550, __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, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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)); + __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, 550, __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":551 + * 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, 551, __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, 551, __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, 551, __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, 551, __pyx_L1_error) + #endif + if (__pyx_t_12 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12); + ++__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, 551, __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, 551, __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, 551, __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":552 + * 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, 552, __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, 552, __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, 552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 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, 552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + } + __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, 552, __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, 552, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_7) { + + /* "constraint/constraints.py":553 + * 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_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, 553, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "constraint/constraints.py":552 + * 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) + * +*/ + } + + /* "constraint/constraints.py":551 + * 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":548 + * + * 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_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":547 + * multipliers = self._multipliers + * + * if not multipliers: # <<<<<<<<<<<<<< + * for var in self.sum_vars: + * domain = domains[var] +*/ + } + + /* "constraint/constraints.py":542 + * 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) + * +*/ + + /* 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_10); + __Pyx_XDECREF(__pyx_t_11); + __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:; + __Pyx_XDECREF(__pyx_v_multipliers); + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_others_max); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_10preProcess_2generator4); + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":555 + * domain.remove(value) + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * multipliers = self._multipliers + * +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_24VariableMinSumConstraint_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_24VariableMinSumConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_24VariableMinSumConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_24VariableMinSumConstraint_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 +) { + PyObject *__pyx_v_self = 0; + CYTHON_UNUSED PyObject *__pyx_v_variables = 0; + PyObject *__pyx_v_domains = 0; + PyObject *__pyx_v_assignments = 0; + CYTHON_UNUSED PyObject *__pyx_v_forwardcheck = 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("__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,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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 555, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + 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, 555, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 555, __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, 555, __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.VariableMinSumConstraint.__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, 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_24VariableMinSumConstraint_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_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) { + PyObject *__pyx_v_multipliers = NULL; + PyObject *__pyx_v_target_value = NULL; + PyObject *__pyx_v_sum_value = NULL; + PyObject *__pyx_v_var = NULL; + PyObject *__pyx_v_multiplier = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + 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 *); + 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":556 + * + * 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, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_multipliers = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":558 + * 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, 558, __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, 558, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "constraint/constraints.py":559 + * + * if self.target_var not in assignments: + * return True # can't evaluate without target, defer to later # <<<<<<<<<<<<<< + * + * target_value = assignments[self.target_var] +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "constraint/constraints.py":558 + * multipliers = self._multipliers + * + * if self.target_var not in assignments: # <<<<<<<<<<<<<< + * return True # can't evaluate without target, defer to later + * +*/ + } + + /* "constraint/constraints.py":561 + * 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, 561, __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, 561, __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":562 + * + * target_value = assignments[self.target_var] + * sum_value = 0 # <<<<<<<<<<<<<< + * + * if multipliers: +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_sum_value = __pyx_mstate_global->__pyx_int_0; + + /* "constraint/constraints.py":564 + * 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, 564, __pyx_L1_error) + if (__pyx_t_2) { + + /* "constraint/constraints.py":565 + * + * if multipliers: + * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< + * if var in assignments: + * 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, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = 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)); + __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, 565, __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; + } else { + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 565, __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, 565, __pyx_L1_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, 565, __pyx_L1_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_7); + ++__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, 565, __pyx_L1_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, 565, __pyx_L1_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, 565, __pyx_L1_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, 565, __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_INCREF(__pyx_t_1); + } else { + __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 565, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_1); + } + #else + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #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, 565, __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; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 565, __pyx_L1_error) + __pyx_t_10 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L8_unpacking_done; + __pyx_L7_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, 565, __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_t_1 = 0; + + /* "constraint/constraints.py":566 + * 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, 566, __pyx_L1_error) + if (__pyx_t_2) { + + /* "constraint/constraints.py":567 + * 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, 567, __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, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __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, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); + __pyx_t_3 = 0; + + /* "constraint/constraints.py":566 + * if multipliers: + * for var, multiplier in zip(self.sum_vars, multipliers): + * if var in assignments: # <<<<<<<<<<<<<< + * sum_value += assignments[var] * multiplier + * else: +*/ + goto __pyx_L9; + } + + /* "constraint/constraints.py":569 + * sum_value += assignments[var] * multiplier + * else: + * sum_value += max(domains[var] * multiplier) # use max value if not assigned # <<<<<<<<<<<<<< + * else: + * 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, 569, __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, 569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_6 = 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, 569, __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, 569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_5); + __pyx_t_5 = 0; + } + __pyx_L9:; + + /* "constraint/constraints.py":565 + * + * if multipliers: + * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< + * if var in assignments: + * sum_value += assignments[var] * multiplier +*/ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":564 + * sum_value = 0 + * + * if multipliers: # <<<<<<<<<<<<<< + * for var, multiplier in zip(self.sum_vars, multipliers): + * if var in assignments: +*/ + goto __pyx_L4; + } + + /* "constraint/constraints.py":571 + * sum_value += max(domains[var] * multiplier) # use max value if not assigned + * else: + * for var in self.sum_vars: # <<<<<<<<<<<<<< + * if var in assignments: + * 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, 571, __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; + } else { + __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __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, 571, __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))) { + { + 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, 571, __pyx_L1_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_7); + ++__pyx_t_7; + } 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, 571, __pyx_L1_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_5, __pyx_t_7)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7); + #endif + ++__pyx_t_7; + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error) + } else { + __pyx_t_4 = __pyx_t_8(__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, 571, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); + __pyx_t_4 = 0; + + /* "constraint/constraints.py":572 + * 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, 572, __pyx_L1_error) + if (__pyx_t_2) { + + /* "constraint/constraints.py":573 + * 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, 573, __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, 573, __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":572 + * else: + * for var in self.sum_vars: + * if var in assignments: # <<<<<<<<<<<<<< + * sum_value += assignments[var] + * else: +*/ + goto __pyx_L13; + } + + /* "constraint/constraints.py":575 + * sum_value += assignments[var] + * else: + * sum_value += max(domains[var]) # use max value if not assigned # <<<<<<<<<<<<<< + * + * if isinstance(sum_value, float): +*/ + /*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, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = 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)); + __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, 575, __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, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_11); + __pyx_t_11 = 0; + } + __pyx_L13:; + + /* "constraint/constraints.py":571 + * sum_value += max(domains[var] * multiplier) # use max value if not assigned + * else: + * for var in self.sum_vars: # <<<<<<<<<<<<<< + * if var in assignments: + * sum_value += assignments[var] +*/ + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_L4:; + + /* "constraint/constraints.py":577 + * sum_value += max(domains[var]) # use max value if not assigned + * + * if isinstance(sum_value, float): # <<<<<<<<<<<<<< + * sum_value = round(sum_value, 10) + * +*/ + __pyx_t_2 = PyFloat_Check(__pyx_v_sum_value); + if (__pyx_t_2) { + + /* "constraint/constraints.py":578 + * + * 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; + { + 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, 578, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_5); + __pyx_t_5 = 0; + + /* "constraint/constraints.py":577 + * sum_value += max(domains[var]) # use max value if not assigned + * + * if isinstance(sum_value, float): # <<<<<<<<<<<<<< + * sum_value = round(sum_value, 10) + * +*/ + } + + /* "constraint/constraints.py":580 + * sum_value = round(sum_value, 10) + * + * return sum_value >= target_value # <<<<<<<<<<<<<< + * + * +*/ + __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, 580, __pyx_L1_error) + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "constraint/constraints.py":555 + * domain.remove(value) + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * multipliers = self._multipliers + * +*/ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __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:; + __Pyx_XDECREF(__pyx_v_multipliers); + __Pyx_XDECREF(__pyx_v_target_value); + __Pyx_XDECREF(__pyx_v_sum_value); + __Pyx_XDECREF(__pyx_v_var); + __Pyx_XDECREF(__pyx_v_multiplier); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":594 + * """ + * + * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_16MaxSumConstraint_1__init__(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_16MaxSumConstraint___init__, "Initialization method.\n\n Args:\n maxsum (number): Value to be considered as the maximum sum\n multipliers (sequence of numbers): If given, variable values\n will be multiplied by the given factors before being\n summed to be checked\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_16MaxSumConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_16MaxSumConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_16MaxSumConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_16MaxSumConstraint_1__init__(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_maxsum = 0; + PyObject *__pyx_v_multipliers = 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("__init__ (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_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, 594, __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, 594, __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, 594, __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, 594, __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, 594, __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, 594, __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, 594, __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, 594, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 594, __pyx_L3_error) + break; + default: goto __pyx_L5_argtuple_error; + } + if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); + } + __pyx_v_self = values[0]; + __pyx_v_maxsum = values[1]; + __pyx_v_multipliers = values[2]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 594, __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.MaxSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_maxsum, __pyx_v_multipliers); + + /* 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_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 + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "constraint/constraints.py":603 + * summed to be checked + * """ + * self._maxsum = maxsum # <<<<<<<<<<<<<< + * self._multipliers = multipliers + * +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxsum_2, __pyx_v_maxsum) < 0) __PYX_ERR(0, 603, __pyx_L1_error) + + /* "constraint/constraints.py":604 + * """ + * self._maxsum = maxsum + * self._multipliers = multipliers # <<<<<<<<<<<<<< + * + * 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, 604, __pyx_L1_error) + + /* "constraint/constraints.py":594 + * """ + * + * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.MaxSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":606 + * self._multipliers = multipliers + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_16MaxSumConstraint_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_16MaxSumConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_16MaxSumConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_16MaxSumConstraint_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, 606, __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, 606, __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, 606, __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, 606, __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, 606, __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, 606, __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, 606, __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, 606, __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, 606, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 606, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 606, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 606, __pyx_L3_error) + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 606, __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, 606, __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.MaxSumConstraint.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, 606, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 606, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 606, __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 */ + 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_16MaxSumConstraint_10preProcess_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "constraint/constraints.py":613 + * 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, 613, __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, 613, __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, 613, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 613, __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, 613, __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, 613, __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, 613, __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, 613, __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, 613, __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, 613, __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, 613, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 613, __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":606 + * 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_multiplier = NULL; + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10preProcess_2generator5 = 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 *); + int __pyx_t_8; + int __pyx_t_9; + 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 *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("preProcess", 0); + + /* "constraint/constraints.py":607 + * + * 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 +*/ + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __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, 607, __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(__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, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":610 + * + * # 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, 610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_variable_contains_negative = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":611 + * # 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]) +*/ + __Pyx_INCREF(Py_None); + __pyx_v_variable_with_negative = Py_None; + + /* "constraint/constraints.py":612 + * 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 (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, 612, __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, 612, __pyx_L1_error) + } + for (;;) { + 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, 612, __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_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, 612, __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_1, __pyx_t_6)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __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, 612, __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":613 + * 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: +*/ + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __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, 613, __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, 613, __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; + + /* "constraint/constraints.py":614 + * 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: +*/ + __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, 614, __pyx_L1_error) + + /* "constraint/constraints.py":615 + * 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, 615, __pyx_L1_error) + if (__pyx_t_9) { + + /* "constraint/constraints.py":616 + * 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 +*/ + __pyx_t_9 = (__pyx_v_variable_with_negative != Py_None); + if (__pyx_t_9) { + + /* "constraint/constraints.py":618 + * if variable_with_negative is not None: + * # if more than one associated variables contain negative, we can't prune + * return # <<<<<<<<<<<<<< + * variable_with_negative = variable + * +*/ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + + /* "constraint/constraints.py":616 + * 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":619 + * # if more than one associated variables contain negative, we can't prune + * return + * variable_with_negative = variable # <<<<<<<<<<<<<< + * + * # 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":615 + * 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":612 + * 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) +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":622 + * + * # 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, 622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_multipliers = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":623 + * # 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, 623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_maxsum = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":624 + * 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, 624, __pyx_L1_error) + if (__pyx_t_9) { + + /* "constraint/constraints.py":625 + * 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; + __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, 625, __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_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, 625, __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, 625, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_7)) { + 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, 625, __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_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, 625, __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_2, __pyx_t_6)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __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, 625, __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, 625, __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_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, 625, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 625, __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, 625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 625, __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_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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; + __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, 625, __pyx_L1_error) + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L12_unpacking_done; + __pyx_L11_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, 625, __pyx_L1_error) + __pyx_L12_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_t_3 = 0; + + /* "constraint/constraints.py":626 + * 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, 626, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 626, __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":627 + * 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":626 + * 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":628 + * 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, 628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":629 + * 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, 629, __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, 629, __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, 629, __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, 629, __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, 629, __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, 629, __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, 629, __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":630 + * 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, 630, __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, 630, __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, 630, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_9) { + + /* "constraint/constraints.py":631 + * 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, 631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":630 + * domain = domains[variable] + * for value in domain[:]: + * if value * multiplier > maxsum: # <<<<<<<<<<<<<< + * domain.remove(value) + * else: +*/ + } + + /* "constraint/constraints.py":629 + * continue + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value * multiplier > maxsum: + * domain.remove(value) +*/ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":625 + * 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":624 + * 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; + } + + /* "constraint/constraints.py":633 + * domain.remove(value) + * else: + * for variable in variables: # <<<<<<<<<<<<<< + * if variable_with_negative is not None and variable_with_negative != variable: + * continue +*/ + /*else*/ { + 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; + } else { + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __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, 633, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_7)) { + 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, 633, __pyx_L1_error) + #endif + if (__pyx_t_6 >= __pyx_temp) break; + } + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6); + ++__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, 633, __pyx_L1_error) + #endif + 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_2, __pyx_t_6)); + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L1_error) + } else { + __pyx_t_3 = __pyx_t_7(__pyx_t_2); + 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, 633, __pyx_L1_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":634 + * 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, 634, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 634, __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":635 + * 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":634 + * else: + * for variable in variables: + * if variable_with_negative is not None and variable_with_negative != variable: # <<<<<<<<<<<<<< + * continue + * domain = domains[variable] +*/ + } + + /* "constraint/constraints.py":636 + * 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, 636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); + __pyx_t_3 = 0; + + /* "constraint/constraints.py":637 + * 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, 637, __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_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, 637, __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, 637, __pyx_L1_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, 637, __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, 637, __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, 637, __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, 637, __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":638 + * 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, 638, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 638, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_9) { + + /* "constraint/constraints.py":639 + * 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, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":638 + * domain = domains[variable] + * for value in domain[:]: + * if value > maxsum: # <<<<<<<<<<<<<< + * domain.remove(value) + * +*/ + } + + /* "constraint/constraints.py":637 + * 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":633 + * 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:; + + /* "constraint/constraints.py":606 + * self._multipliers = multipliers + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * +*/ + + /* 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_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_multiplier); + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10preProcess_2generator5); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":641 + * domain.remove(value) + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * multipliers = self._multipliers + * maxsum = self._maxsum +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_16MaxSumConstraint_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_16MaxSumConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_16MaxSumConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_16MaxSumConstraint_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 +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_variables = 0; + PyObject *__pyx_v_domains = 0; + PyObject *__pyx_v_assignments = 0; + PyObject *__pyx_v_forwardcheck = 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("__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,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, 641, __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, 641, __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, 641, __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, 641, __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, 641, __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, 641, __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, 641, __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, 641, __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, 641, __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, 641, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 641, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 641, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 641, __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, 641, __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.MaxSumConstraint.__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, 641, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 641, __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 */ + 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_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) { + PyObject *__pyx_v_multipliers = NULL; + PyObject *__pyx_v_maxsum = NULL; + PyObject *__pyx_v_sum = NULL; + PyObject *__pyx_v_variable = NULL; + PyObject *__pyx_v_multiplier = NULL; + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + 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 *); + 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_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "constraint/constraints.py":642 + * + * 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, 642, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_multipliers = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":643 + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * multipliers = self._multipliers + * maxsum = self._maxsum # <<<<<<<<<<<<<< + * sum = 0 + * if 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, 643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_maxsum = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":644 + * multipliers = self._multipliers + * maxsum = self._maxsum + * sum = 0 # <<<<<<<<<<<<<< + * if multipliers: + * for variable, multiplier in zip(variables, multipliers): +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; + + /* "constraint/constraints.py":645 + * maxsum = self._maxsum + * sum = 0 + * 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, 645, __pyx_L1_error) + if (__pyx_t_2) { + + /* "constraint/constraints.py":646 + * sum = 0 + * 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; + { + 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_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, 646, __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; + } else { + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __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, 646, __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))) { + { + 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, 646, __pyx_L1_error) + #endif + if (__pyx_t_6 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_6); + ++__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, 646, __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_4, __pyx_t_6)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_7(__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, 646, __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, 646, __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_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, 646, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 646, __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, 646, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 646, __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, 646, __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_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, 646, __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; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 646, __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_multiplier, __pyx_t_8); + __pyx_t_8 = 0; + + /* "constraint/constraints.py":647 + * if multipliers: + * for variable, multiplier in zip(variables, multipliers): + * if variable in assignments: # <<<<<<<<<<<<<< + * sum += assignments[variable] * multiplier + * if isinstance(sum, float): +*/ + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 647, __pyx_L1_error) + if (__pyx_t_2) { + + /* "constraint/constraints.py":648 + * for variable, multiplier in zip(variables, multipliers): + * if variable in assignments: + * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< + * 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, 648, __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, 648, __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, 648, __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":647 + * if multipliers: + * for variable, multiplier in zip(variables, multipliers): + * if variable in assignments: # <<<<<<<<<<<<<< + * sum += assignments[variable] * multiplier + * if isinstance(sum, float): +*/ + } + + /* "constraint/constraints.py":646 + * sum = 0 + * 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; + + /* "constraint/constraints.py":649 + * if variable in assignments: + * sum += assignments[variable] * multiplier + * if isinstance(sum, float): # <<<<<<<<<<<<<< + * sum = round(sum, 10) + * if sum > maxsum: +*/ + __pyx_t_2 = PyFloat_Check(__pyx_v_sum); + if (__pyx_t_2) { + + /* "constraint/constraints.py":650 + * sum += assignments[variable] * multiplier + * if isinstance(sum, float): + * sum = round(sum, 10) # <<<<<<<<<<<<<< + * if sum > maxsum: + * return False +*/ + __pyx_t_1 = NULL; + __Pyx_INCREF(__pyx_builtin_round); + __pyx_t_8 = __pyx_builtin_round; + __pyx_t_5 = 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, 650, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_4); + __pyx_t_4 = 0; + + /* "constraint/constraints.py":649 + * if variable in assignments: + * sum += assignments[variable] * multiplier + * if isinstance(sum, float): # <<<<<<<<<<<<<< + * sum = round(sum, 10) + * if sum > maxsum: +*/ + } + + /* "constraint/constraints.py":651 + * if isinstance(sum, float): + * sum = round(sum, 10) + * if sum > maxsum: # <<<<<<<<<<<<<< + * return False + * if forwardcheck: +*/ + __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, 651, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 651, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_2) { + + /* "constraint/constraints.py":652 + * sum = round(sum, 10) + * if sum > maxsum: + * return False # <<<<<<<<<<<<<< + * if forwardcheck: + * for variable, multiplier in zip(variables, multipliers): +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "constraint/constraints.py":651 + * if isinstance(sum, float): + * sum = round(sum, 10) + * if sum > maxsum: # <<<<<<<<<<<<<< + * return False + * if forwardcheck: +*/ + } + + /* "constraint/constraints.py":653 + * if sum > maxsum: + * return False + * if forwardcheck: # <<<<<<<<<<<<<< + * 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, 653, __pyx_L1_error) + if (__pyx_t_2) { + + /* "constraint/constraints.py":654 + * return False + * if forwardcheck: + * 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; + { + 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, 654, __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, 654, __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, 654, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + for (;;) { + 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, 654, __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_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, 654, __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_1, __pyx_t_6)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __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, 654, __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; + 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, 654, __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); + } else { + __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + } + #else + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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, 654, __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:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_L16_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; + + /* "constraint/constraints.py":655 + * if forwardcheck: + * 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, 655, __pyx_L1_error) + if (__pyx_t_2) { + + /* "constraint/constraints.py":656 + * 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, 656, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); + __pyx_t_4 = 0; + + /* "constraint/constraints.py":657 + * 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, 657, __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; + } else { + __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __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, 657, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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, 657, __pyx_L1_error) + #endif + if (__pyx_t_11 >= __pyx_temp) break; + } + __pyx_t_4 = __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, 657, __pyx_L1_error) + #endif + if (__pyx_t_11 >= __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)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); + #endif + ++__pyx_t_11; + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L1_error) + } else { + __pyx_t_4 = __pyx_t_12(__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, 657, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); + __pyx_t_4 = 0; + + /* "constraint/constraints.py":658 + * 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, 658, __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, 658, __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, 658, __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, 658, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_2) { + + /* "constraint/constraints.py":659 + * 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; + { + 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, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":658 + * domain = domains[variable] + * for value in domain[:]: + * if sum + value * multiplier > maxsum: # <<<<<<<<<<<<<< + * domain.hideValue(value) + * if not domain: +*/ + } + + /* "constraint/constraints.py":657 + * if variable not in assignments: + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if sum + value * multiplier > maxsum: + * domain.hideValue(value) +*/ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":660 + * 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, 660, __pyx_L1_error) + __pyx_t_13 = (!__pyx_t_2); + if (__pyx_t_13) { + + /* "constraint/constraints.py":661 + * domain.hideValue(value) + * if not domain: + * return False # <<<<<<<<<<<<<< + * else: + * for variable in variables: +*/ + __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":660 + * if sum + value * multiplier > maxsum: + * domain.hideValue(value) + * if not domain: # <<<<<<<<<<<<<< + * return False + * else: +*/ + } + + /* "constraint/constraints.py":655 + * if forwardcheck: + * for variable, multiplier in zip(variables, multipliers): + * if variable not in assignments: # <<<<<<<<<<<<<< + * domain = domains[variable] + * for value in domain[:]: +*/ + } + + /* "constraint/constraints.py":654 + * return False + * if forwardcheck: + * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< + * if variable not in assignments: + * domain = domains[variable] +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":653 + * if sum > maxsum: + * return False + * if forwardcheck: # <<<<<<<<<<<<<< + * for variable, multiplier in zip(variables, multipliers): + * if variable not in assignments: +*/ + } + + /* "constraint/constraints.py":645 + * maxsum = self._maxsum + * sum = 0 + * if multipliers: # <<<<<<<<<<<<<< + * for variable, multiplier in zip(variables, multipliers): + * if variable in assignments: +*/ + goto __pyx_L3; + } + + /* "constraint/constraints.py":663 + * return False + * else: + * for variable in variables: # <<<<<<<<<<<<<< + * if variable in assignments: + * sum += assignments[variable] +*/ + /*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; + } else { + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 663, __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, 663, __pyx_L1_error) + } + for (;;) { + 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, 663, __pyx_L1_error) + #endif + if (__pyx_t_6 >= __pyx_temp) break; + } + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + ++__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, 663, __pyx_L1_error) + #endif + 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_6)); + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __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, 663, __pyx_L1_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":664 + * else: + * for variable in variables: + * if variable in assignments: # <<<<<<<<<<<<<< + * sum += assignments[variable] + * if isinstance(sum, float): +*/ + __pyx_t_13 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 664, __pyx_L1_error) + if (__pyx_t_13) { + + /* "constraint/constraints.py":665 + * for variable in variables: + * if variable in assignments: + * sum += assignments[variable] # <<<<<<<<<<<<<< + * if isinstance(sum, float): + * sum = round(sum, 10) +*/ + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __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, 665, __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; + + /* "constraint/constraints.py":664 + * else: + * for variable in variables: + * if variable in assignments: # <<<<<<<<<<<<<< + * sum += assignments[variable] + * if isinstance(sum, float): +*/ + } + + /* "constraint/constraints.py":663 + * return False + * else: + * for variable in variables: # <<<<<<<<<<<<<< + * if variable in assignments: + * sum += assignments[variable] +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":666 + * if variable in assignments: + * sum += assignments[variable] + * if isinstance(sum, float): # <<<<<<<<<<<<<< + * sum = round(sum, 10) + * if sum > maxsum: +*/ + __pyx_t_13 = PyFloat_Check(__pyx_v_sum); + if (__pyx_t_13) { + + /* "constraint/constraints.py":667 + * sum += assignments[variable] + * if isinstance(sum, float): + * sum = round(sum, 10) # <<<<<<<<<<<<<< + * if sum > maxsum: + * return False +*/ + __pyx_t_4 = NULL; + __Pyx_INCREF(__pyx_builtin_round); + __pyx_t_3 = __pyx_builtin_round; + __pyx_t_5 = 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, 667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":666 + * if variable in assignments: + * sum += assignments[variable] + * if isinstance(sum, float): # <<<<<<<<<<<<<< + * sum = round(sum, 10) + * if sum > maxsum: +*/ + } + + /* "constraint/constraints.py":668 + * if isinstance(sum, float): + * sum = round(sum, 10) + * if sum > maxsum: # <<<<<<<<<<<<<< + * return False + * if forwardcheck: +*/ + __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, 668, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_13) { + + /* "constraint/constraints.py":669 + * sum = round(sum, 10) + * if sum > maxsum: + * return False # <<<<<<<<<<<<<< + * if forwardcheck: + * for variable in variables: +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "constraint/constraints.py":668 + * if isinstance(sum, float): + * sum = round(sum, 10) + * if sum > maxsum: # <<<<<<<<<<<<<< + * return False + * if forwardcheck: +*/ + } + + /* "constraint/constraints.py":670 + * if sum > maxsum: + * return False + * if forwardcheck: # <<<<<<<<<<<<<< + * 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, 670, __pyx_L1_error) + if (__pyx_t_13) { + + /* "constraint/constraints.py":671 + * return False + * if forwardcheck: + * 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; + } else { + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __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, 671, __pyx_L1_error) + } + for (;;) { + 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, 671, __pyx_L1_error) + #endif + if (__pyx_t_6 >= __pyx_temp) break; + } + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + ++__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, 671, __pyx_L1_error) + #endif + 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_6)); + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 671, __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, 671, __pyx_L1_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":672 + * if forwardcheck: + * 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, 672, __pyx_L1_error) + if (__pyx_t_13) { + + /* "constraint/constraints.py":673 + * 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, 673, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); + __pyx_t_3 = 0; + + /* "constraint/constraints.py":674 + * 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, 674, __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; + } else { + __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __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, 674, __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))) { + { + 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, 674, __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, 674, __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, 674, __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, 674, __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":675 + * 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, 675, __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, 675, __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, 675, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_13) { + + /* "constraint/constraints.py":676 + * for value in domain[:]: + * if sum + value > maxsum: + * domain.hideValue(value) # <<<<<<<<<<<<<< + * if not domain: + * return False +*/ + __pyx_t_3 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = 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, 676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "constraint/constraints.py":675 + * domain = domains[variable] + * for value in domain[:]: + * if sum + value > maxsum: # <<<<<<<<<<<<<< + * domain.hideValue(value) + * if not domain: +*/ + } + + /* "constraint/constraints.py":674 + * if variable not in assignments: + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if sum + value > maxsum: + * domain.hideValue(value) +*/ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":677 + * 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, 677, __pyx_L1_error) + __pyx_t_2 = (!__pyx_t_13); + if (__pyx_t_2) { + + /* "constraint/constraints.py":678 + * 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":677 + * if sum + value > maxsum: + * domain.hideValue(value) + * if not domain: # <<<<<<<<<<<<<< + * return False + * return True +*/ + } + + /* "constraint/constraints.py":672 + * if forwardcheck: + * for variable in variables: + * if variable not in assignments: # <<<<<<<<<<<<<< + * domain = domains[variable] + * for value in domain[:]: +*/ + } + + /* "constraint/constraints.py":671 + * return False + * if forwardcheck: + * for variable in variables: # <<<<<<<<<<<<<< + * if variable not in assignments: + * domain = domains[variable] +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":670 + * if sum > maxsum: + * return False + * if forwardcheck: # <<<<<<<<<<<<<< + * for variable in variables: + * if variable not in assignments: +*/ + } + } + __pyx_L3:; + + /* "constraint/constraints.py":679 + * if not domain: + * return False + * return True # <<<<<<<<<<<<<< + * + * +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "constraint/constraints.py":641 + * domain.remove(value) + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * multipliers = self._multipliers + * maxsum = self._maxsum +*/ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("constraint.constraints.MaxSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_multipliers); + __Pyx_XDECREF(__pyx_v_maxsum); + __Pyx_XDECREF(__pyx_v_sum); + __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(); + return __pyx_r; +} + +/* "constraint/constraints.py":693 + * """ # noqa: E501 + * + * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_24VariableMaxSumConstraint_1__init__(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_24VariableMaxSumConstraint___init__, "Initialization method.\n\n Args:\n target_var (Variable): The target variable to sum to.\n sum_vars (sequence of Variables): The variables to sum up.\n multipliers (sequence of numbers): If given, variable values\n (except the last) will be multiplied by the given factors before being\n summed to match the last variable.\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_24VariableMaxSumConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_24VariableMaxSumConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_24VariableMaxSumConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_24VariableMaxSumConstraint_1__init__(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_target_var = 0; + PyObject *__pyx_v_sum_vars = 0; + PyObject *__pyx_v_multipliers = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {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("__init__ (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_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, 693, __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, 693, __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, 693, __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, 693, __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, 693, __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, 693, __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, 693, __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, 693, __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, 693, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 693, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 693, __pyx_L3_error) + break; + default: goto __pyx_L5_argtuple_error; + } + if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None)); + } + __pyx_v_self = values[0]; + __pyx_v_target_var = ((PyObject*)values[1]); + __pyx_v_sum_vars = values[2]; + __pyx_v_multipliers = values[3]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 693, __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.VariableMaxSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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, 693, __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 */ + 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_24VariableMaxSumConstraint_8__init___2generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "constraint/constraints.py":709 + * 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." + * +*/ + +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; + 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); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 709, __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_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, 709, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.VariableMaxSumConstraint.__init__.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_24VariableMaxSumConstraint_8__init___2generator6(__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); + 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_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, 709, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 709, __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, 709, __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, 709, __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, 709, __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, 709, __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, 709, __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, 709, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_m); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_m, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_6 = PyLong_Check(__pyx_cur_scope->__pyx_v_m); + if (!__pyx_t_6) { + } else { + __pyx_t_5 = __pyx_t_6; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_6 = PyFloat_Check(__pyx_cur_scope->__pyx_v_m); + __pyx_t_5 = __pyx_t_6; + __pyx_L7_bool_binop_done:; + __pyx_t_6 = (!__pyx_t_5); + if (__pyx_t_6) { + __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_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":693 + * """ # noqa: E501 + * + * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = 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_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "constraint/constraints.py":703 + * 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, 703, __pyx_L1_error) + + /* "constraint/constraints.py":704 + * """ + * 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, 704, __pyx_L1_error) + + /* "constraint/constraints.py":705 + * 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, 705, __pyx_L1_error) + + /* "constraint/constraints.py":707 + * 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, 707, __pyx_L1_error) + if (__pyx_t_1) { + + /* "constraint/constraints.py":708 + * + * 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." +*/ + #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, 708, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 708, __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, 708, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 708, __pyx_L1_error) + #endif + + /* "constraint/constraints.py":709 + * 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." + * +*/ + #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, 709, __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, 709, __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, 709, __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, 709, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 709, __pyx_L1_error) + #endif + + /* "constraint/constraints.py":710 + * 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." # <<<<<<<<<<<<<< + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 +*/ + #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); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 710, __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, 710, __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, 710, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 710, __pyx_L1_error) + #endif + + /* "constraint/constraints.py":707 + * 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." +*/ + } + + /* "constraint/constraints.py":693 + * """ # noqa: E501 + * + * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __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_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":712 + * 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) + * +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_24VariableMaxSumConstraint_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_24VariableMaxSumConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_24VariableMaxSumConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_24VariableMaxSumConstraint_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, 712, __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, 712, __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, 712, __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, 712, __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, 712, __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, 712, __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, 712, __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, 712, __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, 712, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 712, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 712, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 712, __pyx_L3_error) + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 712, __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, 712, __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.VariableMaxSumConstraint.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, 712, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 712, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 712, __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 */ + goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.preProcess.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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_24VariableMaxSumConstraint_10preProcess_2generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "constraint/constraints.py":720 + * 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]): +*/ + +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; + 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); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 720, __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_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, 720, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.VariableMaxSumConstraint.preProcess.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); @@ -12782,9 +18542,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_5generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_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_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_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; @@ -12810,934 +18570,1242 @@ 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, 509, __pyx_L1_error) + __PYX_ERR(0, 720, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 509, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 720, __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, 509, __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, 720, __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, 720, __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, 720, __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, 720, __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, 720, __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, 720, __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_var)) { __Pyx_RaiseClosureNameError("var"); __PYX_ERR(0, 720, __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, 720, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 720, __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, 720, __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, 720, __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, 720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = 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)); + __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, 720, __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, 720, __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); + __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); + } + __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":712 + * 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) + * +*/ + +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; + 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_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; + int __pyx_t_7; + 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 *); + 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); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 712, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_v_domains = __pyx_v_domains; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_domains); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_domains); + + /* "constraint/constraints.py":713 + * + * 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_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 713, __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, 713, __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_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_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, 713, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":715 + * 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, 715, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_multipliers = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":717 + * 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, 717, __pyx_L1_error) + __pyx_t_7 = (!__pyx_t_6); + if (__pyx_t_7) { + + /* "constraint/constraints.py":718 + * + * 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, 718, __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, 509, __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, 509, __pyx_L1_error) + 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, 718, __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, 718, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_9)) { + 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, 718, __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_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, 718, __pyx_L1_error) + #endif + if (__pyx_t_8 >= __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_8)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_8); #endif - if (__pyx_t_2 >= __pyx_temp) break; + ++__pyx_t_8; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); - ++__pyx_t_2; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 718, __pyx_L1_error) } 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, 509, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; + __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, 718, __pyx_L1_error) + PyErr_Clear(); + } + 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, 509, __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, 509, __pyx_L1_error) - PyErr_Clear(); - } - break; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_var); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_var, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":719 + * 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, 719, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":720 + * 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]): +*/ + __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, 720, __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, 720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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)); + __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, 720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - } - __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_var)) { __Pyx_RaiseClosureNameError("var"); __PYX_ERR(0, 509, __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, 509, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 509, __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, 509, __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, 509, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_others_min, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":721 + * 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, 721, __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, 721, __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, 721, __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, 509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = 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)); - __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, 509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __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, 721, __pyx_L1_error) + #endif + if (__pyx_t_12 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12); + ++__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, 721, __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, 721, __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, 721, __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":722 + * 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, 722, __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, 722, __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, 722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 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, 722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + } + __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, 722, __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, 722, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_7) { + + /* "constraint/constraints.py":723 + * 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_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, 723, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "constraint/constraints.py":722 + * 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) + * +*/ + } + + /* "constraint/constraints.py":721 + * 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_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, 509, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":718 + * + * 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_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":717 + * multipliers = self._multipliers + * + * if not multipliers: # <<<<<<<<<<<<<< + * for var in self.sum_vars: + * domain = domains[var] +*/ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* "constraint/constraints.py":712 + * 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) + * +*/ /* 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_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); - } + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __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:; + __Pyx_XDECREF(__pyx_v_multipliers); + __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_DECREF((PyObject *)__pyx_cur_scope); __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":494 - * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." +/* "constraint/constraints.py":725 + * domain.remove(value) * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * multipliers = self._multipliers * */ -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) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *__pyx_cur_scope; +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_24VariableMaxSumConstraint_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_24VariableMaxSumConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_24VariableMaxSumConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_24VariableMaxSumConstraint_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 +) { + PyObject *__pyx_v_self = 0; + CYTHON_UNUSED PyObject *__pyx_v_variables = 0; + PyObject *__pyx_v_domains = 0; + PyObject *__pyx_v_assignments = 0; + CYTHON_UNUSED PyObject *__pyx_v_forwardcheck = 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("__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,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, 725, __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, 725, __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, 725, __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, 725, __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, 725, __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, 725, __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, 725, __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, 725, __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, 725, __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, 725, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 725, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 725, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 725, __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, 725, __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.VariableMaxSumConstraint.__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, 725, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 725, __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 */ + 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_24VariableMaxSumConstraint_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) { PyObject *__pyx_v_multipliers = NULL; + PyObject *__pyx_v_target_value = NULL; + PyObject *__pyx_v_sum_value = NULL; + PyObject *__pyx_v_var = NULL; PyObject *__pyx_v_multiplier = NULL; - PyObject *__pyx_v_domain = NULL; - PyObject *__pyx_v_value = NULL; - PyObject *__pyx_v_others_min = NULL; - PyObject *__pyx_v_others_max = NULL; - PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_2generator2 = 0; - PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_5generator3 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; + int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - size_t __pyx_t_5; - int __pyx_t_6; + PyObject *__pyx_t_5 = NULL; + size_t __pyx_t_6; 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_13 = NULL; - PyObject *__pyx_t_14 = NULL; - PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_11 = 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_2_preProcess *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_preProcess(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_preProcess, __pyx_mstate_global->__pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 494, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_v_domains = __pyx_v_domains; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_domains); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_domains); + __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":495 + /* "constraint/constraints.py":726 * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< + * 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, 726, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_multipliers = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":728 * 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, 728, __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, 728, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "constraint/constraints.py":729 + * + * if self.target_var not in assignments: + * return True # can't evaluate without target, defer to later # <<<<<<<<<<<<<< + * + * target_value = assignments[self.target_var] +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "constraint/constraints.py":728 + * multipliers = self._multipliers + * + * if self.target_var not in assignments: # <<<<<<<<<<<<<< + * return True # can't evaluate without target, defer to later + * */ - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __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, 495, __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_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_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, 495, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); } + + /* "constraint/constraints.py":731 + * 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, 731, __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, 731, __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":497 - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + /* "constraint/constraints.py":732 * - * multipliers = self._multipliers # <<<<<<<<<<<<<< + * target_value = assignments[self.target_var] + * sum_value = 0 # <<<<<<<<<<<<<< * * 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, 497, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_multipliers = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_sum_value = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":499 - * multipliers = self._multipliers + /* "constraint/constraints.py":734 + * sum_value = 0 * * if multipliers: # <<<<<<<<<<<<<< * for var, multiplier in zip(self.sum_vars, multipliers): - * domain = domains[var] + * if var in assignments: */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 499, __pyx_L1_error) - if (__pyx_t_6) { + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 734, __pyx_L1_error) + if (__pyx_t_2) { - /* "constraint/constraints.py":500 + /* "constraint/constraints.py":735 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< - * domain = domains[var] - * for value in domain[:]: + * if var in assignments: + * sum_value += assignments[var] * multiplier */ - __pyx_t_4 = NULL; + __pyx_t_1 = 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, 500, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = 1; + __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, 735, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = 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)); - __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, 500, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_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)); + __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, 735, __pyx_L1_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); + 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_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __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, 500, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __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, 735, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_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, 500, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 735, __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_3 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_7); ++__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_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 500, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 735, __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)); + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_8(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { + __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, 500, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 735, __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; + __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, 500, __pyx_L1_error) + __PYX_ERR(0, 735, __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); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_5); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_1); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 500, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 735, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_1); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 500, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 735, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); #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_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_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; - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 500, __pyx_L1_error) + 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; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 735, __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:; + goto __pyx_L8_unpacking_done; + __pyx_L7_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, 500, __pyx_L1_error) - __pyx_L7_unpacking_done:; + __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_L8_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_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":501 + /* "constraint/constraints.py":736 * 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]): + * if var in assignments: # <<<<<<<<<<<<<< + * sum_value += assignments[var] * multiplier + * else: */ - __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, 501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 736, __pyx_L1_error) + if (__pyx_t_2) { - /* "constraint/constraints.py":502 + /* "constraint/constraints.py":737 * 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, 502, __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_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, 502, __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, 502, __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))) { - { - 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, 502, __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_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, 502, __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)); - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); - #endif - ++__pyx_t_11; - } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error) - } else { - __pyx_t_1 = __pyx_t_12(__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, 502, __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":503 - * domain = domains[var] - * for value in domain[:]: - * if value * multiplier > max(domains[self.target_var]): # <<<<<<<<<<<<<< - * domain.remove(value) - * else: + * if var in assignments: + * sum_value += assignments[var] * multiplier # <<<<<<<<<<<<<< + * else: + * sum_value += min(domains[var] * multiplier) # use min value if not assigned */ - __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 737, __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, 737, __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, 503, __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, 503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 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)); - __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, 503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __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, 503, __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, 503, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (__pyx_t_6) { + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 737, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":504 - * for value in domain[:]: - * if value * multiplier > max(domains[self.target_var]): - * domain.remove(value) # <<<<<<<<<<<<<< - * else: - * for var in self.sum_vars: + /* "constraint/constraints.py":736 + * if multipliers: + * for var, multiplier in zip(self.sum_vars, multipliers): + * if var in assignments: # <<<<<<<<<<<<<< + * sum_value += assignments[var] * multiplier + * else: */ - __pyx_t_3 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_3); - __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, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - } - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L9; + } - /* "constraint/constraints.py":503 - * domain = domains[var] - * for value in domain[:]: - * if value * multiplier > max(domains[self.target_var]): # <<<<<<<<<<<<<< - * domain.remove(value) + /* "constraint/constraints.py":739 + * sum_value += assignments[var] * multiplier + * else: + * sum_value += min(domains[var] * multiplier) # use min value if not assigned # <<<<<<<<<<<<<< * else: + * 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, 739, __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, 739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_6 = 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, 739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - - /* "constraint/constraints.py":502 - * 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_5 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __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(__pyx_t_4); __pyx_t_4 = 0; + __pyx_L9:; - /* "constraint/constraints.py":500 + /* "constraint/constraints.py":735 * * if multipliers: - * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< - * domain = domains[var] - * for value in domain[:]: + * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< + * if var in assignments: + * sum_value += assignments[var] * multiplier */ } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":499 - * multipliers = self._multipliers + /* "constraint/constraints.py":734 + * sum_value = 0 * * if multipliers: # <<<<<<<<<<<<<< * for var, multiplier in zip(self.sum_vars, multipliers): - * domain = domains[var] + * if var in assignments: */ - goto __pyx_L3; + goto __pyx_L4; } - /* "constraint/constraints.py":506 - * domain.remove(value) + /* "constraint/constraints.py":741 + * sum_value += min(domains[var] * multiplier) # use min value if not assigned * 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) + * if var in assignments: + * sum_value += assignments[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, 506, __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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 741, __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; } else { - __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 506, __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, 506, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 741, __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, 741, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { + if (likely(PyList_CheckExact(__pyx_t_5))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + 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, 506, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 741, __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_4 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_7); ++__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_5); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 506, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 741, __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_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7)); #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7); #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 506, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 741, __pyx_L1_error) } else { - __pyx_t_2 = __pyx_t_8(__pyx_t_4); - if (unlikely(!__pyx_t_2)) { + __pyx_t_4 = __pyx_t_8(__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, 506, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 741, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_var); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_var, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":507 + /* "constraint/constraints.py":742 * 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) + * if var in assignments: # <<<<<<<<<<<<<< + * sum_value += assignments[var] + * else: */ - __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, 507, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 742, __pyx_L1_error) + if (__pyx_t_2) { - /* "constraint/constraints.py":508 + /* "constraint/constraints.py":743 * 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, 508, __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, 508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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, 508, __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":509 - * 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, 509, __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, 509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 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, 509, __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":510 - * 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, 510, __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_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, 510, __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, 510, __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))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_15); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 510, __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_11; - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_15); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 510, __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)); - #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_15, __pyx_t_11); - #endif - ++__pyx_t_11; - } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error) - } else { - __pyx_t_2 = __pyx_t_12(__pyx_t_15); - 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, 510, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_2); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_2); - __pyx_t_2 = 0; - - /* "constraint/constraints.py":511 - * 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, 511, __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, 511, __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, 511, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __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; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __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, 511, __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, 511, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (__pyx_t_6) { - - /* "constraint/constraints.py":512 - * 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]): - * domain.remove(value) -*/ - __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_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_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 512, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - } - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - - /* "constraint/constraints.py":511 - * 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]): -*/ - } - - /* "constraint/constraints.py":513 - * if value + others_min > max(domains[self.target_var]): - * domain.remove(value) - * if value + others_max < min(domains[self.target_var]): # <<<<<<<<<<<<<< - * domain.remove(value) - * + * if var in assignments: + * sum_value += assignments[var] # <<<<<<<<<<<<<< + * else: + * sum_value += min(domains[var]) # use min value if not assigned */ - __pyx_t_13 = PyNumber_Add(__pyx_v_value, __pyx_v_others_max); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 513, __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, 513, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 743, __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, 743, __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, 513, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_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, 513, __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, 513, __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, 513, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (__pyx_t_6) { + __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":514 - * domain.remove(value) - * 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 + /* "constraint/constraints.py":742 + * else: + * for var in self.sum_vars: + * if var in assignments: # <<<<<<<<<<<<<< + * sum_value += assignments[var] + * else: */ - __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_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_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 514, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - } - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L13; + } - /* "constraint/constraints.py":513 - * if value + others_min > max(domains[self.target_var]): - * domain.remove(value) - * if value + others_max < min(domains[self.target_var]): # <<<<<<<<<<<<<< - * domain.remove(value) + /* "constraint/constraints.py":745 + * sum_value += assignments[var] + * else: + * sum_value += min(domains[var]) # use min value if not assigned # <<<<<<<<<<<<<< * + * if isinstance(sum_value, float): */ + /*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, 745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = 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)); + __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, 745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - - /* "constraint/constraints.py":510 - * 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_11 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __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(__pyx_t_15); __pyx_t_15 = 0; + __pyx_L13:; - /* "constraint/constraints.py":506 - * domain.remove(value) + /* "constraint/constraints.py":741 + * sum_value += min(domains[var] * multiplier) # use min value if not assigned * 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) + * if var in assignments: + * sum_value += assignments[var] */ } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_L3:; + __pyx_L4:; - /* "constraint/constraints.py":494 - * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." + /* "constraint/constraints.py":747 + * sum_value += min(domains[var]) # use min value if not assigned * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * if isinstance(sum_value, float): # <<<<<<<<<<<<<< + * sum_value = round(sum_value, 10) * */ + __pyx_t_2 = PyFloat_Check(__pyx_v_sum_value); + if (__pyx_t_2) { - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* "constraint/constraints.py":748 + * + * 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; + { + 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, 748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_5); + __pyx_t_5 = 0; + + /* "constraint/constraints.py":747 + * sum_value += min(domains[var]) # use min value if not assigned + * + * if isinstance(sum_value, float): # <<<<<<<<<<<<<< + * sum_value = round(sum_value, 10) + * +*/ + } + + /* "constraint/constraints.py":750 + * sum_value = round(sum_value, 10) + * + * return sum_value <= target_value # <<<<<<<<<<<<<< + * + * +*/ + __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, 750, __pyx_L1_error) + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; + + /* "constraint/constraints.py":725 + * domain.remove(value) + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * multipliers = self._multipliers + * +*/ + + /* 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_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_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("constraint.constraints.VariableMaxSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_multipliers); + __Pyx_XDECREF(__pyx_v_target_value); + __Pyx_XDECREF(__pyx_v_sum_value); + __Pyx_XDECREF(__pyx_v_var); __Pyx_XDECREF(__pyx_v_multiplier); - __Pyx_XDECREF(__pyx_v_domain); - __Pyx_XDECREF(__pyx_v_value); - __Pyx_XDECREF(__pyx_v_others_min); - __Pyx_XDECREF(__pyx_v_others_max); - __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_2generator2); - __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_5generator3); - __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":516 - * domain.remove(value) +/* "constraint/constraints.py":764 + * """ * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * multipliers = self._multipliers + * def __init__(self, exactprod: Union[int, float]): # <<<<<<<<<<<<<< + * """Instantiate an ExactProdConstraint. * */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_5__call__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_19ExactProdConstraint_1__init__(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_26VariableExactSumConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_26VariableExactSumConstraint_5__call__(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_19ExactProdConstraint___init__, "Instantiate an ExactProdConstraint.\n\n Args:\n exactprod: Value to be considered as the product\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_19ExactProdConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_19ExactProdConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_19ExactProdConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_19ExactProdConstraint_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -13745,21 +19813,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - CYTHON_UNUSED PyObject *__pyx_v_variables = 0; - PyObject *__pyx_v_domains = 0; - PyObject *__pyx_v_assignments = 0; - PyObject *__pyx_v_forwardcheck = 0; + PyObject *__pyx_v_exactprod = 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}; + PyObject* values[2] = {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); + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -13769,1311 +19834,1083 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #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,0}; + 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, 516, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 764, __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, 516, __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, 516, __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, 516, __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, 516, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 764, __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, 516, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 764, __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, 516, __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, 516, __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, 764, __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, 764, __pyx_L3_error) } } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_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, 516, __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, 516, __pyx_L3_error) - values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 516, __pyx_L3_error) - values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 516, __pyx_L3_error) - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 516, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_error; - } - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 764, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 764, __pyx_L3_error) } __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_v_exactprod = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 516, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 764, __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.VariableExactSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.ExactProdConstraint.__init__", __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, 516, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 516, __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); + __pyx_r = __pyx_pf_10constraint_11constraints_19ExactProdConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_exactprod); /* 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_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) { - PyObject *__pyx_v_multipliers = NULL; - PyObject *__pyx_v_target_value = NULL; - PyObject *__pyx_v_sum_value = NULL; - int __pyx_v_missing; - PyObject *__pyx_v_var = NULL; - PyObject *__pyx_v_multiplier = NULL; - PyObject *__pyx_v_domain = NULL; - PyObject *__pyx_v_value = NULL; - PyObject *__pyx_v_temp_sum = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - 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 *); - 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_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 0); - - /* "constraint/constraints.py":517 - * - * 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, 517, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_multipliers = __pyx_t_1; - __pyx_t_1 = 0; - - /* "constraint/constraints.py":519 - * 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, 519, __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, 519, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { - - /* "constraint/constraints.py":520 - * - * if self.target_var not in assignments: - * return True # can't evaluate without target, defer to later # <<<<<<<<<<<<<< - * - * target_value = assignments[self.target_var] -*/ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; - - /* "constraint/constraints.py":519 - * multipliers = self._multipliers - * - * if self.target_var not in assignments: # <<<<<<<<<<<<<< - * return True # can't evaluate without target, defer to later - * -*/ - } - - /* "constraint/constraints.py":522 - * 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, 522, __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, 522, __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":523 - * - * target_value = assignments[self.target_var] - * sum_value = 0 # <<<<<<<<<<<<<< - * missing = False - * -*/ - __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); - __pyx_v_sum_value = __pyx_mstate_global->__pyx_int_0; +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 + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":524 - * target_value = assignments[self.target_var] - * sum_value = 0 - * missing = False # <<<<<<<<<<<<<< + /* "constraint/constraints.py":770 + * exactprod: Value to be considered as the product + * """ + * self._exactprod = exactprod # <<<<<<<<<<<<<< * - * if multipliers: + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 */ - __pyx_v_missing = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exactprod_2, __pyx_v_exactprod) < 0) __PYX_ERR(0, 770, __pyx_L1_error) - /* "constraint/constraints.py":526 - * missing = False + /* "constraint/constraints.py":764 + * """ * - * 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, 526, __pyx_L1_error) - if (__pyx_t_2) { - - /* "constraint/constraints.py":527 + * def __init__(self, exactprod: Union[int, float]): # <<<<<<<<<<<<<< + * """Instantiate an ExactProdConstraint. * - * if multipliers: - * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< - * if var in assignments: - * 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, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = 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)); - __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, 527, __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; - } else { - __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __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, 527, __pyx_L1_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, 527, __pyx_L1_error) - #endif - if (__pyx_t_7 >= __pyx_temp) break; - } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_7); - ++__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, 527, __pyx_L1_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, 527, __pyx_L1_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, 527, __pyx_L1_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, 527, __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_INCREF(__pyx_t_1); - } else { - __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_1); - } - #else - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #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, 527, __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; - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 527, __pyx_L1_error) - __pyx_t_10 = NULL; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L8_unpacking_done; - __pyx_L7_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, 527, __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_t_1 = 0; - /* "constraint/constraints.py":528 - * 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, 528, __pyx_L1_error) - if (__pyx_t_2) { + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.ExactProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "constraint/constraints.py":529 - * for var, multiplier in zip(self.sum_vars, multipliers): - * if var in assignments: - * sum_value += assignments[var] * multiplier # <<<<<<<<<<<<<< - * else: - * missing = True +/* "constraint/constraints.py":772 + * self._exactprod = exactprod + * + * 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_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __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, 529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __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, 529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); - __pyx_t_3 = 0; - /* "constraint/constraints.py":528 - * if multipliers: - * for var, multiplier in zip(self.sum_vars, multipliers): - * if var in assignments: # <<<<<<<<<<<<<< - * sum_value += assignments[var] * multiplier - * else: -*/ - goto __pyx_L9; +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_19ExactProdConstraint_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_19ExactProdConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_19ExactProdConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_19ExactProdConstraint_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, 772, __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, 772, __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, 772, __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, 772, __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, 772, __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, 772, __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, 772, __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, 772, __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, 772, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 772, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 772, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 772, __pyx_L3_error) + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 772, __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, 772, __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.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, 772, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 772, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 772, __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); - /* "constraint/constraints.py":531 - * sum_value += assignments[var] * multiplier - * else: - * missing = True # <<<<<<<<<<<<<< - * else: - * for var in self.sum_vars: -*/ - /*else*/ { - __pyx_v_missing = 1; - } - __pyx_L9:; + /* 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_10preProcess_2generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - /* "constraint/constraints.py":527 - * - * if multipliers: - * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< - * if var in assignments: - * sum_value += assignments[var] * multiplier +/* "constraint/constraints.py":779 + * 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_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":526 - * missing = False - * - * if multipliers: # <<<<<<<<<<<<<< - * for var, multiplier in zip(self.sum_vars, multipliers): - * if var in assignments: -*/ - goto __pyx_L4; +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; + 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, 779, __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_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, 779, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; } - /* "constraint/constraints.py":533 - * missing = True - * else: - * for var in self.sum_vars: # <<<<<<<<<<<<<< - * if var in assignments: - * 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, 533, __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; - } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __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, 533, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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, 533, __pyx_L1_error) - #endif - if (__pyx_t_7 >= __pyx_temp) break; - } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_7); - ++__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, 533, __pyx_L1_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_3, __pyx_t_7)); - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.ExactProdConstraint.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_19ExactProdConstraint_10preProcess_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, 779, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 779, __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, 779, __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, 779, __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, 779, __pyx_L1_error) #endif - ++__pyx_t_7; + if (__pyx_t_2 >= __pyx_temp) break; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 533, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + ++__pyx_t_2; } else { - __pyx_t_4 = __pyx_t_8(__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, 533, __pyx_L1_error) - PyErr_Clear(); - } - break; + { + 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) + #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; } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); - __pyx_t_4 = 0; - - /* "constraint/constraints.py":534 - * 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, 534, __pyx_L1_error) - if (__pyx_t_2) { - - /* "constraint/constraints.py":535 - * 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, 535, __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, 535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_1); - __pyx_t_1 = 0; - - /* "constraint/constraints.py":534 - * else: - * for var in self.sum_vars: - * if var in assignments: # <<<<<<<<<<<<<< - * sum_value += assignments[var] - * else: -*/ - goto __pyx_L13; - } - - /* "constraint/constraints.py":537 - * sum_value += assignments[var] - * else: - * sum_value += min(domains[var]) # use min value if not assigned # <<<<<<<<<<<<<< - * missing = True - * -*/ - /*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, 537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = 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)); - __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, 537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 779, __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, 779, __pyx_L1_error) + PyErr_Clear(); } - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 537, __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; - - /* "constraint/constraints.py":538 - * else: - * sum_value += min(domains[var]) # use min value if not assigned - * missing = True # <<<<<<<<<<<<<< - * - * if isinstance(sum_value, float): -*/ - __pyx_v_missing = 1; + break; } - __pyx_L13:; - - /* "constraint/constraints.py":533 - * missing = True - * else: - * for var in self.sum_vars: # <<<<<<<<<<<<<< - * if var in assignments: - * sum_value += assignments[var] -*/ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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, 779, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 779, __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_L4:; + __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); - /* "constraint/constraints.py":540 - * missing = True - * - * if isinstance(sum_value, float): # <<<<<<<<<<<<<< - * sum_value = round(sum_value, 10) - * -*/ - __pyx_t_2 = PyFloat_Check(__pyx_v_sum_value); - if (__pyx_t_2) { + /* 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":541 +/* "constraint/constraints.py":772 + * self._exactprod = exactprod * - * if isinstance(sum_value, float): - * sum_value = round(sum_value, 10) # <<<<<<<<<<<<<< + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * - * if missing: */ - __pyx_t_5 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_1 = __pyx_builtin_round; - __pyx_t_6 = 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, 541, __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":540 - * missing = True +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) { + PyObject *__pyx_v_variable_with_lt1 = NULL; + PyObject *__pyx_v_variable = NULL; + PyObject *__pyx_v_contains_lt1 = NULL; + 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_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 *); + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *(*__pyx_t_10)(PyObject *); + int __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + PyObject *(*__pyx_t_14)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("preProcess", 0); + + /* "constraint/constraints.py":773 * - * if isinstance(sum_value, float): # <<<<<<<<<<<<<< - * sum_value = round(sum_value, 10) + * 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 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, 773, __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, 773, __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(__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, 773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":543 - * sum_value = round(sum_value, 10) + /* "constraint/constraints.py":776 * - * if missing: # <<<<<<<<<<<<<< - * # Partial assignments: only check feasibility - * if sum_value > target_value: -*/ - if (__pyx_v_missing) { - - /* "constraint/constraints.py":545 - * 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, 545, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 545, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_2) { - - /* "constraint/constraints.py":546 - * # Partial assignments: only check feasibility - * if sum_value > target_value: - * return False # <<<<<<<<<<<<<< - * if forwardcheck: - * for var in self.sum_vars: -*/ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - - /* "constraint/constraints.py":545 - * if missing: - * # Partial assignments: only check feasibility - * if sum_value > target_value: # <<<<<<<<<<<<<< - * return False - * if forwardcheck: + * # 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, 776, __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, 776, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":547 - * if sum_value > target_value: - * return False - * if forwardcheck: # <<<<<<<<<<<<<< - * for var in self.sum_vars: - * if var not in assignments: + /* "constraint/constraints.py":777 + * # 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: + * contains_lt1 = any(value < 1 for value in domains[variable]) */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 547, __pyx_L1_error) - if (__pyx_t_2) { + __Pyx_INCREF(Py_None); + __pyx_v_variable_with_lt1 = Py_None; - /* "constraint/constraints.py":548 - * return False - * if forwardcheck: - * for var in self.sum_vars: # <<<<<<<<<<<<<< - * if var not in assignments: - * domain = domains[var] + /* "constraint/constraints.py":778 + * self._variable_contains_lt1: list[bool] = list() + * 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) */ - __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, 548, __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; + 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, 778, __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, 778, __pyx_L1_error) + } + for (;;) { + 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, 778, __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_6; } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __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, 548, __pyx_L1_error) + { + 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, 778, __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_1, __pyx_t_6)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + #endif + ++__pyx_t_6; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 548, __pyx_L1_error) - #endif - if (__pyx_t_7 >= __pyx_temp) break; - } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_7); - ++__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, 548, __pyx_L1_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_1, __pyx_t_7)); - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); - #endif - ++__pyx_t_7; - } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 548, __pyx_L1_error) - } else { - __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, 548, __pyx_L1_error) - PyErr_Clear(); - } - break; - } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 778, __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, 778, __pyx_L1_error) + PyErr_Clear(); } - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":549 - * 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, 549, __pyx_L1_error) - if (__pyx_t_2) { - - /* "constraint/constraints.py":550 - * 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, 550, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":551 - * 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, 551, __pyx_L1_error) - if (__pyx_t_2) { + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":552 - * 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: + /* "constraint/constraints.py":779 + * 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_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, 552, __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_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, 552, __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, 552, __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))) { - { - 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, 552, __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_11; - } 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, 552, __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)); - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_11); - #endif - ++__pyx_t_11; - } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __pyx_L1_error) - } else { - __pyx_t_3 = __pyx_t_12(__pyx_t_5); - 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, 552, __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_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 779, __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, 779, __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, 779, __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":553 - * 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) + /* "constraint/constraints.py":780 + * 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_sum_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __pyx_t_4; - __Pyx_INCREF(__pyx_t_9); - __pyx_t_6 = 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, 553, __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, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __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, 553, __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, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_temp_sum, __pyx_t_4); - __pyx_t_4 = 0; + __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, 780, __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, 780, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":554 - * for value in domain[:]: - * temp_sum = sum_value + (value * multipliers[self.sum_vars.index(var)]) - * if temp_sum > target_value: # <<<<<<<<<<<<<< - * domain.hideValue(value) - * else: + /* "constraint/constraints.py":778 + * self._variable_contains_lt1: list[bool] = list() + * 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) */ - __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, 554, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 554, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_2) { + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":555 - * temp_sum = sum_value + (value * multipliers[self.sum_vars.index(var)]) - * if temp_sum > target_value: - * domain.hideValue(value) # <<<<<<<<<<<<<< - * else: - * for value in domain[:]: + /* "constraint/constraints.py":781 + * 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: + * if variable_with_lt1 is not None: */ - __pyx_t_3 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_6 = 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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __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, 781, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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)); + __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, 781, __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_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, 781, __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, 781, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_7)) { + 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, 781, __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_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, 781, __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_2, __pyx_t_6)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __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, 781, __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, 781, __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_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 781, __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, 781, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 781, __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, 781, __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; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 781, __pyx_L1_error) + __pyx_t_10 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_unpacking_done; + __pyx_L8_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, 781, __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_t_4 = 0; - /* "constraint/constraints.py":554 - * for value in domain[:]: - * temp_sum = sum_value + (value * multipliers[self.sum_vars.index(var)]) - * if temp_sum > target_value: # <<<<<<<<<<<<<< - * domain.hideValue(value) - * else: + /* "constraint/constraints.py":782 + * self._variable_contains_lt1.append(contains_lt1) + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if contains_lt1 is True: # <<<<<<<<<<<<<< + * if variable_with_lt1 is not None: + * # if more than one associated variables contain less than 1, we can't prune */ - } + __pyx_t_11 = (__pyx_v_contains_lt1 == Py_True); + if (__pyx_t_11) { - /* "constraint/constraints.py":552 - * 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: + /* "constraint/constraints.py":783 + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if contains_lt1 is True: + * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< + * # if more than one associated variables contain less than 1, we can't prune + * return */ - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_11 = (__pyx_v_variable_with_lt1 != Py_None); + if (__pyx_t_11) { - /* "constraint/constraints.py":551 - * 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)]) + /* "constraint/constraints.py":785 + * if variable_with_lt1 is not None: + * # if more than one associated variables contain less than 1, we can't prune + * return # <<<<<<<<<<<<<< + * variable_with_lt1 = variable + * */ - goto __pyx_L22; - } + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; - /* "constraint/constraints.py":557 - * domain.hideValue(value) - * else: - * for value in domain[:]: # <<<<<<<<<<<<<< - * temp_sum = sum_value + value - * if temp_sum > target_value: + /* "constraint/constraints.py":783 + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if contains_lt1 is True: + * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< + * # if more than one associated variables contain less than 1, we can't prune + * return */ - /*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, 557, __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_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, 557, __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, 557, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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, 557, __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_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, 557, __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)); - #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); - #endif - ++__pyx_t_11; - } - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 557, __pyx_L1_error) - } else { - __pyx_t_5 = __pyx_t_12(__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, 557, __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":558 - * else: - * for value in domain[:]: - * temp_sum = sum_value + value # <<<<<<<<<<<<<< - * if temp_sum > target_value: - * domain.hideValue(value) + /* "constraint/constraints.py":786 + * # if more than one associated variables contain less than 1, we can't prune + * return + * variable_with_lt1 = variable # <<<<<<<<<<<<<< + * + * # prune the associated variables of values > exactprod */ - __pyx_t_5 = PyNumber_Add(__pyx_v_sum_value, __pyx_v_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 558, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_XDECREF_SET(__pyx_v_temp_sum, __pyx_t_5); - __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_v_variable); + __Pyx_DECREF_SET(__pyx_v_variable_with_lt1, __pyx_v_variable); - /* "constraint/constraints.py":559 - * for value in domain[:]: - * temp_sum = sum_value + value - * if temp_sum > target_value: # <<<<<<<<<<<<<< - * domain.hideValue(value) - * if not domain: + /* "constraint/constraints.py":782 + * self._variable_contains_lt1.append(contains_lt1) + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if contains_lt1 is True: # <<<<<<<<<<<<<< + * if variable_with_lt1 is not None: + * # if more than one associated variables contain less than 1, we can't prune */ - __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, 559, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 559, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_2) { + } - /* "constraint/constraints.py":560 - * temp_sum = sum_value + value - * if temp_sum > target_value: - * domain.hideValue(value) # <<<<<<<<<<<<<< - * if not domain: - * return False + /* "constraint/constraints.py":781 + * 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: + * if variable_with_lt1 is not None: */ - __pyx_t_3 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_6 = 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, 560, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":559 - * for value in domain[:]: - * temp_sum = sum_value + value - * if temp_sum > target_value: # <<<<<<<<<<<<<< - * domain.hideValue(value) - * if not domain: + /* "constraint/constraints.py":789 + * + * # 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, 789, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_exactprod = __pyx_t_2; + __pyx_t_2 = 0; - /* "constraint/constraints.py":557 - * domain.hideValue(value) - * else: - * for value in domain[:]: # <<<<<<<<<<<<<< - * temp_sum = sum_value + value - * if temp_sum > target_value: + /* "constraint/constraints.py":790 + * # 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: + * continue */ - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_L22:; + 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; + } else { + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __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, 790, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_7)) { + 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, 790, __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_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, 790, __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_2, __pyx_t_6)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __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, 790, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":561 - * if temp_sum > target_value: - * domain.hideValue(value) - * if not domain: # <<<<<<<<<<<<<< - * return False - * return True + /* "constraint/constraints.py":791 + * exactprod = self._exactprod + * for variable in variables: + * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< + * continue + * domain = domains[variable] */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 561, __pyx_L1_error) - __pyx_t_13 = (!__pyx_t_2); - if (__pyx_t_13) { + __pyx_t_12 = (__pyx_v_variable_with_lt1 != Py_None); + if (__pyx_t_12) { + } else { + __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, 791, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 791, __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":562 - * domain.hideValue(value) - * if not domain: - * return False # <<<<<<<<<<<<<< - * return True - * else: + /* "constraint/constraints.py":792 + * for variable in variables: + * if variable_with_lt1 is not None and variable_with_lt1 != variable: + * continue # <<<<<<<<<<<<<< + * domain = domains[variable] + * for value in domain[:]: */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; + goto __pyx_L13_continue; - /* "constraint/constraints.py":561 - * if temp_sum > target_value: - * domain.hideValue(value) - * if not domain: # <<<<<<<<<<<<<< - * return False - * return True + /* "constraint/constraints.py":791 + * exactprod = self._exactprod + * for variable in variables: + * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< + * continue + * domain = domains[variable] */ - } + } - /* "constraint/constraints.py":549 - * if forwardcheck: - * for var in self.sum_vars: - * if var not in assignments: # <<<<<<<<<<<<<< - * domain = domains[var] - * if multipliers: + /* "constraint/constraints.py":793 + * 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, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":548 - * return False - * if forwardcheck: - * for var in self.sum_vars: # <<<<<<<<<<<<<< - * if var not in assignments: - * domain = domains[var] + /* "constraint/constraints.py":794 + * 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, 794, __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_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, 794, __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, 794, __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))) { + { + 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, 794, __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_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, 794, __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)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); + #endif + ++__pyx_t_13; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 794, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_14(__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, 794, __pyx_L1_error) + PyErr_Clear(); + } + break; + } } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":547 - * if sum_value > target_value: - * return False - * if forwardcheck: # <<<<<<<<<<<<<< - * for var in self.sum_vars: - * if var not in assignments: + /* "constraint/constraints.py":795 + * 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, 795, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 795, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_11) { - /* "constraint/constraints.py":563 - * if not domain: - * return False - * return True # <<<<<<<<<<<<<< - * else: - * return sum_value == target_value + /* "constraint/constraints.py":796 + * for value in domain[:]: + * if value > exactprod: + * domain.remove(value) # <<<<<<<<<<<<<< + * elif value == 0 and exactprod != 0: + * domain.remove(value) */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; + __pyx_t_3 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_3); + __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, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":543 - * sum_value = round(sum_value, 10) - * - * if missing: # <<<<<<<<<<<<<< - * # Partial assignments: only check feasibility - * if sum_value > target_value: + /* "constraint/constraints.py":795 + * domain = domains[variable] + * for value in domain[:]: + * if value > exactprod: # <<<<<<<<<<<<<< + * domain.remove(value) + * elif value == 0 and exactprod != 0: */ - } + goto __pyx_L20; + } - /* "constraint/constraints.py":565 - * return True - * else: - * return sum_value == target_value # <<<<<<<<<<<<<< - * + /* "constraint/constraints.py":797 + * if value > exactprod: + * domain.remove(value) + * elif value == 0 and exactprod != 0: # <<<<<<<<<<<<<< + * domain.remove(value) * */ - /*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, 565, __pyx_L1_error) - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - } + __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, 797, __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, 797, __pyx_L1_error) + __pyx_t_11 = __pyx_t_12; + __pyx_L21_bool_binop_done:; + if (__pyx_t_11) { - /* "constraint/constraints.py":516 - * domain.remove(value) - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * multipliers = self._multipliers + /* "constraint/constraints.py":798 + * 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_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, 798, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_multipliers); - __Pyx_XDECREF(__pyx_v_target_value); - __Pyx_XDECREF(__pyx_v_sum_value); - __Pyx_XDECREF(__pyx_v_var); - __Pyx_XDECREF(__pyx_v_multiplier); - __Pyx_XDECREF(__pyx_v_domain); - __Pyx_XDECREF(__pyx_v_value); - __Pyx_XDECREF(__pyx_v_temp_sum); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "constraint/constraints.py":579 - * """ - * - * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< - * """Initialization method. + /* "constraint/constraints.py":797 + * if value > exactprod: + * domain.remove(value) + * elif value == 0 and exactprod != 0: # <<<<<<<<<<<<<< + * domain.remove(value) * */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_16MinSumConstraint_1__init__(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_16MinSumConstraint___init__, "Initialization method.\n\n Args:\n minsum (number): Value to be considered as the minimum sum\n multipliers (sequence of numbers): If given, variable values\n will be multiplied by the given factors before being\n summed to be checked\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_16MinSumConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_16MinSumConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_16MinSumConstraint___init__}; -static PyObject *__pyx_pw_10constraint_11constraints_16MinSumConstraint_1__init__(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_minsum = 0; - PyObject *__pyx_v_multipliers = 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("__init__ (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_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, 579, __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, 579, __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, 579, __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, 579, __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, 579, __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, 579, __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, 579, __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, 579, __pyx_L3_error) - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 579, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_error; } - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); - } - __pyx_v_self = values[0]; - __pyx_v_minsum = values[1]; - __pyx_v_multipliers = values[2]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 579, __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.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_16MinSumConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_minsum, __pyx_v_multipliers); - - /* 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_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 - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); + __pyx_L20:; - /* "constraint/constraints.py":588 - * summed to be checked - * """ - * self._minsum = minsum # <<<<<<<<<<<<<< - * self._multipliers = multipliers - * + /* "constraint/constraints.py":794 + * continue + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value > exactprod: + * domain.remove(value) */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_minsum_2, __pyx_v_minsum) < 0) __PYX_ERR(0, 588, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":589 - * """ - * self._minsum = minsum - * self._multipliers = multipliers # <<<<<<<<<<<<<< - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + /* "constraint/constraints.py":790 + * # 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: + * continue */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2, __pyx_v_multipliers) < 0) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_L13_continue:; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":579 - * """ + /* "constraint/constraints.py":772 + * self._exactprod = exactprod * - * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< - * """Initialization method. + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * */ @@ -15081,32 +20918,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint___init__ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.MinSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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.ExactProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_variable_with_lt1); + __Pyx_XDECREF(__pyx_v_variable); + __Pyx_XDECREF(__pyx_v_contains_lt1); + __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_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":591 - * self._multipliers = multipliers +/* "constraint/constraints.py":800 + * 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: + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * exactprod = self._exactprod + * prod = 1 */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_16MinSumConstraint_3__call__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_19ExactProdConstraint_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_19ExactProdConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_19ExactProdConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_19ExactProdConstraint_5__call__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -15115,9 +20964,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_variables = 0; - CYTHON_UNUSED PyObject *__pyx_v_domains = 0; + PyObject *__pyx_v_domains = 0; PyObject *__pyx_v_assignments = 0; - CYTHON_UNUSED PyObject *__pyx_v_forwardcheck = 0; + PyObject *__pyx_v_forwardcheck = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -15140,53 +20989,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, 591, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 800, __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, 591, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 800, __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, 591, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 800, __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, 591, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 800, __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, 591, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 800, __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, 591, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 800, __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, 591, __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, 800, __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, 591, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 800, __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, 591, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 800, __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, 591, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 800, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 591, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 800, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 591, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 800, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 591, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 800, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -15200,20 +21049,20 @@ 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, 591, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 800, __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.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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, 591, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 591, __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, 800, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 800, __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; @@ -15232,507 +21081,708 @@ 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) { +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; + int __pyx_v_missing; + PyObject *__pyx_v_missing_lt1 = NULL; PyObject *__pyx_v_variable = NULL; - PyObject *__pyx_v_multipliers = NULL; - PyObject *__pyx_v_minsum = NULL; - PyObject *__pyx_v_sum = NULL; - PyObject *__pyx_v_multiplier = NULL; + PyObject *__pyx_v_contains_lt1 = NULL; + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_value = 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_2 = NULL; + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - size_t __pyx_t_7; + 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_9)(PyObject *); + int __pyx_t_10; + int __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __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":593 + /* "constraint/constraints.py":801 + * * 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 + * exactprod = self._exactprod # <<<<<<<<<<<<<< + * prod = 1 + * missing = False */ - 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, 593, __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, 801, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_exactprod = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":802 + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * exactprod = self._exactprod + * prod = 1 # <<<<<<<<<<<<<< + * missing = False + * missing_lt1 = False +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); + __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; + + /* "constraint/constraints.py":803 + * exactprod = self._exactprod + * prod = 1 + * missing = False # <<<<<<<<<<<<<< + * missing_lt1 = False + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): +*/ + __pyx_v_missing = 0; + + /* "constraint/constraints.py":804 + * prod = 1 + * missing = False + * missing_lt1 = False # <<<<<<<<<<<<<< + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if variable in assignments: +*/ + __Pyx_INCREF(Py_False); + __pyx_v_missing_lt1 = Py_False; + + /* "constraint/constraints.py":805 + * missing = False + * missing_lt1 = False + * 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, 805, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = 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, 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, 593, __pyx_L1_error) } + 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; + } else { + __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 805, __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, 805, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(!__pyx_t_7)) { + 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, 593, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 805, __pyx_L1_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); - ++__pyx_t_2; + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_6); + ++__pyx_t_6; } 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, 593, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 805, __pyx_L1_error) #endif - if (__pyx_t_2 >= __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_1, __pyx_t_2)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); #endif - ++__pyx_t_2; + ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 805, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { + __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, 593, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 805, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_4); + __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, 805, __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_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 805, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 805, __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, 805, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 805, __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_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 805, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __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, 805, __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; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 805, __pyx_L1_error) + __pyx_L6_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; - /* "constraint/constraints.py":594 - * # check if each variable is in the assignments - * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< - * return True - * + /* "constraint/constraints.py":806 + * missing_lt1 = False + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if variable in assignments: # <<<<<<<<<<<<<< + * prod *= assignments[variable] + * else: */ - __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 594, __pyx_L1_error) - if (__pyx_t_5) { + __pyx_t_10 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 806, __pyx_L1_error) + if (__pyx_t_10) { - /* "constraint/constraints.py":595 - * for variable in variables: - * if variable not in assignments: - * return True # <<<<<<<<<<<<<< - * - * # with each variable assigned, sum the values + /* "constraint/constraints.py":807 + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if variable in assignments: + * prod *= assignments[variable] # <<<<<<<<<<<<<< + * else: + * missing = True */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 807, __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, 807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; + __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/constraints.py":594 - * # check if each variable is in the assignments - * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< - * return True - * + /* "constraint/constraints.py":806 + * missing_lt1 = False + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if variable in assignments: # <<<<<<<<<<<<<< + * prod *= assignments[variable] + * else: */ + goto __pyx_L7; } - /* "constraint/constraints.py":593 - * 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 + /* "constraint/constraints.py":809 + * prod *= assignments[variable] + * else: + * missing = True # <<<<<<<<<<<<<< + * if not missing_lt1: + * missing_lt1 = contains_lt1 +*/ + /*else*/ { + __pyx_v_missing = 1; + + /* "constraint/constraints.py":810 + * else: + * missing = True + * if not missing_lt1: # <<<<<<<<<<<<<< + * missing_lt1 = contains_lt1 + * if isinstance(prod, float): +*/ + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_missing_lt1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 810, __pyx_L1_error) + __pyx_t_11 = (!__pyx_t_10); + if (__pyx_t_11) { + + /* "constraint/constraints.py":811 + * missing = True + * if not missing_lt1: + * missing_lt1 = contains_lt1 # <<<<<<<<<<<<<< + * if isinstance(prod, float): + * prod = round(prod, 10) +*/ + __Pyx_INCREF(__pyx_v_contains_lt1); + __Pyx_DECREF_SET(__pyx_v_missing_lt1, __pyx_v_contains_lt1); + + /* "constraint/constraints.py":810 + * else: + * missing = True + * if not missing_lt1: # <<<<<<<<<<<<<< + * missing_lt1 = contains_lt1 + * if isinstance(prod, float): +*/ + } + } + __pyx_L7:; + + /* "constraint/constraints.py":805 + * missing = False + * missing_lt1 = False + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< + * if variable in assignments: + * prod *= assignments[variable] */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":598 - * - * # with each variable assigned, sum the values - * multipliers = self._multipliers # <<<<<<<<<<<<<< - * minsum = self._minsum - * sum = 0 + /* "constraint/constraints.py":812 + * if not missing_lt1: + * missing_lt1 = contains_lt1 + * if isinstance(prod, float): # <<<<<<<<<<<<<< + * prod = round(prod, 10) + * if not missing and prod != exactprod or (not missing_lt1 and prod > exactprod): */ - __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, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_multipliers = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_11 = PyFloat_Check(__pyx_v_prod); + if (__pyx_t_11) { - /* "constraint/constraints.py":599 - * # with each variable assigned, sum the values - * multipliers = self._multipliers - * minsum = self._minsum # <<<<<<<<<<<<<< - * sum = 0 - * if multipliers: + /* "constraint/constraints.py":813 + * missing_lt1 = contains_lt1 + * if isinstance(prod, float): + * prod = round(prod, 10) # <<<<<<<<<<<<<< + * if not missing and prod != exactprod or (not missing_lt1 and prod > exactprod): + * return 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, 599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_minsum = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_2 = NULL; + __Pyx_INCREF(__pyx_builtin_round); + __pyx_t_1 = __pyx_builtin_round; + __pyx_t_5 = 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, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":600 - * multipliers = self._multipliers - * minsum = self._minsum - * sum = 0 # <<<<<<<<<<<<<< - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): + /* "constraint/constraints.py":812 + * if not missing_lt1: + * missing_lt1 = contains_lt1 + * if isinstance(prod, float): # <<<<<<<<<<<<<< + * prod = round(prod, 10) + * if not missing and prod != exactprod or (not missing_lt1 and prod > exactprod): +*/ + } + + /* "constraint/constraints.py":814 + * if isinstance(prod, float): + * prod = round(prod, 10) + * if not missing and prod != exactprod or (not missing_lt1 and prod > exactprod): # <<<<<<<<<<<<<< + * return False + * if forwardcheck and not missing_lt1: +*/ + __pyx_t_10 = (!__pyx_v_missing); + if (!__pyx_t_10) { + goto __pyx_L13_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, 814, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 814, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_10) { + } else { + __pyx_t_11 = __pyx_t_10; + goto __pyx_L12_bool_binop_done; + } + __pyx_L13_next_or:; + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_missing_lt1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_12 = (!__pyx_t_10); + if (__pyx_t_12) { + } else { + __pyx_t_11 = __pyx_t_12; + goto __pyx_L12_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, 814, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 814, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = __pyx_t_12; + __pyx_L12_bool_binop_done:; + if (__pyx_t_11) { + + /* "constraint/constraints.py":815 + * prod = round(prod, 10) + * if not missing and prod != exactprod or (not missing_lt1 and prod > exactprod): + * return False # <<<<<<<<<<<<<< + * if forwardcheck and not missing_lt1: + * for variable in variables: +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "constraint/constraints.py":814 + * if isinstance(prod, float): + * prod = round(prod, 10) + * if not missing and prod != exactprod or (not missing_lt1 and prod > exactprod): # <<<<<<<<<<<<<< + * return False + * if forwardcheck and not missing_lt1: */ - __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); - __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; + } - /* "constraint/constraints.py":601 - * minsum = self._minsum - * sum = 0 - * if multipliers: # <<<<<<<<<<<<<< - * for variable, multiplier in zip(variables, multipliers): - * sum += assignments[variable] * multiplier + /* "constraint/constraints.py":816 + * if not missing and prod != exactprod or (not missing_lt1 and prod > exactprod): + * return False + * if forwardcheck and not missing_lt1: # <<<<<<<<<<<<<< + * for variable in variables: + * if variable not in assignments: */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 601, __pyx_L1_error) - if (__pyx_t_5) { + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 816, __pyx_L1_error) + if (__pyx_t_12) { + } else { + __pyx_t_11 = __pyx_t_12; + goto __pyx_L17_bool_binop_done; + } + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_missing_lt1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_10 = (!__pyx_t_12); + __pyx_t_11 = __pyx_t_10; + __pyx_L17_bool_binop_done:; + if (__pyx_t_11) { - /* "constraint/constraints.py":602 - * sum = 0 - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< - * sum += assignments[variable] * multiplier - * else: + /* "constraint/constraints.py":817 + * return False + * if forwardcheck and not missing_lt1: + * for variable in variables: # <<<<<<<<<<<<<< + * if variable not in assignments: + * domain = domains[variable] */ - __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_6 = __pyx_builtin_zip; - __pyx_t_7 = 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, 602, __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; + 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; } else { - __pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 602, __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, 602, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __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, 817, __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_7)) { + 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, 602, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 817, __pyx_L1_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_2); - ++__pyx_t_2; + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_6); + ++__pyx_t_6; } 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, 602, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 817, __pyx_L1_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + 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_6, __pyx_t_2)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_2); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); #endif - ++__pyx_t_2; + ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_3(__pyx_t_6); + __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, 602, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 817, __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, 602, __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_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, 602, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __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, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __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, 602, __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; - __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 602, __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:; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_10 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 602, __pyx_L1_error) - __pyx_L11_unpacking_done:; - } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); - __pyx_t_8 = 0; - - /* "constraint/constraints.py":603 - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): - * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< - * 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, 603, __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, 603, __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, 603, __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_XDECREF_SET(__pyx_v_variable, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":602 - * sum = 0 - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< - * sum += assignments[variable] * multiplier - * else: + /* "constraint/constraints.py":818 + * if forwardcheck and not missing_lt1: + * for variable in variables: + * if variable not in assignments: # <<<<<<<<<<<<<< + * domain = domains[variable] + * for value in domain[:]: */ - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_11 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 818, __pyx_L1_error) + if (__pyx_t_11) { - /* "constraint/constraints.py":601 - * minsum = self._minsum - * sum = 0 - * if multipliers: # <<<<<<<<<<<<<< - * for variable, multiplier in zip(variables, multipliers): - * sum += assignments[variable] * multiplier + /* "constraint/constraints.py":819 + * for variable in variables: + * if variable not in assignments: + * domain = domains[variable] # <<<<<<<<<<<<<< + * for value in domain[:]: + * if prod * value > exactprod: */ - goto __pyx_L7; - } + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":605 - * sum += assignments[variable] * multiplier - * else: - * for variable in variables: # <<<<<<<<<<<<<< - * sum += assignments[variable] - * if isinstance(sum, float): + /* "constraint/constraints.py":820 + * if variable not in assignments: + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if prod * value > exactprod: + * domain.hideValue(value) */ - /*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; - } else { - __pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 605, __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, 605, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_6))) { - { - 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, 605, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_2); - ++__pyx_t_2; + __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, 820, __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; } 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, 605, __pyx_L1_error) - #endif - 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_6, __pyx_t_2)); - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_2); - #endif - ++__pyx_t_2; + __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 820, __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, 820, __pyx_L1_error) } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error) - } else { - __pyx_t_1 = __pyx_t_3(__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, 605, __pyx_L1_error) - PyErr_Clear(); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_14)) { + 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, 820, __pyx_L1_error) + #endif + if (__pyx_t_13 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_13); + ++__pyx_t_13; + } 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, 820, __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_2, __pyx_t_13)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); + #endif + ++__pyx_t_13; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_14(__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, 820, __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":821 + * 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, 821, __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, 821, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 821, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_11) { + + /* "constraint/constraints.py":822 + * 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; + { + 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, 822, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":821 + * domain = domains[variable] + * for value in domain[:]: + * if prod * value > exactprod: # <<<<<<<<<<<<<< + * domain.hideValue(value) + * if not domain: +*/ } - break; + + /* "constraint/constraints.py":820 + * if variable not in assignments: + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if prod * value > exactprod: + * domain.hideValue(value) +*/ } - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":606 - * else: - * for variable in variables: - * sum += assignments[variable] # <<<<<<<<<<<<<< - * if isinstance(sum, float): - * sum = round(sum, 10) + /* "constraint/constraints.py":823 + * if prod * value > exactprod: + * domain.hideValue(value) + * if not domain: # <<<<<<<<<<<<<< + * return False + * return True */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __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, 606, __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_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 823, __pyx_L1_error) + __pyx_t_10 = (!__pyx_t_11); + if (__pyx_t_10) { - /* "constraint/constraints.py":605 - * sum += assignments[variable] * multiplier - * else: - * for variable in variables: # <<<<<<<<<<<<<< - * sum += assignments[variable] - * if isinstance(sum, float): + /* "constraint/constraints.py":824 + * domain.hideValue(value) + * if not domain: + * return False # <<<<<<<<<<<<<< + * return True + * */ - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __pyx_L7:; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L0; - /* "constraint/constraints.py":607 + /* "constraint/constraints.py":823 + * if prod * value > exactprod: + * domain.hideValue(value) + * if not domain: # <<<<<<<<<<<<<< + * return False + * return True +*/ + } + + /* "constraint/constraints.py":818 + * if forwardcheck and not missing_lt1: * for variable in variables: - * sum += assignments[variable] - * if isinstance(sum, float): # <<<<<<<<<<<<<< - * sum = round(sum, 10) - * return sum >= minsum + * if variable not in assignments: # <<<<<<<<<<<<<< + * domain = domains[variable] + * for value in domain[:]: */ - __pyx_t_5 = PyFloat_Check(__pyx_v_sum); - if (__pyx_t_5) { + } - /* "constraint/constraints.py":608 - * sum += assignments[variable] - * if isinstance(sum, float): - * sum = round(sum, 10) # <<<<<<<<<<<<<< - * return sum >= minsum - * + /* "constraint/constraints.py":817 + * return False + * if forwardcheck and not missing_lt1: + * for variable in variables: # <<<<<<<<<<<<<< + * if variable not in assignments: + * domain = domains[variable] */ - __pyx_t_8 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_1 = __pyx_builtin_round; - __pyx_t_7 = 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_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, 608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); } - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_6); - __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":607 + /* "constraint/constraints.py":816 + * if not missing and prod != exactprod or (not missing_lt1 and prod > exactprod): + * return False + * if forwardcheck and not missing_lt1: # <<<<<<<<<<<<<< * for variable in variables: - * sum += assignments[variable] - * if isinstance(sum, float): # <<<<<<<<<<<<<< - * sum = round(sum, 10) - * return sum >= minsum + * if variable not in assignments: */ } - /* "constraint/constraints.py":609 - * if isinstance(sum, float): - * sum = round(sum, 10) - * return sum >= minsum # <<<<<<<<<<<<<< + /* "constraint/constraints.py":825 + * if not domain: + * return False + * return True # <<<<<<<<<<<<<< * * */ __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, 609, __pyx_L1_error) - __pyx_r = __pyx_t_6; - __pyx_t_6 = 0; + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":591 - * self._multipliers = multipliers + /* "constraint/constraints.py":800 + * 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 */ /* 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_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("constraint.constraints.MinSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.ExactProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_exactprod); + __Pyx_XDECREF(__pyx_v_prod); + __Pyx_XDECREF(__pyx_v_missing_lt1); __Pyx_XDECREF(__pyx_v_variable); - __Pyx_XDECREF(__pyx_v_multipliers); - __Pyx_XDECREF(__pyx_v_minsum); - __Pyx_XDECREF(__pyx_v_sum); - __Pyx_XDECREF(__pyx_v_multiplier); + __Pyx_XDECREF(__pyx_v_contains_lt1); + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":615 - * """Constraint enforcing that values of given variables create a product up to at most a given amount.""" +/* "constraint/constraints.py":839 + * """ * * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MaxProdConstraint. @@ -15780,39 +21830,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, 615, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 839, __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, 615, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 839, __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, 615, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 839, __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, 615, __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, 839, __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, 615, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 839, __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, 615, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 839, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 615, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 839, __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, 615, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 839, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -15841,17 +21891,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":621 + /* "constraint/constraints.py":845 * maxprod: Value to be considered as the maximum product * """ * self._maxprod = maxprod # <<<<<<<<<<<<<< * * 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, 621, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxprod_2, __pyx_v_maxprod) < 0) __PYX_ERR(0, 845, __pyx_L1_error) - /* "constraint/constraints.py":615 - * """Constraint enforcing that values of given variables create a product up to at most a given amount.""" + /* "constraint/constraints.py":839 + * """ * * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MaxProdConstraint. @@ -15870,7 +21920,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ return __pyx_r; } -/* "constraint/constraints.py":623 +/* "constraint/constraints.py":847 * self._maxprod = maxprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -15921,50 +21971,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, 623, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 847, __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, 623, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 847, __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, 623, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 847, __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, 623, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 847, __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, 623, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 847, __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, 623, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 847, __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, 623, __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, 847, __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, 623, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 847, __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, 623, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 847, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 623, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 847, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 623, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 847, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 623, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 847, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 623, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 847, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -15974,7 +22024,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, 623, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 847, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -15985,9 +22035,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, 623, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 623, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 623, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 847, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 847, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 847, __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 */ @@ -16006,29 +22056,29 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":630 +/* "constraint/constraints.py":854 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< - * variable_contains_lt1.append(contains_lt1) - * if contains_lt1 is True: + * self._variable_contains_lt1.append(contains_lt1) + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): */ 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_5_genexpr *__pyx_cur_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_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_5_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 630, __pyx_L1_error) + __PYX_ERR(0, 854, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -16036,7 +22086,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_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_MaxProdConstraint_preProcess_loc, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 630, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_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_MaxProdConstraint_preProcess_loc, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -16052,9 +22102,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_10prePr return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -16073,16 +22123,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 630, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 630, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 854, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 854, __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, 630, __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, 854, __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, 630, __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, 854, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -16090,7 +22140,7 @@ 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, 630, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 854, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -16100,7 +22150,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr { 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, 630, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 854, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -16111,13 +22161,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 630, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __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, 630, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 854, __pyx_L1_error) PyErr_Clear(); } break; @@ -16128,8 +22178,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, 630, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 630, __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, 854, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_XDECREF(__pyx_r); @@ -16168,7 +22218,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr return __pyx_r; } -/* "constraint/constraints.py":623 +/* "constraint/constraints.py":847 * self._maxprod = maxprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -16177,14 +22227,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr */ 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) { - PyObject *__pyx_v_variable_contains_lt1 = 0; PyObject *__pyx_v_variable_with_lt1 = NULL; PyObject *__pyx_v_variable = NULL; PyObject *__pyx_v_contains_lt1 = NULL; PyObject *__pyx_v_maxprod = NULL; PyObject *__pyx_v_domain = NULL; PyObject *__pyx_v_value = NULL; - PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator4 = 0; + PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator9 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -16195,16 +22244,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; - int __pyx_t_9; - int __pyx_t_10; - Py_ssize_t __pyx_t_11; - PyObject *(*__pyx_t_12)(PyObject *); + PyObject *__pyx_t_9 = NULL; + PyObject *(*__pyx_t_10)(PyObject *); + int __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + PyObject *(*__pyx_t_14)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":624 + /* "constraint/constraints.py":848 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -16212,9 +22263,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, 624, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __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, 624, __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, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -16234,26 +22285,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __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_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, 624, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":627 + /* "constraint/constraints.py":851 * * # check if there are any values less than 1 in the associated variables - * variable_contains_lt1: list[bool] = list() # <<<<<<<<<<<<<< + * 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, 627, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_variable_contains_lt1 = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1, __pyx_t_1) < 0) __PYX_ERR(0, 851, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":628 + /* "constraint/constraints.py":852 * # check if there are any values less than 1 in the associated variables - * variable_contains_lt1: list[bool] = list() + * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None # <<<<<<<<<<<<<< * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) @@ -16261,21 +22312,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_INCREF(Py_None); __pyx_v_variable_with_lt1 = Py_None; - /* "constraint/constraints.py":629 - * variable_contains_lt1: list[bool] = list() + /* "constraint/constraints.py":853 + * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< * contains_lt1 = any(value < 1 for value in domains[variable]) - * variable_contains_lt1.append(contains_lt1) + * self._variable_contains_lt1.append(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_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, 629, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __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, 629, __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, 853, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -16283,7 +22334,7 @@ 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, 629, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 853, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16293,7 +22344,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 629, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 853, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16304,13 +22355,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 853, __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, 629, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 853, __pyx_L1_error) PyErr_Clear(); } break; @@ -16320,54 +22371,194 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":630 + /* "constraint/constraints.py":854 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< - * variable_contains_lt1.append(contains_lt1) - * if contains_lt1 is True: + * 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, 630, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __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, 630, __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, 854, __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, 630, __pyx_L1_error) + __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __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":631 + /* "constraint/constraints.py":855 * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) - * variable_contains_lt1.append(contains_lt1) # <<<<<<<<<<<<<< + * self._variable_contains_lt1.append(contains_lt1) # <<<<<<<<<<<<<< + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: - * if variable_with_lt1 is not None: */ - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_variable_contains_lt1, __pyx_v_contains_lt1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 631, __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, 855, __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, 855, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":853 + * self._variable_contains_lt1: list[bool] = list() + * 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) +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":632 + /* "constraint/constraints.py":856 * contains_lt1 = any(value < 1 for value in domains[variable]) - * variable_contains_lt1.append(contains_lt1) + * self._variable_contains_lt1.append(contains_lt1) + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< + * if contains_lt1 is True: + * 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, 856, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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)); + __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, 856, __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_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, 856, __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, 856, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_7)) { + 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, 856, __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_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, 856, __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_2, __pyx_t_6)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __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, 856, __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, 856, __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_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __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, 856, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __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, 856, __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; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_10 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_unpacking_done; + __pyx_L8_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, 856, __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_t_4 = 0; + + /* "constraint/constraints.py":857 + * self._variable_contains_lt1.append(contains_lt1) + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: # <<<<<<<<<<<<<< * if variable_with_lt1 is not None: * # if more than one associated variables contain less than 1, we can't prune */ - __pyx_t_9 = (__pyx_v_contains_lt1 == Py_True); - if (__pyx_t_9) { + __pyx_t_11 = (__pyx_v_contains_lt1 == Py_True); + if (__pyx_t_11) { - /* "constraint/constraints.py":633 - * variable_contains_lt1.append(contains_lt1) + /* "constraint/constraints.py":858 + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< * # if more than one associated variables contain less than 1, we can't prune * return */ - __pyx_t_9 = (__pyx_v_variable_with_lt1 != Py_None); - if (__pyx_t_9) { + __pyx_t_11 = (__pyx_v_variable_with_lt1 != Py_None); + if (__pyx_t_11) { - /* "constraint/constraints.py":635 + /* "constraint/constraints.py":860 * if variable_with_lt1 is not None: * # if more than one associated variables contain less than 1, we can't prune * return # <<<<<<<<<<<<<< @@ -16376,11 +22567,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/constraints.py":633 - * variable_contains_lt1.append(contains_lt1) + /* "constraint/constraints.py":858 + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< * # if more than one associated variables contain less than 1, we can't prune @@ -16388,7 +22579,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":636 + /* "constraint/constraints.py":861 * # if more than one associated variables contain less than 1, we can't prune * return * variable_with_lt1 = variable # <<<<<<<<<<<<<< @@ -16398,38 +22589,38 @@ 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":632 - * contains_lt1 = any(value < 1 for value in domains[variable]) - * variable_contains_lt1.append(contains_lt1) + /* "constraint/constraints.py":857 + * self._variable_contains_lt1.append(contains_lt1) + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: # <<<<<<<<<<<<<< * if variable_with_lt1 is not None: * # if more than one associated variables contain less than 1, we can't prune */ } - /* "constraint/constraints.py":629 - * variable_contains_lt1: list[bool] = list() - * variable_with_lt1 = None - * for variable in variables: # <<<<<<<<<<<<<< + /* "constraint/constraints.py":856 * contains_lt1 = any(value < 1 for value in domains[variable]) - * variable_contains_lt1.append(contains_lt1) + * self._variable_contains_lt1.append(contains_lt1) + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< + * if contains_lt1 is True: + * if variable_with_lt1 is not None: */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":639 + /* "constraint/constraints.py":864 * * # 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_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_maxprod = __pyx_t_1; - __pyx_t_1 = 0; + __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, 864, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_maxprod = __pyx_t_2; + __pyx_t_2 = 0; - /* "constraint/constraints.py":640 + /* "constraint/constraints.py":865 * # prune the associated variables of values > maxprod * maxprod = self._maxprod * for variable in variables: # <<<<<<<<<<<<<< @@ -16437,87 +22628,87 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * continue */ 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 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_2); __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, 640, __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, 640, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 865, __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, 865, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { - 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, 640, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 865, __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_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6); ++__pyx_t_6; } 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, 640, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 865, __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_1, __pyx_t_6)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 640, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_7(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { + __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, 640, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 865, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":641 + /* "constraint/constraints.py":866 * maxprod = self._maxprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< * continue * domain = domains[variable] */ - __pyx_t_10 = (__pyx_v_variable_with_lt1 != Py_None); - if (__pyx_t_10) { + __pyx_t_12 = (__pyx_v_variable_with_lt1 != Py_None); + if (__pyx_t_12) { } else { - __pyx_t_9 = __pyx_t_10; - goto __pyx_L11_bool_binop_done; + __pyx_t_11 = __pyx_t_12; + goto __pyx_L16_bool_binop_done; } - __pyx_t_4 = PyObject_RichCompare(__pyx_v_variable_with_lt1, __pyx_v_variable, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 641, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = __pyx_t_10; - __pyx_L11_bool_binop_done:; - if (__pyx_t_9) { + __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, 866, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 866, __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":642 + /* "constraint/constraints.py":867 * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: * continue # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: */ - goto __pyx_L8_continue; + goto __pyx_L13_continue; - /* "constraint/constraints.py":641 + /* "constraint/constraints.py":866 * maxprod = self._maxprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -16526,93 +22717,93 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":643 + /* "constraint/constraints.py":868 * 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_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 643, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_domain, __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, 868, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":644 + /* "constraint/constraints.py":869 * continue * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< * if value > maxprod: * 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, 644, __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_11 = 0; - __pyx_t_12 = NULL; + __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, 869, __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_13 = 0; + __pyx_t_14 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 644, __pyx_L1_error) + __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 869, __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, 869, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(!__pyx_t_14)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_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, 644, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 869, __pyx_L1_error) #endif - if (__pyx_t_11 >= __pyx_temp) break; + if (__pyx_t_13 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_11); - ++__pyx_t_11; + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_13); + ++__pyx_t_13; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + 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, 644, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 869, __pyx_L1_error) #endif - if (__pyx_t_11 >= __pyx_temp) break; + if (__pyx_t_13 >= __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_11)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); #endif - ++__pyx_t_11; + ++__pyx_t_13; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 644, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_12(__pyx_t_2); - if (unlikely(!__pyx_t_4)) { + __pyx_t_1 = __pyx_t_14(__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, 644, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 869, __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_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":645 + /* "constraint/constraints.py":870 * domain = domains[variable] * for value in domain[:]: * if value > maxprod: # <<<<<<<<<<<<<< * domain.remove(value) * elif value == 0 and maxprod < 0: */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_value, __pyx_v_maxprod, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 645, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 645, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_9) { + __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, 870, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 870, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_11) { - /* "constraint/constraints.py":646 + /* "constraint/constraints.py":871 * for value in domain[:]: * if value > maxprod: * domain.remove(value) # <<<<<<<<<<<<<< @@ -16624,44 +22815,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_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_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_4)) __PYX_ERR(0, 646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":645 + /* "constraint/constraints.py":870 * domain = domains[variable] * for value in domain[:]: * if value > maxprod: # <<<<<<<<<<<<<< * domain.remove(value) * elif value == 0 and maxprod < 0: */ - goto __pyx_L15; + goto __pyx_L20; } - /* "constraint/constraints.py":647 + /* "constraint/constraints.py":872 * if value > maxprod: * domain.remove(value) * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< * domain.remove(value) * */ - __pyx_t_10 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 647, __pyx_L1_error) - if (__pyx_t_10) { + __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, 872, __pyx_L1_error) + if (__pyx_t_12) { } else { - __pyx_t_9 = __pyx_t_10; - goto __pyx_L16_bool_binop_done; + __pyx_t_11 = __pyx_t_12; + goto __pyx_L21_bool_binop_done; } - __pyx_t_4 = PyObject_RichCompare(__pyx_v_maxprod, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 647, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = __pyx_t_10; - __pyx_L16_bool_binop_done:; - if (__pyx_t_9) { + __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, 872, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 872, __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":648 + /* "constraint/constraints.py":873 * domain.remove(value) * elif value == 0 and maxprod < 0: * domain.remove(value) # <<<<<<<<<<<<<< @@ -16673,14 +22864,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_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_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_4)) __PYX_ERR(0, 648, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":647 + /* "constraint/constraints.py":872 * if value > maxprod: * domain.remove(value) * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< @@ -16688,9 +22879,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * */ } - __pyx_L15:; + __pyx_L20:; - /* "constraint/constraints.py":644 + /* "constraint/constraints.py":869 * continue * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -16698,20 +22889,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * domain.remove(value) */ } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":640 + /* "constraint/constraints.py":865 * # 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: * continue */ - __pyx_L8_continue:; + __pyx_L13_continue:; } - __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":847 * self._maxprod = maxprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -16727,23 +22918,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_variable_contains_lt1); __Pyx_XDECREF(__pyx_v_variable_with_lt1); __Pyx_XDECREF(__pyx_v_variable); __Pyx_XDECREF(__pyx_v_contains_lt1); __Pyx_XDECREF(__pyx_v_maxprod); __Pyx_XDECREF(__pyx_v_domain); __Pyx_XDECREF(__pyx_v_value); - __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator4); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator9); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":650 +/* "constraint/constraints.py":875 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -16794,53 +22985,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, 650, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 875, __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, 650, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 875, __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, 650, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 875, __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, 650, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 875, __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, 650, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 875, __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, 650, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 875, __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, 650, __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, 875, __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, 650, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 875, __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, 650, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 875, __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, 650, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 875, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 650, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 875, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 650, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 875, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 650, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 875, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -16854,7 +23045,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, 650, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 875, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -16865,8 +23056,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, 650, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 650, __pyx_L1_error) + 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_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 875, __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 */ @@ -16889,210 +23080,361 @@ PyObject *__pyx_args, PyObject *__pyx_kwds 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; PyObject *__pyx_v_prod = NULL; + int __pyx_v_missing; + PyObject *__pyx_v_missing_lt1 = NULL; PyObject *__pyx_v_variable = NULL; + PyObject *__pyx_v_contains_lt1 = NULL; PyObject *__pyx_v_domain = NULL; PyObject *__pyx_v_value = 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_2 = NULL; + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - size_t __pyx_t_7; - Py_ssize_t __pyx_t_8; + 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)(PyObject *); - PyObject *__pyx_t_10 = NULL; + int __pyx_t_10; int __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __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":651 + /* "constraint/constraints.py":876 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * maxprod = self._maxprod # <<<<<<<<<<<<<< * prod = 1 - * for variable in variables: + * 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, 651, __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, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_maxprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":652 + /* "constraint/constraints.py":877 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * maxprod = self._maxprod * prod = 1 # <<<<<<<<<<<<<< - * for variable in variables: - * if variable in assignments: + * missing = False + * missing_lt1 = False */ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; - /* "constraint/constraints.py":653 + /* "constraint/constraints.py":878 * maxprod = self._maxprod * prod = 1 - * for variable in variables: # <<<<<<<<<<<<<< + * missing = False # <<<<<<<<<<<<<< + * missing_lt1 = False + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): +*/ + __pyx_v_missing = 0; + + /* "constraint/constraints.py":879 + * prod = 1 + * missing = False + * missing_lt1 = False # <<<<<<<<<<<<<< + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if variable in assignments: +*/ + __Pyx_INCREF(Py_False); + __pyx_v_missing_lt1 = Py_False; + + /* "constraint/constraints.py":880 + * missing = False + * missing_lt1 = False + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< * if variable in assignments: * prod *= assignments[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_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, 653, __pyx_L1_error) + __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, 880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = 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, 880, __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, 653, __pyx_L1_error) } + 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; + } else { + __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __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, 880, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(!__pyx_t_7)) { + 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, 653, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 880, __pyx_L1_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); - ++__pyx_t_2; + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_6); + ++__pyx_t_6; } 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, 653, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 880, __pyx_L1_error) #endif - if (__pyx_t_2 >= __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_1, __pyx_t_2)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); #endif - ++__pyx_t_2; + ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 653, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { + __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, 653, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 880, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_4); + __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, 880, __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_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __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, 880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __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_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __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, 880, __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; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_L6_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; - /* "constraint/constraints.py":654 - * prod = 1 - * for variable in variables: + /* "constraint/constraints.py":881 + * missing_lt1 = False + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if variable in assignments: # <<<<<<<<<<<<<< * prod *= assignments[variable] - * if isinstance(prod, float): + * else: */ - __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 654, __pyx_L1_error) - if (__pyx_t_5) { + __pyx_t_10 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 881, __pyx_L1_error) + if (__pyx_t_10) { - /* "constraint/constraints.py":655 - * for variable in variables: + /* "constraint/constraints.py":882 + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if variable in assignments: * prod *= assignments[variable] # <<<<<<<<<<<<<< - * if isinstance(prod, float): - * prod = round(prod, 10) + * else: + * missing = True */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 655, __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, 655, __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; + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __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, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/constraints.py":654 - * prod = 1 - * for variable in variables: + /* "constraint/constraints.py":881 + * missing_lt1 = False + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if variable in assignments: # <<<<<<<<<<<<<< * prod *= assignments[variable] + * else: +*/ + goto __pyx_L7; + } + + /* "constraint/constraints.py":884 + * prod *= assignments[variable] + * else: + * missing = True # <<<<<<<<<<<<<< + * if not missing_lt1: + * missing_lt1 = contains_lt1 +*/ + /*else*/ { + __pyx_v_missing = 1; + + /* "constraint/constraints.py":885 + * else: + * missing = True + * if not missing_lt1: # <<<<<<<<<<<<<< + * missing_lt1 = contains_lt1 + * if isinstance(prod, float): +*/ + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_missing_lt1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_11 = (!__pyx_t_10); + if (__pyx_t_11) { + + /* "constraint/constraints.py":886 + * missing = True + * if not missing_lt1: + * missing_lt1 = contains_lt1 # <<<<<<<<<<<<<< + * if isinstance(prod, float): + * prod = round(prod, 10) +*/ + __Pyx_INCREF(__pyx_v_contains_lt1); + __Pyx_DECREF_SET(__pyx_v_missing_lt1, __pyx_v_contains_lt1); + + /* "constraint/constraints.py":885 + * else: + * missing = True + * if not missing_lt1: # <<<<<<<<<<<<<< + * missing_lt1 = contains_lt1 * if isinstance(prod, float): */ + } } + __pyx_L7:; - /* "constraint/constraints.py":653 - * maxprod = self._maxprod - * prod = 1 - * for variable in variables: # <<<<<<<<<<<<<< + /* "constraint/constraints.py":880 + * missing = False + * missing_lt1 = False + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< * if variable in assignments: * prod *= assignments[variable] */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":656 - * if variable in assignments: - * prod *= assignments[variable] + /* "constraint/constraints.py":887 + * if not missing_lt1: + * missing_lt1 = contains_lt1 * if isinstance(prod, float): # <<<<<<<<<<<<<< * prod = round(prod, 10) - * if prod > maxprod: + * if (not missing or not missing_lt1) and prod > maxprod: */ - __pyx_t_5 = PyFloat_Check(__pyx_v_prod); - if (__pyx_t_5) { + __pyx_t_11 = PyFloat_Check(__pyx_v_prod); + if (__pyx_t_11) { - /* "constraint/constraints.py":657 - * prod *= assignments[variable] + /* "constraint/constraints.py":888 + * missing_lt1 = contains_lt1 * if isinstance(prod, float): * prod = round(prod, 10) # <<<<<<<<<<<<<< - * if prod > maxprod: + * if (not missing or not missing_lt1) and prod > maxprod: * return False */ - __pyx_t_6 = NULL; + __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_4 = __pyx_builtin_round; - __pyx_t_7 = 1; + __pyx_t_1 = __pyx_builtin_round; + __pyx_t_5 = 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_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, 657, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_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, 888, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":656 - * if variable in assignments: - * prod *= assignments[variable] + /* "constraint/constraints.py":887 + * if not missing_lt1: + * missing_lt1 = contains_lt1 * if isinstance(prod, float): # <<<<<<<<<<<<<< * prod = round(prod, 10) - * if prod > maxprod: + * if (not missing or not missing_lt1) and prod > maxprod: */ } - /* "constraint/constraints.py":658 + /* "constraint/constraints.py":889 * if isinstance(prod, float): * prod = round(prod, 10) - * if prod > maxprod: # <<<<<<<<<<<<<< + * if (not missing or not missing_lt1) and prod > maxprod: # <<<<<<<<<<<<<< * return False - * if forwardcheck: + * if forwardcheck and not missing_lt1: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_prod, __pyx_v_maxprod, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 658, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { + __pyx_t_10 = (!__pyx_v_missing); + if (!__pyx_t_10) { + } else { + goto __pyx_L13_next_and; + } + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_missing_lt1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 889, __pyx_L1_error) + __pyx_t_12 = (!__pyx_t_10); + if (__pyx_t_12) { + } else { + __pyx_t_11 = __pyx_t_12; + goto __pyx_L12_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, 889, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 889, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = __pyx_t_12; + __pyx_L12_bool_binop_done:; + if (__pyx_t_11) { - /* "constraint/constraints.py":659 + /* "constraint/constraints.py":890 * prod = round(prod, 10) - * if prod > maxprod: + * if (not missing or not missing_lt1) and prod > maxprod: * return False # <<<<<<<<<<<<<< - * if forwardcheck: + * if forwardcheck and not missing_lt1: * for variable in variables: */ __Pyx_XDECREF(__pyx_r); @@ -17100,203 +23442,212 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":658 + /* "constraint/constraints.py":889 * if isinstance(prod, float): * prod = round(prod, 10) - * if prod > maxprod: # <<<<<<<<<<<<<< + * if (not missing or not missing_lt1) and prod > maxprod: # <<<<<<<<<<<<<< * return False - * if forwardcheck: + * if forwardcheck and not missing_lt1: */ } - /* "constraint/constraints.py":660 - * if prod > maxprod: + /* "constraint/constraints.py":891 + * if (not missing or not missing_lt1) and prod > maxprod: * return False - * if forwardcheck: # <<<<<<<<<<<<<< + * if forwardcheck and not missing_lt1: # <<<<<<<<<<<<<< * 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, 660, __pyx_L1_error) - if (__pyx_t_5) { + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 891, __pyx_L1_error) + if (__pyx_t_12) { + } else { + __pyx_t_11 = __pyx_t_12; + goto __pyx_L16_bool_binop_done; + } + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_missing_lt1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_10 = (!__pyx_t_12); + __pyx_t_11 = __pyx_t_10; + __pyx_L16_bool_binop_done:; + if (__pyx_t_11) { - /* "constraint/constraints.py":661 + /* "constraint/constraints.py":892 * return False - * if forwardcheck: + * if forwardcheck and not missing_lt1: * 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_2 = 0; - __pyx_t_3 = NULL; + __pyx_t_3 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_3); + __pyx_t_6 = 0; + __pyx_t_7 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __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, 661, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __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, 892, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(!__pyx_t_7)) { + 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, 661, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 892, __pyx_L1_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); - ++__pyx_t_2; + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_6); + ++__pyx_t_6; } 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, 661, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 892, __pyx_L1_error) #endif - if (__pyx_t_2 >= __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_1, __pyx_t_2)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); #endif - ++__pyx_t_2; + ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 661, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { + __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, 661, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 892, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":662 - * if forwardcheck: + /* "constraint/constraints.py":893 + * if forwardcheck and not missing_lt1: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value 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, 662, __pyx_L1_error) - if (__pyx_t_5) { + __pyx_t_11 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 893, __pyx_L1_error) + if (__pyx_t_11) { - /* "constraint/constraints.py":663 + /* "constraint/constraints.py":894 * for variable in variables: * if variable not in assignments: * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if prod * value > maxprod: */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_domain, __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, 894, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":664 + /* "constraint/constraints.py":895 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< * if prod * value > maxprod: * 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, 664, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_6 = __pyx_t_4; __Pyx_INCREF(__pyx_t_6); - __pyx_t_8 = 0; - __pyx_t_9 = NULL; + __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, 895, __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; } else { - __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 664, __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, 664, __pyx_L1_error) + __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 895, __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, 895, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_9)) { - if (likely(PyList_CheckExact(__pyx_t_6))) { + if (likely(!__pyx_t_14)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); + 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, 664, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 895, __pyx_L1_error) #endif - if (__pyx_t_8 >= __pyx_temp) break; + if (__pyx_t_13 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_8); - ++__pyx_t_8; + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_13); + ++__pyx_t_13; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); + 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, 664, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 895, __pyx_L1_error) #endif - if (__pyx_t_8 >= __pyx_temp) break; + if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); #endif - ++__pyx_t_8; + ++__pyx_t_13; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_9(__pyx_t_6); - if (unlikely(!__pyx_t_4)) { + __pyx_t_1 = __pyx_t_14(__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, 664, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 895, __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_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":665 + /* "constraint/constraints.py":896 * domain = domains[variable] * for value in domain[:]: * if prod * value > maxprod: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ - __pyx_t_4 = PyNumber_Multiply(__pyx_v_prod, __pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = PyObject_RichCompare(__pyx_t_4, __pyx_v_maxprod, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 665, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_v_prod, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __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, 896, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 665, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__pyx_t_5) { + if (__pyx_t_11) { - /* "constraint/constraints.py":666 + /* "constraint/constraints.py":897 * for value in domain[:]: * if prod * value > maxprod: * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False */ - __pyx_t_4 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_4); - __pyx_t_7 = 0; + __pyx_t_1 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_value}; - __pyx_t_10 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 666, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + 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, 897, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":665 + /* "constraint/constraints.py":896 * domain = domains[variable] * for value in domain[:]: * if prod * value > maxprod: # <<<<<<<<<<<<<< @@ -17305,7 +23656,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":664 + /* "constraint/constraints.py":895 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -17313,20 +23664,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * domain.hideValue(value) */ } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":667 + /* "constraint/constraints.py":898 * if prod * value > maxprod: * 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, 667, __pyx_L1_error) - __pyx_t_11 = (!__pyx_t_5); - if (__pyx_t_11) { + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 898, __pyx_L1_error) + __pyx_t_10 = (!__pyx_t_11); + if (__pyx_t_10) { - /* "constraint/constraints.py":668 + /* "constraint/constraints.py":899 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -17336,10 +23687,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_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "constraint/constraints.py":667 + /* "constraint/constraints.py":898 * if prod * value > maxprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -17348,8 +23699,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":662 - * if forwardcheck: + /* "constraint/constraints.py":893 + * if forwardcheck and not missing_lt1: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] @@ -17357,26 +23708,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":661 + /* "constraint/constraints.py":892 * return False - * if forwardcheck: + * if forwardcheck and not missing_lt1: * 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_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":660 - * if prod > maxprod: + /* "constraint/constraints.py":891 + * if (not missing or not missing_lt1) and prod > maxprod: * return False - * if forwardcheck: # <<<<<<<<<<<<<< + * if forwardcheck and not missing_lt1: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: */ } - /* "constraint/constraints.py":669 + /* "constraint/constraints.py":900 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -17388,7 +23739,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":650 + /* "constraint/constraints.py":875 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -17399,15 +23750,18 @@ 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_10); + __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_maxprod); __Pyx_XDECREF(__pyx_v_prod); + __Pyx_XDECREF(__pyx_v_missing_lt1); __Pyx_XDECREF(__pyx_v_variable); + __Pyx_XDECREF(__pyx_v_contains_lt1); __Pyx_XDECREF(__pyx_v_domain); __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); @@ -17415,8 +23769,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call return __pyx_r; } -/* "constraint/constraints.py":675 - * """Constraint enforcing that values of given variables create a product up to at least a given amount.""" +/* "constraint/constraints.py":914 + * """ * * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MinProdConstraint. @@ -17464,39 +23818,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, 675, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 914, __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, 675, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 914, __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, 675, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 914, __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, 675, __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, 914, __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, 675, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 914, __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, 675, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 914, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 675, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 914, __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, 675, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 914, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -17525,17 +23879,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":681 + /* "constraint/constraints.py":920 * 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, 681, __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, 920, __pyx_L1_error) - /* "constraint/constraints.py":675 - * """Constraint enforcing that values of given variables create a product up to at least a given amount.""" + /* "constraint/constraints.py":914 + * """ * * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MinProdConstraint. @@ -17554,7 +23908,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ return __pyx_r; } -/* "constraint/constraints.py":683 +/* "constraint/constraints.py":922 * self._minprod = minprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -17605,50 +23959,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, 683, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 922, __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, 683, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 922, __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, 683, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 922, __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, 683, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 922, __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, 683, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 922, __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, 683, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 922, __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, 683, __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, 922, __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, 683, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 922, __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, 683, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 922, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 683, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 922, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 683, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 922, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 683, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 922, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 683, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 922, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -17658,7 +24012,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, 683, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 922, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -17669,9 +24023,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, 683, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 683, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 683, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 922, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 922, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 922, __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 */ @@ -17714,17 +24068,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":684 + /* "constraint/constraints.py":923 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< * - * # prune the associated variables of values > maxprod + * # 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, 684, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __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, 684, __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, 923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -17744,25 +24098,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro __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_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, 684, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":687 + /* "constraint/constraints.py":926 * - * # prune the associated variables of values > maxprod + * # 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, 687, __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, 926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_minprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":688 - * # prune the associated variables of values > maxprod + /* "constraint/constraints.py":927 + * # prune the associated variables of values > minprod * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< * domain = domains[variable] @@ -17773,9 +24127,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, 688, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 927, __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, 688, __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, 927, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -17783,7 +24137,7 @@ 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, 688, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 927, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -17793,7 +24147,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro { 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, 688, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 927, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -17804,13 +24158,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 927, __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, 688, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 927, __pyx_L1_error) PyErr_Clear(); } break; @@ -17820,35 +24174,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":689 + /* "constraint/constraints.py":928 * 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, 689, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":690 + /* "constraint/constraints.py":929 * 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, 690, __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, 929, __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, 690, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 929, __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, 690, __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, 929, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -17857,7 +24211,7 @@ 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, 690, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 929, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -17867,7 +24221,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro { 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, 690, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 929, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -17878,13 +24232,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 929, __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, 690, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 929, __pyx_L1_error) PyErr_Clear(); } break; @@ -17894,27 +24248,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":691 + /* "constraint/constraints.py":930 * 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, 691, __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, 930, __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, 691, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 691, __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, 930, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 930, __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":692 + /* "constraint/constraints.py":931 * for value in domain[:]: * if value == 0 and minprod > 0: * domain.remove(value) # <<<<<<<<<<<<<< @@ -17928,12 +24282,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro 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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":691 + /* "constraint/constraints.py":930 * domain = domains[variable] * for value in domain[:]: * if value == 0 and minprod > 0: # <<<<<<<<<<<<<< @@ -17942,7 +24296,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro */ } - /* "constraint/constraints.py":690 + /* "constraint/constraints.py":929 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -17952,8 +24306,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":688 - * # prune the associated variables of values > maxprod + /* "constraint/constraints.py":927 + * # prune the associated variables of values > minprod * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< * domain = domains[variable] @@ -17962,7 +24316,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":683 + /* "constraint/constraints.py":922 * self._minprod = minprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -17990,7 +24344,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro return __pyx_r; } -/* "constraint/constraints.py":694 +/* "constraint/constraints.py":933 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -18041,53 +24395,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, 694, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 933, __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, 694, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 933, __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, 694, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 933, __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, 933, __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, 933, __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, 933, __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, 694, __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, 933, __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, 694, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 933, __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, 694, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 933, __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, 694, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 933, __pyx_L3_error) 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, 933, __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, 933, __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, 933, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -18101,7 +24455,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, 694, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 933, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18112,8 +24466,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, 694, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 694, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 933, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 933, __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 */ @@ -18151,7 +24505,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":696 + /* "constraint/constraints.py":935 * 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: # <<<<<<<<<<<<<< @@ -18163,9 +24517,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, 696, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 935, __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, 696, __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, 935, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -18173,7 +24527,7 @@ 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, 696, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 935, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -18183,7 +24537,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call { 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, 696, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 935, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -18194,13 +24548,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 935, __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, 696, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 935, __pyx_L1_error) PyErr_Clear(); } break; @@ -18210,17 +24564,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":697 + /* "constraint/constraints.py":936 * # 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, 697, __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, 936, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":698 + /* "constraint/constraints.py":937 * for variable in variables: * if variable not in assignments: * return True # <<<<<<<<<<<<<< @@ -18233,7 +24587,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":697 + /* "constraint/constraints.py":936 * # check if each variable is in the assignments * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -18242,7 +24596,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call */ } - /* "constraint/constraints.py":696 + /* "constraint/constraints.py":935 * 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: # <<<<<<<<<<<<<< @@ -18252,19 +24606,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":701 + /* "constraint/constraints.py":940 * * # 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, 701, __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, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_minprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":702 + /* "constraint/constraints.py":941 * # with each variable assigned, sum the values * minprod = self._minprod * prod = 1 # <<<<<<<<<<<<<< @@ -18274,7 +24628,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":703 + /* "constraint/constraints.py":942 * minprod = self._minprod * prod = 1 * for variable in variables: # <<<<<<<<<<<<<< @@ -18286,9 +24640,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, 703, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 942, __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, 703, __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, 942, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -18296,7 +24650,7 @@ 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, 703, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 942, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -18306,7 +24660,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call { 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, 703, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 942, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -18317,13 +24671,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 942, __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, 703, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 942, __pyx_L1_error) PyErr_Clear(); } break; @@ -18333,22 +24687,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":704 + /* "constraint/constraints.py":943 * 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, 704, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 943, __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, 704, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 943, __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":703 + /* "constraint/constraints.py":942 * minprod = self._minprod * prod = 1 * for variable in variables: # <<<<<<<<<<<<<< @@ -18358,7 +24712,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":705 + /* "constraint/constraints.py":944 * for variable in variables: * prod *= assignments[variable] * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -18368,7 +24722,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":706 + /* "constraint/constraints.py":945 * prod *= assignments[variable] * if isinstance(prod, float): * prod = round(prod, 10) # <<<<<<<<<<<<<< @@ -18384,13 +24738,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call __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_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, 706, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":705 + /* "constraint/constraints.py":944 * for variable in variables: * prod *= assignments[variable] * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -18399,7 +24753,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call */ } - /* "constraint/constraints.py":707 + /* "constraint/constraints.py":946 * if isinstance(prod, float): * prod = round(prod, 10) * return prod >= minprod # <<<<<<<<<<<<<< @@ -18407,12 +24761,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, 707, __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, 946, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":694 + /* "constraint/constraints.py":933 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -18436,7 +24790,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call return __pyx_r; } -/* "constraint/constraints.py":721 +/* "constraint/constraints.py":960 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -18485,39 +24839,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, 721, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 960, __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, 721, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 960, __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, 721, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 960, __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, 721, __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, 960, __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, 721, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 960, __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, 721, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 960, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 721, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 960, __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, 721, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 960, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18546,16 +24900,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":727 + /* "constraint/constraints.py":966 * 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, 727, __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, 966, __pyx_L1_error) - /* "constraint/constraints.py":721 + /* "constraint/constraints.py":960 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -18575,7 +24929,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( return __pyx_r; } -/* "constraint/constraints.py":729 +/* "constraint/constraints.py":968 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -18626,53 +24980,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, 729, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 968, __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, 729, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 968, __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, 729, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 968, __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, 729, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 968, __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, 729, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 968, __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, 729, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 968, __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, 729, __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, 968, __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, 729, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 968, __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, 729, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 968, __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, 729, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 968, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 729, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 968, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 729, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 968, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 729, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 968, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -18686,7 +25040,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, 729, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 968, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18719,7 +25073,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":731 + /* "constraint/constraints.py":970 * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 * # preProcess() will remove it. * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< @@ -18735,14 +25089,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ __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, 731, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 970, __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, 731, __pyx_L1_error) + __PYX_ERR(0, 970, __pyx_L1_error) - /* "constraint/constraints.py":729 + /* "constraint/constraints.py":968 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -18762,7 +25116,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ return __pyx_r; } -/* "constraint/constraints.py":733 +/* "constraint/constraints.py":972 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -18813,50 +25167,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, 733, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 972, __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, 733, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 972, __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, 733, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 972, __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, 733, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 972, __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, 733, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 972, __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, 733, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 972, __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, 733, __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, 972, __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, 733, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 972, __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, 733, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 972, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 733, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 972, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 733, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 972, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 733, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 972, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 733, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 972, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -18866,7 +25220,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, 733, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 972, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18877,9 +25231,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, 733, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 733, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 733, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 972, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 972, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 972, __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 */ @@ -18922,19 +25276,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":734 + /* "constraint/constraints.py":973 * * 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, 734, __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, 973, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":735 + /* "constraint/constraints.py":974 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -18946,9 +25300,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, 735, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __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, 735, __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, 974, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -18956,7 +25310,7 @@ 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, 735, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 974, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -18966,7 +25320,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce { 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, 735, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 974, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -18977,13 +25331,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 974, __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, 735, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 974, __pyx_L1_error) PyErr_Clear(); } break; @@ -18993,35 +25347,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":736 + /* "constraint/constraints.py":975 * 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, 736, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":737 + /* "constraint/constraints.py":976 * 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, 737, __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, 976, __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, 737, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 976, __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, 737, __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, 976, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -19030,7 +25384,7 @@ 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, 737, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 976, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -19040,7 +25394,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce { 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, 737, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 976, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -19051,13 +25405,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __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, 737, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 976, __pyx_L1_error) PyErr_Clear(); } break; @@ -19067,17 +25421,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":738 + /* "constraint/constraints.py":977 * 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, 738, __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, 977, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":739 + /* "constraint/constraints.py":978 * for value in domain[:]: * if value not in set: * domain.remove(value) # <<<<<<<<<<<<<< @@ -19091,12 +25445,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce 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_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":738 + /* "constraint/constraints.py":977 * domain = domains[variable] * for value in domain[:]: * if value not in set: # <<<<<<<<<<<<<< @@ -19105,7 +25459,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce */ } - /* "constraint/constraints.py":737 + /* "constraint/constraints.py":976 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -19115,25 +25469,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":740 + /* "constraint/constraints.py":979 * 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, 740, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 979, __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, 740, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 979, __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, 740, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 979, __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, 740, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 979, __pyx_L1_error); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11}; @@ -19141,12 +25495,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce __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, 740, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":735 + /* "constraint/constraints.py":974 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -19156,27 +25510,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":741 + /* "constraint/constraints.py":980 * 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, 741, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __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, 741, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 980, __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, 741, __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, 741, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 980, __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, 980, __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":733 + /* "constraint/constraints.py":972 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -19205,7 +25559,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce return __pyx_r; } -/* "constraint/constraints.py":755 +/* "constraint/constraints.py":994 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -19254,39 +25608,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, 755, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 994, __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, 755, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 994, __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, 755, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 994, __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, 755, __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, 994, __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, 755, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 994, __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, 755, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 994, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 755, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 994, __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, 755, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 994, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19315,16 +25669,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":761 + /* "constraint/constraints.py":1000 * 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, 761, __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, 1000, __pyx_L1_error) - /* "constraint/constraints.py":755 + /* "constraint/constraints.py":994 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -19344,7 +25698,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init return __pyx_r; } -/* "constraint/constraints.py":763 +/* "constraint/constraints.py":1002 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -19395,53 +25749,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, 763, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1002, __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, 763, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1002, __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, 763, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1002, __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, 763, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1002, __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, 763, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1002, __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, 763, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1002, __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, 763, __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, 1002, __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, 763, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1002, __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, 763, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1002, __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, 763, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1002, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 763, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1002, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 763, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1002, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 763, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1002, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -19455,7 +25809,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, 763, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1002, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19488,7 +25842,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":765 + /* "constraint/constraints.py":1004 * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 * # preProcess() will remove it. * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< @@ -19504,14 +25858,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal __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, 765, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1004, __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, 765, __pyx_L1_error) + __PYX_ERR(0, 1004, __pyx_L1_error) - /* "constraint/constraints.py":763 + /* "constraint/constraints.py":1002 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -19531,7 +25885,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal return __pyx_r; } -/* "constraint/constraints.py":767 +/* "constraint/constraints.py":1006 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -19582,50 +25936,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, 767, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1006, __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, 767, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1006, __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, 767, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1006, __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, 767, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1006, __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, 767, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1006, __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, 767, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1006, __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, 767, __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, 1006, __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, 767, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1006, __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, 767, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1006, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 767, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1006, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 767, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1006, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 767, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1006, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 767, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1006, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -19635,7 +25989,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, 767, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1006, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19646,9 +26000,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, 767, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 767, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 767, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1006, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1006, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1006, __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 */ @@ -19691,19 +26045,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":768 + /* "constraint/constraints.py":1007 * * 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, 768, __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, 1007, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":769 + /* "constraint/constraints.py":1008 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -19715,9 +26069,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, 769, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1008, __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, 769, __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, 1008, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -19725,7 +26079,7 @@ 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, 769, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1008, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -19735,7 +26089,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr { 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, 769, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1008, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -19746,13 +26100,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 769, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1008, __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, 769, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1008, __pyx_L1_error) PyErr_Clear(); } break; @@ -19762,35 +26116,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":770 + /* "constraint/constraints.py":1009 * 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, 770, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":771 + /* "constraint/constraints.py":1010 * 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, 771, __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, 1010, __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, 771, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1010, __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, 771, __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, 1010, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -19799,7 +26153,7 @@ 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, 771, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1010, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -19809,7 +26163,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr { 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, 771, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1010, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -19820,13 +26174,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 771, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1010, __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, 771, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1010, __pyx_L1_error) PyErr_Clear(); } break; @@ -19836,17 +26190,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":772 + /* "constraint/constraints.py":1011 * 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, 772, __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, 1011, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":773 + /* "constraint/constraints.py":1012 * for value in domain[:]: * if value in set: * domain.remove(value) # <<<<<<<<<<<<<< @@ -19860,12 +26214,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr 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_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 773, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":772 + /* "constraint/constraints.py":1011 * domain = domains[variable] * for value in domain[:]: * if value in set: # <<<<<<<<<<<<<< @@ -19874,7 +26228,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr */ } - /* "constraint/constraints.py":771 + /* "constraint/constraints.py":1010 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -19884,25 +26238,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":774 + /* "constraint/constraints.py":1013 * 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, 774, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1013, __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, 774, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1013, __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, 774, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1013, __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, 774, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1013, __pyx_L1_error); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11}; @@ -19910,12 +26264,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr __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, 774, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":769 + /* "constraint/constraints.py":1008 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -19925,27 +26279,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":775 + /* "constraint/constraints.py":1014 * 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, 775, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __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, 775, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1014, __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, 775, __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, 775, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1014, __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, 1014, __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":767 + /* "constraint/constraints.py":1006 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -19974,7 +26328,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr return __pyx_r; } -/* "constraint/constraints.py":789 +/* "constraint/constraints.py":1028 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -20013,7 +26367,191 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + __Pyx_RefNannySetupContext("__init__ (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_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, 1028, __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, 1028, __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, 1028, __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, 1028, __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, 1028, __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, 1028, __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, 1028, __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, 1028, __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, 1028, __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, 1028, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1028, __pyx_L3_error) + break; + default: goto __pyx_L5_argtuple_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))); + } + __pyx_v_self = values[0]; + __pyx_v_set = values[1]; + __pyx_v_n = values[2]; + __pyx_v_exact = values[3]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1028, __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.SomeInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10constraint_11constraints_19SomeInSetConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_set, __pyx_v_n, __pyx_v_exact); + + /* 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_19SomeInSetConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set, PyObject *__pyx_v_n, PyObject *__pyx_v_exact) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "constraint/constraints.py":1038 + * 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, 1038, __pyx_L1_error) + + /* "constraint/constraints.py":1039 + * """ + * 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, 1039, __pyx_L1_error) + + /* "constraint/constraints.py":1040 + * 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, 1040, __pyx_L1_error) + + /* "constraint/constraints.py":1028 + * """ + * + * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.SomeInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":1042 + * self._exact = exact + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * set = self._set + * missing = 0 +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_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_19SomeInSetConstraint_3__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_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 +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_variables = 0; + PyObject *__pyx_v_domains = 0; + PyObject *__pyx_v_assignments = 0; + PyObject *__pyx_v_forwardcheck = 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("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -20023,2142 +26561,3128 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #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_set,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_exact,0}; + 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, 789, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1042, __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, 1042, __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, 789, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1042, __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, 789, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1042, __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, 789, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1042, __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, 789, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1042, __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, 789, __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, 789, __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, 1042, __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, 1042, __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, 1042, __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, 789, __pyx_L3_error) - CYTHON_FALLTHROUGH; - case 3: + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1042, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 789, __pyx_L3_error) - CYTHON_FALLTHROUGH; - case 2: + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1042, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 789, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1042, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 789, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1042, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_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))); + if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); } __pyx_v_self = values[0]; - __pyx_v_set = values[1]; - __pyx_v_n = values[2]; - __pyx_v_exact = values[3]; + __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("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 789, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1042, __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.SomeInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.SomeInSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_19SomeInSetConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_set, __pyx_v_n, __pyx_v_exact); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1042, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1042, __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 */ + 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_19SomeInSetConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set, PyObject *__pyx_v_n, PyObject *__pyx_v_exact) { +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) { + PyObject *__pyx_v_set = NULL; + PyObject *__pyx_v_missing = NULL; + PyObject *__pyx_v_found = NULL; + PyObject *__pyx_v_variable = NULL; + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_value = 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; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + PyObject *__pyx_t_10 = NULL; + size_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "constraint/constraints.py":799 - * 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, 799, __pyx_L1_error) + __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":800 - * """ - * self._set = set - * self._n = n # <<<<<<<<<<<<<< - * self._exact = exact + /* "constraint/constraints.py":1043 * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * set = self._set # <<<<<<<<<<<<<< + * missing = 0 + * found = 0 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2, __pyx_v_n) < 0) __PYX_ERR(0, 800, __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, 1043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_set = __pyx_t_1; + __pyx_t_1 = 0; - /* "constraint/constraints.py":801 - * self._set = set - * self._n = n - * self._exact = exact # <<<<<<<<<<<<<< - * + /* "constraint/constraints.py":1044 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * set = self._set + * missing = 0 # <<<<<<<<<<<<<< + * found = 0 + * for variable in variables: +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_missing = __pyx_mstate_global->__pyx_int_0; + + /* "constraint/constraints.py":1045 + * set = self._set + * missing = 0 + * found = 0 # <<<<<<<<<<<<<< + * for variable in variables: + * if variable in assignments: +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_found = __pyx_mstate_global->__pyx_int_0; + + /* "constraint/constraints.py":1046 + * missing = 0 + * found = 0 + * for variable in variables: # <<<<<<<<<<<<<< + * if variable in assignments: + * found += assignments[variable] in set +*/ + 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, 1046, __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, 1046, __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, 1046, __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, 1046, __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, 1046, __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, 1046, __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":1047 + * 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, 1047, __pyx_L1_error) + if (__pyx_t_5) { + + /* "constraint/constraints.py":1048 + * 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, 1048, __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, 1048, __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, 1048, __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, 1048, __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":1047 + * found = 0 + * for variable in variables: + * if variable in assignments: # <<<<<<<<<<<<<< + * found += assignments[variable] in set + * else: +*/ + goto __pyx_L5; + } + + /* "constraint/constraints.py":1050 + * found += assignments[variable] in set + * else: + * missing += 1 # <<<<<<<<<<<<<< + * if missing: + * 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, 1050, __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":1046 + * missing = 0 + * found = 0 + * for variable in variables: # <<<<<<<<<<<<<< + * if variable in assignments: + * found += assignments[variable] in set +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":1051 + * 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, 1051, __pyx_L1_error) + if (__pyx_t_5) { + + /* "constraint/constraints.py":1052 + * 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, 1052, __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, 1052, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "constraint/constraints.py":1053 + * 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, 1053, __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, 1053, __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, 1053, __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, 1053, __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, 1053, __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":1054 + * if self._exact: + * if not (found <= self._n <= missing + found): + * return False # <<<<<<<<<<<<<< + * else: + * if self._n > missing + found: +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "constraint/constraints.py":1053 + * if missing: + * if self._exact: + * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< + * return False + * else: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2, __pyx_v_exact) < 0) __PYX_ERR(0, 801, __pyx_L1_error) + } - /* "constraint/constraints.py":789 - * """ - * - * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< - * """Initialization method. - * + /* "constraint/constraints.py":1052 + * missing += 1 + * if missing: + * if self._exact: # <<<<<<<<<<<<<< + * if not (found <= self._n <= missing + found): + * return False */ + goto __pyx_L8; + } - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.SomeInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "constraint/constraints.py":1056 + * return False + * else: + * if self._n > missing + found: # <<<<<<<<<<<<<< + * return False + * 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, 1056, __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, 1056, __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, 1056, __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, 1056, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_7) { -/* "constraint/constraints.py":803 - * self._exact = exact - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * set = self._set - * missing = 0 + /* "constraint/constraints.py":1057 + * else: + * if self._n > missing + found: + * return False # <<<<<<<<<<<<<< + * if forwardcheck and self._n - found == missing: + * # All unassigned variables must be assigned to */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; -/* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_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_19SomeInSetConstraint_3__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_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 -) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_variables = 0; - PyObject *__pyx_v_domains = 0; - PyObject *__pyx_v_assignments = 0; - PyObject *__pyx_v_forwardcheck = 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("__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,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, 803, __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, 803, __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, 803, __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, 803, __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, 803, __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, 803, __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, 803, __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, 803, __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, 803, __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, 803, __pyx_L3_error) - values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 803, __pyx_L3_error) - values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 803, __pyx_L3_error) - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 803, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_error; + /* "constraint/constraints.py":1056 + * return False + * else: + * if self._n > missing + found: # <<<<<<<<<<<<<< + * return False + * if forwardcheck and self._n - found == missing: +*/ } - 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, 803, __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.SomeInSetConstraint.__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, 803, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 803, __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); + __pyx_L8:; - /* 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; -} + /* "constraint/constraints.py":1058 + * 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, 1058, __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, 1058, __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, 1058, __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, 1058, __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, 1058, __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) { -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) { - PyObject *__pyx_v_set = NULL; - PyObject *__pyx_v_missing = NULL; - PyObject *__pyx_v_found = NULL; - PyObject *__pyx_v_variable = NULL; - PyObject *__pyx_v_domain = NULL; - PyObject *__pyx_v_value = 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; - int __pyx_t_7; - Py_ssize_t __pyx_t_8; - PyObject *(*__pyx_t_9)(PyObject *); - PyObject *__pyx_t_10 = NULL; - size_t __pyx_t_11; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 0); + /* "constraint/constraints.py":1061 + * # All unassigned variables must be assigned to + * # values in the set. + * 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_4 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_4); + __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, 1061, __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, 1061, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + 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, 1061, __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_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, 1061, __pyx_L1_error) + #endif + 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_4, __pyx_t_2)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_2); + #endif + ++__pyx_t_2; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1061, __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, 1061, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":804 - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - * set = self._set # <<<<<<<<<<<<<< - * missing = 0 - * found = 0 + /* "constraint/constraints.py":1062 + * # values in the set. + * for variable in variables: + * if variable not in assignments: # <<<<<<<<<<<<<< + * domain = domains[variable] + * for value in domain[:]: */ - __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, 804, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_set = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_7 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1062, __pyx_L1_error) + if (__pyx_t_7) { - /* "constraint/constraints.py":805 - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - * set = self._set - * missing = 0 # <<<<<<<<<<<<<< - * found = 0 - * for variable in variables: + /* "constraint/constraints.py":1063 + * for variable in variables: + * if variable not in assignments: + * domain = domains[variable] # <<<<<<<<<<<<<< + * for value in domain[:]: + * if value not in set: */ - __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); - __pyx_v_missing = __pyx_mstate_global->__pyx_int_0; + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1063, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":806 - * set = self._set - * missing = 0 - * found = 0 # <<<<<<<<<<<<<< - * for variable in variables: - * if variable in assignments: + /* "constraint/constraints.py":1064 + * if variable not in assignments: + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value not in set: + * domain.hideValue(value) */ - __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); - __pyx_v_found = __pyx_mstate_global->__pyx_int_0; + __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, 1064, __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, 1064, __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, 1064, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_6))) { + { + 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, 1064, __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_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, 1064, __pyx_L1_error) + #endif + if (__pyx_t_8 >= __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_8)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); + #endif + ++__pyx_t_8; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1064, __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, 1064, __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":807 - * missing = 0 - * found = 0 - * for variable in variables: # <<<<<<<<<<<<<< - * if variable in assignments: - * found += assignments[variable] in set + /* "constraint/constraints.py":1065 + * domain = domains[variable] + * for value in domain[:]: + * if value not in set: # <<<<<<<<<<<<<< + * domain.hideValue(value) + * if not domain: */ - 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, 807, __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, 807, __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, 807, __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, 807, __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, 807, __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, 807, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_set, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1065, __pyx_L1_error) + if (__pyx_t_7) { - /* "constraint/constraints.py":808 - * found = 0 - * for variable in variables: - * if variable in assignments: # <<<<<<<<<<<<<< - * found += assignments[variable] in set - * else: + /* "constraint/constraints.py":1066 + * for value in domain[:]: + * if value not in set: + * domain.hideValue(value) # <<<<<<<<<<<<<< + * if not domain: + * return False */ - __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 808, __pyx_L1_error) - if (__pyx_t_5) { + __pyx_t_10 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_10); + __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_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":809 - * for variable in variables: - * if variable in assignments: - * found += assignments[variable] in set # <<<<<<<<<<<<<< - * else: - * missing += 1 + /* "constraint/constraints.py":1065 + * domain = domains[variable] + * for value in domain[:]: + * if value not in set: # <<<<<<<<<<<<<< + * domain.hideValue(value) + * if not domain: */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 809, __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, 809, __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, 809, __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, 809, __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":808 - * found = 0 - * for variable in variables: - * if variable in assignments: # <<<<<<<<<<<<<< - * found += assignments[variable] in set - * else: + /* "constraint/constraints.py":1064 + * if variable not in assignments: + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value not in set: + * domain.hideValue(value) */ - goto __pyx_L5; - } + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":811 - * found += assignments[variable] in set - * else: - * missing += 1 # <<<<<<<<<<<<<< - * if missing: + /* "constraint/constraints.py":1067 + * 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, 1067, __pyx_L1_error) + __pyx_t_5 = (!__pyx_t_7); + if (__pyx_t_5) { + + /* "constraint/constraints.py":1068 + * domain.hideValue(value) + * if not domain: + * return False # <<<<<<<<<<<<<< + * else: * 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, 811, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF_SET(__pyx_v_missing, __pyx_t_6); - __pyx_t_6 = 0; - } - __pyx_L5:; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L0; + + /* "constraint/constraints.py":1067 + * if value not in set: + * domain.hideValue(value) + * if not domain: # <<<<<<<<<<<<<< + * return False + * else: +*/ + } + + /* "constraint/constraints.py":1062 + * # values in the set. + * for variable in variables: + * if variable not in assignments: # <<<<<<<<<<<<<< + * domain = domains[variable] + * for value in domain[:]: +*/ + } + + /* "constraint/constraints.py":1061 + * # All unassigned variables must be assigned to + * # values in the set. + * for variable in variables: # <<<<<<<<<<<<<< + * if variable not in assignments: + * domain = domains[variable] +*/ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":807 - * missing = 0 - * found = 0 - * for variable in variables: # <<<<<<<<<<<<<< - * if variable in assignments: - * found += assignments[variable] in set + /* "constraint/constraints.py":1058 + * 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } - /* "constraint/constraints.py":812 + /* "constraint/constraints.py":1051 * 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, 812, __pyx_L1_error) - if (__pyx_t_5) { + goto __pyx_L7; + } - /* "constraint/constraints.py":813 - * missing += 1 - * if missing: + /* "constraint/constraints.py":1070 + * return False + * else: * if self._exact: # <<<<<<<<<<<<<< - * if not (found <= self._n <= missing + found): + * if found != self._n: * 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, 813, __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, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /*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, 1070, __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, 1070, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":814 - * if missing: + /* "constraint/constraints.py":1071 + * else: * if self._exact: - * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< + * if found != self._n: # <<<<<<<<<<<<<< * 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, 814, __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, 814, __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, 814, __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, 814, __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, 814, __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, 1071, __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, 1071, __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, 1071, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = (!__pyx_t_5); - if (__pyx_t_7) { + if (__pyx_t_5) { - /* "constraint/constraints.py":815 + /* "constraint/constraints.py":1072 * if self._exact: - * if not (found <= self._n <= missing + found): + * if found != self._n: * return False # <<<<<<<<<<<<<< * else: - * if self._n > missing + found: + * if found < self._n: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":814 - * if missing: + /* "constraint/constraints.py":1071 + * else: * if self._exact: - * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< + * if found != self._n: # <<<<<<<<<<<<<< * return False * else: */ } - /* "constraint/constraints.py":813 - * missing += 1 - * if missing: + /* "constraint/constraints.py":1070 + * return False + * else: * if self._exact: # <<<<<<<<<<<<<< - * if not (found <= self._n <= missing + found): + * if found != self._n: * return False */ - goto __pyx_L8; + goto __pyx_L23; } - /* "constraint/constraints.py":817 + /* "constraint/constraints.py":1074 * return False * else: - * if self._n > missing + found: # <<<<<<<<<<<<<< + * if found < self._n: # <<<<<<<<<<<<<< * return False - * if forwardcheck and self._n - found == missing: + * 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, 817, __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, 1074, __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, 817, __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, 817, __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, 1074, __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, 817, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1074, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_7) { + if (__pyx_t_5) { - /* "constraint/constraints.py":818 + /* "constraint/constraints.py":1075 * else: - * if self._n > missing + found: + * if found < self._n: * return False # <<<<<<<<<<<<<< - * if forwardcheck and self._n - found == missing: - * # All unassigned variables must be assigned to + * return True + * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":817 + /* "constraint/constraints.py":1074 * return False * else: - * if self._n > missing + found: # <<<<<<<<<<<<<< + * if found < self._n: # <<<<<<<<<<<<<< * return False - * if forwardcheck and self._n - found == missing: + * return True */ } } - __pyx_L8:; + __pyx_L23:; + } + __pyx_L7:; + + /* "constraint/constraints.py":1076 + * 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":1042 + * self._exact = exact + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * set = self._set + * missing = 0 +*/ + + /* 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_10); + __Pyx_AddTraceback("constraint.constraints.SomeInSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_set); + __Pyx_XDECREF(__pyx_v_missing); + __Pyx_XDECREF(__pyx_v_found); + __Pyx_XDECREF(__pyx_v_variable); + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":1090 + * """ + * + * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_1__init__(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_22SomeNotInSetConstraint___init__, "Initialization method.\n\n Args:\n set (set): Set of values to be checked\n n (int): Minimum number of assigned values that should not\n be present in set (default is 1)\n exact (bool): Whether the number of assigned values which\n are not present in set must be exactly `n`\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_22SomeNotInSetConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_22SomeNotInSetConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_1__init__(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_set = 0; + PyObject *__pyx_v_n = 0; + PyObject *__pyx_v_exact = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {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("__init__ (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_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, 1090, __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, 1090, __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, 1090, __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, 1090, __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, 1090, __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, 1090, __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, 1090, __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, 1090, __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, 1090, __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, 1090, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1090, __pyx_L3_error) + break; + default: goto __pyx_L5_argtuple_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))); + } + __pyx_v_self = values[0]; + __pyx_v_set = values[1]; + __pyx_v_n = values[2]; + __pyx_v_exact = values[3]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1090, __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.SomeNotInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_set, __pyx_v_n, __pyx_v_exact); + + /* 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_22SomeNotInSetConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set, PyObject *__pyx_v_n, PyObject *__pyx_v_exact) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":819 - * 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. + /* "constraint/constraints.py":1100 + * are not present in set must be exactly `n` + * """ + * self._set = set # <<<<<<<<<<<<<< + * self._n = n + * self._exact = exact */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 819, __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, 819, __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, 819, __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, 819, __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, 819, __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) { + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2, __pyx_v_set) < 0) __PYX_ERR(0, 1100, __pyx_L1_error) - /* "constraint/constraints.py":822 - * # All unassigned variables must be assigned to - * # values in the set. - * for variable in variables: # <<<<<<<<<<<<<< - * if variable not in assignments: - * domain = domains[variable] + /* "constraint/constraints.py":1101 + * """ + * self._set = set + * self._n = n # <<<<<<<<<<<<<< + * self._exact = exact + * */ - if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { - __pyx_t_4 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_4); - __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, 822, __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, 822, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_3)) { - 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, 822, __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_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, 822, __pyx_L1_error) - #endif - 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_4, __pyx_t_2)); - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_2); - #endif - ++__pyx_t_2; - } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __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, 822, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); - __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2, __pyx_v_n) < 0) __PYX_ERR(0, 1101, __pyx_L1_error) - /* "constraint/constraints.py":823 - * # values in the set. - * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: + /* "constraint/constraints.py":1102 + * self._set = set + * self._n = n + * self._exact = exact # <<<<<<<<<<<<<< + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 */ - __pyx_t_7 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 823, __pyx_L1_error) - if (__pyx_t_7) { + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2, __pyx_v_exact) < 0) __PYX_ERR(0, 1102, __pyx_L1_error) - /* "constraint/constraints.py":824 - * for variable in variables: - * if variable not in assignments: - * domain = domains[variable] # <<<<<<<<<<<<<< - * for value in domain[:]: - * if value not in set: + /* "constraint/constraints.py":1090 + * """ + * + * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< + * """Initialization method. + * */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 824, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); - __pyx_t_1 = 0; - /* "constraint/constraints.py":825 - * if variable not in assignments: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value not in set: - * domain.hideValue(value) + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.SomeNotInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":1104 + * self._exact = exact + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * set = self._set + * missing = 0 */ - __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, 825, __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, 825, __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, 825, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_9)) { - if (likely(PyList_CheckExact(__pyx_t_6))) { - { - 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, 825, __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_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, 825, __pyx_L1_error) - #endif - if (__pyx_t_8 >= __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_8)); - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); - #endif - ++__pyx_t_8; - } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __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, 825, __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":826 - * 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, 826, __pyx_L1_error) - if (__pyx_t_7) { +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_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_22SomeNotInSetConstraint_3__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_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 +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_variables = 0; + PyObject *__pyx_v_domains = 0; + PyObject *__pyx_v_assignments = 0; + PyObject *__pyx_v_forwardcheck = 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("__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,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, 1104, __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, 1104, __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, 1104, __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, 1104, __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, 1104, __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, 1104, __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, 1104, __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, 1104, __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, 1104, __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, 1104, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1104, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1104, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1104, __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, 1104, __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.SomeNotInSetConstraint.__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, 1104, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1104, __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 */ + 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; +} - /* "constraint/constraints.py":827 - * for value in domain[:]: - * if value not in set: - * domain.hideValue(value) # <<<<<<<<<<<<<< - * if not domain: - * return False -*/ - __pyx_t_10 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_10); - __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_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +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) { + PyObject *__pyx_v_set = NULL; + PyObject *__pyx_v_missing = NULL; + PyObject *__pyx_v_found = NULL; + PyObject *__pyx_v_variable = NULL; + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_value = 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; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + PyObject *__pyx_t_10 = NULL; + size_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":826 - * domain = domains[variable] - * for value in domain[:]: - * if value not in set: # <<<<<<<<<<<<<< - * domain.hideValue(value) - * if not domain: + /* "constraint/constraints.py":1105 + * + * 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, 1105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_set = __pyx_t_1; + __pyx_t_1 = 0; - /* "constraint/constraints.py":825 - * if variable not in assignments: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value not in set: - * domain.hideValue(value) + /* "constraint/constraints.py":1106 + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * set = self._set + * missing = 0 # <<<<<<<<<<<<<< + * found = 0 + * for variable in variables: */ - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_missing = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":828 - * if value not in set: - * domain.hideValue(value) - * if not domain: # <<<<<<<<<<<<<< - * return False - * else: + /* "constraint/constraints.py":1107 + * set = self._set + * missing = 0 + * found = 0 # <<<<<<<<<<<<<< + * for variable in variables: + * if variable in assignments: */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 828, __pyx_L1_error) - __pyx_t_5 = (!__pyx_t_7); - if (__pyx_t_5) { + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_found = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":829 - * domain.hideValue(value) - * if not domain: - * return False # <<<<<<<<<<<<<< - * else: - * if self._exact: + /* "constraint/constraints.py":1108 + * missing = 0 + * found = 0 + * for variable in variables: # <<<<<<<<<<<<<< + * if variable in assignments: + * found += assignments[variable] not in set */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L0; + 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, 1108, __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, 1108, __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, 1108, __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, 1108, __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, 1108, __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, 1108, __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":828 - * if value not in set: - * domain.hideValue(value) - * if not domain: # <<<<<<<<<<<<<< - * return False - * else: + /* "constraint/constraints.py":1109 + * 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, 1109, __pyx_L1_error) + if (__pyx_t_5) { - /* "constraint/constraints.py":823 - * # values in the set. - * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: + /* "constraint/constraints.py":1110 + * 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, 1110, __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, 1110, __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, 1110, __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, 1110, __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":822 - * # All unassigned variables must be assigned to - * # values in the set. - * for variable in variables: # <<<<<<<<<<<<<< - * if variable not in assignments: - * domain = domains[variable] + /* "constraint/constraints.py":1109 + * found = 0 + * for variable in variables: + * if variable in assignments: # <<<<<<<<<<<<<< + * found += assignments[variable] not in set + * else: */ - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L5; + } - /* "constraint/constraints.py":819 - * 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. + /* "constraint/constraints.py":1112 + * found += assignments[variable] not in set + * else: + * missing += 1 # <<<<<<<<<<<<<< + * if missing: + * 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, 1112, __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":1108 + * missing = 0 + * found = 0 + * for variable in variables: # <<<<<<<<<<<<<< + * if variable in assignments: + * found += assignments[variable] not in set +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":812 + /* "constraint/constraints.py":1113 * else: * missing += 1 * if missing: # <<<<<<<<<<<<<< * if self._exact: * if not (found <= self._n <= missing + found): */ - goto __pyx_L7; - } + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_missing); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1113, __pyx_L1_error) + if (__pyx_t_5) { - /* "constraint/constraints.py":831 - * return False - * else: + /* "constraint/constraints.py":1114 + * missing += 1 + * if missing: * if self._exact: # <<<<<<<<<<<<<< - * if found != self._n: + * if not (found <= self._n <= missing + found): * 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, 831, __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, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __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, 1114, __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, 1114, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":832 - * else: + /* "constraint/constraints.py":1115 + * if missing: * if self._exact: - * if found != self._n: # <<<<<<<<<<<<<< + * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< * 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, 832, __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, 832, __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, 832, __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, 1115, __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, 1115, __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, 1115, __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, 1115, __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, 1115, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__pyx_t_5) { + __pyx_t_7 = (!__pyx_t_5); + if (__pyx_t_7) { - /* "constraint/constraints.py":833 + /* "constraint/constraints.py":1116 * if self._exact: - * if found != self._n: + * if not (found <= self._n <= missing + found): * return False # <<<<<<<<<<<<<< * else: - * if found < self._n: + * if self._n > missing + found: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":832 - * else: + /* "constraint/constraints.py":1115 + * if missing: * if self._exact: - * if found != self._n: # <<<<<<<<<<<<<< + * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< * return False * else: */ } - /* "constraint/constraints.py":831 - * return False - * else: + /* "constraint/constraints.py":1114 + * missing += 1 + * if missing: * if self._exact: # <<<<<<<<<<<<<< - * if found != self._n: + * if not (found <= self._n <= missing + found): * return False */ - goto __pyx_L23; + goto __pyx_L8; } - /* "constraint/constraints.py":835 - * return False - * else: - * if found < self._n: # <<<<<<<<<<<<<< - * return False - * 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, 835, __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, 835, __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, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_5) { - - /* "constraint/constraints.py":836 - * 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":835 + /* "constraint/constraints.py":1118 * return False * else: - * if found < self._n: # <<<<<<<<<<<<<< - * return False - * return True -*/ - } - } - __pyx_L23:; - } - __pyx_L7:; - - /* "constraint/constraints.py":837 - * if found < self._n: + * if self._n > missing + found: # <<<<<<<<<<<<<< * return False - * return True # <<<<<<<<<<<<<< - * - * -*/ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; - - /* "constraint/constraints.py":803 - * self._exact = exact - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * set = self._set - * missing = 0 -*/ - - /* 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_10); - __Pyx_AddTraceback("constraint.constraints.SomeInSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_set); - __Pyx_XDECREF(__pyx_v_missing); - __Pyx_XDECREF(__pyx_v_found); - __Pyx_XDECREF(__pyx_v_variable); - __Pyx_XDECREF(__pyx_v_domain); - __Pyx_XDECREF(__pyx_v_value); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "constraint/constraints.py":851 - * """ - * - * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< - * """Initialization method. - * -*/ - -/* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_1__init__(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_22SomeNotInSetConstraint___init__, "Initialization method.\n\n Args:\n set (set): Set of values to be checked\n n (int): Minimum number of assigned values that should not\n be present in set (default is 1)\n exact (bool): Whether the number of assigned values which\n are not present in set must be exactly `n`\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_22SomeNotInSetConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_22SomeNotInSetConstraint___init__}; -static PyObject *__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_1__init__(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_set = 0; - PyObject *__pyx_v_n = 0; - PyObject *__pyx_v_exact = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[4] = {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("__init__ (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_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, 851, __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, 851, __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, 851, __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, 851, __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, 851, __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, 851, __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, 851, __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, 851, __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, 851, __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, 851, __pyx_L3_error) - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 851, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_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))); - } - __pyx_v_self = values[0]; - __pyx_v_set = values[1]; - __pyx_v_n = values[2]; - __pyx_v_exact = values[3]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 851, __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.SomeNotInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_set, __pyx_v_n, __pyx_v_exact); - - /* 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_22SomeNotInSetConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set, PyObject *__pyx_v_n, PyObject *__pyx_v_exact) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "constraint/constraints.py":861 - * 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, 861, __pyx_L1_error) - - /* "constraint/constraints.py":862 - * """ - * self._set = set - * self._n = n # <<<<<<<<<<<<<< - * self._exact = exact - * + * if forwardcheck and self._n - found == missing: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2, __pyx_v_n) < 0) __PYX_ERR(0, 862, __pyx_L1_error) + /*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, 1118, __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, 1118, __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, 1118, __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, 1118, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_7) { - /* "constraint/constraints.py":863 - * self._set = set - * self._n = n - * self._exact = exact # <<<<<<<<<<<<<< - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + /* "constraint/constraints.py":1119 + * else: + * if self._n > missing + found: + * return False # <<<<<<<<<<<<<< + * if forwardcheck and self._n - found == missing: + * # All unassigned variables must be assigned to */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2, __pyx_v_exact) < 0) __PYX_ERR(0, 863, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; - /* "constraint/constraints.py":851 - * """ - * - * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< - * """Initialization method. - * + /* "constraint/constraints.py":1118 + * return False + * else: + * if self._n > missing + found: # <<<<<<<<<<<<<< + * return False + * if forwardcheck and self._n - found == missing: */ + } + } + __pyx_L8:; - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.SomeNotInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "constraint/constraints.py":865 - * self._exact = exact - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * set = self._set - * missing = 0 + /* "constraint/constraints.py":1120 + * 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. */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_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_22SomeNotInSetConstraint_3__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_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 -) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_variables = 0; - PyObject *__pyx_v_domains = 0; - PyObject *__pyx_v_assignments = 0; - PyObject *__pyx_v_forwardcheck = 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("__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,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, 865, __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, 865, __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, 865, __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, 865, __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, 865, __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, 865, __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, 865, __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, 865, __pyx_L3_error) } - } + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1120, __pyx_L1_error) + if (__pyx_t_5) { } 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, 865, __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, 865, __pyx_L3_error) - values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 865, __pyx_L3_error) - values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 865, __pyx_L3_error) - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 865, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_error; - } - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + __pyx_t_7 = __pyx_t_5; + goto __pyx_L12_bool_binop_done; } - __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, 865, __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.SomeNotInSetConstraint.__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, 865, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 865, __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 */ - 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; -} + __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, 1120, __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, 1120, __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, 1120, __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, 1120, __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) { -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) { - PyObject *__pyx_v_set = NULL; - PyObject *__pyx_v_missing = NULL; - PyObject *__pyx_v_found = NULL; - PyObject *__pyx_v_variable = NULL; - PyObject *__pyx_v_domain = NULL; - PyObject *__pyx_v_value = 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; - int __pyx_t_7; - Py_ssize_t __pyx_t_8; - PyObject *(*__pyx_t_9)(PyObject *); - PyObject *__pyx_t_10 = NULL; - size_t __pyx_t_11; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 0); + /* "constraint/constraints.py":1123 + * # All unassigned variables must be assigned to + * # values not in the set. + * 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_4 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_4); + __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, 1123, __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, 1123, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + 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, 1123, __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_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, 1123, __pyx_L1_error) + #endif + 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_4, __pyx_t_2)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_2); + #endif + ++__pyx_t_2; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1123, __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, 1123, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":866 - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - * set = self._set # <<<<<<<<<<<<<< - * missing = 0 - * found = 0 + /* "constraint/constraints.py":1124 + * # values not in the set. + * for variable in variables: + * if variable not in assignments: # <<<<<<<<<<<<<< + * domain = domains[variable] + * for value in domain[:]: */ - __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, 866, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_set = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_7 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1124, __pyx_L1_error) + if (__pyx_t_7) { - /* "constraint/constraints.py":867 - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - * set = self._set - * missing = 0 # <<<<<<<<<<<<<< - * found = 0 - * for variable in variables: + /* "constraint/constraints.py":1125 + * for variable in variables: + * if variable not in assignments: + * domain = domains[variable] # <<<<<<<<<<<<<< + * for value in domain[:]: + * if value in set: */ - __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); - __pyx_v_missing = __pyx_mstate_global->__pyx_int_0; + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":868 - * set = self._set - * missing = 0 - * found = 0 # <<<<<<<<<<<<<< - * for variable in variables: - * if variable in assignments: + /* "constraint/constraints.py":1126 + * if variable not in assignments: + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value in set: + * domain.hideValue(value) */ - __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); - __pyx_v_found = __pyx_mstate_global->__pyx_int_0; + __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, 1126, __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, 1126, __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, 1126, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_6))) { + { + 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, 1126, __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_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, 1126, __pyx_L1_error) + #endif + if (__pyx_t_8 >= __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_8)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); + #endif + ++__pyx_t_8; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1126, __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, 1126, __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":869 - * missing = 0 - * found = 0 - * for variable in variables: # <<<<<<<<<<<<<< - * if variable in assignments: - * found += assignments[variable] not in set + /* "constraint/constraints.py":1127 + * domain = domains[variable] + * for value in domain[:]: + * if value in set: # <<<<<<<<<<<<<< + * domain.hideValue(value) + * if not domain: */ - 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, 869, __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, 869, __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, 869, __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, 869, __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, 869, __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, 869, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_set, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1127, __pyx_L1_error) + if (__pyx_t_7) { - /* "constraint/constraints.py":870 - * found = 0 - * for variable in variables: - * if variable in assignments: # <<<<<<<<<<<<<< - * found += assignments[variable] not in set - * else: + /* "constraint/constraints.py":1128 + * for value in domain[:]: + * if value in set: + * domain.hideValue(value) # <<<<<<<<<<<<<< + * if not domain: + * return False */ - __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 870, __pyx_L1_error) - if (__pyx_t_5) { + __pyx_t_10 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_10); + __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_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":871 - * for variable in variables: - * if variable in assignments: - * found += assignments[variable] not in set # <<<<<<<<<<<<<< - * else: - * missing += 1 + /* "constraint/constraints.py":1127 + * domain = domains[variable] + * for value in domain[:]: + * if value in set: # <<<<<<<<<<<<<< + * domain.hideValue(value) + * if not domain: */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 871, __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, 871, __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, 871, __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, 871, __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":870 - * found = 0 - * for variable in variables: - * if variable in assignments: # <<<<<<<<<<<<<< - * found += assignments[variable] not in set - * else: + /* "constraint/constraints.py":1126 + * if variable not in assignments: + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value in set: + * domain.hideValue(value) */ - goto __pyx_L5; - } + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":873 - * found += assignments[variable] not in set - * else: - * missing += 1 # <<<<<<<<<<<<<< - * if missing: + /* "constraint/constraints.py":1129 + * 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, 1129, __pyx_L1_error) + __pyx_t_5 = (!__pyx_t_7); + if (__pyx_t_5) { + + /* "constraint/constraints.py":1130 + * domain.hideValue(value) + * if not domain: + * return False # <<<<<<<<<<<<<< + * else: * 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, 873, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF_SET(__pyx_v_missing, __pyx_t_6); - __pyx_t_6 = 0; - } - __pyx_L5:; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L0; - /* "constraint/constraints.py":869 - * missing = 0 - * found = 0 - * for variable in variables: # <<<<<<<<<<<<<< - * if variable in assignments: - * found += assignments[variable] not in set + /* "constraint/constraints.py":1129 + * if value in set: + * domain.hideValue(value) + * if not domain: # <<<<<<<<<<<<<< + * return False + * else: +*/ + } + + /* "constraint/constraints.py":1124 + * # values not in the set. + * for variable in variables: + * if variable not in assignments: # <<<<<<<<<<<<<< + * domain = domains[variable] + * for value in domain[:]: +*/ + } + + /* "constraint/constraints.py":1123 + * # All unassigned variables must be assigned to + * # values not in the set. + * 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_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":1120 + * 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. +*/ + } - /* "constraint/constraints.py":874 + /* "constraint/constraints.py":1113 * 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, 874, __pyx_L1_error) - if (__pyx_t_5) { + goto __pyx_L7; + } - /* "constraint/constraints.py":875 - * missing += 1 - * if missing: + /* "constraint/constraints.py":1132 + * return False + * else: * if self._exact: # <<<<<<<<<<<<<< - * if not (found <= self._n <= missing + found): + * if found != self._n: * 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, 875, __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, 875, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /*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, 1132, __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, 1132, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":876 - * if missing: + /* "constraint/constraints.py":1133 + * else: * if self._exact: - * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< + * if found != self._n: # <<<<<<<<<<<<<< * 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, 876, __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, 876, __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, 876, __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, 876, __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, 876, __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, 1133, __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, 1133, __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, 1133, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = (!__pyx_t_5); - if (__pyx_t_7) { + if (__pyx_t_5) { - /* "constraint/constraints.py":877 + /* "constraint/constraints.py":1134 * if self._exact: - * if not (found <= self._n <= missing + found): + * if found != self._n: * return False # <<<<<<<<<<<<<< * else: - * if self._n > missing + found: + * if found < self._n: +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "constraint/constraints.py":1133 + * else: + * if self._exact: + * if found != self._n: # <<<<<<<<<<<<<< + * return False + * else: +*/ + } + + /* "constraint/constraints.py":1132 + * return False + * else: + * if self._exact: # <<<<<<<<<<<<<< + * if found != self._n: + * return False +*/ + goto __pyx_L23; + } + + /* "constraint/constraints.py":1136 + * return False + * else: + * if found < self._n: # <<<<<<<<<<<<<< + * return False + * 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, 1136, __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, 1136, __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, 1136, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + + /* "constraint/constraints.py":1137 + * 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":876 - * if missing: - * if self._exact: - * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< - * return False - * else: -*/ - } + /* "constraint/constraints.py":1136 + * return False + * else: + * if found < self._n: # <<<<<<<<<<<<<< + * return False + * return True +*/ + } + } + __pyx_L23:; + } + __pyx_L7:; + + /* "constraint/constraints.py":1138 + * 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":1104 + * self._exact = exact + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * set = self._set + * missing = 0 +*/ + + /* 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_10); + __Pyx_AddTraceback("constraint.constraints.SomeNotInSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_set); + __Pyx_XDECREF(__pyx_v_missing); + __Pyx_XDECREF(__pyx_v_found); + __Pyx_XDECREF(__pyx_v_variable); + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_value); + __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); + 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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_defaults) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->arg0); + #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); + } + #endif +} + +static int __pyx_tp_traverse_10constraint_11constraints___pyx_defaults(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_defaults *p = (struct __pyx_defaults *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } + if (p->arg0) { + e = (*v)(p->arg0, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_10constraint_11constraints___pyx_defaults(PyObject *o) { + PyObject* tmp; + struct __pyx_defaults *p = (struct __pyx_defaults *)o; + tmp = ((PyObject*)p->arg0); + p->arg0 = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_defaults_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_defaults}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_defaults}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_defaults}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_defaults}, + {0, 0}, +}; +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, + __pyx_type_10constraint_11constraints___pyx_defaults_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_defaults = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_defaults", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_defaults, /*tp_traverse*/ + __pyx_tp_clear_10constraint_11constraints___pyx_defaults, /*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_defaults, /*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 PY_VERSION_HEX >= 0x030800b1 && (!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__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)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct__genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr)); + (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/constraints.py":875 - * missing += 1 - * if missing: - * if self._exact: # <<<<<<<<<<<<<< - * if not (found <= self._n <= missing + found): - * return False -*/ - goto __pyx_L8; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct__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 (((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)))) { + __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 + { + #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); + } + #endif + } +} - /* "constraint/constraints.py":879 - * return False - * else: - * if self._n > missing + found: # <<<<<<<<<<<<<< - * return False - * 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, 879, __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, 879, __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, 879, __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, 879, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_7) { - - /* "constraint/constraints.py":880 - * else: - * if self._n > missing + found: - * return False # <<<<<<<<<<<<<< - * if forwardcheck and self._n - found == missing: - * # All unassigned variables must be assigned to -*/ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__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__genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct__genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct__genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_spec = { + "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, + __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_slots, +}; +#else - /* "constraint/constraints.py":879 - * return False - * else: - * if self._n > missing + found: # <<<<<<<<<<<<<< - * return False - * if forwardcheck and self._n - found == missing: -*/ - } - } - __pyx_L8:; +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct__genexpr", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__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__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 PY_VERSION_HEX >= 0x030800b1 && (!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 - /* "constraint/constraints.py":881 - * 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, 881, __pyx_L1_error) - if (__pyx_t_5) { - } else { - __pyx_t_7 = __pyx_t_5; - goto __pyx_L12_bool_binop_done; +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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess)); + (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; +} + +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_preProcess) { + if (PyObject_CallFinalizerFromDealloc(o)) return; } - __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, 881, __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, 881, __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, 881, __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, 881, __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) { + } + #endif + PyObject_GC_UnTrack(o); + 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)))) { + __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 + { + #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); + } + #endif + } +} - /* "constraint/constraints.py":884 - * # All unassigned variables must be assigned to - * # values not in the set. - * 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_4 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_4); - __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, 884, __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, 884, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_3)) { - 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, 884, __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_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, 884, __pyx_L1_error) - #endif - 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_4, __pyx_t_2)); - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_2); - #endif - ++__pyx_t_2; - } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __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, 884, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); - __pyx_t_1 = 0; +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_1_preProcess(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess *)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_v_var) { + e = (*v)(p->__pyx_v_var, a); if (e) return e; + } + return 0; +} - /* "constraint/constraints.py":885 - * # 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, 885, __pyx_L1_error) - if (__pyx_t_7) { +static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_1_preProcess(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_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_1_preProcess_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_preProcess}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_1_preProcess}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_1_preProcess}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_preProcess}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_1_preProcess_spec = { + "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, + __pyx_type_10constraint_11constraints___pyx_scope_struct_1_preProcess_slots, +}; +#else - /* "constraint/constraints.py":886 - * 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, 886, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); - __pyx_t_1 = 0; +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_1_preProcess = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct_1_preProcess", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*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*/ + 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_1_preProcess, /*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 PY_VERSION_HEX >= 0x030800b1 && (!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 - /* "constraint/constraints.py":887 - * 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, 887, __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, 887, __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, 887, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_9)) { - if (likely(PyList_CheckExact(__pyx_t_6))) { - { - 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, 887, __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_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, 887, __pyx_L1_error) - #endif - if (__pyx_t_8 >= __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_8)); - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); - #endif - ++__pyx_t_8; - } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 887, __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, 887, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); - __pyx_t_1 = 0; +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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr)); + (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/constraints.py":888 - * 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, 888, __pyx_L1_error) - if (__pyx_t_7) { +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_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 (((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)))) { + __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 + { + #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); + } + #endif + } +} - /* "constraint/constraints.py":889 - * for value in domain[:]: - * if value in set: - * domain.hideValue(value) # <<<<<<<<<<<<<< - * if not domain: - * return False -*/ - __pyx_t_10 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_10); - __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_XDECREF(__pyx_t_10); __pyx_t_10 = 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; +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_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_2_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr_spec = { + "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, + __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr_slots, +}; +#else - /* "constraint/constraints.py":888 - * domain = domains[variable] - * for value in domain[:]: - * if value in set: # <<<<<<<<<<<<<< - * domain.hideValue(value) - * if not domain: -*/ - } +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct_2_genexpr", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_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_2_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 PY_VERSION_HEX >= 0x030800b1 && (!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 - /* "constraint/constraints.py":887 - * if variable not in assignments: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value in set: - * domain.hideValue(value) -*/ - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; +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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr)); + (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/constraints.py":890 - * 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, 890, __pyx_L1_error) - __pyx_t_5 = (!__pyx_t_7); - if (__pyx_t_5) { +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_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 (((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)))) { + __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 + { + #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); + } + #endif + } +} + +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_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_3_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_spec = { + "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, + __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_slots, +}; +#else - /* "constraint/constraints.py":891 - * domain.hideValue(value) - * if not domain: - * return False # <<<<<<<<<<<<<< - * else: - * if self._exact: -*/ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L0; +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct_3_genexpr", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_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_3_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 PY_VERSION_HEX >= 0x030800b1 && (!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 - /* "constraint/constraints.py":890 - * if value in set: - * domain.hideValue(value) - * if not domain: # <<<<<<<<<<<<<< - * return False - * else: -*/ - } +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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr)); + (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/constraints.py":885 - * # values not in the set. - * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: -*/ - } +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_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 (((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)))) { + __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 + { + #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); + } + #endif + } +} - /* "constraint/constraints.py":884 - * # All unassigned variables must be assigned to - * # values not in the set. - * for variable in variables: # <<<<<<<<<<<<<< - * if variable not in assignments: - * domain = domains[variable] -*/ - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_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_4_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_spec = { + "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, + __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_slots, +}; +#else - /* "constraint/constraints.py":881 - * 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. -*/ - } +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct_4_genexpr", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_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_4_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 PY_VERSION_HEX >= 0x030800b1 && (!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 - /* "constraint/constraints.py":874 - * else: - * missing += 1 - * if missing: # <<<<<<<<<<<<<< - * if self._exact: - * if not (found <= self._n <= missing + found): -*/ - goto __pyx_L7; +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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess)); + (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/constraints.py":893 - * return False - * 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_exact_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __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, 893, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_5) { - - /* "constraint/constraints.py":894 - * 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, 894, __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, 894, __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, 894, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__pyx_t_5) { - - /* "constraint/constraints.py":895 - * if self._exact: - * if found != self._n: - * return False # <<<<<<<<<<<<<< - * else: - * if found < self._n: -*/ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - - /* "constraint/constraints.py":894 - * else: - * if self._exact: - * if found != self._n: # <<<<<<<<<<<<<< - * return False - * else: -*/ - } - - /* "constraint/constraints.py":893 - * return False - * else: - * if self._exact: # <<<<<<<<<<<<<< - * if found != self._n: - * return False -*/ - goto __pyx_L23; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_preProcess) { + if (PyObject_CallFinalizerFromDealloc(o)) return; } - - /* "constraint/constraints.py":897 - * return False - * else: - * if found < self._n: # <<<<<<<<<<<<<< - * return False - * 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, 897, __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, 897, __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, 897, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_5) { - - /* "constraint/constraints.py":898 - * 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":897 - * return False - * else: - * if found < self._n: # <<<<<<<<<<<<<< - * return False - * return True -*/ - } + } + #endif + PyObject_GC_UnTrack(o); + 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)))) { + __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 + { + #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); } - __pyx_L23:; + #endif } - __pyx_L7:; - - /* "constraint/constraints.py":899 - * 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":865 - * self._exact = exact - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * set = self._set - * missing = 0 -*/ +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_preProcess(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *)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_v_var) { + e = (*v)(p->__pyx_v_var, a); if (e) return e; + } + return 0; +} - /* 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_10); - __Pyx_AddTraceback("constraint.constraints.SomeNotInSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_set); - __Pyx_XDECREF(__pyx_v_missing); - __Pyx_XDECREF(__pyx_v_found); - __Pyx_XDECREF(__pyx_v_variable); - __Pyx_XDECREF(__pyx_v_domain); - __Pyx_XDECREF(__pyx_v_value); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; +static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_5_preProcess(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_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; } -/* #### Code section: module_exttypes ### */ +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_preProcess}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_preProcess}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_5_preProcess}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_preProcess}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess_spec = { + "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, + __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct_5_preProcess", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*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*/ + 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_5_preProcess, /*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 PY_VERSION_HEX >= 0x030800b1 && (!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_defaults(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_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); - if (unlikely(!o)) return 0; + #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)); + (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; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_defaults(PyObject *o) { - struct __pyx_defaults *p = (struct __pyx_defaults *)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((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_defaults) { + 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->arg0); - #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); - #else + 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 (((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); + } else + #endif { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); - if (tp_free) tp_free(o); + #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); + } + #endif } - #endif } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_defaults(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_defaults *p = (struct __pyx_defaults *)o; + 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->arg0) { - e = (*v)(p->arg0, 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; -} - -static int __pyx_tp_clear_10constraint_11constraints___pyx_defaults(PyObject *o) { - PyObject* tmp; - struct __pyx_defaults *p = (struct __pyx_defaults *)o; - tmp = ((PyObject*)p->arg0); - p->arg0 = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_defaults_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_defaults}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_defaults}, - {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_defaults}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_defaults}, +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_defaults_spec = { - "constraint.constraints.__pyx_defaults", - sizeof(struct __pyx_defaults), +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|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_defaults_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_defaults = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_defaults", /*tp_name*/ - sizeof(struct __pyx_defaults), /*tp_basicsize*/ + "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_defaults, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_6_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -22180,8 +29704,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_defaults = { 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_defaults, /*tp_traverse*/ - __pyx_tp_clear_10constraint_11constraints___pyx_defaults, /*tp_clear*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_6_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -22198,7 +29722,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_defaults = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_defaults, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_6_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -22231,16 +29755,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_defaults = { }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_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)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct__genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -22253,11 +29777,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct__gen 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; +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((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__genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_7_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -22266,8 +29790,8 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct__gene 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__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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); + 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); } else #endif { @@ -22282,9 +29806,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct__gene } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) { +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__genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *)o; + 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; @@ -22298,27 +29822,27 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__gene return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct__genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct__genexpr}, +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__genexpr_spec = { - "constraint.constraints.__pyx_scope_struct__genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr), +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|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct__genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr), /*tp_basicsize*/ + "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__genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_7_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -22340,7 +29864,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct__ge 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_7_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -22358,7 +29882,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct__ge #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct__genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_7_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -22391,16 +29915,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct__ge }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_11constraints___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_11constraints___pyx_scope_struct_1_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_1_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -22413,11 +29937,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_ge return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_genexpr(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *)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; #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_1_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_8_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -22426,8 +29950,8 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_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_1_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_1_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *)o); + 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); } else #endif { @@ -22442,9 +29966,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_gen } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_8_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -22458,27 +29982,27 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_1_gen return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_1_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_genexpr}, +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}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_1_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr), +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), 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_1_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_8_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_8_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_1_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_8_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_8_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -22500,7 +30024,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_1_g 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_1_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_8_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -22518,7 +30042,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_1_g #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_8_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -22551,16 +30075,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_1_g }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_preProcess(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_9_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_2_preProcess > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_2_preProcess[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_2_preProcess]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -22573,11 +30097,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_pr return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_preProcess(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *)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; #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_2_preProcess) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_9_preProcess) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -22586,8 +30110,8 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_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_2_preProcess < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_2_preProcess[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_2_preProcess++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *)o); + 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); } else #endif { @@ -22602,9 +30126,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_pre } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_preProcess(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_9_preProcess(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -22618,9 +30142,9 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_pre return 0; } -static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_2_preProcess(PyObject *o) { +static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_9_preProcess(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess *)o; + 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); @@ -22630,28 +30154,28 @@ static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_2_prePro return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_2_preProcess_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_preProcess}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_preProcess}, - {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_2_preProcess}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_preProcess}, +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}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_2_preProcess_spec = { - "constraint.constraints.__pyx_scope_struct_2_preProcess", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess), +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), 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_2_preProcess_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_9_preProcess_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_preProcess = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_9_preProcess = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_2_preProcess", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_preProcess), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_9_preProcess", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_preProcess, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_9_preProcess, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -22673,8 +30197,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_p 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_preProcess, /*tp_traverse*/ - __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_2_preProcess, /*tp_clear*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_9_preProcess, /*tp_traverse*/ + __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_9_preProcess, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -22691,7 +30215,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_p #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_preProcess, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_9_preProcess, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -22724,16 +30248,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_p }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_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_3_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -22746,11 +30270,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_ge 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; +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_3_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_10_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -22761,8 +30285,8 @@ 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)))) { - __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); + 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); } else #endif { @@ -22777,9 +30301,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_gen } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_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_3_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_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; @@ -22799,27 +30323,27 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_gen return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_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_3_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_3_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_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_3_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_3_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_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_3_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_10_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -22841,7 +30365,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_g 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_10_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -22859,7 +30383,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_g #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_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*/ @@ -22892,16 +30416,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_g }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr(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_4_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -22914,23 +30438,21 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_ge 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; +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_4_genexpr) { + 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_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_value); #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)))) { - __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); + 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); } else #endif { @@ -22945,49 +30467,43 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_gen } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr(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_4_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr *)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_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_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_4_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr}, +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_4_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_4_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr), +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_4_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_4_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr), /*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_4_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -23009,7 +30525,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_g 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -23027,7 +30543,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_g #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -23060,16 +30576,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_g }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12_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_5_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_5_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_5_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_12_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_12_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_12_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -23082,11 +30598,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_ge return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_genexpr(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr *)o; +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12_genexpr(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_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_5_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -23095,8 +30611,8 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_gen 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_5_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_5_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_12_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_12_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_12_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *)o); } else #endif { @@ -23111,9 +30627,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_gen } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_12_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -23127,27 +30643,27 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_gen return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_5_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_genexpr}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_12_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_5_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_5_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr_spec = { + "constraint.constraints.__pyx_scope_struct_12_genexpr", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_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_5_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_5_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_genexpr), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_12_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -23169,7 +30685,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_g 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_12_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -23187,7 +30703,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_g #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -23274,115 +30790,227 @@ 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, 63, __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, 63, __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, 63, __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, 63, __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, 63, __pyx_L1_error) + #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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults->tp_getattro = PyObject_GenericGetAttr; + } + #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, 392, __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, 392, __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, 392, __pyx_L1_error) + #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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr->tp_getattro = PyObject_GenericGetAttr; + } + #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, 395, __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, 395, __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, 395, __pyx_L1_error) + #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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess->tp_getattro = PyObject_GenericGetAttr; + } + #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, 409, __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, 409, __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, 409, __pyx_L1_error) + #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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_genexpr->tp_getattro = PyObject_GenericGetAttr; + } + #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, 410, __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, 410, __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, 410, __pyx_L1_error) + #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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr->tp_getattro = PyObject_GenericGetAttr; + } + #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, 539, __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, 539, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults = &__pyx_type_10constraint_11constraints___pyx_defaults; + __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_defaults) < 0) __PYX_ERR(0, 63, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 539, __pyx_L1_error) #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)) { - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults->tp_getattro = PyObject_GenericGetAttr; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr->tp_getattro = PyObject_GenericGetAttr; } #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, 307, __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, 307, __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, 542, __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, 542, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr; + __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__genexpr) < 0) __PYX_ERR(0, 307, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess) < 0) __PYX_ERR(0, 542, __pyx_L1_error) #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)) { - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr->tp_getattro = PyObject_GenericGetAttr; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 491, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 491, __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, 550, __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, 550, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr; + __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_1_genexpr) < 0) __PYX_ERR(0, 491, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 550, __pyx_L1_error) #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_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr->tp_getattro = PyObject_GenericGetAttr; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_preProcess = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_2_preProcess_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_preProcess)) __PYX_ERR(0, 494, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_2_preProcess_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_preProcess) < 0) __PYX_ERR(0, 494, __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, 613, __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, 613, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_preProcess = &__pyx_type_10constraint_11constraints___pyx_scope_struct_2_preProcess; + __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_2_preProcess) < 0) __PYX_ERR(0, 494, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 613, __pyx_L1_error) #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_preProcess->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_preProcess->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_preProcess->tp_getattro = PyObject_GenericGetAttr; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr->tp_getattro = PyObject_GenericGetAttr; } #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, 508, __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, 508, __pyx_L1_error) + __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, 709, __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, 709, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_genexpr = &__pyx_type_10constraint_11constraints___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_11constraints___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 508, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(0, 709, __pyx_L1_error) #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)) { - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_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_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; } #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, 509, __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, 509, __pyx_L1_error) + __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, 712, __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, 712, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_preProcess = &__pyx_type_10constraint_11constraints___pyx_scope_struct_9_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_4_genexpr) < 0) __PYX_ERR(0, 509, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_preProcess) < 0) __PYX_ERR(0, 712, __pyx_L1_error) #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)) { - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr->tp_getattro = PyObject_GenericGetAttr; + 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; + } + #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, 720, __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, 720, __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, 720, __pyx_L1_error) + #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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr->tp_getattro = PyObject_GenericGetAttr; + } + #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, 779, __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, 779, __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, 779, __pyx_L1_error) + #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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_5_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_genexpr)) __PYX_ERR(0, 630, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_5_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 630, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr)) __PYX_ERR(0, 854, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(0, 854, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_5_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_12_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_5_genexpr) < 0) __PYX_ERR(0, 630, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(0, 854, __pyx_L1_error) #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_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_genexpr->tp_getattro = PyObject_GenericGetAttr; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif __Pyx_RefNannyFinishContext(); @@ -23703,1333 +31331,1624 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); (void)__Pyx_modinit_function_import_code(__pyx_mstate); /*--- Execution code ---*/ - /* "constraint/constraints.py":3 - * """Module containing the code for constraint definitions.""" + /* "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 +*/ + __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) + __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) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":4 + * + * from constraint.domain import Unassigned + * from typing import Callable, Union, Optional # <<<<<<<<<<<<<< + * from collections.abc import Sequence + * +*/ + __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) + __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; + __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 # <<<<<<<<<<<<<< + * + * class Constraint: +*/ + __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":7 + * from collections.abc import Sequence + * + * class Constraint: # <<<<<<<<<<<<<< + * """Abstract base class for constraints.""" + * +*/ + __pyx_t_3 = __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_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "constraint/constraints.py":10 + * """Abstract base class for constraints.""" + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # <<<<<<<<<<<<<< + * """Perform the constraint checking. + * +*/ + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 10, __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, 10, __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, 10, __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[10])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0]); + __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_call, __pyx_t_4) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":35 + * 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, 35, __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, 35, __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, 35, __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, 35, __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, 35, __pyx_L1_error) + __pyx_t_2 = __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[11])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":63 + * vconstraints[variable].remove((self, variables)) + * + * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): # <<<<<<<<<<<<<< + * """Helper method for generic forward checking. + * +*/ + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 63, __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, 63, __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, 63, __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[12])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __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, 63, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __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_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_forwardCheck, __pyx_t_4) < 0) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":7 + * from collections.abc import Sequence + * + * 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_3, NULL, 0, 0); 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_mstate_global->__pyx_n_u_Constraint, __pyx_t_4) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":104 + * + * + * class FunctionConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint which wraps a function defining the constraint logic. + * +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __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, 104, __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, 104, __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, 104, __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_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, 104, __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, 104, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":125 + * """ + * + * 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, 125, __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, 125, __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, 125, __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[13])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __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_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, 125, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "constraint/constraints.py":137 + * 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, 137, __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, 137, __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, 137, __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, 137, __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[14])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __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, 137, __pyx_L1_error) + + /* "constraint/constraints.py":143 + * 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, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_4)->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, 137, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":104 + * + * + * class FunctionConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint which wraps a function defining the constraint logic. * - * from constraint.domain import Unassigned # <<<<<<<<<<<<<< - * from typing import Callable, Union, Optional - * from collections.abc import Sequence */ - __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) - __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) + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __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, 104, __pyx_L1_error) + __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; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":4 + /* "constraint/constraints.py":190 + * return self._func(*parms) * - * from constraint.domain import Unassigned - * from typing import Callable, Union, Optional # <<<<<<<<<<<<<< - * from collections.abc import Sequence + * class CompilableFunctionConstraint(Constraint): # <<<<<<<<<<<<<< + * """Wrapper function for picklable string constraints that must be compiled into a FunctionConstraint later on.""" * */ - __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_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __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) + __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __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_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_t_3 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __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; + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __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, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_3 != __pyx_t_2) { + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 190, __pyx_L1_error) + } __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":193 + * """Wrapper function for picklable string constraints that must be compiled into a FunctionConstraint later on.""" * - * class Constraint: + * def __init__(self, func: str, assigned: bool = True): # noqa: D102, D107 # <<<<<<<<<<<<<< + * self._func = func + * self._assigned = assigned */ - __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_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __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); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_func, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 193, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_assigned, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(0, 193, __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[15])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __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_2); __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) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "constraint/constraints.py":197 + * 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[16])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __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, 197, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __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_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_6)->arg0 = __pyx_t_2; + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 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, 197, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "constraint/constraints.py":190 + * 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_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __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, 190, __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_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":7 - * from collections.abc import Sequence + /* "constraint/constraints.py":201 * - * class Constraint: # <<<<<<<<<<<<<< - * """Abstract base class for constraints.""" + * + * class AllDifferentConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of all given variables are different. * */ - __pyx_t_3 = __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_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __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, 201, __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, 201, __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, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __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, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_3 != __pyx_t_5) { + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 201, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":10 - * """Abstract base class for constraints.""" + /* "constraint/constraints.py":212 + * """ + * + * def __call__( # noqa: D102 # <<<<<<<<<<<<<< + * self, + * variables: Sequence, +*/ + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __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, 212, __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, 212, __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, 212, __pyx_L1_error) + __pyx_t_2 = __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[17])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 212, __pyx_L1_error) + + /* "constraint/constraints.py":218 + * 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, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_2)->arg0 = __pyx_t_7; + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_2, __pyx_pf_10constraint_11constraints_6__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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_2) < 0) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":201 * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # <<<<<<<<<<<<<< - * """Perform the constraint checking. + * + * class AllDifferentConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of all given variables are different. * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 10, __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, 10, __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, 10, __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[5])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __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, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 10, __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; - /* "constraint/constraints.py":35 - * return True + /* "constraint/constraints.py":239 * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< - * """Preprocess variable domains. + * + * class AllEqualConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of all given variables are equal. * */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __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, 239, __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, 35, __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, 35, __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, 35, __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, 35, __pyx_L1_error) - __pyx_t_2 = __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[6])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __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, 239, __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, 239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __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_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); + if (__pyx_t_3 != __pyx_t_4) { + if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 239, __pyx_L1_error) + } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":63 - * vconstraints[variable].remove((self, variables)) - * - * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): # <<<<<<<<<<<<<< - * """Helper method for generic forward checking. + /* "constraint/constraints.py":250 + * """ * + * def __call__( # noqa: D102 # <<<<<<<<<<<<<< + * self, + * variables: Sequence, */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 63, __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, 63, __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, 63, __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[7])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __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, 63, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __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, 250, __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, 250, __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, 250, __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[18])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __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_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_forwardCheck, __pyx_t_4) < 0) __PYX_ERR(0, 63, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 250, __pyx_L1_error) + + /* "constraint/constraints.py":256 + * 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, 256, __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_2, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 250, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":7 - * from collections.abc import Sequence + /* "constraint/constraints.py":239 * - * class Constraint: # <<<<<<<<<<<<<< - * """Abstract base class for constraints.""" + * + * class AllEqualConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of all given variables are equal. * */ - __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); 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_mstate_global->__pyx_n_u_Constraint, __pyx_t_4) < 0) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 239, __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, 239, __pyx_L1_error) + __Pyx_DECREF(__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; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":104 + /* "constraint/constraints.py":277 * * - * class FunctionConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint which wraps a function defining the constraint logic. + * class ExactSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of given variables sum exactly to a given amount. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __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, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 277, __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_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __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, 104, __pyx_L1_error) + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __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_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, 104, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __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, 277, __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, 104, __pyx_L1_error) + if (__pyx_t_3 != __pyx_t_6) { + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 277, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":125 + /* "constraint/constraints.py":288 * """ * - * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< + * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __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, 288, __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, 288, __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[19])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __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, 125, __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, 125, __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[8])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __pyx_L1_error) + __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_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":300 + * 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, 300, __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, 300, __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, 300, __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, 300, __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, 300, __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[20])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __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_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, 125, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":137 - * self._assigned = assigned + /* "constraint/constraints.py":317 + * domain.remove(value) * - * def __call__( # noqa: D102 # <<<<<<<<<<<<<< - * self, - * variables: Sequence, + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * multipliers = self._multipliers + * exactsum = self._exactsum */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 317, __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, 137, __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, 137, __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, 137, __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[9])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __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, 317, __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, 317, __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, 317, __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[21])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __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, 137, __pyx_L1_error) - - /* "constraint/constraints.py":143 - * 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, 143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_4)->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_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0]); __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, 137, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":104 + /* "constraint/constraints.py":277 * * - * class FunctionConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint which wraps a function defining the constraint logic. + * class ExactSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of given variables sum exactly to a given amount. * */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 277, __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, 104, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 277, __pyx_L1_error) __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; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":190 - * return self._func(*parms) + /* "constraint/constraints.py":365 + * return sum == exactsum * - * class CompilableFunctionConstraint(Constraint): # <<<<<<<<<<<<<< - * """Wrapper function for picklable string constraints that must be compiled into a FunctionConstraint later on.""" + * class VariableExactSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that the sum of variables equals the value of another variable. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __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, 190, __pyx_L1_error) + __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __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, 190, __pyx_L1_error) + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __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, 190, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __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, 190, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __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, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_3 != __pyx_t_2) { - if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 190, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 365, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":193 - * """Wrapper function for picklable string constraints that must be compiled into a FunctionConstraint later on.""" + /* "constraint/constraints.py":376 + * """ + * + * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * """Initialization method. * - * def __init__(self, func: str, assigned: bool = True): # noqa: D102, D107 # <<<<<<<<<<<<<< - * self._func = func - * self._assigned = assigned */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_func, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 193, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_assigned, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(0, 193, __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[10])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 376, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_sum_vars, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 376, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Optional_Sequence) < 0) __PYX_ERR(0, 376, __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[22])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[1]); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[2]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 193, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":197 - * self._assigned = assigned + /* "constraint/constraints.py":395 + * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." * - * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 # <<<<<<<<<<<<<< - * raise NotImplementedError("CompilableFunctionConstraint can not be called directly") + * 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_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[11])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __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, 197, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __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, 395, __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, 395, __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, 395, __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, 395, __pyx_L1_error) + __pyx_t_2 = __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[23])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_6)->arg0 = __pyx_t_2; - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 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, 197, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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_2) < 0) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":190 - * return self._func(*parms) + /* "constraint/constraints.py":417 + * domain.remove(value) * - * class CompilableFunctionConstraint(Constraint): # <<<<<<<<<<<<<< - * """Wrapper function for picklable string constraints that must be compiled into a FunctionConstraint later on.""" + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * multipliers = self._multipliers * */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 417, __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, 417, __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, 417, __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[24])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 417, __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, 190, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[0]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 417, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "constraint/constraints.py":365 + * return sum == exactsum + * + * class VariableExactSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that the sum of variables equals the value of another variable. + * +*/ + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 365, __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, 365, __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_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":201 + /* "constraint/constraints.py":469 * * - * class AllDifferentConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of all given variables are different. + * class MinSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of given variables sum at least to a given amount. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __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, 201, __pyx_L1_error) + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 469, __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, 201, __pyx_L1_error) + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __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, 201, __pyx_L1_error) + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __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, 201, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __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, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3 != __pyx_t_5) { - if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 201, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 469, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":212 + /* "constraint/constraints.py":480 * """ * - * def __call__( # noqa: D102 # <<<<<<<<<<<<<< - * self, - * variables: Sequence, + * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * """Initialization method. + * */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 480, __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, 212, __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, 212, __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, 212, __pyx_L1_error) - __pyx_t_2 = __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[12])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) + 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, 480, __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, 480, __pyx_L1_error) + __pyx_t_2 = __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[25])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 212, __pyx_L1_error) - - /* "constraint/constraints.py":218 - * 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, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_2)->arg0 = __pyx_t_7; - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_2, __pyx_pf_10constraint_11constraints_6__defaults__); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[2]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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_2) < 0) __PYX_ERR(0, 212, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":201 - * - * - * class AllDifferentConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of all given variables are different. + /* "constraint/constraints.py":492 + * self._multipliers = multipliers * + * 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_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __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, 201, __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, 492, __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, 492, __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, 492, __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[26])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 492, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[0]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 492, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "constraint/constraints.py":469 + * + * + * class MinSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of given variables sum at least to a given amount. + * +*/ + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 469, __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, 469, __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_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":239 - * + /* "constraint/constraints.py":512 + * return sum >= minsum * - * class AllEqualConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of all given variables are equal. + * class VariableMinSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that the sum of variables sum at least to the value of another variable. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __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, 239, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __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, 239, __pyx_L1_error) + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __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, 239, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __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_2)) __PYX_ERR(0, 239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __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, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3 != __pyx_t_4) { - if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 239, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 512, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":250 - * """ + /* "constraint/constraints.py":523 + * """ # noqa: E501 + * + * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * """Initialization method. * - * def __call__( # noqa: D102 # <<<<<<<<<<<<<< - * self, - * variables: Sequence, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error) + __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_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 250, __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, 250, __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, 250, __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[13])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __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, 250, __pyx_L1_error) + 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, 523, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sum_vars, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 523, __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, 523, __pyx_L1_error) + __pyx_t_2 = __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[27])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[2]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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_2) < 0) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":256 - * assignments: dict, - * forwardcheck=False, - * _unassigned=Unassigned, # <<<<<<<<<<<<<< - * ): - * singlevalue = _unassigned + /* "constraint/constraints.py":542 + * 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_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __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_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 542, __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, 542, __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, 542, __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, 542, __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[28])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __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_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 542, __pyx_L1_error) __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, 250, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":239 + /* "constraint/constraints.py":555 + * 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, 555, __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, 555, __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, 555, __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, 555, __pyx_L1_error) + __pyx_t_2 = __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[29])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[0]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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_2) < 0) __PYX_ERR(0, 555, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":512 + * return sum >= minsum * - * class AllEqualConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of all given variables are equal. + * class VariableMinSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that the sum of variables sum at least to the value of another variable. * */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 239, __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, 239, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __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, 512, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":277 + /* "constraint/constraints.py":583 * * * class MaxSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum up to a given amount. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __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, 277, __pyx_L1_error) + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 583, __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, 277, __pyx_L1_error) + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __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, 277, __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_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_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 583, __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_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_2)) __PYX_ERR(0, 583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_3 != __pyx_t_6) { - if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 277, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 583, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":288 + /* "constraint/constraints.py":594 * """ * * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 594, __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, 288, __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, 288, __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[14])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) + 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, 594, __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, 594, __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[30])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 288, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":300 + /* "constraint/constraints.py":606 * self._multipliers = multipliers * * 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, 300, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __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, 300, __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, 300, __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, 300, __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, 300, __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[15])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __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, 606, __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, 606, __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, 606, __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, 606, __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[31])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 606, __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, 300, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":335 + /* "constraint/constraints.py":641 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers * maxsum = self._maxsum */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 641, __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, 335, __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, 335, __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, 335, __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[16])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __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, 641, __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, 641, __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, 641, __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[32])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0]); __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, 335, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":277 + /* "constraint/constraints.py":583 * * * class MaxSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum up to a given amount. * */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __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, 277, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 583, __pyx_L1_error) __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; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":376 + /* "constraint/constraints.py":682 * * - * class ExactSumConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables sum exactly to a given amount. + * class VariableMaxSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that the sum of variables sum at most to the value of another variable. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __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, 376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 682, __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_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __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, 376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __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_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __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, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__pyx_t_3 != __pyx_t_2) { - if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 376, __pyx_L1_error) + if (__pyx_t_3 != __pyx_t_5) { + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 682, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":387 - * """ + /* "constraint/constraints.py":693 + * """ # noqa: E501 * - * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exactsum, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 387, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Optional_Sequence) < 0) __PYX_ERR(0, 387, __pyx_L1_error) - __pyx_t_6 = __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[17])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 693, __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, 693, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_sum_vars, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 693, __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, 693, __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[33])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 693, __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_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + __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, 693, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":399 - * self._multipliers = multipliers + /* "constraint/constraints.py":712 + * 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) - * multipliers = self._multipliers + * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 712, __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, 399, __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, 399, __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, 399, __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, 399, __pyx_L1_error) - __pyx_t_2 = __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[18])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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, 712, __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, 712, __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, 712, __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, 712, __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[34])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __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_2) < 0) __PYX_ERR(0, 399, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":416 + /* "constraint/constraints.py":725 * domain.remove(value) * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers - * exactsum = self._exactsum + * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); 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_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 416, __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, 416, __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, 416, __pyx_L1_error) - __pyx_t_6 = __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[19])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 725, __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, 725, __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, 725, __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, 725, __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[35])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[0]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 416, __pyx_L1_error) + __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, 725, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":376 + /* "constraint/constraints.py":682 * * - * class ExactSumConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables sum exactly to a given amount. + * class VariableMaxSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that the sum of variables sum at most to the value of another variable. * */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 376, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 682, __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; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":464 - * return sum == exactsum + /* "constraint/constraints.py":753 * - * class VariableExactSumConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that the sum of variables equals the value of another variable. + * + * class ExactProdConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of given variables create a product of exactly a given amount. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __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, 464, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __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_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __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, 464, __pyx_L1_error) + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __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_6)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __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, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_3 != __pyx_t_5) { - if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 464, __pyx_L1_error) + if (__pyx_t_3 != __pyx_t_2) { + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 753, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "constraint/constraints.py":475 - * """ - * - * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< - * """Initialization method. - * -*/ - __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 475, __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, 475, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_sum_vars, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 475, __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, 475, __pyx_L1_error) - __pyx_t_2 = __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[20])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[2]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":494 - * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." + /* "constraint/constraints.py":764 + * """ * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * def __init__(self, exactprod: Union[int, float]): # <<<<<<<<<<<<<< + * """Instantiate an ExactProdConstraint. * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 494, __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, 494, __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, 494, __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, 494, __pyx_L1_error) - __pyx_t_5 = __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[21])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exactprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 764, __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[36])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 764, __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_6, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 494, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":516 - * domain.remove(value) + /* "constraint/constraints.py":772 + * self._exactprod = exactprod * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * multipliers = self._multipliers + * 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(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 772, __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, 516, __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, 516, __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, 516, __pyx_L1_error) - __pyx_t_2 = __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[22])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __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, 772, __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, 772, __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, 772, __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, 772, __pyx_L1_error) + __pyx_t_2 = __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[37])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[0]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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_2) < 0) __PYX_ERR(0, 516, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_2) < 0) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":464 - * return sum == exactsum - * - * class VariableExactSumConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that the sum of variables equals the value of another variable. + /* "constraint/constraints.py":800 + * domain.remove(value) * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * exactprod = self._exactprod + * prod = 1 */ - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 800, __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, 464, __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, 800, __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, 800, __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, 800, __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[38])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 800, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[0]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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; - - /* "constraint/constraints.py":568 - * - * - * class MinSumConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables sum at least to a given amount. - * -*/ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __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, 568, __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, 568, __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, 568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __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_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __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, 568, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 800, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":579 - * """ + /* "constraint/constraints.py":753 * - * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< - * """Initialization method. * -*/ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_minsum, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 579, __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, 579, __pyx_L1_error) - __pyx_t_5 = __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[23])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 579, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[2]); - __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_init, __pyx_t_5) < 0) __PYX_ERR(0, 579, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "constraint/constraints.py":591 - * self._multipliers = multipliers + * class ExactProdConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of given variables create a product of exactly a given amount. * - * 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_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 753, __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, 591, __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, 591, __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, 591, __pyx_L1_error) - __pyx_t_4 = __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[24])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 591, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __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, 753, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 591, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "constraint/constraints.py":568 - * - * - * class MinSumConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables sum at least to a given amount. - * -*/ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 568, __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_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":612 + /* "constraint/constraints.py":828 * * * class MaxProdConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables create a product up to at most a given amount.""" + * """Constraint enforcing that values of given variables create a product up to at most a given amount. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __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, 612, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 828, __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_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error) + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __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, 612, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __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_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__pyx_t_3 != __pyx_t_6) { - if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 612, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __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_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 828, __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, 828, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":615 - * """Constraint enforcing that values of given variables create a product up to at most a given amount.""" + /* "constraint/constraints.py":839 + * """ * * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MaxProdConstraint. * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 615, __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_Union_int_float) < 0) __PYX_ERR(0, 615, __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[25])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __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_init, __pyx_t_5) < 0) __PYX_ERR(0, 615, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_maxprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 839, __pyx_L1_error) + __pyx_t_2 = __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[39])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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_2) < 0) __PYX_ERR(0, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":623 + /* "constraint/constraints.py":847 * self._maxprod = maxprod * * 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, 623, __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, 623, __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, 623, __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, 623, __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, 623, __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[26])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 623, __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, 623, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 847, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 847, __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, 847, __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, 847, __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, 847, __pyx_L1_error) + __pyx_t_4 = __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[40])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 847, __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_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 847, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":650 + /* "constraint/constraints.py":875 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * maxprod = self._maxprod * prod = 1 */ - __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_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 650, __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, 650, __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, 650, __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[27])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 650, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[0]); - __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_call, __pyx_t_5) < 0) __PYX_ERR(0, 650, __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, 875, __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, 875, __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, 875, __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, 875, __pyx_L1_error) + __pyx_t_2 = __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[41])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[0]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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_2) < 0) __PYX_ERR(0, 875, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":612 + /* "constraint/constraints.py":828 * * * class MaxProdConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables create a product up to at most a given amount.""" + * """Constraint enforcing that values of given variables create a product up to at most a given amount. * */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 612, __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, 612, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 828, __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, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":672 + /* "constraint/constraints.py":903 * * * class MinProdConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables create a product up to at least a given amount.""" + * """Constraint enforcing that values of given variables create a product up to at least a given amount. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 672, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 903, __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, 672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 903, __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_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 672, __pyx_L1_error) + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 903, __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, 672, __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_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_5)) __PYX_ERR(0, 672, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3 != __pyx_t_2) { - if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 672, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __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_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (__pyx_t_3 != __pyx_t_6) { + if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 903, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":675 - * """Constraint enforcing that values of given variables create a product up to at least a given amount.""" + /* "constraint/constraints.py":914 + * """ * * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MinProdConstraint. * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_minprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 675, __pyx_L1_error) - __pyx_t_6 = __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[28])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 675, __pyx_L1_error) + 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, 914, __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[42])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 914, __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_2, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 914, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":683 + /* "constraint/constraints.py":922 * 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_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 683, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 922, __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, 922, __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, 922, __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, 922, __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, 922, __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[43])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 922, __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, 683, __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, 683, __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, 683, __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, 683, __pyx_L1_error) - __pyx_t_2 = __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[29])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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_2, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 922, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_2) < 0) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":694 + /* "constraint/constraints.py":933 * 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_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 694, __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, 694, __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, 694, __pyx_L1_error) - __pyx_t_6 = __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[30])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[0]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 694, __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, 933, __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, 933, __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, 933, __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[44])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 933, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 933, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":672 + /* "constraint/constraints.py":903 * * * class MinProdConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables create a product up to at least a given amount.""" + * """Constraint enforcing that values of given variables create a product up to at least a given amount. * */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 672, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 903, __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, 903, __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_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":710 + /* "constraint/constraints.py":949 * * * class InSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are present in the given set. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 949, __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, 710, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 949, __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_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 949, __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, 710, __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_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_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 710, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_3 != __pyx_t_4) { - if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 949, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __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_4)) __PYX_ERR(0, 949, __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, 949, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":721 + /* "constraint/constraints.py":960 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_4 = __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[31])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 721, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __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[45])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 960, __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, 960, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":729 + /* "constraint/constraints.py":968 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * # preProcess() will remove it. * raise RuntimeError("Can't happen") */ - __pyx_t_4 = __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[32])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 729, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0]); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 729, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __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[46])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 968, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[0]); + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 968, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":733 + /* "constraint/constraints.py":972 * 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_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 733, __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, 733, __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, 733, __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, 733, __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, 733, __pyx_L1_error) - __pyx_t_2 = __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[33])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 733, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_2) < 0) __PYX_ERR(0, 733, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 972, __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, 972, __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, 972, __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, 972, __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, 972, __pyx_L1_error) + __pyx_t_6 = __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[47])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 972, __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, 972, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":710 + /* "constraint/constraints.py":949 * * * class InSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are present in the given set. * */ - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 710, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 949, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 949, __pyx_L1_error) __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/constraints.py":744 + /* "constraint/constraints.py":983 * * * class NotInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are not present in the given set. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 744, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 983, __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, 744, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __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_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 744, __pyx_L1_error) + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 983, __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, 744, __pyx_L1_error) + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __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_6)) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __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_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__pyx_t_3 != __pyx_t_5) { - if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 744, __pyx_L1_error) + if (__pyx_t_3 != __pyx_t_2) { + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 983, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":755 + /* "constraint/constraints.py":994 * """ * * 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[34])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 755, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(0, 755, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __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[48])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 994, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(0, 994, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":763 + /* "constraint/constraints.py":1002 * 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[35])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[0]); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 763, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __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[49])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[0]); + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_2) < 0) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":767 + /* "constraint/constraints.py":1006 * 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, 767, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1006, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1006, __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, 1006, __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, 1006, __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, 1006, __pyx_L1_error) + __pyx_t_5 = __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[50])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1006, __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, 767, __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, 767, __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, 767, __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, 767, __pyx_L1_error) - __pyx_t_4 = __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[36])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 767, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __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_6, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 1006, __pyx_L1_error) __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, 767, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":744 + /* "constraint/constraints.py":983 * * * class NotInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are not present in the given set. * */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 744, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 744, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 983, __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_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":778 + /* "constraint/constraints.py":1017 * * * 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_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 778, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1017, __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, 778, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1017, __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_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 778, __pyx_L1_error) + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1017, __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, 778, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __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_4)) __PYX_ERR(0, 778, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__pyx_t_3 != __pyx_t_6) { - if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 778, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1017, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __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_5)) __PYX_ERR(0, 1017, __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, 1017, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":789 + /* "constraint/constraints.py":1028 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * */ - __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[37])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 789, __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_init, __pyx_t_6) < 0) __PYX_ERR(0, 789, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_4 = __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[51])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1028, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[3]); + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 1028, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":803 + /* "constraint/constraints.py":1042 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * missing = 0 */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 803, __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, 803, __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, 803, __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, 803, __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[38])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[0]); - __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_call, __pyx_t_5) < 0) __PYX_ERR(0, 803, __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, 1042, __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, 1042, __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, 1042, __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, 1042, __pyx_L1_error) + __pyx_t_2 = __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[52])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1042, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[0]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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_2) < 0) __PYX_ERR(0, 1042, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":778 + /* "constraint/constraints.py":1017 * * * 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_2, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 778, __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, 778, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1017, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 1017, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":840 + /* "constraint/constraints.py":1079 * * * 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_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1079, __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, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1079, __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_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __pyx_L1_error) + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1079, __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, 840, __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_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, 840, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3 != __pyx_t_2) { - if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 840, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __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_2)) __PYX_ERR(0, 1079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (__pyx_t_3 != __pyx_t_6) { + if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 1079, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":851 + /* "constraint/constraints.py":1090 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_2 = __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[39])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[3]); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(0, 851, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __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[53])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1090, __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_init, __pyx_t_6) < 0) __PYX_ERR(0, 1090, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":865 + /* "constraint/constraints.py":1104 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * missing = 0 */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 865, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 865, __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, 865, __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, 865, __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[40])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[0]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 865, __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, 1104, __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, 1104, __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, 1104, __pyx_L1_error) + __pyx_t_4 = __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[54])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 1104, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":840 + /* "constraint/constraints.py":1079 * * * 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_6 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 1079, __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_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/constraints.py":1 @@ -25123,7 +33042,10 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_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 */ @@ -25135,6 +33057,11 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -25191,9 +33118,22 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_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_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_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_assignments, sizeof(__pyx_k_assignments), 0, 1, 1}, /* PyObject cname: __pyx_n_u_assignments */ @@ -25218,6 +33158,8 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_forwardCheck, sizeof(__pyx_k_forwardCheck), 0, 1, 1}, /* PyObject cname: __pyx_n_u_forwardCheck */ @@ -25249,6 +33191,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_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 */ @@ -25308,13 +33251,13 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, c 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, 198, __pyx_L1_error) - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 319, __pyx_L1_error) - __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_round); if (!__pyx_builtin_round) __PYX_ERR(0, 344, __pyx_L1_error) - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 490, __pyx_L1_error) - __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_max); if (!__pyx_builtin_max) __PYX_ERR(0, 503, __pyx_L1_error) - __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 508, __pyx_L1_error) - __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_min); if (!__pyx_builtin_min) __PYX_ERR(0, 513, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 731, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 305, __pyx_L1_error) + __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_round); if (!__pyx_builtin_round) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_max); if (!__pyx_builtin_max) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 409, __pyx_L1_error) + __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_min); if (!__pyx_builtin_min) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 970, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -25362,7 +33305,7 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { /* "constraint/constraints.py":288 * """ * - * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -25370,14 +33313,14 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); - /* "constraint/constraints.py":789 + /* "constraint/constraints.py":1028 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * */ - __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, 789, __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, 1028, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_RefNannyFinishContext(); @@ -25412,7 +33355,7 @@ static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { unsigned int num_kwonly_args : 1; unsigned int nlocals : 5; unsigned int flags : 10; - unsigned int first_line : 10; + unsigned int first_line : 11; unsigned int line_table_length : 13; } __Pyx_PyCode_New_function_description; /* NewCodeObj.proto */ @@ -25430,209 +33373,279 @@ 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), 307, 2}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_value}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 392, 2}; + 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 491, 2}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_m}; - __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__4, 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), 409, 2}; + 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 508, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 410, 2}; 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 509, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 539, 2}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 550, 2}; + 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), 613, 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; + } + { + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 709, 2}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 720, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_v}; - __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_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) 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_k_A, 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), 779, 2}; + 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 630, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 854, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_value}; - __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_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) 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_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 10, 20}; 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[5] = __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[5])) 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_call, __pyx_k_55H_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 35, 109}; 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[6] = __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[6])) 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_preProcess, __pyx_k_77JJeef_3a_Q_y_WAQ_q_4t1Kz_1_wb, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 63, 151}; 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[7] = __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[7])) goto bad; + __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_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[12])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 125, 25}; 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[8] = __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[8])) 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_init, __pyx_k_Zz_IQ_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 137, 142}; 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[9] = __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[9])) 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_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[14])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 193, 23}; 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[10] = __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[10])) goto bad; + __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_init, __pyx_k_U_A_IQ_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 197, 19}; 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[11] = __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[11])) 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_k_88XXY, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 212, 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_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[12] = __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[12])) 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_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[17])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 250, 160}; 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[13] = __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[13])) 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_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[18])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 288, 27}; - 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[14] = __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[14])) goto bad; + 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[19] = __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[19])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 300, 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[15] = __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[15])) goto bad; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 300, 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[20] = __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[20])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 335, 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[16] = __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[16])) goto bad; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 317, 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[21] = __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[21])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 376, 86}; + 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[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_M_N_L_A_1_3a_Cs_Rs_J_b_3c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 395, 220}; + 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[23] = __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[23])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 417, 347}; + 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[24] = __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[24])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 480, 27}; + 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[25] = __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[25])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 492, 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[26] = __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[26])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 523, 86}; + 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_M_N_L_A_1_3a_Cs_Rs_J_b_3c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 542, 114}; + 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[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_4q_t1_S_A_IV1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 555, 184}; + 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[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_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 387, 27}; - 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[17] = __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[17])) goto bad; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 594, 27}; + 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[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; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 399, 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[18] = __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[18])) goto bad; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 606, 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[31] = __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[31])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 416, 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[19] = __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[19])) goto bad; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 641, 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[32] = __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[32])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 475, 86}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 693, 86}; 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[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_M_N_L_A_1_3a_Cs_Rs_J_b_3c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad; + __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_init, __pyx_k_M_N_L_A_1_3a_Cs_Rs_J_b_3c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 494, 220}; - 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[21] = __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[21])) goto bad; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 712, 114}; + 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[34] = __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[34])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 516, 347}; - 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[22] = __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[22])) goto bad; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 725, 184}; + 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[35] = __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[35])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 579, 27}; - 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[23] = __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[23])) goto bad; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 764, 14}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exactprod}; + __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_init, __pyx_k_N, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 591, 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[24] = __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[24])) goto bad; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 772, 216}; + 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[37] = __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[37])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 800, 228}; + 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[38] = __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_4q_QfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[38])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 615, 14}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 839, 14}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_maxprod}; - __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_k_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad; + __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_init, __pyx_k_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 623, 192}; - 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_lt1, __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[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_QfKy_Q_1_A_L_gQ_Cq_WA_A, 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), 847, 216}; + 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[40] = __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[40])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 650, 164}; - 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_variable, __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_k_55H_a_a_q_L_y_1_1A_QfA_5_q_5_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 875, 220}; + 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[41] = __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_4q_QfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 675, 14}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 914, 14}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_minprod}; - __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_k_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) 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_init, __pyx_k_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 683, 92}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 922, 92}; 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[29] = __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[29])) 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_preProcess, __pyx_k_77JJeef_QfKy_Q_a_L_WAQ_q_6_Bd_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 694, 95}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 933, 95}; 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[30] = __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[30])) 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_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[44])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 721, 11}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 960, 11}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set}; - __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_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad; + __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_init, __pyx_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 729, 14}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 968, 14}; 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[32] = __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[32])) 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_call, __pyx_k_8_l_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[46])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 733, 91}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 972, 91}; 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[33] = __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[33])) 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_preProcess, __pyx_k_77JJeef_d_L_WAQ_q_6_6_7_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[47])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 755, 11}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 994, 11}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set}; - __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_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) 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_init, __pyx_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 763, 14}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1002, 14}; 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[35] = __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[35])) 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_call, __pyx_k_8_l_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[49])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 767, 91}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1006, 91}; 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[36] = __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[36])) goto bad; + __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_d_L_WAQ_q_6_A_6_7_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[50])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 789, 30}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1028, 30}; 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[37] = __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[37])) 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_k_E_HA_F_Ja, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[51])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 803, 249}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1042, 249}; 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[38] = __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[38])) 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_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[52])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 851, 30}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1090, 30}; 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[39] = __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[39])) 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_init, __pyx_k_E_HA_F_Ja, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[53])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 865, 249}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1104, 249}; 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[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_L_y_1_AZwa_1_1_t1_5_c_W, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) 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_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[54])) goto bad; } Py_DECREF(tuple_dedup_map); return 0; @@ -27932,6 +35945,68 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( return 1; } +/* PyDictVersioning */ +#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; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!__pyx_m)) { + if (!PyErr_Occurred()) + PyErr_SetNone(PyExc_NameError); + return NULL; + } + result = PyObject_GetAttr(__pyx_m, name); + if (likely(result)) { + return result; + } + PyErr_Clear(); +#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear(); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return result; + } +#else + result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + /* RaiseUnboundLocalError */ static void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); @@ -28070,68 +36145,6 @@ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { PyErr_SetObject(PyExc_RuntimeError, new_exc); } -/* PyDictVersioning */ -#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; - return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; -} -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { - PyObject **dictptr = NULL; - Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; - if (offset) { -#if CYTHON_COMPILING_IN_CPYTHON - dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); -#else - dictptr = _PyObject_GetDictPtr(obj); -#endif - } - return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; -} -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) - return 0; - return obj_dict_version == __Pyx_get_object_dict_version(obj); -} -#endif - -/* GetModuleGlobalName */ -#if CYTHON_USE_DICT_VERSIONS -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) -#else -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) -#endif -{ - PyObject *result; -#if CYTHON_COMPILING_IN_LIMITED_API - if (unlikely(!__pyx_m)) { - if (!PyErr_Occurred()) - PyErr_SetNone(PyExc_NameError); - return NULL; - } - result = PyObject_GetAttr(__pyx_m, name); - if (likely(result)) { - return result; - } - PyErr_Clear(); -#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear(); - __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return result; - } -#else - result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } - PyErr_Clear(); -#endif - return __Pyx_GetBuiltinName(name); -} - /* PyLongCompare */ static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); @@ -28248,6 +36261,108 @@ static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { } #endif +/* PyObjectCallMethod1 */ +#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000) +static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { + PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); + Py_DECREF(method); + return result; +} +#endif +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { +#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + 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); +#else + PyObject *method = NULL, *result; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_Call2Args(method, obj, arg); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) return NULL; + return __Pyx__PyObject_CallMethod1(method, arg); +#endif +} + +/* append */ +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + if (likely(PyList_CheckExact(L))) { + if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; + } else { + PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_mstate_global->__pyx_n_u_append, x); + if (unlikely(!retval)) + return -1; + Py_DECREF(retval); + } + return 0; +} + +/* PyLongCompare */ +static CYTHON_INLINE int __Pyx_PyLong_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_UNUSED_VAR(inplace); + if (op1 == op2) { + return 0; + } + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + int unequal; + unsigned long uintval; + Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); + const digit* digits = __Pyx_PyLong_Digits(op1); + if (intval == 0) { + return (__Pyx_PyLong_IsZero(op1) != 1); + } else if (intval < 0) { + if (__Pyx_PyLong_IsNonNeg(op1)) + return 1; + intval = -intval; + } else { + if (__Pyx_PyLong_IsNeg(op1)) + return 1; + } + uintval = (unsigned long) intval; +#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 4)) { + unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 3)) { + unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 2)) { + unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 1)) { + unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif + unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); + return (unequal != 0); + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = __Pyx_PyFloat_AS_DOUBLE(op1); + return ((double)a != (double)b); + } + return __Pyx_PyObject_IsTrueAndDecref( + PyObject_RichCompare(op1, op2, Py_NE)); +} + /* CallTypeTraverse */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #else @@ -31281,34 +39396,6 @@ static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) { #endif } -/* PyObjectCallMethod1 */ -#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000) -static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { - PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); - Py_DECREF(method); - return result; -} -#endif -static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { -#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000 - 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); -#else - PyObject *method = NULL, *result; - int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); - if (likely(is_method)) { - result = __Pyx_PyObject_Call2Args(method, obj, arg); - Py_DECREF(method); - return result; - } - if (unlikely(!method)) return NULL; - return __Pyx__PyObject_CallMethod1(method, arg); -#endif -} - /* ReturnWithStopIteration */ static void __Pyx__ReturnWithStopIteration(PyObject* value, int async); static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext) { diff --git a/constraint/parser.c b/constraint/parser.c index 7bb7a00..03e0f45 100644 --- a/constraint/parser.c +++ b/constraint/parser.c @@ -1500,11 +1500,15 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr; -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint; +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr; 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_to_equality_constraint; +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr; +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr; -/* "constraint/parser.py":24 +/* "constraint/parser.py":27 * ) * * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< @@ -1514,11 +1518,12 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr; struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions { PyObject_HEAD PyObject *__pyx_v_params_used; + PyObject *__pyx_v_regex_match_variable; PyObject *__pyx_v_tune_params; }; -/* "constraint/parser.py":72 +/* "constraint/parser.py":75 * return split_restrictions * * def to_numeric_constraint( # <<<<<<<<<<<<<< @@ -1527,17 +1532,22 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions { */ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint { PyObject_HEAD + struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *__pyx_outer_scope; + PyObject *__pyx_v_left; PyObject *__pyx_v_operator; PyObject *__pyx_v_params; + PyObject *__pyx_v_right; + PyObject *__pyx_v_supported_operators; + PyObject *__pyx_v_variable_supported_operators; }; -/* "constraint/parser.py":84 +/* "constraint/parser.py":87 * * # split the string on the comparison and remove leading and trailing whitespace * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< * - * # find out which side is the constant number + * # if we have an inverse operation, rewrite to the other side */ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr { PyObject_HEAD @@ -1549,14 +1559,76 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr { }; -/* "constraint/parser.py":104 - * variable_supported_operators = ['+'] +/* "constraint/parser.py":91 + * # if we have an inverse operation, rewrite to the other side + * supported_operators = ["**", "*", "+", "-", "/"] + * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) # <<<<<<<<<<<<<< + * unique_operators_right = set(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" +*/ +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_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_s; +}; + + +/* "constraint/parser.py":92 + * supported_operators = ["**", "*", "+", "-", "/"] + * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) + * unique_operators_right = set(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" + * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: +*/ +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_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_s; +}; + + +/* "constraint/parser.py":130 + * + * # we have a potentially rewritten restriction, split again + * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< + * + * # find out which side is the constant number +*/ +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr { + PyObject_HEAD + PyObject *__pyx_genexpr_arg_0; + PyObject *__pyx_genexpr_arg_1; + PyObject *__pyx_v_s; + PyObject *__pyx_t_0; + Py_ssize_t __pyx_t_1; +}; + + +/* "constraint/parser.py":151 * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] - * if all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # <<<<<<<<<<<<<< + * # find all unique variable_supported_operators in the restriction, can have at most one + * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) # <<<<<<<<<<<<<< + * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None + * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 +*/ +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_s; +}; + + +/* "constraint/parser.py":153 + * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) + * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None + * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 # <<<<<<<<<<<<<< * variables_on_left = len(right) == 1 - * if comparator == "==": + * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_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; @@ -1564,14 +1636,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr { }; -/* "constraint/parser.py":159 +/* "constraint/parser.py":211 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< - * # if the operator is inconsistent (e.g. 'x + y * z == 3'), return None + * # 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_4_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; @@ -1579,14 +1651,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr { }; -/* "constraint/parser.py":166 +/* "constraint/parser.py":218 * 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_5_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; @@ -1594,43 +1666,43 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr { }; -/* "constraint/parser.py":187 +/* "constraint/parser.py":241 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint { +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_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":206 +/* "constraint/parser.py":260 * 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_7_genexpr { +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr { PyObject_HEAD - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint *__pyx_outer_scope; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_s; }; -/* "constraint/parser.py":216 +/* "constraint/parser.py":270 * * # 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] */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr { +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_r; @@ -2202,6 +2274,48 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); +/* PyObjectCall2Args.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* CallUnboundCMethod1.proto */ +CYTHON_UNUSED +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#else +#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) +#endif + +/* PyObjectCallNoArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); + +/* pyfrozenset_new.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it); + +/* PySetContains.proto */ +static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq); + +/* PyObjectFormatSimple.proto */ +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + PyObject_Format(s, f)) +#elif CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\ + likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\ + PyObject_Format(s, f)) +#else + #define __Pyx_PyObject_FormatSimple(s, f) (\ + likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ + PyObject_Format(s, f)) +#endif + +/* JoinPyUnicode.proto */ +static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, + Py_UCS4 max_char); + /* FixUpExtensionType.proto */ static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); @@ -2328,41 +2442,18 @@ 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); - -/* PyObjectFormatSimple.proto */ -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyObject_FormatSimple(s, f) (\ - likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ - PyObject_Format(s, f)) -#elif CYTHON_USE_TYPE_SLOTS - #define __Pyx_PyObject_FormatSimple(s, f) (\ - likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ - likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\ - likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\ - PyObject_Format(s, f)) -#else - #define __Pyx_PyObject_FormatSimple(s, f) (\ - likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ - PyObject_Format(s, f)) +/* IterNextPlain.proto */ +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 -/* PyObjectCall2Args.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); - -/* CallUnboundCMethod1.proto */ -CYTHON_UNUSED -static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); -#else -#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) -#endif +/* IterNext.proto */ +#define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL) +static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *); -/* JoinPyUnicode.proto */ -static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, - Py_UCS4 max_char); +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); @@ -2376,9 +2467,6 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* Globals.proto */ static PyObject* __Pyx_Globals(void); -/* PyObjectCallNoArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); - /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); @@ -2520,12 +2608,6 @@ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject * static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif -/* IterNextPlain.proto */ -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 */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); @@ -2687,10 +2769,12 @@ static PyObject *__pyx_builtin_compile; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "']]"; static const char __pyx_k_1[] = "\2401"; -static const char __pyx_k_Q[] = "\230Q"; +static const char __pyx_k_A[] = "\250A"; +static const char __pyx_k_Q[] = "\220Q"; 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_q[] = "\240q"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_s[] = "s"; static const char __pyx_k__2[] = "<="; @@ -2699,26 +2783,30 @@ 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__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_Q_2[] = "\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[] = " \n"; -static const char __pyx_k__21[] = "."; -static const char __pyx_k__22[] = "?"; -static const char __pyx_k__23[] = "\270!"; +static const char __pyx_k_1_2[] = "\2501"; +static const char __pyx_k_A_2[] = "\270A"; +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[] = "\270!"; static const char __pyx_k_and[] = " and "; static const char __pyx_k_end[] = "end"; static const char __pyx_k_key[] = "key"; @@ -2750,6 +2838,7 @@ 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"; @@ -2757,6 +2846,7 @@ static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_number[] = "number"; 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"; @@ -2777,6 +2867,7 @@ static const char __pyx_k_return_2[] = "): return "; 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"; @@ -2788,6 +2879,7 @@ 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_code_object[] = "code_object"; static const char __pyx_k_comparators[] = "comparators"; @@ -2804,14 +2896,17 @@ static const char __pyx_k_XQ_Qa_z_5_q_q[] = "\320\010%\240X\250Q\330\014\r\340\0 static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_number_is_int[] = "number_is_int"; static const char __pyx_k_AssertionError[] = "AssertionError"; +static const char __pyx_k_left_remainder[] = "left_remainder"; static const char __pyx_k_replace_params[] = "replace_params"; static const char __pyx_k_operators_found[] = "operators_found"; +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"; @@ -2828,10 +2923,12 @@ 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"; @@ -2840,25 +2937,30 @@ 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_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_VariableExactSumConstraint[] = "VariableExactSumConstraint"; 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_swapped_side_first_variable[] = "swapped_side_first_variable"; static const char __pyx_k_CompilableFunctionConstraint[] = "CompilableFunctionConstraint"; static const char __pyx_k_variable_supported_operators[] = "variable_supported_operators"; 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, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]"; 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_Q2_U_b_U_6_Q_q_t4uA_d_4y_a[] = "\320\000%\320%=\270Y\300a\360\006\000\005\034\2301\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\360b\003\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_Ya_1_Q2_U_H_U_6_Q_q_t4uA_d_4y_a[] = "\320\000%\320%=\270Y\300a\360\006\000\005\034\2301\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\360H\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_A_avV6_a_Bhas_q_a_3a_Q_1_aq_he81[] = "\200A\330\025\"\240!\330\t\n\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#\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\250A\330\014\030\230\001\230\021\230&\240\003\2404\240u\250D\260\001\260\025\260b\270\007\270s\300\"\300G\3101\330\014\035\320\035;\2705\300\003\3001\300F\310#\310R\310s\320RU\320UV\320V]\320]`\320`a\330\020$\240C\240q\250\007\250s\260!\330\020\023\220;\230c\240\021\340\024\027\220q\330\030\037\320\0379\270\021\270)\3002\300T\310\031\320RU\320UV\340\030\037\320\0379\270\021\270)\3001\300D\310\t\320QR\320RS\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\031\230\n\240!\2408\2501\330\010\013\2101\330\014\017\210{\230#\230Q\330\020\023\2201\340\024\036\230a\360\006\000\025\037\230a\330\021\034\230C\230q\330\020\023\2201\340\024\036\230a\360\006\000\025\037\230a\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\240D\250\013\2603\260d\270$\270a\330\020\027\320\027'\240q\250\013\3203J\320JZ\320Z[\320[\\\330\021\034\230C\230u\240D\250\013\2603\260d\270$\270a\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\025\240d\250+\260S\270\004\270D\300\001\330\024\033\320\033,\250A\250[\3208O\320O`\320`a\320ab\330\025 \240\003\2405\250\004\250K\260s\270$\270d\300!\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\004\250K\260s\270$\270d\300!\330\024\033\320\033+\2501\250K\3207N\320N^\320^_\320_`\330\025 \240\003\2405\250\004\250K\260s\270$\270d\300!\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_avV6_a_Bhas_q_a_3a_Q_1_aq_he81[] = "\200A\330\025\"\240!\330\t\n\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#\2408\2501\330\010$\240H\250A\340\010\013\2103\210a\320\017&\240b\250\002\250$\250c\260\021\3202J\310\"\310A\340\014\023\2201\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*\250\"\250G\2601\3204J\310(\320Ri\320ij\330\014\017\320\017+\2503\250a\340\020\027\220q\340\020.\320.I\310\026\310q\320PQ\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(E\300\\\320QX\320XY\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(E\300\\\320QX\320XY\360\006\000\r\023\220(\230%\230x\240q\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\250A\330\014\030\230\001\230\021\230&\240\003\2404\240u\250D\260\001\260\025\260b\270\007\270s\300\"\300G\3101\340\014\"\240(\250!\340\014\017\210s\220!\320\023%\240S\250\002\320*<\320__pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint); - Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr); + 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_to_equality_constraint); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint); + 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_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_12_genexpr); for (int i=0; i<4; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); } - for (int i=0; i<2; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } - for (int i=0; i<14; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<175; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<4; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } + for (int i=0; i<18; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<191; ++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); @@ -3298,16 +3461,24 @@ 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_4_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint); - Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr); + 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_to_equality_constraint); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint); + 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_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_12_genexpr); for (int i=0; i<4; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); } - for (int i=0; i<2; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } - for (int i=0; i<14; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<175; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<4; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } + for (int i=0; i<18; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<191; ++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); @@ -3316,7 +3487,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void #endif /* #### Code section: module_code ### */ -/* "constraint/parser.py":24 +/* "constraint/parser.py":27 * ) * * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< @@ -3365,39 +3536,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, 24, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 27, __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, 27, __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, 27, __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, 24, __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, 27, __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, 24, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("parse_restrictions", 1, 2, 2, i); __PYX_ERR(0, 27, __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, 24, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 27, __pyx_L3_error) 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, 27, __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, 24, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("parse_restrictions", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 27, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3408,8 +3579,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, 24, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tune_params), (&PyDict_Type), 0, "tune_params", 2))) __PYX_ERR(0, 24, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restrictions), (&PyList_Type), 0, "restrictions", 2))) __PYX_ERR(0, 27, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tune_params), (&PyDict_Type), 0, "tune_params", 2))) __PYX_ERR(0, 27, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_parse_restrictions(__pyx_self, __pyx_v_restrictions, __pyx_v_tune_params); /* function exit code */ @@ -3429,7 +3600,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "constraint/parser.py":29 +/* "constraint/parser.py":32 * regex_match_variable = r"([a-zA-Z_$][a-zA-Z_$0-9]*)" * * def replace_params(match_object): # <<<<<<<<<<<<<< @@ -3476,32 +3647,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, 29, __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 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 29, __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, "replace_params", 0) < 0) __PYX_ERR(0, 29, __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, 32, __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, 29, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("replace_params", 1, 1, 1, i); __PYX_ERR(0, 32, __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, 29, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 32, __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, 29, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("replace_params", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 32, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3540,7 +3711,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":30 + /* "constraint/parser.py":33 * * def replace_params(match_object): * key = match_object.group(1) # <<<<<<<<<<<<<< @@ -3554,40 +3725,40 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para 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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_key = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":31 + /* "constraint/parser.py":34 * 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, 31, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 34, __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, 31, __pyx_L1_error) + __PYX_ERR(0, 34, __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, 31, __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, 34, __pyx_L1_error) if (__pyx_t_4) { - /* "constraint/parser.py":32 + /* "constraint/parser.py":35 * 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, 32, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_param = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":33 + /* "constraint/parser.py":36 * if key in tune_params: * param = str(key) * return "params[params_index['" + param + "']]" # <<<<<<<<<<<<<< @@ -3595,16 +3766,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, 33, __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, 36, __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, 33, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __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":31 + /* "constraint/parser.py":34 * def replace_params(match_object): * key = match_object.group(1) * if key in tune_params: # <<<<<<<<<<<<<< @@ -3613,7 +3784,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para */ } - /* "constraint/parser.py":35 + /* "constraint/parser.py":38 * return "params[params_index['" + param + "']]" * else: * return key # <<<<<<<<<<<<<< @@ -3627,7 +3798,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para goto __pyx_L0; } - /* "constraint/parser.py":29 + /* "constraint/parser.py":32 * regex_match_variable = r"([a-zA-Z_$][a-zA-Z_$0-9]*)" * * def replace_params(match_object): # <<<<<<<<<<<<<< @@ -3649,7 +3820,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para return __pyx_r; } -/* "constraint/parser.py":37 +/* "constraint/parser.py":40 * return key * * def replace_params_split(match_object): # <<<<<<<<<<<<<< @@ -3696,32 +3867,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, 37, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 40, __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, 37, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 40, __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, 37, __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, 40, __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, 37, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("replace_params_split", 1, 1, 1, i); __PYX_ERR(0, 40, __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, 37, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 40, __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, 37, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("replace_params_split", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 40, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3761,7 +3932,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":39 + /* "constraint/parser.py":42 * def replace_params_split(match_object): * # careful: has side-effect of adding to set `params_used` * key = match_object.group(1) # <<<<<<<<<<<<<< @@ -3775,54 +3946,54 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par 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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_key = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":40 + /* "constraint/parser.py":43 * # 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, 40, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 43, __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, 40, __pyx_L1_error) + __PYX_ERR(0, 43, __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) + __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, 43, __pyx_L1_error) if (__pyx_t_4) { - /* "constraint/parser.py":41 + /* "constraint/parser.py":44 * 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, 41, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_param = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":42 + /* "constraint/parser.py":45 * 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, 42, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_v_params_used)) { __Pyx_RaiseClosureNameError("params_used"); __PYX_ERR(0, 45, __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, 42, __pyx_L1_error) + __PYX_ERR(0, 45, __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, 42, __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, 45, __pyx_L1_error) - /* "constraint/parser.py":43 + /* "constraint/parser.py":46 * param = str(key) * params_used.add(param) * return param # <<<<<<<<<<<<<< @@ -3834,7 +4005,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par __pyx_r = __pyx_v_param; goto __pyx_L0; - /* "constraint/parser.py":40 + /* "constraint/parser.py":43 * # careful: has side-effect of adding to set `params_used` * key = match_object.group(1) * if key in tune_params: # <<<<<<<<<<<<<< @@ -3843,7 +4014,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par */ } - /* "constraint/parser.py":45 + /* "constraint/parser.py":48 * return param * else: * return key # <<<<<<<<<<<<<< @@ -3857,7 +4028,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par goto __pyx_L0; } - /* "constraint/parser.py":37 + /* "constraint/parser.py":40 * return key * * def replace_params_split(match_object): # <<<<<<<<<<<<<< @@ -3879,7 +4050,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par return __pyx_r; } -/* "constraint/parser.py":47 +/* "constraint/parser.py":50 * return key * * def to_multiple_restrictions(restrictions: list[str]) -> list[str]: # <<<<<<<<<<<<<< @@ -3927,32 +4098,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, 47, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 50, __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, 47, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 50, __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, 47, __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, 50, __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, 47, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_multiple_restrictions", 1, 1, 1, i); __PYX_ERR(0, 50, __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, 47, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 50, __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, 47, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("to_multiple_restrictions", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 50, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3963,7 +4134,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, 47, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restrictions), (&PyList_Type), 0, "restrictions", 2))) __PYX_ERR(0, 50, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple_restrictions(__pyx_self, __pyx_v_restrictions); /* function exit code */ @@ -4014,19 +4185,19 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple int __pyx_clineno = 0; __Pyx_RefNannySetupContext("to_multiple_restrictions", 0); - /* "constraint/parser.py":49 + /* "constraint/parser.py":52 * 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, 49, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_split_restrictions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":50 + /* "constraint/parser.py":53 * """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: # <<<<<<<<<<<<<< @@ -4039,45 +4210,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, 50, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 53, __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, 50, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":52 + /* "constraint/parser.py":55 * 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, 52, __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, 55, __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, 52, __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, 55, __pyx_L1_error) __pyx_t_4 = __pyx_t_5; __pyx_L6_bool_binop_done:; if (__pyx_t_4) { - /* "constraint/parser.py":53 + /* "constraint/parser.py":56 * # 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, 53, __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, 56, __pyx_L1_error) - /* "constraint/parser.py":54 + /* "constraint/parser.py":57 * if " and " in res or " or " in res: * split_restrictions.append(res) * continue # <<<<<<<<<<<<<< @@ -4086,7 +4257,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple */ goto __pyx_L3_continue; - /* "constraint/parser.py":52 + /* "constraint/parser.py":55 * for res in restrictions: * # if there are logic chains in the restriction, skip splitting further * if " and " in res or " or " in res: # <<<<<<<<<<<<<< @@ -4095,31 +4266,31 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple */ } - /* "constraint/parser.py":56 + /* "constraint/parser.py":59 * 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, 56, __pyx_L1_error) + __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __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, 56, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_mstate_global->__pyx_kp_u__2) != (0)) __PYX_ERR(0, 59, __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, 56, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_kp_u__3) != (0)) __PYX_ERR(0, 59, __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, 56, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_mstate_global->__pyx_kp_u__4) != (0)) __PYX_ERR(0, 59, __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, 56, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_mstate_global->__pyx_kp_u__5) != (0)) __PYX_ERR(0, 59, __pyx_L1_error); __Pyx_XDECREF_SET(__pyx_v_comparators, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "constraint/parser.py":57 + /* "constraint/parser.py":60 * # find the indices of splittable comparators * comparators = ["<=", ">=", ">", "<"] * comparators_indices = [(m.start(0), m.end(0)) for m in re.finditer("|".join(comparators), res)] # <<<<<<<<<<<<<< @@ -4127,15 +4298,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, 57, __pyx_L10_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __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, 57, __pyx_L10_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __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, 57, __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, 60, __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, 57, __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, 60, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS @@ -4155,7 +4326,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __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, 57, __pyx_L10_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); } if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { @@ -4163,9 +4334,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, 57, __pyx_L10_error) + __pyx_t_12 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __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, 57, __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, 60, __pyx_L10_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { @@ -4174,7 +4345,7 @@ 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, 57, __pyx_L10_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 60, __pyx_L10_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -4184,7 +4355,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple { 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, 57, __pyx_L10_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 60, __pyx_L10_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -4195,13 +4366,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 57, __pyx_L10_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __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, 57, __pyx_L10_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 60, __pyx_L10_error) PyErr_Clear(); } break; @@ -4217,7 +4388,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple 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_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 57, __pyx_L10_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_8 = __pyx_7genexpr__pyx_v_m; @@ -4227,18 +4398,18 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 57, __pyx_L10_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); } - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 57, __pyx_L10_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 60, __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, 57, __pyx_L10_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 60, __pyx_L10_error); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 57, __pyx_L10_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 60, __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, 57, __pyx_L10_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 60, __pyx_L10_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -4252,27 +4423,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":58 + /* "constraint/parser.py":61 * 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, 58, __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, 61, __pyx_L1_error) __pyx_t_4 = (__pyx_t_12 <= 1); if (__pyx_t_4) { - /* "constraint/parser.py":60 + /* "constraint/parser.py":63 * 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, 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, 63, __pyx_L1_error) - /* "constraint/parser.py":61 + /* "constraint/parser.py":64 * # this can't be split further * split_restrictions.append(res) * continue # <<<<<<<<<<<<<< @@ -4281,7 +4452,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple */ goto __pyx_L3_continue; - /* "constraint/parser.py":58 + /* "constraint/parser.py":61 * comparators = ["<=", ">=", ">", "<"] * comparators_indices = [(m.start(0), m.end(0)) for m in re.finditer("|".join(comparators), res)] * if len(comparators_indices) <= 1: # <<<<<<<<<<<<<< @@ -4290,7 +4461,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple */ } - /* "constraint/parser.py":63 + /* "constraint/parser.py":66 * continue * # split the restrictions from the previous to the next comparator * for index in range(len(comparators_indices)): # <<<<<<<<<<<<<< @@ -4300,8 +4471,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __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, 63, __pyx_L1_error) - __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 63, __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, 66, __pyx_L1_error) + __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = 1; { @@ -4310,7 +4481,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __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, 63, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { @@ -4318,9 +4489,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_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __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, 63, __pyx_L1_error) + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 66, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -4329,7 +4500,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple { 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, 63, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 66, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -4339,7 +4510,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple { 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, 63, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 66, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -4350,13 +4521,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __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, 63, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 66, __pyx_L1_error) PyErr_Clear(); } break; @@ -4366,7 +4537,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":64 + /* "constraint/parser.py":67 * # split the restrictions from the previous to the next comparator * for index in range(len(comparators_indices)): * temp_copy = res # <<<<<<<<<<<<<< @@ -4376,26 +4547,26 @@ 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":65 + /* "constraint/parser.py":68 * 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, 65, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 65, __pyx_L1_error) + __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, 68, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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, 65, __pyx_L1_error) + __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, 68, __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, 65, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_comparators_indices, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 68, __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); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_10, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 68, __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, 65, __pyx_L1_error) + __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, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_3 = __pyx_t_10; @@ -4407,34 +4578,34 @@ 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":67 + /* "constraint/parser.py":70 * 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, 67, __pyx_L1_error) - __pyx_t_10 = PyLong_FromSsize_t((__pyx_t_14 - 1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_GET_SIZE(__pyx_v_comparators_indices); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_10 = PyLong_FromSsize_t((__pyx_t_14 - 1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 70, __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, 67, __pyx_L1_error) + __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, 70, __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, 67, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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, 67, __pyx_L1_error) + __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, 70, __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, 67, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_comparators_indices, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 70, __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); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 70, __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_t_14 = PyObject_Length(__pyx_v_temp_copy); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 67, __pyx_L1_error) - __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_14 = PyObject_Length(__pyx_v_temp_copy); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = __pyx_t_9; __pyx_t_9 = 0; @@ -4442,14 +4613,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __Pyx_XDECREF_SET(__pyx_v_next_stop, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":69 + /* "constraint/parser.py":72 * 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, 69, __pyx_L1_error) + __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, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = __pyx_t_10; __Pyx_INCREF(__pyx_t_9); @@ -4459,13 +4630,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __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, 69, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __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, 69, __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, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":63 + /* "constraint/parser.py":66 * continue * # split the restrictions from the previous to the next comparator * for index in range(len(comparators_indices)): # <<<<<<<<<<<<<< @@ -4475,7 +4646,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/parser.py":50 + /* "constraint/parser.py":53 * """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: # <<<<<<<<<<<<<< @@ -4486,7 +4657,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":70 + /* "constraint/parser.py":73 * ) * split_restrictions.append(temp_copy[prev_stop:next_stop].strip()) * return split_restrictions # <<<<<<<<<<<<<< @@ -4498,7 +4669,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __pyx_r = __pyx_v_split_restrictions; goto __pyx_L0; - /* "constraint/parser.py":47 + /* "constraint/parser.py":50 * return key * * def to_multiple_restrictions(restrictions: list[str]) -> list[str]: # <<<<<<<<<<<<<< @@ -4531,7 +4702,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple return __pyx_r; } -/* "constraint/parser.py":72 +/* "constraint/parser.py":75 * return split_restrictions * * def to_numeric_constraint( # <<<<<<<<<<<<<< @@ -4580,39 +4751,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, 72, __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 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 72, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 75, __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, 72, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 75, __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, 72, __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, 75, __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, 72, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_numeric_constraint", 1, 2, 2, i); __PYX_ERR(0, 75, __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, 72, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 75, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 72, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 75, __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, 72, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("to_numeric_constraint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 75, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4623,8 +4794,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, 73, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 73, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restriction), (&PyUnicode_Type), 0, "restriction", 2))) __PYX_ERR(0, 76, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 76, __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 */ @@ -4644,7 +4815,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "constraint/parser.py":87 +/* "constraint/parser.py":133 * * # find out which side is the constant number * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< @@ -4691,32 +4862,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { 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, 87, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 133, __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, 87, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 133, __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, 87, __pyx_L3_error) + 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, 133, __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, 87, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("is_or_evals_to_number", 1, 1, 1, i); __PYX_ERR(0, 133, __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, 87, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 133, __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, 87, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("is_or_evals_to_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 133, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4727,7 +4898,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __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, 87, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_s), (&PyUnicode_Type), 0, "s", 2))) __PYX_ERR(0, 133, __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 */ @@ -4768,7 +4939,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_or_evals_to_number", 0); - /* "constraint/parser.py":88 + /* "constraint/parser.py":134 * # find out which side is the constant number * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: * try: # <<<<<<<<<<<<<< @@ -4784,7 +4955,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "constraint/parser.py":90 + /* "constraint/parser.py":136 * try: * # check if it's a number or solvable to a number (e.g. '32*2') * number = eval(s) # <<<<<<<<<<<<<< @@ -4794,15 +4965,15 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __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, 90, __pyx_L3_error) + __pyx_t_7 = __Pyx_Globals(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 136, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 90, __pyx_L3_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 136, __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, 90, __pyx_L3_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_number, __pyx_v_number) < 0) __PYX_ERR(0, 136, __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, 90, __pyx_L3_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_s, __pyx_v_s) < 0) __PYX_ERR(0, 136, __pyx_L3_error) } __pyx_t_9 = 1; { @@ -4812,13 +4983,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __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, 90, __pyx_L3_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_number = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/parser.py":91 + /* "constraint/parser.py":137 * # check if it's a number or solvable to a number (e.g. '32*2') * number = eval(s) * assert isinstance(number, (int, float)) # <<<<<<<<<<<<<< @@ -4838,14 +5009,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_L9_bool_binop_done:; if (unlikely(!__pyx_t_10)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 91, __pyx_L3_error) + __PYX_ERR(0, 137, __pyx_L3_error) } } #else - if ((1)); else __PYX_ERR(0, 91, __pyx_L3_error) + if ((1)); else __PYX_ERR(0, 137, __pyx_L3_error) #endif - /* "constraint/parser.py":92 + /* "constraint/parser.py":138 * number = eval(s) * assert isinstance(number, (int, float)) * return number # <<<<<<<<<<<<<< @@ -4857,7 +5028,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_r = __pyx_v_number; goto __pyx_L7_try_return; - /* "constraint/parser.py":88 + /* "constraint/parser.py":134 * # find out which side is the constant number * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: * try: # <<<<<<<<<<<<<< @@ -4872,7 +5043,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/parser.py":93 + /* "constraint/parser.py":139 * assert isinstance(number, (int, float)) * return number * except Exception: # <<<<<<<<<<<<<< @@ -4883,12 +5054,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric if (__pyx_t_12) { __Pyx_ErrRestore(0,0,0); - /* "constraint/parser.py":95 + /* "constraint/parser.py":141 * 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 + * # 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); @@ -4896,7 +5067,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric } goto __pyx_L5_except_error; - /* "constraint/parser.py":88 + /* "constraint/parser.py":134 * # find out which side is the constant number * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: * try: # <<<<<<<<<<<<<< @@ -4923,7 +5094,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric goto __pyx_L0; } - /* "constraint/parser.py":87 + /* "constraint/parser.py":133 * * # find out which side is the constant number * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< @@ -4948,12 +5119,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric } 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 */ -/* "constraint/parser.py":84 +/* "constraint/parser.py":87 * * # split the string on the comparison and remove leading and trailing whitespace * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< * - * # find out which side is the constant number + * # if we have an inverse operation, rewrite to the other side */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_2genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0, PyObject *__pyx_genexpr_arg_1) { @@ -4968,7 +5139,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_2_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 84, __pyx_L1_error) + __PYX_ERR(0, 87, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -4979,7 +5150,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_4generator, ((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_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[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, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5019,11 +5190,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __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, 84, __pyx_L1_error) + __PYX_ERR(0, 87, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 84, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 84, __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, 84, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 87, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 87, __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, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -5032,13 +5203,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 84, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 87, __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, 84, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __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); @@ -5051,7 +5222,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_r = __pyx_t_1; @@ -5070,7 +5241,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_2); __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 84, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 87, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -5098,12 +5269,12 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":104 - * variable_supported_operators = ['+'] - * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] - * if all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # <<<<<<<<<<<<<< - * variables_on_left = len(right) == 1 - * if comparator == "==": +/* "constraint/parser.py":91 + * # if we have an inverse operation, rewrite to the other side + * supported_operators = ["**", "*", "+", "-", "/"] + * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) # <<<<<<<<<<<<<< + * unique_operators_right = set(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" */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_5genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { @@ -5118,7 +5289,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_3_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 104, __pyx_L1_error) + __PYX_ERR(0, 91, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5129,7 +5300,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_7generator1, ((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, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7generator1, ((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, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5150,13 +5321,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_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; + 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_t_7; - int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -5169,97 +5338,57 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 104, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 104, __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, 104, __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, 104, __pyx_L1_error) - } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 91, __pyx_L1_error) } + __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __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 (;;) { - 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, 104, __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, 104, __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, 104, __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, 104, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __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_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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + 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, 91, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; } - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 104, __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, 104, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = (!__pyx_t_7); - if (__pyx_t_8) { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); + ++__pyx_t_3; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __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_supported_operators)) { __Pyx_RaiseClosureNameError("supported_operators"); __PYX_ERR(0, 91, __pyx_L1_error) } + __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_s, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_supported_operators, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 91, __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, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 91, __pyx_L1_error) __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; - } + __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_4); + __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); @@ -5277,12 +5406,12 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":159 - * # check which operator is applied on the variables - * operator = operators_found[0] - * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< - * # if the operator is inconsistent (e.g. 'x + y * z == 3'), return None - * return None +/* "constraint/parser.py":92 + * supported_operators = ["**", "*", "+", "-", "/"] + * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) + * unique_operators_right = set(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" + * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { @@ -5297,7 +5426,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_4_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 159, __pyx_L1_error) + __PYX_ERR(0, 92, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5308,7 +5437,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_10generator2, ((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, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator2, ((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, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5329,11 +5458,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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; 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_t_6; + 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; @@ -5346,88 +5475,58 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 159, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 159, __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, 159, __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, 159, __pyx_L1_error) - } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 92, __pyx_L1_error) } + __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __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 (;;) { - 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, 159, __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, 159, __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, 159, __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, 159, __pyx_L1_error) - PyErr_Clear(); - } - break; - } + { + 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, 92, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_o); - __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, 159, __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, 159, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = (!__pyx_t_5); - if (__pyx_t_6) { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); + ++__pyx_t_3; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __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_supported_operators)) { __Pyx_RaiseClosureNameError("supported_operators"); __PYX_ERR(0, 92, __pyx_L1_error) } + __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_s, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_supported_operators, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 92, __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, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 92, __pyx_L1_error) __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; - } + __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_4); + __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); @@ -5444,15 +5543,15 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_13generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":166 - * 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 == "**": +/* "constraint/parser.py":130 + * + * # we have a potentially rewritten restriction, split again + * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< + * + * # find out which side is the constant number */ -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_11genexpr(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 @@ -5464,18 +5563,18 @@ 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_5_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 166, __pyx_L1_error) + __PYX_ERR(0, 130, __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_cur_scope->__pyx_genexpr_arg_1 = __pyx_genexpr_arg_1; + __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_13generator3, ((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, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_13generator3, ((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, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5496,13 +5595,10 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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; PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - size_t __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; + size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -5510,103 +5606,77 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L6_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 166, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 166, __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, 166, __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, 166, __pyx_L1_error) + 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, 130, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 130, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 130, __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, 130, __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 (;;) { - 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, 166, __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, 166, __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, 166, __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, 166, __pyx_L1_error) - PyErr_Clear(); - } - break; - } + { + 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, 130, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; } - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); + ++__pyx_t_3; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __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_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_5 = __pyx_cur_scope->__pyx_v_s; - __Pyx_INCREF(__pyx_t_5); - __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_4 = __pyx_cur_scope->__pyx_v_s; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = 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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __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, 166, __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, 166, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = (!__pyx_t_7); - if (__pyx_t_8) { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; + 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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + __Pyx_XGIVEREF(__pyx_t_2); + __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_1 = __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_L6_resume_from_yield:; + __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; + __pyx_cur_scope->__pyx_t_0 = 0; + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 130, __pyx_L1_error) } - __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; - } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -5621,3557 +5691,3573 @@ 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_16generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":72 - * return split_restrictions - * - * def to_numeric_constraint( # <<<<<<<<<<<<<< - * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: +/* "constraint/parser.py":151 + * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] + * # find all unique variable_supported_operators in the restriction, can have at most one + * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) # <<<<<<<<<<<<<< + * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None + * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_constraint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_restriction, PyObject *__pyx_v_params) { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *__pyx_cur_scope; - PyObject *__pyx_v_comparators = NULL; - PyObject *__pyx_v_comparators_found = NULL; - PyObject *__pyx_v_comparator = NULL; - PyObject *__pyx_v_left = NULL; - PyObject *__pyx_v_right = 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_variable_supported_operators = NULL; - PyObject *__pyx_v_variables = NULL; - PyObject *__pyx_v_variables_on_left = NULL; - PyObject *__pyx_v_number = NULL; - int __pyx_v_number_is_int; - 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_8genexpr2__pyx_v_s = NULL; - PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7generator1 = 0; - PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator2 = 0; - PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_13generator3 = 0; +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_14genexpr(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 - 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; - int __pyx_t_7; - int __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - Py_ssize_t __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("to_numeric_constraint", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 72, __pyx_L1_error) + __PYX_ERR(0, 151, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_v_params = __pyx_v_params; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_params); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_params); - - /* "constraint/parser.py":76 - * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: - * """Converts a restriction to a built-in numeric constraint if possible.""" - * comparators = ["<=", "==", ">=", ">", "<"] # <<<<<<<<<<<<<< - * comparators_found = re.findall("|".join(comparators), restriction) - * # check if there is exactly one comparator, if not, return None -*/ - __pyx_t_1 = PyList_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __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_1, 0, __pyx_mstate_global->__pyx_kp_u__2) != (0)) __PYX_ERR(0, 76, __pyx_L1_error); - __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__7); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_kp_u__7) != (0)) __PYX_ERR(0, 76, __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_1, 2, __pyx_mstate_global->__pyx_kp_u__3) != (0)) __PYX_ERR(0, 76, __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_1, 3, __pyx_mstate_global->__pyx_kp_u__4) != (0)) __PYX_ERR(0, 76, __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_1, 4, __pyx_mstate_global->__pyx_kp_u__5) != (0)) __PYX_ERR(0, 76, __pyx_L1_error); - __pyx_v_comparators = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "constraint/parser.py":77 - * """Converts a restriction to a built-in numeric constraint if possible.""" - * comparators = ["<=", "==", ">=", ">", "<"] - * comparators_found = re.findall("|".join(comparators), restriction) # <<<<<<<<<<<<<< - * # check if there is exactly one comparator, if not, return None - * if len(comparators_found) != 1: -*/ - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __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, 77, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_comparators); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __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 + __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); { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_3, __pyx_v_restriction}; - __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_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; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_16generator4, ((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, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; } - __pyx_v_comparators_found = __pyx_t_1; - __pyx_t_1 = 0; - - /* "constraint/parser.py":79 - * comparators_found = re.findall("|".join(comparators), restriction) - * # check if there is exactly one comparator, if not, return None - * if len(comparators_found) != 1: # <<<<<<<<<<<<<< - * return None - * comparator = comparators_found[0] -*/ - __pyx_t_6 = PyObject_Length(__pyx_v_comparators_found); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 79, __pyx_L1_error) - __pyx_t_7 = (__pyx_t_6 != 1); - if (__pyx_t_7) { - /* "constraint/parser.py":80 - * # check if there is exactly one comparator, if not, return None - * if len(comparators_found) != 1: - * return None # <<<<<<<<<<<<<< - * comparator = comparators_found[0] - * -*/ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /* 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; +} - /* "constraint/parser.py":79 - * comparators_found = re.findall("|".join(comparators), restriction) - * # check if there is exactly one comparator, if not, return None - * if len(comparators_found) != 1: # <<<<<<<<<<<<<< - * return None - * comparator = comparators_found[0] -*/ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_16generator4(__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; + 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; } - - /* "constraint/parser.py":81 - * if len(comparators_found) != 1: - * return None - * comparator = comparators_found[0] # <<<<<<<<<<<<<< - * - * # split the string on the comparison and remove leading and trailing whitespace -*/ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_comparators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_comparator = __pyx_t_1; - __pyx_t_1 = 0; - - /* "constraint/parser.py":84 - * - * # split the string on the comparison and remove leading and trailing whitespace - * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< - * - * # find out which side is the constant number -*/ - __pyx_t_1 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_2genexpr(NULL, __pyx_v_restriction, __pyx_v_comparator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 151, __pyx_L1_error) } + __pyx_t_1 = __Pyx_PySequence_ListKeepNew(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (1) { - PyObject* sequence = __pyx_t_4; - Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 84, __pyx_L1_error) + 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, 151, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_1); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_3); - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); + ++__pyx_t_3; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __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, 151, __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, 151, __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, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } } - __pyx_v_left = __pyx_t_1; - __pyx_t_1 = 0; - __pyx_v_right = __pyx_t_3; - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "constraint/parser.py":87 - * - * # 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_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_s, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 87, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_Union_int_float) < 0) __PYX_ERR(0, 87, __pyx_L1_error) - __pyx_t_3 = __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_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __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; - __pyx_v_is_or_evals_to_number = __pyx_t_3; - __pyx_t_3 = 0; + /* 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_19generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - /* "constraint/parser.py":98 - * - * # either the left or right side of the equation must evaluate to a constant number - * 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): +/* "constraint/parser.py":153 + * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) + * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None + * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 # <<<<<<<<<<<<<< + * variables_on_left = len(right) == 1 + * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": */ - if (!(likely(PyUnicode_CheckExact(__pyx_v_left))||((__pyx_v_left) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_left))) __PYX_ERR(0, 98, __pyx_L1_error) - __pyx_t_3 = __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_3)) __PYX_ERR(0, 98, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_left_num = __pyx_t_3; - __pyx_t_3 = 0; - /* "constraint/parser.py":99 - * # either the left or right side of the equation must evaluate to a constant number - * 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, use the VariableConstraints -*/ - if (!(likely(PyUnicode_CheckExact(__pyx_v_right))||((__pyx_v_right) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_right))) __PYX_ERR(0, 99, __pyx_L1_error) - __pyx_t_3 = __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_3)) __PYX_ERR(0, 99, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_right_num = __pyx_t_3; - __pyx_t_3 = 0; - - /* "constraint/parser.py":100 - * 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, use the VariableConstraints - * variable_supported_operators = ['+'] -*/ - __pyx_t_8 = (__pyx_v_left_num == Py_None); - if (!__pyx_t_8) { - goto __pyx_L6_next_or; - } else { - } - __pyx_t_8 = (__pyx_v_right_num == Py_None); - if (!__pyx_t_8) { +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_17genexpr(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 + 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_7_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 153, __pyx_L1_error) } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L5_bool_binop_done; + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_L6_next_or:; - __pyx_t_8 = (__pyx_v_left_num != Py_None); - if (__pyx_t_8) { - } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L5_bool_binop_done; + __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_19generator5, ((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, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; } - __pyx_t_8 = (__pyx_v_right_num != Py_None); - __pyx_t_7 = __pyx_t_8; - __pyx_L5_bool_binop_done:; - if (__pyx_t_7) { - /* "constraint/parser.py":102 - * 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, use the VariableConstraints - * variable_supported_operators = ['+'] # <<<<<<<<<<<<<< - * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] - * if all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): -*/ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __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_3, 0, __pyx_mstate_global->__pyx_kp_u__8) != (0)) __PYX_ERR(0, 102, __pyx_L1_error); - __pyx_v_variable_supported_operators = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; + /* 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; +} - /* "constraint/parser.py":103 - * # if both sides are parameters, use the VariableConstraints - * variable_supported_operators = ['+'] - * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] # <<<<<<<<<<<<<< - * if all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): - * variables_on_left = len(right) == 1 -*/ - { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Add(__pyx_v_left, __pyx_v_right); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PySequence_ListKeepNew(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); - __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_19generator5(__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; + PyObject *__pyx_t_1 = NULL; + 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_t_8; + 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, 153, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 153, __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, 153, __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, 153, __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_4); + 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, 103, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 153, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_6); - ++__pyx_t_6; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_s, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_8genexpr2__pyx_v_s, __pyx_v_variable_supported_operators, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 103, __pyx_L11_error) - if (__pyx_t_7) { - __pyx_t_2 = __pyx_8genexpr2__pyx_v_s; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_5 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, 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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_1); - } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 103, __pyx_L11_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __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, 153, __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; } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_s); __pyx_8genexpr2__pyx_v_s = 0; - goto __pyx_L16_exit_scope; - __pyx_L11_error:; - __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_s); __pyx_8genexpr2__pyx_v_s = 0; - goto __pyx_L1_error; - __pyx_L16_exit_scope:; - } /* exit inner scope */ - __pyx_v_variables = __pyx_t_3; - __pyx_t_3 = 0; - - /* "constraint/parser.py":104 - * variable_supported_operators = ['+'] - * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] - * if all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # <<<<<<<<<<<<<< - * variables_on_left = len(right) == 1 - * if comparator == "==": -*/ - __pyx_t_3 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_5genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __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, 153, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __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_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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __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, 153, __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, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = (!__pyx_t_7); if (__pyx_t_8) { - } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L18_bool_binop_done; - } - __pyx_t_6 = PyObject_Length(__pyx_v_left); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 104, __pyx_L1_error) - __pyx_t_8 = (__pyx_t_6 == 1); - if (!__pyx_t_8) { - } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L18_bool_binop_done; + __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_t_6 = PyObject_Length(__pyx_v_right); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 104, __pyx_L1_error) - __pyx_t_8 = (__pyx_t_6 == 1); - __pyx_t_7 = __pyx_t_8; - __pyx_L18_bool_binop_done:; - if (__pyx_t_7) { - - /* "constraint/parser.py":105 - * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] - * if all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): - * variables_on_left = len(right) == 1 # <<<<<<<<<<<<<< - * if comparator == "==": - * # if both sides are parameters, use the VariableExactSumConstraint -*/ - __pyx_t_6 = PyObject_Length(__pyx_v_right); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 105, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyBool_FromLong((__pyx_t_6 == 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_v_variables_on_left = __pyx_t_4; - __pyx_t_4 = 0; - - /* "constraint/parser.py":106 - * if all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): - * variables_on_left = len(right) == 1 - * if comparator == "==": # <<<<<<<<<<<<<< - * # if both sides are parameters, use the VariableExactSumConstraint - * if variables_on_left: -*/ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 106, __pyx_L1_error) - if (__pyx_t_7) { + } + __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); - /* "constraint/parser.py":108 - * if comparator == "==": - * # if both sides are parameters, use the VariableExactSumConstraint - * if variables_on_left: # <<<<<<<<<<<<<< - * return VariableExactSumConstraint(variables[-1], variables[:-1]) - * else: -*/ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 108, __pyx_L1_error) - if (__pyx_t_7) { + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __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_22generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - /* "constraint/parser.py":109 - * # if both sides are parameters, use the VariableExactSumConstraint - * if variables_on_left: - * return VariableExactSumConstraint(variables[-1], variables[:-1]) # <<<<<<<<<<<<<< - * else: - * return VariableExactSumConstraint(variables[0], variables[1:]) +/* "constraint/parser.py":211 + * # 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_XDECREF(__pyx_r); - __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 109, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - assert(__pyx_t_3); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); - __pyx_t_5 = 0; - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_2, __pyx_t_9}; - __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_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - /* "constraint/parser.py":108 - * if comparator == "==": - * # if both sides are parameters, use the VariableExactSumConstraint - * if variables_on_left: # <<<<<<<<<<<<<< - * return VariableExactSumConstraint(variables[-1], variables[:-1]) - * else: -*/ - } +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_8_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_8_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_8_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + 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, 211, __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_22generator6, ((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, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } - /* "constraint/parser.py":111 - * return VariableExactSumConstraint(variables[-1], variables[:-1]) - * else: - * return VariableExactSumConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< - * - * # left_num and right_num can't be both None or both a constant -*/ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9); - assert(__pyx_t_1); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); - __pyx_t_5 = 0; - } + /* 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_22generator6(__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; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __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, 211, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 211, __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, 211, __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, 211, __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, 211, __pyx_L1_error) #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_2, __pyx_t_3}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __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_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; + if (__pyx_t_2 >= __pyx_temp) break; } - - /* "constraint/parser.py":106 - * if all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): - * variables_on_left = len(right) == 1 - * if comparator == "==": # <<<<<<<<<<<<<< - * # if both sides are parameters, use the VariableExactSumConstraint - * if variables_on_left: -*/ + __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, 211, __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, 211, __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, 211, __pyx_L1_error) + PyErr_Clear(); + } + break; } - - /* "constraint/parser.py":104 - * variable_supported_operators = ['+'] - * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] - * if all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # <<<<<<<<<<<<<< - * variables_on_left = len(right) == 1 - * if comparator == "==": -*/ } - - /* "constraint/parser.py":114 - * - * # left_num and right_num can't be both None or both a constant - * return None # <<<<<<<<<<<<<< - * - * # if one side is a number, the other side must be a variable or expression -*/ + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_o); + __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, 211, __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, 211, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (!__pyx_t_5); + if (__pyx_t_6) { + __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_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; goto __pyx_L0; + } + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "constraint/parser.py":100 - * 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, use the VariableConstraints - * variable_supported_operators = ['+'] -*/ + /* 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; +} +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_25generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - /* "constraint/parser.py":118 - * # 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) # <<<<<<<<<<<<<< - * ) - * +/* "constraint/parser.py":218 + * 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_7 = (__pyx_v_left_num != Py_None); - if (__pyx_t_7) { - __pyx_t_3 = __pyx_v_right; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_5 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_9 = __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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 118, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - } - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_left_num); - __Pyx_GIVEREF(__pyx_v_left_num); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_left_num) != (0)) __PYX_ERR(0, 118, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 118, __pyx_L1_error); - __Pyx_INCREF(Py_False); - __Pyx_GIVEREF(Py_False); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, Py_False) != (0)) __PYX_ERR(0, 118, __pyx_L1_error); - __pyx_t_9 = 0; - __pyx_t_4 = __pyx_t_3; - __pyx_t_3 = 0; + +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_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, 218, __pyx_L1_error) } else { - __pyx_t_9 = __pyx_v_left; - __Pyx_INCREF(__pyx_t_9); - __pyx_t_5 = 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_5, (1-__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, 118, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 118, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_v_right_num); - __Pyx_GIVEREF(__pyx_v_right_num); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_right_num) != (0)) __PYX_ERR(0, 118, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 118, __pyx_L1_error); - __Pyx_INCREF(Py_True); - __Pyx_GIVEREF(Py_True); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, Py_True) != (0)) __PYX_ERR(0, 118, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_4 = __pyx_t_9; - __pyx_t_9 = 0; + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - if (likely(__pyx_t_4 != Py_None)) { - PyObject* sequence = __pyx_t_4; - 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, 117, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_9); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_3); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); - __Pyx_INCREF(__pyx_t_2); - #else - __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 117, __pyx_L1_error) + __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_25generator7, ((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, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; } - /* "constraint/parser.py":117 - * - * # 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_9; - __pyx_t_9 = 0; - __pyx_v_variables = __pyx_t_3; - __pyx_t_3 = 0; - __pyx_v_variables_on_left = __pyx_t_2; - __pyx_t_2 = 0; - - /* "constraint/parser.py":122 - * - * # if the number is an integer, we can map '>' to '>=' and '<' to '<=' by changing the number (does not work with floating points!) # noqa: E501 - * number_is_int = isinstance(number, int) # <<<<<<<<<<<<<< - * if number_is_int: - * if comparator == "<": -*/ - __pyx_t_7 = PyLong_Check(__pyx_v_number); - __pyx_v_number_is_int = __pyx_t_7; - - /* "constraint/parser.py":123 - * # if the number is an integer, we can map '>' to '>=' and '<' to '<=' by changing the number (does not work with floating points!) # noqa: E501 - * number_is_int = isinstance(number, int) - * if number_is_int: # <<<<<<<<<<<<<< - * if comparator == "<": - * if variables_on_left: -*/ - if (__pyx_v_number_is_int) { - - /* "constraint/parser.py":124 - * number_is_int = isinstance(number, int) - * if number_is_int: - * if comparator == "<": # <<<<<<<<<<<<<< - * if variables_on_left: - * # (x < 2) == (x <= 2-1) -*/ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 124, __pyx_L1_error) - if (__pyx_t_7) { - - /* "constraint/parser.py":125 - * if number_is_int: - * if comparator == "<": - * if variables_on_left: # <<<<<<<<<<<<<< - * # (x < 2) == (x <= 2-1) - * number -= 1 -*/ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 125, __pyx_L1_error) - if (__pyx_t_7) { - - /* "constraint/parser.py":127 - * if variables_on_left: - * # (x < 2) == (x <= 2-1) - * number -= 1 # <<<<<<<<<<<<<< - * else: - * # (2 < x) == (2+1 <= x) -*/ - __pyx_t_4 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_4); - __pyx_t_4 = 0; + /* 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; +} - /* "constraint/parser.py":125 - * if number_is_int: - * if comparator == "<": - * if variables_on_left: # <<<<<<<<<<<<<< - * # (x < 2) == (x <= 2-1) - * number -= 1 -*/ - goto __pyx_L25; +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_25generator7(__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; + PyObject *__pyx_t_5 = NULL; + size_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + 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, 218, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 218, __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, 218, __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, 218, __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, 218, __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, 218, __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; } - - /* "constraint/parser.py":130 - * else: - * # (2 < x) == (2+1 <= x) - * number += 1 # <<<<<<<<<<<<<< - * elif comparator == ">": - * if variables_on_left: -*/ - /*else*/ { - __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_4); - __pyx_t_4 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __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, 218, __pyx_L1_error) + PyErr_Clear(); + } + break; } - __pyx_L25:; - - /* "constraint/parser.py":124 - * number_is_int = isinstance(number, int) - * if number_is_int: - * if comparator == "<": # <<<<<<<<<<<<<< - * if variables_on_left: - * # (x < 2) == (x <= 2-1) -*/ - goto __pyx_L24; } - - /* "constraint/parser.py":131 - * # (2 < x) == (2+1 <= x) - * number += 1 - * elif comparator == ">": # <<<<<<<<<<<<<< - * if variables_on_left: - * # (x > 2) == (x >= 2+1) -*/ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 131, __pyx_L1_error) - if (__pyx_t_7) { - - /* "constraint/parser.py":132 - * number += 1 - * elif comparator == ">": - * if variables_on_left: # <<<<<<<<<<<<<< - * # (x > 2) == (x >= 2+1) - * number += 1 -*/ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 132, __pyx_L1_error) - if (__pyx_t_7) { - - /* "constraint/parser.py":134 - * if variables_on_left: - * # (x > 2) == (x >= 2+1) - * number += 1 # <<<<<<<<<<<<<< - * else: - * # (2 > x) == (2-1 >= x) -*/ - __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_4); - __pyx_t_4 = 0; - - /* "constraint/parser.py":132 - * number += 1 - * elif comparator == ">": - * if variables_on_left: # <<<<<<<<<<<<<< - * # (x > 2) == (x >= 2+1) - * number += 1 -*/ - goto __pyx_L26; - } - - /* "constraint/parser.py":137 - * else: - * # (2 > x) == (2-1 >= x) - * number -= 1 # <<<<<<<<<<<<<< - * - * # check if an operator is applied on the variables, if not return -*/ - /*else*/ { - __pyx_t_4 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_4); - __pyx_t_4 = 0; - } - __pyx_L26:; - - /* "constraint/parser.py":131 - * # (2 < x) == (2+1 <= x) - * number += 1 - * elif comparator == ">": # <<<<<<<<<<<<<< - * if variables_on_left: - * # (x > 2) == (x >= 2+1) -*/ + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __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_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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __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, 218, __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, 218, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = (!__pyx_t_7); + if (__pyx_t_8) { + __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_L24:; + } + __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); - /* "constraint/parser.py":123 - * # if the number is an integer, we can map '>' to '>=' and '<' to '<=' by changing the number (does not work with floating points!) # noqa: E501 - * number_is_int = isinstance(number, int) - * if number_is_int: # <<<<<<<<<<<<<< - * if comparator == "<": - * if variables_on_left: -*/ + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __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; +} - /* "constraint/parser.py":140 +/* "constraint/parser.py":75 + * return split_restrictions * - * # 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: + * def to_numeric_constraint( # <<<<<<<<<<<<<< + * restriction: str, params: list[str] + * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: */ - __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __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_4, 0, __pyx_mstate_global->__pyx_kp_u__9) != (0)) __PYX_ERR(0, 140, __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_4, 1, __pyx_mstate_global->__pyx_kp_u__10) != (0)) __PYX_ERR(0, 140, __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_4, 2, __pyx_mstate_global->__pyx_kp_u__11) != (0)) __PYX_ERR(0, 140, __pyx_L1_error); - __pyx_v_operators = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; - /* "constraint/parser.py":141 - * # 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 +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_constraint(PyObject *__pyx_self, PyObject *__pyx_v_restriction, PyObject *__pyx_v_params) { + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *__pyx_cur_scope; + PyObject *__pyx_v_comparators = NULL; + PyObject *__pyx_v_comparators_found = NULL; + PyObject *__pyx_v_comparator = NULL; + PyObject *__pyx_v_unique_operators_left = NULL; + PyObject *__pyx_v_unique_operators_right = NULL; + PyObject *__pyx_v_unique_operators = NULL; + PyObject *__pyx_v_variables_on_left = NULL; + PyObject *__pyx_v_swapped_side_first_variable = NULL; + PyObject *__pyx_v_right_remainder = NULL; + 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; + PyObject *__pyx_v_number = NULL; + int __pyx_v_number_is_int; + 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_7generator1 = 0; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator2 = 0; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_13generator3 = 0; + PyObject *__pyx_8genexpr5__pyx_v_s = NULL; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_16generator4 = 0; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_19generator5 = 0; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_22generator6 = 0; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_25generator7 = 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; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9[4]; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("to_numeric_constraint", 0); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint, __pyx_mstate_global->__pyx_empty_tuple, NULL); + 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, 75, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *) __Pyx_CyFunction_GetClosure(__pyx_self); + __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); + __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); + __pyx_cur_scope->__pyx_v_params = __pyx_v_params; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_params); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_params); + __Pyx_INCREF(__pyx_v_restriction); + + /* "constraint/parser.py":79 + * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: + * """Converts a restriction to a built-in numeric constraint if possible.""" + * comparators = ["<=", "==", ">=", ">", "<"] # <<<<<<<<<<<<<< + * comparators_found = re.findall("|".join(comparators), restriction) + * # check if there is exactly one comparator, if not, return None +*/ + __pyx_t_1 = PyList_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __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_1, 0, __pyx_mstate_global->__pyx_kp_u__2) != (0)) __PYX_ERR(0, 79, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__7); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__7); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_kp_u__7) != (0)) __PYX_ERR(0, 79, __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_1, 2, __pyx_mstate_global->__pyx_kp_u__3) != (0)) __PYX_ERR(0, 79, __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_1, 3, __pyx_mstate_global->__pyx_kp_u__4) != (0)) __PYX_ERR(0, 79, __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_1, 4, __pyx_mstate_global->__pyx_kp_u__5) != (0)) __PYX_ERR(0, 79, __pyx_L1_error); + __pyx_v_comparators = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/parser.py":80 + * """Converts a restriction to a built-in numeric constraint if possible.""" + * comparators = ["<=", "==", ">=", ">", "<"] + * comparators_found = re.findall("|".join(comparators), restriction) # <<<<<<<<<<<<<< + * # check if there is exactly one comparator, if not, return None + * if len(comparators_found) != 1: */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_operators); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_comparators); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9); + 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_9); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_3, __pyx_v_variables}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_3, __pyx_v_restriction}; + __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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __pyx_v_operators_found = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_comparators_found = __pyx_t_1; + __pyx_t_1 = 0; - /* "constraint/parser.py":142 - * 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: + /* "constraint/parser.py":82 + * comparators_found = re.findall("|".join(comparators), restriction) + * # check if there is exactly one comparator, if not, return None + * if len(comparators_found) != 1: # <<<<<<<<<<<<<< + * return None + * comparator = comparators_found[0] */ - __pyx_t_6 = PyObject_Length(__pyx_v_operators_found); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 142, __pyx_L1_error) - __pyx_t_7 = (__pyx_t_6 == 0); + __pyx_t_6 = PyObject_Length(__pyx_v_comparators_found); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_7 = (__pyx_t_6 != 1); if (__pyx_t_7) { - /* "constraint/parser.py":144 - * 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 + /* "constraint/parser.py":83 + * # check if there is exactly one comparator, if not, return None + * if len(comparators_found) != 1: + * return None # <<<<<<<<<<<<<< + * comparator = comparators_found[0] + * */ - __pyx_t_4 = __pyx_cur_scope->__pyx_v_params; - __Pyx_INCREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_t_4); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = (__pyx_t_6 != 1); - if (!__pyx_t_8) { - } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L29_bool_binop_done; - } - __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_variables, __pyx_cur_scope->__pyx_v_params, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 144, __pyx_L1_error) - __pyx_t_7 = __pyx_t_8; - __pyx_L29_bool_binop_done:; - if (__pyx_t_7) { + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; - /* "constraint/parser.py":146 - * if len(params) != 1 or variables not in params: - * # there were more than one variable but no operator - * return None # <<<<<<<<<<<<<< - * # map to a Constraint - * # if there are restrictions with a single variable, it will be used to prune the domain at the start + /* "constraint/parser.py":82 + * comparators_found = re.findall("|".join(comparators), restriction) + * # check if there is exactly one comparator, if not, return None + * if len(comparators_found) != 1: # <<<<<<<<<<<<<< + * return None + * comparator = comparators_found[0] */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + } - /* "constraint/parser.py":144 - * 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 + /* "constraint/parser.py":84 + * if len(comparators_found) != 1: + * return None + * comparator = comparators_found[0] # <<<<<<<<<<<<<< + * + * # split the string on the comparison and remove leading and trailing whitespace */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_comparators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_comparator = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/parser.py":87 + * + * # split the string on the comparison and remove leading and trailing whitespace + * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< + * + * # if we have an inverse operation, rewrite to the other side +*/ + __pyx_t_1 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_2genexpr(NULL, __pyx_v_restriction, __pyx_v_comparator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (1) { + PyObject* sequence = __pyx_t_4; + Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 87, __pyx_L1_error) } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_GIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_v_left = __pyx_t_1; + __pyx_t_1 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __pyx_cur_scope->__pyx_v_right = __pyx_t_3; + __pyx_t_3 = 0; - /* "constraint/parser.py":149 - * # 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 == "<" and number_is_int): + /* "constraint/parser.py":90 + * + * # if we have an inverse operation, rewrite to the other side + * supported_operators = ["**", "*", "+", "-", "/"] # <<<<<<<<<<<<<< + * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) + * unique_operators_right = set(s.strip() for s in list(right) if s in supported_operators) */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 149, __pyx_L1_error) - if (__pyx_t_7) { + __pyx_t_4 = PyList_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __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_4, 0, __pyx_mstate_global->__pyx_kp_u__8) != (0)) __PYX_ERR(0, 90, __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_4, 1, __pyx_mstate_global->__pyx_kp_u__9) != (0)) __PYX_ERR(0, 90, __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_4, 2, __pyx_mstate_global->__pyx_kp_u__10) != (0)) __PYX_ERR(0, 90, __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_4, 3, __pyx_mstate_global->__pyx_kp_u__11) != (0)) __PYX_ERR(0, 90, __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_4, 4, __pyx_mstate_global->__pyx_kp_u__12) != (0)) __PYX_ERR(0, 90, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_cur_scope->__pyx_v_supported_operators = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/parser.py":150 - * # 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 == "<" and number_is_int): - * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) + /* "constraint/parser.py":91 + * # if we have an inverse operation, rewrite to the other side + * supported_operators = ["**", "*", "+", "-", "/"] + * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) # <<<<<<<<<<<<<< + * unique_operators_right = set(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" */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); - assert(__pyx_t_9); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); - __pyx_t_5 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_number}; - __pyx_t_4 = __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_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; + __pyx_t_4 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_5genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_left); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_unique_operators_left = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/parser.py":149 - * # 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 == "<" and number_is_int): + /* "constraint/parser.py":92 + * supported_operators = ["**", "*", "+", "-", "/"] + * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) + * unique_operators_right = set(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" + * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: */ - } + __pyx_t_3 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_unique_operators_right = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/parser.py":151 - * elif comparator == "==": - * return ExactSumConstraint(number) - * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< - * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): + /* "constraint/parser.py":94 + * unique_operators_right = set(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" + * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: # <<<<<<<<<<<<<< + * # if there are operators on both sides, we can't handle this yet + * return None */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 151, __pyx_L1_error) - if (!__pyx_t_8) { - } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L31_bool_binop_done; - } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 151, __pyx_L1_error) - if (__pyx_t_8) { - } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L31_bool_binop_done; - } - __pyx_t_7 = __pyx_v_number_is_int; - __pyx_L31_bool_binop_done:; - if (__pyx_t_7) { + if (unlikely(__pyx_v_unique_operators_left == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 94, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators_left); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_8 = (__pyx_t_6 > 0); + if (__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L5_bool_binop_done; + } + if (unlikely(__pyx_v_unique_operators_right == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 94, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators_right); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_8 = (__pyx_t_6 > 0); + __pyx_t_7 = __pyx_t_8; + __pyx_L5_bool_binop_done:; + if (__pyx_t_7) { - /* "constraint/parser.py":152 - * return ExactSumConstraint(number) - * elif comparator == "<=" or (comparator == "<" and number_is_int): - * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< - * elif comparator == ">=" or (comparator == ">" and number_is_int): - * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) + /* "constraint/parser.py":96 + * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: + * # if there are operators on both sides, we can't handle this yet + * return None # <<<<<<<<<<<<<< + * unique_operators = unique_operators_left.union(unique_operators_right) + * if len(unique_operators) == 1: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 152, __pyx_L1_error) - if (__pyx_t_7) { - __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_9); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); - __pyx_t_5 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_number}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __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_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __pyx_t_4 = __pyx_t_3; - __pyx_t_3 = 0; - } else { - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9); - assert(__pyx_t_2); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); - __pyx_t_5 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_number}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __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; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __pyx_t_4 = __pyx_t_3; - __pyx_t_3 = 0; - } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; - /* "constraint/parser.py":151 - * elif comparator == "==": - * return ExactSumConstraint(number) - * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< - * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): + /* "constraint/parser.py":94 + * unique_operators_right = set(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" + * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: # <<<<<<<<<<<<<< + * # if there are operators on both sides, we can't handle this yet + * return None */ - } + } - /* "constraint/parser.py":153 - * elif comparator == "<=" or (comparator == "<" and number_is_int): - * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< - * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) - * raise ValueError(f"Invalid comparator {comparator}") + /* "constraint/parser.py":97 + * # if there are operators on both sides, we can't handle this yet + * return None + * 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_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 153, __pyx_L1_error) - if (!__pyx_t_8) { - } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L34_bool_binop_done; - } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 153, __pyx_L1_error) - if (__pyx_t_8) { - } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L34_bool_binop_done; - } - __pyx_t_7 = __pyx_v_number_is_int; - __pyx_L34_bool_binop_done:; - if (__pyx_t_7) { + __pyx_t_4 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PySet_Type__union, __pyx_v_unique_operators_left, __pyx_v_unique_operators_right); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_unique_operators = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/parser.py":154 - * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): - * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) # <<<<<<<<<<<<<< - * raise ValueError(f"Invalid comparator {comparator}") - * + /* "constraint/parser.py":98 + * return None + * 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_variable = re.search(regex_match_variable, left if variables_on_left else right) */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 154, __pyx_L1_error) - if (__pyx_t_7) { - __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_9); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); - __pyx_t_5 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_number}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __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_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __pyx_t_4 = __pyx_t_3; - __pyx_t_3 = 0; - } else { - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 154, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9); - assert(__pyx_t_2); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); - __pyx_t_5 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_number}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __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; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __pyx_t_4 = __pyx_t_3; - __pyx_t_3 = 0; - } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; + __pyx_t_6 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_7 = (__pyx_t_6 == 1); + if (__pyx_t_7) { - /* "constraint/parser.py":153 - * elif comparator == "<=" or (comparator == "<" and number_is_int): - * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< - * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) - * raise ValueError(f"Invalid comparator {comparator}") + /* "constraint/parser.py":99 + * 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_variable = re.search(regex_match_variable, left if variables_on_left else right) + * if swapped_side_first_variable is None: */ + if (unlikely(__pyx_v_unique_operators_left == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 99, __pyx_L1_error) } + __pyx_t_6 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators_left); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong((__pyx_t_6 > 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_variables_on_left = __pyx_t_4; + __pyx_t_4 = 0; - /* "constraint/parser.py":155 - * elif comparator == ">=" or (comparator == ">" and number_is_int): - * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) - * raise ValueError(f"Invalid comparator {comparator}") # <<<<<<<<<<<<<< - * - * # check which operator is applied on the variables + /* "constraint/parser.py":100 + * if len(unique_operators) == 1: + * variables_on_left = len(unique_operators_left) > 0 + * swapped_side_first_variable = re.search(regex_match_variable, left if variables_on_left else right) # <<<<<<<<<<<<<< + * if swapped_side_first_variable is None: + * # if there is no variable on the left side, we can't handle this yet */ __pyx_t_3 = NULL; - __Pyx_INCREF(__pyx_builtin_ValueError); - __pyx_t_9 = __pyx_builtin_ValueError; - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_comparator, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_search); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_regex_match_variable)) { __Pyx_RaiseClosureNameError("regex_match_variable"); __PYX_ERR(0, 100, __pyx_L1_error) } + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 100, __pyx_L1_error) + if (__pyx_t_7) { + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_left); + __pyx_t_1 = __pyx_cur_scope->__pyx_v_left; + } else { + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_right); + __pyx_t_1 = __pyx_cur_scope->__pyx_v_right; + } __pyx_t_5 = 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); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __pyx_t_5 = 0; + } + #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_1}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_regex_match_variable, __pyx_t_1}; + __pyx_t_4 = __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_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_v_swapped_side_first_variable = __pyx_t_4; + __pyx_t_4 = 0; - /* "constraint/parser.py":142 - * 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: + /* "constraint/parser.py":101 + * variables_on_left = len(unique_operators_left) > 0 + * swapped_side_first_variable = re.search(regex_match_variable, left if variables_on_left else right) + * if swapped_side_first_variable is None: # <<<<<<<<<<<<<< + * # if there is no variable on the left side, we can't handle this yet + * return None */ - } + __pyx_t_7 = (__pyx_v_swapped_side_first_variable == Py_None); + if (__pyx_t_7) { - /* "constraint/parser.py":158 - * - * # check which operator is applied on the variables - * operator = operators_found[0] # <<<<<<<<<<<<<< - * if not all(o == operator for o in operators_found): - * # if the operator is inconsistent (e.g. 'x + y * z == 3'), return None + /* "constraint/parser.py":103 + * if swapped_side_first_variable is None: + * # if there is no variable on the left side, we can't handle this yet + * return None # <<<<<<<<<<<<<< + * else: + * swapped_side_first_variable = swapped_side_first_variable.group(0) */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_operators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_cur_scope->__pyx_v_operator = __pyx_t_4; - __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; - /* "constraint/parser.py":159 - * # check which operator is applied on the variables - * operator = operators_found[0] - * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< - * # if the operator is inconsistent (e.g. 'x + y * z == 3'), return None - * return None + /* "constraint/parser.py":101 + * variables_on_left = len(unique_operators_left) > 0 + * swapped_side_first_variable = re.search(regex_match_variable, left if variables_on_left else right) + * if swapped_side_first_variable is None: # <<<<<<<<<<<<<< + * # if there is no variable on the left side, we can't handle this yet + * return None */ - __pyx_t_4 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_operators_found); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_8 = (!__pyx_t_7); - if (__pyx_t_8) { + } - /* "constraint/parser.py":161 - * if not all(o == operator for o in operators_found): - * # if the operator is inconsistent (e.g. 'x + y * z == 3'), return None - * return None # <<<<<<<<<<<<<< - * - * # split the string on the comparison + /* "constraint/parser.py":105 + * return None + * else: + * swapped_side_first_variable = swapped_side_first_variable.group(0) # <<<<<<<<<<<<<< + * if "-" in unique_operators: + * if not variables_on_left: */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + /*else*/ { + __pyx_t_2 = __pyx_v_swapped_side_first_variable; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_5 = 0; + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_0}; + __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_group, __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_4)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_DECREF_SET(__pyx_v_swapped_side_first_variable, __pyx_t_4); + __pyx_t_4 = 0; + } - /* "constraint/parser.py":159 - * # check which operator is applied on the variables - * operator = operators_found[0] - * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< - * # if the operator is inconsistent (e.g. 'x + y * z == 3'), return None - * return None + /* "constraint/parser.py":106 + * else: + * swapped_side_first_variable = swapped_side_first_variable.group(0) + * if "-" in unique_operators: # <<<<<<<<<<<<<< + * if not variables_on_left: + * # e.g. "G == B-M" becomes "G+M == B" */ - } + __pyx_t_7 = (__Pyx_PySet_ContainsTF(__pyx_mstate_global->__pyx_kp_u__11, __pyx_v_unique_operators, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 106, __pyx_L1_error) + if (__pyx_t_7) { - /* "constraint/parser.py":164 - * - * # 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): + /* "constraint/parser.py":107 + * swapped_side_first_variable = swapped_side_first_variable.group(0) + * 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_variable):] */ - __pyx_t_4 = __pyx_v_variables; - __Pyx_INCREF(__pyx_t_4); - __pyx_t_5 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_operator}; - __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_split, __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_9)) __PYX_ERR(0, 164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - } - __pyx_v_splitted = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_8 = (!__pyx_t_7); + if (__pyx_t_8) { - /* "constraint/parser.py":166 - * 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 == "**": + /* "constraint/parser.py":109 + * if not variables_on_left: + * # e.g. "G == B-M" becomes "G+M == B" + * right_remainder = right[len(swapped_side_first_variable):] # <<<<<<<<<<<<<< + * left_swap = right_remainder.replace("-", "+") + * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" */ - __pyx_t_6 = PyObject_Length(__pyx_v_splitted); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 166, __pyx_L1_error) - __pyx_t_9 = __pyx_cur_scope->__pyx_v_params; - __Pyx_INCREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PyList_GET_SIZE(__pyx_t_9); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 166, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_7 = (__pyx_t_6 == __pyx_t_10); - if (__pyx_t_7) { - } else { - __pyx_t_8 = __pyx_t_7; - goto __pyx_L39_bool_binop_done; - } - __pyx_t_9 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_splitted); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 166, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __pyx_t_7; - __pyx_L39_bool_binop_done:; - if (__pyx_t_8) { + __pyx_t_6 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_right, __pyx_t_6, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_right_remainder = __pyx_t_4; + __pyx_t_4 = 0; - /* "constraint/parser.py":168 - * 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 + /* "constraint/parser.py":110 + * # e.g. "G == B-M" becomes "G+M == B" + * right_remainder = right[len(swapped_side_first_variable):] + * left_swap = right_remainder.replace("-", "+") # <<<<<<<<<<<<<< + * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" + * else: */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 168, __pyx_L1_error) - if (__pyx_t_8) { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_left_swap = __pyx_t_2; + __pyx_t_2 = 0; - /* "constraint/parser.py":170 - * if operator == "**": - * # power operations are not (yet) supported, added to avoid matching the double asterisk - * return None # <<<<<<<<<<<<<< - * elif operator == "*": - * if comparator == "<=" or (comparator == "<" and number_is_int): + /* "constraint/parser.py":111 + * right_remainder = right[len(swapped_side_first_variable):] + * left_swap = right_remainder.replace("-", "+") + * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" # <<<<<<<<<<<<<< + * else: + * # e.g. "B-M == G" becomes "B == G+M" */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9[0] = __pyx_t_2; + __pyx_t_9[1] = __pyx_t_4; + __pyx_t_9[2] = __pyx_t_1; + __pyx_t_9[3] = __pyx_t_3; + __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_9, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3)); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_restriction, ((PyObject*)__pyx_t_10)); + __pyx_t_10 = 0; - /* "constraint/parser.py":168 - * 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 + /* "constraint/parser.py":107 + * swapped_side_first_variable = swapped_side_first_variable.group(0) + * 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_variable):] */ - } + goto __pyx_L10; + } - /* "constraint/parser.py":171 - * # power operations are not (yet) supported, added to avoid matching the double asterisk - * return None - * elif operator == "*": # <<<<<<<<<<<<<< - * if comparator == "<=" or (comparator == "<" and number_is_int): - * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) + /* "constraint/parser.py":114 + * else: + * # e.g. "B-M == G" becomes "B == G+M" + * left_remainder = left[len(swapped_side_first_variable):] # <<<<<<<<<<<<<< + * right_swap = left_remainder.replace("-", "+") + * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 171, __pyx_L1_error) - if (__pyx_t_8) { + /*else*/ { + __pyx_t_6 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_left, __pyx_t_6, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_v_left_remainder = __pyx_t_10; + __pyx_t_10 = 0; - /* "constraint/parser.py":172 - * return None - * elif operator == "*": - * if comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< - * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): + /* "constraint/parser.py":115 + * # e.g. "B-M == G" becomes "B == G+M" + * left_remainder = left[len(swapped_side_first_variable):] + * right_swap = left_remainder.replace("-", "+") # <<<<<<<<<<<<<< + * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" + * if "/" in unique_operators: */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 172, __pyx_L1_error) - if (!__pyx_t_7) { - } else { - __pyx_t_8 = __pyx_t_7; - goto __pyx_L43_bool_binop_done; - } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 172, __pyx_L1_error) - if (__pyx_t_7) { - } else { - __pyx_t_8 = __pyx_t_7; - goto __pyx_L43_bool_binop_done; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_right_swap = __pyx_t_3; + __pyx_t_3 = 0; + + /* "constraint/parser.py":116 + * left_remainder = left[len(swapped_side_first_variable):] + * right_swap = left_remainder.replace("-", "+") + * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" # <<<<<<<<<<<<<< + * if "/" in unique_operators: + * if not variables_on_left: +*/ + __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9[0] = __pyx_t_3; + __pyx_t_9[1] = __pyx_t_10; + __pyx_t_9[2] = __pyx_t_1; + __pyx_t_9[3] = __pyx_t_4; + __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_9, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4)); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_restriction, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; } - __pyx_t_8 = __pyx_v_number_is_int; - __pyx_L43_bool_binop_done:; - if (__pyx_t_8) { + __pyx_L10:; - /* "constraint/parser.py":173 - * elif operator == "*": - * if comparator == "<=" or (comparator == "<" and number_is_int): - * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) # <<<<<<<<<<<<<< - * elif comparator == ">=" or (comparator == ">" and number_is_int): - * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) + /* "constraint/parser.py":106 + * else: + * swapped_side_first_variable = swapped_side_first_variable.group(0) + * if "-" in unique_operators: # <<<<<<<<<<<<<< + * if not variables_on_left: + * # e.g. "G == B-M" becomes "G+M == B" */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 173, __pyx_L1_error) - if (__pyx_t_8) { - __pyx_t_1 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); - assert(__pyx_t_1); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); - __pyx_t_5 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_number}; - __pyx_t_9 = __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_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - } - __pyx_t_4 = __pyx_t_9; - __pyx_t_9 = 0; - } else { - __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - assert(__pyx_t_3); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); - __pyx_t_5 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_number}; - __pyx_t_9 = __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_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - } - __pyx_t_4 = __pyx_t_9; - __pyx_t_9 = 0; - } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; + } - /* "constraint/parser.py":172 - * return None - * elif operator == "*": - * if comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< - * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): + /* "constraint/parser.py":117 + * right_swap = left_remainder.replace("-", "+") + * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" + * if "/" in unique_operators: # <<<<<<<<<<<<<< + * if not variables_on_left: + * # e.g. "G == B/M" becomes "G*M == B" */ - } + __pyx_t_8 = (__Pyx_PySet_ContainsTF(__pyx_mstate_global->__pyx_kp_u__12, __pyx_v_unique_operators, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 117, __pyx_L1_error) + if (__pyx_t_8) { - /* "constraint/parser.py":174 - * if comparator == "<=" or (comparator == "<" and number_is_int): - * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< - * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) - * elif operator == "+": + /* "constraint/parser.py":118 + * restriction = f"{swapped_side_first_variable}{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_variable):] */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 174, __pyx_L1_error) - if (!__pyx_t_7) { - } else { - __pyx_t_8 = __pyx_t_7; - goto __pyx_L46_bool_binop_done; - } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_7 = (!__pyx_t_8); if (__pyx_t_7) { - } else { - __pyx_t_8 = __pyx_t_7; - goto __pyx_L46_bool_binop_done; - } - __pyx_t_8 = __pyx_v_number_is_int; - __pyx_L46_bool_binop_done:; - if (__pyx_t_8) { - /* "constraint/parser.py":175 - * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): - * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) # <<<<<<<<<<<<<< - * elif operator == "+": - * if comparator == "==": + /* "constraint/parser.py":120 + * if not variables_on_left: + * # e.g. "G == B/M" becomes "G*M == B" + * right_remainder = right[len(swapped_side_first_variable):] # <<<<<<<<<<<<<< + * left_swap = right_remainder.replace("/", "*") + * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 175, __pyx_L1_error) - if (__pyx_t_8) { - __pyx_t_1 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); - assert(__pyx_t_1); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); - __pyx_t_5 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_number}; - __pyx_t_9 = __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_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - } - __pyx_t_4 = __pyx_t_9; - __pyx_t_9 = 0; - } else { - __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - assert(__pyx_t_3); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); - __pyx_t_5 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_number}; - __pyx_t_9 = __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_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - } - __pyx_t_4 = __pyx_t_9; - __pyx_t_9 = 0; - } - __pyx_r = __pyx_t_4; + __pyx_t_6 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_right, __pyx_t_6, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_right_remainder, __pyx_t_2); + __pyx_t_2 = 0; + + /* "constraint/parser.py":121 + * # e.g. "G == B/M" becomes "G*M == B" + * right_remainder = right[len(swapped_side_first_variable):] + * left_swap = right_remainder.replace("/", "*") # <<<<<<<<<<<<<< + * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" + * else: +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_left_swap, __pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L0; - /* "constraint/parser.py":174 - * if comparator == "<=" or (comparator == "<" and number_is_int): - * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< - * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) - * elif operator == "+": + /* "constraint/parser.py":122 + * right_remainder = right[len(swapped_side_first_variable):] + * left_swap = right_remainder.replace("/", "*") + * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" # <<<<<<<<<<<<<< + * else: + * # e.g. "B/M == G" becomes "B == G*M" */ - } + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9[0] = __pyx_t_4; + __pyx_t_9[1] = __pyx_t_2; + __pyx_t_9[2] = __pyx_t_1; + __pyx_t_9[3] = __pyx_t_10; + __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_9, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10)); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF_SET(__pyx_v_restriction, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; - /* "constraint/parser.py":171 - * # power operations are not (yet) supported, added to avoid matching the double asterisk - * return None - * elif operator == "*": # <<<<<<<<<<<<<< - * if comparator == "<=" or (comparator == "<" and number_is_int): - * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) + /* "constraint/parser.py":118 + * restriction = f"{swapped_side_first_variable}{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_variable):] */ - goto __pyx_L41; - } + goto __pyx_L12; + } - /* "constraint/parser.py":176 - * elif comparator == ">=" or (comparator == ">" and number_is_int): - * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) - * elif operator == "+": # <<<<<<<<<<<<<< - * if comparator == "==": - * return ExactSumConstraint(number) + /* "constraint/parser.py":125 + * else: + * # e.g. "B/M == G" becomes "B == G*M" + * left_remainder = left[len(swapped_side_first_variable):] # <<<<<<<<<<<<<< + * right_swap = left_remainder.replace("/", "*") + * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_kp_u__8, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 176, __pyx_L1_error) - if (likely(__pyx_t_8)) { + /*else*/ { + __pyx_t_6 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_left, __pyx_t_6, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_left_remainder, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/parser.py":177 - * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) - * elif operator == "+": - * if comparator == "==": # <<<<<<<<<<<<<< - * return ExactSumConstraint(number) - * elif comparator == "<=" or (comparator == "<" and number_is_int): + /* "constraint/parser.py":126 + * # e.g. "B/M == G" becomes "B == G*M" + * left_remainder = left[len(swapped_side_first_variable):] + * right_swap = left_remainder.replace("/", "*") # <<<<<<<<<<<<<< + * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" + * */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 177, __pyx_L1_error) - if (__pyx_t_8) { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_right_swap, __pyx_t_10); + __pyx_t_10 = 0; - /* "constraint/parser.py":178 - * elif operator == "+": - * if comparator == "==": - * return ExactSumConstraint(number) # <<<<<<<<<<<<<< - * elif comparator == "<=" or (comparator == "<" and number_is_int): - * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) + /* "constraint/parser.py":127 + * left_remainder = left[len(swapped_side_first_variable):] + * right_swap = left_remainder.replace("/", "*") + * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" # <<<<<<<<<<<<<< + * + * # we have a potentially rewritten restriction, split again */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); - assert(__pyx_t_9); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); - __pyx_t_5 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_number}; - __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_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - } - __pyx_r = __pyx_t_4; + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9[0] = __pyx_t_10; + __pyx_t_9[1] = __pyx_t_3; + __pyx_t_9[2] = __pyx_t_1; + __pyx_t_9[3] = __pyx_t_2; + __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_9, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2)); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_restriction, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - goto __pyx_L0; + } + __pyx_L12:; + + /* "constraint/parser.py":117 + * right_swap = left_remainder.replace("-", "+") + * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" + * if "/" in unique_operators: # <<<<<<<<<<<<<< + * if not variables_on_left: + * # e.g. "G == B/M" becomes "G*M == B" +*/ + } - /* "constraint/parser.py":177 - * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) - * elif operator == "+": - * if comparator == "==": # <<<<<<<<<<<<<< - * return ExactSumConstraint(number) - * elif comparator == "<=" or (comparator == "<" and number_is_int): + /* "constraint/parser.py":130 + * + * # we have a potentially rewritten restriction, split again + * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< + * + * # find out which side is the constant number */ + __pyx_t_4 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11genexpr(NULL, __pyx_v_restriction, __pyx_v_comparator); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (1) { + PyObject* sequence = __pyx_t_2; + Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 130, __pyx_L1_error) } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_4); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_left); + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_left, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_right); + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_right, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/parser.py":179 - * if comparator == "==": - * return ExactSumConstraint(number) - * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< - * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): + /* "constraint/parser.py":98 + * return None + * 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_variable = re.search(regex_match_variable, left if variables_on_left else right) */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 179, __pyx_L1_error) - if (!__pyx_t_7) { - } else { - __pyx_t_8 = __pyx_t_7; - goto __pyx_L50_bool_binop_done; - } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 179, __pyx_L1_error) - if (__pyx_t_7) { - } else { - __pyx_t_8 = __pyx_t_7; - goto __pyx_L50_bool_binop_done; - } - __pyx_t_8 = __pyx_v_number_is_int; - __pyx_L50_bool_binop_done:; - if (__pyx_t_8) { + } - /* "constraint/parser.py":180 - * return ExactSumConstraint(number) - * elif comparator == "<=" or (comparator == "<" and number_is_int): - * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< - * elif comparator == ">=" or (comparator == ">" and number_is_int): - * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) + /* "constraint/parser.py":133 + * + * # 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_XDECREF(__pyx_r); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 180, __pyx_L1_error) - if (__pyx_t_8) { - __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); - assert(__pyx_t_9); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); - __pyx_t_5 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_number}; - __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)); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } - __pyx_t_4 = __pyx_t_1; - __pyx_t_1 = 0; - } else { - __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9); - assert(__pyx_t_3); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); - __pyx_t_5 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_number}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __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_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } - __pyx_t_4 = __pyx_t_1; - __pyx_t_1 = 0; - } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __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, 133, __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, 133, __pyx_L1_error) + __pyx_t_1 = __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_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __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_is_or_evals_to_number = __pyx_t_1; + __pyx_t_1 = 0; - /* "constraint/parser.py":179 - * if comparator == "==": - * return ExactSumConstraint(number) - * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< - * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): + /* "constraint/parser.py":144 + * + * # 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): */ - } + __pyx_t_1 = __pyx_cur_scope->__pyx_v_left; + __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, 144, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_is_or_evals_to_number(__pyx_v_is_or_evals_to_number, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_left_num = __pyx_t_2; + __pyx_t_2 = 0; - /* "constraint/parser.py":181 - * elif comparator == "<=" or (comparator == "<" and number_is_int): - * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< - * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) - * else: + /* "constraint/parser.py":145 + * # 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 */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) - if (!__pyx_t_7) { - } else { - __pyx_t_8 = __pyx_t_7; - goto __pyx_L53_bool_binop_done; - } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) - if (__pyx_t_7) { - } else { - __pyx_t_8 = __pyx_t_7; - goto __pyx_L53_bool_binop_done; - } - __pyx_t_8 = __pyx_v_number_is_int; - __pyx_L53_bool_binop_done:; - if (__pyx_t_8) { + __pyx_t_2 = __pyx_cur_scope->__pyx_v_right; + __Pyx_INCREF(__pyx_t_2); + if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_is_or_evals_to_number(__pyx_v_is_or_evals_to_number, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_right_num = __pyx_t_1; + __pyx_t_1 = 0; - /* "constraint/parser.py":182 - * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): - * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) # <<<<<<<<<<<<<< - * else: - * raise ValueError(f"Invalid operator {operator}") + /* "constraint/parser.py":146 + * 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 = ['+'] */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 182, __pyx_L1_error) - if (__pyx_t_8) { - __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); - assert(__pyx_t_9); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); - __pyx_t_5 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_number}; - __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)); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } - __pyx_t_4 = __pyx_t_1; - __pyx_t_1 = 0; - } else { - __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9); - assert(__pyx_t_3); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); - __pyx_t_5 = 0; - } + __pyx_t_8 = (__pyx_v_left_num == Py_None); + if (!__pyx_t_8) { + goto __pyx_L15_next_or; + } else { + } + __pyx_t_8 = (__pyx_v_right_num == Py_None); + if (!__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L14_bool_binop_done; + } + __pyx_L15_next_or:; + __pyx_t_8 = (__pyx_v_left_num != Py_None); + if (__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_8 = (__pyx_v_right_num != Py_None); + __pyx_t_7 = __pyx_t_8; + __pyx_L14_bool_binop_done:; + if (__pyx_t_7) { + + /* "constraint/parser.py":148 + * 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 = ['+'] # <<<<<<<<<<<<<< + * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] + * # find all unique variable_supported_operators in the restriction, can have at most one +*/ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __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_1, 0, __pyx_mstate_global->__pyx_kp_u__10) != (0)) __PYX_ERR(0, 148, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_v_variable_supported_operators = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/parser.py":149 + * # if both sides are parameters, try to use the VariableConstraints + * variable_supported_operators = ['+'] + * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] # <<<<<<<<<<<<<< + * # find all unique variable_supported_operators in the restriction, can have at most one + * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) +*/ + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_Add(__pyx_cur_scope->__pyx_v_left, __pyx_cur_scope->__pyx_v_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); + __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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, 149, __pyx_L20_error) #endif + if (__pyx_t_6 >= __pyx_temp) break; + } + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6); + ++__pyx_t_6; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_s, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_8genexpr5__pyx_v_s, __pyx_cur_scope->__pyx_v_variable_supported_operators, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 149, __pyx_L20_error) + if (__pyx_t_7) { + __pyx_t_3 = __pyx_8genexpr5__pyx_v_s; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_number}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + __pyx_t_4 = __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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_4); } - __pyx_t_4 = __pyx_t_1; - __pyx_t_1 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 149, __pyx_L20_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_s); __pyx_8genexpr5__pyx_v_s = 0; + goto __pyx_L25_exit_scope; + __pyx_L20_error:; + __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_s); __pyx_8genexpr5__pyx_v_s = 0; + goto __pyx_L1_error; + __pyx_L25_exit_scope:; + } /* exit inner scope */ + __pyx_v_variables = __pyx_t_1; + __pyx_t_1 = 0; - /* "constraint/parser.py":181 - * elif comparator == "<=" or (comparator == "<" and number_is_int): - * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< - * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) - * else: + /* "constraint/parser.py":151 + * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] + * # find all unique variable_supported_operators in the restriction, can have at most one + * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) # <<<<<<<<<<<<<< + * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None + * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 */ - } + __pyx_t_1 = PyNumber_Add(__pyx_cur_scope->__pyx_v_left, __pyx_cur_scope->__pyx_v_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_14genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_unique_operators, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; - /* "constraint/parser.py":176 - * elif comparator == ">=" or (comparator == ">" and number_is_int): - * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) - * elif operator == "+": # <<<<<<<<<<<<<< - * if comparator == "==": - * return ExactSumConstraint(number) + /* "constraint/parser.py":153 + * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) + * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None + * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 # <<<<<<<<<<<<<< + * variables_on_left = len(right) == 1 + * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": */ - goto __pyx_L41; + if (unlikely(__pyx_v_unique_operators == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 153, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_8 = (__pyx_t_6 <= 1); + if (__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L27_bool_binop_done; + } + __pyx_t_1 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_17genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __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, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L27_bool_binop_done; } + __pyx_t_2 = __pyx_cur_scope->__pyx_v_left; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = (__pyx_t_6 == 1); + if (!__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L27_bool_binop_done; + } + __pyx_t_2 = __pyx_cur_scope->__pyx_v_right; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = (__pyx_t_6 == 1); + __pyx_t_7 = __pyx_t_8; + __pyx_L27_bool_binop_done:; + if (__pyx_t_7) { - /* "constraint/parser.py":184 - * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) - * else: - * raise ValueError(f"Invalid operator {operator}") # <<<<<<<<<<<<<< - * return None - * + /* "constraint/parser.py":154 + * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None + * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 + * variables_on_left = len(right) == 1 # <<<<<<<<<<<<<< + * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": + * if comparator == "==": */ - /*else*/ { - __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_ValueError); - __pyx_t_9 = __pyx_builtin_ValueError; - __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_operator, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_2 = __pyx_cur_scope->__pyx_v_right; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_t_6 == 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = 1; - { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_2}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __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; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 184, __pyx_L1_error) - } - __pyx_L41:; + __Pyx_XDECREF_SET(__pyx_v_variables_on_left, __pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/parser.py":166 - * 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 == "**": + /* "constraint/parser.py":155 + * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 + * variables_on_left = len(right) == 1 + * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": # <<<<<<<<<<<<<< + * if comparator == "==": + * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 */ - } - - /* "constraint/parser.py":185 - * else: - * raise ValueError(f"Invalid operator {operator}") - * return None # <<<<<<<<<<<<<< - * - * def to_equality_constraint( + if (unlikely(__pyx_v_unique_operators == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 155, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_8 = (__pyx_t_6 == 0); + if (!__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L32_bool_binop_done; + } + __pyx_t_2 = PyObject_GetIter(__pyx_v_unique_operators); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__10, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_L32_bool_binop_done:; + if (__pyx_t_7) { + + /* "constraint/parser.py":156 + * variables_on_left = len(right) == 1 + * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": + * if comparator == "==": # <<<<<<<<<<<<<< + * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 + * elif comparator == "<=": */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 156, __pyx_L1_error) + if (__pyx_t_7) { - /* "constraint/parser.py":72 - * return split_restrictions - * - * def to_numeric_constraint( # <<<<<<<<<<<<<< - * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: + /* "constraint/parser.py":157 + * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": + * 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) */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 157, __pyx_L1_error) + if (__pyx_t_7) { + __pyx_t_4 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __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, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __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[3] = {__pyx_t_4, __pyx_t_10, __pyx_t_11}; + __pyx_t_2 = __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_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } else { + __pyx_t_3 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11); + assert(__pyx_t_3); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_10, __pyx_t_4}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __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; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* 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_9); - __Pyx_AddTraceback("constraint.parser.parse_restrictions.to_numeric_constraint", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_comparators); - __Pyx_XDECREF(__pyx_v_comparators_found); - __Pyx_XDECREF(__pyx_v_comparator); - __Pyx_XDECREF(__pyx_v_left); - __Pyx_XDECREF(__pyx_v_right); - __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_variable_supported_operators); - __Pyx_XDECREF(__pyx_v_variables); - __Pyx_XDECREF(__pyx_v_variables_on_left); - __Pyx_XDECREF(__pyx_v_number); - __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_8genexpr2__pyx_v_s); - __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7generator1); - __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator2); - __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_13generator3); - __Pyx_DECREF((PyObject *)__pyx_cur_scope); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "constraint/parser.py":156 + * variables_on_left = len(right) == 1 + * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": + * if comparator == "==": # <<<<<<<<<<<<<< + * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 + * elif comparator == "<=": +*/ + } -/* "constraint/parser.py":187 - * return None + /* "constraint/parser.py":158 + * 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 VariableMaxSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMinSumConstraint(variables[0], variables[1:]) # noqa: E501 +*/ + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 158, __pyx_L1_error) + if (__pyx_t_7) { + + /* "constraint/parser.py":160 + * 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) +*/ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 160, __pyx_L1_error) + if (__pyx_t_7) { + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4); + assert(__pyx_t_11); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_10, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } else { + __pyx_t_4 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __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, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __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[3] = {__pyx_t_4, __pyx_t_10, __pyx_t_11}; + __pyx_t_2 = __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_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "constraint/parser.py":158 + * 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 VariableMaxSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMinSumConstraint(variables[0], variables[1:]) # noqa: E501 +*/ + } + + /* "constraint/parser.py":161 + * # "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 VariableMinSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxSumConstraint(variables[0], variables[1:]) # noqa: E501 +*/ + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 161, __pyx_L1_error) + if (__pyx_t_7) { + + /* "constraint/parser.py":163 + * 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 # <<<<<<<<<<<<<< * - * def to_equality_constraint( # <<<<<<<<<<<<<< - * restriction: str, params: list[str] - * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: + * # left_num and right_num can't be both None or both a constant */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 163, __pyx_L1_error) + if (__pyx_t_7) { + __pyx_t_3 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11); + assert(__pyx_t_3); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_10, __pyx_t_4}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __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; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } else { + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4); + assert(__pyx_t_11); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_10, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; -/* Python wrapper */ -static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_9to_equality_constraint(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_18parse_restrictions_8to_equality_constraint, "Converts a restriction to either an equality or inequality constraint on all the parameters if possible."); -static PyMethodDef __pyx_mdef_10constraint_6parser_18parse_restrictions_9to_equality_constraint = {"to_equality_constraint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_18parse_restrictions_9to_equality_constraint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6parser_18parse_restrictions_8to_equality_constraint}; -static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_9to_equality_constraint(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_restriction = 0; - PyObject *__pyx_v_params = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("to_equality_constraint (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_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, 187, __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, 187, __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, 187, __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, 187, __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, 187, __pyx_L3_error) } + /* "constraint/parser.py":161 + * # "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 VariableMinSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxSumConstraint(variables[0], variables[1:]) # noqa: E501 +*/ + } + + /* "constraint/parser.py":155 + * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 + * variables_on_left = len(right) == 1 + * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": # <<<<<<<<<<<<<< + * if comparator == "==": + * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 +*/ } - } 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, 187, __pyx_L3_error) - values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 187, __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, 187, __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_equality_constraint", __pyx_clineno, __pyx_lineno, __pyx_filename); - __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, 188, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 188, __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 */ - 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_6parser_18parse_restrictions_22to_equality_constraint_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + /* "constraint/parser.py":153 + * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) + * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None + * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 # <<<<<<<<<<<<<< + * variables_on_left = len(right) == 1 + * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": +*/ + } -/* "constraint/parser.py":206 - * 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 == "==": + /* "constraint/parser.py":166 + * + * # left_num and right_num can't be both None or both a constant + * return None # <<<<<<<<<<<<<< + * + * # if one side is a number, the other side must be a variable or expression */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; -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_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_6parser___pyx_scope_struct_7_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 206, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + /* "constraint/parser.py":146 + * 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 = ['+'] +*/ } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_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_2generator4, ((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_equ, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 206, __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_equality_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_22to_equality_constraint_2generator4(__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; - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - size_t __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - 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, 206, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 206, __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, 206, __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, 206, __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); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_4 = __pyx_cur_scope->__pyx_v_s; + /* "constraint/parser.py":170 + * # 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_t_7 = (__pyx_v_left_num != Py_None); + if (__pyx_t_7) { + __pyx_t_4 = __pyx_cur_scope->__pyx_v_right; __Pyx_INCREF(__pyx_t_4); __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_2 = __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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 206, __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, 206, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = (!__pyx_t_6); - if (__pyx_t_7) { - __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_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_left_num); + __Pyx_GIVEREF(__pyx_v_left_num); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_left_num) != (0)) __PYX_ERR(0, 170, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 170, __pyx_L1_error); + __Pyx_INCREF(Py_False); + __Pyx_GIVEREF(Py_False); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, Py_False) != (0)) __PYX_ERR(0, 170, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + } else { + __pyx_t_2 = __pyx_cur_scope->__pyx_v_left; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_5 = 0; + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; + __pyx_t_4 = __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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); } - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /*else*/ { - __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __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, 170, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 170, __pyx_L1_error); __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); - __Pyx_XDECREF(__pyx_t_4); - if (__Pyx_PyErr_Occurred()) { - __Pyx_Generator_Replace_StopIteration(0); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_GIVEREF(Py_True); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_True) != (0)) __PYX_ERR(0, 170, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; } - __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/parser.py":187 - * return None - * - * def to_equality_constraint( # <<<<<<<<<<<<<< - * restriction: str, params: list[str] - * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: -*/ - -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_6_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_2generator4 = 0; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - Py_ssize_t __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - 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_6_to_equality_constraint *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_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_6_to_equality_constraint *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 187, __pyx_L1_error) + if (likely(__pyx_t_1 != Py_None)) { + PyObject* sequence = __pyx_t_1; + 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, 169, __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_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_4); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 169, __pyx_L1_error) } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *) __Pyx_CyFunction_GetClosure(__pyx_self); - __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); - __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); - __pyx_cur_scope->__pyx_v_params = __pyx_v_params; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_params); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_params); - /* "constraint/parser.py":192 - * """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): # <<<<<<<<<<<<<< - * return None + /* "constraint/parser.py":169 * + * # 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_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, 192, __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, 192, __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, 192, __pyx_L1_error) - } - __pyx_t_3 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 192, __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) { + __pyx_v_number = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v_variables = __pyx_t_4; + __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_variables_on_left, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/parser.py":193 - * # check if all parameters are involved - * if len(params) != len(tune_params): - * return None # <<<<<<<<<<<<<< + /* "constraint/parser.py":174 * - * # find whether (in)equalities appear in this restriction + * # if the number is an integer, we can map '>' to '>=' and '<' to '<=' by changing the number (does not work with floating points!) # noqa: E501 + * number_is_int = isinstance(number, int) # <<<<<<<<<<<<<< + * if number_is_int: + * if comparator == "<": */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + __pyx_t_7 = PyLong_Check(__pyx_v_number); + __pyx_v_number_is_int = __pyx_t_7; - /* "constraint/parser.py":192 - * """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): # <<<<<<<<<<<<<< - * return None - * + /* "constraint/parser.py":175 + * # if the number is an integer, we can map '>' to '>=' and '<' to '<=' by changing the number (does not work with floating points!) # noqa: E501 + * number_is_int = isinstance(number, int) + * if number_is_int: # <<<<<<<<<<<<<< + * if comparator == "<": + * if variables_on_left: */ - } + if (__pyx_v_number_is_int) { - /* "constraint/parser.py":196 - * - * # find whether (in)equalities appear in this restriction - * equalities_found = re.findall("==", restriction) # <<<<<<<<<<<<<< - * inequalities_found = re.findall("!=", restriction) - * # check if one of the two have been found, if none or both have been found, return None + /* "constraint/parser.py":176 + * number_is_int = isinstance(number, int) + * if number_is_int: + * if comparator == "<": # <<<<<<<<<<<<<< + * if variables_on_left: + * # (x < 2) == (x <= 2-1) */ - __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 196, __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, 196, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_8 = 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_8 = 0; - } - #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_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, 196, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } - __pyx_v_equalities_found = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 176, __pyx_L1_error) + if (__pyx_t_7) { - /* "constraint/parser.py":197 - * # find whether (in)equalities appear in this restriction - * equalities_found = re.findall("==", restriction) - * 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)): + /* "constraint/parser.py":177 + * if number_is_int: + * if comparator == "<": + * if variables_on_left: # <<<<<<<<<<<<<< + * # (x < 2) == (x <= 2-1) + * number -= 1 */ - __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __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, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); - assert(__pyx_t_7); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); - __pyx_t_8 = 0; - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u__14, __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_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, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } - __pyx_v_inequalities_found = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 177, __pyx_L1_error) + if (__pyx_t_7) { - /* "constraint/parser.py":199 - * 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] + /* "constraint/parser.py":179 + * if variables_on_left: + * # (x < 2) == (x <= 2-1) + * number -= 1 # <<<<<<<<<<<<<< + * else: + * # (2 < x) == (2+1 <= x) */ - __pyx_t_3 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 199, __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, 199, __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, 199, __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, 199, __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, 199, __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, 199, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_9 = (!__pyx_t_4); - if (__pyx_t_9) { + __pyx_t_1 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/parser.py":200 - * # 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] - * + /* "constraint/parser.py":177 + * if number_is_int: + * if comparator == "<": + * if variables_on_left: # <<<<<<<<<<<<<< + * # (x < 2) == (x <= 2-1) + * number -= 1 */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + goto __pyx_L37; + } - /* "constraint/parser.py":199 - * 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] + /* "constraint/parser.py":182 + * else: + * # (2 < x) == (2+1 <= x) + * number += 1 # <<<<<<<<<<<<<< + * elif comparator == ">": + * if variables_on_left: */ - } + /*else*/ { + __pyx_t_1 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_1); + __pyx_t_1 = 0; + } + __pyx_L37:; - /* "constraint/parser.py":201 - * 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 + /* "constraint/parser.py":176 + * number_is_int = isinstance(number, int) + * if number_is_int: + * if comparator == "<": # <<<<<<<<<<<<<< + * if variables_on_left: + * # (x < 2) == (x <= 2-1) */ - __pyx_t_3 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 201, __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); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __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); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __pyx_t_6; - __pyx_t_6 = 0; - } - __pyx_v_comparator = __pyx_t_7; - __pyx_t_7 = 0; + goto __pyx_L36; + } - /* "constraint/parser.py":204 - * - * # 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): + /* "constraint/parser.py":183 + * # (2 < x) == (2+1 <= x) + * number += 1 + * elif comparator == ">": # <<<<<<<<<<<<<< + * if variables_on_left: + * # (x > 2) == (x >= 2+1) */ - __pyx_t_7 = PyUnicode_Split(__pyx_v_restriction, __Pyx_NoneAsNull(__pyx_v_comparator), -1L); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_v_splitted = ((PyObject*)__pyx_t_7); - __pyx_t_7 = 0; + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 183, __pyx_L1_error) + if (__pyx_t_7) { - /* "constraint/parser.py":206 - * 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 == "==": + /* "constraint/parser.py":184 + * number += 1 + * elif comparator == ">": + * if variables_on_left: # <<<<<<<<<<<<<< + * # (x > 2) == (x >= 2+1) + * number += 1 */ - __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_splitted); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 206, __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, 206, __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) { - } else { - __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, 206, __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, 206, __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, 206, __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) { + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 184, __pyx_L1_error) + if (__pyx_t_7) { - /* "constraint/parser.py":208 - * 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 == "!=": + /* "constraint/parser.py":186 + * if variables_on_left: + * # (x > 2) == (x >= 2+1) + * number += 1 # <<<<<<<<<<<<<< + * else: + * # (2 > x) == (2-1 >= x) */ - __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, 208, __pyx_L1_error) - if (__pyx_t_9) { + __pyx_t_1 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/parser.py":209 - * # map to a Constraint - * if comparator == "==": - * return AllEqualConstraint() # <<<<<<<<<<<<<< - * elif comparator == "!=": - * return AllDifferentConstraint() + /* "constraint/parser.py":184 + * number += 1 + * elif comparator == ">": + * if variables_on_left: # <<<<<<<<<<<<<< + * # (x > 2) == (x >= 2+1) + * number += 1 */ - __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, 209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); - assert(__pyx_t_7); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); - __pyx_t_8 = 0; + goto __pyx_L38; } - #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_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, 209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + + /* "constraint/parser.py":189 + * else: + * # (2 > x) == (2-1 >= x) + * number -= 1 # <<<<<<<<<<<<<< + * + * # check if an operator is applied on the variables, if not return +*/ + /*else*/ { + __pyx_t_1 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_1); + __pyx_t_1 = 0; } - __pyx_r = __pyx_t_6; - __pyx_t_6 = 0; - goto __pyx_L0; + __pyx_L38:; - /* "constraint/parser.py":208 - * 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 == "!=": + /* "constraint/parser.py":183 + * # (2 < x) == (2+1 <= x) + * number += 1 + * elif comparator == ">": # <<<<<<<<<<<<<< + * if variables_on_left: + * # (x > 2) == (x >= 2+1) */ } + __pyx_L36:; - /* "constraint/parser.py":210 - * if comparator == "==": - * return AllEqualConstraint() - * elif comparator == "!=": # <<<<<<<<<<<<<< - * return AllDifferentConstraint() - * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") + /* "constraint/parser.py":175 + * # if the number is an integer, we can map '>' to '>=' and '<' to '<=' by changing the number (does not work with floating points!) # noqa: E501 + * number_is_int = isinstance(number, int) + * if number_is_int: # <<<<<<<<<<<<<< + * if comparator == "<": + * if variables_on_left: */ - __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 210, __pyx_L1_error) - if (__pyx_t_9) { + } - /* "constraint/parser.py":211 - * return AllEqualConstraint() - * elif comparator == "!=": - * return AllDifferentConstraint() # <<<<<<<<<<<<<< - * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") - * return None + /* "constraint/parser.py":192 + * + * # 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_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, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); - assert(__pyx_t_1); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); - __pyx_t_8 = 0; - } + __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __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_1, 0, __pyx_mstate_global->__pyx_kp_u__13) != (0)) __PYX_ERR(0, 192, __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_1, 1, __pyx_mstate_global->__pyx_kp_u__14) != (0)) __PYX_ERR(0, 192, __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_1, 2, __pyx_mstate_global->__pyx_kp_u__15) != (0)) __PYX_ERR(0, 192, __pyx_L1_error); + __pyx_v_operators = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/parser.py":193 + * # 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_3 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_operators); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = 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); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_4, __pyx_v_variables}; + __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_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __pyx_v_operators_found = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/parser.py":194 + * 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_6 = PyObject_Length(__pyx_v_operators_found); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_t_7 = (__pyx_t_6 == 0); + if (__pyx_t_7) { + + /* "constraint/parser.py":196 + * 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_1 = __pyx_cur_scope->__pyx_v_params; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 196, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = (__pyx_t_6 != 1); + if (!__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L41_bool_binop_done; + } + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_variables, __pyx_cur_scope->__pyx_v_params, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 196, __pyx_L1_error) + __pyx_t_7 = __pyx_t_8; + __pyx_L41_bool_binop_done:; + if (__pyx_t_7) { + + /* "constraint/parser.py":198 + * if len(params) != 1 or variables not in params: + * # there were more than one variable but no operator + * return None # <<<<<<<<<<<<<< + * # map to a Constraint + * # if there are restrictions with a single variable, it will be used to prune the domain at the start +*/ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "constraint/parser.py":196 + * 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 +*/ + } + + /* "constraint/parser.py":201 + * # 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 == "<" and number_is_int): +*/ + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 201, __pyx_L1_error) + if (__pyx_t_7) { + + /* "constraint/parser.py":202 + * # 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 == "<" and number_is_int): + * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) +*/ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __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[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_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, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_number}; + __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_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __pyx_r = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/parser.py":210 - * if comparator == "==": - * return AllEqualConstraint() - * elif comparator == "!=": # <<<<<<<<<<<<<< - * return AllDifferentConstraint() - * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") + /* "constraint/parser.py":201 + * # 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 == "<" and number_is_int): */ } - /* "constraint/parser.py":212 - * elif comparator == "!=": - * return AllDifferentConstraint() - * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") # <<<<<<<<<<<<<< - * return None - * + /* "constraint/parser.py":203 + * elif comparator == "==": + * return ExactSumConstraint(number) + * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< + * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) + * elif comparator == ">=" or (comparator == ">" and number_is_int): */ - __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, 212, __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, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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)); - __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, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 203, __pyx_L1_error) + if (!__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L43_bool_binop_done; } - __pyx_r = __pyx_t_6; - __pyx_t_6 = 0; - goto __pyx_L0; + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 203, __pyx_L1_error) + if (__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L43_bool_binop_done; + } + __pyx_t_7 = __pyx_v_number_is_int; + __pyx_L43_bool_binop_done:; + if (__pyx_t_7) { - /* "constraint/parser.py":206 - * 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 == "==": + /* "constraint/parser.py":204 + * return ExactSumConstraint(number) + * elif comparator == "<=" or (comparator == "<" and number_is_int): + * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< + * elif comparator == ">=" or (comparator == ">" and number_is_int): + * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) */ - } + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 204, __pyx_L1_error) + if (__pyx_t_7) { + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_number}; + __pyx_t_4 = __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_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + } else { + __pyx_t_3 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = 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); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_number}; + __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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "constraint/parser.py":213 - * return AllDifferentConstraint() - * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") - * return None # <<<<<<<<<<<<<< - * - * # remove functionally duplicate restrictions (preserves order and whitespace) + /* "constraint/parser.py":203 + * elif comparator == "==": + * return ExactSumConstraint(number) + * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< + * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) + * elif comparator == ">=" or (comparator == ">" and number_is_int): */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + } - /* "constraint/parser.py":187 - * return None - * - * def to_equality_constraint( # <<<<<<<<<<<<<< - * restriction: str, params: list[str] - * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: + /* "constraint/parser.py":205 + * elif comparator == "<=" or (comparator == "<" and number_is_int): + * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) + * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< + * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) + * raise ValueError(f"Invalid comparator {comparator}") */ + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 205, __pyx_L1_error) + if (!__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L46_bool_binop_done; + } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 205, __pyx_L1_error) + if (__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L46_bool_binop_done; + } + __pyx_t_7 = __pyx_v_number_is_int; + __pyx_L46_bool_binop_done:; + if (__pyx_t_7) { - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __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:; - __Pyx_XDECREF(__pyx_v_equalities_found); - __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_2generator4); - __Pyx_DECREF((PyObject *)__pyx_cur_scope); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "constraint/parser.py":216 + /* "constraint/parser.py":206 + * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) + * elif comparator == ">=" or (comparator == ">" and number_is_int): + * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) # <<<<<<<<<<<<<< + * raise ValueError(f"Invalid comparator {comparator}") * - * # 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] */ - -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_8_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_8_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_8_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); - 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, 216, __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_12generator5, ((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_genexp, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 216, __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.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_12generator5(__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; - 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, 216, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 216, __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, 216, __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, 216, __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); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_4 = PyUnicode_Check(__pyx_cur_scope->__pyx_v_r); - __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; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 206, __pyx_L1_error) + if (__pyx_t_7) { + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_number}; + __pyx_t_4 = __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_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + } else { + __pyx_t_3 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = 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); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_number}; + __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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_r = __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/parser.py":24 - * ) - * - * 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 + /* "constraint/parser.py":205 + * elif comparator == "<=" or (comparator == "<" and number_is_int): + * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) + * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< + * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) + * raise ValueError(f"Invalid comparator {comparator}") */ + } -static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_restrictions, PyObject *__pyx_v_tune_params) { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *__pyx_cur_scope; - PyObject *__pyx_v_regex_match_variable = NULL; - CYTHON_UNUSED PyObject *__pyx_v_replace_params = 0; - PyObject *__pyx_v_replace_params_split = 0; - PyObject *__pyx_v_to_multiple_restrictions = 0; - PyObject *__pyx_v_to_numeric_constraint = 0; - PyObject *__pyx_v_to_equality_constraint = 0; - PyObject *__pyx_v_restrictions_cleaned = NULL; - PyObject *__pyx_v_restrictions_cleaned_unique = NULL; - PyObject *__pyx_v_restrictions_unique_indices = NULL; - PyObject *__pyx_v_parsed_restrictions = NULL; - PyObject *__pyx_v_res = NULL; - 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_12generator5 = 0; - PyObject *__pyx_8genexpr8__pyx_v_r = NULL; - PyObject *__pyx_8genexpr9__pyx_v_r = NULL; - PyObject *__pyx_9genexpr10__pyx_v_i = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - size_t __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - int __pyx_t_11; - PyObject *__pyx_t_12[5]; - int __pyx_t_13; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("parse_restrictions", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct__parse_restrictions(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions, __pyx_mstate_global->__pyx_empty_tuple, NULL); - 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, 24, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_v_tune_params = __pyx_v_tune_params; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tune_params); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_tune_params); - __Pyx_INCREF(__pyx_v_restrictions); - - /* "constraint/parser.py":27 - * """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]*)" # <<<<<<<<<<<<<< + /* "constraint/parser.py":207 + * elif comparator == ">=" or (comparator == ">" and number_is_int): + * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) + * raise ValueError(f"Invalid comparator {comparator}") # <<<<<<<<<<<<<< * - * def replace_params(match_object): + * # check which operator is applied on the variables */ - __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_a_zA_Z__a_zA_Z__0_9); - __pyx_v_regex_match_variable = __pyx_mstate_global->__pyx_kp_u_a_zA_Z__a_zA_Z__0_9; + __pyx_t_4 = NULL; + __Pyx_INCREF(__pyx_builtin_ValueError); + __pyx_t_2 = __pyx_builtin_ValueError; + __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_comparator, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_10}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __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_10); __pyx_t_10 = 0; + __Pyx_DECREF(__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/parser.py":29 - * regex_match_variable = r"([a-zA-Z_$][a-zA-Z_$0-9]*)" - * - * def replace_params(match_object): # <<<<<<<<<<<<<< - * key = match_object.group(1) - * if key in tune_params: + /* "constraint/parser.py":194 + * 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_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[7])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_replace_params = __pyx_t_1; - __pyx_t_1 = 0; + } - /* "constraint/parser.py":37 - * return key + /* "constraint/parser.py":210 * - * def replace_params_split(match_object): # <<<<<<<<<<<<<< - * # careful: has side-effect of adding to set `params_used` - * key = match_object.group(1) + * # 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_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[8])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_operators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_replace_params_split = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_v_operator = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":47 - * 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() + /* "constraint/parser.py":211 + * # 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_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_20genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_operators_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __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, 47, __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, 47, __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[9])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_t_2 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __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; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = (!__pyx_t_7); + if (__pyx_t_8) { - /* "constraint/parser.py":72 - * return split_restrictions + /* "constraint/parser.py":213 + * 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 # <<<<<<<<<<<<<< * - * def to_numeric_constraint( # <<<<<<<<<<<<<< - * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: + * # split the string on the comparison */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __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, 72, __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, 72, __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, 72, __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, NULL, __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __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; + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; - /* "constraint/parser.py":187 - * return None - * - * def to_equality_constraint( # <<<<<<<<<<<<<< - * restriction: str, params: list[str] - * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: + /* "constraint/parser.py":211 + * # 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_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __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, 187, __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, 187, __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, 187, __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[11])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __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":216 * - * # 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] + * # 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_1 = __pyx_v_variables; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_5 = 0; + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_operator}; + __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_split, __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_2)) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_v_splitted = __pyx_t_2; + __pyx_t_2 = 0; + + /* "constraint/parser.py":218 + * 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_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(NULL, __pyx_v_restrictions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error) + __pyx_t_6 = PyObject_Length(__pyx_v_splitted); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_2 = __pyx_cur_scope->__pyx_v_params; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_12 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = (__pyx_t_6 == __pyx_t_12); + if (__pyx_t_7) { + } else { + __pyx_t_8 = __pyx_t_7; + goto __pyx_L51_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, 218, __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, 216, __pyx_L1_error) + __pyx_t_1 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __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, 216, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_3) { + __pyx_t_8 = __pyx_t_7; + __pyx_L51_bool_binop_done:; + if (__pyx_t_8) { - /* "constraint/parser.py":218 - * 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 - * # get the indices of the unique restrictions, use these to build a new list of restrictions + /* "constraint/parser.py":220 + * 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 */ - { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_v_restrictions; __Pyx_INCREF(__pyx_t_2); - __pyx_t_4 = 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, 218, __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_4; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_r, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr8__pyx_v_r, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 218, __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, 218, __pyx_L6_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_r); __pyx_8genexpr8__pyx_v_r = 0; - goto __pyx_L10_exit_scope; - __pyx_L6_error:; - __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_r); __pyx_8genexpr8__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; + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_kp_u__8, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 220, __pyx_L1_error) + if (__pyx_t_8) { - /* "constraint/parser.py":219 - * # 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 # <<<<<<<<<<<<<< - * # 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] + /* "constraint/parser.py":222 + * if operator == "**": + * # power operations are not (yet) supported, added to avoid matching the double asterisk + * return None # <<<<<<<<<<<<<< + * elif operator == "*": + * if comparator == "==": +*/ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "constraint/parser.py":220 + * 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_2 = ((PyObject *)(&PyDict_Type)); - __Pyx_INCREF(__pyx_t_2); - __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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __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, 219, __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":221 - * 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] - * + /* "constraint/parser.py":223 + * # power operations are not (yet) supported, added to avoid matching the double asterisk + * return None + * elif operator == "*": # <<<<<<<<<<<<<< + * if comparator == "==": + * return ExactProdConstraint(number) */ - { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __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; - 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, 221, __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_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 221, __pyx_L13_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_8genexpr9__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_8genexpr9__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 221, __pyx_L13_error) - __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 221, __pyx_L13_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_r); __pyx_8genexpr9__pyx_v_r = 0; - goto __pyx_L17_exit_scope; - __pyx_L13_error:; - __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_r); __pyx_8genexpr9__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; + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 223, __pyx_L1_error) + if (__pyx_t_8) { - /* "constraint/parser.py":222 - * # 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] # <<<<<<<<<<<<<< - * - * # create the parsed restrictions, split into multiple restrictions where possible + /* "constraint/parser.py":224 + * return None + * elif operator == "*": + * if comparator == "==": # <<<<<<<<<<<<<< + * return ExactProdConstraint(number) + * elif comparator == "<=" or (comparator == "<" and number_is_int): */ - { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __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; - for (;;) { + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 224, __pyx_L1_error) + if (__pyx_t_8) { + + /* "constraint/parser.py":225 + * elif operator == "*": + * if comparator == "==": + * return ExactProdConstraint(number) # <<<<<<<<<<<<<< + * elif comparator == "<=" or (comparator == "<" and number_is_int): + * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) +*/ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_10); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); + __pyx_t_5 = 0; + } + #endif { - 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_L20_error) - #endif - if (__pyx_t_4 >= __pyx_temp) break; + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_number}; + __pyx_t_1 = __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_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); - ++__pyx_t_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 222, __pyx_L20_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_i, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_restrictions, __pyx_9genexpr10__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 222, __pyx_L20_error) - __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 222, __pyx_L20_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_i); __pyx_9genexpr10__pyx_v_i = 0; - goto __pyx_L24_exit_scope; - __pyx_L20_error:; - __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_i); __pyx_9genexpr10__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; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "constraint/parser.py":216 - * - * # 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] + /* "constraint/parser.py":224 + * return None + * elif operator == "*": + * if comparator == "==": # <<<<<<<<<<<<<< + * return ExactProdConstraint(number) + * elif comparator == "<=" or (comparator == "<" and number_is_int): */ - } + } - /* "constraint/parser.py":225 - * - * # 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() + /* "constraint/parser.py":226 + * if comparator == "==": + * return ExactProdConstraint(number) + * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< + * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) + * elif comparator == ">=" or (comparator == ">" and number_is_int): */ - __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, 225, __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, 225, __pyx_L1_error) - __Pyx_DECREF_SET(__pyx_v_restrictions, ((PyObject*)__pyx_t_2)); - __pyx_t_2 = 0; - - /* "constraint/parser.py":227 - * 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, 227, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_parsed_restrictions = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 226, __pyx_L1_error) + if (!__pyx_t_7) { + } else { + __pyx_t_8 = __pyx_t_7; + goto __pyx_L55_bool_binop_done; + } + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 226, __pyx_L1_error) + if (__pyx_t_7) { + } else { + __pyx_t_8 = __pyx_t_7; + goto __pyx_L55_bool_binop_done; + } + __pyx_t_8 = __pyx_v_number_is_int; + __pyx_L55_bool_binop_done:; + if (__pyx_t_8) { - /* "constraint/parser.py":228 - * # split into functions that only take their relevant parameters - * parsed_restrictions = list() - * for res in restrictions: # <<<<<<<<<<<<<< - * params_used: set[str] = set() - * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() + /* "constraint/parser.py":227 + * return ExactProdConstraint(number) + * elif comparator == "<=" or (comparator == "<" and number_is_int): + * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) # <<<<<<<<<<<<<< + * elif comparator == ">=" or (comparator == ">" and number_is_int): + * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) */ - if (unlikely(__pyx_v_restrictions == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 228, __pyx_L1_error) - } - __pyx_t_2 = __pyx_v_restrictions; __Pyx_INCREF(__pyx_t_2); - __pyx_t_4 = 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, 228, __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_4; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 227, __pyx_L1_error) + if (__pyx_t_8) { + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __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[2] = {__pyx_t_2, __pyx_v_number}; + __pyx_t_10 = __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_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + } + __pyx_t_1 = __pyx_t_10; + __pyx_t_10 = 0; + } else { + __pyx_t_4 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_4); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_number}; + __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_2, __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_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + } + __pyx_t_1 = __pyx_t_10; + __pyx_t_10 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "constraint/parser.py":229 - * 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) + /* "constraint/parser.py":226 + * if comparator == "==": + * return ExactProdConstraint(number) + * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< + * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) + * elif comparator == ">=" or (comparator == ">" and number_is_int): */ - __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __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":230 - * 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) - * finalized_constraint = None + /* "constraint/parser.py":228 + * elif comparator == "<=" or (comparator == "<" and number_is_int): + * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) + * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< + * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) + * elif operator == "+": */ - __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 230, __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, 230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_7 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10); - assert(__pyx_t_8); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); - __pyx_t_7 = 0; - } - #endif - { - PyObject *__pyx_callargs[4] = {__pyx_t_8, __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_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, 230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - } - __pyx_t_6 = __pyx_t_5; - __Pyx_INCREF(__pyx_t_6); - __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_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, 230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_parsed_restriction, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 228, __pyx_L1_error) + if (!__pyx_t_7) { + } else { + __pyx_t_8 = __pyx_t_7; + goto __pyx_L58_bool_binop_done; + } + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 228, __pyx_L1_error) + if (__pyx_t_7) { + } else { + __pyx_t_8 = __pyx_t_7; + goto __pyx_L58_bool_binop_done; + } + __pyx_t_8 = __pyx_v_number_is_int; + __pyx_L58_bool_binop_done:; + if (__pyx_t_8) { - /* "constraint/parser.py":231 - * 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: + /* "constraint/parser.py":229 + * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) + * elif comparator == ">=" or (comparator == ">" and number_is_int): + * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) # <<<<<<<<<<<<<< + * elif operator == "+": + * if comparator == "==": */ - __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_v_params_used); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_params_used_list, ((PyObject*)__pyx_t_1)); - __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 229, __pyx_L1_error) + if (__pyx_t_8) { + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __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[2] = {__pyx_t_2, __pyx_v_number}; + __pyx_t_10 = __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_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + } + __pyx_t_1 = __pyx_t_10; + __pyx_t_10 = 0; + } else { + __pyx_t_4 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_4); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_number}; + __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_2, __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_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + } + __pyx_t_1 = __pyx_t_10; + __pyx_t_10 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "constraint/parser.py":232 - * 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: - * # if applicable, strip the outermost round brackets + /* "constraint/parser.py":228 + * elif comparator == "<=" or (comparator == "<" and number_is_int): + * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) + * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< + * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) + * elif operator == "+": */ - __Pyx_INCREF(Py_None); - __Pyx_XDECREF_SET(__pyx_v_finalized_constraint, Py_None); + } - /* "constraint/parser.py":233 - * 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 ( + /* "constraint/parser.py":223 + * # power operations are not (yet) supported, added to avoid matching the double asterisk + * return None + * elif operator == "*": # <<<<<<<<<<<<<< + * if comparator == "==": + * return ExactProdConstraint(number) */ - __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, 233, __pyx_L1_error) - if (__pyx_t_11) { - } else { - __pyx_t_3 = __pyx_t_11; - goto __pyx_L28_bool_binop_done; + goto __pyx_L53; } - __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, 233, __pyx_L1_error) - __pyx_t_3 = __pyx_t_11; - __pyx_L28_bool_binop_done:; - if (__pyx_t_3) { - /* "constraint/parser.py":235 - * if " or " not in res and " and " not in res: - * # if applicable, strip the outermost round brackets - * while ( # <<<<<<<<<<<<<< - * parsed_restriction[0] == "(" - * and parsed_restriction[-1] == ")" + /* "constraint/parser.py":230 + * elif comparator == ">=" or (comparator == ">" and number_is_int): + * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) + * elif operator == "+": # <<<<<<<<<<<<<< + * if comparator == "==": + * return ExactSumConstraint(number) */ - while (1) { + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_kp_u__10, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 230, __pyx_L1_error) + if (likely(__pyx_t_8)) { - /* "constraint/parser.py":236 - * # if applicable, strip the outermost round brackets - * while ( - * parsed_restriction[0] == "(" # <<<<<<<<<<<<<< - * and parsed_restriction[-1] == ")" - * and "(" not in parsed_restriction[1:] + /* "constraint/parser.py":231 + * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) + * elif operator == "+": + * if comparator == "==": # <<<<<<<<<<<<<< + * return ExactSumConstraint(number) + * elif comparator == "<=" or (comparator == "<" and number_is_int): */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parsed_restriction, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 236, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_11) { - } else { - __pyx_t_3 = __pyx_t_11; - goto __pyx_L32_bool_binop_done; - } + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 231, __pyx_L1_error) + if (__pyx_t_8) { - /* "constraint/parser.py":237 - * while ( - * parsed_restriction[0] == "(" - * and parsed_restriction[-1] == ")" # <<<<<<<<<<<<<< - * and "(" not in parsed_restriction[1:] - * and ")" not in parsed_restriction[:1] + /* "constraint/parser.py":232 + * elif operator == "+": + * if comparator == "==": + * return ExactSumConstraint(number) # <<<<<<<<<<<<<< + * elif comparator == "<=" or (comparator == "<" and number_is_int): + * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parsed_restriction, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_11) { - } else { - __pyx_t_3 = __pyx_t_11; - goto __pyx_L32_bool_binop_done; + __Pyx_XDECREF(__pyx_r); + __pyx_t_10 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_10); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_number}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __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_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "constraint/parser.py":238 - * parsed_restriction[0] == "(" - * and parsed_restriction[-1] == ")" - * and "(" not in parsed_restriction[1:] # <<<<<<<<<<<<<< - * and ")" not in parsed_restriction[:1] - * ): + /* "constraint/parser.py":231 + * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) + * elif operator == "+": + * if comparator == "==": # <<<<<<<<<<<<<< + * return ExactSumConstraint(number) + * elif comparator == "<=" or (comparator == "<" and number_is_int): */ - __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, 238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u__17, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 238, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_11) { - } else { - __pyx_t_3 = __pyx_t_11; - goto __pyx_L32_bool_binop_done; - } + } - /* "constraint/parser.py":239 - * and parsed_restriction[-1] == ")" - * and "(" not in parsed_restriction[1:] - * and ")" not in parsed_restriction[:1] # <<<<<<<<<<<<<< - * ): - * parsed_restriction = parsed_restriction[1:-1] + /* "constraint/parser.py":233 + * if comparator == "==": + * return ExactSumConstraint(number) + * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< + * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) + * elif comparator == ">=" or (comparator == ">" and number_is_int): */ - __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, 239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u__18, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 239, __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; + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 233, __pyx_L1_error) + if (!__pyx_t_7) { + } else { + __pyx_t_8 = __pyx_t_7; + goto __pyx_L62_bool_binop_done; + } + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 233, __pyx_L1_error) + if (__pyx_t_7) { + } else { + __pyx_t_8 = __pyx_t_7; + goto __pyx_L62_bool_binop_done; + } + __pyx_t_8 = __pyx_v_number_is_int; + __pyx_L62_bool_binop_done:; + if (__pyx_t_8) { - /* "constraint/parser.py":241 - * 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) + /* "constraint/parser.py":234 + * return ExactSumConstraint(number) + * elif comparator == "<=" or (comparator == "<" and number_is_int): + * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< + * elif comparator == ">=" or (comparator == ">" and number_is_int): + * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) */ - __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, 241, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_parsed_restriction, __pyx_t_1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 234, __pyx_L1_error) + if (__pyx_t_8) { + __pyx_t_10 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4); + assert(__pyx_t_10); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_number}; + __pyx_t_2 = __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_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } else { + __pyx_t_4 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10); + assert(__pyx_t_4); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_number}; + __pyx_t_2 = __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_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } + __pyx_r = __pyx_t_1; __pyx_t_1 = 0; - } + goto __pyx_L0; - /* "constraint/parser.py":243 - * 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 + /* "constraint/parser.py":233 + * if comparator == "==": + * return ExactSumConstraint(number) + * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< + * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) + * elif comparator == ">=" or (comparator == ">" and number_is_int): */ - if (!(likely(PyUnicode_CheckExact(__pyx_v_parsed_restriction))||((__pyx_v_parsed_restriction) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_parsed_restriction))) __PYX_ERR(0, 243, __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, 243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_1); - __pyx_t_1 = 0; + } - /* "constraint/parser.py":244 - * # 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 - * finalized_constraint = to_equality_constraint(parsed_restriction, params_used_list) + /* "constraint/parser.py":235 + * elif comparator == "<=" or (comparator == "<" and number_is_int): + * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) + * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< + * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) + * else: */ - __pyx_t_3 = (__pyx_v_finalized_constraint == Py_None); - if (__pyx_t_3) { + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 235, __pyx_L1_error) + if (!__pyx_t_7) { + } else { + __pyx_t_8 = __pyx_t_7; + goto __pyx_L65_bool_binop_done; + } + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 235, __pyx_L1_error) + if (__pyx_t_7) { + } else { + __pyx_t_8 = __pyx_t_7; + goto __pyx_L65_bool_binop_done; + } + __pyx_t_8 = __pyx_v_number_is_int; + __pyx_L65_bool_binop_done:; + if (__pyx_t_8) { - /* "constraint/parser.py":246 - * 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 + /* "constraint/parser.py":236 + * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) + * elif comparator == ">=" or (comparator == ">" and number_is_int): + * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) # <<<<<<<<<<<<<< + * else: + * raise ValueError(f"Invalid operator {operator}") */ - if (!(likely(PyUnicode_CheckExact(__pyx_v_parsed_restriction))||((__pyx_v_parsed_restriction) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_parsed_restriction))) __PYX_ERR(0, 246, __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, 246, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 236, __pyx_L1_error) + if (__pyx_t_8) { + __pyx_t_10 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4); + assert(__pyx_t_10); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_number}; + __pyx_t_2 = __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_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } else { + __pyx_t_4 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10); + assert(__pyx_t_4); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_number}; + __pyx_t_2 = __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_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } + __pyx_r = __pyx_t_1; __pyx_t_1 = 0; + goto __pyx_L0; - /* "constraint/parser.py":244 - * # 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 - * finalized_constraint = to_equality_constraint(parsed_restriction, params_used_list) + /* "constraint/parser.py":235 + * elif comparator == "<=" or (comparator == "<" and number_is_int): + * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) + * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< + * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) + * else: */ } - /* "constraint/parser.py":233 - * 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 ( + /* "constraint/parser.py":230 + * elif comparator == ">=" or (comparator == ">" and number_is_int): + * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) + * elif operator == "+": # <<<<<<<<<<<<<< + * if comparator == "==": + * return ExactSumConstraint(number) */ + goto __pyx_L53; } - /* "constraint/parser.py":247 - * # 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 - * finalized_constraint = f"def r({', '.join(params_used_list)}): return {parsed_restriction} \n" -*/ - __pyx_t_3 = (__pyx_v_finalized_constraint == Py_None); - if (__pyx_t_3) { - - /* "constraint/parser.py":249 - * 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)) + /* "constraint/parser.py":238 + * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) + * else: + * raise ValueError(f"Invalid operator {operator}") # <<<<<<<<<<<<<< + * return None * */ - __pyx_t_1 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__19, __pyx_v_params_used_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __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, 249, __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; - __pyx_t_12[2] = __pyx_mstate_global->__pyx_kp_u_return_2; - __pyx_t_12[3] = __pyx_t_5; - __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u__20; - __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, 249, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + /*else*/ { + __pyx_t_2 = NULL; + __Pyx_INCREF(__pyx_builtin_ValueError); + __pyx_t_10 = __pyx_builtin_ValueError; + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_operator, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; + __pyx_t_1 = __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_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __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_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_6); - __pyx_t_6 = 0; + __PYX_ERR(0, 238, __pyx_L1_error) + } + __pyx_L53:; - /* "constraint/parser.py":247 - * # 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 - * finalized_constraint = f"def r({', '.join(params_used_list)}): return {parsed_restriction} \n" + /* "constraint/parser.py":218 + * 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 == "**": */ - } + } - /* "constraint/parser.py":250 - * # 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)) # <<<<<<<<<<<<<< + /* "constraint/parser.py":239 + * else: + * raise ValueError(f"Invalid operator {operator}") + * return None # <<<<<<<<<<<<<< * - * return parsed_restrictions -*/ - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __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, 250, __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, 250, __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, 250, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "constraint/parser.py":228 - * # split into functions that only take their relevant parameters - * parsed_restrictions = list() - * for res in restrictions: # <<<<<<<<<<<<<< - * params_used: set[str] = set() - * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() -*/ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "constraint/parser.py":252 - * 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 + * def to_equality_constraint( */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_parsed_restrictions); - __pyx_r = __pyx_v_parsed_restrictions; + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":24 - * ) + /* "constraint/parser.py":75 + * return split_restrictions * - * 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 to_numeric_constraint( # <<<<<<<<<<<<<< + * restriction: str, params: list[str] + * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("constraint.parser.parse_restrictions", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("constraint.parser.parse_restrictions.to_numeric_constraint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_regex_match_variable); - __Pyx_XDECREF(__pyx_v_replace_params); - __Pyx_XDECREF(__pyx_v_replace_params_split); - __Pyx_XDECREF(__pyx_v_to_multiple_restrictions); - __Pyx_XDECREF(__pyx_v_to_numeric_constraint); - __Pyx_XDECREF(__pyx_v_to_equality_constraint); - __Pyx_XDECREF(__pyx_v_restrictions_cleaned); - __Pyx_XDECREF(__pyx_v_restrictions_cleaned_unique); - __Pyx_XDECREF(__pyx_v_restrictions_unique_indices); - __Pyx_XDECREF(__pyx_v_parsed_restrictions); - __Pyx_XDECREF(__pyx_v_res); - __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_12generator5); - __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_r); - __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_r); - __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_i); - __Pyx_XDECREF(__pyx_v_restrictions); + __Pyx_XDECREF(__pyx_v_comparators); + __Pyx_XDECREF(__pyx_v_comparators_found); + __Pyx_XDECREF(__pyx_v_comparator); + __Pyx_XDECREF(__pyx_v_unique_operators_left); + __Pyx_XDECREF(__pyx_v_unique_operators_right); + __Pyx_XDECREF(__pyx_v_unique_operators); + __Pyx_XDECREF(__pyx_v_variables_on_left); + __Pyx_XDECREF(__pyx_v_swapped_side_first_variable); + __Pyx_XDECREF(__pyx_v_right_remainder); + __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); + __Pyx_XDECREF(__pyx_v_number); + __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_7generator1); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator2); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_13generator3); + __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_s); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_16generator4); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_19generator5); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_22generator6); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_25generator7); + __Pyx_XDECREF(__pyx_v_restriction); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/parser.py":254 - * return parsed_restrictions - * - * 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. +/* "constraint/parser.py":241 + * return None * + * def to_equality_constraint( # <<<<<<<<<<<<<< + * restriction: str, params: list[str] + * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_6parser_3compile_to_constraints(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_9to_equality_constraint(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_2compile_to_constraints, "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.\n\n Args:\n constraints (list[str]): list of constraints in string format to compile.\n domains (dict): the domains to use.\n picklable (bool, optional): whether to keep constraints such that they can be pickled for parallel solvers. Defaults to False.\n\n Returns:\n 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.\n "); -static PyMethodDef __pyx_mdef_10constraint_6parser_3compile_to_constraints = {"compile_to_constraints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_3compile_to_constraints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6parser_2compile_to_constraints}; -static PyObject *__pyx_pw_10constraint_6parser_3compile_to_constraints(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10constraint_6parser_18parse_restrictions_8to_equality_constraint, "Converts a restriction to either an equality or inequality constraint on all the parameters if possible."); +static PyMethodDef __pyx_mdef_10constraint_6parser_18parse_restrictions_9to_equality_constraint = {"to_equality_constraint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_18parse_restrictions_9to_equality_constraint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6parser_18parse_restrictions_8to_equality_constraint}; +static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_9to_equality_constraint(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_constraints = 0; - PyObject *__pyx_v_domains = 0; - PyObject *__pyx_v_picklable = 0; + PyObject *__pyx_v_restriction = 0; + PyObject *__pyx_v_params = 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}; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("compile_to_constraints (wrapper)", 0); + __Pyx_RefNannySetupContext("to_equality_constraint (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -9181,68 +9267,54 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - 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}; + 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, 254, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 241, __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, 254, __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, 254, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 241, __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, 254, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 241, __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, 254, __pyx_L3_error) - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + 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, 241, __pyx_L3_error) 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, 254, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_equality_constraint", 1, 2, 2, i); __PYX_ERR(0, 241, __pyx_L3_error) } } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_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, 254, __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, 254, __pyx_L3_error) - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 254, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_error; - } - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 241, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 241, __pyx_L3_error) } - __pyx_v_constraints = ((PyObject*)values[0]); - __pyx_v_domains = ((PyObject*)values[1]); - __pyx_v_picklable = values[2]; + __pyx_v_restriction = ((PyObject*)values[0]); + __pyx_v_params = ((PyObject*)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("compile_to_constraints", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 254, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("to_equality_constraint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 241, __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.compile_to_constraints", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.parser.parse_restrictions.to_equality_constraint", __pyx_clineno, __pyx_lineno, __pyx_filename); __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, 254, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 254, __pyx_L1_error) - __pyx_r = __pyx_pf_10constraint_6parser_2compile_to_constraints(__pyx_self, __pyx_v_constraints, __pyx_v_domains, __pyx_v_picklable); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restriction), (&PyUnicode_Type), 0, "restriction", 2))) __PYX_ERR(0, 242, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 242, __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 */ goto __pyx_L0; @@ -9260,533 +9332,2846 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* 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) { - PyObject *__pyx_v_parsed_restrictions = NULL; - PyObject *__pyx_v_compiled_constraints = 0; - PyObject *__pyx_v_restriction = NULL; - PyObject *__pyx_v_params_used = NULL; - PyObject *__pyx_v_constraint = NULL; - PyObject *__pyx_v_code_object = NULL; - PyObject *__pyx_v_func = NULL; +/* "constraint/parser.py":260 + * 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 == "==": +*/ + +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_11_genexpr *__pyx_cur_scope; 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; - 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)(PyObject *); - int __pyx_t_10; - 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":265 - * 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 - * parsed_restrictions = parse_restrictions(constraints, domains) # <<<<<<<<<<<<<< - * compiled_constraints: list[tuple[Constraint, list[str], Union[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, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - assert(__pyx_t_2); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); - __pyx_t_4 = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __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_11_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 260, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - #endif + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_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); { - 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_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, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator8, ((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_equ, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; } - __pyx_v_parsed_restrictions = __pyx_t_1; - __pyx_t_1 = 0; - /* "constraint/parser.py":266 - * """ # noqa: E501 - * parsed_restrictions = parse_restrictions(constraints, domains) - * compiled_constraints: list[tuple[Constraint, list[str], Union[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, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_compiled_constraints = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.parser.parse_restrictions.to_equality_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; +} - /* "constraint/parser.py":267 - * parsed_restrictions = parse_restrictions(constraints, domains) - * compiled_constraints: list[tuple[Constraint, list[str], Union[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 -*/ - if (likely(PyList_CheckExact(__pyx_v_parsed_restrictions)) || PyTuple_CheckExact(__pyx_v_parsed_restrictions)) { - __pyx_t_1 = __pyx_v_parsed_restrictions; __Pyx_INCREF(__pyx_t_1); - __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, 267, __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, 267, __pyx_L1_error) +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + 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; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + size_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + 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, 260, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 260, __pyx_L1_error) } + __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; for (;;) { - if (likely(!__pyx_t_6)) { - 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, 267, __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_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, 267, __pyx_L1_error) - #endif - 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_5)); - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); - #endif - ++__pyx_t_5; - } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __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, 267, __pyx_L1_error) - PyErr_Clear(); - } - break; - } + { + 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) + #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, 260, __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; - 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, 267, __pyx_L1_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_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, 267, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 267, __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, 267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 267, __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, 267, __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); - index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; - __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, 267, __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; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 267, __pyx_L1_error) - __pyx_L6_unpacking_done:; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_4 = __pyx_cur_scope->__pyx_v_s; + __Pyx_INCREF(__pyx_t_4); + __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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_XDECREF_SET(__pyx_v_restriction, __pyx_t_2); - __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_params_used, __pyx_t_7); - __pyx_t_7 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 260, __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, 260, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = (!__pyx_t_6); + if (__pyx_t_7) { + __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); - /* "constraint/parser.py":268 - * compiled_constraints: list[tuple[Constraint, list[str], Union[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 - * if picklable: + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __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/parser.py":241 + * return None + * + * def to_equality_constraint( # <<<<<<<<<<<<<< + * restriction: str, params: list[str] + * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: */ - __pyx_t_10 = PyUnicode_Check(__pyx_v_restriction); - if (__pyx_t_10) { - /* "constraint/parser.py":270 - * if isinstance(restriction, str): - * # if it's a string, wrap it in a (compilable or compiled) function constraint - * if picklable: # <<<<<<<<<<<<<< - * constraint = CompilableFunctionConstraint(restriction) - * else: +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_10_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_2generator8 = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + 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_10_to_equality_constraint *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_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_10_to_equality_constraint *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 241, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *) __Pyx_CyFunction_GetClosure(__pyx_self); + __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); + __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); + __pyx_cur_scope->__pyx_v_params = __pyx_v_params; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_params); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_params); + + /* "constraint/parser.py":246 + * """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): # <<<<<<<<<<<<<< + * return None + * */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_picklable); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 270, __pyx_L1_error) - if (__pyx_t_10) { + __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, 246, __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, 246, __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, 246, __pyx_L1_error) + } + __pyx_t_3 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 246, __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":271 - * # if it's a string, wrap it in a (compilable or compiled) function constraint - * if picklable: - * constraint = CompilableFunctionConstraint(restriction) # <<<<<<<<<<<<<< - * else: - * code_object = compile(restriction, "", "exec") + /* "constraint/parser.py":247 + * # check if all parameters are involved + * if len(params) != len(tune_params): + * return None # <<<<<<<<<<<<<< + * + * # find whether (in)equalities appear in this restriction */ - __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __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); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); - __pyx_t_4 = 0; - } - #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_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, 271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; - /* "constraint/parser.py":270 - * if isinstance(restriction, str): - * # if it's a string, wrap it in a (compilable or compiled) function constraint - * if picklable: # <<<<<<<<<<<<<< - * constraint = CompilableFunctionConstraint(restriction) - * else: + /* "constraint/parser.py":246 + * """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): # <<<<<<<<<<<<<< + * return None + * */ - goto __pyx_L8; - } + } - /* "constraint/parser.py":273 - * constraint = CompilableFunctionConstraint(restriction) - * else: - * code_object = compile(restriction, "", "exec") # <<<<<<<<<<<<<< - * func = FunctionType(code_object.co_consts[0], globals()) - * constraint = FunctionConstraint(func) + /* "constraint/parser.py":250 + * + * # find whether (in)equalities appear in this restriction + * equalities_found = re.findall("==", restriction) # <<<<<<<<<<<<<< + * inequalities_found = re.findall("!=", restriction) + * # check if one of the two have been found, if none or both have been found, return None */ - /*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_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, 273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_XDECREF_SET(__pyx_v_code_object, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __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, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = 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_8 = 0; + } + #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_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, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __pyx_v_equalities_found = __pyx_t_1; + __pyx_t_1 = 0; - /* "constraint/parser.py":274 - * else: - * code_object = compile(restriction, "", "exec") - * func = FunctionType(code_object.co_consts[0], globals()) # <<<<<<<<<<<<<< - * constraint = FunctionConstraint(func) - * compiled_constraints.append((constraint, params_used, restriction)) + /* "constraint/parser.py":251 + * # find whether (in)equalities appear in this restriction + * equalities_found = re.findall("==", restriction) + * 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)): */ - __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __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, 274, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 274, __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, 274, __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); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __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; - __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, 274, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_3); - __pyx_t_3 = 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, 251, __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, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + assert(__pyx_t_7); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); + __pyx_t_8 = 0; + } + #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_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, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __pyx_v_inequalities_found = __pyx_t_1; + __pyx_t_1 = 0; - /* "constraint/parser.py":275 - * 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): + /* "constraint/parser.py":253 + * 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_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 275, __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); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_2); - __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; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_3); - __pyx_t_3 = 0; - } - __pyx_L8:; + __pyx_t_3 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 253, __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, 253, __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, 253, __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, 253, __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, 253, __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, 253, __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":276 - * 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 + /* "constraint/parser.py":254 + * # 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 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __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, 276, __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, 276, __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, 276, __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, 276, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; - /* "constraint/parser.py":268 - * compiled_constraints: list[tuple[Constraint, list[str], Union[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 - * if picklable: + /* "constraint/parser.py":253 + * 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] */ - goto __pyx_L7; - } + } - /* "constraint/parser.py":277 - * 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)) + /* "constraint/parser.py":255 + * 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_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __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, 277, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (likely(__pyx_t_10)) { + __pyx_t_3 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 255, __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); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __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); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_v_comparator = __pyx_t_7; + __pyx_t_7 = 0; - /* "constraint/parser.py":279 - * 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)}") + /* "constraint/parser.py":258 + * + * # 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_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __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, 279, __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, 279, __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, 279, __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, 279, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = PyUnicode_Split(__pyx_v_restriction, __Pyx_NoneAsNull(__pyx_v_comparator), -1L); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_v_splitted = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/parser.py":277 - * 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)) + /* "constraint/parser.py":260 + * 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 == "==": */ - goto __pyx_L7; - } + __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_splitted); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 260, __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, 260, __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) { + } else { + __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, 260, __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, 260, __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, 260, __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":281 - * compiled_constraints.append((restriction, params_used, None)) - * else: - * raise ValueError(f"Restriction {restriction} is neither a string or Constraint {type(restriction)}") # <<<<<<<<<<<<<< - * - * # return the restrictions and used parameters + /* "constraint/parser.py":262 + * 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 == "!=": */ - /*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, 281, __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, 281, __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, 262, __pyx_L1_error) + if (__pyx_t_9) { + + /* "constraint/parser.py":263 + * # map to a Constraint + * if comparator == "==": + * return AllEqualConstraint() # <<<<<<<<<<<<<< + * elif comparator == "!=": + * return AllDifferentConstraint() +*/ + __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, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); + assert(__pyx_t_7); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); + __pyx_t_8 = 0; + } + #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_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, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + } + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "constraint/parser.py":262 + * 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 == "!=": +*/ + } + + /* "constraint/parser.py":264 + * 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, 264, __pyx_L1_error) + if (__pyx_t_9) { + + /* "constraint/parser.py":265 + * return AllEqualConstraint() + * elif comparator == "!=": + * return AllDifferentConstraint() # <<<<<<<<<<<<<< + * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") + * return None +*/ + __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, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_Restriction; - __pyx_t_13[1] = __pyx_t_11; - __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, 281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_4 = 1; + __pyx_t_8 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); + assert(__pyx_t_1); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __pyx_t_8 = 0; + } + #endif { - 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)); - __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, 281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + 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_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, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); } - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "constraint/parser.py":264 + * if comparator == "==": + * return AllEqualConstraint() + * elif comparator == "!=": # <<<<<<<<<<<<<< + * return AllDifferentConstraint() + * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") +*/ } - __pyx_L7:; - /* "constraint/parser.py":267 - * parsed_restrictions = parse_restrictions(constraints, domains) - * compiled_constraints: list[tuple[Constraint, list[str], Union[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 + /* "constraint/parser.py":266 + * elif comparator == "!=": + * return AllDifferentConstraint() + * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") # <<<<<<<<<<<<<< + * return None + * +*/ + __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, 266, __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, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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)); + __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, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + } + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "constraint/parser.py":260 + * 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":284 + /* "constraint/parser.py":267 + * return AllDifferentConstraint() + * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") + * return None # <<<<<<<<<<<<<< * - * # return the restrictions and used parameters - * return compiled_constraints # <<<<<<<<<<<<<< + * # remove functionally duplicate restrictions (preserves order and whitespace) */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_compiled_constraints); - __pyx_r = __pyx_v_compiled_constraints; + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":254 - * return parsed_restrictions - * - * 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. + /* "constraint/parser.py":241 + * return None * + * def to_equality_constraint( # <<<<<<<<<<<<<< + * restriction: str, params: list[str] + * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: */ /* 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_5); + __Pyx_XDECREF(__pyx_t_6); __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_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("constraint.parser.parse_restrictions.to_equality_constraint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_parsed_restrictions); - __Pyx_XDECREF(__pyx_v_compiled_constraints); - __Pyx_XDECREF(__pyx_v_restriction); - __Pyx_XDECREF(__pyx_v_params_used); - __Pyx_XDECREF(__pyx_v_constraint); - __Pyx_XDECREF(__pyx_v_code_object); - __Pyx_XDECREF(__pyx_v_func); + __Pyx_XDECREF(__pyx_v_equalities_found); + __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_2generator8); + __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* #### Code section: module_exttypes ### */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "constraint/parser.py":270 + * + * # 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] +*/ + +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_12_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); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 270, __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_12generator9, ((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_genexp, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 270, __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.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_12generator9(__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); + 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, 270, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 270, __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, 270, __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, 270, __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); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_4 = PyUnicode_Check(__pyx_cur_scope->__pyx_v_r); + __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/parser.py":27 + * ) + * + * 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 +*/ + +static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_restrictions, PyObject *__pyx_v_tune_params) { + struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *__pyx_cur_scope; + CYTHON_UNUSED PyObject *__pyx_v_replace_params = 0; + PyObject *__pyx_v_replace_params_split = 0; + PyObject *__pyx_v_to_multiple_restrictions = 0; + PyObject *__pyx_v_to_numeric_constraint = 0; + PyObject *__pyx_v_to_equality_constraint = 0; + PyObject *__pyx_v_restrictions_cleaned = NULL; + PyObject *__pyx_v_restrictions_cleaned_unique = NULL; + PyObject *__pyx_v_restrictions_unique_indices = NULL; + PyObject *__pyx_v_parsed_restrictions = NULL; + PyObject *__pyx_v_res = NULL; + 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_12generator9 = 0; + PyObject *__pyx_9genexpr12__pyx_v_r = NULL; + PyObject *__pyx_9genexpr13__pyx_v_r = NULL; + PyObject *__pyx_9genexpr14__pyx_v_i = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + size_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + PyObject *__pyx_t_12[5]; + int __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("parse_restrictions", 0); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct__parse_restrictions(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions, __pyx_mstate_global->__pyx_empty_tuple, NULL); + 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, 27, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_v_tune_params = __pyx_v_tune_params; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tune_params); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_tune_params); + __Pyx_INCREF(__pyx_v_restrictions); + + /* "constraint/parser.py":30 + * """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]*)" # <<<<<<<<<<<<<< + * + * def replace_params(match_object): +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_a_zA_Z__a_zA_Z__0_9); + __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":32 + * regex_match_variable = r"([a-zA-Z_$][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[11])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_replace_params = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/parser.py":40 + * 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[12])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_replace_params_split = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/parser.py":50 + * 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, 50, __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, 50, __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, 50, __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[13])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __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":75 + * return split_restrictions + * + * def to_numeric_constraint( # <<<<<<<<<<<<<< + * restriction: str, params: list[str] + * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: +*/ + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __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, 75, __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, 75, __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, 75, __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[14])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __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":241 + * return None + * + * def to_equality_constraint( # <<<<<<<<<<<<<< + * restriction: str, params: list[str] + * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: +*/ + __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __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, 241, __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, 241, __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, 241, __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[15])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __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":270 + * + * # 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] +*/ + __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(NULL, __pyx_v_restrictions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __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, 270, __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, 270, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "constraint/parser.py":272 + * 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 + * # 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, 272, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_restrictions; __Pyx_INCREF(__pyx_t_2); + __pyx_t_4 = 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, 272, __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_4; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_r, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr12__pyx_v_r, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __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, 272, __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, 272, __pyx_L6_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_r); __pyx_9genexpr12__pyx_v_r = 0; + goto __pyx_L10_exit_scope; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_r); __pyx_9genexpr12__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":273 + * # 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 # <<<<<<<<<<<<<< + * # 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] +*/ + __pyx_t_2 = ((PyObject *)(&PyDict_Type)); + __Pyx_INCREF(__pyx_t_2); + __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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __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, 273, __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":275 + * 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, 275, __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; + 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, 275, __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_4; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr13__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_9genexpr13__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 275, __pyx_L13_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_r); __pyx_9genexpr13__pyx_v_r = 0; + goto __pyx_L17_exit_scope; + __pyx_L13_error:; + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_r); __pyx_9genexpr13__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":276 + * # 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] # <<<<<<<<<<<<<< + * + * # 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, 276, __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; + 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, 276, __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_4; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_i, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_restrictions, __pyx_9genexpr14__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 276, __pyx_L20_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_i); __pyx_9genexpr14__pyx_v_i = 0; + goto __pyx_L24_exit_scope; + __pyx_L20_error:; + __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_i); __pyx_9genexpr14__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":270 + * + * # 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] +*/ + } + + /* "constraint/parser.py":279 + * + * # 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, 279, __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, 279, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_restrictions, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "constraint/parser.py":281 + * 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, 281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_parsed_restrictions = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "constraint/parser.py":282 + * # split into functions that only take their relevant parameters + * parsed_restrictions = list() + * for res in restrictions: # <<<<<<<<<<<<<< + * params_used: set[str] = set() + * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() +*/ + if (unlikely(__pyx_v_restrictions == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 282, __pyx_L1_error) + } + __pyx_t_2 = __pyx_v_restrictions; __Pyx_INCREF(__pyx_t_2); + __pyx_t_4 = 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, 282, __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_4; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/parser.py":283 + * 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, 283, __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":284 + * 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) + * 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, 284, __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, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_7 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10); + assert(__pyx_t_8); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); + __pyx_t_7 = 0; + } + #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_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, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + } + __pyx_t_6 = __pyx_t_5; + __Pyx_INCREF(__pyx_t_6); + __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_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, 284, __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":285 + * 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, 285, __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":286 + * 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: + * # if applicable, strip the outermost round brackets +*/ + __Pyx_INCREF(Py_None); + __Pyx_XDECREF_SET(__pyx_v_finalized_constraint, Py_None); + + /* "constraint/parser.py":287 + * 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, 287, __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, 287, __pyx_L1_error) + __pyx_t_3 = __pyx_t_11; + __pyx_L28_bool_binop_done:; + if (__pyx_t_3) { + + /* "constraint/parser.py":289 + * if " or " not in res and " and " not in res: + * # if applicable, strip the outermost round brackets + * while ( # <<<<<<<<<<<<<< + * parsed_restriction[0] == "(" + * and parsed_restriction[-1] == ")" +*/ + while (1) { + + /* "constraint/parser.py":290 + * # 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); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __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, 290, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_11) { + } else { + __pyx_t_3 = __pyx_t_11; + goto __pyx_L32_bool_binop_done; + } + + /* "constraint/parser.py":291 + * 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); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __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, 291, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_11) { + } else { + __pyx_t_3 = __pyx_t_11; + goto __pyx_L32_bool_binop_done; + } + + /* "constraint/parser.py":292 + * 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, 292, __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, 292, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_11) { + } else { + __pyx_t_3 = __pyx_t_11; + goto __pyx_L32_bool_binop_done; + } + + /* "constraint/parser.py":293 + * 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, 293, __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, 293, __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":295 + * 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, 295, __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":297 + * 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, 297, __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, 297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/parser.py":298 + * # 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 + * finalized_constraint = to_equality_constraint(parsed_restriction, params_used_list) +*/ + __pyx_t_3 = (__pyx_v_finalized_constraint == Py_None); + if (__pyx_t_3) { + + /* "constraint/parser.py":300 + * 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, 300, __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, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/parser.py":298 + * # 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 + * finalized_constraint = to_equality_constraint(parsed_restriction, params_used_list) +*/ + } + + /* "constraint/parser.py":287 + * 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 ( +*/ + } + + /* "constraint/parser.py":301 + * # 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 + * finalized_constraint = f"def r({', '.join(params_used_list)}): return {parsed_restriction} \n" +*/ + __pyx_t_3 = (__pyx_v_finalized_constraint == Py_None); + if (__pyx_t_3) { + + /* "constraint/parser.py":303 + * 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, 303, __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, 303, __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; + __pyx_t_12[2] = __pyx_mstate_global->__pyx_kp_u_return_2; + __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, 303, __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":301 + * # 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 + * finalized_constraint = f"def r({', '.join(params_used_list)}): return {parsed_restriction} \n" +*/ + } + + /* "constraint/parser.py":304 + * # 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, 304, __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, 304, __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, 304, __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, 304, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "constraint/parser.py":282 + * # split into functions that only take their relevant parameters + * parsed_restrictions = list() + * for res in restrictions: # <<<<<<<<<<<<<< + * params_used: set[str] = set() + * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() +*/ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/parser.py":306 + * 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":27 + * ) + * + * 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 +*/ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("constraint.parser.parse_restrictions", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_replace_params); + __Pyx_XDECREF(__pyx_v_replace_params_split); + __Pyx_XDECREF(__pyx_v_to_multiple_restrictions); + __Pyx_XDECREF(__pyx_v_to_numeric_constraint); + __Pyx_XDECREF(__pyx_v_to_equality_constraint); + __Pyx_XDECREF(__pyx_v_restrictions_cleaned); + __Pyx_XDECREF(__pyx_v_restrictions_cleaned_unique); + __Pyx_XDECREF(__pyx_v_restrictions_unique_indices); + __Pyx_XDECREF(__pyx_v_parsed_restrictions); + __Pyx_XDECREF(__pyx_v_res); + __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_12generator9); + __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_r); + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_r); + __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_i); + __Pyx_XDECREF(__pyx_v_restrictions); + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/parser.py":308 + * return parsed_restrictions + * + * 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. + * +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_6parser_3compile_to_constraints(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_2compile_to_constraints, "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.\n\n Args:\n constraints (list[str]): list of constraints in string format to compile.\n domains (dict): the domains to use.\n picklable (bool, optional): whether to keep constraints such that they can be pickled for parallel solvers. Defaults to False.\n\n Returns:\n 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.\n "); +static PyMethodDef __pyx_mdef_10constraint_6parser_3compile_to_constraints = {"compile_to_constraints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_3compile_to_constraints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6parser_2compile_to_constraints}; +static PyObject *__pyx_pw_10constraint_6parser_3compile_to_constraints(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_constraints = 0; + PyObject *__pyx_v_domains = 0; + PyObject *__pyx_v_picklable = 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("compile_to_constraints (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_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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __pyx_L3_error) + 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, 308, __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, 308, __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, 308, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 308, __pyx_L3_error) + break; + default: goto __pyx_L5_argtuple_error; + } + if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + } + __pyx_v_constraints = ((PyObject*)values[0]); + __pyx_v_domains = ((PyObject*)values[1]); + __pyx_v_picklable = values[2]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("compile_to_constraints", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 308, __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.compile_to_constraints", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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, 308, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_r = __pyx_pf_10constraint_6parser_2compile_to_constraints(__pyx_self, __pyx_v_constraints, __pyx_v_domains, __pyx_v_picklable); + + /* 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_2compile_to_constraints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_constraints, PyObject *__pyx_v_domains, PyObject *__pyx_v_picklable) { + PyObject *__pyx_v_parsed_restrictions = NULL; + PyObject *__pyx_v_compiled_constraints = 0; + PyObject *__pyx_v_restriction = NULL; + PyObject *__pyx_v_params_used = NULL; + PyObject *__pyx_v_constraint = NULL; + PyObject *__pyx_v_code_object = NULL; + PyObject *__pyx_v_func = NULL; + 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; + 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)(PyObject *); + int __pyx_t_10; + 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":319 + * 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 + * parsed_restrictions = parse_restrictions(constraints, domains) # <<<<<<<<<<<<<< + * compiled_constraints: list[tuple[Constraint, list[str], Union[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, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); + __pyx_t_4 = 0; + } + #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_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, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __pyx_v_parsed_restrictions = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/parser.py":320 + * """ # noqa: E501 + * parsed_restrictions = parse_restrictions(constraints, domains) + * compiled_constraints: list[tuple[Constraint, list[str], Union[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, 320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_compiled_constraints = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/parser.py":321 + * parsed_restrictions = parse_restrictions(constraints, domains) + * compiled_constraints: list[tuple[Constraint, list[str], Union[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 +*/ + if (likely(PyList_CheckExact(__pyx_v_parsed_restrictions)) || PyTuple_CheckExact(__pyx_v_parsed_restrictions)) { + __pyx_t_1 = __pyx_v_parsed_restrictions; __Pyx_INCREF(__pyx_t_1); + __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, 321, __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, 321, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + 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, 321, __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_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, 321, __pyx_L1_error) + #endif + 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_5)); + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); + #endif + ++__pyx_t_5; + } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __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, 321, __pyx_L1_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, 321, __pyx_L1_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_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, 321, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 321, __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, 321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 321, __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, 321, __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); + index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; + __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, 321, __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; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_L6_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_restriction, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_params_used, __pyx_t_7); + __pyx_t_7 = 0; + + /* "constraint/parser.py":322 + * compiled_constraints: list[tuple[Constraint, list[str], Union[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 + * if picklable: +*/ + __pyx_t_10 = PyUnicode_Check(__pyx_v_restriction); + if (__pyx_t_10) { + + /* "constraint/parser.py":324 + * 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, 324, __pyx_L1_error) + if (__pyx_t_10) { + + /* "constraint/parser.py":325 + * # if it's a string, wrap it in a (compilable or compiled) function constraint + * if picklable: + * constraint = CompilableFunctionConstraint(restriction) # <<<<<<<<<<<<<< + * else: + * 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, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __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); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __pyx_t_4 = 0; + } + #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_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, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_3); + __pyx_t_3 = 0; + + /* "constraint/parser.py":324 + * if isinstance(restriction, str): + * # if it's a string, wrap it in a (compilable or compiled) function constraint + * if picklable: # <<<<<<<<<<<<<< + * constraint = CompilableFunctionConstraint(restriction) + * else: +*/ + goto __pyx_L8; + } + + /* "constraint/parser.py":327 + * constraint = CompilableFunctionConstraint(restriction) + * else: + * code_object = compile(restriction, "", "exec") # <<<<<<<<<<<<<< + * func = FunctionType(code_object.co_consts[0], globals()) + * constraint = FunctionConstraint(func) +*/ + /*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_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, 327, __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":328 + * 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, 328, __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, 328, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 328, __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, 328, __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); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __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; + __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, 328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_3); + __pyx_t_3 = 0; + + /* "constraint/parser.py":329 + * 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, 329, __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); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_2); + __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; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_3); + __pyx_t_3 = 0; + } + __pyx_L8:; + + /* "constraint/parser.py":330 + * 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, 330, __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, 330, __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, 330, __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, 330, __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, 330, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/parser.py":322 + * compiled_constraints: list[tuple[Constraint, list[str], Union[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 + * if picklable: +*/ + goto __pyx_L7; + } + + /* "constraint/parser.py":331 + * 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, 331, __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, 331, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (likely(__pyx_t_10)) { + + /* "constraint/parser.py":333 + * 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, 333, __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, 333, __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, 333, __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, 333, __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, 333, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/parser.py":331 + * 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)) +*/ + goto __pyx_L7; + } + + /* "constraint/parser.py":335 + * compiled_constraints.append((restriction, params_used, None)) + * else: + * raise ValueError(f"Restriction {restriction} is neither a string or Constraint {type(restriction)}") # <<<<<<<<<<<<<< + * + * # return the restrictions and used parameters +*/ + /*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, 335, __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, 335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_Restriction; + __pyx_t_13[1] = __pyx_t_11; + __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, 335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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)); + __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, 335, __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, 335, __pyx_L1_error) + } + __pyx_L7:; + + /* "constraint/parser.py":321 + * parsed_restrictions = parse_restrictions(constraints, domains) + * compiled_constraints: list[tuple[Constraint, list[str], Union[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 +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/parser.py":338 + * + * # 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":308 + * return parsed_restrictions + * + * 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. + * +*/ + + /* 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_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:; + __Pyx_XDECREF(__pyx_v_parsed_restrictions); + __Pyx_XDECREF(__pyx_v_compiled_constraints); + __Pyx_XDECREF(__pyx_v_restriction); + __Pyx_XDECREF(__pyx_v_params_used); + __Pyx_XDECREF(__pyx_v_constraint); + __Pyx_XDECREF(__pyx_v_code_object); + __Pyx_XDECREF(__pyx_v_func); + __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_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; +} + +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; + } + } + #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_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 + #endif + { + #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); + } + #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|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*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 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|Py_TPFLAGS_HAVE_FINALIZE, /*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*/ + 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__parse_restrictions, /*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 PY_VERSION_HEX >= 0x030800b1 && (!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_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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint)); + (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; +} + +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_left); + Py_CLEAR(p->__pyx_v_operator); + Py_CLEAR(p->__pyx_v_params); + Py_CLEAR(p->__pyx_v_right); + Py_CLEAR(p->__pyx_v_supported_operators); + 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)))) { + __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 + { + #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); + } + #endif + } +} + +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint(PyObject *o, visitproc v, void *a) { + int e; + 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; + { + 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_v_left) { + e = (*v)(p->__pyx_v_left, a); if (e) return e; + } + if (p->__pyx_v_operator) { + e = (*v)(p->__pyx_v_operator, a); if (e) return e; + } + if (p->__pyx_v_params) { + e = (*v)(p->__pyx_v_params, a); if (e) return e; + } + if (p->__pyx_v_right) { + e = (*v)(p->__pyx_v_right, a); if (e) return e; + } + if (p->__pyx_v_supported_operators) { + e = (*v)(p->__pyx_v_supported_operators, a); if (e) return e; + } + if (p->__pyx_v_variable_supported_operators) { + e = (*v)(p->__pyx_v_variable_supported_operators, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint(PyObject *o) { + PyObject* tmp; + 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; + 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); + tmp = ((PyObject*)p->__pyx_v_left); + p->__pyx_v_left = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_operator); + p->__pyx_v_operator = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_params); + p->__pyx_v_params = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_right); + p->__pyx_v_right = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_supported_operators); + p->__pyx_v_supported_operators = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_variable_supported_operators); + p->__pyx_v_variable_supported_operators = ((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_1_to_numeric_constraint_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint_spec = { + "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, + __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.parser.""__pyx_scope_struct_1_to_numeric_constraint", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*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*/ + 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_1_to_numeric_constraint, /*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 PY_VERSION_HEX >= 0x030800b1 && (!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_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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr)); + (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; +} + +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_genexpr) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_genexpr_arg_0); + Py_CLEAR(p->__pyx_genexpr_arg_1); + 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_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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 + { + #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); + } + #endif + } +} + +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } + if (p->__pyx_genexpr_arg_1) { + e = (*v)(p->__pyx_genexpr_arg_1, a); if (e) return e; + } + if (p->__pyx_v_s) { + e = (*v)(p->__pyx_v_s, 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_6parser___pyx_scope_struct_2_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_2_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr_spec = { + "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, + __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.parser.""__pyx_scope_struct_2_genexpr", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_2_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_2_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 PY_VERSION_HEX >= 0x030800b1 && (!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_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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr)); + (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; +} + +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_3_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 (((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)))) { + __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 + { + #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); + } + #endif + } +} + +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_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_3_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_3_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_3_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_3_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr_spec = { + "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, + __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr_slots, +}; +#else -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct__parse_restrictions(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.parser.""__pyx_scope_struct_3_genexpr", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_3_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_3_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 PY_VERSION_HEX >= 0x030800b1 && (!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_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__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)); + 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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -9799,21 +12184,22 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct__parse_res 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct__parse_restrictions) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_params_used); - Py_CLEAR(p->__pyx_v_tune_params); + Py_CLEAR(p->__pyx_outer_scope); + 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__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); + 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)))) { + __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 { @@ -9828,56 +12214,46 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct__parse_rest } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct__parse_restrictions(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_4_genexpr(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; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *)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_outer_scope) { + e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } - if (p->__pyx_v_tune_params) { - e = (*v)(p->__pyx_v_tune_params, 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; -} - -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}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_4_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr}, {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), +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_spec = { + "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, - __pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr = { 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*/ + "constraint.parser.""__pyx_scope_struct_4_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct__parse_restrictions, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -9899,8 +12275,8 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct__parse_re 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*/ 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*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_4_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -9917,7 +12293,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct__parse_re #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct__parse_restrictions, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -9950,16 +12326,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct__parse_re }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_1_to_numeric_constraint > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, 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_5_genexpr > 0) & (int)(t->tp_basicsize == 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -9972,21 +12348,23 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numer 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_operator); - Py_CLEAR(p->__pyx_v_params); + Py_CLEAR(p->__pyx_genexpr_arg_0); + Py_CLEAR(p->__pyx_genexpr_arg_1); + 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_1_to_numeric_constraint < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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); + 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)))) { + __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 { @@ -10001,56 +12379,46 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_1_to_numeri } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) { int e; - 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; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } - if (p->__pyx_v_operator) { - e = (*v)(p->__pyx_v_operator, a); if (e) return e; + if (p->__pyx_genexpr_arg_1) { + e = (*v)(p->__pyx_genexpr_arg_1, a); if (e) return e; } - if (p->__pyx_v_params) { - e = (*v)(p->__pyx_v_params, a); if (e) return e; + if (p->__pyx_v_s) { + e = (*v)(p->__pyx_v_s, 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_6parser___pyx_scope_struct_1_to_numeric_constraint(PyObject *o) { - PyObject* tmp; - 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; - tmp = ((PyObject*)p->__pyx_v_operator); - p->__pyx_v_operator = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_params); - p->__pyx_v_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_1_to_numeric_constraint_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint}, - {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint_spec = { - "constraint.parser.__pyx_scope_struct_1_to_numeric_constraint", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint), +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr_spec = { + "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, - __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_1_to_numeric_constraint", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint), /*tp_basicsize*/ + "constraint.parser.""__pyx_scope_struct_5_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -10072,8 +12440,8 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_nume 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*/ 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*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -10090,7 +12458,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_nume #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -10123,16 +12491,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_nume }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_2_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr)); + 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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -10145,23 +12513,22 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr( 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___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_genexpr_arg_1); 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_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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); + 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)))) { + __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 { @@ -10176,46 +12543,46 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_genexpr(P } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *)o; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } - if (p->__pyx_genexpr_arg_1) { - e = (*v)(p->__pyx_genexpr_arg_1, 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; } - 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_6parser___pyx_scope_struct_2_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_2_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr_spec = { - "constraint.parser.__pyx_scope_struct_2_genexpr", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr), +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr_spec = { + "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, - __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_2_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr), /*tp_basicsize*/ + "constraint.parser.""__pyx_scope_struct_6_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -10237,7 +12604,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_2_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -10255,7 +12622,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -10288,16 +12655,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_3_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr)); + 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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -10310,11 +12677,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_3_genexpr( 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_3_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_7_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -10324,8 +12691,8 @@ 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_s); #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)))) { - __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); + 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)))) { + __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 { @@ -10340,9 +12707,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_3_genexpr(P } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_7_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *)o; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -10359,27 +12726,27 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_3_genexpr(P return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_3_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_3_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_3_genexpr}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_7_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_7_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr_spec = { - "constraint.parser.__pyx_scope_struct_3_genexpr", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr), +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr_spec = { + "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, - __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_3_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ + "constraint.parser.""__pyx_scope_struct_7_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_3_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_7_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -10401,7 +12768,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_3_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_7_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -10419,7 +12786,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_3_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -10452,16 +12819,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_4_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr)); + 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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -10474,11 +12841,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr( 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_8_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -10488,8 +12855,8 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr(P Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_o); #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)))) { - __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); + 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)))) { + __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 { @@ -10504,9 +12871,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr(P } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_8_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *)o; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -10523,27 +12890,27 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_4_genexpr(P return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_4_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_8_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_8_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_8_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_spec = { - "constraint.parser.__pyx_scope_struct_4_genexpr", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr), +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr_spec = { + "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, - __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_4_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr), /*tp_basicsize*/ + "constraint.parser.""__pyx_scope_struct_8_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_8_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -10565,7 +12932,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_4_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_8_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -10583,7 +12950,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_8_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -10616,16 +12983,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_5_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr)); + 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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -10638,11 +13005,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_genexpr( 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_9_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -10652,8 +13019,8 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_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_5_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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); + 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)))) { + __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 { @@ -10668,9 +13035,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr(P } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_9_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr *)o; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -10687,27 +13054,27 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_genexpr(P return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_genexpr}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_9_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_9_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_9_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr_spec = { - "constraint.parser.__pyx_scope_struct_5_genexpr", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr), +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr_spec = { + "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, - __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_5_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr), /*tp_basicsize*/ + "constraint.parser.""__pyx_scope_struct_9_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_9_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -10729,7 +13096,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_9_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -10747,7 +13114,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_9_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -10780,16 +13147,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_10_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_6_to_equality_constraint > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -10802,11 +13169,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_to_equal return o; } -static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint(PyObject *o) { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint *)o; +static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint(PyObject *o) { + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_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_6_to_equality_constraint) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -10815,8 +13182,8 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_to_equali 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_6_to_equality_constraint < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint *)o); } else #endif { @@ -10831,9 +13198,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_to_equali } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint *)o; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -10847,9 +13214,9 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_to_equali return 0; } -static int __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint(PyObject *o) { +static int __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint *)o; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_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); @@ -10859,28 +13226,28 @@ static int __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_6_to_equality_ return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint}, - {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint_spec = { - "constraint.parser.__pyx_scope_struct_6_to_equality_constraint", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint), +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint_spec = { + "constraint.parser.__pyx_scope_struct_10_to_equality_constraint", + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_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_6_to_equality_constraint_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_6_to_equality_constraint", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint), /*tp_basicsize*/ + "constraint.parser.""__pyx_scope_struct_10_to_equality_constraint", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -10902,8 +13269,8 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_to_equa 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint, /*tp_traverse*/ - __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint, /*tp_clear*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint, /*tp_traverse*/ + __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -10920,7 +13287,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_to_equa #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -10953,16 +13320,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_to_equa }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_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)))) { - 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_11_genexpr > 0) & (int)(t->tp_basicsize == 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -10975,11 +13342,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr( 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; +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((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_7_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -10989,8 +13356,8 @@ 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)))) { - __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); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_11_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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 { @@ -11005,9 +13372,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_7_genexpr(P } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_7_genexpr(PyObject *o, visitproc v, void *a) { +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_7_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *)o; + 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; @@ -11024,27 +13391,27 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_7_genexpr(P return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_7_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_7_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr}, +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_7_genexpr_spec = { - "constraint.parser.__pyx_scope_struct_7_genexpr", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr), +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_7_genexpr_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_7_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_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_7_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -11066,7 +13433,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_7_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_11_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -11084,7 +13451,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_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*/ @@ -11117,16 +13484,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_8_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_12_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)))) { - 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -11139,11 +13506,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_8_genexpr( 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; +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; #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_8_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -11152,8 +13519,8 @@ 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_r); #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)))) { - __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); + 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); } else #endif { @@ -11168,9 +13535,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_8_genexpr(P } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_8_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_12_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *)o; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -11184,27 +13551,27 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_8_genexpr(P return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_8_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_8_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_8_genexpr}, +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}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr_spec = { - "constraint.parser.__pyx_scope_struct_8_genexpr", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr), +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), 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_8_genexpr_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_12_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_12_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_8_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr), /*tp_basicsize*/ + "constraint.parser.""__pyx_scope_struct_12_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_8_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -11226,7 +13593,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_8_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_12_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -11244,7 +13611,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_8_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_12_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -11331,147 +13698,211 @@ 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, 24, __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, 24, __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, 27, __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, 27, __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, 27, __pyx_L1_error) + #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)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions->tp_getattro = PyObject_GenericGetAttr; + } + #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, 75, __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, 75, __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, 75, __pyx_L1_error) + #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)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint->tp_getattro = PyObject_GenericGetAttr; + } + #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, 87, __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, 87, __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, 87, __pyx_L1_error) + #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)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr->tp_getattro = PyObject_GenericGetAttr; + } + #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, 91, __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, 91, __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, 91, __pyx_L1_error) + #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)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr->tp_getattro = PyObject_GenericGetAttr; + } + #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, 92, __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, 92, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions = &__pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions; + __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__parse_restrictions) < 0) __PYX_ERR(0, 24, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 92, __pyx_L1_error) #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)) { - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions->tp_getattro = PyObject_GenericGetAttr; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr->tp_getattro = PyObject_GenericGetAttr; } #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, 72, __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, 72, __pyx_L1_error) + __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, 130, __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, 130, __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; + __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_1_to_numeric_constraint) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 130, __pyx_L1_error) #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)) { - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint->tp_getattro = PyObject_GenericGetAttr; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr->tp_getattro = PyObject_GenericGetAttr; } #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) + __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, 151, __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, 151, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr; + __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_2_genexpr) < 0) __PYX_ERR(0, 84, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 151, __pyx_L1_error) #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)) { - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr->tp_getattro = PyObject_GenericGetAttr; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr->tp_getattro = PyObject_GenericGetAttr; } #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, 104, __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, 104, __pyx_L1_error) + __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, 153, __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, 153, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr; + __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_3_genexpr) < 0) __PYX_ERR(0, 104, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 153, __pyx_L1_error) #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)) { - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr->tp_getattro = PyObject_GenericGetAttr; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr->tp_getattro = PyObject_GenericGetAttr; } #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, 159, __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, 159, __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, 211, __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, 211, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr; + __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_4_genexpr) < 0) __PYX_ERR(0, 159, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(0, 211, __pyx_L1_error) #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)) { - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr->tp_getattro = PyObject_GenericGetAttr; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr->tp_getattro = PyObject_GenericGetAttr; } #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, 166, __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, 166, __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, 218, __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, 218, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr; + __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_5_genexpr) < 0) __PYX_ERR(0, 166, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr) < 0) __PYX_ERR(0, 218, __pyx_L1_error) #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)) { - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr->tp_getattro = PyObject_GenericGetAttr; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint)) __PYX_ERR(0, 187, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint) < 0) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint)) __PYX_ERR(0, 241, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint) < 0) __PYX_ERR(0, 241, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint = &__pyx_type_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint = &__pyx_type_10constraint_6parser___pyx_scope_struct_10_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_6_to_equality_constraint) < 0) __PYX_ERR(0, 187, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint) < 0) __PYX_ERR(0, 241, __pyx_L1_error) #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_to_equality_constraint->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_to_equality_constraint->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_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_10_to_equality_constraint->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint->tp_getattro = PyObject_GenericGetAttr; } #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, 206, __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, 206, __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, 260, __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, 260, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr; + __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_7_genexpr) < 0) __PYX_ERR(0, 206, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr) < 0) __PYX_ERR(0, 260, __pyx_L1_error) #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)) { - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr->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_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, 216, __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, 216, __pyx_L1_error) + __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, 270, __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, 270, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_12_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, 216, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(0, 270, __pyx_L1_error) #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)) { - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_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_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; } #endif __Pyx_RefNannyFinishContext(); @@ -11846,7 +14277,7 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); * AllEqualConstraint, * Constraint, */ - __pyx_t_2 = __Pyx_PyList_Pack(11, __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_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_FunctionConstraint, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_Pack(14, __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); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "constraint/parser.py":5 @@ -11875,73 +14306,85 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); __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_MaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __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_MaxProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + 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, 12, __pyx_L1_error) + 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_MinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __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_MinSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + 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, 14, __pyx_L1_error) + 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, 15, __pyx_L1_error) + 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, 16, __pyx_L1_error) + 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":24 + /* "constraint/parser.py":27 * ) * * 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 */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __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, 24, __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, 24, __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, 24, __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[12])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + 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, 27, __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, 27, __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, 27, __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[16])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __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, 24, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_parse_restrictions, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":254 + /* "constraint/parser.py":308 * return parsed_restrictions * * 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, 254, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __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, 254, __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, 254, __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, 254, __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[13])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error) + 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, 308, __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, 308, __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, 308, __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[17])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[1]); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[3]); __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_compile_to_constraints, __pyx_t_3) < 0) __PYX_ERR(0, 254, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_compile_to_constraints, __pyx_t_3) < 0) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/parser.py":1 @@ -12019,6 +14462,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -12038,6 +14482,8 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_VariableExactSumConstraint, sizeof(__pyx_k_VariableExactSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableExactSumConstraint */ + {__pyx_k_VariableMaxSumConstraint, sizeof(__pyx_k_VariableMaxSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMaxSumConstraint */ + {__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 */ @@ -12052,6 +14498,8 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -12109,6 +14557,8 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -12164,7 +14614,10 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_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 */ @@ -12175,6 +14628,8 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_variable, sizeof(__pyx_k_swapped_side_first_variable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_swapped_side_first_variable */ {__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 */ @@ -12184,6 +14639,10 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_value, sizeof(__pyx_k_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_value */ {__pyx_k_variable_supported_operators, sizeof(__pyx_k_variable_supported_operators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_supported_operators */ {__pyx_k_variables, sizeof(__pyx_k_variables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variables */ @@ -12197,11 +14656,11 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, c 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, 63, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 155, __pyx_L1_error) - __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_eval); if (!__pyx_builtin_eval) __PYX_ERR(0, 90, __pyx_L1_error) - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 91, __pyx_L1_error) - __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_compile); if (!__pyx_builtin_compile) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_eval); if (!__pyx_builtin_eval) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_compile); if (!__pyx_builtin_compile) __PYX_ERR(0, 327, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -12213,71 +14672,85 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "constraint/parser.py":109 - * # if both sides are parameters, use the VariableExactSumConstraint - * if variables_on_left: - * return VariableExactSumConstraint(variables[-1], variables[:-1]) # <<<<<<<<<<<<<< - * else: - * return VariableExactSumConstraint(variables[0], variables[1:]) + /* "constraint/parser.py":110 + * # e.g. "G == B-M" becomes "G+M == B" + * right_remainder = right[len(swapped_side_first_variable):] + * left_swap = right_remainder.replace("-", "+") # <<<<<<<<<<<<<< + * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" + * else: */ - __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, 109, __pyx_L1_error) - __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); + __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, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); - /* "constraint/parser.py":111 - * return VariableExactSumConstraint(variables[-1], variables[:-1]) - * else: - * return VariableExactSumConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< - * - * # left_num and right_num can't be both None or both a constant + /* "constraint/parser.py":121 + * # e.g. "G == B/M" becomes "G*M == B" + * right_remainder = right[len(swapped_side_first_variable):] + * left_swap = right_remainder.replace("/", "*") # <<<<<<<<<<<<<< + * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" + * 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, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); + + /* "constraint/parser.py":157 + * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": + * 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) */ - __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, 111, __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, 157, __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, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[1]); - /* "constraint/parser.py":218 + /* "constraint/parser.py":272 * 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 * # get the indices of the unique restrictions, use these to build a new list of restrictions */ - __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u__15, __pyx_mstate_global->__pyx_kp_u__16); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); + __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, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); - /* "constraint/parser.py":239 + /* "constraint/parser.py":293 * 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, 239, __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, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[2]); - /* "constraint/parser.py":241 + /* "constraint/parser.py":295 * 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, 241, __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, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[3]); - /* "constraint/parser.py":254 + /* "constraint/parser.py":308 * return parsed_restrictions * * 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_mstate_global->__pyx_tuple[1] = PyTuple_Pack(1, ((PyObject*)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); + __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(1, ((PyObject*)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -12292,6 +14765,8 @@ static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { __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) @@ -12306,9 +14781,9 @@ static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { unsigned int argcount : 2; unsigned int num_posonly_args : 1; unsigned int num_kwonly_args : 1; - unsigned int nlocals : 5; + unsigned int nlocals : 6; unsigned int flags : 10; - unsigned int first_line : 8; + unsigned int first_line : 9; unsigned int line_table_length : 15; } __Pyx_PyCode_New_function_description; /* NewCodeObj.proto */ @@ -12326,74 +14801,94 @@ 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), 87, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; __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_1, 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), 104, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 91, 2}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; + __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_1_2, 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), 92, 2}; + 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_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), 130, 2}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 151, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; - __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_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; + __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__25, 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), 159, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 153, 2}; + 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_A_2, 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), 211, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_o}; - __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_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) 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_k_Q, 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), 166, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 218, 2}; 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__23, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) 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_k__26, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 87, 45}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 133, 45}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s, __pyx_mstate->__pyx_n_u_number}; - __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_is_or_evals_to_number, __pyx_k_XQ_Qa_z_5_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) 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_is_or_evals_to_number, __pyx_k_XQ_Qa_z_5_q_q, 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), 206, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 260, 2}; 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__23, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) 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_k__26, 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), 216, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 270, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_r}; - __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[10] = __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[10])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 29, 50}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 32, 50}; 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[7] = __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[7])) 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_replace_params, __pyx_k_A_l_4s_Cq_2V2Q_1, 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), 37, 50}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 40, 50}; 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[8] = __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[8])) 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_split, __pyx_k_A_l_4s_Cq_t1A_1_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, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 47, 251}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 50, 251}; 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[9] = __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[9])) 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_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[13])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 26, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 72, 899}; - 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_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_variables_on_left, __pyx_mstate->__pyx_n_u_number, __pyx_mstate->__pyx_n_u_number_is_int, __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_s, __pyx_mstate->__pyx_n_u_genexpr, __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_parser_py, __pyx_mstate->__pyx_n_u_to_numeric_constraint, __pyx_k_A_avV6_a_Bhas_q_a_3a_Q_1_aq_he81, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 39, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 75, 1558}; + 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_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_variable, __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_number, __pyx_mstate->__pyx_n_u_number_is_int, __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_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_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_to_numeric_constraint, __pyx_k_A_avV6_a_Bhas_q_a_3a_Q_1_aq_he81, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 187, 222}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 241, 222}; 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[11] = __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[11])) goto bad; + __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_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[15])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 27, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 24, 386}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 27, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 27, 386}; 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_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[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_parse_restrictions, __pyx_k_Ya_1_Q2_U_b_U_6_Q_q_t4uA_d_4y_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) 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_parse_restrictions, __pyx_k_Ya_1_Q2_U_H_U_6_Q_q_t4uA_d_4y_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 254, 177}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 308, 177}; 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[13] = __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[13])) 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_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[17])) goto bad; } Py_DECREF(tuple_dedup_map); return 0; @@ -14621,32 +17116,240 @@ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { return; } } - __Pyx_GetException(&exc, &val, &tb); - Py_XDECREF(exc); - Py_XDECREF(tb); - new_exc = PyObject_CallFunction(PyExc_RuntimeError, "s", - is_async_stopiteration ? "async generator raised StopAsyncIteration" : - in_async_gen ? "async generator raised StopIteration" : - "generator raised StopIteration"); - if (!new_exc) { - Py_XDECREF(val); - return; + __Pyx_GetException(&exc, &val, &tb); + Py_XDECREF(exc); + Py_XDECREF(tb); + new_exc = PyObject_CallFunction(PyExc_RuntimeError, "s", + is_async_stopiteration ? "async generator raised StopAsyncIteration" : + in_async_gen ? "async generator raised StopIteration" : + "generator raised StopIteration"); + if (!new_exc) { + Py_XDECREF(val); + return; + } + PyException_SetCause(new_exc, val); // steals ref to val + PyErr_SetObject(PyExc_RuntimeError, new_exc); +} + +/* RaiseTooManyValuesToUnpack */ +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); +} + +/* RaiseNeedMoreValuesToUnpack */ +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"); +} + +/* PyObjectCall2Args */ +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); +} + +/* CallUnboundCMethod1 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { + int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); + if (likely(was_initialized == 2 && cfunc->func)) { + int flag = cfunc->flag; + if (flag == METH_O) { + return __Pyx_CallCFunction(cfunc, self, arg); + } else if (flag == METH_FASTCALL) { + return __Pyx_CallCFunctionFast(cfunc, self, &arg, 1); + } else if (flag == (METH_FASTCALL | METH_KEYWORDS)) { + return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, &arg, 1, NULL); + } + } +#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__CallUnboundCMethod1(&tmp_cfunc, self, arg); + } +#endif + PyObject* result = __Pyx__CallUnboundCMethod1(cfunc, self, arg); + __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); + return result; +} +#endif +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ + PyObject *result = NULL; + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + if (cfunc->flag & METH_KEYWORDS) + result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); + else + result = __Pyx_CallCFunction(cfunc, self, args); + Py_DECREF(args); + } else +#endif + { + result = __Pyx_PyObject_Call2Args(cfunc->method, self, arg); + } + return result; +} + +/* PyObjectCallNoArg */ +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 */ +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) { + if (it) { + PyObject* result; +#if CYTHON_COMPILING_IN_PYPY + PyObject* args; + args = PyTuple_Pack(1, it); + if (unlikely(!args)) + return NULL; + result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL); + Py_DECREF(args); + return result; +#else + if (PyFrozenSet_CheckExact(it)) { + Py_INCREF(it); + return it; + } + result = PyFrozenSet_New(it); + if (unlikely(!result)) + return NULL; + if ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000) +#if CYTHON_COMPILING_IN_LIMITED_API + || __Pyx_get_runtime_version() >= 0x030A0000 +#endif + ) + return result; + { + Py_ssize_t size = __Pyx_PySet_GET_SIZE(result); + if (likely(size > 0)) + return result; +#if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(size < 0)) { + Py_DECREF(result); + return NULL; + } +#endif + } + Py_DECREF(result); +#endif + } + return __Pyx_PyObject_CallNoArg((PyObject*) &PyFrozenSet_Type); +} + +/* PySetContains */ +static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) { + int result = -1; + if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) { + PyObject *tmpkey; + PyErr_Clear(); + tmpkey = __Pyx_PyFrozenSet_New(key); + if (tmpkey != NULL) { + result = PySet_Contains(set, tmpkey); + Py_DECREF(tmpkey); + } + } + return result; +} +static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) { + int result = PySet_Contains(set, key); + if (unlikely(result < 0)) { + result = __Pyx_PySet_ContainsUnhashable(set, key); + } + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* JoinPyUnicode */ +static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, + Py_UCS4 max_char) { +#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + PyObject *result_uval; + int result_ukind, kind_shift; + Py_ssize_t i, char_pos; + void *result_udata; + if (max_char > 1114111) max_char = 1114111; + result_uval = PyUnicode_New(result_ulength, max_char); + if (unlikely(!result_uval)) return NULL; + result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; + kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; + result_udata = PyUnicode_DATA(result_uval); + assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); + if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0)) + goto overflow; + char_pos = 0; + for (i=0; i < value_count; i++) { + int ukind; + Py_ssize_t ulength; + void *udata; + PyObject *uval = values[i]; + #if !CYTHON_COMPILING_IN_LIMITED_API + if (__Pyx_PyUnicode_READY(uval) == (-1)) + goto bad; + #endif + ulength = __Pyx_PyUnicode_GET_LENGTH(uval); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(ulength < 0)) goto bad; + #endif + if (unlikely(!ulength)) + continue; + if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) + goto overflow; + ukind = __Pyx_PyUnicode_KIND(uval); + udata = __Pyx_PyUnicode_DATA(uval); + if (ukind == result_ukind) { + memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); + } else { + #if PY_VERSION_HEX >= 0x030d0000 + if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; + #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters) + _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); + #else + Py_ssize_t j; + for (j=0; j < ulength; j++) { + Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); + __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); + } + #endif + } + char_pos += ulength; + } + return result_uval; +overflow: + PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); +bad: + Py_DECREF(result_uval); + return NULL; +#else + Py_ssize_t i; + PyObject *result = NULL; + PyObject *value_tuple = PyTuple_New(value_count); + if (unlikely(!value_tuple)) return NULL; + CYTHON_UNUSED_VAR(max_char); + CYTHON_UNUSED_VAR(result_ulength); + for (i=0; i__pyx_empty_unicode, value_tuple); +bad: + Py_DECREF(value_tuple); + return result; +#endif } /* FixUpExtensionType */ @@ -15993,146 +18696,96 @@ __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"); +/* IterNextPlain */ +#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)) + __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next); + return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache; } - -/* PyObjectCall2Args */ -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); +#endif +static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) { +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + PyObject *result; + PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI(); + if (unlikely(!next)) return NULL; + result = PyObject_CallFunctionObjArgs(next, iterator, NULL); + return result; +#else + (void)__Pyx_GetBuiltinName; // only for early limited API + iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator); + assert(iternext); + return iternext(iterator); +#endif } -/* CallUnboundCMethod1 */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { - int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); - if (likely(was_initialized == 2 && cfunc->func)) { - int flag = cfunc->flag; - if (flag == METH_O) { - return __Pyx_CallCFunction(cfunc, self, arg); - } else if (flag == METH_FASTCALL) { - return __Pyx_CallCFunctionFast(cfunc, self, &arg, 1); - } else if (flag == (METH_FASTCALL | METH_KEYWORDS)) { - return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, &arg, 1, NULL); - } +/* 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 + __Pyx_PyThreadState_assign + exc_type = __Pyx_PyErr_CurrentExceptionType(); + if (unlikely(exc_type)) { + if (!defval || unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(defval); + return defval; } -#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__CallUnboundCMethod1(&tmp_cfunc, self, arg); + if (defval) { + Py_INCREF(defval); + return defval; } -#endif - PyObject* result = __Pyx__CallUnboundCMethod1(cfunc, self, arg); - __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); - return result; + __Pyx_PyErr_SetNone(PyExc_StopIteration); + return NULL; } -#endif -static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ - PyObject *result = NULL; - if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; -#if CYTHON_COMPILING_IN_CPYTHON - if (cfunc->func && (cfunc->flag & METH_VARARGS)) { - PyObject *args = PyTuple_New(1); - if (unlikely(!args)) return NULL; - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 0, arg); - if (cfunc->flag & METH_KEYWORDS) - result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); - else - result = __Pyx_CallCFunction(cfunc, self, args); - Py_DECREF(args); +static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) { + __Pyx_TypeName iterator_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(iterator)); + PyErr_Format(PyExc_TypeError, + __Pyx_FMT_TYPENAME " object is not an iterator", iterator_type_name); + __Pyx_DECREF_TypeName(iterator_type_name); +} +static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) { + PyObject* next; +#if !CYTHON_COMPILING_IN_LIMITED_API + iternextfunc iternext = __Pyx_PyObject_TryGetSlot(iterator, tp_iternext, iternextfunc); + if (likely(iternext)) { + next = iternext(iterator); + if (likely(next)) + return next; + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 + if (unlikely(iternext == &_PyObject_NextNotImplemented)) + return NULL; + #endif + } else if (CYTHON_USE_TYPE_SLOTS) { + __Pyx_PyIter_Next_ErrorNoIterator(iterator); + return NULL; } else #endif - { - result = __Pyx_PyObject_Call2Args(cfunc->method, self, arg); + if (unlikely(!PyIter_Check(iterator))) { + __Pyx_PyIter_Next_ErrorNoIterator(iterator); + return NULL; + } else { + next = defval ? PyIter_Next(iterator) : __Pyx_PyIter_Next_Plain(iterator); + if (likely(next)) + return next; } - return result; + return __Pyx_PyIter_Next2Default(defval); } - -/* JoinPyUnicode */ -static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, - Py_UCS4 max_char) { -#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - PyObject *result_uval; - int result_ukind, kind_shift; - Py_ssize_t i, char_pos; - void *result_udata; - if (max_char > 1114111) max_char = 1114111; - result_uval = PyUnicode_New(result_ulength, max_char); - if (unlikely(!result_uval)) return NULL; - result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; - kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; - result_udata = PyUnicode_DATA(result_uval); - assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); - if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0)) - goto overflow; - char_pos = 0; - for (i=0; i < value_count; i++) { - int ukind; - Py_ssize_t ulength; - void *udata; - PyObject *uval = values[i]; - #if !CYTHON_COMPILING_IN_LIMITED_API - if (__Pyx_PyUnicode_READY(uval) == (-1)) - goto bad; - #endif - ulength = __Pyx_PyUnicode_GET_LENGTH(uval); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely(ulength < 0)) goto bad; - #endif - if (unlikely(!ulength)) - continue; - if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) - goto overflow; - ukind = __Pyx_PyUnicode_KIND(uval); - udata = __Pyx_PyUnicode_DATA(uval); - if (ukind == result_ukind) { - memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); - } else { - #if PY_VERSION_HEX >= 0x030d0000 - if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; - #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters) - _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); - #else - Py_ssize_t j; - for (j=0; j < ulength; j++) { - Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); - __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); - } - #endif - } - char_pos += ulength; - } - return result_uval; -overflow: - PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); -bad: - Py_DECREF(result_uval); - return NULL; -#else - Py_ssize_t i; - PyObject *result = NULL; - PyObject *value_tuple = PyTuple_New(value_count); - if (unlikely(!value_tuple)) return NULL; - CYTHON_UNUSED_VAR(max_char); - CYTHON_UNUSED_VAR(result_ulength); - for (i=0; i__pyx_empty_unicode, value_tuple); -bad: - Py_DECREF(value_tuple); - return result; #endif + +/* RaiseNoneIterError */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* IterFinish */ @@ -16174,12 +18827,6 @@ static PyObject* __Pyx_Globals(void) { return __Pyx_NewRef(__pyx_mstate_global->__pyx_d); } -/* PyObjectCallNoArg */ -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); -} - /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; @@ -16633,7 +19280,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__21); + module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u__23); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } @@ -17097,7 +19744,7 @@ __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp) result = name; name = NULL; } else { - result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__22); + result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__24); } goto done; } @@ -17774,29 +20421,6 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, } #endif -/* IterNextPlain */ -#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)) - __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next); - return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache; -} -#endif -static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) { -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 - PyObject *result; - PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI(); - if (unlikely(!next)) return NULL; - result = PyObject_CallFunctionObjArgs(next, iterator, NULL); - return result; -#else - (void)__Pyx_GetBuiltinName; // only for early limited API - iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator); - assert(iternext); - return iternext(iterator); -#endif -} - /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { diff --git a/constraint/parser.py b/constraint/parser.py index c1c19cc..e1a56e7 100644 --- a/constraint/parser.py +++ b/constraint/parser.py @@ -140,7 +140,7 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # 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 + # 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): @@ -150,7 +150,7 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # find all unique variable_supported_operators in the restriction, can have at most one unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None - if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): + if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 variables_on_left = len(right) == 1 if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": if comparator == "==": @@ -160,7 +160,7 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: 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:]) + return VariableMinSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxSumConstraint(variables[0], variables[1:]) # noqa: E501 # left_num and right_num can't be both None or both a constant return None From ca7b989efd0959792b6bb2c60cfc53e3984bd410 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Sun, 8 Jun 2025 13:56:39 +0200 Subject: [PATCH 22/87] Extended parser tests with new constraints --- tests/test_parser.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_parser.py b/tests/test_parser.py index b7cf345..ca1c3e5 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -1,4 +1,4 @@ -from constraint import compile_to_constraints, parse_restrictions, Constraint, FunctionConstraint, CompilableFunctionConstraint, MinProdConstraint, MaxProdConstraint, ExactSumConstraint, VariableExactSumConstraint +from constraint import compile_to_constraints, parse_restrictions, Constraint, FunctionConstraint, CompilableFunctionConstraint, ExactProdConstraint, MinProdConstraint, MaxProdConstraint, ExactSumConstraint, VariableExactSumConstraint from collections.abc import Iterable def test_parse_restrictions(): @@ -37,7 +37,7 @@ def test_parse_restrictions(): def test_compile_to_constraints(): domains = {"x": [50, 100], "y": [0, 1]} - constraints = ["x != 320", "y == 0 or x % 32 != 0", "50 <= x * y < 100", "x == 100", "x == x+y", "100 == x-y"] + constraints = ["x != 320", "y == 0 or x % 32 != 0", "50 <= x * y < 100", "x == 100", "x == x+y", "100 == x-y", "x / y == 100"] # TODO change the last one to "x / y == x" once VarProd implemented expected_constraint_types = [ FunctionConstraint, FunctionConstraint, @@ -46,6 +46,7 @@ def test_compile_to_constraints(): ExactSumConstraint, VariableExactSumConstraint, ExactSumConstraint, + ExactProdConstraint, ] compiled = compile_to_constraints(constraints, domains, picklable=False) From 8e325d03b0ef371eed5f02f5b94fe4fe9f4ba111 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Sun, 8 Jun 2025 14:20:44 +0200 Subject: [PATCH 23/87] Improved pruning and forward checking for product constraints with variables < 1 --- constraint/constraints.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/constraint/constraints.py b/constraint/constraints.py index 757f9b1..3b104df 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -801,21 +801,21 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar exactprod = self._exactprod prod = 1 missing = False - missing_lt1 = False + missing_lt1 = [] for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): if variable in assignments: prod *= assignments[variable] else: missing = True - if not missing_lt1: - missing_lt1 = contains_lt1 + if contains_lt1: + missing_lt1.append(variable) if isinstance(prod, float): prod = round(prod, 10) - if not missing and prod != exactprod or (not missing_lt1 and prod > exactprod): + if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): return False - if forwardcheck and not missing_lt1: + if forwardcheck: for variable in variables: - if variable not in assignments: + 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: @@ -876,21 +876,21 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar maxprod = self._maxprod prod = 1 missing = False - missing_lt1 = False + missing_lt1 = [] for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): if variable in assignments: prod *= assignments[variable] else: missing = True - if not missing_lt1: - missing_lt1 = contains_lt1 + if contains_lt1: + missing_lt1.append(variable) if isinstance(prod, float): prod = round(prod, 10) - if (not missing or not missing_lt1) and prod > maxprod: + if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): return False - if forwardcheck and not missing_lt1: + if forwardcheck: for variable in variables: - if variable not in assignments: + 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: From 23c8c311df6fb64ee9892848786ac38163aea941 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Sun, 8 Jun 2025 15:25:47 +0200 Subject: [PATCH 24/87] Improved pruning and added check on numerical values for parsing to numerical constraints --- constraint/constraints.c | 2262 +++++++------- constraint/constraints.py | 4 +- constraint/parser.c | 6099 +++++++++++++++++++++---------------- constraint/parser.py | 6 +- 4 files changed, 4604 insertions(+), 3767 deletions(-) diff --git a/constraint/constraints.c b/constraint/constraints.c index 1cde216..6a908a9 100644 --- a/constraint/constraints.c +++ b/constraint/constraints.c @@ -1706,7 +1706,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr { }; -/* "constraint/constraints.py":854 +/* "constraint/constraints.py":856 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -2970,14 +2970,14 @@ static const char __pyx_k_ExactSumConstraint_preProcess[] = "ExactSumConstraint. 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_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_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_D_q_a_J_c_T_y_1_1A_4q_QfA[] = "\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\2204\220q\330\024\"\240!\330\010\013\210:\220Q\220f\230A\330\014\023\2205\230\001\230\026\230q\330\010\013\2104\210x\220t\2305\240\003\240:\250T\260\024\260\\\300\024\300U\310\"\310A\330\014\023\2201\330\010\013\210=\230\004\230D\240\001\330\014\020\220\014\230A\330\020\023\2209\230G\2401\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_a_q_a_J_c_T_y_1_1A_4q_QfA[] = "\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\2204\220q\330\024\"\240!\330\010\013\210:\220Q\220f\230A\330\014\023\2205\230\001\230\026\230q\330\010\014\210D\220\010\230\003\2304\230}\250D\260\005\260R\260q\330\014\023\2201\330\010\013\210=\230\004\230D\240\001\330\014\020\220\014\230A\330\020\023\2209\230G\2401\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_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"; @@ -21128,7 +21128,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca * exactprod = self._exactprod * prod = 1 # <<<<<<<<<<<<<< * missing = False - * missing_lt1 = False + * missing_lt1 = [] */ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; @@ -21137,7 +21137,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca * exactprod = self._exactprod * prod = 1 * missing = False # <<<<<<<<<<<<<< - * missing_lt1 = False + * missing_lt1 = [] * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): */ __pyx_v_missing = 0; @@ -21145,16 +21145,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca /* "constraint/constraints.py":804 * prod = 1 * missing = False - * missing_lt1 = False # <<<<<<<<<<<<<< + * missing_lt1 = [] # <<<<<<<<<<<<<< * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if variable in assignments: */ - __Pyx_INCREF(Py_False); - __pyx_v_missing_lt1 = Py_False; + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_missing_lt1 = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; /* "constraint/constraints.py":805 * missing = False - * missing_lt1 = False + * missing_lt1 = [] * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< * if variable in assignments: * prod *= assignments[variable] @@ -21280,7 +21282,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_t_2 = 0; /* "constraint/constraints.py":806 - * missing_lt1 = False + * missing_lt1 = [] * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if variable in assignments: # <<<<<<<<<<<<<< * prod *= assignments[variable] @@ -21305,7 +21307,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_t_2 = 0; /* "constraint/constraints.py":806 - * missing_lt1 = False + * missing_lt1 = [] * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if variable in assignments: # <<<<<<<<<<<<<< * prod *= assignments[variable] @@ -21318,8 +21320,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca * prod *= assignments[variable] * else: * missing = True # <<<<<<<<<<<<<< - * if not missing_lt1: - * missing_lt1 = contains_lt1 + * if contains_lt1: + * missing_lt1.append(variable) */ /*else*/ { __pyx_v_missing = 1; @@ -21327,29 +21329,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca /* "constraint/constraints.py":810 * else: * missing = True - * if not missing_lt1: # <<<<<<<<<<<<<< - * missing_lt1 = contains_lt1 + * if contains_lt1: # <<<<<<<<<<<<<< + * missing_lt1.append(variable) * if isinstance(prod, float): */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_missing_lt1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 810, __pyx_L1_error) - __pyx_t_11 = (!__pyx_t_10); - if (__pyx_t_11) { + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_contains_lt1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 810, __pyx_L1_error) + if (__pyx_t_10) { /* "constraint/constraints.py":811 * missing = True - * if not missing_lt1: - * missing_lt1 = contains_lt1 # <<<<<<<<<<<<<< + * if contains_lt1: + * missing_lt1.append(variable) # <<<<<<<<<<<<<< * if isinstance(prod, float): * prod = round(prod, 10) */ - __Pyx_INCREF(__pyx_v_contains_lt1); - __Pyx_DECREF_SET(__pyx_v_missing_lt1, __pyx_v_contains_lt1); + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_missing_lt1, __pyx_v_variable); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 811, __pyx_L1_error) /* "constraint/constraints.py":810 * else: * missing = True - * if not missing_lt1: # <<<<<<<<<<<<<< - * missing_lt1 = contains_lt1 + * if contains_lt1: # <<<<<<<<<<<<<< + * missing_lt1.append(variable) * if isinstance(prod, float): */ } @@ -21358,7 +21358,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca /* "constraint/constraints.py":805 * missing = False - * missing_lt1 = False + * missing_lt1 = [] * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< * if variable in assignments: * prod *= assignments[variable] @@ -21367,20 +21367,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/constraints.py":812 - * if not missing_lt1: - * missing_lt1 = contains_lt1 + * if contains_lt1: + * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< * prod = round(prod, 10) - * if not missing and prod != exactprod or (not missing_lt1 and prod > exactprod): + * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): */ - __pyx_t_11 = PyFloat_Check(__pyx_v_prod); - if (__pyx_t_11) { + __pyx_t_10 = PyFloat_Check(__pyx_v_prod); + if (__pyx_t_10) { /* "constraint/constraints.py":813 - * missing_lt1 = contains_lt1 + * missing_lt1.append(variable) * if isinstance(prod, float): * prod = round(prod, 10) # <<<<<<<<<<<<<< - * if not missing and prod != exactprod or (not missing_lt1 and prod > exactprod): + * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): * return False */ __pyx_t_2 = NULL; @@ -21399,54 +21399,54 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_t_3 = 0; /* "constraint/constraints.py":812 - * if not missing_lt1: - * missing_lt1 = contains_lt1 + * if contains_lt1: + * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< * prod = round(prod, 10) - * if not missing and prod != exactprod or (not missing_lt1 and prod > exactprod): + * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): */ } /* "constraint/constraints.py":814 * if isinstance(prod, float): * prod = round(prod, 10) - * if not missing and prod != exactprod or (not missing_lt1 and prod > exactprod): # <<<<<<<<<<<<<< + * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): # <<<<<<<<<<<<<< * return False - * if forwardcheck and not missing_lt1: + * if forwardcheck: */ - __pyx_t_10 = (!__pyx_v_missing); - if (!__pyx_t_10) { + __pyx_t_12 = (!__pyx_v_missing); + if (!__pyx_t_12) { goto __pyx_L13_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, 814, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!__pyx_t_10) { + if (!__pyx_t_12) { } else { - __pyx_t_11 = __pyx_t_10; + __pyx_t_10 = __pyx_t_12; goto __pyx_L12_bool_binop_done; } __pyx_L13_next_or:; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_missing_lt1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 814, __pyx_L1_error) - __pyx_t_12 = (!__pyx_t_10); + __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_t_12 = (__pyx_t_6 == 0); if (__pyx_t_12) { } else { - __pyx_t_11 = __pyx_t_12; + __pyx_t_10 = __pyx_t_12; goto __pyx_L12_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, 814, __pyx_L1_error) __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = __pyx_t_12; + __pyx_t_10 = __pyx_t_12; __pyx_L12_bool_binop_done:; - if (__pyx_t_11) { + if (__pyx_t_10) { /* "constraint/constraints.py":815 * prod = round(prod, 10) - * if not missing and prod != exactprod or (not missing_lt1 and prod > exactprod): + * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): * return False # <<<<<<<<<<<<<< - * if forwardcheck and not missing_lt1: + * if forwardcheck: * for variable in variables: */ __Pyx_XDECREF(__pyx_r); @@ -21457,36 +21457,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca /* "constraint/constraints.py":814 * if isinstance(prod, float): * prod = round(prod, 10) - * if not missing and prod != exactprod or (not missing_lt1 and prod > exactprod): # <<<<<<<<<<<<<< + * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): # <<<<<<<<<<<<<< * return False - * if forwardcheck and not missing_lt1: + * if forwardcheck: */ } /* "constraint/constraints.py":816 - * if not missing and prod != exactprod or (not missing_lt1 and prod > exactprod): + * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): * return False - * if forwardcheck and not missing_lt1: # <<<<<<<<<<<<<< + * if forwardcheck: # <<<<<<<<<<<<<< * for variable in variables: - * if variable not in assignments: + * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): */ - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 816, __pyx_L1_error) - if (__pyx_t_12) { - } else { - __pyx_t_11 = __pyx_t_12; - goto __pyx_L17_bool_binop_done; - } - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_missing_lt1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 816, __pyx_L1_error) - __pyx_t_10 = (!__pyx_t_12); - __pyx_t_11 = __pyx_t_10; - __pyx_L17_bool_binop_done:; - if (__pyx_t_11) { + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 816, __pyx_L1_error) + if (__pyx_t_10) { /* "constraint/constraints.py":817 * return False - * if forwardcheck and not missing_lt1: + * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< - * if variable not in assignments: + * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): * domain = domains[variable] */ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { @@ -21542,18 +21533,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_t_1 = 0; /* "constraint/constraints.py":818 - * if forwardcheck and not missing_lt1: + * if forwardcheck: * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< + * 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_11 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 818, __pyx_L1_error) - if (__pyx_t_11) { + __pyx_t_12 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 818, __pyx_L1_error) + if (__pyx_t_12) { + } else { + __pyx_t_10 = __pyx_t_12; + goto __pyx_L20_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, 818, __pyx_L1_error) + if (!__pyx_t_12) { + } else { + __pyx_t_10 = __pyx_t_12; + goto __pyx_L20_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, 818, __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) { /* "constraint/constraints.py":819 * for variable in variables: - * if variable not in assignments: + * 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: @@ -21564,7 +21570,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_t_1 = 0; /* "constraint/constraints.py":820 - * if variable not in assignments: + * 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: @@ -21636,9 +21642,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __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, 821, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 821, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 821, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_11) { + if (__pyx_t_10) { /* "constraint/constraints.py":822 * for value in domain[:]: @@ -21669,7 +21675,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca } /* "constraint/constraints.py":820 - * if variable not in assignments: + * 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: @@ -21685,9 +21691,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca * return False * return True */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 823, __pyx_L1_error) - __pyx_t_10 = (!__pyx_t_11); - if (__pyx_t_10) { + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 823, __pyx_L1_error) + __pyx_t_12 = (!__pyx_t_10); + if (__pyx_t_12) { /* "constraint/constraints.py":824 * domain.hideValue(value) @@ -21712,9 +21718,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca } /* "constraint/constraints.py":818 - * if forwardcheck and not missing_lt1: + * if forwardcheck: * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< + * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: */ @@ -21722,20 +21728,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca /* "constraint/constraints.py":817 * return False - * if forwardcheck and not missing_lt1: + * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< - * if variable not in assignments: + * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): * domain = domains[variable] */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/constraints.py":816 - * if not missing and prod != exactprod or (not missing_lt1 and prod > exactprod): + * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): * return False - * if forwardcheck and not missing_lt1: # <<<<<<<<<<<<<< + * if forwardcheck: # <<<<<<<<<<<<<< * for variable in variables: - * if variable not in assignments: + * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): */ } @@ -21781,7 +21787,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca return __pyx_r; } -/* "constraint/constraints.py":839 +/* "constraint/constraints.py":841 * """ * * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -21830,39 +21836,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, 839, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 841, __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, 839, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 841, __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, 841, __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, 841, __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, 839, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 841, __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, 839, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 841, __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, 841, __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, 839, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 841, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -21891,16 +21897,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":845 + /* "constraint/constraints.py":847 * maxprod: Value to be considered as the maximum product * """ * self._maxprod = maxprod # <<<<<<<<<<<<<< * * 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, 845, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxprod_2, __pyx_v_maxprod) < 0) __PYX_ERR(0, 847, __pyx_L1_error) - /* "constraint/constraints.py":839 + /* "constraint/constraints.py":841 * """ * * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -21920,7 +21926,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ return __pyx_r; } -/* "constraint/constraints.py":847 +/* "constraint/constraints.py":849 * self._maxprod = maxprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -21971,50 +21977,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, 847, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 849, __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, 847, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 849, __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, 847, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 849, __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, 847, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 849, __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, 847, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 849, __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, 847, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 849, __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, 847, __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, 849, __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, 847, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 849, __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, 847, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 849, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 847, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 849, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 847, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 849, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 847, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 849, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 847, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 849, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -22024,7 +22030,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, 847, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 849, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -22035,9 +22041,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, 847, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 847, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 847, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 849, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 849, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 849, __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 */ @@ -22058,7 +22064,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":854 +/* "constraint/constraints.py":856 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -22078,7 +22084,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_10prePr if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 854, __pyx_L1_error) + __PYX_ERR(0, 856, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -22086,7 +22092,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_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_MaxProdConstraint_preProcess_loc, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 854, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_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_MaxProdConstraint_preProcess_loc, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 856, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -22123,16 +22129,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 854, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 854, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 856, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 856, __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, 854, __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, 856, __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, 854, __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, 856, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -22140,7 +22146,7 @@ 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, 854, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 856, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -22150,7 +22156,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr { 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, 854, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 856, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -22161,13 +22167,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __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, 854, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 856, __pyx_L1_error) PyErr_Clear(); } break; @@ -22178,8 +22184,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, 854, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 854, __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, 856, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 856, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_XDECREF(__pyx_r); @@ -22218,7 +22224,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr return __pyx_r; } -/* "constraint/constraints.py":847 +/* "constraint/constraints.py":849 * self._maxprod = maxprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -22255,7 +22261,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":848 + /* "constraint/constraints.py":850 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -22263,9 +22269,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, 848, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 850, __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, 848, __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, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -22285,24 +22291,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __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_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, 848, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":851 + /* "constraint/constraints.py":853 * * # 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, 851, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __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, 851, __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, 853, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":852 + /* "constraint/constraints.py":854 * # check if there are any values less than 1 in the associated variables * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None # <<<<<<<<<<<<<< @@ -22312,7 +22318,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_INCREF(Py_None); __pyx_v_variable_with_lt1 = Py_None; - /* "constraint/constraints.py":853 + /* "constraint/constraints.py":855 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -22324,9 +22330,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, 853, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __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, 853, __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, 855, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -22334,7 +22340,7 @@ 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, 853, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 855, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -22344,7 +22350,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 853, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 855, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -22355,13 +22361,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 853, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __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, 853, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 855, __pyx_L1_error) PyErr_Clear(); } break; @@ -22371,37 +22377,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":854 + /* "constraint/constraints.py":856 * 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, 854, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __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, 854, __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, 856, __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, 854, __pyx_L1_error) + __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __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":855 + /* "constraint/constraints.py":857 * 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, 855, __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, 857, __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, 855, __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, 857, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":853 + /* "constraint/constraints.py":855 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -22411,7 +22417,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":856 + /* "constraint/constraints.py":858 * 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): # <<<<<<<<<<<<<< @@ -22421,7 +22427,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __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, 856, __pyx_L1_error) + __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, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; { @@ -22430,7 +22436,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __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, 856, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -22438,9 +22444,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, 856, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __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, 856, __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, 858, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -22449,7 +22455,7 @@ 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, 856, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 858, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -22459,7 +22465,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 856, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 858, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -22470,13 +22476,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __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, 856, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 858, __pyx_L1_error) PyErr_Clear(); } break; @@ -22489,7 +22495,7 @@ 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, 856, __pyx_L1_error) + __PYX_ERR(0, 858, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -22499,22 +22505,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __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, 856, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __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, 856, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 858, __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); @@ -22522,7 +22528,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __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; __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 856, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 858, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_unpacking_done; @@ -22530,7 +22536,7 @@ 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, 856, __pyx_L1_error) + __PYX_ERR(0, 858, __pyx_L1_error) __pyx_L9_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); @@ -22538,7 +22544,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":857 + /* "constraint/constraints.py":859 * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: # <<<<<<<<<<<<<< @@ -22548,7 +22554,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":858 + /* "constraint/constraints.py":860 * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< @@ -22558,7 +22564,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":860 + /* "constraint/constraints.py":862 * if variable_with_lt1 is not None: * # if more than one associated variables contain less than 1, we can't prune * return # <<<<<<<<<<<<<< @@ -22570,7 +22576,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/constraints.py":858 + /* "constraint/constraints.py":860 * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< @@ -22579,7 +22585,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":861 + /* "constraint/constraints.py":863 * # if more than one associated variables contain less than 1, we can't prune * return * variable_with_lt1 = variable # <<<<<<<<<<<<<< @@ -22589,7 +22595,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":857 + /* "constraint/constraints.py":859 * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: # <<<<<<<<<<<<<< @@ -22598,7 +22604,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":856 + /* "constraint/constraints.py":858 * 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): # <<<<<<<<<<<<<< @@ -22608,19 +22614,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":864 + /* "constraint/constraints.py":866 * * # 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, 864, __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, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_maxprod = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/constraints.py":865 + /* "constraint/constraints.py":867 * # prune the associated variables of values > maxprod * maxprod = self._maxprod * for variable in variables: # <<<<<<<<<<<<<< @@ -22632,9 +22638,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, 865, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 867, __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, 865, __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, 867, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -22642,7 +22648,7 @@ 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, 865, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 867, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -22652,7 +22658,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 865, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 867, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -22663,13 +22669,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 867, __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, 865, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 867, __pyx_L1_error) PyErr_Clear(); } break; @@ -22679,7 +22685,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":866 + /* "constraint/constraints.py":868 * maxprod = self._maxprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -22692,14 +22698,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, 866, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 866, __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, 868, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 868, __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":867 + /* "constraint/constraints.py":869 * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: * continue # <<<<<<<<<<<<<< @@ -22708,7 +22714,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ goto __pyx_L13_continue; - /* "constraint/constraints.py":866 + /* "constraint/constraints.py":868 * maxprod = self._maxprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -22717,35 +22723,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":868 + /* "constraint/constraints.py":870 * 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, 868, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":869 + /* "constraint/constraints.py":871 * 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, 869, __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, 871, __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_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, 869, __pyx_L1_error) + __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 871, __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, 869, __pyx_L1_error) + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 871, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -22754,7 +22760,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 869, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 871, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -22764,7 +22770,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 869, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 871, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -22775,13 +22781,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_13; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_14(__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, 869, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 871, __pyx_L1_error) PyErr_Clear(); } break; @@ -22791,19 +22797,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":870 + /* "constraint/constraints.py":872 * 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, 870, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 870, __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, 872, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { - /* "constraint/constraints.py":871 + /* "constraint/constraints.py":873 * for value in domain[:]: * if value > maxprod: * domain.remove(value) # <<<<<<<<<<<<<< @@ -22817,12 +22823,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro 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, 871, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":870 + /* "constraint/constraints.py":872 * domain = domains[variable] * for value in domain[:]: * if value > maxprod: # <<<<<<<<<<<<<< @@ -22832,27 +22838,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro goto __pyx_L20; } - /* "constraint/constraints.py":872 + /* "constraint/constraints.py":874 * 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, 872, __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, 874, __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, 872, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 872, __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, 874, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 874, __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":873 + /* "constraint/constraints.py":875 * domain.remove(value) * elif value == 0 and maxprod < 0: * domain.remove(value) # <<<<<<<<<<<<<< @@ -22866,12 +22872,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro 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, 873, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":872 + /* "constraint/constraints.py":874 * if value > maxprod: * domain.remove(value) * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< @@ -22881,7 +22887,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __pyx_L20:; - /* "constraint/constraints.py":869 + /* "constraint/constraints.py":871 * continue * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -22891,7 +22897,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":865 + /* "constraint/constraints.py":867 * # prune the associated variables of values > maxprod * maxprod = self._maxprod * for variable in variables: # <<<<<<<<<<<<<< @@ -22902,7 +22908,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":847 + /* "constraint/constraints.py":849 * self._maxprod = maxprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -22934,7 +22940,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro return __pyx_r; } -/* "constraint/constraints.py":875 +/* "constraint/constraints.py":877 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -22985,53 +22991,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, 875, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 877, __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, 877, __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, 877, __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, 877, __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, 877, __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, 877, __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, 875, __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, 877, __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, 875, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 877, __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, 875, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 877, __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, 877, __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, 877, __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, 877, __pyx_L3_error) 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, 877, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -23045,7 +23051,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, 875, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 877, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -23056,8 +23062,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, 875, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 875, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 877, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 877, __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 */ @@ -23107,50 +23113,52 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":876 + /* "constraint/constraints.py":878 * * 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, 876, __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, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_maxprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":877 + /* "constraint/constraints.py":879 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * maxprod = self._maxprod * prod = 1 # <<<<<<<<<<<<<< * missing = False - * missing_lt1 = False + * missing_lt1 = [] */ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; - /* "constraint/constraints.py":878 + /* "constraint/constraints.py":880 * maxprod = self._maxprod * prod = 1 * missing = False # <<<<<<<<<<<<<< - * missing_lt1 = False + * missing_lt1 = [] * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): */ __pyx_v_missing = 0; - /* "constraint/constraints.py":879 + /* "constraint/constraints.py":881 * prod = 1 * missing = False - * missing_lt1 = False # <<<<<<<<<<<<<< + * missing_lt1 = [] # <<<<<<<<<<<<<< * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if variable in assignments: */ - __Pyx_INCREF(Py_False); - __pyx_v_missing_lt1 = Py_False; + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_missing_lt1 = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":880 + /* "constraint/constraints.py":882 * missing = False - * missing_lt1 = False + * missing_lt1 = [] * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< * if variable in assignments: * prod *= assignments[variable] @@ -23158,7 +23166,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __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, 880, __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, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; { @@ -23167,7 +23175,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __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, 880, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -23175,9 +23183,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __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, 880, __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, 882, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -23186,7 +23194,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 880, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 882, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -23196,7 +23204,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 880, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 882, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -23207,13 +23215,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __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, 880, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 882, __pyx_L1_error) PyErr_Clear(); } break; @@ -23226,7 +23234,7 @@ 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, 880, __pyx_L1_error) + __PYX_ERR(0, 882, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -23236,22 +23244,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 880, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 882, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __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, 880, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __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_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __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); @@ -23259,7 +23267,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __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, 880, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 882, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -23267,7 +23275,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 880, __pyx_L1_error) + __PYX_ERR(0, 882, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); @@ -23275,33 +23283,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":881 - * missing_lt1 = False + /* "constraint/constraints.py":883 + * missing_lt1 = [] * 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, 881, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 883, __pyx_L1_error) if (__pyx_t_10) { - /* "constraint/constraints.py":882 + /* "constraint/constraints.py":884 * 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, 882, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __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, 882, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":881 - * missing_lt1 = False + /* "constraint/constraints.py":883 + * missing_lt1 = [] * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if variable in assignments: # <<<<<<<<<<<<<< * prod *= assignments[variable] @@ -23310,51 +23318,49 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call goto __pyx_L7; } - /* "constraint/constraints.py":884 + /* "constraint/constraints.py":886 * prod *= assignments[variable] * else: * missing = True # <<<<<<<<<<<<<< - * if not missing_lt1: - * missing_lt1 = contains_lt1 + * if contains_lt1: + * missing_lt1.append(variable) */ /*else*/ { __pyx_v_missing = 1; - /* "constraint/constraints.py":885 + /* "constraint/constraints.py":887 * else: * missing = True - * if not missing_lt1: # <<<<<<<<<<<<<< - * missing_lt1 = contains_lt1 + * if contains_lt1: # <<<<<<<<<<<<<< + * missing_lt1.append(variable) * if isinstance(prod, float): */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_missing_lt1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 885, __pyx_L1_error) - __pyx_t_11 = (!__pyx_t_10); - if (__pyx_t_11) { + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_contains_lt1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 887, __pyx_L1_error) + if (__pyx_t_10) { - /* "constraint/constraints.py":886 + /* "constraint/constraints.py":888 * missing = True - * if not missing_lt1: - * missing_lt1 = contains_lt1 # <<<<<<<<<<<<<< + * if contains_lt1: + * missing_lt1.append(variable) # <<<<<<<<<<<<<< * if isinstance(prod, float): * prod = round(prod, 10) */ - __Pyx_INCREF(__pyx_v_contains_lt1); - __Pyx_DECREF_SET(__pyx_v_missing_lt1, __pyx_v_contains_lt1); + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_missing_lt1, __pyx_v_variable); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 888, __pyx_L1_error) - /* "constraint/constraints.py":885 + /* "constraint/constraints.py":887 * else: * missing = True - * if not missing_lt1: # <<<<<<<<<<<<<< - * missing_lt1 = contains_lt1 + * if contains_lt1: # <<<<<<<<<<<<<< + * missing_lt1.append(variable) * if isinstance(prod, float): */ } } __pyx_L7:; - /* "constraint/constraints.py":880 + /* "constraint/constraints.py":882 * missing = False - * missing_lt1 = False + * missing_lt1 = [] * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< * if variable in assignments: * prod *= assignments[variable] @@ -23362,21 +23368,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":887 - * if not missing_lt1: - * missing_lt1 = contains_lt1 + /* "constraint/constraints.py":889 + * if contains_lt1: + * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< * prod = round(prod, 10) - * if (not missing or not missing_lt1) and prod > maxprod: + * if (not missing or len(missing_lt1) == 0) and prod > maxprod: */ - __pyx_t_11 = PyFloat_Check(__pyx_v_prod); - if (__pyx_t_11) { + __pyx_t_10 = PyFloat_Check(__pyx_v_prod); + if (__pyx_t_10) { - /* "constraint/constraints.py":888 - * missing_lt1 = contains_lt1 + /* "constraint/constraints.py":890 + * missing_lt1.append(variable) * if isinstance(prod, float): * prod = round(prod, 10) # <<<<<<<<<<<<<< - * if (not missing or not missing_lt1) and prod > maxprod: + * if (not missing or len(missing_lt1) == 0) and prod > maxprod: * return False */ __pyx_t_2 = NULL; @@ -23388,53 +23394,53 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __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, 888, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":887 - * if not missing_lt1: - * missing_lt1 = contains_lt1 + /* "constraint/constraints.py":889 + * if contains_lt1: + * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< * prod = round(prod, 10) - * if (not missing or not missing_lt1) and prod > maxprod: + * if (not missing or len(missing_lt1) == 0) and prod > maxprod: */ } - /* "constraint/constraints.py":889 + /* "constraint/constraints.py":891 * if isinstance(prod, float): * prod = round(prod, 10) - * if (not missing or not missing_lt1) and prod > maxprod: # <<<<<<<<<<<<<< + * if (not missing or len(missing_lt1) == 0) and prod > maxprod: # <<<<<<<<<<<<<< * return False - * if forwardcheck and not missing_lt1: + * if forwardcheck: */ - __pyx_t_10 = (!__pyx_v_missing); - if (!__pyx_t_10) { + __pyx_t_12 = (!__pyx_v_missing); + if (!__pyx_t_12) { } else { goto __pyx_L13_next_and; } - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_missing_lt1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 889, __pyx_L1_error) - __pyx_t_12 = (!__pyx_t_10); + __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_12 = (__pyx_t_6 == 0); if (__pyx_t_12) { } else { - __pyx_t_11 = __pyx_t_12; + __pyx_t_10 = __pyx_t_12; goto __pyx_L12_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, 889, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 889, __pyx_L1_error) + __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, 891, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 891, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = __pyx_t_12; + __pyx_t_10 = __pyx_t_12; __pyx_L12_bool_binop_done:; - if (__pyx_t_11) { + if (__pyx_t_10) { - /* "constraint/constraints.py":890 + /* "constraint/constraints.py":892 * prod = round(prod, 10) - * if (not missing or not missing_lt1) and prod > maxprod: + * if (not missing or len(missing_lt1) == 0) and prod > maxprod: * return False # <<<<<<<<<<<<<< - * if forwardcheck and not missing_lt1: + * if forwardcheck: * for variable in variables: */ __Pyx_XDECREF(__pyx_r); @@ -23442,39 +23448,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":889 + /* "constraint/constraints.py":891 * if isinstance(prod, float): * prod = round(prod, 10) - * if (not missing or not missing_lt1) and prod > maxprod: # <<<<<<<<<<<<<< + * if (not missing or len(missing_lt1) == 0) and prod > maxprod: # <<<<<<<<<<<<<< * return False - * if forwardcheck and not missing_lt1: + * if forwardcheck: */ } - /* "constraint/constraints.py":891 - * if (not missing or not missing_lt1) and prod > maxprod: + /* "constraint/constraints.py":893 + * if (not missing or len(missing_lt1) == 0) and prod > maxprod: * return False - * if forwardcheck and not missing_lt1: # <<<<<<<<<<<<<< + * if forwardcheck: # <<<<<<<<<<<<<< * for variable in variables: - * if variable not in assignments: + * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): */ - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 891, __pyx_L1_error) - if (__pyx_t_12) { - } else { - __pyx_t_11 = __pyx_t_12; - goto __pyx_L16_bool_binop_done; - } - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_missing_lt1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 891, __pyx_L1_error) - __pyx_t_10 = (!__pyx_t_12); - __pyx_t_11 = __pyx_t_10; - __pyx_L16_bool_binop_done:; - if (__pyx_t_11) { + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 893, __pyx_L1_error) + if (__pyx_t_10) { - /* "constraint/constraints.py":892 + /* "constraint/constraints.py":894 * return False - * if forwardcheck and not missing_lt1: + * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< - * if variable not in assignments: + * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): * domain = domains[variable] */ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { @@ -23482,9 +23479,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 894, __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, 892, __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, 894, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -23492,7 +23489,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 892, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 894, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -23502,7 +23499,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 892, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 894, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -23513,13 +23510,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 894, __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, 892, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 894, __pyx_L1_error) PyErr_Clear(); } break; @@ -23529,45 +23526,60 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":893 - * if forwardcheck and not missing_lt1: + /* "constraint/constraints.py":895 + * if forwardcheck: * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< + * 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_11 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 893, __pyx_L1_error) - if (__pyx_t_11) { + __pyx_t_12 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 895, __pyx_L1_error) + if (__pyx_t_12) { + } else { + __pyx_t_10 = __pyx_t_12; + goto __pyx_L19_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, 895, __pyx_L1_error) + if (!__pyx_t_12) { + } else { + __pyx_t_10 = __pyx_t_12; + goto __pyx_L19_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, 895, __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) { - /* "constraint/constraints.py":894 + /* "constraint/constraints.py":896 * for variable in variables: - * if variable not in assignments: + * 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, 894, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":895 - * if variable not in assignments: + /* "constraint/constraints.py":897 + * 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, 895, __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, 897, __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; } else { - __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 895, __pyx_L1_error) + __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 897, __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, 895, __pyx_L1_error) + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 897, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -23576,7 +23588,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 895, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 897, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -23586,7 +23598,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 895, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 897, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -23597,13 +23609,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call #endif ++__pyx_t_13; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 897, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_14(__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, 895, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 897, __pyx_L1_error) PyErr_Clear(); } break; @@ -23613,22 +23625,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":896 + /* "constraint/constraints.py":898 * 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, 896, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_v_prod, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __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, 896, __pyx_L1_error) + __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, 898, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 896, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_11) { + if (__pyx_t_10) { - /* "constraint/constraints.py":897 + /* "constraint/constraints.py":899 * for value in domain[:]: * if prod * value > maxprod: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -23642,12 +23654,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call 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, 897, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":896 + /* "constraint/constraints.py":898 * domain = domains[variable] * for value in domain[:]: * if prod * value > maxprod: # <<<<<<<<<<<<<< @@ -23656,8 +23668,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":895 - * if variable not in assignments: + /* "constraint/constraints.py":897 + * 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: @@ -23666,18 +23678,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":898 + /* "constraint/constraints.py":900 * if prod * value > maxprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False * return True */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 898, __pyx_L1_error) - __pyx_t_10 = (!__pyx_t_11); - if (__pyx_t_10) { + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 900, __pyx_L1_error) + __pyx_t_12 = (!__pyx_t_10); + if (__pyx_t_12) { - /* "constraint/constraints.py":899 + /* "constraint/constraints.py":901 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -23690,7 +23702,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "constraint/constraints.py":898 + /* "constraint/constraints.py":900 * if prod * value > maxprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -23699,35 +23711,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":893 - * if forwardcheck and not missing_lt1: + /* "constraint/constraints.py":895 + * if forwardcheck: * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< + * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: */ } - /* "constraint/constraints.py":892 + /* "constraint/constraints.py":894 * return False - * if forwardcheck and not missing_lt1: + * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< - * if variable not in assignments: + * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): * domain = domains[variable] */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":891 - * if (not missing or not missing_lt1) and prod > maxprod: + /* "constraint/constraints.py":893 + * if (not missing or len(missing_lt1) == 0) and prod > maxprod: * return False - * if forwardcheck and not missing_lt1: # <<<<<<<<<<<<<< + * if forwardcheck: # <<<<<<<<<<<<<< * for variable in variables: - * if variable not in assignments: + * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): */ } - /* "constraint/constraints.py":900 + /* "constraint/constraints.py":902 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -23739,7 +23751,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":875 + /* "constraint/constraints.py":877 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -23769,7 +23781,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call return __pyx_r; } -/* "constraint/constraints.py":914 +/* "constraint/constraints.py":916 * """ * * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -23818,39 +23830,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, 914, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 916, __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, 914, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 916, __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, 914, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 916, __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, 914, __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, 916, __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, 914, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 916, __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, 914, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 916, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 914, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 916, __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, 914, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 916, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -23879,16 +23891,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":920 + /* "constraint/constraints.py":922 * 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, 920, __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, 922, __pyx_L1_error) - /* "constraint/constraints.py":914 + /* "constraint/constraints.py":916 * """ * * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -23908,7 +23920,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ return __pyx_r; } -/* "constraint/constraints.py":922 +/* "constraint/constraints.py":924 * self._minprod = minprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -23959,50 +23971,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, 922, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 924, __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, 922, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 924, __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, 922, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 924, __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, 922, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 924, __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, 922, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 924, __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, 922, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 924, __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, 922, __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, 924, __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, 922, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 924, __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, 922, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 924, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 922, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 924, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 922, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 924, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 922, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 924, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 922, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 924, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -24012,7 +24024,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, 922, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 924, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -24023,9 +24035,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, 922, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 922, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 922, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 924, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 924, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 924, __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 */ @@ -24068,7 +24080,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":923 + /* "constraint/constraints.py":925 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -24076,9 +24088,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, 923, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 925, __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, 923, __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, 925, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -24098,24 +24110,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro __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_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, 923, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 925, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":926 + /* "constraint/constraints.py":928 * * # 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, 926, __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, 928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_minprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":927 + /* "constraint/constraints.py":929 * # prune the associated variables of values > minprod * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< @@ -24127,9 +24139,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, 927, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 929, __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, 927, __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, 929, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -24137,7 +24149,7 @@ 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, 927, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 929, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -24147,7 +24159,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro { 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, 927, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 929, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -24158,13 +24170,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 927, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 929, __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, 927, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 929, __pyx_L1_error) PyErr_Clear(); } break; @@ -24174,35 +24186,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":928 + /* "constraint/constraints.py":930 * 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, 928, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":929 + /* "constraint/constraints.py":931 * 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, 929, __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, 931, __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, 929, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 931, __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, 929, __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, 931, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -24211,7 +24223,7 @@ 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, 929, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 931, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -24221,7 +24233,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro { 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, 929, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 931, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -24232,13 +24244,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 929, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 931, __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, 929, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 931, __pyx_L1_error) PyErr_Clear(); } break; @@ -24248,27 +24260,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":930 + /* "constraint/constraints.py":932 * 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, 930, __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, 932, __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, 930, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 930, __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, 932, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 932, __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":931 + /* "constraint/constraints.py":933 * for value in domain[:]: * if value == 0 and minprod > 0: * domain.remove(value) # <<<<<<<<<<<<<< @@ -24282,12 +24294,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro 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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 931, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":930 + /* "constraint/constraints.py":932 * domain = domains[variable] * for value in domain[:]: * if value == 0 and minprod > 0: # <<<<<<<<<<<<<< @@ -24296,7 +24308,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro */ } - /* "constraint/constraints.py":929 + /* "constraint/constraints.py":931 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -24306,7 +24318,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":927 + /* "constraint/constraints.py":929 * # prune the associated variables of values > minprod * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< @@ -24316,7 +24328,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":922 + /* "constraint/constraints.py":924 * self._minprod = minprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -24344,7 +24356,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro return __pyx_r; } -/* "constraint/constraints.py":933 +/* "constraint/constraints.py":935 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -24395,53 +24407,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, 933, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 935, __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, 933, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 935, __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, 933, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 935, __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, 933, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 935, __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, 933, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 935, __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, 933, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 935, __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, 933, __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, 935, __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, 933, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 935, __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, 933, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 935, __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, 933, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 935, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 933, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 935, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 933, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 935, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 933, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 935, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -24455,7 +24467,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, 933, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 935, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -24466,8 +24478,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, 933, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 933, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 935, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 935, __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 */ @@ -24505,7 +24517,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":935 + /* "constraint/constraints.py":937 * 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: # <<<<<<<<<<<<<< @@ -24517,9 +24529,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, 935, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __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, 935, __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, 937, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -24527,7 +24539,7 @@ 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, 935, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 937, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -24537,7 +24549,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call { 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, 935, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 937, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -24548,13 +24560,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 935, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 937, __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, 935, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 937, __pyx_L1_error) PyErr_Clear(); } break; @@ -24564,17 +24576,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":936 + /* "constraint/constraints.py":938 * # 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, 936, __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, 938, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":937 + /* "constraint/constraints.py":939 * for variable in variables: * if variable not in assignments: * return True # <<<<<<<<<<<<<< @@ -24587,7 +24599,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":936 + /* "constraint/constraints.py":938 * # check if each variable is in the assignments * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -24596,7 +24608,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call */ } - /* "constraint/constraints.py":935 + /* "constraint/constraints.py":937 * 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: # <<<<<<<<<<<<<< @@ -24606,19 +24618,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":940 + /* "constraint/constraints.py":942 * * # 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, 940, __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, 942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_minprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":941 + /* "constraint/constraints.py":943 * # with each variable assigned, sum the values * minprod = self._minprod * prod = 1 # <<<<<<<<<<<<<< @@ -24628,7 +24640,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":942 + /* "constraint/constraints.py":944 * minprod = self._minprod * prod = 1 * for variable in variables: # <<<<<<<<<<<<<< @@ -24640,9 +24652,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, 942, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __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, 942, __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, 944, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -24650,7 +24662,7 @@ 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, 942, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 944, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -24660,7 +24672,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call { 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, 942, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 944, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -24671,13 +24683,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 942, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 944, __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, 942, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 944, __pyx_L1_error) PyErr_Clear(); } break; @@ -24687,22 +24699,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":943 + /* "constraint/constraints.py":945 * 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, 943, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 945, __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, 943, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 945, __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":942 + /* "constraint/constraints.py":944 * minprod = self._minprod * prod = 1 * for variable in variables: # <<<<<<<<<<<<<< @@ -24712,7 +24724,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":944 + /* "constraint/constraints.py":946 * for variable in variables: * prod *= assignments[variable] * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -24722,7 +24734,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":945 + /* "constraint/constraints.py":947 * prod *= assignments[variable] * if isinstance(prod, float): * prod = round(prod, 10) # <<<<<<<<<<<<<< @@ -24738,13 +24750,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call __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_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, 945, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":944 + /* "constraint/constraints.py":946 * for variable in variables: * prod *= assignments[variable] * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -24753,7 +24765,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call */ } - /* "constraint/constraints.py":946 + /* "constraint/constraints.py":948 * if isinstance(prod, float): * prod = round(prod, 10) * return prod >= minprod # <<<<<<<<<<<<<< @@ -24761,12 +24773,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, 946, __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, 948, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":933 + /* "constraint/constraints.py":935 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -24790,7 +24802,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call return __pyx_r; } -/* "constraint/constraints.py":960 +/* "constraint/constraints.py":962 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -24839,39 +24851,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, 960, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 962, __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, 960, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 962, __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, 960, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 962, __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, 960, __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, 962, __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, 960, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 962, __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, 960, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 962, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 960, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 962, __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, 960, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 962, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -24900,16 +24912,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":966 + /* "constraint/constraints.py":968 * 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, 966, __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, 968, __pyx_L1_error) - /* "constraint/constraints.py":960 + /* "constraint/constraints.py":962 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -24929,7 +24941,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( return __pyx_r; } -/* "constraint/constraints.py":968 +/* "constraint/constraints.py":970 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -24980,53 +24992,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, 968, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 970, __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, 968, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 970, __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, 968, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 970, __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, 968, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 970, __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, 968, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 970, __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, 968, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 970, __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, 968, __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, 970, __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, 968, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 970, __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, 968, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 970, __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, 968, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 970, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 968, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 970, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 968, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 970, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 968, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 970, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -25040,7 +25052,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, 968, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 970, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -25073,7 +25085,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":970 + /* "constraint/constraints.py":972 * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 * # preProcess() will remove it. * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< @@ -25089,14 +25101,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ __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, 970, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 972, __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, 970, __pyx_L1_error) + __PYX_ERR(0, 972, __pyx_L1_error) - /* "constraint/constraints.py":968 + /* "constraint/constraints.py":970 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -25116,7 +25128,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ return __pyx_r; } -/* "constraint/constraints.py":972 +/* "constraint/constraints.py":974 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -25167,50 +25179,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, 972, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 974, __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, 972, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 974, __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, 972, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 974, __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, 972, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 974, __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, 972, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 974, __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, 972, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 974, __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, 972, __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, 974, __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, 972, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 974, __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, 972, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 974, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 972, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 974, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 972, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 974, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 972, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 974, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 972, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 974, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -25220,7 +25232,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, 972, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 974, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -25231,9 +25243,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, 972, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 972, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 972, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 974, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 974, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 974, __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 */ @@ -25276,19 +25288,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":973 + /* "constraint/constraints.py":975 * * 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, 973, __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, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":974 + /* "constraint/constraints.py":976 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -25300,9 +25312,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, 974, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __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, 974, __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, 976, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -25310,7 +25322,7 @@ 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, 974, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 976, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -25320,7 +25332,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce { 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, 974, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 976, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -25331,13 +25343,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 974, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __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, 974, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 976, __pyx_L1_error) PyErr_Clear(); } break; @@ -25347,35 +25359,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":975 + /* "constraint/constraints.py":977 * 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, 975, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":976 + /* "constraint/constraints.py":978 * 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, 976, __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, 978, __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, 976, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 978, __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, 976, __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, 978, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -25384,7 +25396,7 @@ 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, 976, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 978, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -25394,7 +25406,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce { 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, 976, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 978, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -25405,13 +25417,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 978, __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, 976, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 978, __pyx_L1_error) PyErr_Clear(); } break; @@ -25421,17 +25433,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":977 + /* "constraint/constraints.py":979 * 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, 977, __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, 979, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":978 + /* "constraint/constraints.py":980 * for value in domain[:]: * if value not in set: * domain.remove(value) # <<<<<<<<<<<<<< @@ -25445,12 +25457,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce 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_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 978, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":977 + /* "constraint/constraints.py":979 * domain = domains[variable] * for value in domain[:]: * if value not in set: # <<<<<<<<<<<<<< @@ -25459,7 +25471,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce */ } - /* "constraint/constraints.py":976 + /* "constraint/constraints.py":978 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -25469,25 +25481,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":979 + /* "constraint/constraints.py":981 * 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, 979, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 981, __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, 979, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 981, __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, 979, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 981, __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, 979, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 981, __pyx_L1_error); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11}; @@ -25495,12 +25507,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce __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, 979, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":974 + /* "constraint/constraints.py":976 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -25510,27 +25522,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":980 + /* "constraint/constraints.py":982 * 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, 980, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __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, 980, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 982, __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, 980, __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, 980, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 982, __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, 982, __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":972 + /* "constraint/constraints.py":974 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -25559,7 +25571,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce return __pyx_r; } -/* "constraint/constraints.py":994 +/* "constraint/constraints.py":996 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -25608,39 +25620,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, 994, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 996, __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, 994, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 996, __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, 994, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 996, __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, 994, __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, 996, __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, 994, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 996, __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, 994, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 996, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 994, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 996, __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, 994, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 996, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -25669,16 +25681,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1000 + /* "constraint/constraints.py":1002 * 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, 1000, __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, 1002, __pyx_L1_error) - /* "constraint/constraints.py":994 + /* "constraint/constraints.py":996 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -25698,7 +25710,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init return __pyx_r; } -/* "constraint/constraints.py":1002 +/* "constraint/constraints.py":1004 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -25749,53 +25761,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, 1002, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1004, __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, 1002, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1004, __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, 1002, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1004, __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, 1002, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1004, __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, 1002, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1004, __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, 1002, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1004, __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, 1002, __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, 1004, __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, 1002, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1004, __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, 1002, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1004, __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, 1002, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1004, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1002, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1004, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1002, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1004, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1002, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1004, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -25809,7 +25821,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, 1002, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1004, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -25842,7 +25854,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1004 + /* "constraint/constraints.py":1006 * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 * # preProcess() will remove it. * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< @@ -25858,14 +25870,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal __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, 1004, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1006, __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, 1004, __pyx_L1_error) + __PYX_ERR(0, 1006, __pyx_L1_error) - /* "constraint/constraints.py":1002 + /* "constraint/constraints.py":1004 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -25885,7 +25897,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal return __pyx_r; } -/* "constraint/constraints.py":1006 +/* "constraint/constraints.py":1008 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -25936,50 +25948,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, 1006, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1008, __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, 1006, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1008, __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, 1006, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1008, __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, 1006, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1008, __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, 1006, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1008, __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, 1006, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1008, __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, 1006, __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, 1008, __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, 1006, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1008, __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, 1006, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1008, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1006, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1008, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1006, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1008, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1006, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1008, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1006, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1008, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -25989,7 +26001,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, 1006, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1008, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26000,9 +26012,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, 1006, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1006, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1006, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1008, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1008, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1008, __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 */ @@ -26045,19 +26057,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1007 + /* "constraint/constraints.py":1009 * * 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, 1007, __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, 1009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1008 + /* "constraint/constraints.py":1010 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -26069,9 +26081,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, 1008, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __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, 1008, __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, 1010, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -26079,7 +26091,7 @@ 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, 1008, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1010, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -26089,7 +26101,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr { 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, 1008, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1010, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -26100,13 +26112,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1008, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1010, __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, 1008, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1010, __pyx_L1_error) PyErr_Clear(); } break; @@ -26116,35 +26128,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":1009 + /* "constraint/constraints.py":1011 * 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, 1009, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1011, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1010 + /* "constraint/constraints.py":1012 * 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, 1010, __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, 1012, __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, 1010, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1012, __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, 1010, __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, 1012, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -26153,7 +26165,7 @@ 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, 1010, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1012, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -26163,7 +26175,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr { 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, 1010, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1012, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -26174,13 +26186,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1010, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1012, __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, 1010, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1012, __pyx_L1_error) PyErr_Clear(); } break; @@ -26190,17 +26202,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":1011 + /* "constraint/constraints.py":1013 * 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, 1011, __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, 1013, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1012 + /* "constraint/constraints.py":1014 * for value in domain[:]: * if value in set: * domain.remove(value) # <<<<<<<<<<<<<< @@ -26214,12 +26226,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr 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_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1012, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1011 + /* "constraint/constraints.py":1013 * domain = domains[variable] * for value in domain[:]: * if value in set: # <<<<<<<<<<<<<< @@ -26228,7 +26240,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr */ } - /* "constraint/constraints.py":1010 + /* "constraint/constraints.py":1012 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -26238,25 +26250,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1013 + /* "constraint/constraints.py":1015 * 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, 1013, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1015, __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, 1013, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1015, __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, 1013, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1015, __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, 1013, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1015, __pyx_L1_error); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11}; @@ -26264,12 +26276,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr __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, 1013, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1015, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1008 + /* "constraint/constraints.py":1010 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -26279,27 +26291,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1014 + /* "constraint/constraints.py":1016 * 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, 1014, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __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, 1014, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1016, __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, 1014, __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, 1014, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1016, __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, 1016, __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":1006 + /* "constraint/constraints.py":1008 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -26328,7 +26340,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr return __pyx_r; } -/* "constraint/constraints.py":1028 +/* "constraint/constraints.py":1030 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -26379,50 +26391,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, 1028, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1030, __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, 1028, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1030, __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, 1028, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1030, __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, 1028, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1030, __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, 1028, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1030, __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, 1028, __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, 1030, __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, 1028, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, i); __PYX_ERR(0, 1030, __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, 1028, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1030, __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, 1028, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1030, __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, 1028, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1030, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1028, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1030, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -26436,7 +26448,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, 1028, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1030, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26465,34 +26477,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1038 + /* "constraint/constraints.py":1040 * 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, 1038, __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, 1040, __pyx_L1_error) - /* "constraint/constraints.py":1039 + /* "constraint/constraints.py":1041 * """ * 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, 1039, __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, 1041, __pyx_L1_error) - /* "constraint/constraints.py":1040 + /* "constraint/constraints.py":1042 * 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, 1040, __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, 1042, __pyx_L1_error) - /* "constraint/constraints.py":1028 + /* "constraint/constraints.py":1030 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -26512,7 +26524,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini return __pyx_r; } -/* "constraint/constraints.py":1042 +/* "constraint/constraints.py":1044 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -26563,53 +26575,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, 1042, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1044, __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, 1042, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1044, __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, 1042, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1044, __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, 1042, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1044, __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, 1042, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1044, __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, 1042, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1044, __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, 1042, __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, 1044, __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, 1042, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1044, __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, 1042, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1044, __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, 1042, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1044, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1042, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1044, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1042, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1044, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1042, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1044, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -26623,7 +26635,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, 1042, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1044, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26634,8 +26646,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, 1042, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1042, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1044, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1044, __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 */ @@ -26680,19 +26692,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1043 + /* "constraint/constraints.py":1045 * * 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, 1043, __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, 1045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1044 + /* "constraint/constraints.py":1046 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * set = self._set * missing = 0 # <<<<<<<<<<<<<< @@ -26702,7 +26714,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":1045 + /* "constraint/constraints.py":1047 * set = self._set * missing = 0 * found = 0 # <<<<<<<<<<<<<< @@ -26712,7 +26724,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":1046 + /* "constraint/constraints.py":1048 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -26724,9 +26736,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, 1046, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __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, 1046, __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, 1048, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -26734,7 +26746,7 @@ 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, 1046, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1048, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -26744,7 +26756,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { 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, 1046, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1048, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -26755,13 +26767,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1046, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1048, __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, 1046, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1048, __pyx_L1_error) PyErr_Clear(); } break; @@ -26771,36 +26783,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":1047 + /* "constraint/constraints.py":1049 * 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, 1047, __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, 1049, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1048 + /* "constraint/constraints.py":1050 * 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, 1048, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1050, __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, 1048, __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, 1050, __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, 1048, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1050, __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, 1048, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_found, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1050, __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":1047 + /* "constraint/constraints.py":1049 * found = 0 * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -26810,7 +26822,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L5; } - /* "constraint/constraints.py":1050 + /* "constraint/constraints.py":1052 * found += assignments[variable] in set * else: * missing += 1 # <<<<<<<<<<<<<< @@ -26818,14 +26830,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, 1050, __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, 1052, __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":1046 + /* "constraint/constraints.py":1048 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -26835,53 +26847,53 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1051 + /* "constraint/constraints.py":1053 * 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, 1051, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_missing); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1053, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1052 + /* "constraint/constraints.py":1054 * 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, 1052, __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, 1054, __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, 1052, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1054, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1053 + /* "constraint/constraints.py":1055 * 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, 1053, __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, 1055, __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, 1053, __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, 1055, __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, 1053, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1055, __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, 1053, __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, 1055, __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, 1053, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1055, __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":1054 + /* "constraint/constraints.py":1056 * if self._exact: * if not (found <= self._n <= missing + found): * return False # <<<<<<<<<<<<<< @@ -26893,7 +26905,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1053 + /* "constraint/constraints.py":1055 * if missing: * if self._exact: * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< @@ -26902,7 +26914,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1052 + /* "constraint/constraints.py":1054 * missing += 1 * if missing: * if self._exact: # <<<<<<<<<<<<<< @@ -26912,7 +26924,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L8; } - /* "constraint/constraints.py":1056 + /* "constraint/constraints.py":1058 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -26920,18 +26932,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, 1056, __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, 1058, __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, 1056, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1058, __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, 1056, __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, 1058, __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, 1056, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1058, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":1057 + /* "constraint/constraints.py":1059 * else: * if self._n > missing + found: * return False # <<<<<<<<<<<<<< @@ -26943,7 +26955,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1056 + /* "constraint/constraints.py":1058 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -26954,33 +26966,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __pyx_L8:; - /* "constraint/constraints.py":1058 + /* "constraint/constraints.py":1060 * 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, 1058, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1060, __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, 1058, __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, 1060, __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, 1058, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1060, __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, 1058, __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, 1060, __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, 1058, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1060, __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":1061 + /* "constraint/constraints.py":1063 * # All unassigned variables must be assigned to * # values in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -26992,9 +27004,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, 1061, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1063, __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, 1061, __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, 1063, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -27002,7 +27014,7 @@ 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, 1061, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1063, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -27012,7 +27024,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { 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, 1061, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1063, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -27023,13 +27035,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1061, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1063, __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, 1061, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1063, __pyx_L1_error) PyErr_Clear(); } break; @@ -27039,45 +27051,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":1062 + /* "constraint/constraints.py":1064 * # 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, 1062, __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, 1064, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1063 + /* "constraint/constraints.py":1065 * 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, 1063, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1064 + /* "constraint/constraints.py":1066 * 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, 1064, __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, 1066, __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, 1064, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1066, __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, 1064, __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, 1066, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -27086,7 +27098,7 @@ 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, 1064, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -27096,7 +27108,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { 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, 1064, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -27107,13 +27119,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1064, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __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, 1064, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1066, __pyx_L1_error) PyErr_Clear(); } break; @@ -27123,17 +27135,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":1065 + /* "constraint/constraints.py":1067 * 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, 1065, __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, 1067, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1066 + /* "constraint/constraints.py":1068 * for value in domain[:]: * if value not in set: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -27147,12 +27159,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca 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_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1065 + /* "constraint/constraints.py":1067 * domain = domains[variable] * for value in domain[:]: * if value not in set: # <<<<<<<<<<<<<< @@ -27161,7 +27173,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1064 + /* "constraint/constraints.py":1066 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -27171,18 +27183,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1067 + /* "constraint/constraints.py":1069 * 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, 1067, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1069, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_7); if (__pyx_t_5) { - /* "constraint/constraints.py":1068 + /* "constraint/constraints.py":1070 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -27195,7 +27207,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":1067 + /* "constraint/constraints.py":1069 * if value not in set: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -27204,7 +27216,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1062 + /* "constraint/constraints.py":1064 * # values in the set. * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -27213,7 +27225,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1061 + /* "constraint/constraints.py":1063 * # All unassigned variables must be assigned to * # values in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -27223,7 +27235,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1058 + /* "constraint/constraints.py":1060 * if self._n > missing + found: * return False * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< @@ -27232,7 +27244,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1051 + /* "constraint/constraints.py":1053 * else: * missing += 1 * if missing: # <<<<<<<<<<<<<< @@ -27242,7 +27254,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L7; } - /* "constraint/constraints.py":1070 + /* "constraint/constraints.py":1072 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -27250,28 +27262,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, 1070, __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, 1072, __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, 1070, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1072, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1071 + /* "constraint/constraints.py":1073 * 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, 1071, __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, 1073, __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, 1071, __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, 1073, __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, 1071, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1072 + /* "constraint/constraints.py":1074 * if self._exact: * if found != self._n: * return False # <<<<<<<<<<<<<< @@ -27283,7 +27295,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1071 + /* "constraint/constraints.py":1073 * else: * if self._exact: * if found != self._n: # <<<<<<<<<<<<<< @@ -27292,7 +27304,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1070 + /* "constraint/constraints.py":1072 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -27302,7 +27314,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L23; } - /* "constraint/constraints.py":1074 + /* "constraint/constraints.py":1076 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -27310,15 +27322,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, 1074, __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, 1076, __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, 1074, __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, 1076, __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, 1074, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1076, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1075 + /* "constraint/constraints.py":1077 * else: * if found < self._n: * return False # <<<<<<<<<<<<<< @@ -27330,7 +27342,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1074 + /* "constraint/constraints.py":1076 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -27343,7 +27355,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __pyx_L7:; - /* "constraint/constraints.py":1076 + /* "constraint/constraints.py":1078 * if found < self._n: * return False * return True # <<<<<<<<<<<<<< @@ -27355,7 +27367,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1042 + /* "constraint/constraints.py":1044 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -27383,7 +27395,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca return __pyx_r; } -/* "constraint/constraints.py":1090 +/* "constraint/constraints.py":1092 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -27434,50 +27446,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, 1090, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1092, __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, 1090, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1092, __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, 1090, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1092, __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, 1090, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1092, __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, 1090, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1092, __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, 1090, __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, 1092, __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, 1090, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, i); __PYX_ERR(0, 1092, __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, 1090, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1092, __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, 1090, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1092, __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, 1090, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1092, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1090, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1092, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -27491,7 +27503,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, 1090, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1092, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27520,34 +27532,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1100 + /* "constraint/constraints.py":1102 * 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, 1100, __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, 1102, __pyx_L1_error) - /* "constraint/constraints.py":1101 + /* "constraint/constraints.py":1103 * """ * 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, 1101, __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, 1103, __pyx_L1_error) - /* "constraint/constraints.py":1102 + /* "constraint/constraints.py":1104 * 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, 1102, __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, 1104, __pyx_L1_error) - /* "constraint/constraints.py":1090 + /* "constraint/constraints.py":1092 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -27567,7 +27579,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ return __pyx_r; } -/* "constraint/constraints.py":1104 +/* "constraint/constraints.py":1106 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -27618,53 +27630,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, 1104, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1106, __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, 1104, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1106, __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, 1104, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1106, __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, 1104, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1106, __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, 1104, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1106, __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, 1104, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1106, __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, 1104, __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, 1106, __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, 1104, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1106, __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, 1104, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1106, __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, 1104, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1106, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1104, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1106, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1104, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1106, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1104, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1106, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -27678,7 +27690,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, 1104, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1106, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27689,8 +27701,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, 1104, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1104, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1106, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1106, __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 */ @@ -27735,19 +27747,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1105 + /* "constraint/constraints.py":1107 * * 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, 1105, __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, 1107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1106 + /* "constraint/constraints.py":1108 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * set = self._set * missing = 0 # <<<<<<<<<<<<<< @@ -27757,7 +27769,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":1107 + /* "constraint/constraints.py":1109 * set = self._set * missing = 0 * found = 0 # <<<<<<<<<<<<<< @@ -27767,7 +27779,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":1108 + /* "constraint/constraints.py":1110 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -27779,9 +27791,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, 1108, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1110, __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, 1108, __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, 1110, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -27789,7 +27801,7 @@ 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, 1108, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1110, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -27799,7 +27811,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_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, 1108, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1110, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -27810,13 +27822,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1108, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1110, __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, 1108, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1110, __pyx_L1_error) PyErr_Clear(); } break; @@ -27826,36 +27838,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":1109 + /* "constraint/constraints.py":1111 * 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, 1109, __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, 1111, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1110 + /* "constraint/constraints.py":1112 * 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, 1110, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1112, __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, 1110, __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, 1112, __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, 1110, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1112, __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, 1110, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_found, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1112, __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":1109 + /* "constraint/constraints.py":1111 * found = 0 * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -27865,7 +27877,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L5; } - /* "constraint/constraints.py":1112 + /* "constraint/constraints.py":1114 * found += assignments[variable] not in set * else: * missing += 1 # <<<<<<<<<<<<<< @@ -27873,14 +27885,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, 1112, __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, 1114, __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":1108 + /* "constraint/constraints.py":1110 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -27890,53 +27902,53 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1113 + /* "constraint/constraints.py":1115 * 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, 1113, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_missing); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1115, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1114 + /* "constraint/constraints.py":1116 * 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, 1114, __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, 1116, __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, 1114, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1115 + /* "constraint/constraints.py":1117 * 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, 1115, __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, 1117, __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, 1115, __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, 1117, __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, 1115, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1117, __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, 1115, __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, 1117, __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, 1115, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1117, __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":1116 + /* "constraint/constraints.py":1118 * if self._exact: * if not (found <= self._n <= missing + found): * return False # <<<<<<<<<<<<<< @@ -27948,7 +27960,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1115 + /* "constraint/constraints.py":1117 * if missing: * if self._exact: * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< @@ -27957,7 +27969,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1114 + /* "constraint/constraints.py":1116 * missing += 1 * if missing: * if self._exact: # <<<<<<<<<<<<<< @@ -27967,7 +27979,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L8; } - /* "constraint/constraints.py":1118 + /* "constraint/constraints.py":1120 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -27975,18 +27987,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, 1118, __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, 1120, __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, 1118, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1120, __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, 1118, __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, 1120, __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, 1118, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":1119 + /* "constraint/constraints.py":1121 * else: * if self._n > missing + found: * return False # <<<<<<<<<<<<<< @@ -27998,7 +28010,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1118 + /* "constraint/constraints.py":1120 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -28009,33 +28021,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __pyx_L8:; - /* "constraint/constraints.py":1120 + /* "constraint/constraints.py":1122 * 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, 1120, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1122, __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, 1120, __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, 1122, __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, 1120, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __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, 1120, __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, 1122, __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, 1120, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1122, __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":1123 + /* "constraint/constraints.py":1125 * # All unassigned variables must be assigned to * # values not in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -28047,9 +28059,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, 1123, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1125, __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, 1123, __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, 1125, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -28057,7 +28069,7 @@ 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, 1123, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1125, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -28067,7 +28079,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ { 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, 1123, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1125, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -28078,13 +28090,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1123, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1125, __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, 1123, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1125, __pyx_L1_error) PyErr_Clear(); } break; @@ -28094,45 +28106,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":1124 + /* "constraint/constraints.py":1126 * # 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, 1124, __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, 1126, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1125 + /* "constraint/constraints.py":1127 * 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, 1125, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1126 + /* "constraint/constraints.py":1128 * 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, 1126, __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, 1128, __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, 1126, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1128, __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, 1126, __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, 1128, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -28141,7 +28153,7 @@ 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, 1126, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1128, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -28151,7 +28163,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ { 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, 1126, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1128, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -28162,13 +28174,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1126, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1128, __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, 1126, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1128, __pyx_L1_error) PyErr_Clear(); } break; @@ -28178,17 +28190,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":1127 + /* "constraint/constraints.py":1129 * 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, 1127, __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, 1129, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1128 + /* "constraint/constraints.py":1130 * for value in domain[:]: * if value in set: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -28202,12 +28214,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ 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_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1128, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1127 + /* "constraint/constraints.py":1129 * domain = domains[variable] * for value in domain[:]: * if value in set: # <<<<<<<<<<<<<< @@ -28216,7 +28228,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1126 + /* "constraint/constraints.py":1128 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -28226,18 +28238,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1129 + /* "constraint/constraints.py":1131 * 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, 1129, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1131, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_7); if (__pyx_t_5) { - /* "constraint/constraints.py":1130 + /* "constraint/constraints.py":1132 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -28250,7 +28262,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1129 + /* "constraint/constraints.py":1131 * if value in set: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -28259,7 +28271,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1124 + /* "constraint/constraints.py":1126 * # values not in the set. * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -28268,7 +28280,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1123 + /* "constraint/constraints.py":1125 * # All unassigned variables must be assigned to * # values not in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -28278,7 +28290,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1120 + /* "constraint/constraints.py":1122 * if self._n > missing + found: * return False * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< @@ -28287,7 +28299,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1113 + /* "constraint/constraints.py":1115 * else: * missing += 1 * if missing: # <<<<<<<<<<<<<< @@ -28297,7 +28309,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L7; } - /* "constraint/constraints.py":1132 + /* "constraint/constraints.py":1134 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -28305,28 +28317,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, 1132, __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, 1134, __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, 1132, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1133 + /* "constraint/constraints.py":1135 * 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, 1133, __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, 1135, __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, 1133, __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, 1135, __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, 1133, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1134 + /* "constraint/constraints.py":1136 * if self._exact: * if found != self._n: * return False # <<<<<<<<<<<<<< @@ -28338,7 +28350,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1133 + /* "constraint/constraints.py":1135 * else: * if self._exact: * if found != self._n: # <<<<<<<<<<<<<< @@ -28347,7 +28359,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1132 + /* "constraint/constraints.py":1134 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -28357,7 +28369,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L23; } - /* "constraint/constraints.py":1136 + /* "constraint/constraints.py":1138 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -28365,15 +28377,15 @@ 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, 1136, __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, 1138, __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, 1136, __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, 1138, __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, 1136, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1137 + /* "constraint/constraints.py":1139 * else: * if found < self._n: * return False # <<<<<<<<<<<<<< @@ -28384,7 +28396,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1136 + /* "constraint/constraints.py":1138 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -28397,7 +28409,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __pyx_L7:; - /* "constraint/constraints.py":1138 + /* "constraint/constraints.py":1140 * if found < self._n: * return False * return True # <<<<<<<<<<<<<< @@ -28407,7 +28419,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1104 + /* "constraint/constraints.py":1106 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -30998,15 +31010,15 @@ 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_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr)) __PYX_ERR(0, 854, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(0, 854, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr)) __PYX_ERR(0, 856, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(0, 856, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_12_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_12_genexpr) < 0) __PYX_ERR(0, 854, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(0, 856, __pyx_L1_error) #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_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -32453,499 +32465,499 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":828 + /* "constraint/constraints.py":830 * * * class MaxProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product up to at most a given amount. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 830, __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, 828, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 830, __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, 828, __pyx_L1_error) + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 830, __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, 828, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __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_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 828, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __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_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 830, __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, 828, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 830, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":839 + /* "constraint/constraints.py":841 * """ * * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MaxProdConstraint. * */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 839, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_maxprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 839, __pyx_L1_error) - __pyx_t_2 = __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[39])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 839, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_maxprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 841, __pyx_L1_error) + __pyx_t_2 = __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[39])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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_2) < 0) __PYX_ERR(0, 839, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(0, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":847 + /* "constraint/constraints.py":849 * self._maxprod = maxprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 847, __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, 847, __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, 847, __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, 847, __pyx_L1_error) - __pyx_t_4 = __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[40])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 847, __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, 849, __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, 849, __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, 849, __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, 849, __pyx_L1_error) + __pyx_t_4 = __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[40])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 849, __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_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 847, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":875 + /* "constraint/constraints.py":877 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * maxprod = self._maxprod * prod = 1 */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __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, 875, __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, 875, __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, 875, __pyx_L1_error) - __pyx_t_2 = __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[41])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __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, 877, __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, 877, __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, 877, __pyx_L1_error) + __pyx_t_2 = __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[41])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[0]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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_2) < 0) __PYX_ERR(0, 875, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_2) < 0) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":828 + /* "constraint/constraints.py":830 * * * class MaxProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product up to at most a given amount. * */ - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 828, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 830, __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, 828, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":903 + /* "constraint/constraints.py":905 * * * class MinProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product up to at least a given amount. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 903, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 905, __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, 903, __pyx_L1_error) + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 905, __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, 903, __pyx_L1_error) + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 905, __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, 903, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 905, __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_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_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __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_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_3 != __pyx_t_6) { - if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 903, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 905, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":914 + /* "constraint/constraints.py":916 * """ * * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MinProdConstraint. * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 916, __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, 914, __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[42])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 914, __pyx_L1_error) + 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, 916, __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[42])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 916, __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_2, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 914, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 916, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":922 + /* "constraint/constraints.py":924 * 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_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 922, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 924, __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, 922, __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, 922, __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, 922, __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, 922, __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[43])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 922, __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, 924, __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, 924, __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, 924, __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, 924, __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[43])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 924, __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_2, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 922, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 924, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":933 + /* "constraint/constraints.py":935 * 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_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 933, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 935, __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, 933, __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, 933, __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, 933, __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[44])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 933, __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, 935, __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, 935, __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, 935, __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[44])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 933, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 935, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":903 + /* "constraint/constraints.py":905 * * * class MinProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product up to at least a given amount. * */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 903, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 905, __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, 903, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 905, __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_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":949 + /* "constraint/constraints.py":951 * * * class InSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are present in the given set. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 949, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 951, __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, 949, __pyx_L1_error) + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 951, __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, 949, __pyx_L1_error) + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 951, __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, 949, __pyx_L1_error) + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __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_4)) __PYX_ERR(0, 949, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __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_4)) __PYX_ERR(0, 951, __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, 949, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 951, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":960 + /* "constraint/constraints.py":962 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_5 = __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[45])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 960, __pyx_L1_error) + __pyx_t_5 = __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[45])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 962, __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, 960, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(0, 962, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":968 + /* "constraint/constraints.py":970 * 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_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[46])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_5 = __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[46])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[0]); - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 968, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 970, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":972 + /* "constraint/constraints.py":974 * 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, 972, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 974, __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, 972, __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, 972, __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, 972, __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, 972, __pyx_L1_error) - __pyx_t_6 = __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[47])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 972, __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, 974, __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, 974, __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, 974, __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, 974, __pyx_L1_error) + __pyx_t_6 = __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[47])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 974, __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, 972, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":949 + /* "constraint/constraints.py":951 * * * class InSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are present in the given set. * */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 949, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 949, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 951, __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_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":983 + /* "constraint/constraints.py":985 * * * class NotInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are not present in the given set. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 983, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 985, __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, 983, __pyx_L1_error) + __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 985, __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, 983, __pyx_L1_error) + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 985, __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, 983, __pyx_L1_error) + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __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_6)) __PYX_ERR(0, 983, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __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_6)) __PYX_ERR(0, 985, __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, 983, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 985, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":994 + /* "constraint/constraints.py":996 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_2 = __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[48])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 994, __pyx_L1_error) + __pyx_t_2 = __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[48])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(0, 994, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1002 + /* "constraint/constraints.py":1004 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * # preProcess() will remove it. * raise RuntimeError("Can't happen") */ - __pyx_t_2 = __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[49])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) + __pyx_t_2 = __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[49])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[0]); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_2) < 0) __PYX_ERR(0, 1002, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_2) < 0) __PYX_ERR(0, 1004, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1006 + /* "constraint/constraints.py":1008 * 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_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1006, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1006, __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, 1006, __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, 1006, __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, 1006, __pyx_L1_error) - __pyx_t_5 = __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[50])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1006, __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, 1008, __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, 1008, __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, 1008, __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, 1008, __pyx_L1_error) + __pyx_t_5 = __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[50])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1008, __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_6, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 1006, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 1008, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":983 + /* "constraint/constraints.py":985 * * * class NotInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are not present in the given set. * */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 983, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 983, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 985, __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_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1017 + /* "constraint/constraints.py":1019 * * * 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_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1017, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1019, __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, 1017, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1019, __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, 1017, __pyx_L1_error) + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1019, __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, 1017, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __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_5)) __PYX_ERR(0, 1017, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __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_5)) __PYX_ERR(0, 1019, __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, 1017, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 1019, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1028 + /* "constraint/constraints.py":1030 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_4 = __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[51])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1028, __pyx_L1_error) + __pyx_t_4 = __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[51])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1030, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[3]); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 1028, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 1030, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1042 + /* "constraint/constraints.py":1044 * 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, 1042, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1044, __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, 1042, __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, 1042, __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, 1042, __pyx_L1_error) - __pyx_t_2 = __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[52])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1042, __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, 1044, __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, 1044, __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, 1044, __pyx_L1_error) + __pyx_t_2 = __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[52])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[0]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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_2) < 0) __PYX_ERR(0, 1042, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_2) < 0) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1017 + /* "constraint/constraints.py":1019 * * * class SomeInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that at least some of the values of given variables must be present in a given set. * */ - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1017, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 1017, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 1019, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1079 + /* "constraint/constraints.py":1081 * * * 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_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1079, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1081, __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, 1079, __pyx_L1_error) + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1081, __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, 1079, __pyx_L1_error) + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1081, __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, 1079, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1081, __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_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_2)) __PYX_ERR(0, 1079, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __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_2)) __PYX_ERR(0, 1081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_3 != __pyx_t_6) { - if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 1079, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 1081, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1090 + /* "constraint/constraints.py":1092 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_6 = __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[53])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1090, __pyx_L1_error) + __pyx_t_6 = __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[53])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1092, __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_init, __pyx_t_6) < 0) __PYX_ERR(0, 1090, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 1092, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1104 + /* "constraint/constraints.py":1106 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * missing = 0 */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1104, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1106, __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, 1104, __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, 1104, __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, 1104, __pyx_L1_error) - __pyx_t_4 = __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[54])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1104, __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, 1106, __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, 1106, __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, 1106, __pyx_L1_error) + __pyx_t_4 = __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[54])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 1104, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 1106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1079 + /* "constraint/constraints.py":1081 * * * 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_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1079, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 1079, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 1081, __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_5); __pyx_t_5 = 0; @@ -33257,7 +33269,7 @@ static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_max); if (!__pyx_builtin_max) __PYX_ERR(0, 404, __pyx_L1_error) __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 409, __pyx_L1_error) __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_min); if (!__pyx_builtin_min) __PYX_ERR(0, 414, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 970, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 972, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -33313,14 +33325,14 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); - /* "constraint/constraints.py":1028 + /* "constraint/constraints.py":1030 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * */ - __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, 1028, __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, 1030, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_RefNannyFinishContext(); @@ -33418,7 +33430,7 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { __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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 854, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 856, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_value}; __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_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; } @@ -33563,87 +33575,87 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { __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_preProcess, __pyx_k_77JJeef_QfKy_Q_6a_A_L_gQ_waq_J, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[37])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 800, 228}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 800, 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[38] = __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_4q_QfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[38])) goto bad; + __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_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[38])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 839, 14}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 841, 14}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_maxprod}; __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_init, __pyx_k_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 847, 216}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 849, 216}; 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[40] = __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[40])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 875, 220}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 877, 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[41] = __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_4q_QfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) 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_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[41])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 914, 14}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 916, 14}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_minprod}; __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_init, __pyx_k_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 922, 92}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 924, 92}; 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[43] = __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[43])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 933, 95}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 935, 95}; 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[44] = __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[44])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 960, 11}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 962, 11}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set}; __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_init, __pyx_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 968, 14}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 970, 14}; 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[46] = __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[46])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 972, 91}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 974, 91}; 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[47] = __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[47])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 994, 11}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 996, 11}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set}; __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_init, __pyx_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1002, 14}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1004, 14}; 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[49] = __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[49])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1006, 91}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1008, 91}; 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[50] = __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[50])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1028, 30}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1030, 30}; 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[51] = __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[51])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1042, 249}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1044, 249}; 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[52] = __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[52])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1090, 30}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1092, 30}; 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[53] = __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[53])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1104, 249}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1106, 249}; 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[54] = __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[54])) goto bad; } diff --git a/constraint/constraints.py b/constraint/constraints.py index 3b104df..0302da3 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -825,6 +825,8 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar return True + + class MaxProdConstraint(Constraint): """Constraint enforcing that values of given variables create a product up to at most a given amount. @@ -886,7 +888,7 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar 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): + if (not missing or len(missing_lt1) == 0) and prod > maxprod: return False if forwardcheck: for variable in variables: diff --git a/constraint/parser.c b/constraint/parser.c index 03e0f45..0b4333b 100644 --- a/constraint/parser.c +++ b/constraint/parser.c @@ -1504,9 +1504,11 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr; 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_to_equality_constraint; +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr; -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_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":27 * ) @@ -1528,7 +1530,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions { * * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: + * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, MaxProdConstraint]]: # noqa: E501 */ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint { PyObject_HEAD @@ -1542,14 +1544,36 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint }; -/* "constraint/parser.py":87 +/* "constraint/parser.py":80 + * """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 + * +*/ +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_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_genexpr; + PyObject *__pyx_v_p; +}; + +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr { + PyObject_HEAD + PyObject *__pyx_genexpr_arg_0; + PyObject *__pyx_v_v; +}; + + +/* "constraint/parser.py":91 * * # split the string on the comparison and remove leading and trailing whitespace * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< * * # if we have an inverse operation, rewrite to the other side */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr { +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_genexpr_arg_1; @@ -1559,14 +1583,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr { }; -/* "constraint/parser.py":91 +/* "constraint/parser.py":95 * # if we have an inverse operation, rewrite to the other side * supported_operators = ["**", "*", "+", "-", "/"] * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) # <<<<<<<<<<<<<< * unique_operators_right = set(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" */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr { +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr { PyObject_HEAD struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; @@ -1574,14 +1598,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr { }; -/* "constraint/parser.py":92 +/* "constraint/parser.py":96 * supported_operators = ["**", "*", "+", "-", "/"] * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) * unique_operators_right = set(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" * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr { +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; @@ -1589,14 +1613,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr { }; -/* "constraint/parser.py":130 +/* "constraint/parser.py":134 * * # we have a potentially rewritten restriction, split again * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< * * # find out which side is the constant number */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr { +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_genexpr_arg_1; @@ -1606,14 +1630,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr { }; -/* "constraint/parser.py":151 +/* "constraint/parser.py":155 * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] * # find all unique variable_supported_operators in the restriction, can have at most one * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) # <<<<<<<<<<<<<< * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_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; @@ -1621,14 +1645,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr { }; -/* "constraint/parser.py":153 +/* "constraint/parser.py":157 * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 # <<<<<<<<<<<<<< * variables_on_left = len(right) == 1 * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_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; @@ -1636,14 +1660,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr { }; -/* "constraint/parser.py":211 +/* "constraint/parser.py":215 * # 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_8_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; @@ -1651,14 +1675,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr { }; -/* "constraint/parser.py":218 +/* "constraint/parser.py":222 * 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_9_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; @@ -1666,43 +1690,43 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr { }; -/* "constraint/parser.py":241 +/* "constraint/parser.py":245 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_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":260 +/* "constraint/parser.py":264 * 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_11_genexpr { +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr { PyObject_HEAD - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_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":270 +/* "constraint/parser.py":274 * * # 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] */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr { +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_r; @@ -2268,6 +2292,17 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /* pep479.proto */ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); +/* DictGetItem.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); +#define __Pyx_PyObject_Dict_GetItem(obj, name)\ + (likely(PyDict_CheckExact(obj)) ?\ + __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) +#else +#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) +#endif + /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); @@ -2770,13 +2805,15 @@ static PyObject *__pyx_builtin_compile; static const char __pyx_k_[] = "']]"; static const char __pyx_k_1[] = "\2401"; static const char __pyx_k_A[] = "\250A"; -static const char __pyx_k_Q[] = "\220Q"; +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[] = ">"; @@ -2790,6 +2827,7 @@ static const char __pyx_k_or[] = " or "; static const char __pyx_k_re[] = "re"; static const char __pyx_k_1_2[] = "\2501"; static const char __pyx_k_A_2[] = "\270A"; +static const char __pyx_k_Q_2[] = "\220Q"; static const char __pyx_k__10[] = "+"; static const char __pyx_k__11[] = "-"; static const char __pyx_k__12[] = "/"; @@ -2953,14 +2991,14 @@ static const char __pyx_k_restrictions_unique_indices[] = "restrictions_unique_i static const char __pyx_k_swapped_side_first_variable[] = "swapped_side_first_variable"; static const char __pyx_k_CompilableFunctionConstraint[] = "CompilableFunctionConstraint"; 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#\2408\2501\330\010$\240H\250A\340\010\013\2103\210a\320\017&\240b\250\002\250$\250c\260\021\3202J\310\"\310A\340\014\023\2201\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*\250\"\250G\2601\3204J\310(\320Ri\320ij\330\014\017\320\017+\2503\250a\340\020\027\220q\340\020.\320.I\310\026\310q\320PQ\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(E\300\\\320QX\320XY\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(E\300\\\320QX\320XY\360\006\000\r\023\220(\230%\230x\240q\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\250A\330\014\030\230\001\230\021\230&\240\003\2404\240u\250D\260\001\260\025\260b\270\007\270s\300\"\300G\3101\340\014\"\240(\250!\340\014\017\210s\220!\320\023%\240S\250\002\320*<\320R\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_Ya_1_Q2_U_P_U_6_Q_q_t4uA_d_4y_a[] = "\320\000%\320%=\270Y\300a\360\006\000\005\034\2301\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\360P\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_A_avV6_a_Bhas_q_a_3a_Q_1_aq_he81[] = "\200A\330\025\"\240!\330\t\n\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#\2408\2501\330\010$\240H\250A\340\010\013\2103\210a\320\017&\240b\250\002\250$\250c\260\021\3202J\310\"\310A\340\014\023\2201\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*\250\"\250G\2601\3204J\310(\320Ri\320ij\330\014\017\320\017+\2503\250a\340\020\027\220q\340\020.\320.I\310\026\310q\320PQ\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(E\300\\\320QX\320XY\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(E\300\\\320QX\320XY\360\006\000\r\023\220(\230%\230x\240q\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\250A\330\014\030\230\001\230\021\230&\240\003\2404\240u\250D\260\001\260\025\260b\270\007\270s\300\"\300G\3101\340\014\"\240(\250!\340\014\017\210s\220!\320\023%\240S\250\002\320*<\320.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"; +static const char __pyx_k_parse_restrictions_locals_to_num[] = "parse_restrictions..to_numeric_constraint..genexpr..genexpr"; 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..is_or_evals_to_number"; -static const char __pyx_k_parse_restrictions_locals_to_num_3[] = "parse_restrictions..to_numeric_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_2genexpr(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_5genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* 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(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11genexpr(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_14genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* 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(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_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_26genexpr(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 */ @@ -3004,9 +3045,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr( static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ 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_to_equality_constraint(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_genexpr(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_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 */ @@ -3055,9 +3098,11 @@ typedef struct { PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr; 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_to_equality_constraint; + PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr; PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr; - PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_12_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; @@ -3068,16 +3113,18 @@ typedef struct { PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr; 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_to_equality_constraint; + PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr; PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr; - PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_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_pop; __Pyx_CachedCFunction __pyx_umethod_PyList_Type__index; __Pyx_CachedCFunction __pyx_umethod_PySet_Type__union; PyObject *__pyx_slice[4]; PyObject *__pyx_tuple[4]; - PyObject *__pyx_codeobj_tab[18]; - PyObject *__pyx_string_tab[191]; + PyObject *__pyx_codeobj_tab[20]; + PyObject *__pyx_string_tab[194]; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_neg_1; @@ -3144,8 +3191,8 @@ int __pyx_freecount_10constraint_6parser___pyx_scope_struct_9_genexpr; #endif #if CYTHON_USE_FREELISTS -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint *__pyx_freelist_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint[8]; -int __pyx_freecount_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint; +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_10_genexpr[8]; +int __pyx_freecount_10constraint_6parser___pyx_scope_struct_10_genexpr; #endif #if CYTHON_USE_FREELISTS @@ -3154,8 +3201,18 @@ 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; @@ -3305,77 +3362,80 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_operators __pyx_string_tab[117] #define __pyx_n_u_operators_found __pyx_string_tab[118] #define __pyx_kp_u_or __pyx_string_tab[119] -#define __pyx_n_u_param __pyx_string_tab[120] -#define __pyx_n_u_params __pyx_string_tab[121] -#define __pyx_kp_u_params_params_index __pyx_string_tab[122] -#define __pyx_n_u_params_used __pyx_string_tab[123] -#define __pyx_n_u_params_used_list __pyx_string_tab[124] -#define __pyx_n_u_parse_restrictions __pyx_string_tab[125] -#define __pyx_n_u_parse_restrictions_locals_genexp __pyx_string_tab[126] -#define __pyx_n_u_parse_restrictions_locals_replac __pyx_string_tab[127] -#define __pyx_n_u_parse_restrictions_locals_replac_2 __pyx_string_tab[128] -#define __pyx_n_u_parse_restrictions_locals_to_equ __pyx_string_tab[129] -#define __pyx_n_u_parse_restrictions_locals_to_equ_2 __pyx_string_tab[130] -#define __pyx_n_u_parse_restrictions_locals_to_mul __pyx_string_tab[131] -#define __pyx_n_u_parse_restrictions_locals_to_num __pyx_string_tab[132] -#define __pyx_n_u_parse_restrictions_locals_to_num_2 __pyx_string_tab[133] -#define __pyx_n_u_parse_restrictions_locals_to_num_3 __pyx_string_tab[134] -#define __pyx_n_u_parsed_restriction __pyx_string_tab[135] -#define __pyx_n_u_parsed_restrictions __pyx_string_tab[136] -#define __pyx_n_u_picklable __pyx_string_tab[137] -#define __pyx_n_u_pop __pyx_string_tab[138] -#define __pyx_n_u_prev_stop __pyx_string_tab[139] -#define __pyx_n_u_qualname __pyx_string_tab[140] -#define __pyx_n_u_r __pyx_string_tab[141] -#define __pyx_n_u_range __pyx_string_tab[142] -#define __pyx_n_u_re __pyx_string_tab[143] -#define __pyx_n_u_regex_match_variable __pyx_string_tab[144] -#define __pyx_n_u_replace __pyx_string_tab[145] -#define __pyx_n_u_replace_params __pyx_string_tab[146] -#define __pyx_n_u_replace_params_split __pyx_string_tab[147] -#define __pyx_n_u_res __pyx_string_tab[148] -#define __pyx_n_u_restriction __pyx_string_tab[149] -#define __pyx_n_u_restrictions __pyx_string_tab[150] -#define __pyx_n_u_restrictions_cleaned __pyx_string_tab[151] -#define __pyx_n_u_restrictions_cleaned_unique __pyx_string_tab[152] -#define __pyx_n_u_restrictions_unique_indices __pyx_string_tab[153] -#define __pyx_n_u_return __pyx_string_tab[154] -#define __pyx_kp_u_return_2 __pyx_string_tab[155] -#define __pyx_n_u_right __pyx_string_tab[156] -#define __pyx_n_u_right_num __pyx_string_tab[157] -#define __pyx_n_u_right_remainder __pyx_string_tab[158] -#define __pyx_n_u_right_swap __pyx_string_tab[159] -#define __pyx_n_u_s __pyx_string_tab[160] -#define __pyx_n_u_search __pyx_string_tab[161] -#define __pyx_n_u_send __pyx_string_tab[162] -#define __pyx_n_u_spec __pyx_string_tab[163] -#define __pyx_n_u_split __pyx_string_tab[164] -#define __pyx_n_u_split_restrictions __pyx_string_tab[165] -#define __pyx_n_u_splitted __pyx_string_tab[166] -#define __pyx_n_u_start __pyx_string_tab[167] -#define __pyx_n_u_str __pyx_string_tab[168] -#define __pyx_kp_u_string __pyx_string_tab[169] -#define __pyx_n_u_strip __pyx_string_tab[170] -#define __pyx_n_u_sub __pyx_string_tab[171] -#define __pyx_n_u_supported_operators __pyx_string_tab[172] -#define __pyx_n_u_swapped_side_first_variable __pyx_string_tab[173] -#define __pyx_n_u_temp_copy __pyx_string_tab[174] -#define __pyx_n_u_test __pyx_string_tab[175] -#define __pyx_n_u_throw __pyx_string_tab[176] -#define __pyx_n_u_to_equality_constraint __pyx_string_tab[177] -#define __pyx_n_u_to_multiple_restrictions __pyx_string_tab[178] -#define __pyx_n_u_to_numeric_constraint __pyx_string_tab[179] -#define __pyx_n_u_tune_params __pyx_string_tab[180] -#define __pyx_n_u_types __pyx_string_tab[181] -#define __pyx_n_u_typing __pyx_string_tab[182] -#define __pyx_n_u_union __pyx_string_tab[183] -#define __pyx_n_u_unique_operators __pyx_string_tab[184] -#define __pyx_n_u_unique_operators_left __pyx_string_tab[185] -#define __pyx_n_u_unique_operators_right __pyx_string_tab[186] -#define __pyx_n_u_value __pyx_string_tab[187] -#define __pyx_n_u_variable_supported_operators __pyx_string_tab[188] -#define __pyx_n_u_variables __pyx_string_tab[189] -#define __pyx_n_u_variables_on_left __pyx_string_tab[190] +#define __pyx_n_u_p __pyx_string_tab[120] +#define __pyx_n_u_param __pyx_string_tab[121] +#define __pyx_n_u_params __pyx_string_tab[122] +#define __pyx_kp_u_params_params_index __pyx_string_tab[123] +#define __pyx_n_u_params_used __pyx_string_tab[124] +#define __pyx_n_u_params_used_list __pyx_string_tab[125] +#define __pyx_n_u_parse_restrictions __pyx_string_tab[126] +#define __pyx_n_u_parse_restrictions_locals_genexp __pyx_string_tab[127] +#define __pyx_n_u_parse_restrictions_locals_replac __pyx_string_tab[128] +#define __pyx_n_u_parse_restrictions_locals_replac_2 __pyx_string_tab[129] +#define __pyx_n_u_parse_restrictions_locals_to_equ __pyx_string_tab[130] +#define __pyx_n_u_parse_restrictions_locals_to_equ_2 __pyx_string_tab[131] +#define __pyx_n_u_parse_restrictions_locals_to_mul __pyx_string_tab[132] +#define __pyx_n_u_parse_restrictions_locals_to_num __pyx_string_tab[133] +#define __pyx_n_u_parse_restrictions_locals_to_num_2 __pyx_string_tab[134] +#define __pyx_n_u_parse_restrictions_locals_to_num_3 __pyx_string_tab[135] +#define __pyx_n_u_parse_restrictions_locals_to_num_4 __pyx_string_tab[136] +#define __pyx_n_u_parsed_restriction __pyx_string_tab[137] +#define __pyx_n_u_parsed_restrictions __pyx_string_tab[138] +#define __pyx_n_u_picklable __pyx_string_tab[139] +#define __pyx_n_u_pop __pyx_string_tab[140] +#define __pyx_n_u_prev_stop __pyx_string_tab[141] +#define __pyx_n_u_qualname __pyx_string_tab[142] +#define __pyx_n_u_r __pyx_string_tab[143] +#define __pyx_n_u_range __pyx_string_tab[144] +#define __pyx_n_u_re __pyx_string_tab[145] +#define __pyx_n_u_regex_match_variable __pyx_string_tab[146] +#define __pyx_n_u_replace __pyx_string_tab[147] +#define __pyx_n_u_replace_params __pyx_string_tab[148] +#define __pyx_n_u_replace_params_split __pyx_string_tab[149] +#define __pyx_n_u_res __pyx_string_tab[150] +#define __pyx_n_u_restriction __pyx_string_tab[151] +#define __pyx_n_u_restrictions __pyx_string_tab[152] +#define __pyx_n_u_restrictions_cleaned __pyx_string_tab[153] +#define __pyx_n_u_restrictions_cleaned_unique __pyx_string_tab[154] +#define __pyx_n_u_restrictions_unique_indices __pyx_string_tab[155] +#define __pyx_n_u_return __pyx_string_tab[156] +#define __pyx_kp_u_return_2 __pyx_string_tab[157] +#define __pyx_n_u_right __pyx_string_tab[158] +#define __pyx_n_u_right_num __pyx_string_tab[159] +#define __pyx_n_u_right_remainder __pyx_string_tab[160] +#define __pyx_n_u_right_swap __pyx_string_tab[161] +#define __pyx_n_u_s __pyx_string_tab[162] +#define __pyx_n_u_search __pyx_string_tab[163] +#define __pyx_n_u_send __pyx_string_tab[164] +#define __pyx_n_u_spec __pyx_string_tab[165] +#define __pyx_n_u_split __pyx_string_tab[166] +#define __pyx_n_u_split_restrictions __pyx_string_tab[167] +#define __pyx_n_u_splitted __pyx_string_tab[168] +#define __pyx_n_u_start __pyx_string_tab[169] +#define __pyx_n_u_str __pyx_string_tab[170] +#define __pyx_kp_u_string __pyx_string_tab[171] +#define __pyx_n_u_strip __pyx_string_tab[172] +#define __pyx_n_u_sub __pyx_string_tab[173] +#define __pyx_n_u_supported_operators __pyx_string_tab[174] +#define __pyx_n_u_swapped_side_first_variable __pyx_string_tab[175] +#define __pyx_n_u_temp_copy __pyx_string_tab[176] +#define __pyx_n_u_test __pyx_string_tab[177] +#define __pyx_n_u_throw __pyx_string_tab[178] +#define __pyx_n_u_to_equality_constraint __pyx_string_tab[179] +#define __pyx_n_u_to_multiple_restrictions __pyx_string_tab[180] +#define __pyx_n_u_to_numeric_constraint __pyx_string_tab[181] +#define __pyx_n_u_tune_params __pyx_string_tab[182] +#define __pyx_n_u_types __pyx_string_tab[183] +#define __pyx_n_u_typing __pyx_string_tab[184] +#define __pyx_n_u_union __pyx_string_tab[185] +#define __pyx_n_u_unique_operators __pyx_string_tab[186] +#define __pyx_n_u_unique_operators_left __pyx_string_tab[187] +#define __pyx_n_u_unique_operators_right __pyx_string_tab[188] +#define __pyx_n_u_v __pyx_string_tab[189] +#define __pyx_n_u_value __pyx_string_tab[190] +#define __pyx_n_u_variable_supported_operators __pyx_string_tab[191] +#define __pyx_n_u_variables __pyx_string_tab[192] +#define __pyx_n_u_variables_on_left __pyx_string_tab[193] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3416,16 +3476,20 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr); 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_to_equality_constraint); - Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint); + 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_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_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_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<18; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<191; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<20; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<194; ++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); @@ -3469,16 +3533,20 @@ 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_8_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr); 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_to_equality_constraint); - Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint); + 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_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_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_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<18; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<191; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<20; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<194; ++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); @@ -4707,7 +4775,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: + * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, MaxProdConstraint]]: # noqa: E501 */ /* Python wrapper */ @@ -4815,7 +4883,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "constraint/parser.py":133 +/* "constraint/parser.py":137 * * # find out which side is the constant number * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< @@ -4862,32 +4930,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { 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, 133, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 137, __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, 133, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 137, __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, 133, __pyx_L3_error) + 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, 137, __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, 133, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("is_or_evals_to_number", 1, 1, 1, i); __PYX_ERR(0, 137, __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, 133, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 137, __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, 133, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("is_or_evals_to_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 137, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4898,7 +4966,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __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, 133, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_s), (&PyUnicode_Type), 0, "s", 2))) __PYX_ERR(0, 137, __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 */ @@ -4939,7 +5007,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_or_evals_to_number", 0); - /* "constraint/parser.py":134 + /* "constraint/parser.py":138 * # find out which side is the constant number * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: * try: # <<<<<<<<<<<<<< @@ -4955,7 +5023,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "constraint/parser.py":136 + /* "constraint/parser.py":140 * try: * # check if it's a number or solvable to a number (e.g. '32*2') * number = eval(s) # <<<<<<<<<<<<<< @@ -4965,15 +5033,15 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __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, 136, __pyx_L3_error) + __pyx_t_7 = __Pyx_Globals(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 140, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 136, __pyx_L3_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 140, __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, 136, __pyx_L3_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_number, __pyx_v_number) < 0) __PYX_ERR(0, 140, __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, 136, __pyx_L3_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_s, __pyx_v_s) < 0) __PYX_ERR(0, 140, __pyx_L3_error) } __pyx_t_9 = 1; { @@ -4983,13 +5051,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __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, 136, __pyx_L3_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_number = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/parser.py":137 + /* "constraint/parser.py":141 * # check if it's a number or solvable to a number (e.g. '32*2') * number = eval(s) * assert isinstance(number, (int, float)) # <<<<<<<<<<<<<< @@ -5009,14 +5077,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_L9_bool_binop_done:; if (unlikely(!__pyx_t_10)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 137, __pyx_L3_error) + __PYX_ERR(0, 141, __pyx_L3_error) } } #else - if ((1)); else __PYX_ERR(0, 137, __pyx_L3_error) + if ((1)); else __PYX_ERR(0, 141, __pyx_L3_error) #endif - /* "constraint/parser.py":138 + /* "constraint/parser.py":142 * number = eval(s) * assert isinstance(number, (int, float)) * return number # <<<<<<<<<<<<<< @@ -5028,7 +5096,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_r = __pyx_v_number; goto __pyx_L7_try_return; - /* "constraint/parser.py":134 + /* "constraint/parser.py":138 * # find out which side is the constant number * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: * try: # <<<<<<<<<<<<<< @@ -5043,7 +5111,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/parser.py":139 + /* "constraint/parser.py":143 * assert isinstance(number, (int, float)) * return number * except Exception: # <<<<<<<<<<<<<< @@ -5054,7 +5122,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric if (__pyx_t_12) { __Pyx_ErrRestore(0,0,0); - /* "constraint/parser.py":141 + /* "constraint/parser.py":145 * except Exception: * # it's not a solvable subexpression, return None * return None # <<<<<<<<<<<<<< @@ -5067,7 +5135,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric } goto __pyx_L5_except_error; - /* "constraint/parser.py":134 + /* "constraint/parser.py":138 * # find out which side is the constant number * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: * try: # <<<<<<<<<<<<<< @@ -5094,7 +5162,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric goto __pyx_L0; } - /* "constraint/parser.py":133 + /* "constraint/parser.py":137 * * # find out which side is the constant number * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< @@ -5118,39 +5186,37 @@ 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); /* 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":87 - * - * # split the string on the comparison and remove leading and trailing whitespace - * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< +/* "constraint/parser.py":80 + * """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 * - * # if we have an inverse operation, rewrite to the other side */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_2genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0, PyObject *__pyx_genexpr_arg_1) { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *__pyx_cur_scope; +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_2_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __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_2_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 87, __pyx_L1_error) + __PYX_ERR(0, 80, __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_cur_scope->__pyx_genexpr_arg_1 = __pyx_genexpr_arg_1; - __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_4generator, ((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, 87, __pyx_L1_error) + __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, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5158,7 +5224,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric /* function exit code */ __pyx_L1_error:; - __Pyx_AddTraceback("constraint.parser.parse_restrictions.to_numeric_constraint.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.parser.parse_restrictions.to_numeric_constraint.genexpr.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); @@ -5166,15 +5232,16 @@ 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_7genexpr_2generator1(__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); + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; - size_t __pyx_t_5; + int __pyx_t_5; + int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -5182,76 +5249,97 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; - case 1: goto __pyx_L6_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, 87, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 80, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 80, __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, 80, __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, 80, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 87, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 87, __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, 87, __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, 87, __pyx_L1_error) - #endif - if (__pyx_t_3 >= __pyx_temp) break; + 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, 80, __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, 80, __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, 80, __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, 80, __pyx_L1_error) + PyErr_Clear(); + } + break; + } } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); - ++__pyx_t_3; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __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; - __pyx_t_4 = __pyx_cur_scope->__pyx_v_s; - __Pyx_INCREF(__pyx_t_4); - __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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __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; + __pyx_t_6 = PyLong_Check(__pyx_cur_scope->__pyx_v_v); + if (!__pyx_t_6) { + } else { + __pyx_t_5 = __pyx_t_6; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_6 = PyFloat_Check(__pyx_cur_scope->__pyx_v_v); + __pyx_t_5 = __pyx_t_6; + __pyx_L7_bool_binop_done:; + __pyx_t_6 = (!__pyx_t_5); + if (__pyx_t_6) { + __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_r = __pyx_t_1; - __pyx_t_1 = 0; - __Pyx_XGIVEREF(__pyx_t_2); - __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; - __pyx_cur_scope->__pyx_t_1 = __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_L6_resume_from_yield:; - __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; - __pyx_cur_scope->__pyx_t_0 = 0; - __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 87, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __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 */ - __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_4); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); @@ -5267,29 +5355,21 @@ 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_7generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "constraint/parser.py":91 - * # if we have an inverse operation, rewrite to the other side - * supported_operators = ["**", "*", "+", "-", "/"] - * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) # <<<<<<<<<<<<<< - * unique_operators_right = set(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" -*/ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_5genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *__pyx_cur_scope; +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_2genexpr(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; __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); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_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_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 91, __pyx_L1_error) + __PYX_ERR(0, 80, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5300,7 +5380,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_7generator1, ((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, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 91, __pyx_L1_error) + __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, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5310,22 +5390,23 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_L1_error:; __Pyx_AddTraceback("constraint.parser.parse_restrictions.to_numeric_constraint.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7genexpr_2generator1); __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_7generator1(__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_4generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *)__pyx_generator->closure); + 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; 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; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -5338,58 +5419,65 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 91, __pyx_L1_error) - __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 91, __pyx_L1_error) } - __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __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; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 80, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 80, __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_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, 91, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 80, __pyx_L1_error) #endif - if (__pyx_t_3 >= __pyx_temp) break; + if (__pyx_t_2 >= __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, 91, __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_supported_operators)) { __Pyx_RaiseClosureNameError("supported_operators"); __PYX_ERR(0, 91, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_s, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_supported_operators, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 91, __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, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } - if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + ++__pyx_t_2; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __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_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 80, __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 subscriptable"); + __PYX_ERR(0, 80, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_tune_params, __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7genexpr_genexpr(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = (!__pyx_t_5); + if (__pyx_t_6) { + __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_2); __pyx_t_2 = 0; + __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_r); __pyx_r = 0; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -5404,17 +5492,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_10generator2(__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_7generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":92 - * supported_operators = ["**", "*", "+", "-", "/"] - * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) - * unique_operators_right = set(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" - * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: +/* "constraint/parser.py":91 + * + * # split the string on the comparison and remove leading and trailing whitespace + * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< + * + * # if we have an inverse operation, rewrite to the other side */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { +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) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -5426,18 +5514,18 @@ 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_4_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 92, __pyx_L1_error) + __PYX_ERR(0, 91, __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_cur_scope->__pyx_genexpr_arg_1 = __pyx_genexpr_arg_1; + __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_10generator2, ((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, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 92, __pyx_L1_error) + __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, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5453,16 +5541,15 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator2(__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_7generator2(__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; 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; + PyObject *__pyx_t_4 = NULL; + size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -5470,16 +5557,19 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L6_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 92, __pyx_L1_error) - __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 92, __pyx_L1_error) - __Pyx_GOTREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 92, __pyx_L1_error) } - __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) + 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, 91, __pyx_L1_error) + } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 91, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 91, __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, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -5488,45 +5578,56 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 92, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 91, __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, 92, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __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_supported_operators)) { __Pyx_RaiseClosureNameError("supported_operators"); __PYX_ERR(0, 92, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_s, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_supported_operators, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 92, __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, 92, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } - if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 92, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __pyx_cur_scope->__pyx_v_s; + __Pyx_INCREF(__pyx_t_4); + __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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + __Pyx_XGIVEREF(__pyx_t_2); + __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_1 = __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_L6_resume_from_yield:; + __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; + __pyx_cur_scope->__pyx_t_0 = 0; + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 91, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_r); __pyx_r = 0; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -5541,17 +5642,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_13generator3(__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_10generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":130 - * - * # we have a potentially rewritten restriction, split again - * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< - * - * # find out which side is the constant number +/* "constraint/parser.py":95 + * # if we have an inverse operation, rewrite to the other side + * supported_operators = ["**", "*", "+", "-", "/"] + * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) # <<<<<<<<<<<<<< + * unique_operators_right = set(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" */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11genexpr(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_8genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -5563,18 +5664,18 @@ 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_5_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 130, __pyx_L1_error) + __PYX_ERR(0, 95, __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_cur_scope->__pyx_genexpr_arg_1 = __pyx_genexpr_arg_1; - __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_13generator3, ((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, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 130, __pyx_L1_error) + __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, 95, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5590,15 +5691,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_13generator3(__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_10generator3(__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; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - size_t __pyx_t_5; + 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; @@ -5606,19 +5708,16 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; - case 1: goto __pyx_L6_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, 130, __pyx_L1_error) - } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 130, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 130, __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, 130, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_GOTREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 95, __pyx_L1_error) } + __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); 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; @@ -5627,56 +5726,45 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 130, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 95, __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, 130, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __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; - __pyx_t_4 = __pyx_cur_scope->__pyx_v_s; - __Pyx_INCREF(__pyx_t_4); - __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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_supported_operators)) { __Pyx_RaiseClosureNameError("supported_operators"); __PYX_ERR(0, 95, __pyx_L1_error) } + __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_s, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_supported_operators, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 95, __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, 95, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - __Pyx_XGIVEREF(__pyx_t_2); - __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; - __pyx_cur_scope->__pyx_t_1 = __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_L6_resume_from_yield:; - __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; - __pyx_cur_scope->__pyx_t_0 = 0; - __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 130, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_r); __pyx_r = 0; __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); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -5691,17 +5779,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_16generator4(__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_13generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":151 - * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] - * # find all unique variable_supported_operators in the restriction, can have at most one - * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) # <<<<<<<<<<<<<< - * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None - * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 +/* "constraint/parser.py":96 + * supported_operators = ["**", "*", "+", "-", "/"] + * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) + * unique_operators_right = set(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" + * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: */ -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_11genexpr(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 @@ -5713,7 +5801,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, 151, __pyx_L1_error) + __PYX_ERR(0, 96, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5724,7 +5812,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_16generator4, ((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, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 151, __pyx_L1_error) + __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, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5740,7 +5828,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_16generator4(__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_13generator4(__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; @@ -5762,11 +5850,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 151, __pyx_L1_error) - __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 151, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 151, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PySequence_ListKeepNew(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 96, __pyx_L1_error) } + __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -5775,20 +5863,20 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 151, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 96, __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, 151, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __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, 151, __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, 151, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_supported_operators)) { __Pyx_RaiseClosureNameError("supported_operators"); __PYX_ERR(0, 96, __pyx_L1_error) } + __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_s, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_supported_operators, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 96, __pyx_L1_error) if (__pyx_t_4) { __pyx_t_5 = __pyx_cur_scope->__pyx_v_s; __Pyx_INCREF(__pyx_t_5); @@ -5797,10 +5885,10 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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, 151, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 151, __pyx_L1_error) + if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } } @@ -5828,17 +5916,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_19generator5(__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_16generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":153 - * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) - * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None - * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 # <<<<<<<<<<<<<< - * variables_on_left = len(right) == 1 - * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": +/* "constraint/parser.py":134 + * + * # we have a potentially rewritten restriction, split again + * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< + * + * # find out which side is the constant number */ -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_14genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0, PyObject *__pyx_genexpr_arg_1) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -5850,18 +5938,18 @@ 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_7_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 153, __pyx_L1_error) + __PYX_ERR(0, 134, __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_cur_scope->__pyx_genexpr_arg_1 = __pyx_genexpr_arg_1; + __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_19generator5, ((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, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 153, __pyx_L1_error) + __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, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5877,18 +5965,15 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_19generator5(__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_16generator5(__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; PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - size_t __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; + size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -5896,103 +5981,77 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L6_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 153, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 153, __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, 153, __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, 153, __pyx_L1_error) + 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, 134, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 134, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 134, __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, 134, __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 (;;) { - 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, 153, __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, 153, __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, 153, __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, 153, __pyx_L1_error) - PyErr_Clear(); - } - break; - } + { + 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, 134, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; } - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); + ++__pyx_t_3; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __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_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_5 = __pyx_cur_scope->__pyx_v_s; - __Pyx_INCREF(__pyx_t_5); - __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_4 = __pyx_cur_scope->__pyx_v_s; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = 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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __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, 153, __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, 153, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = (!__pyx_t_7); - if (__pyx_t_8) { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; + 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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + __Pyx_XGIVEREF(__pyx_t_2); + __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_1 = __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_L6_resume_from_yield:; + __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; + __pyx_cur_scope->__pyx_t_0 = 0; + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 134, __pyx_L1_error) } - __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; - } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -6007,17 +6066,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_22generator6(__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_19generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":211 - * # 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 +/* "constraint/parser.py":155 + * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] + * # find all unique variable_supported_operators in the restriction, can have at most one + * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) # <<<<<<<<<<<<<< + * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None + * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_20genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_17genexpr(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 @@ -6029,7 +6088,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, 211, __pyx_L1_error) + __PYX_ERR(0, 155, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6040,7 +6099,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_22generator6, ((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, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 211, __pyx_L1_error) + __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, 155, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6056,16 +6115,155 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_22generator6(__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_19generator6(__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, 155, __pyx_L1_error) + __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 155, __pyx_L1_error) } + __pyx_t_1 = __Pyx_PySequence_ListKeepNew(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __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, 155, __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, 155, __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, 155, __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, 155, __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, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 155, __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_22generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "constraint/parser.py":157 + * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) + * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None + * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 # <<<<<<<<<<<<<< + * variables_on_left = len(right) == 1 + * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": +*/ + +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; + 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, 157, __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_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, 157, __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_22generator7(__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; - int __pyx_t_5; - int __pyx_t_6; + PyObject *__pyx_t_5 = NULL; + size_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -6078,16 +6276,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, 211, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 211, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 157, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 157, __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, 211, __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, 157, __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, 211, __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, 157, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6095,7 +6293,7 @@ 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, 211, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 157, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6105,7 +6303,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 211, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 157, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6116,29 +6314,38 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __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, 211, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 157, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_4); - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_o); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_o, __pyx_t_4); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __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, 211, __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, 211, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 211, __pyx_L1_error) + __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_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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __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, 157, __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, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = (!__pyx_t_5); - if (__pyx_t_6) { + __pyx_t_8 = (!__pyx_t_7); + if (__pyx_t_8) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -6160,6 +6367,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -6174,29 +6382,29 @@ 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_25generator7(__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_25generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":218 - * 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 == "**": +/* "constraint/parser.py":215 + * # 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 */ 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_9_genexpr *__pyx_cur_scope; + 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, 218, __pyx_L1_error) + __PYX_ERR(0, 215, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6207,7 +6415,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_25generator7, ((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, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 218, __pyx_L1_error) + __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, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6223,18 +6431,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_25generator7(__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_25generator8(__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; 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_t_8; + int __pyx_t_5; + int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -6247,16 +6453,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, 218, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 218, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 215, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 215, __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, 218, __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, 215, __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, 218, __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, 215, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6264,7 +6470,7 @@ 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, 218, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 215, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6274,7 +6480,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 218, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 215, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6285,38 +6491,29 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __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, 218, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 215, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_4); - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_4); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_o); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_o, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __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_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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __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, 218, __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, 218, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_operator)) { __Pyx_RaiseClosureNameError("operator"); __PYX_ERR(0, 215, __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, 215, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = (!__pyx_t_7); - if (__pyx_t_8) { + __pyx_t_6 = (!__pyx_t_5); + if (__pyx_t_6) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -6338,7 +6535,6 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -6353,22 +6549,201 @@ 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_28generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":75 - * return split_restrictions - * - * def to_numeric_constraint( # <<<<<<<<<<<<<< - * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: +/* "constraint/parser.py":222 + * 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 == "**": */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_constraint(PyObject *__pyx_self, PyObject *__pyx_v_restriction, PyObject *__pyx_v_params) { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *__pyx_cur_scope; - PyObject *__pyx_v_comparators = NULL; - PyObject *__pyx_v_comparators_found = NULL; - PyObject *__pyx_v_comparator = NULL; - PyObject *__pyx_v_unique_operators_left = NULL; - PyObject *__pyx_v_unique_operators_right = NULL; +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_26genexpr(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_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_11_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 222, __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_28generator9, ((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, 222, __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_28generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + 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; + 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_t_8; + 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, 222, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 222, __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, 222, __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) + } + 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, 222, __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, 222, __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, 222, __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) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __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_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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __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, 222, __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, 222, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = (!__pyx_t_7); + if (__pyx_t_8) { + __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_4); + __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; +} + +/* "constraint/parser.py":75 + * return split_restrictions + * + * def to_numeric_constraint( # <<<<<<<<<<<<<< + * restriction: str, params: list[str] + * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, MaxProdConstraint]]: # noqa: E501 +*/ + +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_constraint(PyObject *__pyx_self, PyObject *__pyx_v_restriction, PyObject *__pyx_v_params) { + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *__pyx_cur_scope; + PyObject *__pyx_v_comparators = NULL; + PyObject *__pyx_v_comparators_found = NULL; + PyObject *__pyx_v_comparator = NULL; + PyObject *__pyx_v_unique_operators_left = NULL; + PyObject *__pyx_v_unique_operators_right = NULL; PyObject *__pyx_v_unique_operators = NULL; PyObject *__pyx_v_variables_on_left = NULL; PyObject *__pyx_v_swapped_side_first_variable = NULL; @@ -6386,28 +6761,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ 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_7generator1 = 0; - PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator2 = 0; - PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_13generator3 = 0; - PyObject *__pyx_8genexpr5__pyx_v_s = NULL; - PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_16generator4 = 0; - PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_19generator5 = 0; - PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_22generator6 = 0; - PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_25generator7 = 0; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7generator2 = 0; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator3 = 0; + 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_8genexpr7__pyx_v_s = NULL; + 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_28generator9 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; 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; - int __pyx_t_7; - int __pyx_t_8; - PyObject *__pyx_t_9[4]; - PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + size_t __pyx_t_9; + PyObject *__pyx_t_10[4]; PyObject *__pyx_t_11 = NULL; - Py_ssize_t __pyx_t_12; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -6428,84 +6805,133 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_params); __Pyx_INCREF(__pyx_v_restriction); - /* "constraint/parser.py":79 - * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: + /* "constraint/parser.py":80 + * """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 + * +*/ + __pyx_t_2 = __pyx_cur_scope->__pyx_v_params; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = (__pyx_t_3 == 0); + if (!__pyx_t_4) { + } else { + __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, 80, __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, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = (!__pyx_t_4); + __pyx_t_1 = __pyx_t_6; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "constraint/parser.py":81 + * # 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 # <<<<<<<<<<<<<< + * + * comparators = ["<=", "==", ">=", ">", "<"] +*/ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "constraint/parser.py":80 * """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 + * +*/ + } + + /* "constraint/parser.py":83 + * return None + * * comparators = ["<=", "==", ">=", ">", "<"] # <<<<<<<<<<<<<< * comparators_found = re.findall("|".join(comparators), restriction) * # check if there is exactly one comparator, if not, return None */ - __pyx_t_1 = PyList_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyList_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __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_1, 0, __pyx_mstate_global->__pyx_kp_u__2) != (0)) __PYX_ERR(0, 79, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_mstate_global->__pyx_kp_u__2) != (0)) __PYX_ERR(0, 83, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__7); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_kp_u__7) != (0)) __PYX_ERR(0, 79, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_mstate_global->__pyx_kp_u__7) != (0)) __PYX_ERR(0, 83, __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_1, 2, __pyx_mstate_global->__pyx_kp_u__3) != (0)) __PYX_ERR(0, 79, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_mstate_global->__pyx_kp_u__3) != (0)) __PYX_ERR(0, 83, __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_1, 3, __pyx_mstate_global->__pyx_kp_u__4) != (0)) __PYX_ERR(0, 79, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 3, __pyx_mstate_global->__pyx_kp_u__4) != (0)) __PYX_ERR(0, 83, __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_1, 4, __pyx_mstate_global->__pyx_kp_u__5) != (0)) __PYX_ERR(0, 79, __pyx_L1_error); - __pyx_v_comparators = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 4, __pyx_mstate_global->__pyx_kp_u__5) != (0)) __PYX_ERR(0, 83, __pyx_L1_error); + __pyx_v_comparators = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; - /* "constraint/parser.py":80 - * """Converts a restriction to a built-in numeric constraint if possible.""" + /* "constraint/parser.py":84 + * * comparators = ["<=", "==", ">=", ">", "<"] * comparators_found = re.findall("|".join(comparators), restriction) # <<<<<<<<<<<<<< * # check if there is exactly one comparator, if not, return None * if len(comparators_found) != 1: */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __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, 80, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_comparators); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = 1; + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_comparators); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + 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_4); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_3, __pyx_v_restriction}; - __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)); + 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_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; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_v_comparators_found = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_comparators_found = __pyx_t_5; + __pyx_t_5 = 0; - /* "constraint/parser.py":82 + /* "constraint/parser.py":86 * comparators_found = re.findall("|".join(comparators), restriction) * # check if there is exactly one comparator, if not, return None * if len(comparators_found) != 1: # <<<<<<<<<<<<<< * return None * comparator = comparators_found[0] */ - __pyx_t_6 = PyObject_Length(__pyx_v_comparators_found); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 82, __pyx_L1_error) - __pyx_t_7 = (__pyx_t_6 != 1); - if (__pyx_t_7) { + __pyx_t_3 = PyObject_Length(__pyx_v_comparators_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_3 != 1); + if (__pyx_t_1) { - /* "constraint/parser.py":83 + /* "constraint/parser.py":87 * # check if there is exactly one comparator, if not, return None * if len(comparators_found) != 1: * return None # <<<<<<<<<<<<<< @@ -6516,7 +6942,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":82 + /* "constraint/parser.py":86 * comparators_found = re.findall("|".join(comparators), restriction) * # check if there is exactly one comparator, if not, return None * if len(comparators_found) != 1: # <<<<<<<<<<<<<< @@ -6525,117 +6951,117 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":84 + /* "constraint/parser.py":88 * if len(comparators_found) != 1: * return None * comparator = comparators_found[0] # <<<<<<<<<<<<<< * * # split the string on the comparison and remove leading and trailing whitespace */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_comparators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_comparator = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_comparators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_comparator = __pyx_t_5; + __pyx_t_5 = 0; - /* "constraint/parser.py":87 + /* "constraint/parser.py":91 * * # split the string on the comparison and remove leading and trailing whitespace * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< * * # if we have an inverse operation, rewrite to the other side */ - __pyx_t_1 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_2genexpr(NULL, __pyx_v_restriction, __pyx_v_comparator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __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, 91, __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, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (1) { - PyObject* sequence = __pyx_t_4; + PyObject* sequence = __pyx_t_8; Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 87, __pyx_L1_error) + __PYX_ERR(0, 91, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_1); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_5); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 91, __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; } - __Pyx_GIVEREF(__pyx_t_1); - __pyx_cur_scope->__pyx_v_left = __pyx_t_1; - __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_t_3); - __pyx_cur_scope->__pyx_v_right = __pyx_t_3; - __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_cur_scope->__pyx_v_left = __pyx_t_5; + __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_7); + __pyx_cur_scope->__pyx_v_right = __pyx_t_7; + __pyx_t_7 = 0; - /* "constraint/parser.py":90 + /* "constraint/parser.py":94 * * # if we have an inverse operation, rewrite to the other side * supported_operators = ["**", "*", "+", "-", "/"] # <<<<<<<<<<<<<< * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) * unique_operators_right = set(s.strip() for s in list(right) if s in supported_operators) */ - __pyx_t_4 = PyList_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyList_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 94, __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_4, 0, __pyx_mstate_global->__pyx_kp_u__8) != (0)) __PYX_ERR(0, 90, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_mstate_global->__pyx_kp_u__8) != (0)) __PYX_ERR(0, 94, __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_4, 1, __pyx_mstate_global->__pyx_kp_u__9) != (0)) __PYX_ERR(0, 90, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_kp_u__9) != (0)) __PYX_ERR(0, 94, __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_4, 2, __pyx_mstate_global->__pyx_kp_u__10) != (0)) __PYX_ERR(0, 90, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_mstate_global->__pyx_kp_u__10) != (0)) __PYX_ERR(0, 94, __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_4, 3, __pyx_mstate_global->__pyx_kp_u__11) != (0)) __PYX_ERR(0, 90, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 3, __pyx_mstate_global->__pyx_kp_u__11) != (0)) __PYX_ERR(0, 94, __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_4, 4, __pyx_mstate_global->__pyx_kp_u__12) != (0)) __PYX_ERR(0, 90, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_cur_scope->__pyx_v_supported_operators = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 4, __pyx_mstate_global->__pyx_kp_u__12) != (0)) __PYX_ERR(0, 94, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_cur_scope->__pyx_v_supported_operators = ((PyObject*)__pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/parser.py":91 + /* "constraint/parser.py":95 * # if we have an inverse operation, rewrite to the other side * supported_operators = ["**", "*", "+", "-", "/"] * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) # <<<<<<<<<<<<<< * unique_operators_right = set(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" */ - __pyx_t_4 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_5genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_left); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_unique_operators_left = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_8 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_left); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 95, __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, 95, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_unique_operators_left = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/parser.py":92 + /* "constraint/parser.py":96 * supported_operators = ["**", "*", "+", "-", "/"] * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) * unique_operators_right = set(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" * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: */ - __pyx_t_3 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_unique_operators_right = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_7 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_right); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_unique_operators_right = ((PyObject*)__pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/parser.py":94 + /* "constraint/parser.py":98 * unique_operators_right = set(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" * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: # <<<<<<<<<<<<<< @@ -6644,26 +7070,26 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ if (unlikely(__pyx_v_unique_operators_left == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 94, __pyx_L1_error) + __PYX_ERR(0, 98, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators_left); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 94, __pyx_L1_error) - __pyx_t_8 = (__pyx_t_6 > 0); - if (__pyx_t_8) { + __pyx_t_3 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators_left); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_6 = (__pyx_t_3 > 0); + if (__pyx_t_6) { } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L5_bool_binop_done; + __pyx_t_1 = __pyx_t_6; + goto __pyx_L8_bool_binop_done; } if (unlikely(__pyx_v_unique_operators_right == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 94, __pyx_L1_error) + __PYX_ERR(0, 98, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators_right); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 94, __pyx_L1_error) - __pyx_t_8 = (__pyx_t_6 > 0); - __pyx_t_7 = __pyx_t_8; - __pyx_L5_bool_binop_done:; - if (__pyx_t_7) { + __pyx_t_3 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators_right); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_6 = (__pyx_t_3 > 0); + __pyx_t_1 = __pyx_t_6; + __pyx_L8_bool_binop_done:; + if (__pyx_t_1) { - /* "constraint/parser.py":96 + /* "constraint/parser.py":100 * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: * # if there are operators on both sides, we can't handle this yet * return None # <<<<<<<<<<<<<< @@ -6674,7 +7100,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":94 + /* "constraint/parser.py":98 * unique_operators_right = set(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" * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: # <<<<<<<<<<<<<< @@ -6683,30 +7109,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":97 + /* "constraint/parser.py":101 * # if there are operators on both sides, we can't handle this yet * return None * unique_operators = unique_operators_left.union(unique_operators_right) # <<<<<<<<<<<<<< * if len(unique_operators) == 1: * variables_on_left = len(unique_operators_left) > 0 */ - __pyx_t_4 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PySet_Type__union, __pyx_v_unique_operators_left, __pyx_v_unique_operators_right); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_v_unique_operators = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 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, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_v_unique_operators = ((PyObject*)__pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/parser.py":98 + /* "constraint/parser.py":102 * return None * 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_variable = re.search(regex_match_variable, left if variables_on_left else right) */ - __pyx_t_6 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 98, __pyx_L1_error) - __pyx_t_7 = (__pyx_t_6 == 1); - if (__pyx_t_7) { + __pyx_t_3 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_3 == 1); + if (__pyx_t_1) { - /* "constraint/parser.py":99 + /* "constraint/parser.py":103 * unique_operators = unique_operators_left.union(unique_operators_right) * if len(unique_operators) == 1: * variables_on_left = len(unique_operators_left) > 0 # <<<<<<<<<<<<<< @@ -6715,71 +7141,71 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ if (unlikely(__pyx_v_unique_operators_left == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 99, __pyx_L1_error) + __PYX_ERR(0, 103, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators_left); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 99, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyBool_FromLong((__pyx_t_6 > 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_v_variables_on_left = __pyx_t_4; - __pyx_t_4 = 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, 103, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong((__pyx_t_3 > 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_v_variables_on_left = __pyx_t_8; + __pyx_t_8 = 0; - /* "constraint/parser.py":100 + /* "constraint/parser.py":104 * if len(unique_operators) == 1: * variables_on_left = len(unique_operators_left) > 0 * swapped_side_first_variable = re.search(regex_match_variable, left if variables_on_left else right) # <<<<<<<<<<<<<< * if swapped_side_first_variable is None: * # if there is no variable on the left side, we can't handle this yet */ - __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_search); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_7 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __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, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_regex_match_variable)) { __Pyx_RaiseClosureNameError("regex_match_variable"); __PYX_ERR(0, 100, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 100, __pyx_L1_error) - if (__pyx_t_7) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_regex_match_variable)) { __Pyx_RaiseClosureNameError("regex_match_variable"); __PYX_ERR(0, 104, __pyx_L1_error) } + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 104, __pyx_L1_error) + if (__pyx_t_1) { __Pyx_INCREF(__pyx_cur_scope->__pyx_v_left); - __pyx_t_1 = __pyx_cur_scope->__pyx_v_left; + __pyx_t_5 = __pyx_cur_scope->__pyx_v_left; } else { __Pyx_INCREF(__pyx_cur_scope->__pyx_v_right); - __pyx_t_1 = __pyx_cur_scope->__pyx_v_right; + __pyx_t_5 = __pyx_cur_scope->__pyx_v_right; } - __pyx_t_5 = 1; + __pyx_t_9 = 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); + __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_3); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); - __pyx_t_5 = 0; + __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_regex_match_variable, __pyx_t_1}; - __pyx_t_4 = __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_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_regex_match_variable, __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_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_4)) __PYX_ERR(0, 100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_v_swapped_side_first_variable = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_swapped_side_first_variable = __pyx_t_8; + __pyx_t_8 = 0; - /* "constraint/parser.py":101 + /* "constraint/parser.py":105 * variables_on_left = len(unique_operators_left) > 0 * swapped_side_first_variable = re.search(regex_match_variable, left if variables_on_left else right) * if swapped_side_first_variable is None: # <<<<<<<<<<<<<< * # if there is no variable on the left side, we can't handle this yet * return None */ - __pyx_t_7 = (__pyx_v_swapped_side_first_variable == Py_None); - if (__pyx_t_7) { + __pyx_t_1 = (__pyx_v_swapped_side_first_variable == Py_None); + if (__pyx_t_1) { - /* "constraint/parser.py":103 + /* "constraint/parser.py":107 * if swapped_side_first_variable is None: * # if there is no variable on the left side, we can't handle this yet * return None # <<<<<<<<<<<<<< @@ -6790,7 +7216,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":101 + /* "constraint/parser.py":105 * variables_on_left = len(unique_operators_left) > 0 * swapped_side_first_variable = re.search(regex_match_variable, left if variables_on_left else right) * if swapped_side_first_variable is None: # <<<<<<<<<<<<<< @@ -6799,7 +7225,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":105 + /* "constraint/parser.py":109 * return None * else: * swapped_side_first_variable = swapped_side_first_variable.group(0) # <<<<<<<<<<<<<< @@ -6809,107 +7235,107 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ /*else*/ { __pyx_t_2 = __pyx_v_swapped_side_first_variable; __Pyx_INCREF(__pyx_t_2); - __pyx_t_5 = 0; + __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_0}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __Pyx_DECREF_SET(__pyx_v_swapped_side_first_variable, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_swapped_side_first_variable, __pyx_t_8); + __pyx_t_8 = 0; } - /* "constraint/parser.py":106 + /* "constraint/parser.py":110 * else: * swapped_side_first_variable = swapped_side_first_variable.group(0) * if "-" in unique_operators: # <<<<<<<<<<<<<< * if not variables_on_left: * # e.g. "G == B-M" becomes "G+M == B" */ - __pyx_t_7 = (__Pyx_PySet_ContainsTF(__pyx_mstate_global->__pyx_kp_u__11, __pyx_v_unique_operators, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 106, __pyx_L1_error) - if (__pyx_t_7) { + __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, 110, __pyx_L1_error) + if (__pyx_t_1) { - /* "constraint/parser.py":107 + /* "constraint/parser.py":111 * swapped_side_first_variable = swapped_side_first_variable.group(0) * 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_variable):] */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 107, __pyx_L1_error) - __pyx_t_8 = (!__pyx_t_7); - if (__pyx_t_8) { + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 111, __pyx_L1_error) + __pyx_t_6 = (!__pyx_t_1); + if (__pyx_t_6) { - /* "constraint/parser.py":109 + /* "constraint/parser.py":113 * if not variables_on_left: * # e.g. "G == B-M" becomes "G+M == B" * right_remainder = right[len(swapped_side_first_variable):] # <<<<<<<<<<<<<< * left_swap = right_remainder.replace("-", "+") * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" */ - __pyx_t_6 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 109, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_right, __pyx_t_6, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_v_right_remainder = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_right, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_v_right_remainder = __pyx_t_8; + __pyx_t_8 = 0; - /* "constraint/parser.py":110 + /* "constraint/parser.py":114 * # e.g. "G == B-M" becomes "G+M == B" * right_remainder = right[len(swapped_side_first_variable):] * left_swap = right_remainder.replace("-", "+") # <<<<<<<<<<<<<< * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" * else: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_left_swap = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/parser.py":111 + /* "constraint/parser.py":115 * right_remainder = right[len(swapped_side_first_variable):] * left_swap = right_remainder.replace("-", "+") * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" # <<<<<<<<<<<<<< * else: * # e.g. "B-M == G" becomes "B == G+M" */ - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9[0] = __pyx_t_2; - __pyx_t_9[1] = __pyx_t_4; - __pyx_t_9[2] = __pyx_t_1; - __pyx_t_9[3] = __pyx_t_3; - __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_9, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3)); - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10[0] = __pyx_t_2; + __pyx_t_10[1] = __pyx_t_8; + __pyx_t_10[2] = __pyx_t_5; + __pyx_t_10[3] = __pyx_t_7; + __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7)); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_restriction, ((PyObject*)__pyx_t_10)); - __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_restriction, ((PyObject*)__pyx_t_11)); + __pyx_t_11 = 0; - /* "constraint/parser.py":107 + /* "constraint/parser.py":111 * swapped_side_first_variable = swapped_side_first_variable.group(0) * 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_variable):] */ - goto __pyx_L10; + goto __pyx_L13; } - /* "constraint/parser.py":114 + /* "constraint/parser.py":118 * else: * # e.g. "B-M == G" becomes "B == G+M" * left_remainder = left[len(swapped_side_first_variable):] # <<<<<<<<<<<<<< @@ -6917,59 +7343,59 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" */ /*else*/ { - __pyx_t_6 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 114, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_left, __pyx_t_6, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_v_left_remainder = __pyx_t_10; - __pyx_t_10 = 0; + __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_left, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_v_left_remainder = __pyx_t_11; + __pyx_t_11 = 0; - /* "constraint/parser.py":115 + /* "constraint/parser.py":119 * # e.g. "B-M == G" becomes "B == G+M" * left_remainder = left[len(swapped_side_first_variable):] * right_swap = left_remainder.replace("-", "+") # <<<<<<<<<<<<<< * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" * if "/" in unique_operators: */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_v_right_swap = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_right_swap = __pyx_t_7; + __pyx_t_7 = 0; - /* "constraint/parser.py":116 + /* "constraint/parser.py":120 * left_remainder = left[len(swapped_side_first_variable):] * right_swap = left_remainder.replace("-", "+") * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" # <<<<<<<<<<<<<< * if "/" in unique_operators: * if not variables_on_left: */ - __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9[0] = __pyx_t_3; - __pyx_t_9[1] = __pyx_t_10; - __pyx_t_9[2] = __pyx_t_1; - __pyx_t_9[3] = __pyx_t_4; - __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_9, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4)); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10[0] = __pyx_t_7; + __pyx_t_10[1] = __pyx_t_11; + __pyx_t_10[2] = __pyx_t_5; + __pyx_t_10[3] = __pyx_t_8; + __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8)); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_restriction, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; } - __pyx_L10:; + __pyx_L13:; - /* "constraint/parser.py":106 + /* "constraint/parser.py":110 * else: * swapped_side_first_variable = swapped_side_first_variable.group(0) * if "-" in unique_operators: # <<<<<<<<<<<<<< @@ -6978,95 +7404,95 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":117 + /* "constraint/parser.py":121 * right_swap = left_remainder.replace("-", "+") * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" * if "/" in unique_operators: # <<<<<<<<<<<<<< * if not variables_on_left: * # e.g. "G == B/M" becomes "G*M == B" */ - __pyx_t_8 = (__Pyx_PySet_ContainsTF(__pyx_mstate_global->__pyx_kp_u__12, __pyx_v_unique_operators, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 117, __pyx_L1_error) - if (__pyx_t_8) { + __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, 121, __pyx_L1_error) + if (__pyx_t_6) { - /* "constraint/parser.py":118 + /* "constraint/parser.py":122 * restriction = f"{swapped_side_first_variable}{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_variable):] */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 118, __pyx_L1_error) - __pyx_t_7 = (!__pyx_t_8); - if (__pyx_t_7) { + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_1 = (!__pyx_t_6); + if (__pyx_t_1) { - /* "constraint/parser.py":120 + /* "constraint/parser.py":124 * if not variables_on_left: * # e.g. "G == B/M" becomes "G*M == B" * right_remainder = right[len(swapped_side_first_variable):] # <<<<<<<<<<<<<< * left_swap = right_remainder.replace("/", "*") * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" */ - __pyx_t_6 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 120, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_right, __pyx_t_6, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_right, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_right_remainder, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":121 + /* "constraint/parser.py":125 * # e.g. "G == B/M" becomes "G*M == B" * right_remainder = right[len(swapped_side_first_variable):] * left_swap = right_remainder.replace("/", "*") # <<<<<<<<<<<<<< * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" * else: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_left_swap, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_left_swap, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/parser.py":122 + /* "constraint/parser.py":126 * right_remainder = right[len(swapped_side_first_variable):] * left_swap = right_remainder.replace("/", "*") * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" # <<<<<<<<<<<<<< * else: * # e.g. "B/M == G" becomes "B == G*M" */ - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9[0] = __pyx_t_4; - __pyx_t_9[1] = __pyx_t_2; - __pyx_t_9[2] = __pyx_t_1; - __pyx_t_9[3] = __pyx_t_10; - __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_9, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10)); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10[0] = __pyx_t_8; + __pyx_t_10[1] = __pyx_t_2; + __pyx_t_10[2] = __pyx_t_5; + __pyx_t_10[3] = __pyx_t_11; + __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11)); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 126, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF_SET(__pyx_v_restriction, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF_SET(__pyx_v_restriction, ((PyObject*)__pyx_t_7)); + __pyx_t_7 = 0; - /* "constraint/parser.py":118 + /* "constraint/parser.py":122 * restriction = f"{swapped_side_first_variable}{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_variable):] */ - goto __pyx_L12; + goto __pyx_L15; } - /* "constraint/parser.py":125 + /* "constraint/parser.py":129 * else: * # e.g. "B/M == G" becomes "B == G*M" * left_remainder = left[len(swapped_side_first_variable):] # <<<<<<<<<<<<<< @@ -7074,59 +7500,59 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" */ /*else*/ { - __pyx_t_6 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 125, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_left, __pyx_t_6, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_left_remainder, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_left, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_left_remainder, __pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/parser.py":126 + /* "constraint/parser.py":130 * # e.g. "B/M == G" becomes "B == G*M" * left_remainder = left[len(swapped_side_first_variable):] * right_swap = left_remainder.replace("/", "*") # <<<<<<<<<<<<<< * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_right_swap, __pyx_t_10); - __pyx_t_10 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_right_swap, __pyx_t_11); + __pyx_t_11 = 0; - /* "constraint/parser.py":127 + /* "constraint/parser.py":131 * left_remainder = left[len(swapped_side_first_variable):] * right_swap = left_remainder.replace("/", "*") * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" # <<<<<<<<<<<<<< * * # we have a potentially rewritten restriction, split again */ - __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9[0] = __pyx_t_10; - __pyx_t_9[1] = __pyx_t_3; - __pyx_t_9[2] = __pyx_t_1; - __pyx_t_9[3] = __pyx_t_2; - __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_9, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2)); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_10[0] = __pyx_t_11; + __pyx_t_10[1] = __pyx_t_7; + __pyx_t_10[2] = __pyx_t_5; + __pyx_t_10[3] = __pyx_t_2; + __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2)); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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; - __Pyx_DECREF_SET(__pyx_v_restriction, ((PyObject*)__pyx_t_4)); - __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_restriction, ((PyObject*)__pyx_t_8)); + __pyx_t_8 = 0; } - __pyx_L12:; + __pyx_L15:; - /* "constraint/parser.py":117 + /* "constraint/parser.py":121 * right_swap = left_remainder.replace("-", "+") * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" * if "/" in unique_operators: # <<<<<<<<<<<<<< @@ -7135,49 +7561,49 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":130 + /* "constraint/parser.py":134 * * # we have a potentially rewritten restriction, split again * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< * * # find out which side is the constant number */ - __pyx_t_4 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11genexpr(NULL, __pyx_v_restriction, __pyx_v_comparator); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_8 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_14genexpr(NULL, __pyx_v_restriction, __pyx_v_comparator); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 134, __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, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (1) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 130, __pyx_L1_error) + __PYX_ERR(0, 134, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_4); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_1); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_8); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_left); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_left, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_left, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_right); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_right, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_right, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; - /* "constraint/parser.py":98 + /* "constraint/parser.py":102 * return None * unique_operators = unique_operators_left.union(unique_operators_right) * if len(unique_operators) == 1: # <<<<<<<<<<<<<< @@ -7186,41 +7612,41 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":133 + /* "constraint/parser.py":137 * * # 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, 133, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __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, 133, __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, 133, __pyx_L1_error) - __pyx_t_1 = __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_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_1, __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, 137, __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, 137, __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[10])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __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_1; - __pyx_t_1 = 0; + __pyx_v_is_or_evals_to_number = __pyx_t_5; + __pyx_t_5 = 0; - /* "constraint/parser.py":144 + /* "constraint/parser.py":148 * * # 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): */ - __pyx_t_1 = __pyx_cur_scope->__pyx_v_left; - __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, 144, __pyx_L1_error) - __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_is_or_evals_to_number(__pyx_v_is_or_evals_to_number, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_5 = __pyx_cur_scope->__pyx_v_left; + __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, 148, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_is_or_evals_to_number(__pyx_v_is_or_evals_to_number, ((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_left_num = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/parser.py":145 + /* "constraint/parser.py":149 * # 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) # <<<<<<<<<<<<<< @@ -7229,60 +7655,60 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __pyx_t_2 = __pyx_cur_scope->__pyx_v_right; __Pyx_INCREF(__pyx_t_2); - if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 145, __pyx_L1_error) - __pyx_t_1 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_is_or_evals_to_number(__pyx_v_is_or_evals_to_number, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 149, __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_t_2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_right_num = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_right_num = __pyx_t_5; + __pyx_t_5 = 0; - /* "constraint/parser.py":146 + /* "constraint/parser.py":150 * 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 = ['+'] */ - __pyx_t_8 = (__pyx_v_left_num == Py_None); - if (!__pyx_t_8) { - goto __pyx_L15_next_or; + __pyx_t_6 = (__pyx_v_left_num == Py_None); + if (!__pyx_t_6) { + goto __pyx_L18_next_or; } else { } - __pyx_t_8 = (__pyx_v_right_num == Py_None); - if (!__pyx_t_8) { + __pyx_t_6 = (__pyx_v_right_num == Py_None); + if (!__pyx_t_6) { } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L14_bool_binop_done; + __pyx_t_1 = __pyx_t_6; + goto __pyx_L17_bool_binop_done; } - __pyx_L15_next_or:; - __pyx_t_8 = (__pyx_v_left_num != Py_None); - if (__pyx_t_8) { + __pyx_L18_next_or:; + __pyx_t_6 = (__pyx_v_left_num != Py_None); + if (__pyx_t_6) { } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L14_bool_binop_done; + __pyx_t_1 = __pyx_t_6; + goto __pyx_L17_bool_binop_done; } - __pyx_t_8 = (__pyx_v_right_num != Py_None); - __pyx_t_7 = __pyx_t_8; - __pyx_L14_bool_binop_done:; - if (__pyx_t_7) { + __pyx_t_6 = (__pyx_v_right_num != Py_None); + __pyx_t_1 = __pyx_t_6; + __pyx_L17_bool_binop_done:; + if (__pyx_t_1) { - /* "constraint/parser.py":148 + /* "constraint/parser.py":152 * 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 = ['+'] # <<<<<<<<<<<<<< * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] * # find all unique variable_supported_operators in the restriction, can have at most one */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 152, __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_1, 0, __pyx_mstate_global->__pyx_kp_u__10) != (0)) __PYX_ERR(0, 148, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_cur_scope->__pyx_v_variable_supported_operators = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_mstate_global->__pyx_kp_u__10) != (0)) __PYX_ERR(0, 152, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_cur_scope->__pyx_v_variable_supported_operators = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; - /* "constraint/parser.py":149 + /* "constraint/parser.py":153 * # if both sides are parameters, try to use the VariableConstraints * variable_supported_operators = ['+'] * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] # <<<<<<<<<<<<<< @@ -7290,76 +7716,76 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L20_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_cur_scope->__pyx_v_left, __pyx_cur_scope->__pyx_v_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L20_error) + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyNumber_Add(__pyx_cur_scope->__pyx_v_left, __pyx_cur_scope->__pyx_v_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L20_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PySequence_ListKeepNew(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 153, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); - __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2); + __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_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 149, __pyx_L20_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 153, __pyx_L23_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6); - ++__pyx_t_6; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L20_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_s, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_8genexpr5__pyx_v_s, __pyx_cur_scope->__pyx_v_variable_supported_operators, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 149, __pyx_L20_error) - if (__pyx_t_7) { - __pyx_t_3 = __pyx_8genexpr5__pyx_v_s; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_5 = 0; + __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); + ++__pyx_t_3; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 153, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_s, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_8genexpr7__pyx_v_s, __pyx_cur_scope->__pyx_v_variable_supported_operators, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 153, __pyx_L23_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_3, NULL}; - __pyx_t_4 = __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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L20_error) - __Pyx_GOTREF(__pyx_t_4); + 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, 153, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_8); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 149, __pyx_L20_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 153, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_s); __pyx_8genexpr5__pyx_v_s = 0; - goto __pyx_L25_exit_scope; - __pyx_L20_error:; - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_s); __pyx_8genexpr5__pyx_v_s = 0; + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_s); __pyx_8genexpr7__pyx_v_s = 0; + goto __pyx_L28_exit_scope; + __pyx_L23_error:; + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_s); __pyx_8genexpr7__pyx_v_s = 0; goto __pyx_L1_error; - __pyx_L25_exit_scope:; + __pyx_L28_exit_scope:; } /* exit inner scope */ - __pyx_v_variables = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_variables = __pyx_t_5; + __pyx_t_5 = 0; - /* "constraint/parser.py":151 + /* "constraint/parser.py":155 * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] * # find all unique variable_supported_operators in the restriction, can have at most one * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) # <<<<<<<<<<<<<< * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 */ - __pyx_t_1 = PyNumber_Add(__pyx_cur_scope->__pyx_v_left, __pyx_cur_scope->__pyx_v_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_14genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_cur_scope->__pyx_v_left, __pyx_cur_scope->__pyx_v_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_17genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_unique_operators, ((PyObject*)__pyx_t_1)); - __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_unique_operators, ((PyObject*)__pyx_t_5)); + __pyx_t_5 = 0; - /* "constraint/parser.py":153 + /* "constraint/parser.py":157 * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 # <<<<<<<<<<<<<< @@ -7368,47 +7794,47 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ if (unlikely(__pyx_v_unique_operators == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 153, __pyx_L1_error) + __PYX_ERR(0, 157, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 153, __pyx_L1_error) - __pyx_t_8 = (__pyx_t_6 <= 1); - if (__pyx_t_8) { + __pyx_t_3 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_6 = (__pyx_t_3 <= 1); + if (__pyx_t_6) { } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L27_bool_binop_done; + __pyx_t_1 = __pyx_t_6; + goto __pyx_L30_bool_binop_done; } - __pyx_t_1 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_17genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __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, 153, __pyx_L1_error) + __pyx_t_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_20genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_variables); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __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, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_8) { + if (__pyx_t_6) { } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L27_bool_binop_done; + __pyx_t_1 = __pyx_t_6; + goto __pyx_L30_bool_binop_done; } __pyx_t_2 = __pyx_cur_scope->__pyx_v_left; __Pyx_INCREF(__pyx_t_2); - __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = (__pyx_t_6 == 1); - if (!__pyx_t_8) { + __pyx_t_6 = (__pyx_t_3 == 1); + if (!__pyx_t_6) { } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L27_bool_binop_done; + __pyx_t_1 = __pyx_t_6; + goto __pyx_L30_bool_binop_done; } __pyx_t_2 = __pyx_cur_scope->__pyx_v_right; __Pyx_INCREF(__pyx_t_2); - __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = (__pyx_t_6 == 1); - __pyx_t_7 = __pyx_t_8; - __pyx_L27_bool_binop_done:; - if (__pyx_t_7) { + __pyx_t_6 = (__pyx_t_3 == 1); + __pyx_t_1 = __pyx_t_6; + __pyx_L30_bool_binop_done:; + if (__pyx_t_1) { - /* "constraint/parser.py":154 + /* "constraint/parser.py":158 * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 * variables_on_left = len(right) == 1 # <<<<<<<<<<<<<< @@ -7417,14 +7843,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __pyx_t_2 = __pyx_cur_scope->__pyx_v_right; __Pyx_INCREF(__pyx_t_2); - __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 154, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_t_6 == 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_t_3 == 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_variables_on_left, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":155 + /* "constraint/parser.py":159 * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 * variables_on_left = len(right) == 1 * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": # <<<<<<<<<<<<<< @@ -7433,37 +7859,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ if (unlikely(__pyx_v_unique_operators == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 155, __pyx_L1_error) + __PYX_ERR(0, 159, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 155, __pyx_L1_error) - __pyx_t_8 = (__pyx_t_6 == 0); - if (!__pyx_t_8) { + __pyx_t_3 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_6 = (__pyx_t_3 == 0); + if (!__pyx_t_6) { } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L32_bool_binop_done; + __pyx_t_1 = __pyx_t_6; + goto __pyx_L35_bool_binop_done; } - __pyx_t_2 = PyObject_GetIter(__pyx_v_unique_operators); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_2 = PyObject_GetIter(__pyx_v_unique_operators); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__10, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 155, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __pyx_t_8; - __pyx_L32_bool_binop_done:; - if (__pyx_t_7) { + __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, 159, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __pyx_t_6; + __pyx_L35_bool_binop_done:; + if (__pyx_t_1) { - /* "constraint/parser.py":156 + /* "constraint/parser.py":160 * variables_on_left = len(right) == 1 * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": * if comparator == "==": # <<<<<<<<<<<<<< * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 * elif comparator == "<=": */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 156, __pyx_L1_error) - if (__pyx_t_7) { + __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, 160, __pyx_L1_error) + if (__pyx_t_1) { - /* "constraint/parser.py":157 + /* "constraint/parser.py":161 * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": * if comparator == "==": * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 # <<<<<<<<<<<<<< @@ -7471,77 +7897,77 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # "B+C <= A" (maxsum) if variables_on_left else "A <= B+C" (minsum) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 157, __pyx_L1_error) - if (__pyx_t_7) { - __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __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, 157, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 161, __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, 161, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = 1; + __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, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = 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); + 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); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_10, __pyx_t_11}; - __pyx_t_2 = __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_10); __pyx_t_10 = 0; + 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; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) + __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, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_1 = __pyx_t_2; + __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 0; } else { - __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_7 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 161, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = 1; + __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, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11); - assert(__pyx_t_3); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_3); + if (unlikely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12); + assert(__pyx_t_7); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); + __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_10, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __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; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + 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; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_1 = __pyx_t_2; + __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 0; } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":156 + /* "constraint/parser.py":160 * variables_on_left = len(right) == 1 * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": * if comparator == "==": # <<<<<<<<<<<<<< @@ -7550,17 +7976,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":158 + /* "constraint/parser.py":162 * 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 VariableMaxSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMinSumConstraint(variables[0], variables[1:]) # noqa: E501 */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 158, __pyx_L1_error) - if (__pyx_t_7) { + __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, 162, __pyx_L1_error) + if (__pyx_t_1) { - /* "constraint/parser.py":160 + /* "constraint/parser.py":164 * 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 # <<<<<<<<<<<<<< @@ -7568,77 +7994,77 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # "B+C >= A" (minsum) if variables_on_left else "A >= B+C" (maxsum) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 160, __pyx_L1_error) - if (__pyx_t_7) { - __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = 1; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 164, __pyx_L1_error) + if (__pyx_t_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, 164, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 164, __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, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4); - assert(__pyx_t_11); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_11); + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); + assert(__pyx_t_12); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_10, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) + 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)); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 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, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_1 = __pyx_t_2; + __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 0; } else { - __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __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, 160, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 164, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = 1; + __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, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = 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); + 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); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_10, __pyx_t_11}; - __pyx_t_2 = __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_10); __pyx_t_10 = 0; + 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; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) + __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, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_1 = __pyx_t_2; + __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 0; } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":158 + /* "constraint/parser.py":162 * if comparator == "==": * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 * elif comparator == "<=": # <<<<<<<<<<<<<< @@ -7647,17 +8073,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":161 + /* "constraint/parser.py":165 * # "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 VariableMinSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxSumConstraint(variables[0], variables[1:]) # noqa: E501 */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 161, __pyx_L1_error) - if (__pyx_t_7) { + __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, 165, __pyx_L1_error) + if (__pyx_t_1) { - /* "constraint/parser.py":163 + /* "constraint/parser.py":167 * 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 # <<<<<<<<<<<<<< @@ -7665,77 +8091,77 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # left_num and right_num can't be both None or both a constant */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 163, __pyx_L1_error) - if (__pyx_t_7) { - __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 167, __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, 167, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = 1; + __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, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11); - assert(__pyx_t_3); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_3); + if (unlikely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12); + assert(__pyx_t_7); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); + __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_10, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __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; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + 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; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_1 = __pyx_t_2; + __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 0; } else { - __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = 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, 167, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 167, __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, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4); - assert(__pyx_t_11); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_11); + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); + assert(__pyx_t_12); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_10, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) + 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)); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 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, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_1 = __pyx_t_2; + __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 0; } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":161 + /* "constraint/parser.py":165 * # "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 == ">=": # <<<<<<<<<<<<<< @@ -7744,7 +8170,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":155 + /* "constraint/parser.py":159 * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 * variables_on_left = len(right) == 1 * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": # <<<<<<<<<<<<<< @@ -7753,7 +8179,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":153 + /* "constraint/parser.py":157 * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 # <<<<<<<<<<<<<< @@ -7762,7 +8188,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":166 + /* "constraint/parser.py":170 * * # left_num and right_num can't be both None or both a constant * return None # <<<<<<<<<<<<<< @@ -7773,7 +8199,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":146 + /* "constraint/parser.py":150 * 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): # <<<<<<<<<<<<<< @@ -7782,92 +8208,92 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":170 + /* "constraint/parser.py":174 * # 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_t_7 = (__pyx_v_left_num != Py_None); - if (__pyx_t_7) { - __pyx_t_4 = __pyx_cur_scope->__pyx_v_right; - __Pyx_INCREF(__pyx_t_4); - __pyx_t_5 = 0; + __pyx_t_1 = (__pyx_v_left_num != Py_None); + if (__pyx_t_1) { + __pyx_t_8 = __pyx_cur_scope->__pyx_v_right; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_9 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; - __pyx_t_2 = __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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) + 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, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_left_num); __Pyx_GIVEREF(__pyx_v_left_num); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_left_num) != (0)) __PYX_ERR(0, 170, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_left_num) != (0)) __PYX_ERR(0, 174, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 170, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 174, __pyx_L1_error); __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, Py_False) != (0)) __PYX_ERR(0, 170, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, Py_False) != (0)) __PYX_ERR(0, 174, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_1 = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_5 = __pyx_t_8; + __pyx_t_8 = 0; } else { __pyx_t_2 = __pyx_cur_scope->__pyx_v_left; __Pyx_INCREF(__pyx_t_2); - __pyx_t_5 = 0; + __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_4 = __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_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_4)) __PYX_ERR(0, 170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __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, 170, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 170, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_right_num) != (0)) __PYX_ERR(0, 174, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 174, __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, 170, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_1 = __pyx_t_2; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_True) != (0)) __PYX_ERR(0, 174, __pyx_L1_error); + __pyx_t_8 = 0; + __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 0; } - if (likely(__pyx_t_1 != Py_None)) { - PyObject* sequence = __pyx_t_1; + if (likely(__pyx_t_5 != Py_None)) { + PyObject* sequence = __pyx_t_5; 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, 169, __pyx_L1_error) + __PYX_ERR(0, 173, __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_4 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_4); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); - __Pyx_INCREF(__pyx_t_3); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_8); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 173, __pyx_L1_error) } - /* "constraint/parser.py":169 + /* "constraint/parser.py":173 * * # if one side is a number, the other side must be a variable or expression * number, variables, variables_on_left = ( # <<<<<<<<<<<<<< @@ -7876,22 +8302,22 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __pyx_v_number = __pyx_t_2; __pyx_t_2 = 0; - __pyx_v_variables = __pyx_t_4; - __pyx_t_4 = 0; - __Pyx_XDECREF_SET(__pyx_v_variables_on_left, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_v_variables = __pyx_t_8; + __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_variables_on_left, __pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/parser.py":174 + /* "constraint/parser.py":178 * * # if the number is an integer, we can map '>' to '>=' and '<' to '<=' by changing the number (does not work with floating points!) # noqa: E501 * number_is_int = isinstance(number, int) # <<<<<<<<<<<<<< * if number_is_int: * if comparator == "<": */ - __pyx_t_7 = PyLong_Check(__pyx_v_number); - __pyx_v_number_is_int = __pyx_t_7; + __pyx_t_1 = PyLong_Check(__pyx_v_number); + __pyx_v_number_is_int = __pyx_t_1; - /* "constraint/parser.py":175 + /* "constraint/parser.py":179 * # if the number is an integer, we can map '>' to '>=' and '<' to '<=' by changing the number (does not work with floating points!) # noqa: E501 * number_is_int = isinstance(number, int) * if number_is_int: # <<<<<<<<<<<<<< @@ -7900,49 +8326,49 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ if (__pyx_v_number_is_int) { - /* "constraint/parser.py":176 + /* "constraint/parser.py":180 * number_is_int = isinstance(number, int) * if number_is_int: * if comparator == "<": # <<<<<<<<<<<<<< * if variables_on_left: * # (x < 2) == (x <= 2-1) */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 176, __pyx_L1_error) - if (__pyx_t_7) { + __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, 180, __pyx_L1_error) + if (__pyx_t_1) { - /* "constraint/parser.py":177 + /* "constraint/parser.py":181 * if number_is_int: * if comparator == "<": * if variables_on_left: # <<<<<<<<<<<<<< * # (x < 2) == (x <= 2-1) * number -= 1 */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 177, __pyx_L1_error) - if (__pyx_t_7) { + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) + if (__pyx_t_1) { - /* "constraint/parser.py":179 + /* "constraint/parser.py":183 * if variables_on_left: * # (x < 2) == (x <= 2-1) * number -= 1 # <<<<<<<<<<<<<< * else: * # (2 < x) == (2+1 <= x) */ - __pyx_t_1 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_5); + __pyx_t_5 = 0; - /* "constraint/parser.py":177 + /* "constraint/parser.py":181 * if number_is_int: * if comparator == "<": * if variables_on_left: # <<<<<<<<<<<<<< * # (x < 2) == (x <= 2-1) * number -= 1 */ - goto __pyx_L37; + goto __pyx_L40; } - /* "constraint/parser.py":182 + /* "constraint/parser.py":186 * else: * # (2 < x) == (2+1 <= x) * number += 1 # <<<<<<<<<<<<<< @@ -7950,66 +8376,66 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if variables_on_left: */ /*else*/ { - __pyx_t_1 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_5); + __pyx_t_5 = 0; } - __pyx_L37:; + __pyx_L40:; - /* "constraint/parser.py":176 + /* "constraint/parser.py":180 * number_is_int = isinstance(number, int) * if number_is_int: * if comparator == "<": # <<<<<<<<<<<<<< * if variables_on_left: * # (x < 2) == (x <= 2-1) */ - goto __pyx_L36; + goto __pyx_L39; } - /* "constraint/parser.py":183 + /* "constraint/parser.py":187 * # (2 < x) == (2+1 <= x) * number += 1 * elif comparator == ">": # <<<<<<<<<<<<<< * if variables_on_left: * # (x > 2) == (x >= 2+1) */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 183, __pyx_L1_error) - if (__pyx_t_7) { + __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, 187, __pyx_L1_error) + if (__pyx_t_1) { - /* "constraint/parser.py":184 + /* "constraint/parser.py":188 * number += 1 * elif comparator == ">": * if variables_on_left: # <<<<<<<<<<<<<< * # (x > 2) == (x >= 2+1) * number += 1 */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 184, __pyx_L1_error) - if (__pyx_t_7) { + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 188, __pyx_L1_error) + if (__pyx_t_1) { - /* "constraint/parser.py":186 + /* "constraint/parser.py":190 * if variables_on_left: * # (x > 2) == (x >= 2+1) * number += 1 # <<<<<<<<<<<<<< * else: * # (2 > x) == (2-1 >= x) */ - __pyx_t_1 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_5); + __pyx_t_5 = 0; - /* "constraint/parser.py":184 + /* "constraint/parser.py":188 * number += 1 * elif comparator == ">": * if variables_on_left: # <<<<<<<<<<<<<< * # (x > 2) == (x >= 2+1) * number += 1 */ - goto __pyx_L38; + goto __pyx_L41; } - /* "constraint/parser.py":189 + /* "constraint/parser.py":193 * else: * # (2 > x) == (2-1 >= x) * number -= 1 # <<<<<<<<<<<<<< @@ -8017,14 +8443,14 @@ 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_1 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_5); + __pyx_t_5 = 0; } - __pyx_L38:; + __pyx_L41:; - /* "constraint/parser.py":183 + /* "constraint/parser.py":187 * # (2 < x) == (2+1 <= x) * number += 1 * elif comparator == ">": # <<<<<<<<<<<<<< @@ -8032,9 +8458,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # (x > 2) == (x >= 2+1) */ } - __pyx_L36:; + __pyx_L39:; - /* "constraint/parser.py":175 + /* "constraint/parser.py":179 * # if the number is an integer, we can map '>' to '>=' and '<' to '<=' by changing the number (does not work with floating points!) # noqa: E501 * number_is_int = isinstance(number, int) * if number_is_int: # <<<<<<<<<<<<<< @@ -8043,100 +8469,100 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":192 + /* "constraint/parser.py":196 * * # 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_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 196, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __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_1, 0, __pyx_mstate_global->__pyx_kp_u__13) != (0)) __PYX_ERR(0, 192, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_mstate_global->__pyx_kp_u__13) != (0)) __PYX_ERR(0, 196, __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_1, 1, __pyx_mstate_global->__pyx_kp_u__14) != (0)) __PYX_ERR(0, 192, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_mstate_global->__pyx_kp_u__14) != (0)) __PYX_ERR(0, 196, __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_1, 2, __pyx_mstate_global->__pyx_kp_u__15) != (0)) __PYX_ERR(0, 192, __pyx_L1_error); - __pyx_v_operators = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_mstate_global->__pyx_kp_u__15) != (0)) __PYX_ERR(0, 196, __pyx_L1_error); + __pyx_v_operators = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; - /* "constraint/parser.py":193 + /* "constraint/parser.py":197 * # 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_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_7 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 197, __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, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_operators); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = 1; + __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, 197, __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_3 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_3); + __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_3); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); - __pyx_t_5 = 0; + __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_4, __pyx_v_variables}; - __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_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + 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; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_v_operators_found = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_operators_found = __pyx_t_5; + __pyx_t_5 = 0; - /* "constraint/parser.py":194 + /* "constraint/parser.py":198 * 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_6 = PyObject_Length(__pyx_v_operators_found); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 194, __pyx_L1_error) - __pyx_t_7 = (__pyx_t_6 == 0); - if (__pyx_t_7) { + __pyx_t_3 = PyObject_Length(__pyx_v_operators_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_3 == 0); + if (__pyx_t_1) { - /* "constraint/parser.py":196 + /* "constraint/parser.py":200 * 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_1 = __pyx_cur_scope->__pyx_v_params; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 196, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = (__pyx_t_6 != 1); - if (!__pyx_t_8) { + __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, 200, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = (__pyx_t_3 != 1); + if (!__pyx_t_6) { } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L41_bool_binop_done; + __pyx_t_1 = __pyx_t_6; + goto __pyx_L44_bool_binop_done; } - __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_variables, __pyx_cur_scope->__pyx_v_params, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 196, __pyx_L1_error) - __pyx_t_7 = __pyx_t_8; - __pyx_L41_bool_binop_done:; - if (__pyx_t_7) { + __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, 200, __pyx_L1_error) + __pyx_t_1 = __pyx_t_6; + __pyx_L44_bool_binop_done:; + if (__pyx_t_1) { - /* "constraint/parser.py":198 + /* "constraint/parser.py":202 * if len(params) != 1 or variables not in params: * # there were more than one variable but no operator * return None # <<<<<<<<<<<<<< @@ -8147,7 +8573,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":196 + /* "constraint/parser.py":200 * if len(operators_found) == 0: * # no operators found, return only based on comparator * if len(params) != 1 or variables not in params: # <<<<<<<<<<<<<< @@ -8156,17 +8582,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":201 + /* "constraint/parser.py":205 * # 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 == "<" and number_is_int): */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 201, __pyx_L1_error) - if (__pyx_t_7) { + __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, 205, __pyx_L1_error) + if (__pyx_t_1) { - /* "constraint/parser.py":202 + /* "constraint/parser.py":206 * # if there are restrictions with a single variable, it will be used to prune the domain at the start * elif comparator == "==": * return ExactSumConstraint(number) # <<<<<<<<<<<<<< @@ -8175,33 +8601,33 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = 1; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + 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_4); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); - __pyx_t_5 = 0; + __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_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_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_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":201 + /* "constraint/parser.py":205 * # 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 == "==": # <<<<<<<<<<<<<< @@ -8210,30 +8636,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":203 + /* "constraint/parser.py":207 * elif comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 203, __pyx_L1_error) - if (!__pyx_t_8) { + __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, 207, __pyx_L1_error) + if (!__pyx_t_6) { } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L43_bool_binop_done; + __pyx_t_1 = __pyx_t_6; + goto __pyx_L46_bool_binop_done; } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 203, __pyx_L1_error) - if (__pyx_t_8) { + __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, 207, __pyx_L1_error) + if (__pyx_t_6) { } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L43_bool_binop_done; + __pyx_t_1 = __pyx_t_6; + goto __pyx_L46_bool_binop_done; } - __pyx_t_7 = __pyx_v_number_is_int; - __pyx_L43_bool_binop_done:; - if (__pyx_t_7) { + __pyx_t_1 = __pyx_v_number_is_int; + __pyx_L46_bool_binop_done:; + if (__pyx_t_1) { - /* "constraint/parser.py":204 + /* "constraint/parser.py":208 * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< @@ -8241,65 +8667,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_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 204, __pyx_L1_error) - if (__pyx_t_7) { + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 208, __pyx_L1_error) + if (__pyx_t_1) { __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = 1; + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + 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_3); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_number}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_1 = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_5 = __pyx_t_8; + __pyx_t_8 = 0; } else { - __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_7 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = 1; + __pyx_t_9 = 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); + __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_3); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); - __pyx_t_5 = 0; + __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_number}; - __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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + 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_4)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_1 = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_5 = __pyx_t_8; + __pyx_t_8 = 0; } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":203 + /* "constraint/parser.py":207 * elif comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< @@ -8308,30 +8734,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":205 + /* "constraint/parser.py":209 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * raise ValueError(f"Invalid comparator {comparator}") */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 205, __pyx_L1_error) - if (!__pyx_t_8) { + __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, 209, __pyx_L1_error) + if (!__pyx_t_6) { } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L46_bool_binop_done; + __pyx_t_1 = __pyx_t_6; + goto __pyx_L49_bool_binop_done; } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 205, __pyx_L1_error) - if (__pyx_t_8) { + __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, 209, __pyx_L1_error) + if (__pyx_t_6) { } else { - __pyx_t_7 = __pyx_t_8; - goto __pyx_L46_bool_binop_done; + __pyx_t_1 = __pyx_t_6; + goto __pyx_L49_bool_binop_done; } - __pyx_t_7 = __pyx_v_number_is_int; - __pyx_L46_bool_binop_done:; - if (__pyx_t_7) { + __pyx_t_1 = __pyx_v_number_is_int; + __pyx_L49_bool_binop_done:; + if (__pyx_t_1) { - /* "constraint/parser.py":206 + /* "constraint/parser.py":210 * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) # <<<<<<<<<<<<<< @@ -8339,65 +8765,65 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 206, __pyx_L1_error) - if (__pyx_t_7) { + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 210, __pyx_L1_error) + if (__pyx_t_1) { __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = 1; + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + 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_3); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_number}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_1 = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_5 = __pyx_t_8; + __pyx_t_8 = 0; } else { - __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_7 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = 1; + __pyx_t_9 = 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); + __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_3); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); - __pyx_t_5 = 0; + __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_number}; - __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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + 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_4)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_1 = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_5 = __pyx_t_8; + __pyx_t_8 = 0; } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":205 + /* "constraint/parser.py":209 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< @@ -8406,36 +8832,36 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":207 + /* "constraint/parser.py":211 * elif comparator == ">=" or (comparator == ">" and number_is_int): * 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_4 = NULL; + __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_builtin_ValueError); __pyx_t_2 = __pyx_builtin_ValueError; - __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_comparator, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = 1; + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 211, __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, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_9 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_10}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __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_10); __pyx_t_10 = 0; + 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; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 211, __pyx_L1_error) - /* "constraint/parser.py":194 + /* "constraint/parser.py":198 * operators = [r"\*\*", r"\*", r"\+"] * operators_found = re.findall(str("|".join(operators)), variables) * if len(operators_found) == 0: # <<<<<<<<<<<<<< @@ -8444,37 +8870,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":210 + /* "constraint/parser.py":214 * * # 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_1 = __Pyx_GetItemInt(__pyx_v_operators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_cur_scope->__pyx_v_operator = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_operators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __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; - /* "constraint/parser.py":211 + /* "constraint/parser.py":215 * # 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_1 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_20genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_operators_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __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, 211, __pyx_L1_error) + __pyx_t_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_23genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_operators_found); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __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, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 211, __pyx_L1_error) + __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, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = (!__pyx_t_7); - if (__pyx_t_8) { + __pyx_t_6 = (!__pyx_t_1); + if (__pyx_t_6) { - /* "constraint/parser.py":213 + /* "constraint/parser.py":217 * 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 # <<<<<<<<<<<<<< @@ -8485,7 +8911,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":211 + /* "constraint/parser.py":215 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< @@ -8494,66 +8920,66 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":216 + /* "constraint/parser.py":220 * * # 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_1 = __pyx_v_variables; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = 0; + __pyx_t_5 = __pyx_v_variables; + __Pyx_INCREF(__pyx_t_5); + __pyx_t_9 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_operator}; - __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_split, __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_2)) __PYX_ERR(0, 216, __pyx_L1_error) + 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, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_splitted = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/parser.py":218 + /* "constraint/parser.py":222 * 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_6 = PyObject_Length(__pyx_v_splitted); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_splitted); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 222, __pyx_L1_error) __pyx_t_2 = __pyx_cur_scope->__pyx_v_params; __Pyx_INCREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = (__pyx_t_6 == __pyx_t_12); - if (__pyx_t_7) { + __pyx_t_1 = (__pyx_t_3 == __pyx_t_13); + if (__pyx_t_1) { } else { - __pyx_t_8 = __pyx_t_7; - goto __pyx_L51_bool_binop_done; + __pyx_t_6 = __pyx_t_1; + goto __pyx_L54_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, 218, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_26genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_splitted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __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, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = __pyx_t_7; - __pyx_L51_bool_binop_done:; - if (__pyx_t_8) { + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __pyx_t_1; + __pyx_L54_bool_binop_done:; + if (__pyx_t_6) { - /* "constraint/parser.py":220 + /* "constraint/parser.py":224 * 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_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_kp_u__8, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 220, __pyx_L1_error) - if (__pyx_t_8) { + __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, 224, __pyx_L1_error) + if (__pyx_t_6) { - /* "constraint/parser.py":222 + /* "constraint/parser.py":226 * if operator == "**": * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None # <<<<<<<<<<<<<< @@ -8564,7 +8990,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":220 + /* "constraint/parser.py":224 * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): * # map to a Constraint * if operator == "**": # <<<<<<<<<<<<<< @@ -8573,27 +8999,27 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":223 + /* "constraint/parser.py":227 * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None * elif operator == "*": # <<<<<<<<<<<<<< * if comparator == "==": * return ExactProdConstraint(number) */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 223, __pyx_L1_error) - if (__pyx_t_8) { + __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, 227, __pyx_L1_error) + if (__pyx_t_6) { - /* "constraint/parser.py":224 + /* "constraint/parser.py":228 * return None * elif operator == "*": * if comparator == "==": # <<<<<<<<<<<<<< * return ExactProdConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 224, __pyx_L1_error) - if (__pyx_t_8) { + __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, 228, __pyx_L1_error) + if (__pyx_t_6) { - /* "constraint/parser.py":225 + /* "constraint/parser.py":229 * elif operator == "*": * if comparator == "==": * return ExactProdConstraint(number) # <<<<<<<<<<<<<< @@ -8602,33 +9028,33 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 225, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = 1; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_10); + 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_10); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); - __pyx_t_5 = 0; + __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_1 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":224 + /* "constraint/parser.py":228 * return None * elif operator == "*": * if comparator == "==": # <<<<<<<<<<<<<< @@ -8637,30 +9063,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":226 + /* "constraint/parser.py":230 * if comparator == "==": * return ExactProdConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 226, __pyx_L1_error) - if (!__pyx_t_7) { + __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, 230, __pyx_L1_error) + if (!__pyx_t_1) { } else { - __pyx_t_8 = __pyx_t_7; - goto __pyx_L55_bool_binop_done; + __pyx_t_6 = __pyx_t_1; + goto __pyx_L58_bool_binop_done; } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 226, __pyx_L1_error) - if (__pyx_t_7) { + __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, 230, __pyx_L1_error) + if (__pyx_t_1) { } else { - __pyx_t_8 = __pyx_t_7; - goto __pyx_L55_bool_binop_done; + __pyx_t_6 = __pyx_t_1; + goto __pyx_L58_bool_binop_done; } - __pyx_t_8 = __pyx_v_number_is_int; - __pyx_L55_bool_binop_done:; - if (__pyx_t_8) { + __pyx_t_6 = __pyx_v_number_is_int; + __pyx_L58_bool_binop_done:; + if (__pyx_t_6) { - /* "constraint/parser.py":227 + /* "constraint/parser.py":231 * return ExactProdConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) # <<<<<<<<<<<<<< @@ -8668,65 +9094,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_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 227, __pyx_L1_error) - if (__pyx_t_8) { + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 231, __pyx_L1_error) + if (__pyx_t_6) { __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = 1; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + 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_4); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); - __pyx_t_5 = 0; + __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_10 = __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_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; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 227, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_1 = __pyx_t_10; - __pyx_t_10 = 0; + __pyx_t_5 = __pyx_t_11; + __pyx_t_11 = 0; } else { - __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = 1; + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_4); + __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_4); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); - __pyx_t_5 = 0; + __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_number}; - __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_2, __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; + 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 227, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_1 = __pyx_t_10; - __pyx_t_10 = 0; + __pyx_t_5 = __pyx_t_11; + __pyx_t_11 = 0; } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":226 + /* "constraint/parser.py":230 * if comparator == "==": * return ExactProdConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< @@ -8735,30 +9161,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":228 + /* "constraint/parser.py":232 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 228, __pyx_L1_error) - if (!__pyx_t_7) { + __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, 232, __pyx_L1_error) + if (!__pyx_t_1) { } else { - __pyx_t_8 = __pyx_t_7; - goto __pyx_L58_bool_binop_done; + __pyx_t_6 = __pyx_t_1; + goto __pyx_L61_bool_binop_done; } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 228, __pyx_L1_error) - if (__pyx_t_7) { + __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, 232, __pyx_L1_error) + if (__pyx_t_1) { } else { - __pyx_t_8 = __pyx_t_7; - goto __pyx_L58_bool_binop_done; + __pyx_t_6 = __pyx_t_1; + goto __pyx_L61_bool_binop_done; } - __pyx_t_8 = __pyx_v_number_is_int; - __pyx_L58_bool_binop_done:; - if (__pyx_t_8) { + __pyx_t_6 = __pyx_v_number_is_int; + __pyx_L61_bool_binop_done:; + if (__pyx_t_6) { - /* "constraint/parser.py":229 + /* "constraint/parser.py":233 * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) # <<<<<<<<<<<<<< @@ -8766,65 +9192,65 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if comparator == "==": */ __Pyx_XDECREF(__pyx_r); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 229, __pyx_L1_error) - if (__pyx_t_8) { + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 233, __pyx_L1_error) + if (__pyx_t_6) { __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = 1; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + 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_4); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); - __pyx_t_5 = 0; + __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_10 = __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_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; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 229, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_1 = __pyx_t_10; - __pyx_t_10 = 0; + __pyx_t_5 = __pyx_t_11; + __pyx_t_11 = 0; } else { - __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = 1; + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_4); + __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_4); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); - __pyx_t_5 = 0; + __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_number}; - __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_2, __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; + 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 229, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_1 = __pyx_t_10; - __pyx_t_10 = 0; + __pyx_t_5 = __pyx_t_11; + __pyx_t_11 = 0; } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":228 + /* "constraint/parser.py":232 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< @@ -8833,37 +9259,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":223 + /* "constraint/parser.py":227 * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None * elif operator == "*": # <<<<<<<<<<<<<< * if comparator == "==": * return ExactProdConstraint(number) */ - goto __pyx_L53; + goto __pyx_L56; } - /* "constraint/parser.py":230 + /* "constraint/parser.py":234 * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": # <<<<<<<<<<<<<< * if comparator == "==": * return ExactSumConstraint(number) */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_kp_u__10, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 230, __pyx_L1_error) - if (likely(__pyx_t_8)) { + __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, 234, __pyx_L1_error) + if (likely(__pyx_t_6)) { - /* "constraint/parser.py":231 + /* "constraint/parser.py":235 * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": * if comparator == "==": # <<<<<<<<<<<<<< * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 231, __pyx_L1_error) - if (__pyx_t_8) { + __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, 235, __pyx_L1_error) + if (__pyx_t_6) { - /* "constraint/parser.py":232 + /* "constraint/parser.py":236 * elif operator == "+": * if comparator == "==": * return ExactSumConstraint(number) # <<<<<<<<<<<<<< @@ -8871,34 +9297,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_10 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = 1; + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_10); + __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_10); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); - __pyx_t_5 = 0; + __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_number}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __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; + 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_1)) __PYX_ERR(0, 232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":231 + /* "constraint/parser.py":235 * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": * if comparator == "==": # <<<<<<<<<<<<<< @@ -8907,30 +9333,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":233 + /* "constraint/parser.py":237 * if comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 233, __pyx_L1_error) - if (!__pyx_t_7) { + __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, 237, __pyx_L1_error) + if (!__pyx_t_1) { } else { - __pyx_t_8 = __pyx_t_7; - goto __pyx_L62_bool_binop_done; + __pyx_t_6 = __pyx_t_1; + goto __pyx_L65_bool_binop_done; } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 233, __pyx_L1_error) - if (__pyx_t_7) { + __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, 237, __pyx_L1_error) + if (__pyx_t_1) { } else { - __pyx_t_8 = __pyx_t_7; - goto __pyx_L62_bool_binop_done; + __pyx_t_6 = __pyx_t_1; + goto __pyx_L65_bool_binop_done; } - __pyx_t_8 = __pyx_v_number_is_int; - __pyx_L62_bool_binop_done:; - if (__pyx_t_8) { + __pyx_t_6 = __pyx_v_number_is_int; + __pyx_L65_bool_binop_done:; + if (__pyx_t_6) { - /* "constraint/parser.py":234 + /* "constraint/parser.py":238 * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< @@ -8938,65 +9364,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_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 234, __pyx_L1_error) - if (__pyx_t_8) { - __pyx_t_10 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = 1; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 238, __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, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4); - assert(__pyx_t_10); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_10); + 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_4, __pyx__function); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_number}; - __pyx_t_2 = __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_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + 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; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_1 = __pyx_t_2; + __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 0; } else { - __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = 1; + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10); - assert(__pyx_t_4); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_4); + 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_10, __pyx__function); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); + __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_number}; - __pyx_t_2 = __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_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + 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_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, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_1 = __pyx_t_2; + __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 0; } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":233 + /* "constraint/parser.py":237 * if comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< @@ -9005,30 +9431,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":235 + /* "constraint/parser.py":239 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * else: */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 235, __pyx_L1_error) - if (!__pyx_t_7) { + __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, 239, __pyx_L1_error) + if (!__pyx_t_1) { } else { - __pyx_t_8 = __pyx_t_7; - goto __pyx_L65_bool_binop_done; + __pyx_t_6 = __pyx_t_1; + goto __pyx_L68_bool_binop_done; } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 235, __pyx_L1_error) - if (__pyx_t_7) { + __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) { } else { - __pyx_t_8 = __pyx_t_7; - goto __pyx_L65_bool_binop_done; + __pyx_t_6 = __pyx_t_1; + goto __pyx_L68_bool_binop_done; } - __pyx_t_8 = __pyx_v_number_is_int; - __pyx_L65_bool_binop_done:; - if (__pyx_t_8) { + __pyx_t_6 = __pyx_v_number_is_int; + __pyx_L68_bool_binop_done:; + if (__pyx_t_6) { - /* "constraint/parser.py":236 + /* "constraint/parser.py":240 * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) # <<<<<<<<<<<<<< @@ -9036,65 +9462,65 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * raise ValueError(f"Invalid operator {operator}") */ __Pyx_XDECREF(__pyx_r); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 236, __pyx_L1_error) - if (__pyx_t_8) { - __pyx_t_10 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = 1; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 240, __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, 240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4); - assert(__pyx_t_10); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_10); + 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_4, __pyx__function); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_number}; - __pyx_t_2 = __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_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + 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; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_1 = __pyx_t_2; + __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 0; } else { - __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = 1; + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10); - assert(__pyx_t_4); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_4); + 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_10, __pyx__function); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); + __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_number}; - __pyx_t_2 = __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_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + 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_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, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_1 = __pyx_t_2; + __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 0; } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":235 + /* "constraint/parser.py":239 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< @@ -9103,17 +9529,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":230 + /* "constraint/parser.py":234 * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": # <<<<<<<<<<<<<< * if comparator == "==": * return ExactSumConstraint(number) */ - goto __pyx_L53; + goto __pyx_L56; } - /* "constraint/parser.py":238 + /* "constraint/parser.py":242 * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * else: * raise ValueError(f"Invalid operator {operator}") # <<<<<<<<<<<<<< @@ -9123,29 +9549,29 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ /*else*/ { __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_builtin_ValueError); - __pyx_t_10 = __pyx_builtin_ValueError; - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_operator, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = 1; + __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, 242, __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, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_10, __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_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_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __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, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 242, __pyx_L1_error) } - __pyx_L53:; + __pyx_L56:; - /* "constraint/parser.py":218 + /* "constraint/parser.py":222 * 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): # <<<<<<<<<<<<<< @@ -9154,7 +9580,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":239 + /* "constraint/parser.py":243 * else: * raise ValueError(f"Invalid operator {operator}") * return None # <<<<<<<<<<<<<< @@ -9170,17 +9596,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: + * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, MaxProdConstraint]]: # noqa: E501 */ /* 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_10); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("constraint.parser.parse_restrictions.to_numeric_constraint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -9205,14 +9631,15 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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_7generator1); - __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator2); - __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_13generator3); - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_s); - __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_16generator4); - __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_19generator5); - __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_22generator6); - __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_25generator7); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7generator2); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator3); + __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_8genexpr7__pyx_v_s); + __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_28generator9); __Pyx_XDECREF(__pyx_v_restriction); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); @@ -9220,7 +9647,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ return __pyx_r; } -/* "constraint/parser.py":241 +/* "constraint/parser.py":245 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< @@ -9269,39 +9696,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, 241, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 245, __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, 241, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 245, __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, 241, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 245, __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, 241, __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, 245, __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, 241, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_equality_constraint", 1, 2, 2, i); __PYX_ERR(0, 245, __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, 241, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 245, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 241, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 245, __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, 241, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("to_equality_constraint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 245, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9312,8 +9739,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, 242, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 242, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restriction), (&PyUnicode_Type), 0, "restriction", 2))) __PYX_ERR(0, 246, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 246, __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 */ @@ -9332,9 +9759,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator8(__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":260 +/* "constraint/parser.py":264 * 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): # <<<<<<<<<<<<<< @@ -9343,29 +9770,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_11_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_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); + __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_11_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, 260, __pyx_L1_error) + __PYX_ERR(0, 264, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_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_2generator8, ((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_equ, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 260, __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[11]), (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, 264, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -9381,9 +9808,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_2generator8(__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_11_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_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; @@ -9404,21 +9831,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, 260, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 260, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 264, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 264, __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, 260, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 264, __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, 260, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __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); @@ -9431,11 +9858,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit 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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __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, 260, __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, 260, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 264, __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, 264, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { @@ -9476,7 +9903,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit return __pyx_r; } -/* "constraint/parser.py":241 +/* "constraint/parser.py":245 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< @@ -9485,12 +9912,12 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit */ 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_10_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_2generator8 = 0; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator10 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -9507,11 +9934,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality 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_10_to_equality_constraint *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_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_10_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, 241, __pyx_L1_error) + __PYX_ERR(0, 245, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -9522,7 +9949,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":246 + /* "constraint/parser.py":250 * """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): # <<<<<<<<<<<<<< @@ -9531,21 +9958,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, 246, __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, 250, __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, 246, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 250, __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, 246, __pyx_L1_error) + __PYX_ERR(0, 250, __pyx_L1_error) } - __pyx_t_3 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_3 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 250, __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":247 + /* "constraint/parser.py":251 * # check if all parameters are involved * if len(params) != len(tune_params): * return None # <<<<<<<<<<<<<< @@ -9556,7 +9983,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":246 + /* "constraint/parser.py":250 * """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): # <<<<<<<<<<<<<< @@ -9565,7 +9992,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":250 + /* "constraint/parser.py":254 * * # find whether (in)equalities appear in this restriction * equalities_found = re.findall("==", restriction) # <<<<<<<<<<<<<< @@ -9573,9 +10000,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, 250, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __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, 250, __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, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = 1; @@ -9595,13 +10022,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 250, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_equalities_found = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":251 + /* "constraint/parser.py":255 * # find whether (in)equalities appear in this restriction * equalities_found = re.findall("==", restriction) * inequalities_found = re.findall("!=", restriction) # <<<<<<<<<<<<<< @@ -9609,9 +10036,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, 251, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 255, __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, 251, __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, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = 1; @@ -9631,37 +10058,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 251, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_inequalities_found = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":253 + /* "constraint/parser.py":257 * 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, 253, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 257, __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, 253, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_4))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __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, 253, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_inequalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 257, __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, 253, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBool_FromLong((!(!__pyx_t_4))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __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, 253, __pyx_L1_error) + __pyx_t_7 = PyNumber_Xor(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 257, __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, 253, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 257, __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":254 + /* "constraint/parser.py":258 * # 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 # <<<<<<<<<<<<<< @@ -9672,7 +10099,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":253 + /* "constraint/parser.py":257 * 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)): # <<<<<<<<<<<<<< @@ -9681,22 +10108,22 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":255 + /* "constraint/parser.py":259 * 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, 255, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 259, __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); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_equalities_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __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); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_inequalities_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __pyx_t_6; __pyx_t_6 = 0; @@ -9704,29 +10131,29 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __pyx_v_comparator = __pyx_t_7; __pyx_t_7 = 0; - /* "constraint/parser.py":258 + /* "constraint/parser.py":262 * * # 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, 258, __pyx_L1_error) + __pyx_t_7 = PyUnicode_Split(__pyx_v_restriction, __Pyx_NoneAsNull(__pyx_v_comparator), -1L); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_splitted = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/parser.py":260 + /* "constraint/parser.py":264 * 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, 260, __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, 264, __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, 260, __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, 264, __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) { @@ -9734,28 +10161,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, 260, __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, 264, __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, 260, __pyx_L1_error) + __pyx_t_6 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 264, __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, 260, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 264, __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":262 + /* "constraint/parser.py":266 * 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, 262, __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, 266, __pyx_L1_error) if (__pyx_t_9) { - /* "constraint/parser.py":263 + /* "constraint/parser.py":267 * # map to a Constraint * if comparator == "==": * return AllEqualConstraint() # <<<<<<<<<<<<<< @@ -9764,7 +10191,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, 263, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS @@ -9783,14 +10210,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 263, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/parser.py":262 + /* "constraint/parser.py":266 * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): * # map to a Constraint * if comparator == "==": # <<<<<<<<<<<<<< @@ -9799,17 +10226,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":264 + /* "constraint/parser.py":268 * 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, 264, __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, 268, __pyx_L1_error) if (__pyx_t_9) { - /* "constraint/parser.py":265 + /* "constraint/parser.py":269 * return AllEqualConstraint() * elif comparator == "!=": * return AllDifferentConstraint() # <<<<<<<<<<<<<< @@ -9818,7 +10245,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, 265, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS @@ -9837,14 +10264,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 265, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/parser.py":264 + /* "constraint/parser.py":268 * if comparator == "==": * return AllEqualConstraint() * elif comparator == "!=": # <<<<<<<<<<<<<< @@ -9853,7 +10280,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":266 + /* "constraint/parser.py":270 * elif comparator == "!=": * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") # <<<<<<<<<<<<<< @@ -9864,9 +10291,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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, 266, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __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, 266, __pyx_L1_error) + __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, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = 1; @@ -9876,14 +10303,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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, 266, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/parser.py":260 + /* "constraint/parser.py":264 * 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): # <<<<<<<<<<<<<< @@ -9892,7 +10319,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":267 + /* "constraint/parser.py":271 * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") * return None # <<<<<<<<<<<<<< @@ -9903,7 +10330,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":241 + /* "constraint/parser.py":245 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< @@ -9925,15 +10352,15 @@ 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_2generator8); + __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_12generator9(__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":270 +/* "constraint/parser.py":274 * * # remove functionally duplicate restrictions (preserves order and whitespace) * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< @@ -9942,18 +10369,18 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator9 */ 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_12_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_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_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_12_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, 270, __pyx_L1_error) + __PYX_ERR(0, 274, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -9961,7 +10388,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_12generator9, ((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_genexp, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 270, __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[12]), (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, 274, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -9977,9 +10404,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(CY return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator9(__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_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_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; @@ -9998,21 +10425,21 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator9 return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 270, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 270, __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) } __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, 270, __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_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __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); @@ -10080,10 +10507,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_12generator9 = 0; - PyObject *__pyx_9genexpr12__pyx_v_r = NULL; - PyObject *__pyx_9genexpr13__pyx_v_r = NULL; - PyObject *__pyx_9genexpr14__pyx_v_i = NULL; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator11 = 0; + PyObject *__pyx_9genexpr14__pyx_v_r = NULL; + PyObject *__pyx_9genexpr15__pyx_v_r = NULL; + PyObject *__pyx_9genexpr16__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -10134,7 +10561,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * 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[11])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __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[13])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_replace_params = __pyx_t_1; __pyx_t_1 = 0; @@ -10146,7 +10573,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * # 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[12])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __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[14])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_replace_params_split = __pyx_t_1; __pyx_t_1 = 0; @@ -10162,7 +10589,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __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, 50, __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, 50, __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[13])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __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[15])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __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; @@ -10174,56 +10601,56 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: + * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, MaxProdConstraint]]: # noqa: E501 */ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __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, 75, __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, 75, __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, 75, __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[14])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __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[16])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __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":241 + /* "constraint/parser.py":245 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __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, 241, __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, 241, __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, 241, __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[15])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __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, 245, __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, 245, __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, 245, __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[17])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __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":270 + /* "constraint/parser.py":274 * * # 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] */ - __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(NULL, __pyx_v_restrictions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __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, 274, __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, 270, __pyx_L1_error) + __pyx_t_1 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __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, 270, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "constraint/parser.py":272 + /* "constraint/parser.py":276 * if all(isinstance(r, str) for r in restrictions): * # clean the restriction strings to functional equivalence * restrictions_cleaned = [r.replace(' ', '') for r in restrictions] # <<<<<<<<<<<<<< @@ -10231,7 +10658,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * # 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, 272, __pyx_L6_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_v_restrictions; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; @@ -10239,36 +10666,36 @@ 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, 272, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 276, __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_4; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L6_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_r, __pyx_t_5); + __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_r, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr12__pyx_v_r, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L6_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr14__pyx_v_r, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __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, 272, __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, 276, __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, 272, __pyx_L6_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 276, __pyx_L6_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_r); __pyx_9genexpr12__pyx_v_r = 0; + __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_r); __pyx_9genexpr14__pyx_v_r = 0; goto __pyx_L10_exit_scope; __pyx_L6_error:; - __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_r); __pyx_9genexpr12__pyx_v_r = 0; + __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_r); __pyx_9genexpr14__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":273 + /* "constraint/parser.py":277 * # 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 # <<<<<<<<<<<<<< @@ -10282,16 +10709,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED 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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __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, 273, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __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":275 + /* "constraint/parser.py":279 * 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] # <<<<<<<<<<<<<< @@ -10299,7 +10726,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * */ { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L13_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __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; @@ -10307,33 +10734,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, 275, __pyx_L13_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 279, __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_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L13_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_r, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr15__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_9genexpr13__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L13_error) + __pyx_t_6 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyList_Type__index, __pyx_v_restrictions_cleaned, __pyx_9genexpr15__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 275, __pyx_L13_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 279, __pyx_L13_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_r); __pyx_9genexpr13__pyx_v_r = 0; + __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_r); __pyx_9genexpr15__pyx_v_r = 0; goto __pyx_L17_exit_scope; __pyx_L13_error:; - __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_r); __pyx_9genexpr13__pyx_v_r = 0; + __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_r); __pyx_9genexpr15__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":276 + /* "constraint/parser.py":280 * # 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] # <<<<<<<<<<<<<< @@ -10341,7 +10768,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, 276, __pyx_L20_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __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; @@ -10349,33 +10776,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, 276, __pyx_L20_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 280, __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_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L20_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_i, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr16__pyx_v_i, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_restrictions, __pyx_9genexpr14__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L20_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_restrictions, __pyx_9genexpr16__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 276, __pyx_L20_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 280, __pyx_L20_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_i); __pyx_9genexpr14__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_i); __pyx_9genexpr16__pyx_v_i = 0; goto __pyx_L24_exit_scope; __pyx_L20_error:; - __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_i); __pyx_9genexpr14__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_i); __pyx_9genexpr16__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":270 + /* "constraint/parser.py":274 * * # remove functionally duplicate restrictions (preserves order and whitespace) * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< @@ -10384,32 +10811,32 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":279 + /* "constraint/parser.py":283 * * # 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, 279, __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, 283, __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, 279, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_restrictions, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "constraint/parser.py":281 + /* "constraint/parser.py":285 * 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, 281, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_parsed_restrictions = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":282 + /* "constraint/parser.py":286 * # split into functions that only take their relevant parameters * parsed_restrictions = list() * for res in restrictions: # <<<<<<<<<<<<<< @@ -10418,7 +10845,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, 282, __pyx_L1_error) + __PYX_ERR(0, 286, __pyx_L1_error) } __pyx_t_2 = __pyx_v_restrictions; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; @@ -10426,32 +10853,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, 282, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 286, __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_4; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":283 + /* "constraint/parser.py":287 * 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, 283, __pyx_L1_error) + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __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":284 + /* "constraint/parser.py":288 * for res in restrictions: * params_used: set[str] = set() * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() # <<<<<<<<<<<<<< @@ -10459,9 +10886,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, 284, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 288, __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, 284, __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, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_7 = 1; @@ -10481,7 +10908,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __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_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, 284, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __pyx_t_5; @@ -10492,25 +10919,25 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __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_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, 284, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __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":285 + /* "constraint/parser.py":289 * 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, 285, __pyx_L1_error) + __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_v_params_used); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __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":286 + /* "constraint/parser.py":290 * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() * params_used_list = list(params_used) * finalized_constraint = None # <<<<<<<<<<<<<< @@ -10520,25 +10947,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":287 + /* "constraint/parser.py":291 * 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, 287, __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, 291, __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, 287, __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, 291, __pyx_L1_error) __pyx_t_3 = __pyx_t_11; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - /* "constraint/parser.py":289 + /* "constraint/parser.py":293 * if " or " not in res and " and " not in res: * # if applicable, strip the outermost round brackets * while ( # <<<<<<<<<<<<<< @@ -10547,16 +10974,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ while (1) { - /* "constraint/parser.py":290 + /* "constraint/parser.py":294 * # 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); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parsed_restriction, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __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, 290, __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, 294, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { } else { @@ -10564,16 +10991,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":291 + /* "constraint/parser.py":295 * 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); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parsed_restriction, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __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, 291, __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, 295, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { } else { @@ -10581,16 +11008,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":292 + /* "constraint/parser.py":296 * 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, 292, __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, 296, __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, 292, __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, 296, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { } else { @@ -10598,48 +11025,48 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":293 + /* "constraint/parser.py":297 * 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, 293, __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, 297, __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, 293, __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, 297, __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":295 + /* "constraint/parser.py":299 * 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, 295, __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, 299, __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":297 + /* "constraint/parser.py":301 * 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, 297, __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, 297, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_parsed_restriction))||((__pyx_v_parsed_restriction) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_parsed_restriction))) __PYX_ERR(0, 301, __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, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":298 + /* "constraint/parser.py":302 * # 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: # <<<<<<<<<<<<<< @@ -10649,20 +11076,20 @@ 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":300 + /* "constraint/parser.py":304 * 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, 300, __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, 300, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_parsed_restriction))||((__pyx_v_parsed_restriction) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_parsed_restriction))) __PYX_ERR(0, 304, __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, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":298 + /* "constraint/parser.py":302 * # 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: # <<<<<<<<<<<<<< @@ -10671,7 +11098,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":287 + /* "constraint/parser.py":291 * params_used_list = list(params_used) * finalized_constraint = None * if " or " not in res and " and " not in res: # <<<<<<<<<<<<<< @@ -10680,7 +11107,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":301 + /* "constraint/parser.py":305 * # 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: # <<<<<<<<<<<<<< @@ -10690,16 +11117,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":303 + /* "constraint/parser.py":307 * 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, 303, __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, 307, __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, 303, __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, 307, __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; @@ -10707,14 +11134,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, 303, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 307, __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":301 + /* "constraint/parser.py":305 * # 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: # <<<<<<<<<<<<<< @@ -10723,25 +11150,25 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":304 + /* "constraint/parser.py":308 * # 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, 304, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __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, 304, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_finalized_constraint) != (0)) __PYX_ERR(0, 308, __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, 304, __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, 304, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_params_used_list) != (0)) __PYX_ERR(0, 308, __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, 308, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/parser.py":282 + /* "constraint/parser.py":286 * # split into functions that only take their relevant parameters * parsed_restrictions = list() * for res in restrictions: # <<<<<<<<<<<<<< @@ -10751,7 +11178,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":306 + /* "constraint/parser.py":310 * parsed_restrictions.append((finalized_constraint, params_used_list)) * * return parsed_restrictions # <<<<<<<<<<<<<< @@ -10796,10 +11223,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_12generator9); - __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_r); - __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_r); - __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_i); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_12generator11); + __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_r); + __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_r); + __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_i); __Pyx_XDECREF(__pyx_v_restrictions); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); @@ -10807,7 +11234,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED return __pyx_r; } -/* "constraint/parser.py":308 +/* "constraint/parser.py":312 * return parsed_restrictions * * def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 # <<<<<<<<<<<<<< @@ -10857,41 +11284,41 @@ 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, 308, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 312, __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, 308, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 312, __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, 308, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 312, __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, 308, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 312, __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, 308, __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, 312, __pyx_L3_error) 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, 308, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("compile_to_constraints", 0, 2, 3, i); __PYX_ERR(0, 312, __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, 308, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 312, __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, 308, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 312, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 308, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 312, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -10903,7 +11330,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, 308, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compile_to_constraints", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 312, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10914,8 +11341,8 @@ 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, 308, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 308, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 312, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 312, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_2compile_to_constraints(__pyx_self, __pyx_v_constraints, __pyx_v_domains, __pyx_v_picklable); /* function exit code */ @@ -10964,7 +11391,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compile_to_constraints", 0); - /* "constraint/parser.py":319 + /* "constraint/parser.py":323 * 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 * parsed_restrictions = parse_restrictions(constraints, domains) # <<<<<<<<<<<<<< @@ -10972,7 +11399,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * 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, 319, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_parse_restrictions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -10991,25 +11418,25 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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_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, 319, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_parsed_restrictions = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":320 + /* "constraint/parser.py":324 * """ # noqa: E501 * parsed_restrictions = parse_restrictions(constraints, domains) * compiled_constraints: list[tuple[Constraint, list[str], Union[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, 320, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_compiled_constraints = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":321 + /* "constraint/parser.py":325 * parsed_restrictions = parse_restrictions(constraints, domains) * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: # <<<<<<<<<<<<<< @@ -11021,9 +11448,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, 321, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parsed_restrictions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __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, 321, __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, 325, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { @@ -11031,7 +11458,7 @@ 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, 321, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 325, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -11041,7 +11468,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN { 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, 321, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 325, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -11052,13 +11479,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __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, 321, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 325, __pyx_L1_error) PyErr_Clear(); } break; @@ -11071,7 +11498,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, 321, __pyx_L1_error) + __PYX_ERR(0, 325, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -11081,22 +11508,22 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __Pyx_INCREF(__pyx_t_7); } else { __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 321, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __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, 321, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __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, 321, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 325, __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); @@ -11104,7 +11531,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, 321, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 325, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -11112,7 +11539,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, 321, __pyx_L1_error) + __PYX_ERR(0, 325, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_restriction, __pyx_t_2); @@ -11120,7 +11547,7 @@ 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":322 + /* "constraint/parser.py":326 * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: * if isinstance(restriction, str): # <<<<<<<<<<<<<< @@ -11130,17 +11557,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":324 + /* "constraint/parser.py":328 * 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, 324, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_picklable); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 328, __pyx_L1_error) if (__pyx_t_10) { - /* "constraint/parser.py":325 + /* "constraint/parser.py":329 * # if it's a string, wrap it in a (compilable or compiled) function constraint * if picklable: * constraint = CompilableFunctionConstraint(restriction) # <<<<<<<<<<<<<< @@ -11148,7 +11575,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, 325, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -11167,13 +11594,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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_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, 325, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":324 + /* "constraint/parser.py":328 * if isinstance(restriction, str): * # if it's a string, wrap it in a (compilable or compiled) function constraint * if picklable: # <<<<<<<<<<<<<< @@ -11183,7 +11610,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L8; } - /* "constraint/parser.py":327 + /* "constraint/parser.py":331 * constraint = CompilableFunctionConstraint(restriction) * else: * code_object = compile(restriction, "", "exec") # <<<<<<<<<<<<<< @@ -11200,13 +11627,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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_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, 327, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __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":328 + /* "constraint/parser.py":332 * else: * code_object = compile(restriction, "", "exec") * func = FunctionType(code_object.co_consts[0], globals()) # <<<<<<<<<<<<<< @@ -11214,14 +11641,14 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * 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, 328, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __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, 328, __pyx_L1_error) + __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, 332, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 332, __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, 328, __pyx_L1_error) + __pyx_t_8 = __Pyx_Globals(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -11242,13 +11669,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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, 328, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":329 + /* "constraint/parser.py":333 * code_object = compile(restriction, "", "exec") * func = FunctionType(code_object.co_consts[0], globals()) * constraint = FunctionConstraint(func) # <<<<<<<<<<<<<< @@ -11256,7 +11683,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * 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, 329, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -11275,7 +11702,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_3); @@ -11283,28 +11710,28 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN } __pyx_L8:; - /* "constraint/parser.py":330 + /* "constraint/parser.py":334 * 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, 330, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __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, 330, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 334, __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, 330, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_params_used) != (0)) __PYX_ERR(0, 334, __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, 330, __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, 330, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_restriction) != (0)) __PYX_ERR(0, 334, __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, 334, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":322 + /* "constraint/parser.py":326 * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: * if isinstance(restriction, str): # <<<<<<<<<<<<<< @@ -11314,41 +11741,41 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L7; } - /* "constraint/parser.py":331 + /* "constraint/parser.py":335 * 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, 331, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 335, __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, 331, __pyx_L1_error) + __pyx_t_10 = PyObject_IsInstance(__pyx_v_restriction, __pyx_t_3); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(__pyx_t_10)) { - /* "constraint/parser.py":333 + /* "constraint/parser.py":337 * 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, 333, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __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, 333, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_restriction) != (0)) __PYX_ERR(0, 337, __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, 333, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_params_used) != (0)) __PYX_ERR(0, 337, __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, 333, __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, 333, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None) != (0)) __PYX_ERR(0, 337, __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, 337, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":331 + /* "constraint/parser.py":335 * constraint = FunctionConstraint(func) * compiled_constraints.append((constraint, params_used, restriction)) * elif isinstance(restriction, Constraint): # <<<<<<<<<<<<<< @@ -11358,7 +11785,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L7; } - /* "constraint/parser.py":335 + /* "constraint/parser.py":339 * compiled_constraints.append((restriction, params_used, None)) * else: * raise ValueError(f"Restriction {restriction} is neither a string or Constraint {type(restriction)}") # <<<<<<<<<<<<<< @@ -11369,16 +11796,16 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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, 335, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_restriction, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 339, __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, 335, __pyx_L1_error) + __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, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_Restriction; __pyx_t_13[1] = __pyx_t_11; __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, 335, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -11389,16 +11816,16 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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, 335, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 339, __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, 335, __pyx_L1_error) + __PYX_ERR(0, 339, __pyx_L1_error) } __pyx_L7:; - /* "constraint/parser.py":321 + /* "constraint/parser.py":325 * parsed_restrictions = parse_restrictions(constraints, domains) * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: # <<<<<<<<<<<<<< @@ -11408,7 +11835,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":338 + /* "constraint/parser.py":342 * * # return the restrictions and used parameters * return compiled_constraints # <<<<<<<<<<<<<< @@ -11418,7 +11845,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __pyx_r = __pyx_v_compiled_constraints; goto __pyx_L0; - /* "constraint/parser.py":308 + /* "constraint/parser.py":312 * return parsed_restrictions * * def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 # <<<<<<<<<<<<<< @@ -11449,18 +11876,400 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* #### Code section: module_exttypes ### */ +/* #### 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; +} + +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; + } + } + #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_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 + #endif + { + #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); + } + #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|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*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 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|Py_TPFLAGS_HAVE_FINALIZE, /*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*/ + 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__parse_restrictions, /*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 PY_VERSION_HEX >= 0x030800b1 && (!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_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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint)); + (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; +} + +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_v_left); + Py_CLEAR(p->__pyx_v_operator); + Py_CLEAR(p->__pyx_v_params); + Py_CLEAR(p->__pyx_v_right); + Py_CLEAR(p->__pyx_v_supported_operators); + 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)))) { + __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 + { + #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); + } + #endif + } +} + +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint(PyObject *o, visitproc v, void *a) { + int e; + 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; + { + 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_v_left) { + e = (*v)(p->__pyx_v_left, a); if (e) return e; + } + if (p->__pyx_v_operator) { + e = (*v)(p->__pyx_v_operator, a); if (e) return e; + } + if (p->__pyx_v_params) { + e = (*v)(p->__pyx_v_params, a); if (e) return e; + } + if (p->__pyx_v_right) { + e = (*v)(p->__pyx_v_right, a); if (e) return e; + } + if (p->__pyx_v_supported_operators) { + e = (*v)(p->__pyx_v_supported_operators, a); if (e) return e; + } + if (p->__pyx_v_variable_supported_operators) { + e = (*v)(p->__pyx_v_variable_supported_operators, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint(PyObject *o) { + PyObject* tmp; + 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; + 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); + tmp = ((PyObject*)p->__pyx_v_left); + p->__pyx_v_left = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_operator); + p->__pyx_v_operator = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_params); + p->__pyx_v_params = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_right); + p->__pyx_v_right = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_supported_operators); + p->__pyx_v_supported_operators = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_variable_supported_operators); + p->__pyx_v_variable_supported_operators = ((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_1_to_numeric_constraint_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint_spec = { + "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, + __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint_slots, +}; +#else -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct__parse_restrictions(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.parser.""__pyx_scope_struct_1_to_numeric_constraint", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*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*/ + 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_1_to_numeric_constraint, /*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 PY_VERSION_HEX >= 0x030800b1 && (!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_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__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)); + 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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -11473,22 +12282,23 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct__parse_res 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct__parse_restrictions) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_genexpr) { 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_tune_params); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_genexpr_arg_0); + 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__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); + 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)))) { + __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 { @@ -11503,56 +12313,49 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct__parse_rest } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct__parse_restrictions(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_2_genexpr(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; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *)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_outer_scope) { + e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } - if (p->__pyx_v_tune_params) { - e = (*v)(p->__pyx_v_tune_params, 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_genexpr) { + e = (*v)(p->__pyx_v_genexpr, a); if (e) return e; + } + if (p->__pyx_v_p) { + e = (*v)(p->__pyx_v_p, 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}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_2_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr}, {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), +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr_spec = { + "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, - __pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr = { 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*/ + "constraint.parser.""__pyx_scope_struct_2_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct__parse_restrictions, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -11574,8 +12377,8 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct__parse_re 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*/ 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*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_2_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -11592,7 +12395,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct__parse_re #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct__parse_restrictions, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -11625,16 +12428,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct__parse_re }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_1_to_numeric_constraint > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, 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_3_genexpr > 0) & (int)(t->tp_basicsize == 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -11647,120 +12450,72 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numer 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_3_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_left); - Py_CLEAR(p->__pyx_v_operator); - Py_CLEAR(p->__pyx_v_params); - Py_CLEAR(p->__pyx_v_right); - Py_CLEAR(p->__pyx_v_supported_operators); - Py_CLEAR(p->__pyx_v_variable_supported_operators); + 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_1_to_numeric_constraint < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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); + 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)))) { + __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 { #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); - } - #endif - } -} - -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint(PyObject *o, visitproc v, void *a) { - int e; - 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; - { - 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_v_left) { - e = (*v)(p->__pyx_v_left, a); if (e) return e; - } - if (p->__pyx_v_operator) { - e = (*v)(p->__pyx_v_operator, a); if (e) return e; - } - if (p->__pyx_v_params) { - e = (*v)(p->__pyx_v_params, a); if (e) return e; - } - if (p->__pyx_v_right) { - e = (*v)(p->__pyx_v_right, a); if (e) return e; - } - if (p->__pyx_v_supported_operators) { - e = (*v)(p->__pyx_v_supported_operators, a); if (e) return e; - } - if (p->__pyx_v_variable_supported_operators) { - e = (*v)(p->__pyx_v_variable_supported_operators, a); if (e) return e; + { + freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + if (tp_free) tp_free(o); + } + #endif } - return 0; } -static int __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint(PyObject *o) { - PyObject* tmp; - 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; - 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); - tmp = ((PyObject*)p->__pyx_v_left); - p->__pyx_v_left = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_operator); - p->__pyx_v_operator = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_params); - p->__pyx_v_params = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_right); - p->__pyx_v_right = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_supported_operators); - p->__pyx_v_supported_operators = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_variable_supported_operators); - p->__pyx_v_variable_supported_operators = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_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_v) { + e = (*v)(p->__pyx_v_v, a); if (e) return e; + } return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint}, - {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_3_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_3_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_3_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint_spec = { - "constraint.parser.__pyx_scope_struct_1_to_numeric_constraint", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint), +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr_spec = { + "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, - __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_1_to_numeric_constraint", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint), /*tp_basicsize*/ + "constraint.parser.""__pyx_scope_struct_3_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_3_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -11782,8 +12537,8 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_nume 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*/ 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*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_3_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -11800,7 +12555,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_nume #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_3_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -11833,16 +12588,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_nume }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_2_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr)); + 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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -11855,11 +12610,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr( 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -11870,8 +12625,8 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_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_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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); + 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)))) { + __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 { @@ -11886,9 +12641,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_genexpr(P } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *)o; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -11905,27 +12660,27 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_2_genexpr(P return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_2_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_4_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr_spec = { - "constraint.parser.__pyx_scope_struct_2_genexpr", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr), +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_spec = { + "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, - __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_2_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr), /*tp_basicsize*/ + "constraint.parser.""__pyx_scope_struct_4_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -11947,7 +12702,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_2_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_4_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -11965,7 +12720,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -11998,16 +12753,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_3_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr)); + 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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -12020,11 +12775,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_3_genexpr( 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_3_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -12034,8 +12789,8 @@ 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_s); #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)))) { - __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); + 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)))) { + __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 { @@ -12050,9 +12805,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_3_genexpr(P } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *)o; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -12069,27 +12824,27 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_3_genexpr(P return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_3_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_3_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_3_genexpr}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr_spec = { - "constraint.parser.__pyx_scope_struct_3_genexpr", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr), +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr_spec = { + "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, - __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_3_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ + "constraint.parser.""__pyx_scope_struct_5_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_3_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -12111,7 +12866,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_3_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -12129,7 +12884,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_3_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -12162,16 +12917,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_4_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr)); + 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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -12184,11 +12939,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr( 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -12198,8 +12953,8 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_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_4_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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); + 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)))) { + __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 { @@ -12214,9 +12969,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr(P } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *)o; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -12233,27 +12988,27 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_4_genexpr(P return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_4_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_spec = { - "constraint.parser.__pyx_scope_struct_4_genexpr", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr), +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr_spec = { + "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, - __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_4_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr), /*tp_basicsize*/ + "constraint.parser.""__pyx_scope_struct_6_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -12275,7 +13030,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_4_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -12293,7 +13048,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -12326,16 +13081,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_5_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr)); + 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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -12348,11 +13103,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_genexpr( 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_7_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -12363,8 +13118,8 @@ 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)))) { - __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); + 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)))) { + __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 { @@ -12379,9 +13134,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr(P } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_7_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr *)o; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -12398,27 +13153,27 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_genexpr(P return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_genexpr}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_7_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_7_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr}, {0, 0}, -}; -static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr_spec = { - "constraint.parser.__pyx_scope_struct_5_genexpr", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr), +}; +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr_spec = { + "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, - __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_5_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr), /*tp_basicsize*/ + "constraint.parser.""__pyx_scope_struct_7_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_7_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -12440,7 +13195,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_7_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -12458,7 +13213,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -12491,16 +13246,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_6_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr)); + 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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -12513,11 +13268,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr( 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_8_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -12527,8 +13282,8 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_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_6_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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); + 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)))) { + __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 { @@ -12543,9 +13298,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_genexpr(P } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_8_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *)o; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -12562,27 +13317,27 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_genexpr(P return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_8_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_8_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_8_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr_spec = { - "constraint.parser.__pyx_scope_struct_6_genexpr", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr), +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr_spec = { + "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, - __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_6_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr), /*tp_basicsize*/ + "constraint.parser.""__pyx_scope_struct_8_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_8_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -12604,7 +13359,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_8_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -12622,7 +13377,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_8_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -12655,16 +13410,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_7_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr)); + 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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -12677,11 +13432,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr( 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_7_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_9_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -12691,8 +13446,8 @@ 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)))) { - __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); + 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)))) { + __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 { @@ -12707,9 +13462,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_7_genexpr(P } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_7_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_9_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *)o; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -12726,27 +13481,27 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_7_genexpr(P return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_7_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_7_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_9_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_9_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_9_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr_spec = { - "constraint.parser.__pyx_scope_struct_7_genexpr", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr), +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr_spec = { + "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, - __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_7_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr), /*tp_basicsize*/ + "constraint.parser.""__pyx_scope_struct_9_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_7_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_9_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -12768,7 +13523,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_7_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_9_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -12786,7 +13541,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_9_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -12819,16 +13574,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_8_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_8_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr)); + 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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -12841,11 +13596,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_8_genexpr( 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_8_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -12855,8 +13610,8 @@ 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_o); #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)))) { - __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); + 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)))) { + __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 { @@ -12871,9 +13626,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_8_genexpr(P } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_8_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_10_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *)o; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -12890,27 +13645,27 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_8_genexpr(P return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_8_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_8_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_8_genexpr}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_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_8_genexpr_spec = { - "constraint.parser.__pyx_scope_struct_8_genexpr", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_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|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_8_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr), /*tp_basicsize*/ + "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_8_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -12932,7 +13687,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_8_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_10_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -12950,7 +13705,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_8_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_10_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -12983,16 +13738,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_9_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_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)))) { - 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_11_genexpr > 0) & (int)(t->tp_basicsize == 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -13005,11 +13760,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_9_genexpr( 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; +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((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_9_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -13019,8 +13774,8 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_9_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_9_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_11_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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 { @@ -13035,9 +13790,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_9_genexpr(P } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_9_genexpr(PyObject *o, visitproc v, void *a) { +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_9_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr *)o; + 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; @@ -13054,27 +13809,27 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_9_genexpr(P return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_9_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_9_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_9_genexpr}, +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_9_genexpr_spec = { - "constraint.parser.__pyx_scope_struct_9_genexpr", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr), +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_9_genexpr_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_9_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_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_9_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -13096,7 +13851,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_9_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_11_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -13114,7 +13869,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_9_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*/ @@ -13147,16 +13902,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_10_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_10_to_equality_constraint > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint > 0) & (int)(t->tp_basicsize == 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -13169,11 +13924,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_10_to_equa return o; } -static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint(PyObject *o) { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_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_10_to_equality_constraint) { + 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; } } @@ -13182,8 +13937,8 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_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_10_to_equality_constraint < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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 { @@ -13198,9 +13953,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_to_equal } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_10_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_10_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_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; @@ -13214,9 +13969,9 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_10_to_equal return 0; } -static int __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_10_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_10_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_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); @@ -13226,28 +13981,28 @@ static int __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_10_to_equality return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint}, - {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_10_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_10_to_equality_constraint_spec = { - "constraint.parser.__pyx_scope_struct_10_to_equality_constraint", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_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_10_to_equality_constraint_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_10_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_10_to_equality_constraint", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_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_10_to_equality_constraint, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -13269,8 +14024,8 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_10_to_equ 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint, /*tp_traverse*/ - __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_10_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*/ @@ -13287,7 +14042,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_10_to_equ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_10_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*/ @@ -13320,16 +14075,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_10_to_equ }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_11_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_11_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -13342,11 +14097,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_11_genexpr 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; +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_11_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_13_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -13356,8 +14111,8 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_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_11_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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); + 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); } else #endif { @@ -13372,9 +14127,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_genexpr( } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_11_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_11_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_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; @@ -13391,27 +14146,27 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_11_genexpr( 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}, +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_11_genexpr_spec = { - "constraint.parser.__pyx_scope_struct_11_genexpr", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_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_11_genexpr_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_11_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_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_11_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_13_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -13433,7 +14188,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexp 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_11_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_13_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -13451,7 +14206,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexp #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_11_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*/ @@ -13484,16 +14239,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexp }; #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_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_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_14_genexpr > 0) & (int)(t->tp_basicsize == 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -13506,11 +14261,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_12_genexpr 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_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_12_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_14_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -13519,8 +14274,8 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_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_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 (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_14_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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 { @@ -13535,9 +14290,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_genexpr( } } -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_14_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_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; @@ -13551,27 +14306,27 @@ 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_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_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_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_12_genexpr_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_14_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_12_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_14_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_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_12_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_14_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -13593,7 +14348,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_12_genexp 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_12_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_14_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -13611,7 +14366,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_14_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -13730,15 +14485,15 @@ 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, 87, __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, 87, __pyx_L1_error) + __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, 80, __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, 80, __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, 87, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 80, __pyx_L1_error) #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)) { @@ -13746,15 +14501,15 @@ 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, 91, __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, 91, __pyx_L1_error) + __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, 80, __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, 80, __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, 91, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 80, __pyx_L1_error) #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)) { @@ -13762,15 +14517,15 @@ 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, 92, __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, 92, __pyx_L1_error) + __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, 91, __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, 91, __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, 92, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 91, __pyx_L1_error) #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)) { @@ -13778,15 +14533,15 @@ 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, 130, __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, 130, __pyx_L1_error) + __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, 95, __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, 95, __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, 130, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 95, __pyx_L1_error) #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)) { @@ -13794,15 +14549,15 @@ 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, 151, __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, 151, __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, 96, __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, 96, __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, 151, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 96, __pyx_L1_error) #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)) { @@ -13810,15 +14565,15 @@ 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, 153, __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, 153, __pyx_L1_error) + __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, 134, __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, 134, __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, 153, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 134, __pyx_L1_error) #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)) { @@ -13826,15 +14581,15 @@ 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, 211, __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, 211, __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, 155, __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, 155, __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, 211, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(0, 155, __pyx_L1_error) #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)) { @@ -13842,15 +14597,15 @@ 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, 218, __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, 218, __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, 157, __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, 157, __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, 218, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr) < 0) __PYX_ERR(0, 157, __pyx_L1_error) #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)) { @@ -13858,31 +14613,31 @@ 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_to_equality_constraint = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint)) __PYX_ERR(0, 241, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint) < 0) __PYX_ERR(0, 241, __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, 215, __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, 215, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint = &__pyx_type_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint; + __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_to_equality_constraint) < 0) __PYX_ERR(0, 241, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr) < 0) __PYX_ERR(0, 215, __pyx_L1_error) #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_to_equality_constraint->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_to_equality_constraint->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_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_10_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __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, 260, __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, 260, __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, 222, __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, 222, __pyx_L1_error) #else __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_genexpr) < 0) __PYX_ERR(0, 260, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr) < 0) __PYX_ERR(0, 222, __pyx_L1_error) #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_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -13890,19 +14645,51 @@ 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_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, 270, __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, 270, __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, 245, __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, 245, __pyx_L1_error) + #else + __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_to_equality_constraint) < 0) __PYX_ERR(0, 245, __pyx_L1_error) + #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_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, 264, __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, 264, __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, 264, __pyx_L1_error) + #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, 274, __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, 274, __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_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_12_genexpr) < 0) __PYX_ERR(0, 270, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_14_genexpr) < 0) __PYX_ERR(0, 274, __pyx_L1_error) #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_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(); @@ -14360,31 +15147,31 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); 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, 27, __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, 27, __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, 27, __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[16])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __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[18])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __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, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":308 + /* "constraint/parser.py":312 * return parsed_restrictions * * 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, 308, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __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, 308, __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, 308, __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, 308, __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[17])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) + 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, 312, __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, 312, __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, 312, __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[19])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __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); __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, 308, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_compile_to_constraints, __pyx_t_3) < 0) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/parser.py":1 @@ -14433,11 +15220,11 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); typedef struct { const char *s; -#if 179 <= 65535 +#if 210 <= 65535 const unsigned short n; -#elif 179 / 2 < INT_MAX +#elif 210 / 2 < INT_MAX const unsigned int n; -#elif 179 / 2 < LONG_MAX +#elif 210 / 2 < LONG_MAX const unsigned long n; #else const Py_ssize_t n; @@ -14576,6 +15363,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_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 */ @@ -14591,6 +15379,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -14643,6 +15432,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_supported_operators, sizeof(__pyx_k_variable_supported_operators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_supported_operators */ {__pyx_k_variables, sizeof(__pyx_k_variables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variables */ @@ -14657,10 +15447,10 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, c 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, 66, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 207, __pyx_L1_error) - __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_eval); if (!__pyx_builtin_eval) __PYX_ERR(0, 136, __pyx_L1_error) - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 137, __pyx_L1_error) - __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_compile); if (!__pyx_builtin_compile) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_eval); if (!__pyx_builtin_eval) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_compile); if (!__pyx_builtin_compile) __PYX_ERR(0, 331, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -14672,83 +15462,83 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "constraint/parser.py":110 + /* "constraint/parser.py":114 * # e.g. "G == B-M" becomes "G+M == B" * right_remainder = right[len(swapped_side_first_variable):] * left_swap = right_remainder.replace("-", "+") # <<<<<<<<<<<<<< * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" * 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, 110, __pyx_L1_error) + __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, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); - /* "constraint/parser.py":121 + /* "constraint/parser.py":125 * # e.g. "G == B/M" becomes "G*M == B" * right_remainder = right[len(swapped_side_first_variable):] * left_swap = right_remainder.replace("/", "*") # <<<<<<<<<<<<<< * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" * 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, 121, __pyx_L1_error) + __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, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); - /* "constraint/parser.py":157 + /* "constraint/parser.py":161 * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": * 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) */ - __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, 157, __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, 161, __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, 157, __pyx_L1_error) + __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, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[1]); - /* "constraint/parser.py":272 + /* "constraint/parser.py":276 * 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 * # 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, 272, __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, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); - /* "constraint/parser.py":293 + /* "constraint/parser.py":297 * 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, 293, __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, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[2]); - /* "constraint/parser.py":295 + /* "constraint/parser.py":299 * 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, 295, __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, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[3]); - /* "constraint/parser.py":308 + /* "constraint/parser.py":312 * return parsed_restrictions * * 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_mstate_global->__pyx_tuple[3] = PyTuple_Pack(1, ((PyObject*)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 308, __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, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_RefNannyFinishContext(); @@ -14801,94 +15591,104 @@ 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), 87, 2}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; - __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_1, 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), 80, 2}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 80, 2}; + 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; } { const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 91, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; - __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_1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) 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_k_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), 95, 2}; + 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_1_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, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 92, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 96, 2}; 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_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; + __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_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), 130, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 134, 2}; 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[5] = __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[5])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 151, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 155, 2}; 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__25, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) 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_k__25, 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), 153, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 157, 2}; 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_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) 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_k_A_2, 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), 211, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 215, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_o}; - __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, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) 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_k_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), 218, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 222, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; - __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__26, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) 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_k__26, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 133, 45}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 137, 45}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s, __pyx_mstate->__pyx_n_u_number}; - __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_is_or_evals_to_number, __pyx_k_XQ_Qa_z_5_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) 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_is_or_evals_to_number, __pyx_k_XQ_Qa_z_5_q_q, 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), 260, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 264, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; - __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_k__26, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) 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_k__26, 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), 270, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 274, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_r}; - __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_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) 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_genexpr, __pyx_k_Q_2, 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), 32, 50}; 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[11] = __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[11])) 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, __pyx_k_A_l_4s_Cq_2V2Q_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, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 40, 50}; 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_split, __pyx_k_A_l_4s_Cq_t1A_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) 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_replace_params_split, __pyx_k_A_l_4s_Cq_t1A_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 50, 251}; 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[13] = __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[13])) goto bad; + __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_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[15])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 39, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 75, 1558}; - 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_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_variable, __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_number, __pyx_mstate->__pyx_n_u_number_is_int, __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_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_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_to_numeric_constraint, __pyx_k_A_avV6_a_Bhas_q_a_3a_Q_1_aq_he81, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 40, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 75, 1584}; + 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_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_variable, __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_number, __pyx_mstate->__pyx_n_u_number_is_int, __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_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_global->__pyx_codeobj_tab[16] = __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[16])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 241, 222}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 245, 222}; 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[15] = __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[15])) 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_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[17])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 27, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 27, 386}; 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_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[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_parse_restrictions, __pyx_k_Ya_1_Q2_U_H_U_6_Q_q_t4uA_d_4y_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) 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_parse_restrictions, __pyx_k_Ya_1_Q2_U_P_U_6_Q_q_t4uA_d_4y_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 308, 177}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 312, 177}; 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[17] = __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[17])) goto bad; + __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_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[19])) goto bad; } Py_DECREF(tuple_dedup_map); return 0; @@ -17131,6 +17931,25 @@ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { PyErr_SetObject(PyExc_RuntimeError, new_exc); } +/* DictGetItem */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error + if (unlikely(PyTuple_Check(key))) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) { + PyErr_SetObject(PyExc_KeyError, args); + Py_DECREF(args); + } + } else { + PyErr_SetObject(PyExc_KeyError, key); + } + } + return value; +} +#endif + /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, diff --git a/constraint/parser.py b/constraint/parser.py index e1a56e7..d7db645 100644 --- a/constraint/parser.py +++ b/constraint/parser.py @@ -74,8 +74,12 @@ def to_multiple_restrictions(restrictions: list[str]) -> list[str]: def to_numeric_constraint( restriction: str, params: list[str] - ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: + ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, MaxProdConstraint]]: # 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): + return None + comparators = ["<=", "==", ">=", ">", "<"] comparators_found = re.findall("|".join(comparators), restriction) # check if there is exactly one comparator, if not, return None From e4d1bbae2ff6409996ab6524cd973667b35ccf6f Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Sun, 8 Jun 2025 16:06:44 +0200 Subject: [PATCH 25/87] Implemented the VariableExactProdConstraint, added it to the parser, improved typing for other constraints --- constraint/constraints.c | 17877 +++++++++++++++++++++++------------- constraint/constraints.py | 110 +- constraint/parser.c | 3384 +++---- constraint/parser.py | 8 +- 4 files changed, 13245 insertions(+), 8134 deletions(-) diff --git a/constraint/constraints.c b/constraint/constraints.c index 6a908a9..c716952 100644 --- a/constraint/constraints.c +++ b/constraint/constraints.c @@ -1507,9 +1507,13 @@ 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_10_genexpr; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr; -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_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_genexpr; -/* "constraint/constraints.py":63 +/* "constraint/constraints.py":64 * vconstraints[variable].remove((self, variables)) * * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): # <<<<<<<<<<<<<< @@ -1522,7 +1526,7 @@ struct __pyx_defaults { }; -/* "constraint/constraints.py":392 +/* "constraint/constraints.py":393 * 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." # <<<<<<<<<<<<<< @@ -1536,7 +1540,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr { }; -/* "constraint/constraints.py":395 +/* "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 # <<<<<<<<<<<<<< @@ -1550,7 +1554,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess { }; -/* "constraint/constraints.py":409 +/* "constraint/constraints.py":410 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -1568,7 +1572,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr { }; -/* "constraint/constraints.py":410 +/* "constraint/constraints.py":411 * 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) # <<<<<<<<<<<<<< @@ -1586,7 +1590,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr { }; -/* "constraint/constraints.py":539 +/* "constraint/constraints.py":540 * 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." # <<<<<<<<<<<<<< @@ -1600,7 +1604,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr { }; -/* "constraint/constraints.py":542 +/* "constraint/constraints.py":543 * 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 # <<<<<<<<<<<<<< @@ -1614,7 +1618,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess { }; -/* "constraint/constraints.py":550 +/* "constraint/constraints.py":551 * for var in self.sum_vars: * domain = domains[var] * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -1632,7 +1636,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr { }; -/* "constraint/constraints.py":613 +/* "constraint/constraints.py":614 * variable_with_negative = None * for variable in variables: * contains_negative = any(value < 0 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -1646,7 +1650,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr { }; -/* "constraint/constraints.py":709 +/* "constraint/constraints.py":710 * 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." # <<<<<<<<<<<<<< @@ -1660,7 +1664,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr { }; -/* "constraint/constraints.py":712 +/* "constraint/constraints.py":713 * 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 # <<<<<<<<<<<<<< @@ -1674,7 +1678,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess { }; -/* "constraint/constraints.py":720 +/* "constraint/constraints.py":721 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -1692,7 +1696,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr { }; -/* "constraint/constraints.py":779 +/* "constraint/constraints.py":780 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -1706,14 +1710,77 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr { }; -/* "constraint/constraints.py":856 +/* "constraint/constraints.py":888 + * 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 +*/ +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":911 + * 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) # <<<<<<<<<<<<<< + * possible_max = max(assigned_product * c for c in candidates) + * +*/ +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_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; + PyObject *__pyx_t_0; + Py_ssize_t __pyx_t_1; +}; + + +/* "constraint/constraints.py":912 + * 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: +*/ +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_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; + PyObject *__pyx_t_0; + Py_ssize_t __pyx_t_1; +}; + + +/* "constraint/constraints.py":926 + * 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":960 * 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_12_genexpr { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_value; @@ -2310,6 +2377,52 @@ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /* PyLongCompare.proto */ static CYTHON_INLINE int __Pyx_PyLong_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + L->ob_item[len] = x; + #else + PyList_SET_ITEM(list, len, x); + #endif + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* PyObjectVectorCallKwBuilder.proto */ +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 +#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall +#endif +#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n) +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict +#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n) +#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value) +#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value) +#endif + +/* PyObjectVectorCallMethodKwBuilder.proto */ +#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000 +#define __Pyx_Object_VectorcallMethod_CallFromBuilder PyObject_VectorcallMethod +#else +static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames); +#endif + /* 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 @@ -2521,24 +2634,6 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #define __Pyx_HAS_GCC_DIAGNOSTIC #endif -/* PyObjectVectorCallKwBuilder.proto */ -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 -#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall -#else -#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall -#endif -#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n) -static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); -static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n); -#else -#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict -#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n) -#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value) -#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value) -#endif - /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value); @@ -2783,15 +2878,23 @@ 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_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"; @@ -2829,16 +2932,22 @@ static const char __pyx_k_set_2[] = "_set"; 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"; @@ -2849,6 +2958,7 @@ 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_Callable[] = "Callable"; static const char __pyx_k_Optional[] = "Optional"; @@ -2859,53 +2969,75 @@ 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_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_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_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_vconstraints[] = "vconstraints"; 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_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_Constraint___call[] = "Constraint.__call__"; static const char __pyx_k_MaxProdConstraint[] = "MaxProdConstraint"; static const char __pyx_k_MinProdConstraint[] = "MinProdConstraint"; @@ -2919,6 +3051,7 @@ 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"; @@ -2948,9 +3081,9 @@ static const char __pyx_k_ExactSumConstraint___call[] = "ExactSumConstraint.__ca 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_M_N_L_A_1_3a_Cs_Rs_J_b_3c[] = "\320\004#\240?\260*\270M\310\021\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_NotInSetConstraint___call[] = "NotInSetConstraint.__call__"; static const char __pyx_k_NotInSetConstraint___init[] = "NotInSetConstraint.__init__"; +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__"; @@ -2962,6 +3095,7 @@ static const char __pyx_k_variable_contains_negative[] = "variable_contains_nega 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"; @@ -2978,6 +3112,7 @@ static const char __pyx_k_55H_a_d_Q_a_1_1Kq_9Cq_az_1_z_q[] = "\320\004\"\320\"5\ 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_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"; @@ -2987,6 +3122,7 @@ static const char __pyx_k_77JJeef_QfKy_Q_6Q_L_7_gQa_q_d_Q[] = "\320\004$\320$7\3 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."; @@ -2994,6 +3130,7 @@ static const char __pyx_k_VariableMaxSumConstraint___call[] = "VariableMaxSumCon static const char __pyx_k_VariableMaxSumConstraint___init[] = "VariableMaxSumConstraint.__init__..genexpr"; 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_3avS_Qb_E_4q_3a_Qb[] = "\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\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"; @@ -3002,6 +3139,7 @@ static const char __pyx_k_CompilableFunctionConstraint___c[] = "CompilableFuncti 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 "; @@ -3011,6 +3149,11 @@ static const char __pyx_k_MaxSumConstraint_preProcess_loca[] = "MaxSumConstraint 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"; @@ -3031,6 +3174,7 @@ static const char __pyx_k_Constraint_enforcing_that_values_6[] = "Constraint enf static const char __pyx_k_Constraint_enforcing_that_values_7[] = "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_8[] = "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_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_VariableMaxSumConstraint_preProc_2[] = "VariableMaxSumConstraint.preProcess"; @@ -3080,6 +3224,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint___ini 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_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 */ +static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_4_safe_product(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_values); /* proto */ +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_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 */ @@ -3110,7 +3262,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_8_ge 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_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_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_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ /* SmallCodeConfig */ @@ -3162,7 +3318,11 @@ typedef struct { PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_9_preProcess; 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_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_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; @@ -3176,14 +3336,18 @@ typedef struct { PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_preProcess; 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_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_genexpr; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; __Pyx_CachedCFunction __pyx_umethod_PyList_Type__remove; PyObject *__pyx_slice[1]; - PyObject *__pyx_tuple[4]; - PyObject *__pyx_codeobj_tab[55]; - PyObject *__pyx_string_tab[217]; + PyObject *__pyx_tuple[5]; + PyObject *__pyx_codeobj_tab[63]; + PyObject *__pyx_string_tab[259]; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_10; @@ -3250,8 +3414,28 @@ int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_11_genexpr; #endif #if CYTHON_USE_FREELISTS -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_12_genexpr[8]; -int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_12_genexpr; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_12___call__[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_12___call__; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_13_genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_13_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_14_genexpr[8]; +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; +#endif + +#if CYTHON_USE_FREELISTS +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 /* CachedMethodType.module_state_decls */ #if CYTHON_COMPILING_IN_LIMITED_API @@ -3308,206 +3492,248 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_su __pyx_string_tab[17] -#define __pyx_kp_u_Constraint_enforcing_that_the_su_2 __pyx_string_tab[18] -#define __pyx_kp_u_Constraint_enforcing_that_the_su_3 __pyx_string_tab[19] -#define __pyx_kp_u_Constraint_enforcing_that_values __pyx_string_tab[20] -#define __pyx_kp_u_Constraint_enforcing_that_values_10 __pyx_string_tab[21] -#define __pyx_kp_u_Constraint_enforcing_that_values_2 __pyx_string_tab[22] -#define __pyx_kp_u_Constraint_enforcing_that_values_3 __pyx_string_tab[23] -#define __pyx_kp_u_Constraint_enforcing_that_values_4 __pyx_string_tab[24] -#define __pyx_kp_u_Constraint_enforcing_that_values_5 __pyx_string_tab[25] -#define __pyx_kp_u_Constraint_enforcing_that_values_6 __pyx_string_tab[26] -#define __pyx_kp_u_Constraint_enforcing_that_values_7 __pyx_string_tab[27] -#define __pyx_kp_u_Constraint_enforcing_that_values_8 __pyx_string_tab[28] -#define __pyx_kp_u_Constraint_enforcing_that_values_9 __pyx_string_tab[29] -#define __pyx_n_u_Constraint_forwardCheck __pyx_string_tab[30] -#define __pyx_n_u_Constraint_preProcess __pyx_string_tab[31] -#define __pyx_kp_u_Constraint_which_wraps_a_functio __pyx_string_tab[32] -#define __pyx_n_u_ExactProdConstraint __pyx_string_tab[33] -#define __pyx_n_u_ExactProdConstraint___call __pyx_string_tab[34] -#define __pyx_n_u_ExactProdConstraint___init __pyx_string_tab[35] -#define __pyx_n_u_ExactProdConstraint_preProcess __pyx_string_tab[36] -#define __pyx_n_u_ExactProdConstraint_preProcess_l __pyx_string_tab[37] -#define __pyx_n_u_ExactSumConstraint __pyx_string_tab[38] -#define __pyx_n_u_ExactSumConstraint___call __pyx_string_tab[39] -#define __pyx_n_u_ExactSumConstraint___init __pyx_string_tab[40] -#define __pyx_n_u_ExactSumConstraint_preProcess __pyx_string_tab[41] -#define __pyx_n_u_FunctionConstraint __pyx_string_tab[42] -#define __pyx_n_u_FunctionConstraint___call __pyx_string_tab[43] -#define __pyx_n_u_FunctionConstraint___init __pyx_string_tab[44] -#define __pyx_n_u_InSetConstraint __pyx_string_tab[45] -#define __pyx_n_u_InSetConstraint___call __pyx_string_tab[46] -#define __pyx_n_u_InSetConstraint___init __pyx_string_tab[47] -#define __pyx_n_u_InSetConstraint_preProcess __pyx_string_tab[48] -#define __pyx_kp_u_Last_multiplier_must_be_1_as_it __pyx_string_tab[49] -#define __pyx_n_u_MaxProdConstraint __pyx_string_tab[50] -#define __pyx_n_u_MaxProdConstraint___call __pyx_string_tab[51] -#define __pyx_n_u_MaxProdConstraint___init __pyx_string_tab[52] -#define __pyx_n_u_MaxProdConstraint_preProcess __pyx_string_tab[53] -#define __pyx_n_u_MaxProdConstraint_preProcess_loc __pyx_string_tab[54] -#define __pyx_n_u_MaxSumConstraint __pyx_string_tab[55] -#define __pyx_n_u_MaxSumConstraint___call __pyx_string_tab[56] -#define __pyx_n_u_MaxSumConstraint___init __pyx_string_tab[57] -#define __pyx_n_u_MaxSumConstraint_preProcess __pyx_string_tab[58] -#define __pyx_n_u_MaxSumConstraint_preProcess_loca __pyx_string_tab[59] -#define __pyx_n_u_MinProdConstraint __pyx_string_tab[60] -#define __pyx_n_u_MinProdConstraint___call __pyx_string_tab[61] -#define __pyx_n_u_MinProdConstraint___init __pyx_string_tab[62] -#define __pyx_n_u_MinProdConstraint_preProcess __pyx_string_tab[63] -#define __pyx_n_u_MinSumConstraint __pyx_string_tab[64] -#define __pyx_n_u_MinSumConstraint___call __pyx_string_tab[65] -#define __pyx_n_u_MinSumConstraint___init __pyx_string_tab[66] -#define __pyx_kp_u_Multipliers_must_be_numbers __pyx_string_tab[67] -#define __pyx_kp_u_Multipliers_must_match_sum_varia __pyx_string_tab[68] -#define __pyx_n_u_NotImplementedError __pyx_string_tab[69] -#define __pyx_n_u_NotInSetConstraint __pyx_string_tab[70] -#define __pyx_n_u_NotInSetConstraint___call __pyx_string_tab[71] -#define __pyx_n_u_NotInSetConstraint___init __pyx_string_tab[72] -#define __pyx_n_u_NotInSetConstraint_preProcess __pyx_string_tab[73] -#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[74] -#define __pyx_n_u_Optional __pyx_string_tab[75] -#define __pyx_kp_u_Optional_Sequence __pyx_string_tab[76] -#define __pyx_n_u_RuntimeError __pyx_string_tab[77] -#define __pyx_n_u_Sequence __pyx_string_tab[78] -#define __pyx_n_u_SomeInSetConstraint __pyx_string_tab[79] -#define __pyx_n_u_SomeInSetConstraint___call __pyx_string_tab[80] -#define __pyx_n_u_SomeInSetConstraint___init __pyx_string_tab[81] -#define __pyx_n_u_SomeNotInSetConstraint __pyx_string_tab[82] -#define __pyx_n_u_SomeNotInSetConstraint___call __pyx_string_tab[83] -#define __pyx_n_u_SomeNotInSetConstraint___init __pyx_string_tab[84] -#define __pyx_n_u_Unassigned __pyx_string_tab[85] -#define __pyx_n_u_Union __pyx_string_tab[86] -#define __pyx_kp_u_Union_int_float __pyx_string_tab[87] -#define __pyx_n_u_VariableExactSumConstraint __pyx_string_tab[88] -#define __pyx_n_u_VariableExactSumConstraint___cal __pyx_string_tab[89] -#define __pyx_n_u_VariableExactSumConstraint___ini __pyx_string_tab[90] -#define __pyx_n_u_VariableExactSumConstraint___ini_2 __pyx_string_tab[91] -#define __pyx_n_u_VariableExactSumConstraint_prePr __pyx_string_tab[92] -#define __pyx_n_u_VariableExactSumConstraint_prePr_2 __pyx_string_tab[93] -#define __pyx_n_u_VariableMaxSumConstraint __pyx_string_tab[94] -#define __pyx_n_u_VariableMaxSumConstraint___call __pyx_string_tab[95] -#define __pyx_n_u_VariableMaxSumConstraint___init __pyx_string_tab[96] -#define __pyx_n_u_VariableMaxSumConstraint___init_2 __pyx_string_tab[97] -#define __pyx_n_u_VariableMaxSumConstraint_preProc __pyx_string_tab[98] -#define __pyx_n_u_VariableMaxSumConstraint_preProc_2 __pyx_string_tab[99] -#define __pyx_n_u_VariableMinSumConstraint __pyx_string_tab[100] -#define __pyx_n_u_VariableMinSumConstraint___call __pyx_string_tab[101] -#define __pyx_n_u_VariableMinSumConstraint___init __pyx_string_tab[102] -#define __pyx_n_u_VariableMinSumConstraint___init_2 __pyx_string_tab[103] -#define __pyx_n_u_VariableMinSumConstraint_preProc __pyx_string_tab[104] -#define __pyx_n_u_VariableMinSumConstraint_preProc_2 __pyx_string_tab[105] -#define __pyx_kp_u_Wrapper_function_for_picklable_s __pyx_string_tab[106] -#define __pyx_kp_u__2 __pyx_string_tab[107] -#define __pyx_kp_u_add_note __pyx_string_tab[108] -#define __pyx_n_u_append __pyx_string_tab[109] -#define __pyx_n_u_assigned __pyx_string_tab[110] -#define __pyx_n_u_assigned_2 __pyx_string_tab[111] -#define __pyx_n_u_assignments __pyx_string_tab[112] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[113] -#define __pyx_n_u_bool __pyx_string_tab[114] -#define __pyx_n_u_call __pyx_string_tab[115] -#define __pyx_n_u_class_getitem __pyx_string_tab[116] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[117] -#define __pyx_n_u_close __pyx_string_tab[118] -#define __pyx_n_u_collections_abc __pyx_string_tab[119] -#define __pyx_n_u_constraint_constraints __pyx_string_tab[120] -#define __pyx_kp_u_constraint_constraints_py __pyx_string_tab[121] -#define __pyx_n_u_constraint_domain __pyx_string_tab[122] -#define __pyx_n_u_constraints __pyx_string_tab[123] -#define __pyx_n_u_contains_lt1 __pyx_string_tab[124] -#define __pyx_n_u_contains_negative __pyx_string_tab[125] -#define __pyx_n_u_dict __pyx_string_tab[126] -#define __pyx_kp_u_disable __pyx_string_tab[127] -#define __pyx_n_u_doc __pyx_string_tab[128] -#define __pyx_n_u_domain __pyx_string_tab[129] -#define __pyx_n_u_domains __pyx_string_tab[130] -#define __pyx_kp_u_enable __pyx_string_tab[131] -#define __pyx_n_u_exact __pyx_string_tab[132] -#define __pyx_n_u_exact_2 __pyx_string_tab[133] -#define __pyx_n_u_exactprod __pyx_string_tab[134] -#define __pyx_n_u_exactprod_2 __pyx_string_tab[135] -#define __pyx_n_u_exactsum __pyx_string_tab[136] -#define __pyx_n_u_exactsum_2 __pyx_string_tab[137] -#define __pyx_n_u_forwardCheck __pyx_string_tab[138] -#define __pyx_n_u_forwardcheck __pyx_string_tab[139] -#define __pyx_n_u_found __pyx_string_tab[140] -#define __pyx_n_u_func __pyx_string_tab[141] -#define __pyx_n_u_func_2 __pyx_string_tab[142] -#define __pyx_n_u_func_3 __pyx_string_tab[143] -#define __pyx_kp_u_gc __pyx_string_tab[144] -#define __pyx_n_u_genexpr __pyx_string_tab[145] -#define __pyx_n_u_get __pyx_string_tab[146] -#define __pyx_n_u_hideValue __pyx_string_tab[147] -#define __pyx_n_u_index __pyx_string_tab[148] -#define __pyx_n_u_init __pyx_string_tab[149] -#define __pyx_n_u_is_coroutine __pyx_string_tab[150] -#define __pyx_kp_u_isenabled __pyx_string_tab[151] -#define __pyx_kp_u_list_tuple __pyx_string_tab[152] -#define __pyx_n_u_m __pyx_string_tab[153] -#define __pyx_n_u_main __pyx_string_tab[154] -#define __pyx_n_u_max __pyx_string_tab[155] -#define __pyx_n_u_maxprod __pyx_string_tab[156] -#define __pyx_n_u_maxprod_2 __pyx_string_tab[157] -#define __pyx_n_u_maxsum __pyx_string_tab[158] -#define __pyx_n_u_maxsum_2 __pyx_string_tab[159] -#define __pyx_n_u_metaclass __pyx_string_tab[160] -#define __pyx_n_u_min __pyx_string_tab[161] -#define __pyx_n_u_minprod __pyx_string_tab[162] -#define __pyx_n_u_minprod_2 __pyx_string_tab[163] -#define __pyx_n_u_minsum __pyx_string_tab[164] -#define __pyx_n_u_minsum_2 __pyx_string_tab[165] -#define __pyx_n_u_missing __pyx_string_tab[166] -#define __pyx_n_u_missing_lt1 __pyx_string_tab[167] -#define __pyx_n_u_module __pyx_string_tab[168] -#define __pyx_n_u_mro_entries __pyx_string_tab[169] -#define __pyx_n_u_multiplier __pyx_string_tab[170] -#define __pyx_n_u_multipliers __pyx_string_tab[171] -#define __pyx_n_u_multipliers_2 __pyx_string_tab[172] -#define __pyx_n_u_n __pyx_string_tab[173] -#define __pyx_n_u_n_2 __pyx_string_tab[174] -#define __pyx_n_u_name __pyx_string_tab[175] -#define __pyx_n_u_next __pyx_string_tab[176] -#define __pyx_n_u_others_max __pyx_string_tab[177] -#define __pyx_n_u_others_min __pyx_string_tab[178] -#define __pyx_n_u_parms __pyx_string_tab[179] -#define __pyx_n_u_pop __pyx_string_tab[180] -#define __pyx_n_u_preProcess __pyx_string_tab[181] -#define __pyx_n_u_prepare __pyx_string_tab[182] -#define __pyx_n_u_prod __pyx_string_tab[183] -#define __pyx_n_u_qualname __pyx_string_tab[184] -#define __pyx_n_u_remove __pyx_string_tab[185] -#define __pyx_n_u_round __pyx_string_tab[186] -#define __pyx_n_u_seen __pyx_string_tab[187] -#define __pyx_n_u_self __pyx_string_tab[188] -#define __pyx_n_u_send __pyx_string_tab[189] -#define __pyx_n_u_set __pyx_string_tab[190] -#define __pyx_n_u_set_2 __pyx_string_tab[191] -#define __pyx_n_u_singlevalue __pyx_string_tab[192] -#define __pyx_n_u_str __pyx_string_tab[193] -#define __pyx_n_u_sum __pyx_string_tab[194] -#define __pyx_n_u_sum_value __pyx_string_tab[195] -#define __pyx_n_u_sum_vars __pyx_string_tab[196] -#define __pyx_n_u_target_value __pyx_string_tab[197] -#define __pyx_n_u_target_var __pyx_string_tab[198] -#define __pyx_n_u_temp_sum __pyx_string_tab[199] -#define __pyx_n_u_test __pyx_string_tab[200] -#define __pyx_n_u_throw __pyx_string_tab[201] -#define __pyx_n_u_typing __pyx_string_tab[202] -#define __pyx_n_u_unassigned __pyx_string_tab[203] -#define __pyx_n_u_unassignedvariable __pyx_string_tab[204] -#define __pyx_n_u_v __pyx_string_tab[205] -#define __pyx_n_u_value __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_variable_contains_lt1 __pyx_string_tab[209] -#define __pyx_n_u_variable_contains_negative __pyx_string_tab[210] -#define __pyx_n_u_variable_with_lt1 __pyx_string_tab[211] -#define __pyx_n_u_variable_with_negative __pyx_string_tab[212] -#define __pyx_n_u_variables __pyx_string_tab[213] -#define __pyx_n_u_vconstraints __pyx_string_tab[214] -#define __pyx_n_u_x __pyx_string_tab[215] -#define __pyx_n_u_zip __pyx_string_tab[216] +#define __pyx_kp_u_Constraint_enforcing_that_the_pr __pyx_string_tab[17] +#define __pyx_kp_u_Constraint_enforcing_that_the_su __pyx_string_tab[18] +#define __pyx_kp_u_Constraint_enforcing_that_the_su_2 __pyx_string_tab[19] +#define __pyx_kp_u_Constraint_enforcing_that_the_su_3 __pyx_string_tab[20] +#define __pyx_kp_u_Constraint_enforcing_that_values __pyx_string_tab[21] +#define __pyx_kp_u_Constraint_enforcing_that_values_10 __pyx_string_tab[22] +#define __pyx_kp_u_Constraint_enforcing_that_values_2 __pyx_string_tab[23] +#define __pyx_kp_u_Constraint_enforcing_that_values_3 __pyx_string_tab[24] +#define __pyx_kp_u_Constraint_enforcing_that_values_4 __pyx_string_tab[25] +#define __pyx_kp_u_Constraint_enforcing_that_values_5 __pyx_string_tab[26] +#define __pyx_kp_u_Constraint_enforcing_that_values_6 __pyx_string_tab[27] +#define __pyx_kp_u_Constraint_enforcing_that_values_7 __pyx_string_tab[28] +#define __pyx_kp_u_Constraint_enforcing_that_values_8 __pyx_string_tab[29] +#define __pyx_kp_u_Constraint_enforcing_that_values_9 __pyx_string_tab[30] +#define __pyx_n_u_Constraint_forwardCheck __pyx_string_tab[31] +#define __pyx_n_u_Constraint_preProcess __pyx_string_tab[32] +#define __pyx_kp_u_Constraint_which_wraps_a_functio __pyx_string_tab[33] +#define __pyx_n_u_ExactProdConstraint __pyx_string_tab[34] +#define __pyx_n_u_ExactProdConstraint___call __pyx_string_tab[35] +#define __pyx_n_u_ExactProdConstraint___init __pyx_string_tab[36] +#define __pyx_n_u_ExactProdConstraint_preProcess __pyx_string_tab[37] +#define __pyx_n_u_ExactProdConstraint_preProcess_l __pyx_string_tab[38] +#define __pyx_n_u_ExactSumConstraint __pyx_string_tab[39] +#define __pyx_n_u_ExactSumConstraint___call __pyx_string_tab[40] +#define __pyx_n_u_ExactSumConstraint___init __pyx_string_tab[41] +#define __pyx_n_u_ExactSumConstraint_preProcess __pyx_string_tab[42] +#define __pyx_n_u_FunctionConstraint __pyx_string_tab[43] +#define __pyx_n_u_FunctionConstraint___call __pyx_string_tab[44] +#define __pyx_n_u_FunctionConstraint___init __pyx_string_tab[45] +#define __pyx_n_u_InSetConstraint __pyx_string_tab[46] +#define __pyx_n_u_InSetConstraint___call __pyx_string_tab[47] +#define __pyx_n_u_InSetConstraint___init __pyx_string_tab[48] +#define __pyx_n_u_InSetConstraint_preProcess __pyx_string_tab[49] +#define __pyx_kp_u_Last_multiplier_must_be_1_as_it __pyx_string_tab[50] +#define __pyx_n_u_MaxProdConstraint __pyx_string_tab[51] +#define __pyx_n_u_MaxProdConstraint___call __pyx_string_tab[52] +#define __pyx_n_u_MaxProdConstraint___init __pyx_string_tab[53] +#define __pyx_n_u_MaxProdConstraint_preProcess __pyx_string_tab[54] +#define __pyx_n_u_MaxProdConstraint_preProcess_loc __pyx_string_tab[55] +#define __pyx_n_u_MaxSumConstraint __pyx_string_tab[56] +#define __pyx_n_u_MaxSumConstraint___call __pyx_string_tab[57] +#define __pyx_n_u_MaxSumConstraint___init __pyx_string_tab[58] +#define __pyx_n_u_MaxSumConstraint_preProcess __pyx_string_tab[59] +#define __pyx_n_u_MaxSumConstraint_preProcess_loca __pyx_string_tab[60] +#define __pyx_n_u_MinProdConstraint __pyx_string_tab[61] +#define __pyx_n_u_MinProdConstraint___call __pyx_string_tab[62] +#define __pyx_n_u_MinProdConstraint___init __pyx_string_tab[63] +#define __pyx_n_u_MinProdConstraint_preProcess __pyx_string_tab[64] +#define __pyx_n_u_MinSumConstraint __pyx_string_tab[65] +#define __pyx_n_u_MinSumConstraint___call __pyx_string_tab[66] +#define __pyx_n_u_MinSumConstraint___init __pyx_string_tab[67] +#define __pyx_kp_u_Multipliers_must_be_numbers __pyx_string_tab[68] +#define __pyx_kp_u_Multipliers_must_match_sum_varia __pyx_string_tab[69] +#define __pyx_n_u_NotImplementedError __pyx_string_tab[70] +#define __pyx_n_u_NotInSetConstraint __pyx_string_tab[71] +#define __pyx_n_u_NotInSetConstraint___call __pyx_string_tab[72] +#define __pyx_n_u_NotInSetConstraint___init __pyx_string_tab[73] +#define __pyx_n_u_NotInSetConstraint_preProcess __pyx_string_tab[74] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[75] +#define __pyx_n_u_Optional __pyx_string_tab[76] +#define __pyx_kp_u_Optional_Sequence __pyx_string_tab[77] +#define __pyx_n_u_RuntimeError __pyx_string_tab[78] +#define __pyx_n_u_Sequence __pyx_string_tab[79] +#define __pyx_kp_u_Sequence_str __pyx_string_tab[80] +#define __pyx_n_u_SomeInSetConstraint __pyx_string_tab[81] +#define __pyx_n_u_SomeInSetConstraint___call __pyx_string_tab[82] +#define __pyx_n_u_SomeInSetConstraint___init __pyx_string_tab[83] +#define __pyx_n_u_SomeNotInSetConstraint __pyx_string_tab[84] +#define __pyx_n_u_SomeNotInSetConstraint___call __pyx_string_tab[85] +#define __pyx_n_u_SomeNotInSetConstraint___init __pyx_string_tab[86] +#define __pyx_n_u_Unassigned __pyx_string_tab[87] +#define __pyx_n_u_Union __pyx_string_tab[88] +#define __pyx_kp_u_Union_int_float __pyx_string_tab[89] +#define __pyx_n_u_VariableExactProdConstraint __pyx_string_tab[90] +#define __pyx_n_u_VariableExactProdConstraint___ca __pyx_string_tab[91] +#define __pyx_n_u_VariableExactProdConstraint___ca_2 __pyx_string_tab[92] +#define __pyx_n_u_VariableExactProdConstraint___in __pyx_string_tab[93] +#define __pyx_n_u_VariableExactProdConstraint__get __pyx_string_tab[94] +#define __pyx_n_u_VariableExactProdConstraint__saf __pyx_string_tab[95] +#define __pyx_n_u_VariableExactProdConstraint_preP __pyx_string_tab[96] +#define __pyx_n_u_VariableExactSumConstraint __pyx_string_tab[97] +#define __pyx_n_u_VariableExactSumConstraint___cal __pyx_string_tab[98] +#define __pyx_n_u_VariableExactSumConstraint___ini __pyx_string_tab[99] +#define __pyx_n_u_VariableExactSumConstraint___ini_2 __pyx_string_tab[100] +#define __pyx_n_u_VariableExactSumConstraint_prePr __pyx_string_tab[101] +#define __pyx_n_u_VariableExactSumConstraint_prePr_2 __pyx_string_tab[102] +#define __pyx_n_u_VariableMaxSumConstraint __pyx_string_tab[103] +#define __pyx_n_u_VariableMaxSumConstraint___call __pyx_string_tab[104] +#define __pyx_n_u_VariableMaxSumConstraint___init __pyx_string_tab[105] +#define __pyx_n_u_VariableMaxSumConstraint___init_2 __pyx_string_tab[106] +#define __pyx_n_u_VariableMaxSumConstraint_preProc __pyx_string_tab[107] +#define __pyx_n_u_VariableMaxSumConstraint_preProc_2 __pyx_string_tab[108] +#define __pyx_n_u_VariableMinSumConstraint __pyx_string_tab[109] +#define __pyx_n_u_VariableMinSumConstraint___call __pyx_string_tab[110] +#define __pyx_n_u_VariableMinSumConstraint___init __pyx_string_tab[111] +#define __pyx_n_u_VariableMinSumConstraint___init_2 __pyx_string_tab[112] +#define __pyx_n_u_VariableMinSumConstraint_preProc __pyx_string_tab[113] +#define __pyx_n_u_VariableMinSumConstraint_preProc_2 __pyx_string_tab[114] +#define __pyx_kp_u_Wrapper_function_for_picklable_s __pyx_string_tab[115] +#define __pyx_kp_u__2 __pyx_string_tab[116] +#define __pyx_kp_u_add_note __pyx_string_tab[117] +#define __pyx_n_u_all_bounds __pyx_string_tab[118] +#define __pyx_n_u_append __pyx_string_tab[119] +#define __pyx_n_u_assigned __pyx_string_tab[120] +#define __pyx_n_u_assigned_2 __pyx_string_tab[121] +#define __pyx_n_u_assigned_product __pyx_string_tab[122] +#define __pyx_n_u_assignments __pyx_string_tab[123] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[124] +#define __pyx_n_u_b __pyx_string_tab[125] +#define __pyx_n_u_bool __pyx_string_tab[126] +#define __pyx_n_u_bounds __pyx_string_tab[127] +#define __pyx_n_u_c __pyx_string_tab[128] +#define __pyx_n_u_call __pyx_string_tab[129] +#define __pyx_n_u_candidates __pyx_string_tab[130] +#define __pyx_n_u_class_getitem __pyx_string_tab[131] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[132] +#define __pyx_n_u_close __pyx_string_tab[133] +#define __pyx_n_u_collections_abc __pyx_string_tab[134] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[135] +#define __pyx_kp_u_constraint_constraints_py __pyx_string_tab[136] +#define __pyx_n_u_constraint_domain __pyx_string_tab[137] +#define __pyx_n_u_constraints __pyx_string_tab[138] +#define __pyx_n_u_contains_lt1 __pyx_string_tab[139] +#define __pyx_n_u_contains_negative __pyx_string_tab[140] +#define __pyx_n_u_dict __pyx_string_tab[141] +#define __pyx_kp_u_disable __pyx_string_tab[142] +#define __pyx_n_u_doc __pyx_string_tab[143] +#define __pyx_n_u_dom __pyx_string_tab[144] +#define __pyx_n_u_domain __pyx_string_tab[145] +#define __pyx_n_u_domain_bounds __pyx_string_tab[146] +#define __pyx_n_u_domain_dict __pyx_string_tab[147] +#define __pyx_n_u_domains __pyx_string_tab[148] +#define __pyx_kp_u_enable __pyx_string_tab[149] +#define __pyx_n_u_exact __pyx_string_tab[150] +#define __pyx_n_u_exact_2 __pyx_string_tab[151] +#define __pyx_n_u_exactprod __pyx_string_tab[152] +#define __pyx_n_u_exactprod_2 __pyx_string_tab[153] +#define __pyx_n_u_exactsum __pyx_string_tab[154] +#define __pyx_n_u_exactsum_2 __pyx_string_tab[155] +#define __pyx_n_u_exclude_var __pyx_string_tab[156] +#define __pyx_n_u_forwardCheck __pyx_string_tab[157] +#define __pyx_n_u_forwardcheck __pyx_string_tab[158] +#define __pyx_n_u_found __pyx_string_tab[159] +#define __pyx_n_u_func __pyx_string_tab[160] +#define __pyx_n_u_func_2 __pyx_string_tab[161] +#define __pyx_n_u_func_3 __pyx_string_tab[162] +#define __pyx_kp_u_gc __pyx_string_tab[163] +#define __pyx_n_u_genexpr __pyx_string_tab[164] +#define __pyx_n_u_get __pyx_string_tab[165] +#define __pyx_n_u_get_product_bounds __pyx_string_tab[166] +#define __pyx_n_u_hi __pyx_string_tab[167] +#define __pyx_n_u_hideValue __pyx_string_tab[168] +#define __pyx_n_u_index __pyx_string_tab[169] +#define __pyx_n_u_init __pyx_string_tab[170] +#define __pyx_n_u_is_coroutine __pyx_string_tab[171] +#define __pyx_kp_u_isenabled __pyx_string_tab[172] +#define __pyx_n_u_itertools __pyx_string_tab[173] +#define __pyx_kp_u_list_tuple __pyx_string_tab[174] +#define __pyx_n_u_lo __pyx_string_tab[175] +#define __pyx_n_u_m __pyx_string_tab[176] +#define __pyx_n_u_main __pyx_string_tab[177] +#define __pyx_n_u_max __pyx_string_tab[178] +#define __pyx_n_u_maxprod __pyx_string_tab[179] +#define __pyx_n_u_maxprod_2 __pyx_string_tab[180] +#define __pyx_n_u_maxsum __pyx_string_tab[181] +#define __pyx_n_u_maxsum_2 __pyx_string_tab[182] +#define __pyx_n_u_maxval __pyx_string_tab[183] +#define __pyx_n_u_metaclass __pyx_string_tab[184] +#define __pyx_n_u_min __pyx_string_tab[185] +#define __pyx_n_u_minprod __pyx_string_tab[186] +#define __pyx_n_u_minprod_2 __pyx_string_tab[187] +#define __pyx_n_u_minsum __pyx_string_tab[188] +#define __pyx_n_u_minsum_2 __pyx_string_tab[189] +#define __pyx_n_u_minval __pyx_string_tab[190] +#define __pyx_n_u_missing __pyx_string_tab[191] +#define __pyx_n_u_missing_lt1 __pyx_string_tab[192] +#define __pyx_n_u_module __pyx_string_tab[193] +#define __pyx_n_u_mro_entries __pyx_string_tab[194] +#define __pyx_n_u_multiplier __pyx_string_tab[195] +#define __pyx_n_u_multipliers __pyx_string_tab[196] +#define __pyx_n_u_multipliers_2 __pyx_string_tab[197] +#define __pyx_n_u_n __pyx_string_tab[198] +#define __pyx_n_u_n_2 __pyx_string_tab[199] +#define __pyx_n_u_name __pyx_string_tab[200] +#define __pyx_n_u_next __pyx_string_tab[201] +#define __pyx_n_u_other_max __pyx_string_tab[202] +#define __pyx_n_u_other_min __pyx_string_tab[203] +#define __pyx_n_u_other_products __pyx_string_tab[204] +#define __pyx_n_u_others __pyx_string_tab[205] +#define __pyx_n_u_others_bounds __pyx_string_tab[206] +#define __pyx_n_u_others_max __pyx_string_tab[207] +#define __pyx_n_u_others_min __pyx_string_tab[208] +#define __pyx_n_u_p __pyx_string_tab[209] +#define __pyx_n_u_parms __pyx_string_tab[210] +#define __pyx_n_u_pop __pyx_string_tab[211] +#define __pyx_n_u_possible_max __pyx_string_tab[212] +#define __pyx_n_u_possible_min __pyx_string_tab[213] +#define __pyx_n_u_preProcess __pyx_string_tab[214] +#define __pyx_n_u_prepare __pyx_string_tab[215] +#define __pyx_n_u_prod __pyx_string_tab[216] +#define __pyx_n_u_product __pyx_string_tab[217] +#define __pyx_n_u_product_vars __pyx_string_tab[218] +#define __pyx_n_u_products __pyx_string_tab[219] +#define __pyx_n_u_qualname __pyx_string_tab[220] +#define __pyx_n_u_remove __pyx_string_tab[221] +#define __pyx_n_u_round __pyx_string_tab[222] +#define __pyx_n_u_safe_product __pyx_string_tab[223] +#define __pyx_n_u_seen __pyx_string_tab[224] +#define __pyx_n_u_self __pyx_string_tab[225] +#define __pyx_n_u_send __pyx_string_tab[226] +#define __pyx_n_u_set __pyx_string_tab[227] +#define __pyx_n_u_set_2 __pyx_string_tab[228] +#define __pyx_n_u_singlevalue __pyx_string_tab[229] +#define __pyx_n_u_str __pyx_string_tab[230] +#define __pyx_n_u_sum __pyx_string_tab[231] +#define __pyx_n_u_sum_value __pyx_string_tab[232] +#define __pyx_n_u_sum_vars __pyx_string_tab[233] +#define __pyx_n_u_target_domain __pyx_string_tab[234] +#define __pyx_n_u_target_max __pyx_string_tab[235] +#define __pyx_n_u_target_min __pyx_string_tab[236] +#define __pyx_n_u_target_value __pyx_string_tab[237] +#define __pyx_n_u_target_var __pyx_string_tab[238] +#define __pyx_n_u_temp_sum __pyx_string_tab[239] +#define __pyx_n_u_test __pyx_string_tab[240] +#define __pyx_n_u_throw __pyx_string_tab[241] +#define __pyx_n_u_typing __pyx_string_tab[242] +#define __pyx_n_u_unassigned __pyx_string_tab[243] +#define __pyx_n_u_unassigned_vars __pyx_string_tab[244] +#define __pyx_n_u_unassignedvariable __pyx_string_tab[245] +#define __pyx_n_u_v __pyx_string_tab[246] +#define __pyx_n_u_value __pyx_string_tab[247] +#define __pyx_n_u_values __pyx_string_tab[248] +#define __pyx_n_u_var __pyx_string_tab[249] +#define __pyx_n_u_variable __pyx_string_tab[250] +#define __pyx_n_u_variable_contains_lt1 __pyx_string_tab[251] +#define __pyx_n_u_variable_contains_negative __pyx_string_tab[252] +#define __pyx_n_u_variable_with_lt1 __pyx_string_tab[253] +#define __pyx_n_u_variable_with_negative __pyx_string_tab[254] +#define __pyx_n_u_variables __pyx_string_tab[255] +#define __pyx_n_u_vconstraints __pyx_string_tab[256] +#define __pyx_n_u_x __pyx_string_tab[257] +#define __pyx_n_u_zip __pyx_string_tab[258] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3554,12 +3780,20 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { 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); Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_12___call__); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr); + 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_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_16_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<55; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<217; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<5; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } + for (int i=0; i<63; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<259; ++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); @@ -3609,12 +3843,20 @@ 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_10_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_12___call__); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr); + 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_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_16_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<55; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<217; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<5; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } + for (int i=0; i<63; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<259; ++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); @@ -3623,7 +3865,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void #endif /* #### Code section: module_code ### */ -/* "constraint/constraints.py":10 +/* "constraint/constraints.py":11 * """Abstract base class for constraints.""" * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # <<<<<<<<<<<<<< @@ -3675,53 +3917,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, 10, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 11, __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, 10, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 11, __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, 10, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 11, __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, 10, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 11, __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, 10, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 11, __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, 10, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 11, __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, 10, __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, 11, __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, 10, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 11, __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, 10, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 11, __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, 10, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 11, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 10, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 11, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 10, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 11, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 10, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 11, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -3735,7 +3977,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, 10, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 11, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3746,8 +3988,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, 10, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 10, __pyx_L1_error) + 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) __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 */ @@ -3772,7 +4014,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint___call__(CYTHO __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":33 + /* "constraint/constraints.py":34 * broken or not * """ * return True # <<<<<<<<<<<<<< @@ -3784,7 +4026,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint___call__(CYTHO __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":10 + /* "constraint/constraints.py":11 * """Abstract base class for constraints.""" * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # <<<<<<<<<<<<<< @@ -3799,7 +4041,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint___call__(CYTHO return __pyx_r; } -/* "constraint/constraints.py":35 +/* "constraint/constraints.py":36 * return True * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< @@ -3851,50 +4093,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, 35, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 36, __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, 35, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 36, __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, 35, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 36, __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, 35, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 36, __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, 35, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 36, __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, 35, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 36, __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, 35, __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, 36, __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, 35, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 36, __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, 35, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 36, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 35, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 36, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 35, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 36, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 35, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 36, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 35, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 36, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -3904,7 +4146,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, 35, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 36, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3915,9 +4157,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, 35, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 35, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 35, __pyx_L1_error) + 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) __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 */ @@ -3958,58 +4200,58 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":54 + /* "constraint/constraints.py":55 * 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, 54, __pyx_L1_error) + __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_2 = (__pyx_t_1 == 1); if (__pyx_t_2) { - /* "constraint/constraints.py":55 + /* "constraint/constraints.py":56 * """ * 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); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_variable = __pyx_t_3; __pyx_t_3 = 0; - /* "constraint/constraints.py":56 + /* "constraint/constraints.py":57 * 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, 56, __pyx_L1_error) + __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_GOTREF(__pyx_t_3); __pyx_v_domain = __pyx_t_3; __pyx_t_3 = 0; - /* "constraint/constraints.py":57 + /* "constraint/constraints.py":58 * 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, 57, __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, 58, __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, 57, __pyx_L1_error) + __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_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, 57, __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, 58, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -4018,7 +4260,7 @@ 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, 57, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 58, __pyx_L1_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } @@ -4028,7 +4270,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY { 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, 57, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 58, __pyx_L1_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } @@ -4039,13 +4281,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY #endif ++__pyx_t_1; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __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, 57, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 58, __pyx_L1_error) PyErr_Clear(); } break; @@ -4055,7 +4297,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":58 + /* "constraint/constraints.py":59 * domain = domains[variable] * for value in domain[:]: * if not self(variables, domains, {variable: value}): # <<<<<<<<<<<<<< @@ -4065,9 +4307,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, 58, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_v_variable, __pyx_v_value) < 0) __PYX_ERR(0, 58, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_v_variable, __pyx_v_value) < 0) __PYX_ERR(0, 59, __pyx_L1_error) __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { @@ -4086,15 +4328,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY __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, 58, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __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, 58, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 59, __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":59 + /* "constraint/constraints.py":60 * for value in domain[:]: * if not self(variables, domains, {variable: value}): * domain.remove(value) # <<<<<<<<<<<<<< @@ -4108,12 +4350,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY 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_XDECREF(__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_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":58 + /* "constraint/constraints.py":59 * domain = domains[variable] * for value in domain[:]: * if not self(variables, domains, {variable: value}): # <<<<<<<<<<<<<< @@ -4122,7 +4364,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY */ } - /* "constraint/constraints.py":57 + /* "constraint/constraints.py":58 * variable = variables[0] * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -4132,45 +4374,45 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":60 + /* "constraint/constraints.py":61 * 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, 60, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __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, 60, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 61, __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, 60, __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, 60, __pyx_L1_error) + 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) __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":61 + /* "constraint/constraints.py":62 * 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, 61, __pyx_L1_error) + __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_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, 61, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 62, __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, 61, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 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_8, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 61, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 62, __pyx_L1_error); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8}; @@ -4178,12 +4420,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY __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, 61, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":54 + /* "constraint/constraints.py":55 * of constraints affecting the given variables. * """ * if len(variables) == 1: # <<<<<<<<<<<<<< @@ -4192,7 +4434,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY */ } - /* "constraint/constraints.py":35 + /* "constraint/constraints.py":36 * return True * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< @@ -4220,7 +4462,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY return __pyx_r; } -/* "constraint/constraints.py":63 +/* "constraint/constraints.py":64 * vconstraints[variable].remove((self, variables)) * * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): # <<<<<<<<<<<<<< @@ -4238,18 +4480,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, 63, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __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, 63, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __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, 64, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __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, 63, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 64, __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, 63, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 64, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -4312,53 +4554,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, 63, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 64, __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, 63, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 64, __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, 63, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 64, __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, 63, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 64, __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, 63, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 64, __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, 63, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 64, __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, 63, __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, 64, __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, 63, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("forwardCheck", 0, 4, 5, i); __PYX_ERR(0, 64, __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, 63, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 64, __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, 63, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 64, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 63, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 64, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 63, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 64, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 63, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 64, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -4372,7 +4614,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, 63, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forwardCheck", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 64, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4383,8 +4625,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, 63, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 63, __pyx_L1_error) + 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) __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 */ @@ -4425,7 +4667,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("forwardCheck", 0); - /* "constraint/constraints.py":81 + /* "constraint/constraints.py":82 * broken or not * """ * unassignedvariable = _unassigned # <<<<<<<<<<<<<< @@ -4435,7 +4677,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( __Pyx_INCREF(__pyx_v__unassigned); __pyx_v_unassignedvariable = __pyx_v__unassigned; - /* "constraint/constraints.py":82 + /* "constraint/constraints.py":83 * """ * unassignedvariable = _unassigned * for variable in variables: # <<<<<<<<<<<<<< @@ -4447,9 +4689,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, 82, __pyx_L1_error) + __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_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, 82, __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, 83, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -4457,7 +4699,7 @@ 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, 82, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 83, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -4467,7 +4709,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( { 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, 82, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 83, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -4478,13 +4720,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __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, 82, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 83, __pyx_L1_error) PyErr_Clear(); } break; @@ -4494,17 +4736,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":83 + /* "constraint/constraints.py":84 * 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, 83, __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, 84, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":84 + /* "constraint/constraints.py":85 * for variable in variables: * if variable not in assignments: * if unassignedvariable is _unassigned: # <<<<<<<<<<<<<< @@ -4514,7 +4756,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":85 + /* "constraint/constraints.py":86 * if variable not in assignments: * if unassignedvariable is _unassigned: * unassignedvariable = variable # <<<<<<<<<<<<<< @@ -4524,7 +4766,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":84 + /* "constraint/constraints.py":85 * for variable in variables: * if variable not in assignments: * if unassignedvariable is _unassigned: # <<<<<<<<<<<<<< @@ -4534,7 +4776,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( goto __pyx_L6; } - /* "constraint/constraints.py":87 + /* "constraint/constraints.py":88 * unassignedvariable = variable * else: * break # <<<<<<<<<<<<<< @@ -4546,7 +4788,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( } __pyx_L6:; - /* "constraint/constraints.py":83 + /* "constraint/constraints.py":84 * unassignedvariable = _unassigned * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -4555,7 +4797,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( */ } - /* "constraint/constraints.py":82 + /* "constraint/constraints.py":83 * """ * unassignedvariable = _unassigned * for variable in variables: # <<<<<<<<<<<<<< @@ -4571,7 +4813,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( /*else*/ { __pyx_L7_for_else:; - /* "constraint/constraints.py":89 + /* "constraint/constraints.py":90 * break * else: * if unassignedvariable is not _unassigned: # <<<<<<<<<<<<<< @@ -4581,45 +4823,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":92 + /* "constraint/constraints.py":93 * # 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, 92, __pyx_L1_error) + __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_GOTREF(__pyx_t_1); __pyx_v_domain = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":93 + /* "constraint/constraints.py":94 * # 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, 93, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 94, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":94 + /* "constraint/constraints.py":95 * 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, 94, __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, 95, __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, 94, __pyx_L1_error) + __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_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, 94, __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, 95, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -4628,7 +4870,7 @@ 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, 94, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 95, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -4638,7 +4880,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( { 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, 94, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 95, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -4649,13 +4891,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __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, 94, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 95, __pyx_L1_error) PyErr_Clear(); } break; @@ -4665,16 +4907,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":95 + /* "constraint/constraints.py":96 * 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, 95, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_assignments, __pyx_v_unassignedvariable, __pyx_v_value) < 0))) __PYX_ERR(0, 96, __pyx_L1_error) - /* "constraint/constraints.py":96 + /* "constraint/constraints.py":97 * for value in domain[:]: * assignments[unassignedvariable] = value * if not self(variables, domains, assignments): # <<<<<<<<<<<<<< @@ -4701,15 +4943,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( __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_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, 96, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __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, 96, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 97, __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":97 + /* "constraint/constraints.py":98 * assignments[unassignedvariable] = value * if not self(variables, domains, assignments): * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -4723,12 +4965,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( 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_XDECREF(__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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":96 + /* "constraint/constraints.py":97 * for value in domain[:]: * assignments[unassignedvariable] = value * if not self(variables, domains, assignments): # <<<<<<<<<<<<<< @@ -4737,7 +4979,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( */ } - /* "constraint/constraints.py":94 + /* "constraint/constraints.py":95 * domain = domains[unassignedvariable] * if domain: * for value in domain[:]: # <<<<<<<<<<<<<< @@ -4747,16 +4989,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":98 + /* "constraint/constraints.py":99 * 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, 98, __pyx_L1_error) + if (unlikely((PyDict_DelItem(__pyx_v_assignments, __pyx_v_unassignedvariable) < 0))) __PYX_ERR(0, 99, __pyx_L1_error) - /* "constraint/constraints.py":93 + /* "constraint/constraints.py":94 * # values which break our variable's constraints. * domain = domains[unassignedvariable] * if domain: # <<<<<<<<<<<<<< @@ -4765,18 +5007,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( */ } - /* "constraint/constraints.py":99 + /* "constraint/constraints.py":100 * 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, 99, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_9); if (__pyx_t_5) { - /* "constraint/constraints.py":100 + /* "constraint/constraints.py":101 * del assignments[unassignedvariable] * if not domain: * return False # <<<<<<<<<<<<<< @@ -4788,7 +5030,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":99 + /* "constraint/constraints.py":100 * domain.hideValue(value) * del assignments[unassignedvariable] * if not domain: # <<<<<<<<<<<<<< @@ -4797,7 +5039,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( */ } - /* "constraint/constraints.py":89 + /* "constraint/constraints.py":90 * break * else: * if unassignedvariable is not _unassigned: # <<<<<<<<<<<<<< @@ -4808,7 +5050,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( } __pyx_L8_for_end:; - /* "constraint/constraints.py":101 + /* "constraint/constraints.py":102 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -4820,7 +5062,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":63 + /* "constraint/constraints.py":64 * vconstraints[variable].remove((self, variables)) * * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): # <<<<<<<<<<<<<< @@ -4846,7 +5088,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( return __pyx_r; } -/* "constraint/constraints.py":125 +/* "constraint/constraints.py":126 * """ * * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< @@ -4896,41 +5138,41 @@ 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, 125, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 126, __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, 125, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 126, __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, 125, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 126, __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, 125, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 126, __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, 125, __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, 126, __pyx_L3_error) if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 125, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 126, __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, 125, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 126, __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, 125, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 126, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 125, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 126, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -4942,7 +5184,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, 125, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 126, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4971,25 +5213,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":134 + /* "constraint/constraints.py":135 * 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, 134, __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, 135, __pyx_L1_error) - /* "constraint/constraints.py":135 + /* "constraint/constraints.py":136 * """ * 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, 135, __pyx_L1_error) + 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) - /* "constraint/constraints.py":125 + /* "constraint/constraints.py":126 * """ * * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< @@ -5009,7 +5251,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init return __pyx_r; } -/* "constraint/constraints.py":137 +/* "constraint/constraints.py":138 * self._assigned = assigned * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -5028,36 +5270,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_2__defaults__(CYTHON_UNUSED __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - /* "constraint/constraints.py":142 + /* "constraint/constraints.py":143 * domains: dict, * assignments: dict, * forwardcheck=False, # <<<<<<<<<<<<<< * _unassigned=Unassigned, * ): */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __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, 137, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)Py_False)) != (0)) __PYX_ERR(0, 138, __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, 137, __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, 138, __pyx_L1_error); - /* "constraint/constraints.py":137 + /* "constraint/constraints.py":138 * self._assigned = assigned * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __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, 137, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 138, __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, 137, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 138, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -5120,62 +5362,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, 137, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 138, __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, 137, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 138, __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, 137, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 138, __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, 137, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 138, __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, 137, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 138, __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, 137, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 138, __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, 137, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 138, __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, 137, __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, 138, __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, 137, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, i); __PYX_ERR(0, 138, __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, 137, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 138, __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, 137, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 138, __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, 137, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 138, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 137, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 138, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 137, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 138, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 137, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 138, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -5191,7 +5433,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, 137, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, __pyx_nargs); __PYX_ERR(0, 138, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5202,8 +5444,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, 140, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 141, __pyx_L1_error) + 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) __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 */ @@ -5244,19 +5486,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":174 + /* "constraint/constraints.py":175 * * # 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, 174, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_parms = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":175 + /* "constraint/constraints.py":176 * # single loop list: 0.11462 seconds, Cythonized: 0.08686 seconds * parms = list() * missing = 0 # <<<<<<<<<<<<<< @@ -5266,7 +5508,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":176 + /* "constraint/constraints.py":177 * parms = list() * missing = 0 * for x in variables: # <<<<<<<<<<<<<< @@ -5278,9 +5520,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, 176, __pyx_L1_error) + __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_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, 176, __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, 177, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -5288,7 +5530,7 @@ 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, 176, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 177, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5298,7 +5540,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal { 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, 176, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 177, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5309,13 +5551,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __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, 176, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 177, __pyx_L1_error) PyErr_Clear(); } break; @@ -5325,29 +5567,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":177 + /* "constraint/constraints.py":178 * 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, 177, __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, 178, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":178 + /* "constraint/constraints.py":179 * 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, 178, __pyx_L1_error) + __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_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, 178, __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, 179, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":177 + /* "constraint/constraints.py":178 * missing = 0 * for x in variables: * if x in assignments: # <<<<<<<<<<<<<< @@ -5357,7 +5599,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal goto __pyx_L5; } - /* "constraint/constraints.py":180 + /* "constraint/constraints.py":181 * parms.append(assignments[x]) * else: * parms.append(_unassigned) # <<<<<<<<<<<<<< @@ -5365,23 +5607,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, 180, __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, 181, __pyx_L1_error) - /* "constraint/constraints.py":181 + /* "constraint/constraints.py":182 * 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, 181, __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, 182, __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":176 + /* "constraint/constraints.py":177 * parms = list() * missing = 0 * for x in variables: # <<<<<<<<<<<<<< @@ -5391,19 +5633,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":184 + /* "constraint/constraints.py":185 * * # 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, 184, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 184, __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, 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":185 + /* "constraint/constraints.py":186 * # 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 ( # <<<<<<<<<<<<<< @@ -5411,23 +5653,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, 185, __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, 186, __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, 185, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 186, __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, 185, __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, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PySequence_Tuple(__pyx_v_parms); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_7 = PySequence_Tuple(__pyx_v_parms); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 186, __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, 185, __pyx_L1_error) + __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_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, 185, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 186, __pyx_L1_error) if (__pyx_t_5) { __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { @@ -5438,26 +5680,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal } __pyx_L9_next_and:; - /* "constraint/constraints.py":186 + /* "constraint/constraints.py":187 * 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, 186, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 187, __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, 186, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 187, __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, 186, __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, 187, __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, 186, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) if (!__pyx_t_9) { __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { @@ -5473,7 +5715,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal 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_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 186, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_INCREF(__pyx_t_8); @@ -5484,7 +5726,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":184 + /* "constraint/constraints.py":185 * * # if there are unassigned variables, do a forward check before executing the restriction function * if missing > 0: # <<<<<<<<<<<<<< @@ -5493,7 +5735,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal */ } - /* "constraint/constraints.py":188 + /* "constraint/constraints.py":189 * not forwardcheck or missing != 1 or self.forwardCheck(variables, domains, assignments) * ) * return self._func(*parms) # <<<<<<<<<<<<<< @@ -5501,11 +5743,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, 188, __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, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PySequence_Tuple(__pyx_v_parms); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_8 = PySequence_Tuple(__pyx_v_parms); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 189, __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, 188, __pyx_L1_error) + __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_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -5513,7 +5755,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/constraints.py":137 + /* "constraint/constraints.py":138 * self._assigned = assigned * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -5538,7 +5780,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal return __pyx_r; } -/* "constraint/constraints.py":193 +/* "constraint/constraints.py":194 * """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 # <<<<<<<<<<<<<< @@ -5587,41 +5829,41 @@ 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, 193, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 194, __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, 193, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 194, __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, 193, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 194, __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, 193, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 194, __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, 193, __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, 194, __pyx_L3_error) if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 193, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 194, __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, 193, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 194, __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, 193, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 194, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 193, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 194, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -5633,7 +5875,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, 193, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 194, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5644,7 +5886,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, 193, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_func), (&PyUnicode_Type), 0, "func", 2))) __PYX_ERR(0, 194, __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 */ @@ -5672,25 +5914,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":194 + /* "constraint/constraints.py":195 * * 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, 194, __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, 195, __pyx_L1_error) - /* "constraint/constraints.py":195 + /* "constraint/constraints.py":196 * 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, 195, __pyx_L1_error) + 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) - /* "constraint/constraints.py":193 + /* "constraint/constraints.py":194 * """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 # <<<<<<<<<<<<<< @@ -5710,7 +5952,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra return __pyx_r; } -/* "constraint/constraints.py":197 +/* "constraint/constraints.py":198 * self._assigned = assigned * * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 # <<<<<<<<<<<<<< @@ -5728,21 +5970,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_4__defaults__(CYTHON_UNUSED 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, 197, __pyx_L1_error) + __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, 197, __pyx_L1_error); + 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, 197, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __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, 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, 197, __pyx_L1_error); + 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, 197, __pyx_L1_error); + 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; @@ -5805,62 +6047,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, 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 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 197, __pyx_L3_error) + 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, 197, __pyx_L3_error) + 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, 197, __pyx_L3_error) + 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, 197, __pyx_L3_error) + 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, 197, __pyx_L3_error) + 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, 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, "__call__", 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, "__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, 197, __pyx_L3_error) } + 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, 197, __pyx_L3_error) + 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, 197, __pyx_L3_error) + 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, 197, __pyx_L3_error) + 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, 197, __pyx_L3_error) + 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, 197, __pyx_L3_error) + 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, 197, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 198, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -5876,7 +6118,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, 197, __pyx_L3_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:; @@ -5909,7 +6151,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":198 + /* "constraint/constraints.py":199 * * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 * raise NotImplementedError("CompilableFunctionConstraint can not be called directly") # <<<<<<<<<<<<<< @@ -5925,14 +6167,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra __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, 198, __pyx_L1_error) + 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, 198, __pyx_L1_error) + __PYX_ERR(0, 199, __pyx_L1_error) - /* "constraint/constraints.py":197 + /* "constraint/constraints.py":198 * self._assigned = assigned * * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 # <<<<<<<<<<<<<< @@ -5952,7 +6194,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra return __pyx_r; } -/* "constraint/constraints.py":212 +/* "constraint/constraints.py":213 * """ * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -5971,36 +6213,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_6__defaults__(CYTHON_UNUSED __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - /* "constraint/constraints.py":217 + /* "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, 212, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __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, 212, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)Py_False)) != (0)) __PYX_ERR(0, 213, __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, 212, __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, 213, __pyx_L1_error); - /* "constraint/constraints.py":212 + /* "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, 212, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __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, 212, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 213, __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, 212, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 213, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -6063,62 +6305,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, 212, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 213, __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, 212, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 213, __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, 212, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 213, __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, 212, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 213, __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, 212, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 213, __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, 212, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 213, __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, 212, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 213, __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, 212, __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, 213, __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, 212, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, i); __PYX_ERR(0, 213, __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, 212, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 213, __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, 212, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 213, __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, 212, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 213, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 212, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 213, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 212, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 213, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 212, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 213, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -6134,7 +6376,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, 212, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, __pyx_nargs); __PYX_ERR(0, 213, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6145,8 +6387,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, 215, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 216, __pyx_L1_error) + 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) __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 */ @@ -6191,19 +6433,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":220 + /* "constraint/constraints.py":221 * _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, 220, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_seen = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":221 + /* "constraint/constraints.py":222 * ): * seen = {} * for variable in variables: # <<<<<<<<<<<<<< @@ -6215,9 +6457,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, 221, __pyx_L1_error) + __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_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, 221, __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, 222, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6225,7 +6467,7 @@ 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, 221, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 222, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6235,7 +6477,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ { 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, 221, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 222, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6246,13 +6488,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __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, 221, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 222, __pyx_L1_error) PyErr_Clear(); } break; @@ -6262,19 +6504,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":222 + /* "constraint/constraints.py":223 * 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, 222, __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, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":223 + /* "constraint/constraints.py":224 * for variable in variables: * value = assignments.get(variable, _unassigned) * if value is not _unassigned: # <<<<<<<<<<<<<< @@ -6284,17 +6526,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __pyx_t_5 = (__pyx_v_value != __pyx_v__unassigned); if (__pyx_t_5) { - /* "constraint/constraints.py":224 + /* "constraint/constraints.py":225 * 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, 224, __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, 225, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":225 + /* "constraint/constraints.py":226 * if value is not _unassigned: * if value in seen: * return False # <<<<<<<<<<<<<< @@ -6307,7 +6549,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":224 + /* "constraint/constraints.py":225 * value = assignments.get(variable, _unassigned) * if value is not _unassigned: * if value in seen: # <<<<<<<<<<<<<< @@ -6316,16 +6558,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ */ } - /* "constraint/constraints.py":226 + /* "constraint/constraints.py":227 * 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, 226, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_seen, __pyx_v_value, Py_True) < 0))) __PYX_ERR(0, 227, __pyx_L1_error) - /* "constraint/constraints.py":223 + /* "constraint/constraints.py":224 * for variable in variables: * value = assignments.get(variable, _unassigned) * if value is not _unassigned: # <<<<<<<<<<<<<< @@ -6334,7 +6576,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ */ } - /* "constraint/constraints.py":221 + /* "constraint/constraints.py":222 * ): * seen = {} * for variable in variables: # <<<<<<<<<<<<<< @@ -6344,17 +6586,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":227 + /* "constraint/constraints.py":228 * 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, 227, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 228, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":228 + /* "constraint/constraints.py":229 * seen[value] = True * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -6366,9 +6608,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, 228, __pyx_L1_error) + __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_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, 228, __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, 229, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6376,7 +6618,7 @@ 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, 228, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 229, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6386,7 +6628,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ { 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, 228, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 229, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6397,13 +6639,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __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, 228, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 229, __pyx_L1_error) PyErr_Clear(); } break; @@ -6413,29 +6655,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":229 + /* "constraint/constraints.py":230 * 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, 229, __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, 230, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":230 + /* "constraint/constraints.py":231 * 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, 230, __pyx_L1_error) + __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_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":231 + /* "constraint/constraints.py":232 * if variable not in assignments: * domain = domains[variable] * for value in seen: # <<<<<<<<<<<<<< @@ -6443,7 +6685,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, 231, __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, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_9; @@ -6451,22 +6693,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, 231, __pyx_L1_error) + if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":232 + /* "constraint/constraints.py":233 * 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, 232, __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, 233, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":233 + /* "constraint/constraints.py":234 * for value in seen: * if value in domain: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -6480,23 +6722,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ 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_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 233, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":234 + /* "constraint/constraints.py":235 * 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, 234, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 235, __pyx_L1_error) __pyx_t_13 = (!__pyx_t_5); if (__pyx_t_13) { - /* "constraint/constraints.py":235 + /* "constraint/constraints.py":236 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -6510,7 +6752,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "constraint/constraints.py":234 + /* "constraint/constraints.py":235 * if value in domain: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -6519,7 +6761,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ */ } - /* "constraint/constraints.py":232 + /* "constraint/constraints.py":233 * domain = domains[variable] * for value in seen: * if value in domain: # <<<<<<<<<<<<<< @@ -6530,7 +6772,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":229 + /* "constraint/constraints.py":230 * if forwardcheck: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -6539,7 +6781,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ */ } - /* "constraint/constraints.py":228 + /* "constraint/constraints.py":229 * seen[value] = True * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -6549,7 +6791,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":227 + /* "constraint/constraints.py":228 * return False * seen[value] = True * if forwardcheck: # <<<<<<<<<<<<<< @@ -6558,7 +6800,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ */ } - /* "constraint/constraints.py":236 + /* "constraint/constraints.py":237 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -6570,7 +6812,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":212 + /* "constraint/constraints.py":213 * """ * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -6596,7 +6838,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ return __pyx_r; } -/* "constraint/constraints.py":250 +/* "constraint/constraints.py":251 * """ * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -6615,36 +6857,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_8__defaults__(CYTHON_UNUSED __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - /* "constraint/constraints.py":255 + /* "constraint/constraints.py":256 * domains: dict, * assignments: dict, * forwardcheck=False, # <<<<<<<<<<<<<< * _unassigned=Unassigned, * ): */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __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, 250, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)Py_False)) != (0)) __PYX_ERR(0, 251, __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, 250, __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, 251, __pyx_L1_error); - /* "constraint/constraints.py":250 + /* "constraint/constraints.py":251 * """ * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __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, 250, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 251, __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, 250, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 251, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -6707,62 +6949,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, 250, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 251, __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, 250, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 251, __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, 250, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 251, __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, 250, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 251, __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, 250, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 251, __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, 250, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 251, __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, 250, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 251, __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, 250, __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, 251, __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, 250, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, i); __PYX_ERR(0, 251, __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, 250, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 251, __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, 250, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 251, __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, 250, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 251, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 250, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 251, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 250, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 251, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 250, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 251, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -6778,7 +7020,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, 250, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, __pyx_nargs); __PYX_ERR(0, 251, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6789,8 +7031,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, 253, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 254, __pyx_L1_error) + 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) __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 */ @@ -6833,7 +7075,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":258 + /* "constraint/constraints.py":259 * _unassigned=Unassigned, * ): * singlevalue = _unassigned # <<<<<<<<<<<<<< @@ -6843,7 +7085,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __Pyx_INCREF(__pyx_v__unassigned); __pyx_v_singlevalue = __pyx_v__unassigned; - /* "constraint/constraints.py":259 + /* "constraint/constraints.py":260 * ): * singlevalue = _unassigned * for variable in variables: # <<<<<<<<<<<<<< @@ -6855,9 +7097,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, 259, __pyx_L1_error) + __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_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, 259, __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, 260, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6865,7 +7107,7 @@ 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, 259, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 260, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6875,7 +7117,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call { 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, 259, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 260, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6886,13 +7128,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 260, __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, 259, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 260, __pyx_L1_error) PyErr_Clear(); } break; @@ -6902,19 +7144,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":260 + /* "constraint/constraints.py":261 * 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, 260, __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, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":261 + /* "constraint/constraints.py":262 * for variable in variables: * value = assignments.get(variable, _unassigned) * if singlevalue is _unassigned: # <<<<<<<<<<<<<< @@ -6924,7 +7166,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":262 + /* "constraint/constraints.py":263 * value = assignments.get(variable, _unassigned) * if singlevalue is _unassigned: * singlevalue = value # <<<<<<<<<<<<<< @@ -6934,7 +7176,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":261 + /* "constraint/constraints.py":262 * for variable in variables: * value = assignments.get(variable, _unassigned) * if singlevalue is _unassigned: # <<<<<<<<<<<<<< @@ -6944,7 +7186,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call goto __pyx_L5; } - /* "constraint/constraints.py":263 + /* "constraint/constraints.py":264 * if singlevalue is _unassigned: * singlevalue = value * elif value is not _unassigned and value != singlevalue: # <<<<<<<<<<<<<< @@ -6957,14 +7199,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, 263, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 263, __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, 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_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":264 + /* "constraint/constraints.py":265 * singlevalue = value * elif value is not _unassigned and value != singlevalue: * return False # <<<<<<<<<<<<<< @@ -6977,7 +7219,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":263 + /* "constraint/constraints.py":264 * if singlevalue is _unassigned: * singlevalue = value * elif value is not _unassigned and value != singlevalue: # <<<<<<<<<<<<<< @@ -6987,7 +7229,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } __pyx_L5:; - /* "constraint/constraints.py":259 + /* "constraint/constraints.py":260 * ): * singlevalue = _unassigned * for variable in variables: # <<<<<<<<<<<<<< @@ -6997,14 +7239,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":265 + /* "constraint/constraints.py":266 * 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, 265, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 266, __pyx_L1_error) if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; @@ -7015,7 +7257,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __pyx_L10_bool_binop_done:; if (__pyx_t_5) { - /* "constraint/constraints.py":266 + /* "constraint/constraints.py":267 * return False * if forwardcheck and singlevalue is not _unassigned: * for variable in variables: # <<<<<<<<<<<<<< @@ -7027,9 +7269,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, 266, __pyx_L1_error) + __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_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, 266, __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)) { @@ -7037,7 +7279,7 @@ 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, 266, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 267, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -7047,7 +7289,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call { 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, 266, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 267, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -7058,13 +7300,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __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, 266, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 267, __pyx_L1_error) PyErr_Clear(); } break; @@ -7074,39 +7316,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":267 + /* "constraint/constraints.py":268 * 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, 267, __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, 268, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":268 + /* "constraint/constraints.py":269 * 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, 268, __pyx_L1_error) + __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_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":269 + /* "constraint/constraints.py":270 * 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, 269, __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, 270, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":270 + /* "constraint/constraints.py":271 * domain = domains[variable] * if singlevalue not in domain: * return False # <<<<<<<<<<<<<< @@ -7119,7 +7361,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":269 + /* "constraint/constraints.py":270 * if variable not in assignments: * domain = domains[variable] * if singlevalue not in domain: # <<<<<<<<<<<<<< @@ -7128,23 +7370,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call */ } - /* "constraint/constraints.py":271 + /* "constraint/constraints.py":272 * 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, 271, __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, 272, __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, 271, __pyx_L1_error) + __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_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, 271, __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, 272, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -7153,7 +7395,7 @@ 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, 271, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 272, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -7163,7 +7405,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call { 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, 271, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 272, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -7174,13 +7416,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __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, 271, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 272, __pyx_L1_error) PyErr_Clear(); } break; @@ -7190,19 +7432,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":272 + /* "constraint/constraints.py":273 * 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, 272, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 272, __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, 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_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":273 + /* "constraint/constraints.py":274 * for value in domain[:]: * if value != singlevalue: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -7216,12 +7458,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call 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_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":272 + /* "constraint/constraints.py":273 * return False * for value in domain[:]: * if value != singlevalue: # <<<<<<<<<<<<<< @@ -7230,7 +7472,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call */ } - /* "constraint/constraints.py":271 + /* "constraint/constraints.py":272 * if singlevalue not in domain: * return False * for value in domain[:]: # <<<<<<<<<<<<<< @@ -7240,7 +7482,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":267 + /* "constraint/constraints.py":268 * if forwardcheck and singlevalue is not _unassigned: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -7249,7 +7491,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call */ } - /* "constraint/constraints.py":266 + /* "constraint/constraints.py":267 * return False * if forwardcheck and singlevalue is not _unassigned: * for variable in variables: # <<<<<<<<<<<<<< @@ -7259,7 +7501,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":265 + /* "constraint/constraints.py":266 * elif value is not _unassigned and value != singlevalue: * return False * if forwardcheck and singlevalue is not _unassigned: # <<<<<<<<<<<<<< @@ -7268,7 +7510,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call */ } - /* "constraint/constraints.py":274 + /* "constraint/constraints.py":275 * if value != singlevalue: * domain.hideValue(value) * return True # <<<<<<<<<<<<<< @@ -7280,7 +7522,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":250 + /* "constraint/constraints.py":251 * """ * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -7306,7 +7548,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call return __pyx_r; } -/* "constraint/constraints.py":288 +/* "constraint/constraints.py":289 * """ * * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -7356,41 +7598,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, 288, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 289, __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, 288, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 289, __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, 288, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 289, __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, 288, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 289, __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, 288, __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, 289, __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, 288, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 289, __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, 288, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 289, __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, 288, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 289, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 288, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 289, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -7402,7 +7644,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, 288, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 289, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7431,25 +7673,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint___init int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":297 + /* "constraint/constraints.py":298 * summed to be checked * """ * self._exactsum = exactsum # <<<<<<<<<<<<<< * self._multipliers = multipliers * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exactsum_2, __pyx_v_exactsum) < 0) __PYX_ERR(0, 297, __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, 298, __pyx_L1_error) - /* "constraint/constraints.py":298 + /* "constraint/constraints.py":299 * """ * self._exactsum = exactsum * self._multipliers = multipliers # <<<<<<<<<<<<<< * * 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, 298, __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, 299, __pyx_L1_error) - /* "constraint/constraints.py":288 + /* "constraint/constraints.py":289 * """ * * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -7469,7 +7711,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint___init return __pyx_r; } -/* "constraint/constraints.py":300 +/* "constraint/constraints.py":301 * self._multipliers = multipliers * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -7520,50 +7762,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, 300, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 301, __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, 300, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 301, __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, 300, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 301, __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, 300, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 301, __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, 300, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 301, __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, 300, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 301, __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, 300, __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, 301, __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, 300, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 301, __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, 300, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 301, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 300, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 301, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 300, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 301, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 300, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 301, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 300, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 301, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -7573,7 +7815,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, 300, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 301, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7584,9 +7826,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, 300, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 300, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 300, __pyx_L1_error) + 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) __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 */ @@ -7632,7 +7874,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":301 + /* "constraint/constraints.py":302 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -7640,9 +7882,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * 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, 301, __pyx_L1_error) + __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_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, 301, __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, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -7662,46 +7904,46 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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_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, 301, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":302 + /* "constraint/constraints.py":303 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * multipliers = self._multipliers # <<<<<<<<<<<<<< * exactsum = self._exactsum * 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, 302, __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, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":303 + /* "constraint/constraints.py":304 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * multipliers = self._multipliers * exactsum = self._exactsum # <<<<<<<<<<<<<< * if multipliers: * for variable, multiplier in zip(variables, multipliers): */ - __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, 303, __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, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_exactsum = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":304 + /* "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, 304, __pyx_L1_error) + __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":305 + /* "constraint/constraints.py":306 * exactsum = self._exactsum * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -7717,7 +7959,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 305, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -7725,9 +7967,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 305, __pyx_L1_error) + __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_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, 305, __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, 306, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -7736,7 +7978,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 305, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 306, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -7746,7 +7988,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 305, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 306, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -7757,13 +7999,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __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, 305, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 306, __pyx_L1_error) PyErr_Clear(); } break; @@ -7776,7 +8018,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 305, __pyx_L1_error) + __PYX_ERR(0, 306, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -7786,22 +8028,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error) + 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, 305, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __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, 305, __pyx_L1_error) + __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, 305, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __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, 305, __pyx_L1_error) + __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); @@ -7809,7 +8051,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 305, __pyx_L1_error) + 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; @@ -7817,7 +8059,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 305, __pyx_L1_error) + __PYX_ERR(0, 306, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); @@ -7825,35 +8067,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":306 + /* "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, 306, __pyx_L1_error) + __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":307 + /* "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, 307, __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, 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, 307, __pyx_L1_error) + __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, 307, __pyx_L1_error) + __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 (;;) { @@ -7862,7 +8104,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 307, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 308, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -7872,7 +8114,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 307, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 308, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -7883,13 +8125,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) + 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, 307, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 308, __pyx_L1_error) PyErr_Clear(); } break; @@ -7899,22 +8141,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":308 + /* "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, 308, __pyx_L1_error) + __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, 308, __pyx_L1_error) + __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, 308, __pyx_L1_error) + __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":309 + /* "constraint/constraints.py":310 * for value in domain[:]: * if value * multiplier > exactsum: * domain.remove(value) # <<<<<<<<<<<<<< @@ -7928,12 +8170,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr 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, 309, __pyx_L1_error) + 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":308 + /* "constraint/constraints.py":309 * domain = domains[variable] * for value in domain[:]: * if value * multiplier > exactsum: # <<<<<<<<<<<<<< @@ -7942,7 +8184,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr */ } - /* "constraint/constraints.py":307 + /* "constraint/constraints.py":308 * for variable, multiplier in zip(variables, multipliers): * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -7952,7 +8194,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":305 + /* "constraint/constraints.py":306 * exactsum = self._exactsum * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -7962,7 +8204,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":304 + /* "constraint/constraints.py":305 * multipliers = self._multipliers * exactsum = self._exactsum * if multipliers: # <<<<<<<<<<<<<< @@ -7972,7 +8214,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr goto __pyx_L3; } - /* "constraint/constraints.py":311 + /* "constraint/constraints.py":312 * domain.remove(value) * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -7985,9 +8227,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 311, __pyx_L1_error) + __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, 311, __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, 312, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { @@ -7995,7 +8237,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 311, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 312, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -8005,7 +8247,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 311, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 312, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -8016,13 +8258,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error) } else { __pyx_t_3 = __pyx_t_8(__pyx_t_2); 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, 311, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 312, __pyx_L1_error) PyErr_Clear(); } break; @@ -8032,35 +8274,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":312 + /* "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, 312, __pyx_L1_error) + __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":313 + /* "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, 313, __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, 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; } else { - __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __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, 313, __pyx_L1_error) + __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) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -8069,7 +8311,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 313, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 314, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -8079,7 +8321,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 313, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 314, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -8090,13 +8332,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error) + 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, 313, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 314, __pyx_L1_error) PyErr_Clear(); } break; @@ -8106,19 +8348,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":314 + /* "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, 314, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 314, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":315 + /* "constraint/constraints.py":316 * for value in domain[:]: * if value > exactsum: * domain.remove(value) # <<<<<<<<<<<<<< @@ -8132,12 +8374,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr 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, 315, __pyx_L1_error) + 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; - /* "constraint/constraints.py":314 + /* "constraint/constraints.py":315 * domain = domains[variable] * for value in domain[:]: * if value > exactsum: # <<<<<<<<<<<<<< @@ -8146,7 +8388,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr */ } - /* "constraint/constraints.py":313 + /* "constraint/constraints.py":314 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -8156,7 +8398,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":311 + /* "constraint/constraints.py":312 * domain.remove(value) * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -8168,7 +8410,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr } __pyx_L3:; - /* "constraint/constraints.py":300 + /* "constraint/constraints.py":301 * self._multipliers = multipliers * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -8199,7 +8441,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr return __pyx_r; } -/* "constraint/constraints.py":317 +/* "constraint/constraints.py":318 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -8250,53 +8492,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, 317, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 318, __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, 317, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 318, __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, 317, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 318, __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, 317, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 318, __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, 317, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 318, __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, 317, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 318, __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, 317, __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, 318, __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, 317, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 318, __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, 317, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 318, __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, 317, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 318, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 317, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 318, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 317, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 318, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 317, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 318, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -8310,7 +8552,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, 317, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 318, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -8321,8 +8563,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, 317, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 317, __pyx_L1_error) + 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) __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 */ @@ -8371,31 +8613,31 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":318 + /* "constraint/constraints.py":319 * * 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, 318, __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, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":319 + /* "constraint/constraints.py":320 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * multipliers = self._multipliers * exactsum = self._exactsum # <<<<<<<<<<<<<< * sum = 0 * missing = False */ - __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, 319, __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":320 + /* "constraint/constraints.py":321 * multipliers = self._multipliers * exactsum = self._exactsum * sum = 0 # <<<<<<<<<<<<<< @@ -8405,7 +8647,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":321 + /* "constraint/constraints.py":322 * exactsum = self._exactsum * sum = 0 * missing = False # <<<<<<<<<<<<<< @@ -8414,17 +8656,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ __pyx_v_missing = 0; - /* "constraint/constraints.py":322 + /* "constraint/constraints.py":323 * sum = 0 * missing = 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, 322, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 323, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":323 + /* "constraint/constraints.py":324 * missing = False * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -8440,7 +8682,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __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_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, 323, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -8448,9 +8690,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error) + __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, 323, __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, 324, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -8459,7 +8701,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 323, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 324, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -8469,7 +8711,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 323, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 324, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -8480,13 +8722,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_7(__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, 323, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 324, __pyx_L1_error) PyErr_Clear(); } break; @@ -8499,7 +8741,7 @@ 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, 323, __pyx_L1_error) + __PYX_ERR(0, 324, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8509,22 +8751,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) + 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, 323, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 324, __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, 323, __pyx_L1_error) + __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, 323, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 324, __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, 323, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 324, __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); @@ -8532,7 +8774,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_GOTREF(__pyx_t_3); 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, 323, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 324, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; @@ -8540,7 +8782,7 @@ 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, 323, __pyx_L1_error) + __PYX_ERR(0, 324, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); @@ -8548,35 +8790,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":324 + /* "constraint/constraints.py":325 * 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, 324, __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, 325, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":325 + /* "constraint/constraints.py":326 * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< * else: * missing = True */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __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_GOTREF(__pyx_t_1); - __pyx_t_8 = PyNumber_Multiply(__pyx_t_1, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_8 = PyNumber_Multiply(__pyx_t_1, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 326, __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, 325, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __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":324 + /* "constraint/constraints.py":325 * if multipliers: * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: # <<<<<<<<<<<<<< @@ -8586,7 +8828,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal goto __pyx_L8; } - /* "constraint/constraints.py":327 + /* "constraint/constraints.py":328 * sum += assignments[variable] * multiplier * else: * missing = True # <<<<<<<<<<<<<< @@ -8598,7 +8840,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __pyx_L8:; - /* "constraint/constraints.py":323 + /* "constraint/constraints.py":324 * missing = False * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -8608,7 +8850,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":328 + /* "constraint/constraints.py":329 * else: * missing = True * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -8618,7 +8860,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_t_2 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_2) { - /* "constraint/constraints.py":329 + /* "constraint/constraints.py":330 * missing = True * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< @@ -8634,13 +8876,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __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, 329, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":328 + /* "constraint/constraints.py":329 * else: * missing = True * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -8649,19 +8891,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":330 + /* "constraint/constraints.py":331 * if isinstance(sum, float): * sum = round(sum, 10) * if sum > exactsum: # <<<<<<<<<<<<<< * return False * if forwardcheck and missing: */ - __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, 330, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 330, __pyx_L1_error) + __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; if (__pyx_t_2) { - /* "constraint/constraints.py":331 + /* "constraint/constraints.py":332 * sum = round(sum, 10) * if sum > exactsum: * return False # <<<<<<<<<<<<<< @@ -8673,7 +8915,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":330 + /* "constraint/constraints.py":331 * if isinstance(sum, float): * sum = round(sum, 10) * if sum > exactsum: # <<<<<<<<<<<<<< @@ -8682,14 +8924,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":332 + /* "constraint/constraints.py":333 * if sum > exactsum: * return False * if forwardcheck and missing: # <<<<<<<<<<<<<< * 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, 332, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 333, __pyx_L1_error) if (__pyx_t_11) { } else { __pyx_t_2 = __pyx_t_11; @@ -8699,7 +8941,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_L13_bool_binop_done:; if (__pyx_t_2) { - /* "constraint/constraints.py":333 + /* "constraint/constraints.py":334 * return False * if forwardcheck and missing: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -8715,7 +8957,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __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, 333, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { @@ -8723,9 +8965,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __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, 333, __pyx_L1_error) + __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, 333, __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, 334, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -8734,7 +8976,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__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, 333, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 334, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -8744,7 +8986,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 333, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 334, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -8755,13 +8997,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __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, 333, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 334, __pyx_L1_error) PyErr_Clear(); } break; @@ -8774,7 +9016,7 @@ 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, 333, __pyx_L1_error) + __PYX_ERR(0, 334, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8784,22 +9026,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 333, __pyx_L1_error) + 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, 333, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); } #else - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 333, __pyx_L1_error) + __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, 333, __pyx_L1_error) + __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); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); @@ -8807,7 +9049,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __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, 333, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 334, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L18_unpacking_done; @@ -8815,7 +9057,7 @@ 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, 333, __pyx_L1_error) + __PYX_ERR(0, 334, __pyx_L1_error) __pyx_L18_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_8); @@ -8823,45 +9065,45 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":334 + /* "constraint/constraints.py":335 * if forwardcheck and missing: * 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, 334, __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, 335, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":335 + /* "constraint/constraints.py":336 * 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, 335, __pyx_L1_error) + __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; - /* "constraint/constraints.py":336 + /* "constraint/constraints.py":337 * 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, 336, __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, 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_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, 336, __pyx_L1_error) + __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, 336, __pyx_L1_error) + __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -8870,7 +9112,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 336, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 337, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -8880,7 +9122,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 336, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 337, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -8891,13 +9133,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_13(__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, 336, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 337, __pyx_L1_error) PyErr_Clear(); } break; @@ -8907,25 +9149,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":337 + /* "constraint/constraints.py":338 * 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, 337, __pyx_L1_error) + __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, 337, __pyx_L1_error) + __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, 337, __pyx_L1_error) + __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, 337, __pyx_L1_error) + __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; if (__pyx_t_2) { - /* "constraint/constraints.py":338 + /* "constraint/constraints.py":339 * for value in domain[:]: * if sum + value * multiplier > exactsum: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -8939,12 +9181,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal 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, 338, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":337 + /* "constraint/constraints.py":338 * domain = domains[variable] * for value in domain[:]: * if sum + value * multiplier > exactsum: # <<<<<<<<<<<<<< @@ -8953,7 +9195,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":336 + /* "constraint/constraints.py":337 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -8963,18 +9205,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":339 + /* "constraint/constraints.py":340 * 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, 339, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 340, __pyx_L1_error) __pyx_t_11 = (!__pyx_t_2); if (__pyx_t_11) { - /* "constraint/constraints.py":340 + /* "constraint/constraints.py":341 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -8987,7 +9229,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":339 + /* "constraint/constraints.py":340 * if sum + value * multiplier > exactsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -8996,7 +9238,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":334 + /* "constraint/constraints.py":335 * if forwardcheck and missing: * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: # <<<<<<<<<<<<<< @@ -9005,7 +9247,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":333 + /* "constraint/constraints.py":334 * return False * if forwardcheck and missing: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -9015,7 +9257,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":332 + /* "constraint/constraints.py":333 * if sum > exactsum: * return False * if forwardcheck and missing: # <<<<<<<<<<<<<< @@ -9024,7 +9266,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":322 + /* "constraint/constraints.py":323 * sum = 0 * missing = False * if multipliers: # <<<<<<<<<<<<<< @@ -9034,7 +9276,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal goto __pyx_L3; } - /* "constraint/constraints.py":342 + /* "constraint/constraints.py":343 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -9047,9 +9289,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __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, 342, __pyx_L1_error) + __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, 342, __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, 343, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -9057,7 +9299,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__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, 342, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 343, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -9067,7 +9309,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 342, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 343, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -9078,13 +9320,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __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, 342, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 343, __pyx_L1_error) PyErr_Clear(); } break; @@ -9094,32 +9336,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":343 + /* "constraint/constraints.py":344 * 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, 343, __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, 344, __pyx_L1_error) if (__pyx_t_11) { - /* "constraint/constraints.py":344 + /* "constraint/constraints.py":345 * for variable in variables: * if variable in assignments: * sum += assignments[variable] # <<<<<<<<<<<<<< * else: * missing = True */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error) + __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_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) + __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; - /* "constraint/constraints.py":343 + /* "constraint/constraints.py":344 * else: * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -9129,7 +9371,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal goto __pyx_L28; } - /* "constraint/constraints.py":346 + /* "constraint/constraints.py":347 * sum += assignments[variable] * else: * missing = True # <<<<<<<<<<<<<< @@ -9141,7 +9383,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __pyx_L28:; - /* "constraint/constraints.py":342 + /* "constraint/constraints.py":343 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -9151,7 +9393,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":347 + /* "constraint/constraints.py":348 * else: * missing = True * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -9161,7 +9403,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_t_11 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_11) { - /* "constraint/constraints.py":348 + /* "constraint/constraints.py":349 * missing = True * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< @@ -9177,13 +9419,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __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, 348, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":347 + /* "constraint/constraints.py":348 * else: * missing = True * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -9192,19 +9434,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":349 + /* "constraint/constraints.py":350 * if isinstance(sum, float): * sum = round(sum, 10) * if sum > exactsum: # <<<<<<<<<<<<<< * return False * if forwardcheck and missing: */ - __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, 349, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 349, __pyx_L1_error) + __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; if (__pyx_t_11) { - /* "constraint/constraints.py":350 + /* "constraint/constraints.py":351 * sum = round(sum, 10) * if sum > exactsum: * return False # <<<<<<<<<<<<<< @@ -9216,7 +9458,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":349 + /* "constraint/constraints.py":350 * if isinstance(sum, float): * sum = round(sum, 10) * if sum > exactsum: # <<<<<<<<<<<<<< @@ -9225,14 +9467,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":351 + /* "constraint/constraints.py":352 * if sum > exactsum: * return False * if forwardcheck and missing: # <<<<<<<<<<<<<< * 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, 351, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 352, __pyx_L1_error) if (__pyx_t_2) { } else { __pyx_t_11 = __pyx_t_2; @@ -9242,7 +9484,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_L33_bool_binop_done:; if (__pyx_t_11) { - /* "constraint/constraints.py":352 + /* "constraint/constraints.py":353 * return False * if forwardcheck and missing: * for variable in variables: # <<<<<<<<<<<<<< @@ -9254,9 +9496,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __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, 352, __pyx_L1_error) + __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, 352, __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, 353, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -9264,7 +9506,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__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, 352, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 353, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -9274,7 +9516,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 352, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 353, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -9285,13 +9527,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 352, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __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, 352, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 353, __pyx_L1_error) PyErr_Clear(); } break; @@ -9301,45 +9543,45 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":353 + /* "constraint/constraints.py":354 * if forwardcheck and missing: * 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, 353, __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, 354, __pyx_L1_error) if (__pyx_t_11) { - /* "constraint/constraints.py":354 + /* "constraint/constraints.py":355 * 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, 354, __pyx_L1_error) + __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; - /* "constraint/constraints.py":355 + /* "constraint/constraints.py":356 * 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, 355, __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, 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_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, 355, __pyx_L1_error) + __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, 355, __pyx_L1_error) + __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -9348,7 +9590,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 355, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 356, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -9358,7 +9600,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 355, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 356, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -9369,13 +9611,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error) } else { __pyx_t_3 = __pyx_t_13(__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, 355, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 356, __pyx_L1_error) PyErr_Clear(); } break; @@ -9385,22 +9627,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":356 + /* "constraint/constraints.py":357 * 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, 356, __pyx_L1_error) + __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, 356, __pyx_L1_error) + __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, 356, __pyx_L1_error) + __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; if (__pyx_t_11) { - /* "constraint/constraints.py":357 + /* "constraint/constraints.py":358 * for value in domain[:]: * if sum + value > exactsum: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -9414,12 +9656,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal 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, 357, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":356 + /* "constraint/constraints.py":357 * domain = domains[variable] * for value in domain[:]: * if sum + value > exactsum: # <<<<<<<<<<<<<< @@ -9428,7 +9670,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":355 + /* "constraint/constraints.py":356 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -9438,18 +9680,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":358 + /* "constraint/constraints.py":359 * 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, 358, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 359, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_11); if (__pyx_t_2) { - /* "constraint/constraints.py":359 + /* "constraint/constraints.py":360 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -9462,7 +9704,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":358 + /* "constraint/constraints.py":359 * if sum + value > exactsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -9471,7 +9713,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":353 + /* "constraint/constraints.py":354 * if forwardcheck and missing: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -9480,7 +9722,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":352 + /* "constraint/constraints.py":353 * return False * if forwardcheck and missing: * for variable in variables: # <<<<<<<<<<<<<< @@ -9490,7 +9732,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":351 + /* "constraint/constraints.py":352 * if sum > exactsum: * return False * if forwardcheck and missing: # <<<<<<<<<<<<<< @@ -9501,7 +9743,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __pyx_L3:; - /* "constraint/constraints.py":360 + /* "constraint/constraints.py":361 * if not domain: * return False * if missing: # <<<<<<<<<<<<<< @@ -9510,7 +9752,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ if (__pyx_v_missing) { - /* "constraint/constraints.py":361 + /* "constraint/constraints.py":362 * return False * if missing: * return sum <= exactsum # <<<<<<<<<<<<<< @@ -9518,12 +9760,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * 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, 361, __pyx_L1_error) + __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; goto __pyx_L0; - /* "constraint/constraints.py":360 + /* "constraint/constraints.py":361 * if not domain: * return False * if missing: # <<<<<<<<<<<<<< @@ -9532,7 +9774,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":363 + /* "constraint/constraints.py":364 * return sum <= exactsum * else: * return sum == exactsum # <<<<<<<<<<<<<< @@ -9541,13 +9783,13 @@ 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, 363, __pyx_L1_error) + __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; goto __pyx_L0; } - /* "constraint/constraints.py":317 + /* "constraint/constraints.py":318 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -9577,10 +9819,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal return __pyx_r; } -/* "constraint/constraints.py":376 +/* "constraint/constraints.py":377 * """ * - * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -9628,47 +9870,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, 376, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 377, __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, 376, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 377, __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, 376, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 377, __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, 376, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 377, __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, 376, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 377, __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, 376, __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, 377, __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, 376, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, i); __PYX_ERR(0, 377, __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, 376, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 377, __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, 376, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 377, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 376, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 377, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 376, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 377, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -9681,7 +9923,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, 376, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 377, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9692,7 +9934,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, 376, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 377, __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 */ @@ -9713,7 +9955,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":392 +/* "constraint/constraints.py":393 * 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." # <<<<<<<<<<<<<< @@ -9733,7 +9975,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, 392, __pyx_L1_error) + __PYX_ERR(0, 393, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -9741,7 +9983,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, 392, __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, 393, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -9779,16 +10021,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 392, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 392, __pyx_L1_error) } + 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 (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, 392, __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, 393, __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, 392, __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, 393, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -9796,7 +10038,7 @@ 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, 392, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 393, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -9806,7 +10048,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain { 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, 392, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 393, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -9817,13 +10059,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __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, 392, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 393, __pyx_L1_error) PyErr_Clear(); } break; @@ -9881,10 +10123,10 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":376 +/* "constraint/constraints.py":377 * """ * - * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -9903,44 +10145,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":386 + /* "constraint/constraints.py":387 * 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, 386, __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, 387, __pyx_L1_error) - /* "constraint/constraints.py":387 + /* "constraint/constraints.py":388 * """ * 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, 387, __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, 388, __pyx_L1_error) - /* "constraint/constraints.py":388 + /* "constraint/constraints.py":389 * 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, 388, __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, 389, __pyx_L1_error) - /* "constraint/constraints.py":390 + /* "constraint/constraints.py":391 * 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, 390, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 391, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/constraints.py":391 + /* "constraint/constraints.py":392 * * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." # <<<<<<<<<<<<<< @@ -9949,19 +10191,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, 391, __pyx_L1_error) - __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 391, __pyx_L1_error) + __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_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, 391, __pyx_L1_error) + __PYX_ERR(0, 392, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 391, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 392, __pyx_L1_error) #endif - /* "constraint/constraints.py":392 + /* "constraint/constraints.py":393 * 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." # <<<<<<<<<<<<<< @@ -9970,23 +10212,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, 392, __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, 393, __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, 392, __pyx_L1_error) + __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 393, __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, 392, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 393, __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, 392, __pyx_L1_error) + __PYX_ERR(0, 393, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 392, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 393, __pyx_L1_error) #endif - /* "constraint/constraints.py":393 + /* "constraint/constraints.py":394 * 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." # <<<<<<<<<<<<<< @@ -9995,20 +10237,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); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_multipliers, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 394, __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, 393, __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, 394, __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, 393, __pyx_L1_error) + __PYX_ERR(0, 394, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 393, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 394, __pyx_L1_error) #endif - /* "constraint/constraints.py":390 + /* "constraint/constraints.py":391 * self._multipliers = multipliers * * if multipliers: # <<<<<<<<<<<<<< @@ -10017,10 +10259,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":376 + /* "constraint/constraints.py":377 * """ * - * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -10040,7 +10282,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":395 +/* "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 # <<<<<<<<<<<<<< @@ -10091,50 +10333,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, 395, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 396, __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, 395, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 396, __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, 395, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 396, __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, 395, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 396, __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, 395, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 396, __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, 395, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 396, __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, 395, __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, 396, __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, 395, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 396, __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, 395, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 396, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 395, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 396, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 395, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 396, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 395, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 396, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 395, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 396, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -10144,7 +10386,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, 395, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 396, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10155,9 +10397,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, 395, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 395, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 395, __pyx_L1_error) + 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) __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 */ @@ -10178,7 +10420,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":409 +/* "constraint/constraints.py":410 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -10198,7 +10440,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, 409, __pyx_L1_error) + __PYX_ERR(0, 410, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10209,7 +10451,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, 409, __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, 410, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -10253,17 +10495,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, 409, __pyx_L1_error) + __PYX_ERR(0, 410, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 409, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 410, __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, 409, __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, 410, __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, 409, __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, 410, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -10271,7 +10513,7 @@ 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, 409, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 410, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -10281,7 +10523,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain { 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, 409, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 410, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -10292,13 +10534,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 410, __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, 409, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 410, __pyx_L1_error) PyErr_Clear(); } break; @@ -10309,20 +10551,20 @@ 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, 409, __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, 409, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 409, __pyx_L1_error) + 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) __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, 409, __pyx_L1_error) } + 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 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 409, __pyx_L1_error) + __PYX_ERR(0, 410, __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, 409, __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; { @@ -10331,7 +10573,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain __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, 409, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = __pyx_t_4; @@ -10352,7 +10594,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, 409, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 410, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10383,7 +10625,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":410 +/* "constraint/constraints.py":411 * 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) # <<<<<<<<<<<<<< @@ -10403,7 +10645,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, 410, __pyx_L1_error) + __PYX_ERR(0, 411, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10414,7 +10656,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, 410, __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, 411, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -10458,17 +10700,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, 411, __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, 411, __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, 411, __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, 411, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -10476,7 +10718,7 @@ 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, 411, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -10486,7 +10728,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain { 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, 411, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -10497,13 +10739,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, 411, __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, 411, __pyx_L1_error) PyErr_Clear(); } break; @@ -10514,20 +10756,20 @@ 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, 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) __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, 410, __pyx_L1_error) } + 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 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 410, __pyx_L1_error) + __PYX_ERR(0, 411, __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_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; { @@ -10536,7 +10778,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain __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, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = __pyx_t_4; @@ -10557,7 +10799,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, 411, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10587,7 +10829,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":395 +/* "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 # <<<<<<<<<<<<<< @@ -10630,7 +10872,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, 395, __pyx_L1_error) + __PYX_ERR(0, 396, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10638,7 +10880,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":396 + /* "constraint/constraints.py":397 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -10646,9 +10888,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, 396, __pyx_L1_error) + __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_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, 396, __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, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -10668,34 +10910,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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_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, 396, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":398 + /* "constraint/constraints.py":399 * 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, 398, __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, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":400 + /* "constraint/constraints.py":401 * 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, 400, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 401, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/constraints.py":401 + /* "constraint/constraints.py":402 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -10705,7 +10947,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 401, __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, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; { @@ -10714,7 +10956,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 401, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -10722,9 +10964,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, 401, __pyx_L1_error) + __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_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, 401, __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, 402, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -10733,7 +10975,7 @@ 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, 401, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 402, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -10743,7 +10985,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 401, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 402, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -10754,13 +10996,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __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, 401, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 402, __pyx_L1_error) PyErr_Clear(); } break; @@ -10773,7 +11015,7 @@ 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, 401, __pyx_L1_error) + __PYX_ERR(0, 402, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -10783,22 +11025,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error) + 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, 401, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 402, __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, 401, __pyx_L1_error) + __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, 401, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 402, __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, 401, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 402, __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); @@ -10806,7 +11048,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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; __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 401, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 402, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; @@ -10814,7 +11056,7 @@ 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, 401, __pyx_L1_error) + __PYX_ERR(0, 402, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_var); @@ -10824,35 +11066,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":402 + /* "constraint/constraints.py":403 * 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, 402, __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, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":403 + /* "constraint/constraints.py":404 * 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, 403, __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, 404, __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_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, 403, __pyx_L1_error) + __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, 403, __pyx_L1_error) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -10861,7 +11103,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 403, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 404, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -10871,7 +11113,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 403, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 404, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -10882,13 +11124,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 403, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_12(__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, 403, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 404, __pyx_L1_error) PyErr_Clear(); } break; @@ -10898,21 +11140,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":404 + /* "constraint/constraints.py":405 * 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, 404, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __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, 404, __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, 405, __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, 404, __pyx_L1_error) + __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_t_5 = 1; @@ -10922,17 +11164,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 404, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - __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, 404, __pyx_L1_error) + __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_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, 404, __pyx_L1_error) + __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; if (__pyx_t_6) { - /* "constraint/constraints.py":405 + /* "constraint/constraints.py":406 * for value in domain[:]: * if value * multiplier > max(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< @@ -10946,12 +11188,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain 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, 405, __pyx_L1_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "constraint/constraints.py":404 + /* "constraint/constraints.py":405 * domain = domains[var] * for value in domain[:]: * if value * multiplier > max(domains[self.target_var]): # <<<<<<<<<<<<<< @@ -10960,7 +11202,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":403 + /* "constraint/constraints.py":404 * for var, multiplier in zip(self.sum_vars, multipliers): * domain = domains[var] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -10970,7 +11212,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":401 + /* "constraint/constraints.py":402 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -10980,7 +11222,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":400 + /* "constraint/constraints.py":401 * multipliers = self._multipliers * * if multipliers: # <<<<<<<<<<<<<< @@ -10990,7 +11232,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L3; } - /* "constraint/constraints.py":407 + /* "constraint/constraints.py":408 * domain.remove(value) * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -10998,16 +11240,16 @@ 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, 407, __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, 408, __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_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, 407, __pyx_L1_error) + __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, 407, __pyx_L1_error) + __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_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -11016,7 +11258,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 407, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 408, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -11026,7 +11268,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 407, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 408, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -11037,13 +11279,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error) } else { __pyx_t_2 = __pyx_t_8(__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, 407, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 408, __pyx_L1_error) PyErr_Clear(); } break; @@ -11055,19 +11297,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":408 + /* "constraint/constraints.py":409 * 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, 408, __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, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":409 + /* "constraint/constraints.py":410 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -11077,9 +11319,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 409, __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, 410, __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, 409, __pyx_L1_error) + __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_t_5 = 1; @@ -11089,13 +11331,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 409, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __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":410 + /* "constraint/constraints.py":411 * 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) # <<<<<<<<<<<<<< @@ -11105,9 +11347,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 410, __pyx_L1_error) + __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, 410, __pyx_L1_error) + __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_5 = 1; @@ -11117,29 +11359,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 410, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __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":411 + /* "constraint/constraints.py":412 * 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, 411, __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, 412, __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_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, 411, __pyx_L1_error) + __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, 411, __pyx_L1_error) + __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_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -11148,7 +11390,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_15); #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, 412, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -11158,7 +11400,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_15); #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, 412, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -11169,13 +11411,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) } else { __pyx_t_2 = __pyx_t_12(__pyx_t_15); 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, 411, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 412, __pyx_L1_error) PyErr_Clear(); } break; @@ -11185,21 +11427,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":412 + /* "constraint/constraints.py":413 * 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, 412, __pyx_L1_error) + __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_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, 412, __pyx_L1_error) + __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_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, 412, __pyx_L1_error) + __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_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_5 = 1; @@ -11209,17 +11451,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __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, 412, __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, 413, __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, 412, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_6) { - /* "constraint/constraints.py":413 + /* "constraint/constraints.py":414 * for value in domain[:]: * if value + others_min > max(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< @@ -11233,12 +11475,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain 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_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 413, __pyx_L1_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "constraint/constraints.py":412 + /* "constraint/constraints.py":413 * 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]): # <<<<<<<<<<<<<< @@ -11247,21 +11489,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":414 + /* "constraint/constraints.py":415 * 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, 414, __pyx_L1_error) + __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_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, 414, __pyx_L1_error) + __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, 414, __pyx_L1_error) + __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_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -11271,17 +11513,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 414, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __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, 414, __pyx_L1_error) + __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_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, 414, __pyx_L1_error) + __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; if (__pyx_t_6) { - /* "constraint/constraints.py":415 + /* "constraint/constraints.py":416 * domain.remove(value) * if value + others_max < min(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< @@ -11295,12 +11537,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain 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_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 415, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "constraint/constraints.py":414 + /* "constraint/constraints.py":415 * if value + others_min > max(domains[self.target_var]): * domain.remove(value) * if value + others_max < min(domains[self.target_var]): # <<<<<<<<<<<<<< @@ -11309,7 +11551,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":411 + /* "constraint/constraints.py":412 * 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[:]: # <<<<<<<<<<<<<< @@ -11319,7 +11561,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "constraint/constraints.py":407 + /* "constraint/constraints.py":408 * domain.remove(value) * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -11331,7 +11573,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __pyx_L3:; - /* "constraint/constraints.py":395 + /* "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 # <<<<<<<<<<<<<< @@ -11368,7 +11610,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":417 +/* "constraint/constraints.py":418 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -11419,53 +11661,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, 417, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 418, __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, 417, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 418, __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, 417, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 418, __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, 417, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 418, __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, 417, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 418, __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, 417, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 418, __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, 417, __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, 418, __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, 417, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 418, __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, 417, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 418, __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, 417, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 418, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 417, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 418, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 417, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 418, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 417, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 418, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -11479,7 +11721,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, 417, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 418, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11490,8 +11732,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, 417, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 417, __pyx_L1_error) + 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) __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 */ @@ -11541,32 +11783,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":418 + /* "constraint/constraints.py":419 * * 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, 418, __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, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":420 + /* "constraint/constraints.py":421 * 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, 420, __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, 421, __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, 420, __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, 421, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":421 + /* "constraint/constraints.py":422 * * if self.target_var not in assignments: * return True # can't evaluate without target, defer to later # <<<<<<<<<<<<<< @@ -11578,7 +11820,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":420 + /* "constraint/constraints.py":421 * multipliers = self._multipliers * * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -11587,22 +11829,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":423 + /* "constraint/constraints.py":424 * 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, 423, __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, 424, __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, 423, __pyx_L1_error) + __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_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":424 + /* "constraint/constraints.py":425 * * target_value = assignments[self.target_var] * sum_value = 0 # <<<<<<<<<<<<<< @@ -11612,7 +11854,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":425 + /* "constraint/constraints.py":426 * target_value = assignments[self.target_var] * sum_value = 0 * missing = False # <<<<<<<<<<<<<< @@ -11621,17 +11863,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ __pyx_v_missing = 0; - /* "constraint/constraints.py":427 + /* "constraint/constraints.py":428 * 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, 427, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 428, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":428 + /* "constraint/constraints.py":429 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -11641,7 +11883,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 428, __pyx_L1_error) + __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; { @@ -11650,7 +11892,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 428, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { @@ -11658,9 +11900,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 428, __pyx_L1_error) + __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_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, 428, __pyx_L1_error) + __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -11669,7 +11911,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 428, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 429, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -11679,7 +11921,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 428, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 429, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -11690,13 +11932,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_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, 428, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 429, __pyx_L1_error) PyErr_Clear(); } break; @@ -11709,7 +11951,7 @@ 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, 428, __pyx_L1_error) + __PYX_ERR(0, 429, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -11719,22 +11961,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L1_error) + 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, 428, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); } #else - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L1_error) + __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, 428, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #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, 428, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 429, __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); @@ -11742,7 +11984,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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; __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 428, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 429, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; @@ -11750,7 +11992,7 @@ 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, 428, __pyx_L1_error) + __PYX_ERR(0, 429, __pyx_L1_error) __pyx_L8_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_5); @@ -11758,35 +12000,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":429 + /* "constraint/constraints.py":430 * 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, 429, __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, 430, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":430 + /* "constraint/constraints.py":431 * 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, 430, __pyx_L1_error) + __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_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error) + __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_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, 430, __pyx_L1_error) + __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_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":429 + /* "constraint/constraints.py":430 * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: # <<<<<<<<<<<<<< @@ -11796,7 +12038,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L9; } - /* "constraint/constraints.py":432 + /* "constraint/constraints.py":433 * sum_value += assignments[var] * multiplier * else: * missing = True # <<<<<<<<<<<<<< @@ -11808,7 +12050,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __pyx_L9:; - /* "constraint/constraints.py":428 + /* "constraint/constraints.py":429 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -11818,7 +12060,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":427 + /* "constraint/constraints.py":428 * missing = False * * if multipliers: # <<<<<<<<<<<<<< @@ -11828,7 +12070,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L4; } - /* "constraint/constraints.py":434 + /* "constraint/constraints.py":435 * missing = True * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -11836,16 +12078,16 @@ 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, 434, __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, 435, __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; } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error) + __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_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, 434, __pyx_L1_error) + __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -11854,7 +12096,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 434, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 435, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -11864,7 +12106,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 434, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 435, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -11875,13 +12117,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_8(__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, 434, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 435, __pyx_L1_error) PyErr_Clear(); } break; @@ -11891,32 +12133,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":435 + /* "constraint/constraints.py":436 * 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, 435, __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, 436, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":436 + /* "constraint/constraints.py":437 * 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, 436, __pyx_L1_error) + __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_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) + __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":435 + /* "constraint/constraints.py":436 * else: * for var in self.sum_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -11926,7 +12168,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L13; } - /* "constraint/constraints.py":438 + /* "constraint/constraints.py":439 * sum_value += assignments[var] * else: * sum_value += min(domains[var]) # use min value if not assigned # <<<<<<<<<<<<<< @@ -11937,7 +12179,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 438, __pyx_L1_error) + __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; { @@ -11946,16 +12188,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 438, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 438, __pyx_L1_error) + __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; - /* "constraint/constraints.py":439 + /* "constraint/constraints.py":440 * else: * sum_value += min(domains[var]) # use min value if not assigned * missing = True # <<<<<<<<<<<<<< @@ -11966,7 +12208,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __pyx_L13:; - /* "constraint/constraints.py":434 + /* "constraint/constraints.py":435 * missing = True * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -11978,7 +12220,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __pyx_L4:; - /* "constraint/constraints.py":441 + /* "constraint/constraints.py":442 * missing = True * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -11988,7 +12230,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_t_2 = PyFloat_Check(__pyx_v_sum_value); if (__pyx_t_2) { - /* "constraint/constraints.py":442 + /* "constraint/constraints.py":443 * * if isinstance(sum_value, float): * sum_value = round(sum_value, 10) # <<<<<<<<<<<<<< @@ -12004,13 +12246,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 442, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __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":441 + /* "constraint/constraints.py":442 * missing = True * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -12019,7 +12261,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":444 + /* "constraint/constraints.py":445 * sum_value = round(sum_value, 10) * * if missing: # <<<<<<<<<<<<<< @@ -12028,19 +12270,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ if (__pyx_v_missing) { - /* "constraint/constraints.py":446 + /* "constraint/constraints.py":447 * 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, 446, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 446, __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, 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":447 + /* "constraint/constraints.py":448 * # Partial assignments: only check feasibility * if sum_value > target_value: * return False # <<<<<<<<<<<<<< @@ -12052,7 +12294,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":446 + /* "constraint/constraints.py":447 * if missing: * # Partial assignments: only check feasibility * if sum_value > target_value: # <<<<<<<<<<<<<< @@ -12061,33 +12303,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":448 + /* "constraint/constraints.py":449 * 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, 448, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 449, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":449 + /* "constraint/constraints.py":450 * 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, 449, __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, 450, __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; } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) + __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_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, 449, __pyx_L1_error) + __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -12096,7 +12338,7 @@ static PyObject *__pyx_pf_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, 449, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 450, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -12106,7 +12348,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 449, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 450, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -12117,13 +12359,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error) } else { __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, 449, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 450, __pyx_L1_error) PyErr_Clear(); } break; @@ -12133,55 +12375,55 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":450 + /* "constraint/constraints.py":451 * 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, 450, __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, 451, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":451 + /* "constraint/constraints.py":452 * 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, 451, __pyx_L1_error) + __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_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":452 + /* "constraint/constraints.py":453 * 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, 452, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 453, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":453 + /* "constraint/constraints.py":454 * 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, 453, __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, 454, __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_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, 453, __pyx_L1_error) + __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, 453, __pyx_L1_error) + __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -12190,7 +12432,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 453, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 454, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -12200,7 +12442,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 453, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 454, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -12211,13 +12453,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) } else { __pyx_t_3 = __pyx_t_12(__pyx_t_5); 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, 453, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 454, __pyx_L1_error) PyErr_Clear(); } break; @@ -12227,14 +12469,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":454 + /* "constraint/constraints.py":455 * 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, 454, __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, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __pyx_t_4; __Pyx_INCREF(__pyx_t_9); @@ -12244,34 +12486,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 454, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __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, 454, __pyx_L1_error) + __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_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, 454, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_value, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __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, 454, __pyx_L1_error) + __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_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_temp_sum, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":455 + /* "constraint/constraints.py":456 * 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, 455, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 455, __pyx_L1_error) + __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; if (__pyx_t_2) { - /* "constraint/constraints.py":456 + /* "constraint/constraints.py":457 * temp_sum = sum_value + (value * multipliers[self.sum_vars.index(var)]) * if temp_sum > target_value: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -12285,12 +12527,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain 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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":455 + /* "constraint/constraints.py":456 * for value in domain[:]: * temp_sum = sum_value + (value * multipliers[self.sum_vars.index(var)]) * if temp_sum > target_value: # <<<<<<<<<<<<<< @@ -12299,7 +12541,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":453 + /* "constraint/constraints.py":454 * domain = domains[var] * if multipliers: * for value in domain[:]: # <<<<<<<<<<<<<< @@ -12309,7 +12551,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":452 + /* "constraint/constraints.py":453 * if var not in assignments: * domain = domains[var] * if multipliers: # <<<<<<<<<<<<<< @@ -12319,7 +12561,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L22; } - /* "constraint/constraints.py":458 + /* "constraint/constraints.py":459 * domain.hideValue(value) * else: * for value in domain[:]: # <<<<<<<<<<<<<< @@ -12327,16 +12569,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain * if temp_sum > 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, 458, __pyx_L1_error) + __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_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, 458, __pyx_L1_error) + __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, 458, __pyx_L1_error) + __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_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { @@ -12345,7 +12587,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 458, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 459, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -12355,7 +12597,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 458, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 459, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -12366,13 +12608,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 459, __pyx_L1_error) } else { __pyx_t_5 = __pyx_t_12(__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, 458, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 459, __pyx_L1_error) PyErr_Clear(); } break; @@ -12382,31 +12624,31 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":459 + /* "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, 459, __pyx_L1_error) + __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; - /* "constraint/constraints.py":460 + /* "constraint/constraints.py":461 * for value in domain[:]: * temp_sum = sum_value + value * if temp_sum > 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, 460, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 460, __pyx_L1_error) + __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; if (__pyx_t_2) { - /* "constraint/constraints.py":461 + /* "constraint/constraints.py":462 * temp_sum = sum_value + value * if temp_sum > target_value: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -12420,12 +12662,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain 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, 461, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":460 + /* "constraint/constraints.py":461 * for value in domain[:]: * temp_sum = sum_value + value * if temp_sum > target_value: # <<<<<<<<<<<<<< @@ -12434,7 +12676,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":458 + /* "constraint/constraints.py":459 * domain.hideValue(value) * else: * for value in domain[:]: # <<<<<<<<<<<<<< @@ -12446,18 +12688,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __pyx_L22:; - /* "constraint/constraints.py":462 + /* "constraint/constraints.py":463 * if temp_sum > 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, 462, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 463, __pyx_L1_error) __pyx_t_13 = (!__pyx_t_2); if (__pyx_t_13) { - /* "constraint/constraints.py":463 + /* "constraint/constraints.py":464 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -12470,7 +12712,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":462 + /* "constraint/constraints.py":463 * if temp_sum > target_value: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -12479,7 +12721,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":450 + /* "constraint/constraints.py":451 * if forwardcheck: * for var in self.sum_vars: * if var not in assignments: # <<<<<<<<<<<<<< @@ -12488,7 +12730,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":449 + /* "constraint/constraints.py":450 * return False * if forwardcheck: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -12498,7 +12740,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":448 + /* "constraint/constraints.py":449 * if sum_value > target_value: * return False * if forwardcheck: # <<<<<<<<<<<<<< @@ -12507,7 +12749,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":464 + /* "constraint/constraints.py":465 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -12519,7 +12761,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":444 + /* "constraint/constraints.py":445 * sum_value = round(sum_value, 10) * * if missing: # <<<<<<<<<<<<<< @@ -12528,7 +12770,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":466 + /* "constraint/constraints.py":467 * return True * else: * return sum_value == target_value # <<<<<<<<<<<<<< @@ -12537,13 +12779,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, 466, __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, 467, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } - /* "constraint/constraints.py":417 + /* "constraint/constraints.py":418 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -12574,7 +12816,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":480 +/* "constraint/constraints.py":481 * """ * * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -12624,41 +12866,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, 480, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 481, __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, 480, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 481, __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, 480, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 481, __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, 480, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 481, __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, 480, __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, 481, __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, 480, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 481, __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, 480, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 481, __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, 480, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 481, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 480, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 481, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -12670,7 +12912,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, 480, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 481, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -12699,25 +12941,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint___init__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":489 + /* "constraint/constraints.py":490 * summed to be checked * """ * self._minsum = minsum # <<<<<<<<<<<<<< * self._multipliers = multipliers * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_minsum_2, __pyx_v_minsum) < 0) __PYX_ERR(0, 489, __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, 490, __pyx_L1_error) - /* "constraint/constraints.py":490 + /* "constraint/constraints.py":491 * """ * self._minsum = minsum * self._multipliers = multipliers # <<<<<<<<<<<<<< * * 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, 490, __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, 491, __pyx_L1_error) - /* "constraint/constraints.py":480 + /* "constraint/constraints.py":481 * """ * * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -12737,7 +12979,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint___init__ return __pyx_r; } -/* "constraint/constraints.py":492 +/* "constraint/constraints.py":493 * self._multipliers = multipliers * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -12788,53 +13030,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, 492, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 493, __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, 492, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 493, __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, 492, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 493, __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, 492, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 493, __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, 492, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 493, __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, 492, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 493, __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, 492, __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, 493, __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, 492, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 493, __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, 492, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 493, __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, 492, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 493, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 492, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 493, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 492, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 493, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 492, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 493, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -12848,7 +13090,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, 492, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 493, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -12859,8 +13101,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, 492, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 492, __pyx_L1_error) + 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); /* function exit code */ @@ -12903,7 +13145,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":494 + /* "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: # <<<<<<<<<<<<<< @@ -12915,9 +13157,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__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, 494, __pyx_L1_error) + __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, 494, __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, 495, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -12925,7 +13167,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__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, 494, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 495, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -12935,7 +13177,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ { 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, 494, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 495, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -12946,13 +13188,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error) + 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, 494, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 495, __pyx_L1_error) PyErr_Clear(); } break; @@ -12962,17 +13204,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":495 + /* "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, 495, __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, 496, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":496 + /* "constraint/constraints.py":497 * for variable in variables: * if variable not in assignments: * return True # <<<<<<<<<<<<<< @@ -12985,7 +13227,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":495 + /* "constraint/constraints.py":496 * # check if each variable is in the assignments * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -12994,7 +13236,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ */ } - /* "constraint/constraints.py":494 + /* "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: # <<<<<<<<<<<<<< @@ -13004,31 +13246,31 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":499 + /* "constraint/constraints.py":500 * * # with each variable assigned, sum the values * 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, 499, __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, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":500 + /* "constraint/constraints.py":501 * # with each variable assigned, sum the values * multipliers = self._multipliers * minsum = self._minsum # <<<<<<<<<<<<<< * sum = 0 * if multipliers: */ - __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, 500, __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, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_minsum = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":501 + /* "constraint/constraints.py":502 * multipliers = self._multipliers * minsum = self._minsum * sum = 0 # <<<<<<<<<<<<<< @@ -13038,17 +13280,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":502 + /* "constraint/constraints.py":503 * minsum = self._minsum * sum = 0 * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * sum += assignments[variable] * multiplier */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 502, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":503 + /* "constraint/constraints.py":504 * sum = 0 * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -13064,7 +13306,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ __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, 503, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -13072,9 +13314,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 503, __pyx_L1_error) + __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, 503, __pyx_L1_error) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -13083,7 +13325,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ { 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, 503, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 504, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -13093,7 +13335,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ { 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, 503, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 504, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -13104,13 +13346,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_3(__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, 503, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 504, __pyx_L1_error) PyErr_Clear(); } break; @@ -13123,7 +13365,7 @@ 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, 503, __pyx_L1_error) + __PYX_ERR(0, 504, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -13133,22 +13375,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error) + 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, 503, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __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, 503, __pyx_L1_error) + __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, 503, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __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, 503, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 504, __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); @@ -13156,7 +13398,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ __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; __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 503, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 504, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L11_unpacking_done; @@ -13164,7 +13406,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 503, __pyx_L1_error) + __PYX_ERR(0, 504, __pyx_L1_error) __pyx_L11_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); @@ -13172,25 +13414,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":504 + /* "constraint/constraints.py":505 * if multipliers: * for variable, multiplier in zip(variables, multipliers): * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< * 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, 504, __pyx_L1_error) + __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, 504, __pyx_L1_error) + __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, 504, __pyx_L1_error) + __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; - /* "constraint/constraints.py":503 + /* "constraint/constraints.py":504 * sum = 0 * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -13200,7 +13442,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":502 + /* "constraint/constraints.py":503 * minsum = self._minsum * sum = 0 * if multipliers: # <<<<<<<<<<<<<< @@ -13210,7 +13452,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ goto __pyx_L7; } - /* "constraint/constraints.py":506 + /* "constraint/constraints.py":507 * sum += assignments[variable] * multiplier * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -13223,9 +13465,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 506, __pyx_L1_error) + __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, 506, __pyx_L1_error) + __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) } for (;;) { if (likely(!__pyx_t_3)) { @@ -13233,7 +13475,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ { 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, 506, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 507, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -13243,7 +13485,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ { 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, 506, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 507, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -13254,13 +13496,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 506, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_3(__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, 506, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 507, __pyx_L1_error) PyErr_Clear(); } break; @@ -13270,22 +13512,22 @@ 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":507 + /* "constraint/constraints.py":508 * else: * for variable in variables: * sum += assignments[variable] # <<<<<<<<<<<<<< * 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, 507, __pyx_L1_error) + __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, 507, __pyx_L1_error) + __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; - /* "constraint/constraints.py":506 + /* "constraint/constraints.py":507 * sum += assignments[variable] * multiplier * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -13297,7 +13539,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ } __pyx_L7:; - /* "constraint/constraints.py":508 + /* "constraint/constraints.py":509 * for variable in variables: * sum += assignments[variable] * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -13307,7 +13549,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ __pyx_t_5 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_5) { - /* "constraint/constraints.py":509 + /* "constraint/constraints.py":510 * sum += assignments[variable] * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< @@ -13323,13 +13565,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ __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_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, 509, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":508 + /* "constraint/constraints.py":509 * for variable in variables: * sum += assignments[variable] * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -13338,7 +13580,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ */ } - /* "constraint/constraints.py":510 + /* "constraint/constraints.py":511 * if isinstance(sum, float): * sum = round(sum, 10) * return sum >= minsum # <<<<<<<<<<<<<< @@ -13346,12 +13588,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * 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, 510, __pyx_L1_error) + __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; goto __pyx_L0; - /* "constraint/constraints.py":492 + /* "constraint/constraints.py":493 * self._multipliers = multipliers * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -13379,10 +13621,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ return __pyx_r; } -/* "constraint/constraints.py":523 +/* "constraint/constraints.py":524 * """ # noqa: E501 * - * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -13430,47 +13672,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, 523, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 524, __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, 523, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 524, __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, 523, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 524, __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, 523, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 524, __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, 523, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 524, __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, 523, __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, 524, __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, 523, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, i); __PYX_ERR(0, 524, __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, 523, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 524, __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, 523, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 524, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 523, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 524, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 523, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 524, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -13483,7 +13725,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, 523, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 524, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -13494,7 +13736,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, 523, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 524, __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 */ @@ -13515,7 +13757,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":539 +/* "constraint/constraints.py":540 * 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." # <<<<<<<<<<<<<< @@ -13535,7 +13777,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, 539, __pyx_L1_error) + __PYX_ERR(0, 540, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -13543,7 +13785,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, 539, __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, 540, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -13581,16 +13823,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 539, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 539, __pyx_L1_error) } + 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 (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, 539, __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, 540, __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, 539, __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, 540, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -13598,7 +13840,7 @@ 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, 539, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 540, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -13608,7 +13850,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 539, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 540, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -13619,13 +13861,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 539, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __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, 539, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 540, __pyx_L1_error) PyErr_Clear(); } break; @@ -13683,10 +13925,10 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":523 +/* "constraint/constraints.py":524 * """ # noqa: E501 * - * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -13705,44 +13947,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":533 + /* "constraint/constraints.py":534 * 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, 533, __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, 534, __pyx_L1_error) - /* "constraint/constraints.py":534 + /* "constraint/constraints.py":535 * """ * 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, 534, __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, 535, __pyx_L1_error) - /* "constraint/constraints.py":535 + /* "constraint/constraints.py":536 * 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, 535, __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 + /* "constraint/constraints.py":538 * 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, 537, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 538, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/constraints.py":538 + /* "constraint/constraints.py":539 * * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." # <<<<<<<<<<<<<< @@ -13751,19 +13993,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, 538, __pyx_L1_error) - __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 538, __pyx_L1_error) + __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_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, 538, __pyx_L1_error) + __PYX_ERR(0, 539, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 538, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 539, __pyx_L1_error) #endif - /* "constraint/constraints.py":539 + /* "constraint/constraints.py":540 * 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." # <<<<<<<<<<<<<< @@ -13772,23 +14014,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, 539, __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, 540, __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, 539, __pyx_L1_error) + __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 540, __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, 539, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 540, __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, 539, __pyx_L1_error) + __PYX_ERR(0, 540, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 539, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 540, __pyx_L1_error) #endif - /* "constraint/constraints.py":540 + /* "constraint/constraints.py":541 * 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." # <<<<<<<<<<<<<< @@ -13797,20 +14039,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); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_multipliers, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __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, 540, __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, 541, __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, 540, __pyx_L1_error) + __PYX_ERR(0, 541, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 540, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 541, __pyx_L1_error) #endif - /* "constraint/constraints.py":537 + /* "constraint/constraints.py":538 * self._multipliers = multipliers * * if multipliers: # <<<<<<<<<<<<<< @@ -13819,10 +14061,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":523 + /* "constraint/constraints.py":524 * """ # noqa: E501 * - * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -13842,7 +14084,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":542 +/* "constraint/constraints.py":543 * 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 # <<<<<<<<<<<<<< @@ -13893,50 +14135,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, 542, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 543, __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, 542, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 543, __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, 542, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 543, __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, 542, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 543, __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, 542, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 543, __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, 542, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 543, __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, 542, __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, 543, __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, 542, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 543, __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, 542, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 543, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 542, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 543, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 542, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 543, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 542, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 543, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 542, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 543, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -13946,7 +14188,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, 542, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 543, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -13957,9 +14199,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, 542, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 542, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 542, __pyx_L1_error) + 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) __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 */ @@ -13980,7 +14222,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":550 +/* "constraint/constraints.py":551 * for var in self.sum_vars: * domain = domains[var] * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -14000,7 +14242,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, 550, __pyx_L1_error) + __PYX_ERR(0, 551, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -14011,7 +14253,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, 550, __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, 551, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -14055,17 +14297,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, 550, __pyx_L1_error) + __PYX_ERR(0, 551, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 550, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 551, __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, 550, __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, 551, __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, 550, __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, 551, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -14073,7 +14315,7 @@ 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, 550, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 551, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -14083,7 +14325,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 550, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 551, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -14094,13 +14336,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __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, 550, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 551, __pyx_L1_error) PyErr_Clear(); } break; @@ -14111,20 +14353,20 @@ 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, 550, __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, 550, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 550, __pyx_L1_error) + 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) __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, 550, __pyx_L1_error) } + 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 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 550, __pyx_L1_error) + __PYX_ERR(0, 551, __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, 550, __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; { @@ -14133,7 +14375,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ __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, 550, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = __pyx_t_4; @@ -14154,7 +14396,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, 550, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 551, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -14184,7 +14426,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":542 +/* "constraint/constraints.py":543 * 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 # <<<<<<<<<<<<<< @@ -14224,7 +14466,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, 542, __pyx_L1_error) + __PYX_ERR(0, 543, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -14232,7 +14474,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":543 + /* "constraint/constraints.py":544 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -14240,9 +14482,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, 543, __pyx_L1_error) + __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_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, 543, __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, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -14262,51 +14504,51 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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_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, 543, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":545 + /* "constraint/constraints.py":546 * 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, 545, __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, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":547 + /* "constraint/constraints.py":548 * 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, 547, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 548, __pyx_L1_error) __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { - /* "constraint/constraints.py":548 + /* "constraint/constraints.py":549 * * 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, 548, __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, 549, __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, 548, __pyx_L1_error) + __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_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, 548, __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, 549, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -14315,7 +14557,7 @@ 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, 548, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 549, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -14325,7 +14567,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 548, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 549, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -14336,13 +14578,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __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, 548, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 549, __pyx_L1_error) PyErr_Clear(); } break; @@ -14354,19 +14596,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":549 + /* "constraint/constraints.py":550 * 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, 549, __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, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":550 + /* "constraint/constraints.py":551 * for var in self.sum_vars: * domain = domains[var] * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -14376,9 +14618,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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, 550, __pyx_L1_error) + __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_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, 550, __pyx_L1_error) + __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_t_5 = 1; @@ -14388,29 +14630,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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, 550, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __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":551 + /* "constraint/constraints.py":552 * 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, 551, __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, 552, __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, 551, __pyx_L1_error) + __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, 551, __pyx_L1_error) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -14419,7 +14661,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 551, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 552, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -14429,7 +14671,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 551, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 552, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -14440,13 +14682,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __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, 551, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 552, __pyx_L1_error) PyErr_Clear(); } break; @@ -14456,21 +14698,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":552 + /* "constraint/constraints.py":553 * 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, 552, __pyx_L1_error) + __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_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, 552, __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, 553, __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, 552, __pyx_L1_error) + __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_t_5 = 1; @@ -14480,17 +14722,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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, 552, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } - __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, 552, __pyx_L1_error) + __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_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, 552, __pyx_L1_error) + __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; if (__pyx_t_7) { - /* "constraint/constraints.py":553 + /* "constraint/constraints.py":554 * for value in domain[:]: * if value + others_max < min(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< @@ -14504,12 +14746,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ 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, 553, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "constraint/constraints.py":552 + /* "constraint/constraints.py":553 * 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]): # <<<<<<<<<<<<<< @@ -14518,7 +14760,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":551 + /* "constraint/constraints.py":552 * domain = domains[var] * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) * for value in domain[:]: # <<<<<<<<<<<<<< @@ -14528,7 +14770,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":548 + /* "constraint/constraints.py":549 * * if not multipliers: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -14538,7 +14780,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":547 + /* "constraint/constraints.py":548 * multipliers = self._multipliers * * if not multipliers: # <<<<<<<<<<<<<< @@ -14547,7 +14789,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":542 + /* "constraint/constraints.py":543 * 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 # <<<<<<<<<<<<<< @@ -14581,7 +14823,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":555 +/* "constraint/constraints.py":556 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -14632,53 +14874,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, 555, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 556, __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, 555, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 556, __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, 555, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 556, __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, 555, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 556, __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, 555, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 556, __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, 555, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 556, __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, 555, __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, 556, __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, 555, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 556, __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, 555, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 556, __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, 555, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 556, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 555, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 556, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 555, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 556, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 555, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 556, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -14692,7 +14934,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, 555, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 556, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -14703,8 +14945,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, 555, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 555, __pyx_L1_error) + 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) __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 */ @@ -14748,32 +14990,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":556 + /* "constraint/constraints.py":557 * * 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, 556, __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, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":558 + /* "constraint/constraints.py":559 * 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, 558, __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, 559, __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, 558, __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, 559, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":559 + /* "constraint/constraints.py":560 * * if self.target_var not in assignments: * return True # can't evaluate without target, defer to later # <<<<<<<<<<<<<< @@ -14785,7 +15027,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":558 + /* "constraint/constraints.py":559 * multipliers = self._multipliers * * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -14794,22 +15036,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":561 + /* "constraint/constraints.py":562 * 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, 561, __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, 562, __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, 561, __pyx_L1_error) + __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_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":562 + /* "constraint/constraints.py":563 * * target_value = assignments[self.target_var] * sum_value = 0 # <<<<<<<<<<<<<< @@ -14819,17 +15061,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":564 + /* "constraint/constraints.py":565 * 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, 564, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 565, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":565 + /* "constraint/constraints.py":566 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -14839,7 +15081,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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, 565, __pyx_L1_error) + __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; { @@ -14848,7 +15090,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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, 565, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { @@ -14856,9 +15098,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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, 565, __pyx_L1_error) + __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_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, 565, __pyx_L1_error) + __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -14867,7 +15109,7 @@ 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, 565, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 566, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -14877,7 +15119,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 565, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 566, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -14888,13 +15130,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_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, 565, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 566, __pyx_L1_error) PyErr_Clear(); } break; @@ -14907,7 +15149,7 @@ 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, 565, __pyx_L1_error) + __PYX_ERR(0, 566, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -14917,22 +15159,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 565, __pyx_L1_error) + 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, 565, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); } #else - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 565, __pyx_L1_error) + __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, 565, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #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, 565, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 566, __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); @@ -14940,7 +15182,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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; __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 565, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 566, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; @@ -14948,7 +15190,7 @@ 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, 565, __pyx_L1_error) + __PYX_ERR(0, 566, __pyx_L1_error) __pyx_L8_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_5); @@ -14956,35 +15198,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":566 + /* "constraint/constraints.py":567 * 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, 566, __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, 567, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":567 + /* "constraint/constraints.py":568 * 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, 567, __pyx_L1_error) + __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_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error) + __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_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, 567, __pyx_L1_error) + __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_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":566 + /* "constraint/constraints.py":567 * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: # <<<<<<<<<<<<<< @@ -14994,7 +15236,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ goto __pyx_L9; } - /* "constraint/constraints.py":569 + /* "constraint/constraints.py":570 * sum_value += assignments[var] * multiplier * else: * sum_value += max(domains[var] * multiplier) # use max value if not assigned # <<<<<<<<<<<<<< @@ -15005,9 +15247,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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, 569, __pyx_L1_error) + __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_GOTREF(__pyx_t_9); - __pyx_t_11 = PyNumber_Multiply(__pyx_t_9, __pyx_v_multiplier); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 569, __pyx_L1_error) + __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; @@ -15017,10 +15259,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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, 569, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __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, 569, __pyx_L1_error) + __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_5); @@ -15028,7 +15270,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __pyx_L9:; - /* "constraint/constraints.py":565 + /* "constraint/constraints.py":566 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -15038,7 +15280,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":564 + /* "constraint/constraints.py":565 * sum_value = 0 * * if multipliers: # <<<<<<<<<<<<<< @@ -15048,7 +15290,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ goto __pyx_L4; } - /* "constraint/constraints.py":571 + /* "constraint/constraints.py":572 * sum_value += max(domains[var] * multiplier) # use max value if not assigned * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -15056,16 +15298,16 @@ 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, 571, __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, 572, __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; } else { - __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error) + __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, 571, __pyx_L1_error) + __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -15074,7 +15316,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 571, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 572, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -15084,7 +15326,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 571, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 572, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -15095,13 +15337,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_8(__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, 571, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 572, __pyx_L1_error) PyErr_Clear(); } break; @@ -15111,32 +15353,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":572 + /* "constraint/constraints.py":573 * 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, 572, __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, 573, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":573 + /* "constraint/constraints.py":574 * 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, 573, __pyx_L1_error) + __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_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 573, __pyx_L1_error) + __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_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":572 + /* "constraint/constraints.py":573 * else: * for var in self.sum_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -15146,7 +15388,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ goto __pyx_L13; } - /* "constraint/constraints.py":575 + /* "constraint/constraints.py":576 * sum_value += assignments[var] * else: * sum_value += max(domains[var]) # use max value if not assigned # <<<<<<<<<<<<<< @@ -15157,7 +15399,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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, 575, __pyx_L1_error) + __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; { @@ -15166,10 +15408,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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, 575, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 576, __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, 575, __pyx_L1_error) + __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_11); @@ -15177,7 +15419,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __pyx_L13:; - /* "constraint/constraints.py":571 + /* "constraint/constraints.py":572 * sum_value += max(domains[var] * multiplier) # use max value if not assigned * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -15189,7 +15431,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __pyx_L4:; - /* "constraint/constraints.py":577 + /* "constraint/constraints.py":578 * sum_value += max(domains[var]) # use max value if not assigned * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -15199,7 +15441,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __pyx_t_2 = PyFloat_Check(__pyx_v_sum_value); if (__pyx_t_2) { - /* "constraint/constraints.py":578 + /* "constraint/constraints.py":579 * * if isinstance(sum_value, float): * sum_value = round(sum_value, 10) # <<<<<<<<<<<<<< @@ -15215,13 +15457,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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, 578, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":577 + /* "constraint/constraints.py":578 * sum_value += max(domains[var]) # use max value if not assigned * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -15230,7 +15472,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":580 + /* "constraint/constraints.py":581 * sum_value = round(sum_value, 10) * * return sum_value >= target_value # <<<<<<<<<<<<<< @@ -15238,12 +15480,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, 580, __pyx_L1_error) + __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; goto __pyx_L0; - /* "constraint/constraints.py":555 + /* "constraint/constraints.py":556 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -15272,7 +15514,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":594 +/* "constraint/constraints.py":595 * """ * * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -15322,41 +15564,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, 594, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 595, __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, 594, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 595, __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, 594, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 595, __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, 594, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 595, __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, 594, __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, 595, __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, 594, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 595, __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, 594, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 595, __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, 594, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 595, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 594, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 595, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -15368,7 +15610,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, 594, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 595, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -15397,25 +15639,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":603 + /* "constraint/constraints.py":604 * summed to be checked * """ * self._maxsum = maxsum # <<<<<<<<<<<<<< * self._multipliers = multipliers * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxsum_2, __pyx_v_maxsum) < 0) __PYX_ERR(0, 603, __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, 604, __pyx_L1_error) - /* "constraint/constraints.py":604 + /* "constraint/constraints.py":605 * """ * self._maxsum = maxsum * self._multipliers = multipliers # <<<<<<<<<<<<<< * * 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, 604, __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, 605, __pyx_L1_error) - /* "constraint/constraints.py":594 + /* "constraint/constraints.py":595 * """ * * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -15435,7 +15677,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ return __pyx_r; } -/* "constraint/constraints.py":606 +/* "constraint/constraints.py":607 * self._multipliers = multipliers * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -15486,50 +15728,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, 606, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 607, __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, 606, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 607, __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, 606, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 607, __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, 606, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 607, __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, 606, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 607, __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, 606, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 607, __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, 606, __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, 607, __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, 606, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 607, __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, 606, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 607, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 606, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 607, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 606, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 607, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 606, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 607, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 606, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 607, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -15539,7 +15781,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, 606, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 607, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -15550,9 +15792,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, 606, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 606, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 606, __pyx_L1_error) + 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) __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 */ @@ -15573,7 +15815,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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":613 +/* "constraint/constraints.py":614 * variable_with_negative = None * for variable in variables: * contains_negative = any(value < 0 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -15593,7 +15835,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_10prePro 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, 613, __pyx_L1_error) + __PYX_ERR(0, 614, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -15601,7 +15843,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_10prePro __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, 613, __pyx_L1_error) + __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; @@ -15638,16 +15880,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10prePro return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 613, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 613, __pyx_L1_error) } + 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, 613, __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, 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, 613, __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, 614, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -15655,7 +15897,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10prePro { 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, 613, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 614, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -15665,7 +15907,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10prePro { 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, 613, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 614, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -15676,13 +15918,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10prePro #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __pyx_L1_error) + 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, 613, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 614, __pyx_L1_error) PyErr_Clear(); } break; @@ -15693,8 +15935,8 @@ static PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10prePro __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, 613, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 613, __pyx_L1_error) + __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); @@ -15733,7 +15975,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10prePro return __pyx_r; } -/* "constraint/constraints.py":606 +/* "constraint/constraints.py":607 * self._multipliers = multipliers * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -15773,7 +16015,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":607 + /* "constraint/constraints.py":608 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -15781,9 +16023,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * # check if there are any negative values 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, 607, __pyx_L1_error) + __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_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, 607, __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, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -15803,24 +16045,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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_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, 607, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":610 + /* "constraint/constraints.py":611 * * # 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, 610, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_variable_contains_negative = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":611 + /* "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 # <<<<<<<<<<<<<< @@ -15830,7 +16072,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_INCREF(Py_None); __pyx_v_variable_with_negative = Py_None; - /* "constraint/constraints.py":612 + /* "constraint/constraints.py":613 * variable_contains_negative: list[bool] = list() * variable_with_negative = None * for variable in variables: # <<<<<<<<<<<<<< @@ -15842,9 +16084,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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, 612, __pyx_L1_error) + __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_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, 612, __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, 613, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -15852,7 +16094,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 612, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 613, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -15862,7 +16104,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 612, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 613, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -15873,13 +16115,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __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, 612, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 613, __pyx_L1_error) PyErr_Clear(); } break; @@ -15889,44 +16131,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":613 + /* "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: */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __pyx_L1_error) + __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, 613, __pyx_L1_error) + __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, 613, __pyx_L1_error) + __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; - /* "constraint/constraints.py":614 + /* "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: */ - __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, 614, __pyx_L1_error) + __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) - /* "constraint/constraints.py":615 + /* "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, 615, __pyx_L1_error) + __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":616 + /* "constraint/constraints.py":617 * variable_contains_negative.append(contains_negative) * if contains_negative: * if variable_with_negative is not None: # <<<<<<<<<<<<<< @@ -15936,7 +16178,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __pyx_t_9 = (__pyx_v_variable_with_negative != Py_None); if (__pyx_t_9) { - /* "constraint/constraints.py":618 + /* "constraint/constraints.py":619 * if variable_with_negative is not None: * # if more than one associated variables contain negative, we can't prune * return # <<<<<<<<<<<<<< @@ -15948,7 +16190,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":616 + /* "constraint/constraints.py":617 * variable_contains_negative.append(contains_negative) * if contains_negative: * if variable_with_negative is not None: # <<<<<<<<<<<<<< @@ -15957,7 +16199,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc */ } - /* "constraint/constraints.py":619 + /* "constraint/constraints.py":620 * # if more than one associated variables contain negative, we can't prune * return * variable_with_negative = variable # <<<<<<<<<<<<<< @@ -15967,7 +16209,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_INCREF(__pyx_v_variable); __Pyx_DECREF_SET(__pyx_v_variable_with_negative, __pyx_v_variable); - /* "constraint/constraints.py":615 + /* "constraint/constraints.py":616 * contains_negative = any(value < 0 for value in domains[variable]) * variable_contains_negative.append(contains_negative) * if contains_negative: # <<<<<<<<<<<<<< @@ -15976,7 +16218,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc */ } - /* "constraint/constraints.py":612 + /* "constraint/constraints.py":613 * variable_contains_negative: list[bool] = list() * variable_with_negative = None * for variable in variables: # <<<<<<<<<<<<<< @@ -15986,41 +16228,41 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":622 + /* "constraint/constraints.py":623 * * # 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, 622, __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, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":623 + /* "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, 623, __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, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_maxsum = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":624 + /* "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, 624, __pyx_L1_error) + __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":625 + /* "constraint/constraints.py":626 * maxsum = self._maxsum * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -16036,7 +16278,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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, 625, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -16044,9 +16286,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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, 625, __pyx_L1_error) + __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, 625, __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, 626, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -16055,7 +16297,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 625, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 626, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16065,7 +16307,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 625, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 626, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16076,13 +16318,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __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, 625, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 626, __pyx_L1_error) PyErr_Clear(); } break; @@ -16095,7 +16337,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 625, __pyx_L1_error) + __PYX_ERR(0, 626, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -16105,22 +16347,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 625, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 625, __pyx_L1_error) + 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, 625, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 625, __pyx_L1_error) + __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; } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 625, __pyx_L1_error) + __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); @@ -16128,7 +16370,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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, 625, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 626, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L12_unpacking_done; @@ -16136,7 +16378,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 625, __pyx_L1_error) + __PYX_ERR(0, 626, __pyx_L1_error) __pyx_L12_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); @@ -16144,7 +16386,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":626 + /* "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: # <<<<<<<<<<<<<< @@ -16157,14 +16399,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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, 626, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 626, __pyx_L1_error) + __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":627 + /* "constraint/constraints.py":628 * for variable, multiplier in zip(variables, multipliers): * if variable_with_negative is not None and variable_with_negative != variable: * continue # <<<<<<<<<<<<<< @@ -16173,7 +16415,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc */ goto __pyx_L9_continue; - /* "constraint/constraints.py":626 + /* "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: # <<<<<<<<<<<<<< @@ -16182,35 +16424,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc */ } - /* "constraint/constraints.py":628 + /* "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, 628, __pyx_L1_error) + __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":629 + /* "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, 629, __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, 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, 629, __pyx_L1_error) + __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, 629, __pyx_L1_error) + __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 (;;) { @@ -16219,7 +16461,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 629, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 630, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -16229,7 +16471,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 629, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 630, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -16240,13 +16482,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc #endif ++__pyx_t_13; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error) + 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, 629, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 630, __pyx_L1_error) PyErr_Clear(); } break; @@ -16256,22 +16498,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":630 + /* "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, 630, __pyx_L1_error) + __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, 630, __pyx_L1_error) + __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, 630, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_9) { - /* "constraint/constraints.py":631 + /* "constraint/constraints.py":632 * for value in domain[:]: * if value * multiplier > maxsum: * domain.remove(value) # <<<<<<<<<<<<<< @@ -16285,12 +16527,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc 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, 631, __pyx_L1_error) + 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":630 + /* "constraint/constraints.py":631 * domain = domains[variable] * for value in domain[:]: * if value * multiplier > maxsum: # <<<<<<<<<<<<<< @@ -16299,7 +16541,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc */ } - /* "constraint/constraints.py":629 + /* "constraint/constraints.py":630 * continue * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -16309,7 +16551,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":625 + /* "constraint/constraints.py":626 * maxsum = self._maxsum * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -16320,7 +16562,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":624 + /* "constraint/constraints.py":625 * multipliers = self._multipliers * maxsum = self._maxsum * if multipliers: # <<<<<<<<<<<<<< @@ -16330,7 +16572,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc goto __pyx_L8; } - /* "constraint/constraints.py":633 + /* "constraint/constraints.py":634 * domain.remove(value) * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -16343,9 +16585,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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, 633, __pyx_L1_error) + __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, 633, __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, 634, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -16353,7 +16595,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 633, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 634, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16363,7 +16605,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 633, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 634, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16374,13 +16616,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 634, __pyx_L1_error) } else { __pyx_t_3 = __pyx_t_7(__pyx_t_2); 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, 633, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 634, __pyx_L1_error) PyErr_Clear(); } break; @@ -16390,7 +16632,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":634 + /* "constraint/constraints.py":635 * else: * for variable in variables: * if variable_with_negative is not None and variable_with_negative != variable: # <<<<<<<<<<<<<< @@ -16403,14 +16645,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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, 634, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 634, __pyx_L1_error) + __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":635 + /* "constraint/constraints.py":636 * for variable in variables: * if variable_with_negative is not None and variable_with_negative != variable: * continue # <<<<<<<<<<<<<< @@ -16419,7 +16661,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc */ goto __pyx_L21_continue; - /* "constraint/constraints.py":634 + /* "constraint/constraints.py":635 * else: * for variable in variables: * if variable_with_negative is not None and variable_with_negative != variable: # <<<<<<<<<<<<<< @@ -16428,35 +16670,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc */ } - /* "constraint/constraints.py":636 + /* "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, 636, __pyx_L1_error) + __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_t_3 = 0; - /* "constraint/constraints.py":637 + /* "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, 637, __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, 638, __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_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, 637, __pyx_L1_error) + __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, 637, __pyx_L1_error) + __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -16465,7 +16707,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 637, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 638, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -16475,7 +16717,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 637, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 638, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -16486,13 +16728,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc #endif ++__pyx_t_13; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 637, __pyx_L1_error) + 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, 637, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 638, __pyx_L1_error) PyErr_Clear(); } break; @@ -16502,19 +16744,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":638 + /* "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, 638, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 638, __pyx_L1_error) + __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":639 + /* "constraint/constraints.py":640 * for value in domain[:]: * if value > maxsum: * domain.remove(value) # <<<<<<<<<<<<<< @@ -16528,12 +16770,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc 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, 639, __pyx_L1_error) + 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":638 + /* "constraint/constraints.py":639 * domain = domains[variable] * for value in domain[:]: * if value > maxsum: # <<<<<<<<<<<<<< @@ -16542,7 +16784,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc */ } - /* "constraint/constraints.py":637 + /* "constraint/constraints.py":638 * continue * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -16552,7 +16794,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":633 + /* "constraint/constraints.py":634 * domain.remove(value) * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -16565,7 +16807,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } __pyx_L8:; - /* "constraint/constraints.py":606 + /* "constraint/constraints.py":607 * self._multipliers = multipliers * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -16600,7 +16842,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc return __pyx_r; } -/* "constraint/constraints.py":641 +/* "constraint/constraints.py":642 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -16651,53 +16893,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, 641, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 642, __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, 641, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 642, __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, 641, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 642, __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, 641, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 642, __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, 641, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 642, __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, 641, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 642, __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, 641, __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, 642, __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, 641, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 642, __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, 641, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 642, __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, 641, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 642, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 641, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 642, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 641, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 642, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 641, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 642, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -16711,7 +16953,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, 641, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 642, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -16722,8 +16964,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, 641, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 641, __pyx_L1_error) + 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) __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 */ @@ -16771,31 +17013,31 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":642 + /* "constraint/constraints.py":643 * * 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, 642, __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, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":643 + /* "constraint/constraints.py":644 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * multipliers = self._multipliers * maxsum = self._maxsum # <<<<<<<<<<<<<< * sum = 0 * if 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, 643, __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, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_maxsum = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":644 + /* "constraint/constraints.py":645 * multipliers = self._multipliers * maxsum = self._maxsum * sum = 0 # <<<<<<<<<<<<<< @@ -16805,17 +17047,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":645 + /* "constraint/constraints.py":646 * maxsum = self._maxsum * sum = 0 * 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, 645, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 646, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":646 + /* "constraint/constraints.py":647 * sum = 0 * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -16831,7 +17073,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __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_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, 646, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -16839,9 +17081,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __pyx_L1_error) + __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, 646, __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, 647, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -16850,7 +17092,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 646, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 647, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16860,7 +17102,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 646, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 647, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16871,13 +17113,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_7(__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, 646, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 647, __pyx_L1_error) PyErr_Clear(); } break; @@ -16890,7 +17132,7 @@ 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, 646, __pyx_L1_error) + __PYX_ERR(0, 647, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -16900,22 +17142,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error) + 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, 646, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 647, __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, 646, __pyx_L1_error) + __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, 646, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 647, __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, 646, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 647, __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); @@ -16923,7 +17165,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_GOTREF(__pyx_t_3); 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, 646, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 647, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; @@ -16931,7 +17173,7 @@ 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, 646, __pyx_L1_error) + __PYX_ERR(0, 647, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); @@ -16939,35 +17181,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":647 + /* "constraint/constraints.py":648 * if multipliers: * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * multiplier * if isinstance(sum, float): */ - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 647, __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, 648, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":648 + /* "constraint/constraints.py":649 * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< * 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, 648, __pyx_L1_error) + __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_GOTREF(__pyx_t_1); - __pyx_t_8 = PyNumber_Multiply(__pyx_t_1, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 648, __pyx_L1_error) + __pyx_t_8 = PyNumber_Multiply(__pyx_t_1, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 649, __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, 648, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __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":647 + /* "constraint/constraints.py":648 * if multipliers: * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: # <<<<<<<<<<<<<< @@ -16976,7 +17218,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":646 + /* "constraint/constraints.py":647 * sum = 0 * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -16986,7 +17228,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":649 + /* "constraint/constraints.py":650 * if variable in assignments: * sum += assignments[variable] * multiplier * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -16996,7 +17238,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_t_2 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_2) { - /* "constraint/constraints.py":650 + /* "constraint/constraints.py":651 * sum += assignments[variable] * multiplier * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< @@ -17012,13 +17254,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __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, 650, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":649 + /* "constraint/constraints.py":650 * if variable in assignments: * sum += assignments[variable] * multiplier * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -17027,19 +17269,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":651 + /* "constraint/constraints.py":652 * if isinstance(sum, float): * sum = round(sum, 10) * if sum > maxsum: # <<<<<<<<<<<<<< * return False * if forwardcheck: */ - __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, 651, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 651, __pyx_L1_error) + __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; if (__pyx_t_2) { - /* "constraint/constraints.py":652 + /* "constraint/constraints.py":653 * sum = round(sum, 10) * if sum > maxsum: * return False # <<<<<<<<<<<<<< @@ -17051,7 +17293,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":651 + /* "constraint/constraints.py":652 * if isinstance(sum, float): * sum = round(sum, 10) * if sum > maxsum: # <<<<<<<<<<<<<< @@ -17060,17 +17302,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":653 + /* "constraint/constraints.py":654 * if sum > maxsum: * return False * if forwardcheck: # <<<<<<<<<<<<<< * 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, 653, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 654, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":654 + /* "constraint/constraints.py":655 * return False * if forwardcheck: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -17086,7 +17328,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __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, 654, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { @@ -17094,9 +17336,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __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, 654, __pyx_L1_error) + __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, 654, __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, 655, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -17105,7 +17347,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_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, 654, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 655, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -17115,7 +17357,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 654, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 655, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -17126,13 +17368,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 655, __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, 654, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 655, __pyx_L1_error) PyErr_Clear(); } break; @@ -17145,7 +17387,7 @@ 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, 654, __pyx_L1_error) + __PYX_ERR(0, 655, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -17155,22 +17397,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 654, __pyx_L1_error) + 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, 654, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); } #else - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 654, __pyx_L1_error) + __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, 654, __pyx_L1_error) + __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); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); @@ -17178,7 +17420,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __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, 654, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 655, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L16_unpacking_done; @@ -17186,7 +17428,7 @@ 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, 654, __pyx_L1_error) + __PYX_ERR(0, 655, __pyx_L1_error) __pyx_L16_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_8); @@ -17194,45 +17436,45 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":655 + /* "constraint/constraints.py":656 * if forwardcheck: * 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, 655, __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, 656, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":656 + /* "constraint/constraints.py":657 * 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, 656, __pyx_L1_error) + __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; - /* "constraint/constraints.py":657 + /* "constraint/constraints.py":658 * 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, 657, __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, 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; } else { - __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L1_error) + __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, 657, __pyx_L1_error) + __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -17241,7 +17483,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 657, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 658, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -17251,7 +17493,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 657, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 658, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -17262,13 +17504,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 658, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_12(__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, 657, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 658, __pyx_L1_error) PyErr_Clear(); } break; @@ -17278,25 +17520,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":658 + /* "constraint/constraints.py":659 * 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, 658, __pyx_L1_error) + __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, 658, __pyx_L1_error) + __pyx_t_8 = PyNumber_Add(__pyx_v_sum, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 659, __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, 658, __pyx_L1_error) + __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_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, 658, __pyx_L1_error) + __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":659 + /* "constraint/constraints.py":660 * for value in domain[:]: * if sum + value * multiplier > maxsum: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -17310,12 +17552,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ 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, 659, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":658 + /* "constraint/constraints.py":659 * domain = domains[variable] * for value in domain[:]: * if sum + value * multiplier > maxsum: # <<<<<<<<<<<<<< @@ -17324,7 +17566,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":657 + /* "constraint/constraints.py":658 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -17334,18 +17576,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":660 + /* "constraint/constraints.py":661 * 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, 660, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":661 + /* "constraint/constraints.py":662 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -17358,7 +17600,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":660 + /* "constraint/constraints.py":661 * if sum + value * multiplier > maxsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -17367,7 +17609,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":655 + /* "constraint/constraints.py":656 * if forwardcheck: * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: # <<<<<<<<<<<<<< @@ -17376,7 +17618,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":654 + /* "constraint/constraints.py":655 * return False * if forwardcheck: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -17386,7 +17628,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":653 + /* "constraint/constraints.py":654 * if sum > maxsum: * return False * if forwardcheck: # <<<<<<<<<<<<<< @@ -17395,7 +17637,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":645 + /* "constraint/constraints.py":646 * maxsum = self._maxsum * sum = 0 * if multipliers: # <<<<<<<<<<<<<< @@ -17405,7 +17647,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ goto __pyx_L3; } - /* "constraint/constraints.py":663 + /* "constraint/constraints.py":664 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -17418,9 +17660,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __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, 663, __pyx_L1_error) + __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, 663, __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, 664, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -17428,7 +17670,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_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, 663, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 664, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -17438,7 +17680,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 663, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 664, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -17449,13 +17691,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __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, 663, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 664, __pyx_L1_error) PyErr_Clear(); } break; @@ -17465,32 +17707,32 @@ 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":664 + /* "constraint/constraints.py":665 * else: * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * if isinstance(sum, float): */ - __pyx_t_13 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 664, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":665 + /* "constraint/constraints.py":666 * for variable in variables: * if variable in assignments: * sum += assignments[variable] # <<<<<<<<<<<<<< * if isinstance(sum, float): * sum = round(sum, 10) */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error) + __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, 665, __pyx_L1_error) + __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; - /* "constraint/constraints.py":664 + /* "constraint/constraints.py":665 * else: * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -17499,7 +17741,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":663 + /* "constraint/constraints.py":664 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -17509,7 +17751,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":666 + /* "constraint/constraints.py":667 * if variable in assignments: * sum += assignments[variable] * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -17519,7 +17761,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_t_13 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_13) { - /* "constraint/constraints.py":667 + /* "constraint/constraints.py":668 * sum += assignments[variable] * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< @@ -17535,13 +17777,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __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, 667, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":666 + /* "constraint/constraints.py":667 * if variable in assignments: * sum += assignments[variable] * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -17550,19 +17792,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":668 + /* "constraint/constraints.py":669 * if isinstance(sum, float): * sum = round(sum, 10) * if sum > maxsum: # <<<<<<<<<<<<<< * return False * if forwardcheck: */ - __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, 668, __pyx_L1_error) - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 668, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":669 + /* "constraint/constraints.py":670 * sum = round(sum, 10) * if sum > maxsum: * return False # <<<<<<<<<<<<<< @@ -17574,7 +17816,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":668 + /* "constraint/constraints.py":669 * if isinstance(sum, float): * sum = round(sum, 10) * if sum > maxsum: # <<<<<<<<<<<<<< @@ -17583,17 +17825,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":670 + /* "constraint/constraints.py":671 * if sum > maxsum: * return False * if forwardcheck: # <<<<<<<<<<<<<< * 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, 670, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":671 + /* "constraint/constraints.py":672 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -17605,9 +17847,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __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, 671, __pyx_L1_error) + __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, 671, __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, 672, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -17615,7 +17857,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_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, 671, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 672, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -17625,7 +17867,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 671, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 672, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -17636,13 +17878,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 671, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 672, __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, 671, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 672, __pyx_L1_error) PyErr_Clear(); } break; @@ -17652,45 +17894,45 @@ 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":672 + /* "constraint/constraints.py":673 * if forwardcheck: * 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, 672, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":673 + /* "constraint/constraints.py":674 * 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, 673, __pyx_L1_error) + __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_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":674 + /* "constraint/constraints.py":675 * 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, 674, __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, 675, __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; } else { - __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error) + __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, 674, __pyx_L1_error) + __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -17699,7 +17941,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 674, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 675, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -17709,7 +17951,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 674, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 675, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -17720,13 +17962,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __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, 674, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 675, __pyx_L1_error) PyErr_Clear(); } break; @@ -17736,22 +17978,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":675 + /* "constraint/constraints.py":676 * 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, 675, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_v_sum, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 676, __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, 675, __pyx_L1_error) + __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_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, 675, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":676 + /* "constraint/constraints.py":677 * for value in domain[:]: * if sum + value > maxsum: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -17765,12 +18007,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ 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, 676, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":675 + /* "constraint/constraints.py":676 * domain = domains[variable] * for value in domain[:]: * if sum + value > maxsum: # <<<<<<<<<<<<<< @@ -17779,7 +18021,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":674 + /* "constraint/constraints.py":675 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -17789,18 +18031,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":677 + /* "constraint/constraints.py":678 * 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, 677, __pyx_L1_error) + __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); if (__pyx_t_2) { - /* "constraint/constraints.py":678 + /* "constraint/constraints.py":679 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -17813,7 +18055,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":677 + /* "constraint/constraints.py":678 * if sum + value > maxsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -17822,7 +18064,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":672 + /* "constraint/constraints.py":673 * if forwardcheck: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -17831,7 +18073,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":671 + /* "constraint/constraints.py":672 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -17841,7 +18083,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":670 + /* "constraint/constraints.py":671 * if sum > maxsum: * return False * if forwardcheck: # <<<<<<<<<<<<<< @@ -17852,7 +18094,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __pyx_L3:; - /* "constraint/constraints.py":679 + /* "constraint/constraints.py":680 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -17864,7 +18106,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":641 + /* "constraint/constraints.py":642 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -17894,10 +18136,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ return __pyx_r; } -/* "constraint/constraints.py":693 +/* "constraint/constraints.py":694 * """ # noqa: E501 * - * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -17945,47 +18187,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, 693, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 694, __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, 693, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 694, __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, 693, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 694, __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, 693, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 694, __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, 693, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 694, __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, 693, __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, 694, __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, 693, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, i); __PYX_ERR(0, 694, __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, 693, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 694, __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, 693, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 694, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 693, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 694, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 693, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 694, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -17998,7 +18240,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, 693, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 694, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18009,7 +18251,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, 693, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 694, __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 */ @@ -18030,7 +18272,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_8__init___2generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":709 +/* "constraint/constraints.py":710 * 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." # <<<<<<<<<<<<<< @@ -18050,7 +18292,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 709, __pyx_L1_error) + __PYX_ERR(0, 710, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -18058,7 +18300,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, 709, __pyx_L1_error) + __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_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -18096,16 +18338,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 709, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 709, __pyx_L1_error) } + 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 (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, 709, __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, 710, __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, 709, __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, 710, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -18113,7 +18355,7 @@ 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, 709, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 710, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -18123,7 +18365,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 709, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 710, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -18134,13 +18376,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 709, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 710, __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, 709, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 710, __pyx_L1_error) PyErr_Clear(); } break; @@ -18198,10 +18440,10 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":693 +/* "constraint/constraints.py":694 * """ # noqa: E501 * - * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -18220,44 +18462,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":703 + /* "constraint/constraints.py":704 * 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, 703, __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, 704, __pyx_L1_error) - /* "constraint/constraints.py":704 + /* "constraint/constraints.py":705 * """ * 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, 704, __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, 705, __pyx_L1_error) - /* "constraint/constraints.py":705 + /* "constraint/constraints.py":706 * 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, 705, __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, 706, __pyx_L1_error) - /* "constraint/constraints.py":707 + /* "constraint/constraints.py":708 * 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, 707, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 708, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/constraints.py":708 + /* "constraint/constraints.py":709 * * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." # <<<<<<<<<<<<<< @@ -18266,19 +18508,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, 708, __pyx_L1_error) - __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 708, __pyx_L1_error) + __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_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, 708, __pyx_L1_error) + __PYX_ERR(0, 709, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 708, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 709, __pyx_L1_error) #endif - /* "constraint/constraints.py":709 + /* "constraint/constraints.py":710 * 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." # <<<<<<<<<<<<<< @@ -18287,23 +18529,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, 709, __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, 710, __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, 709, __pyx_L1_error) + __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 710, __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, 709, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 710, __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, 709, __pyx_L1_error) + __PYX_ERR(0, 710, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 709, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 710, __pyx_L1_error) #endif - /* "constraint/constraints.py":710 + /* "constraint/constraints.py":711 * 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." # <<<<<<<<<<<<<< @@ -18312,20 +18554,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); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_multipliers, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 711, __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, 710, __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, 711, __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, 710, __pyx_L1_error) + __PYX_ERR(0, 711, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 710, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 711, __pyx_L1_error) #endif - /* "constraint/constraints.py":707 + /* "constraint/constraints.py":708 * self._multipliers = multipliers * * if multipliers: # <<<<<<<<<<<<<< @@ -18334,10 +18576,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":693 + /* "constraint/constraints.py":694 * """ # noqa: E501 * - * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -18357,7 +18599,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":712 +/* "constraint/constraints.py":713 * 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 # <<<<<<<<<<<<<< @@ -18408,50 +18650,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, 712, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 713, __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, 712, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 713, __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, 712, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 713, __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, 712, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 713, __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, 712, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 713, __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, 712, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 713, __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, 712, __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, 713, __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, 712, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 713, __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, 712, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 713, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 712, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 713, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 712, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 713, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 712, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 713, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 712, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 713, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -18461,7 +18703,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, 712, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 713, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18472,9 +18714,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, 712, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 712, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 712, __pyx_L1_error) + 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) __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 */ @@ -18495,7 +18737,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_10preProcess_2generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":720 +/* "constraint/constraints.py":721 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -18515,7 +18757,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 720, __pyx_L1_error) + __PYX_ERR(0, 721, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -18526,7 +18768,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_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, 720, __pyx_L1_error) + __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_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -18570,17 +18812,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, 720, __pyx_L1_error) + __PYX_ERR(0, 721, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 720, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 721, __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, 720, __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, 721, __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, 720, __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, 721, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -18588,7 +18830,7 @@ 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, 720, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 721, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -18598,7 +18840,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 720, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 721, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -18609,13 +18851,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 720, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __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, 720, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 721, __pyx_L1_error) PyErr_Clear(); } break; @@ -18626,20 +18868,20 @@ 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, 720, __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, 720, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 720, __pyx_L1_error) + 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) __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, 720, __pyx_L1_error) } + 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 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 720, __pyx_L1_error) + __PYX_ERR(0, 721, __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, 720, __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; { @@ -18648,7 +18890,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ __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, 720, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = __pyx_t_4; @@ -18669,7 +18911,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, 720, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 721, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -18699,7 +18941,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":712 +/* "constraint/constraints.py":713 * 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 # <<<<<<<<<<<<<< @@ -18739,7 +18981,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 712, __pyx_L1_error) + __PYX_ERR(0, 713, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -18747,7 +18989,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":713 + /* "constraint/constraints.py":714 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -18755,9 +18997,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, 713, __pyx_L1_error) + __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_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, 713, __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, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -18777,51 +19019,51 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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_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, 713, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":715 + /* "constraint/constraints.py":716 * 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, 715, __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, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":717 + /* "constraint/constraints.py":718 * 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, 717, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 718, __pyx_L1_error) __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { - /* "constraint/constraints.py":718 + /* "constraint/constraints.py":719 * * 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, 718, __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, 719, __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, 718, __pyx_L1_error) + __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_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, 718, __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, 719, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -18830,7 +19072,7 @@ 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, 718, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 719, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -18840,7 +19082,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 718, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 719, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -18851,13 +19093,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 718, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __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, 718, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 719, __pyx_L1_error) PyErr_Clear(); } break; @@ -18869,19 +19111,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":719 + /* "constraint/constraints.py":720 * 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, 719, __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, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":720 + /* "constraint/constraints.py":721 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -18891,9 +19133,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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, 720, __pyx_L1_error) + __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_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, 720, __pyx_L1_error) + __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_t_5 = 1; @@ -18903,29 +19145,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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, 720, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __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":721 + /* "constraint/constraints.py":722 * 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, 721, __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, 722, __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, 721, __pyx_L1_error) + __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, 721, __pyx_L1_error) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -18934,7 +19176,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 721, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 722, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -18944,7 +19186,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 721, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 722, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -18955,13 +19197,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __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, 721, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 722, __pyx_L1_error) PyErr_Clear(); } break; @@ -18971,21 +19213,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":722 + /* "constraint/constraints.py":723 * 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, 722, __pyx_L1_error) + __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_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, 722, __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, 723, __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, 722, __pyx_L1_error) + __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_t_5 = 1; @@ -18995,17 +19237,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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, 722, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } - __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, 722, __pyx_L1_error) + __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_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, 722, __pyx_L1_error) + __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; if (__pyx_t_7) { - /* "constraint/constraints.py":723 + /* "constraint/constraints.py":724 * for value in domain[:]: * if value + others_min > max(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< @@ -19019,12 +19261,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ 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, 723, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "constraint/constraints.py":722 + /* "constraint/constraints.py":723 * 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]): # <<<<<<<<<<<<<< @@ -19033,7 +19275,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":721 + /* "constraint/constraints.py":722 * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) * for value in domain[:]: # <<<<<<<<<<<<<< @@ -19043,7 +19285,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":718 + /* "constraint/constraints.py":719 * * if not multipliers: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -19053,7 +19295,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":717 + /* "constraint/constraints.py":718 * multipliers = self._multipliers * * if not multipliers: # <<<<<<<<<<<<<< @@ -19062,7 +19304,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":712 + /* "constraint/constraints.py":713 * 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 # <<<<<<<<<<<<<< @@ -19096,7 +19338,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":725 +/* "constraint/constraints.py":726 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -19147,53 +19389,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, 725, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 726, __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, 725, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 726, __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, 725, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 726, __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, 725, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 726, __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, 725, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 726, __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, 725, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 726, __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, 725, __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, 726, __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, 725, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 726, __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, 725, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 726, __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, 725, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 726, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 725, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 726, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 725, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 726, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 725, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 726, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -19207,7 +19449,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, 725, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 726, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19218,8 +19460,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, 725, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 725, __pyx_L1_error) + 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) __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 */ @@ -19263,32 +19505,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":726 + /* "constraint/constraints.py":727 * * 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, 726, __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, 727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":728 + /* "constraint/constraints.py":729 * 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, 728, __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, 729, __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, 728, __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, 729, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":729 + /* "constraint/constraints.py":730 * * if self.target_var not in assignments: * return True # can't evaluate without target, defer to later # <<<<<<<<<<<<<< @@ -19300,7 +19542,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":728 + /* "constraint/constraints.py":729 * multipliers = self._multipliers * * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -19309,22 +19551,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":731 + /* "constraint/constraints.py":732 * 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, 731, __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, 732, __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, 731, __pyx_L1_error) + __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_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":732 + /* "constraint/constraints.py":733 * * target_value = assignments[self.target_var] * sum_value = 0 # <<<<<<<<<<<<<< @@ -19334,17 +19576,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":734 + /* "constraint/constraints.py":735 * 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, 734, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 735, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":735 + /* "constraint/constraints.py":736 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -19354,7 +19596,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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, 735, __pyx_L1_error) + __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; { @@ -19363,7 +19605,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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, 735, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { @@ -19371,9 +19613,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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, 735, __pyx_L1_error) + __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_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, 735, __pyx_L1_error) + __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -19382,7 +19624,7 @@ 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, 735, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 736, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -19392,7 +19634,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 735, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 736, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -19403,13 +19645,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 736, __pyx_L1_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, 735, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 736, __pyx_L1_error) PyErr_Clear(); } break; @@ -19422,7 +19664,7 @@ 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, 735, __pyx_L1_error) + __PYX_ERR(0, 736, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -19432,22 +19674,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 735, __pyx_L1_error) + 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, 735, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); } #else - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 735, __pyx_L1_error) + __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, 735, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #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, 735, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 736, __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); @@ -19455,7 +19697,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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; __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 735, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 736, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; @@ -19463,7 +19705,7 @@ 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, 735, __pyx_L1_error) + __PYX_ERR(0, 736, __pyx_L1_error) __pyx_L8_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_5); @@ -19471,35 +19713,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":736 + /* "constraint/constraints.py":737 * 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, 736, __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, 737, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":737 + /* "constraint/constraints.py":738 * 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, 737, __pyx_L1_error) + __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_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error) + __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_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, 737, __pyx_L1_error) + __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_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":736 + /* "constraint/constraints.py":737 * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: # <<<<<<<<<<<<<< @@ -19509,7 +19751,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ goto __pyx_L9; } - /* "constraint/constraints.py":739 + /* "constraint/constraints.py":740 * sum_value += assignments[var] * multiplier * else: * sum_value += min(domains[var] * multiplier) # use min value if not assigned # <<<<<<<<<<<<<< @@ -19520,9 +19762,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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, 739, __pyx_L1_error) + __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_GOTREF(__pyx_t_9); - __pyx_t_11 = PyNumber_Multiply(__pyx_t_9, __pyx_v_multiplier); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 739, __pyx_L1_error) + __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; @@ -19532,10 +19774,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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, 739, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 740, __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, 739, __pyx_L1_error) + __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_5); @@ -19543,7 +19785,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __pyx_L9:; - /* "constraint/constraints.py":735 + /* "constraint/constraints.py":736 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -19553,7 +19795,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":734 + /* "constraint/constraints.py":735 * sum_value = 0 * * if multipliers: # <<<<<<<<<<<<<< @@ -19563,7 +19805,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ goto __pyx_L4; } - /* "constraint/constraints.py":741 + /* "constraint/constraints.py":742 * sum_value += min(domains[var] * multiplier) # use min value if not assigned * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -19571,16 +19813,16 @@ 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, 741, __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, 742, __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; } else { - __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 741, __pyx_L1_error) + __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, 741, __pyx_L1_error) + __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -19589,7 +19831,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 741, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 742, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -19599,7 +19841,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 741, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 742, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -19610,13 +19852,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 741, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 742, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_8(__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, 741, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 742, __pyx_L1_error) PyErr_Clear(); } break; @@ -19626,32 +19868,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":742 + /* "constraint/constraints.py":743 * 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, 742, __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, 743, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":743 + /* "constraint/constraints.py":744 * 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, 743, __pyx_L1_error) + __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_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 743, __pyx_L1_error) + __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_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":742 + /* "constraint/constraints.py":743 * else: * for var in self.sum_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -19661,7 +19903,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ goto __pyx_L13; } - /* "constraint/constraints.py":745 + /* "constraint/constraints.py":746 * sum_value += assignments[var] * else: * sum_value += min(domains[var]) # use min value if not assigned # <<<<<<<<<<<<<< @@ -19672,7 +19914,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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, 745, __pyx_L1_error) + __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; { @@ -19681,10 +19923,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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, 745, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __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, 745, __pyx_L1_error) + __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_11); @@ -19692,7 +19934,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __pyx_L13:; - /* "constraint/constraints.py":741 + /* "constraint/constraints.py":742 * sum_value += min(domains[var] * multiplier) # use min value if not assigned * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -19704,7 +19946,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __pyx_L4:; - /* "constraint/constraints.py":747 + /* "constraint/constraints.py":748 * sum_value += min(domains[var]) # use min value if not assigned * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -19714,7 +19956,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __pyx_t_2 = PyFloat_Check(__pyx_v_sum_value); if (__pyx_t_2) { - /* "constraint/constraints.py":748 + /* "constraint/constraints.py":749 * * if isinstance(sum_value, float): * sum_value = round(sum_value, 10) # <<<<<<<<<<<<<< @@ -19730,13 +19972,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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, 748, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":747 + /* "constraint/constraints.py":748 * sum_value += min(domains[var]) # use min value if not assigned * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -19745,7 +19987,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":750 + /* "constraint/constraints.py":751 * sum_value = round(sum_value, 10) * * return sum_value <= target_value # <<<<<<<<<<<<<< @@ -19753,12 +19995,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, 750, __pyx_L1_error) + __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; goto __pyx_L0; - /* "constraint/constraints.py":725 + /* "constraint/constraints.py":726 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -19787,7 +20029,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":764 +/* "constraint/constraints.py":765 * """ * * def __init__(self, exactprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -19836,39 +20078,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, 764, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 765, __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, 764, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 765, __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, 764, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 765, __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, 764, __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, 765, __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, 764, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 765, __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, 764, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 765, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 764, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 765, __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, 764, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 765, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19897,16 +20139,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint___ini int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":770 + /* "constraint/constraints.py":771 * exactprod: Value to be considered as the product * """ * self._exactprod = exactprod # <<<<<<<<<<<<<< * * 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, 770, __pyx_L1_error) + 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) - /* "constraint/constraints.py":764 + /* "constraint/constraints.py":765 * """ * * def __init__(self, exactprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -19926,7 +20168,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint___ini return __pyx_r; } -/* "constraint/constraints.py":772 +/* "constraint/constraints.py":773 * self._exactprod = exactprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -19977,50 +20219,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, 772, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 773, __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, 772, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 773, __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, 772, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 773, __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, 772, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 773, __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, 772, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 773, __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, 772, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 773, __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, 772, __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, 773, __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, 772, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 773, __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, 772, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 773, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 772, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 773, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 772, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 773, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 772, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 773, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 772, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 773, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -20030,7 +20272,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, 772, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 773, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20041,9 +20283,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, 772, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 772, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 772, __pyx_L1_error) + 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) __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 */ @@ -20064,7 +20306,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10preProcess_2generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":779 +/* "constraint/constraints.py":780 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -20084,7 +20326,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_10pre 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, 779, __pyx_L1_error) + __PYX_ERR(0, 780, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -20092,7 +20334,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, 779, __pyx_L1_error) + __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_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -20129,16 +20371,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 779, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 779, __pyx_L1_error) } + 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 (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, 779, __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, 780, __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, 779, __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, 780, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -20146,7 +20388,7 @@ 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, 779, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 780, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -20156,7 +20398,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre { 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, 780, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -20167,13 +20409,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 779, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 780, __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, 779, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 780, __pyx_L1_error) PyErr_Clear(); } break; @@ -20184,8 +20426,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, 779, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 779, __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, 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_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_XDECREF(__pyx_r); @@ -20224,7 +20466,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre return __pyx_r; } -/* "constraint/constraints.py":772 +/* "constraint/constraints.py":773 * self._exactprod = exactprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -20261,7 +20503,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":773 + /* "constraint/constraints.py":774 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -20269,9 +20511,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, 773, __pyx_L1_error) + __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_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, 773, __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, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -20291,24 +20533,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __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_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, 773, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":776 + /* "constraint/constraints.py":777 * * # 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, 776, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 777, __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, 776, __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, 777, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":777 + /* "constraint/constraints.py":778 * # check if there are any values less than 1 in the associated variables * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None # <<<<<<<<<<<<<< @@ -20318,7 +20560,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_INCREF(Py_None); __pyx_v_variable_with_lt1 = Py_None; - /* "constraint/constraints.py":778 + /* "constraint/constraints.py":779 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -20330,9 +20572,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, 778, __pyx_L1_error) + __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_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, 778, __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, 779, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -20340,7 +20582,7 @@ 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, 778, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 779, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -20350,7 +20592,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { 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, 778, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 779, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -20361,13 +20603,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 778, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 779, __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, 778, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 779, __pyx_L1_error) PyErr_Clear(); } break; @@ -20377,37 +20619,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":779 + /* "constraint/constraints.py":780 * 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, 779, __pyx_L1_error) + __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_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, 779, __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, 780, __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, 779, __pyx_L1_error) + __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 780, __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":780 + /* "constraint/constraints.py":781 * 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, 780, __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, 781, __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, 780, __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, 781, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":778 + /* "constraint/constraints.py":779 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -20417,7 +20659,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":781 + /* "constraint/constraints.py":782 * 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): # <<<<<<<<<<<<<< @@ -20427,7 +20669,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __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, 781, __pyx_L1_error) + __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_5 = 1; { @@ -20436,7 +20678,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __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, 781, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -20444,9 +20686,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, 781, __pyx_L1_error) + __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_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, 781, __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, 782, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -20455,7 +20697,7 @@ 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, 781, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 782, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -20465,7 +20707,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { 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, 781, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 782, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -20476,13 +20718,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __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, 781, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 782, __pyx_L1_error) PyErr_Clear(); } break; @@ -20495,7 +20737,7 @@ 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, 781, __pyx_L1_error) + __PYX_ERR(0, 782, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -20505,22 +20747,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L1_error) + 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, 781, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 782, __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, 781, __pyx_L1_error) + __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, 781, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 782, __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, 781, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 782, __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); @@ -20528,7 +20770,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __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; __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 781, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 782, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_unpacking_done; @@ -20536,7 +20778,7 @@ 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, 781, __pyx_L1_error) + __PYX_ERR(0, 782, __pyx_L1_error) __pyx_L9_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); @@ -20544,7 +20786,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":782 + /* "constraint/constraints.py":783 * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: # <<<<<<<<<<<<<< @@ -20554,7 +20796,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":783 + /* "constraint/constraints.py":784 * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< @@ -20564,7 +20806,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":785 + /* "constraint/constraints.py":786 * if variable_with_lt1 is not None: * # if more than one associated variables contain less than 1, we can't prune * return # <<<<<<<<<<<<<< @@ -20576,7 +20818,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/constraints.py":783 + /* "constraint/constraints.py":784 * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< @@ -20585,7 +20827,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ } - /* "constraint/constraints.py":786 + /* "constraint/constraints.py":787 * # if more than one associated variables contain less than 1, we can't prune * return * variable_with_lt1 = variable # <<<<<<<<<<<<<< @@ -20595,7 +20837,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":782 + /* "constraint/constraints.py":783 * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: # <<<<<<<<<<<<<< @@ -20604,7 +20846,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ } - /* "constraint/constraints.py":781 + /* "constraint/constraints.py":782 * 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): # <<<<<<<<<<<<<< @@ -20614,19 +20856,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":789 + /* "constraint/constraints.py":790 * * # 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, 789, __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, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_exactprod = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/constraints.py":790 + /* "constraint/constraints.py":791 * # prune the associated variables of values > exactprod * exactprod = self._exactprod * for variable in variables: # <<<<<<<<<<<<<< @@ -20638,9 +20880,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, 790, __pyx_L1_error) + __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_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, 790, __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, 791, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -20648,7 +20890,7 @@ 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, 790, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 791, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -20658,7 +20900,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { 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, 790, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 791, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -20669,13 +20911,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __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, 790, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 791, __pyx_L1_error) PyErr_Clear(); } break; @@ -20685,7 +20927,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":791 + /* "constraint/constraints.py":792 * exactprod = self._exactprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -20698,14 +20940,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, 791, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 791, __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, 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_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":792 + /* "constraint/constraints.py":793 * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: * continue # <<<<<<<<<<<<<< @@ -20714,7 +20956,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ goto __pyx_L13_continue; - /* "constraint/constraints.py":791 + /* "constraint/constraints.py":792 * exactprod = self._exactprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -20723,35 +20965,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ } - /* "constraint/constraints.py":793 + /* "constraint/constraints.py":794 * 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, 793, __pyx_L1_error) + __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_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":794 + /* "constraint/constraints.py":795 * 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, 794, __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, 795, __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_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, 794, __pyx_L1_error) + __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, 794, __pyx_L1_error) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -20760,7 +21002,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { 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, 794, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 795, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -20770,7 +21012,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { 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, 794, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 795, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -20781,13 +21023,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif ++__pyx_t_13; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 794, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 795, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_14(__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, 794, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 795, __pyx_L1_error) PyErr_Clear(); } break; @@ -20797,19 +21039,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":795 + /* "constraint/constraints.py":796 * 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, 795, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 795, __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, 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { - /* "constraint/constraints.py":796 + /* "constraint/constraints.py":797 * for value in domain[:]: * if value > exactprod: * domain.remove(value) # <<<<<<<<<<<<<< @@ -20823,12 +21065,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP 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, 796, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":795 + /* "constraint/constraints.py":796 * domain = domains[variable] * for value in domain[:]: * if value > exactprod: # <<<<<<<<<<<<<< @@ -20838,25 +21080,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP goto __pyx_L20; } - /* "constraint/constraints.py":797 + /* "constraint/constraints.py":798 * 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, 797, __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, 798, __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, 797, __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, 798, __pyx_L1_error) __pyx_t_11 = __pyx_t_12; __pyx_L21_bool_binop_done:; if (__pyx_t_11) { - /* "constraint/constraints.py":798 + /* "constraint/constraints.py":799 * domain.remove(value) * elif value == 0 and exactprod != 0: * domain.remove(value) # <<<<<<<<<<<<<< @@ -20870,12 +21112,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP 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, 798, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":797 + /* "constraint/constraints.py":798 * if value > exactprod: * domain.remove(value) * elif value == 0 and exactprod != 0: # <<<<<<<<<<<<<< @@ -20885,7 +21127,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __pyx_L20:; - /* "constraint/constraints.py":794 + /* "constraint/constraints.py":795 * continue * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -20895,7 +21137,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":790 + /* "constraint/constraints.py":791 * # prune the associated variables of values > exactprod * exactprod = self._exactprod * for variable in variables: # <<<<<<<<<<<<<< @@ -20906,7 +21148,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":772 + /* "constraint/constraints.py":773 * self._exactprod = exactprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -20938,7 +21180,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP return __pyx_r; } -/* "constraint/constraints.py":800 +/* "constraint/constraints.py":801 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -20989,53 +21231,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, 800, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 801, __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, 800, __pyx_L3_error) + 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, 800, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 801, __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, 800, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 801, __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, 800, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 801, __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, 800, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 801, __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, 800, __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, 801, __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, 800, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 801, __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, 800, __pyx_L3_error) + 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, 800, __pyx_L3_error) + 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, 800, __pyx_L3_error) + 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, 800, __pyx_L3_error) + 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, 800, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 801, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -21049,7 +21291,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, 800, __pyx_L3_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:; @@ -21060,8 +21302,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, 800, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 800, __pyx_L1_error) + 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); /* function exit code */ @@ -21111,19 +21353,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":801 + /* "constraint/constraints.py":802 * * 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, 801, __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, 802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_exactprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":802 + /* "constraint/constraints.py":803 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * exactprod = self._exactprod * prod = 1 # <<<<<<<<<<<<<< @@ -21133,7 +21375,7 @@ 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":803 + /* "constraint/constraints.py":804 * exactprod = self._exactprod * prod = 1 * missing = False # <<<<<<<<<<<<<< @@ -21142,19 +21384,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ __pyx_v_missing = 0; - /* "constraint/constraints.py":804 + /* "constraint/constraints.py":805 * prod = 1 * missing = False * missing_lt1 = [] # <<<<<<<<<<<<<< * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if variable in assignments: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_missing_lt1 = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":805 + /* "constraint/constraints.py":806 * missing = False * missing_lt1 = [] * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< @@ -21164,7 +21406,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __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, 805, __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, 806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; { @@ -21173,7 +21415,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __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, 805, __pyx_L1_error) + 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)) { @@ -21181,9 +21423,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 805, __pyx_L1_error) + __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, 805, __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, 806, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -21192,7 +21434,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca { 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, 805, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 806, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -21202,7 +21444,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca { 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, 805, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 806, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -21213,13 +21455,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 805, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 806, __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, 805, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 806, __pyx_L1_error) PyErr_Clear(); } break; @@ -21232,7 +21474,7 @@ 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, 805, __pyx_L1_error) + __PYX_ERR(0, 806, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -21242,22 +21484,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 805, __pyx_L1_error) + 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, 805, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 806, __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, 805, __pyx_L1_error) + __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, 805, __pyx_L1_error) + __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); #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, 805, __pyx_L1_error) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); @@ -21265,7 +21507,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __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, 805, __pyx_L1_error) + 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; @@ -21273,7 +21515,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 805, __pyx_L1_error) + __PYX_ERR(0, 806, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); @@ -21281,32 +21523,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":806 + /* "constraint/constraints.py":807 * missing_lt1 = [] * 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, 806, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":807 + /* "constraint/constraints.py":808 * 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, 807, __pyx_L1_error) + __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_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":806 + /* "constraint/constraints.py":807 * missing_lt1 = [] * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if variable in assignments: # <<<<<<<<<<<<<< @@ -21316,7 +21558,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca goto __pyx_L7; } - /* "constraint/constraints.py":809 + /* "constraint/constraints.py":810 * prod *= assignments[variable] * else: * missing = True # <<<<<<<<<<<<<< @@ -21326,26 +21568,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca /*else*/ { __pyx_v_missing = 1; - /* "constraint/constraints.py":810 + /* "constraint/constraints.py":811 * 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, 810, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":811 + /* "constraint/constraints.py":812 * 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, 811, __pyx_L1_error) + __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) - /* "constraint/constraints.py":810 + /* "constraint/constraints.py":811 * else: * missing = True * if contains_lt1: # <<<<<<<<<<<<<< @@ -21356,7 +21598,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca } __pyx_L7:; - /* "constraint/constraints.py":805 + /* "constraint/constraints.py":806 * missing = False * missing_lt1 = [] * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< @@ -21366,7 +21608,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":812 + /* "constraint/constraints.py":813 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -21376,7 +21618,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_t_10 = PyFloat_Check(__pyx_v_prod); if (__pyx_t_10) { - /* "constraint/constraints.py":813 + /* "constraint/constraints.py":814 * missing_lt1.append(variable) * if isinstance(prod, float): * prod = round(prod, 10) # <<<<<<<<<<<<<< @@ -21392,13 +21634,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __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, 813, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":812 + /* "constraint/constraints.py":813 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -21407,7 +21649,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":814 + /* "constraint/constraints.py":815 * if isinstance(prod, float): * prod = round(prod, 10) * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): # <<<<<<<<<<<<<< @@ -21419,8 +21661,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca goto __pyx_L13_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, 814, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 814, __pyx_L1_error) + __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) { } else { @@ -21428,21 +21670,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca goto __pyx_L12_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, 814, __pyx_L1_error) + __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) { } else { __pyx_t_10 = __pyx_t_12; goto __pyx_L12_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, 814, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 814, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":815 + /* "constraint/constraints.py":816 * prod = round(prod, 10) * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): * return False # <<<<<<<<<<<<<< @@ -21454,7 +21696,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":814 + /* "constraint/constraints.py":815 * if isinstance(prod, float): * prod = round(prod, 10) * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): # <<<<<<<<<<<<<< @@ -21463,17 +21705,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":816 + /* "constraint/constraints.py":817 * 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, 816, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":817 + /* "constraint/constraints.py":818 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -21485,9 +21727,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error) + __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, 817, __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, 818, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -21495,7 +21737,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca { 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, 817, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 818, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -21505,7 +21747,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca { 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, 817, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 818, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -21516,13 +21758,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __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, 817, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 818, __pyx_L1_error) PyErr_Clear(); } break; @@ -21532,60 +21774,60 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":818 + /* "constraint/constraints.py":819 * 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, 818, __pyx_L1_error) + __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) { } else { __pyx_t_10 = __pyx_t_12; goto __pyx_L20_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, 818, __pyx_L1_error) + __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) { } else { __pyx_t_10 = __pyx_t_12; goto __pyx_L20_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, 818, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":819 + /* "constraint/constraints.py":820 * 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, 819, __pyx_L1_error) + __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; - /* "constraint/constraints.py":820 + /* "constraint/constraints.py":821 * 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, 820, __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, 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_14 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 820, __pyx_L1_error) + __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, 820, __pyx_L1_error) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -21594,7 +21836,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca { 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, 820, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 821, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -21604,7 +21846,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca { 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, 820, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 821, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -21615,13 +21857,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca #endif ++__pyx_t_13; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_14(__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, 820, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 821, __pyx_L1_error) PyErr_Clear(); } break; @@ -21631,22 +21873,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":821 + /* "constraint/constraints.py":822 * 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, 821, __pyx_L1_error) + __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, 821, __pyx_L1_error) + __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, 821, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":822 + /* "constraint/constraints.py":823 * for value in domain[:]: * if prod * value > exactprod: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -21660,12 +21902,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca 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, 822, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":821 + /* "constraint/constraints.py":822 * domain = domains[variable] * for value in domain[:]: * if prod * value > exactprod: # <<<<<<<<<<<<<< @@ -21674,7 +21916,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":820 + /* "constraint/constraints.py":821 * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -21684,18 +21926,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":823 + /* "constraint/constraints.py":824 * 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, 823, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":824 + /* "constraint/constraints.py":825 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -21708,7 +21950,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "constraint/constraints.py":823 + /* "constraint/constraints.py":824 * if prod * value > exactprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -21717,7 +21959,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":818 + /* "constraint/constraints.py":819 * if forwardcheck: * for variable in variables: * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): # <<<<<<<<<<<<<< @@ -21726,7 +21968,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":817 + /* "constraint/constraints.py":818 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -21736,7 +21978,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":816 + /* "constraint/constraints.py":817 * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): * return False * if forwardcheck: # <<<<<<<<<<<<<< @@ -21745,19 +21987,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":825 + /* "constraint/constraints.py":826 * if not domain: * return False * return True # <<<<<<<<<<<<<< * - * + * class VariableExactProdConstraint(Constraint): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":800 + /* "constraint/constraints.py":801 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -21787,25 +22029,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca return __pyx_r; } -/* "constraint/constraints.py":841 +/* "constraint/constraints.py":839 * """ * - * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< - * """Instantiate a MaxProdConstraint. + * def __init__(self, target_var: str, product_vars: Sequence[str]): # <<<<<<<<<<<<<< + * """Instantiate a VariableExactProdConstraint. * */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_27VariableExactProdConstraint_1__init__(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_17MaxProdConstraint___init__, "Instantiate a MaxProdConstraint.\n\n Args:\n maxprod: Value to be considered as the maximum product\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_17MaxProdConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MaxProdConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_17MaxProdConstraint___init__}; -static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_1__init__(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_27VariableExactProdConstraint___init__, "Instantiate a VariableExactProdConstraint.\n\n Args:\n target_var (Variable): The target variable to match.\n product_vars (sequence of Variables): The variables to calculate the product of.\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_27VariableExactProdConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_27VariableExactProdConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_27VariableExactProdConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_27VariableExactProdConstraint_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -21813,12 +22055,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_maxprod = 0; + PyObject *__pyx_v_target_var = 0; + PyObject *__pyx_v_product_vars = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; + PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -21834,62 +22077,79 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #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_maxprod,0}; + 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, 841, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 839, __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) + CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 841, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 839, __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, 841, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 839, __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, 841, __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, 841, __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, 839, __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) } } - } else if (unlikely(__pyx_nargs != 2)) { + } 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, 841, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 839, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 841, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 839, __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) } __pyx_v_self = values[0]; - __pyx_v_maxprod = values[1]; + __pyx_v_target_var = ((PyObject*)values[1]); + __pyx_v_product_vars = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 841, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 839, __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.MaxProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.VariableExactProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_17MaxProdConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_maxprod); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 839, __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 */ + 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_17MaxProdConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_maxprod) { +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) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; @@ -21897,20 +22157,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); + /* "constraint/constraints.py":846 + * 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) + /* "constraint/constraints.py":847 - * maxprod: Value to be considered as the maximum product * """ - * self._maxprod = maxprod # <<<<<<<<<<<<<< + * self.target_var = target_var + * self.product_vars = product_vars # <<<<<<<<<<<<<< * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 + * def _get_product_bounds(self, domain_dict, exclude_var=None): */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxprod_2, __pyx_v_maxprod) < 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, 847, __pyx_L1_error) - /* "constraint/constraints.py":841 + /* "constraint/constraints.py":839 * """ * - * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< - * """Instantiate a MaxProdConstraint. + * def __init__(self, target_var: str, product_vars: Sequence[str]): # <<<<<<<<<<<<<< + * """Instantiate a VariableExactProdConstraint. * */ @@ -21918,7 +22187,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.VariableExactProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -21927,23 +22196,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ } /* "constraint/constraints.py":849 - * self._maxprod = maxprod - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * 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 = [] */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_3preProcess(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_27VariableExactProdConstraint_3_get_product_bounds(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_17MaxProdConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MaxProdConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_3preProcess(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_27VariableExactProdConstraint_2_get_product_bounds, "Return min and max product of domains of product_vars (excluding `exclude_var` if given)."); +static PyMethodDef __pyx_mdef_10constraint_11constraints_27VariableExactProdConstraint_3_get_product_bounds = {"_get_product_bounds", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_27VariableExactProdConstraint_3_get_product_bounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_27VariableExactProdConstraint_2_get_product_bounds}; +static PyObject *__pyx_pw_10constraint_11constraints_27VariableExactProdConstraint_3_get_product_bounds(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -21951,21 +22221,19 @@ 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; + PyObject *__pyx_v_domain_dict = 0; + PyObject *__pyx_v_exclude_var = 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}; + 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("preProcess (wrapper)", 0); + __Pyx_RefNannySetupContext("_get_product_bounds (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -21975,19 +22243,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #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}; + 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 (__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, 849, __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, 849, __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, 849, __pyx_L3_error) @@ -22004,912 +22264,1482 @@ 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, "preProcess", 0) < 0) __PYX_ERR(0, 849, __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, 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, 849, __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) } } - } 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, 849, __pyx_L3_error) - values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 849, __pyx_L3_error) - values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 849, __pyx_L3_error) - values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 849, __pyx_L3_error) - values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 849, __pyx_L3_error) + 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) + 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) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 849, __pyx_L3_error) + break; + default: goto __pyx_L5_argtuple_error; + } + if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); } __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]); + __pyx_v_domain_dict = values[1]; + __pyx_v_exclude_var = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 849, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 849, __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.MaxProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.VariableExactProdConstraint._get_product_bounds", __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, 849, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 849, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 849, __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); + __pyx_r = __pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_2_get_product_bounds(__pyx_self, __pyx_v_self, __pyx_v_domain_dict, __pyx_v_exclude_var); /* 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_17MaxProdConstraint_10preProcess_2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "constraint/constraints.py":856 - * 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): -*/ -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_12_genexpr *__pyx_cur_scope; +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) { + PyObject *__pyx_v_bounds = NULL; + PyObject *__pyx_v_var = NULL; + PyObject *__pyx_v_dom = NULL; + 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_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_12_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 856, __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_10preProcess_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_MaxProdConstraint_preProcess_loc, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 856, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.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_17MaxProdConstraint_10preProcess_2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_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; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + size_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *(*__pyx_t_15)(PyObject *); 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, 856, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 856, __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; + __Pyx_RefNannySetupContext("_get_product_bounds", 0); + + /* "constraint/constraints.py":851 + * 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_GOTREF(__pyx_t_1); + __pyx_v_bounds = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":852 + * """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_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_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __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, 856, __pyx_L1_error) + __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_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_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(!__pyx_t_4)) { + 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, 856, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 852, __pyx_L1_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); - ++__pyx_t_2; + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); + ++__pyx_t_3; } 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, 856, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 852, __pyx_L1_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (__pyx_t_3 >= __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)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); #endif - ++__pyx_t_2; + ++__pyx_t_3; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { + __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, 856, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 852, __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, 856, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 856, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":853 + * 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_DECREF(__pyx_t_1); __pyx_t_1 = 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":854 + * for var in self.product_vars: + * if var == exclude_var: + * continue # <<<<<<<<<<<<<< + * dom = domain_dict[var] + * bounds.append((min(dom), max(dom))) +*/ + goto __pyx_L3_continue; -/* "constraint/constraints.py":849 - * self._maxprod = maxprod - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + /* "constraint/constraints.py":853 + * bounds = [] + * for var in self.product_vars: + * if var == exclude_var: # <<<<<<<<<<<<<< + * continue + * dom = domain_dict[var] +*/ + } + + /* "constraint/constraints.py":855 + * if var == exclude_var: + * continue + * dom = domain_dict[var] # <<<<<<<<<<<<<< + * bounds.append((min(dom), max(dom))) * */ + __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_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_1); + __pyx_t_1 = 0; -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) { - PyObject *__pyx_v_variable_with_lt1 = NULL; - PyObject *__pyx_v_variable = NULL; - PyObject *__pyx_v_contains_lt1 = NULL; - PyObject *__pyx_v_maxprod = NULL; - PyObject *__pyx_v_domain = NULL; - PyObject *__pyx_v_value = NULL; - PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator9 = 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 *); - int __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - PyObject *(*__pyx_t_10)(PyObject *); - int __pyx_t_11; - int __pyx_t_12; - Py_ssize_t __pyx_t_13; - PyObject *(*__pyx_t_14)(PyObject *); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("preProcess", 0); - - /* "constraint/constraints.py":850 - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< + /* "constraint/constraints.py":856 + * continue + * dom = domain_dict[var] + * bounds.append((min(dom), max(dom))) # <<<<<<<<<<<<<< * - * # check if there are any values less than 1 in the associated variables + * all_bounds = [b for b in bounds] */ - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 850, __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, 850, __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(__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, 850, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = NULL; + __Pyx_INCREF(__pyx_builtin_min); + __pyx_t_7 = __pyx_builtin_min; + __pyx_t_8 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_dom}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __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_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __pyx_t_6 = NULL; + __Pyx_INCREF(__pyx_builtin_max); + __pyx_t_9 = __pyx_builtin_max; + __pyx_t_8 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_dom}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __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_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 856, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + } + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 856, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 856, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 856, __pyx_L1_error); + __pyx_t_1 = 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, 856, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "constraint/constraints.py":852 + * """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_L3_continue:; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":853 + /* "constraint/constraints.py":858 + * bounds.append((min(dom), max(dom))) * - * # 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: + * all_bounds = [b for b in bounds] # <<<<<<<<<<<<<< + * if not all_bounds: + * return 1, 1 */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __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, 853, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + { /* enter inner scope */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_2); + __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_9); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 858, __pyx_L9_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_3); + ++__pyx_t_3; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 858, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_b, __pyx_t_7); + __pyx_t_7 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_8genexpr9__pyx_v_b))) __PYX_ERR(0, 858, __pyx_L9_error) + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_b); __pyx_8genexpr9__pyx_v_b = 0; + goto __pyx_L13_exit_scope; + __pyx_L9_error:; + __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_b); __pyx_8genexpr9__pyx_v_b = 0; + goto __pyx_L1_error; + __pyx_L13_exit_scope:; + } /* exit inner scope */ + __pyx_v_all_bounds = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/constraints.py":854 - * # 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: - * contains_lt1 = any(value < 1 for value in domains[variable]) + /* "constraint/constraints.py":859 + * + * all_bounds = [b for b in bounds] + * if not all_bounds: # <<<<<<<<<<<<<< + * return 1, 1 + * */ - __Pyx_INCREF(Py_None); - __pyx_v_variable_with_lt1 = Py_None; + __pyx_t_5 = (__Pyx_PyList_GET_SIZE(__pyx_v_all_bounds) != 0); + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_5 < 0))) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_11 = (!__pyx_t_5); + if (__pyx_t_11) { - /* "constraint/constraints.py":855 - * self._variable_contains_lt1: list[bool] = list() - * 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) + /* "constraint/constraints.py":860 + * 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_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[0]); + __pyx_r = __pyx_mstate_global->__pyx_tuple[0]; + goto __pyx_L0; + + /* "constraint/constraints.py":859 + * + * all_bounds = [b for b in bounds] + * if not all_bounds: # <<<<<<<<<<<<<< + * return 1, 1 + * */ - 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, 855, __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, 855, __pyx_L1_error) } - for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + + /* "constraint/constraints.py":863 + * + * # 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] + * return min(products), max(products) +*/ + { /* enter inner scope */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 863, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_9); + { /* enter inner scope */ + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 863, __pyx_L22_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, 855, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 863, __pyx_L22_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; - } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); - ++__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, 855, __pyx_L1_error) + if (__pyx_t_3 >= __pyx_temp) break; + } + __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + ++__pyx_t_3; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 863, __pyx_L22_error) + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + 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, 863, __pyx_L22_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_12); + __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, 863, __pyx_L22_error) + __Pyx_XGOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 863, __pyx_L22_error) + __Pyx_XGOTREF(__pyx_t_13); + } + #else + __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 863, __pyx_L22_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 863, __pyx_L22_error) + __Pyx_GOTREF(__pyx_t_13); #endif - if (__pyx_t_6 >= __pyx_temp) break; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_14 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 863, __pyx_L22_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_L25_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_L25_unpacking_failed; + __Pyx_GOTREF(__pyx_t_13); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 863, __pyx_L22_error) + __pyx_t_15 = NULL; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L26_unpacking_done; + __pyx_L25_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, 863, __pyx_L22_error) + __pyx_L26_unpacking_done:; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); - #endif - ++__pyx_t_6; + __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_lo, __pyx_t_12); + __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_hi, __pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 863, __pyx_L22_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_9genexpr11__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr11__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_9genexpr11__pyx_v_lo) != (0)) __PYX_ERR(0, 863, __pyx_L22_error); + __Pyx_INCREF(__pyx_9genexpr11__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr11__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_9genexpr11__pyx_v_hi) != (0)) __PYX_ERR(0, 863, __pyx_L22_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 863, __pyx_L22_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error) + __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; + goto __pyx_L28_exit_scope; + __pyx_L22_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; + goto __pyx_L17_error; + __pyx_L28_exit_scope:; + } /* exit inner scope */ + __pyx_t_1 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 863, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_1); + __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, 863, __pyx_L17_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_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_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, 855, __pyx_L1_error) - PyErr_Clear(); + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 863, __pyx_L17_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, 863, __pyx_L17_error) + } + __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, 863, __pyx_L17_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + ++__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, 863, __pyx_L17_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3)); + #else + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); + #endif + ++__pyx_t_3; + } + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 863, __pyx_L17_error) + } else { + __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, 863, __pyx_L17_error) + PyErr_Clear(); + } + break; } - break; } + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_b, __pyx_t_7); + __pyx_t_7 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr10__pyx_v_b))) __PYX_ERR(0, 863, __pyx_L17_error) } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_b); __pyx_9genexpr10__pyx_v_b = 0; + goto __pyx_L30_exit_scope; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_b); __pyx_9genexpr10__pyx_v_b = 0; + goto __pyx_L1_error; + __pyx_L30_exit_scope:; + } /* exit inner scope */ + __pyx_v_candidates = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/constraints.py":856 - * 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): + /* "constraint/constraints.py":864 + * # 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] # <<<<<<<<<<<<<< + * return min(products), max(products) + * */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __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, 856, __pyx_L1_error) + { /* enter inner scope */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 864, __pyx_L33_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, 856, __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; + __pyx_t_1 = __pyx_v_candidates; __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, 864, __pyx_L33_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + ++__pyx_t_3; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 864, __pyx_L33_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_9genexpr12__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; + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_9genexpr12__pyx_v_p}; + __pyx_t_7 = __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_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 864, __pyx_L33_error) + __Pyx_GOTREF(__pyx_t_7); + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 864, __pyx_L33_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; + goto __pyx_L37_exit_scope; + __pyx_L33_error:; + __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_p); __pyx_9genexpr12__pyx_v_p = 0; + goto __pyx_L1_error; + __pyx_L37_exit_scope:; + } /* exit inner scope */ + __pyx_v_products = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/constraints.py":857 - * 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: + /* "constraint/constraints.py":865 + * 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) # <<<<<<<<<<<<<< + * + * def _safe_product(self, values): */ - __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, 857, __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, 857, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = NULL; + __Pyx_INCREF(__pyx_builtin_min); + __pyx_t_7 = __pyx_builtin_min; + __pyx_t_8 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_products}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __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_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_t_1 = NULL; + __Pyx_INCREF(__pyx_builtin_max); + __pyx_t_9 = __pyx_builtin_max; + __pyx_t_8 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_products}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __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_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + } + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 865, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 865, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_7 = 0; + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; - /* "constraint/constraints.py":855 - * self._variable_contains_lt1: list[bool] = list() - * 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) + /* "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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":858 - * 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: - * if variable_with_lt1 is not None: + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_AddTraceback("constraint.constraints.VariableExactProdConstraint._get_product_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_bounds); + __Pyx_XDECREF(__pyx_v_var); + __Pyx_XDECREF(__pyx_v_dom); + __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_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":867 + * return min(products), max(products) + * + * def _safe_product(self, values): # <<<<<<<<<<<<<< + * prod = 1 + * for v in values: */ - __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, 858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = 1; + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_27VariableExactProdConstraint_5_safe_product(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_27VariableExactProdConstraint_5_safe_product = {"_safe_product", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_27VariableExactProdConstraint_5_safe_product, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_27VariableExactProdConstraint_5_safe_product(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; + 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[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_safe_product (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 *__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)); - __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, 858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + 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, 867, __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, 867, __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, 867, __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, 867, __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, 867, __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, 867, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 867, __pyx_L3_error) + } + __pyx_v_self = values[0]; + __pyx_v_values = values[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_6 = 0; - __pyx_t_7 = NULL; + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 867, __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.VariableExactProdConstraint._safe_product", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_4_safe_product(__pyx_self, __pyx_v_self, __pyx_v_values); + + /* 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_27VariableExactProdConstraint_4_safe_product(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_v_prod = NULL; + PyObject *__pyx_v_v = 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_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_safe_product", 0); + + /* "constraint/constraints.py":868 + * + * def _safe_product(self, values): + * prod = 1 # <<<<<<<<<<<<<< + * for v in values: + * prod *= v +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); + __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; + + /* "constraint/constraints.py":869 + * def _safe_product(self, values): + * prod = 1 + * for v in values: # <<<<<<<<<<<<<< + * prod *= v + * return prod +*/ + if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) { + __pyx_t_1 = __pyx_v_values; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_3 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __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, 858, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __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, 869, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(!__pyx_t_3)) { + 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, 858, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 869, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6); - ++__pyx_t_6; + __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_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, 858, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 869, __pyx_L1_error) #endif - if (__pyx_t_6 >= __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_6)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif - ++__pyx_t_6; + ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 869, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_7(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { + __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, 858, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 869, __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, 858, __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_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __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, 858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __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, 858, __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; - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 858, __pyx_L1_error) - __pyx_t_10 = NULL; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L9_unpacking_done; - __pyx_L8_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, 858, __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_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":859 - * self._variable_contains_lt1.append(contains_lt1) - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): - * if contains_lt1 is True: # <<<<<<<<<<<<<< - * if variable_with_lt1 is not None: - * # if more than one associated variables contain less than 1, we can't prune + /* "constraint/constraints.py":870 + * prod = 1 + * for v in values: + * prod *= v # <<<<<<<<<<<<<< + * return prod + * */ - __pyx_t_11 = (__pyx_v_contains_lt1 == Py_True); - if (__pyx_t_11) { + __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":860 - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): - * if contains_lt1 is True: - * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< - * # if more than one associated variables contain less than 1, we can't prune - * return + /* "constraint/constraints.py":869 + * def _safe_product(self, values): + * prod = 1 + * for v in values: # <<<<<<<<<<<<<< + * prod *= v + * return prod */ - __pyx_t_11 = (__pyx_v_variable_with_lt1 != Py_None); - if (__pyx_t_11) { + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":862 - * if variable_with_lt1 is not None: - * # if more than one associated variables contain less than 1, we can't prune - * return # <<<<<<<<<<<<<< - * variable_with_lt1 = variable + /* "constraint/constraints.py":871 + * for v in values: + * prod *= v + * return prod # <<<<<<<<<<<<<< * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L0; - - /* "constraint/constraints.py":860 - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): - * if contains_lt1 is True: - * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< - * # if more than one associated variables contain less than 1, we can't prune - * return -*/ - } + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_prod); + __pyx_r = __pyx_v_prod; + goto __pyx_L0; - /* "constraint/constraints.py":863 - * # if more than one associated variables contain less than 1, we can't prune - * return - * variable_with_lt1 = variable # <<<<<<<<<<<<<< + /* "constraint/constraints.py":867 + * return min(products), max(products) * - * # prune the associated variables of values > maxprod + * def _safe_product(self, values): # <<<<<<<<<<<<<< + * prod = 1 + * for v in values: */ - __Pyx_INCREF(__pyx_v_variable); - __Pyx_DECREF_SET(__pyx_v_variable_with_lt1, __pyx_v_variable); - /* "constraint/constraints.py":859 - * self._variable_contains_lt1.append(contains_lt1) - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): - * if contains_lt1 is True: # <<<<<<<<<<<<<< - * if variable_with_lt1 is not None: - * # if more than one associated variables contain less than 1, we can't prune + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("constraint.constraints.VariableExactProdConstraint._safe_product", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_prod); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":873 + * return prod + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_27VariableExactProdConstraint_7preProcess(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_27VariableExactProdConstraint_7preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_27VariableExactProdConstraint_7preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_27VariableExactProdConstraint_7preProcess(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, 873, __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, 873, __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, 873, __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, 873, __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, 873, __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, 873, __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, 873, __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, 873, __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, 873, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 873, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 873, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 873, __pyx_L3_error) + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 873, __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, 873, __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.VariableExactProdConstraint.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, 873, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 873, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 873, __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); - /* "constraint/constraints.py":858 - * 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: - * if variable_with_lt1 is not None: + /* 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_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) { + PyObject *__pyx_v_target_domain = NULL; + PyObject *__pyx_v_target_min = NULL; + PyObject *__pyx_v_target_max = NULL; + PyObject *__pyx_v_var = NULL; + PyObject *__pyx_v_other_min = NULL; + PyObject *__pyx_v_other_max = NULL; + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_candidates = NULL; + PyObject *__pyx_v_minval = NULL; + PyObject *__pyx_v_maxval = 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; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + Py_ssize_t __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); + PyObject *__pyx_t_12 = NULL; + 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":874 + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< + * + * 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, 874, __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, 874, __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; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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(__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, 874, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":866 + /* "constraint/constraints.py":876 + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * - * # 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: + * target_domain = domains[self.target_var] # <<<<<<<<<<<<<< + * target_min = min(target_domain) + * target_max = max(target_domain) */ - __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, 866, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_maxprod = __pyx_t_2; - __pyx_t_2 = 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, 876, __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, 876, __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":867 - * # 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: - * continue + /* "constraint/constraints.py":877 + * + * target_domain = domains[self.target_var] + * target_min = min(target_domain) # <<<<<<<<<<<<<< + * target_max = max(target_domain) + * for var in self.product_vars: */ - 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_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_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, 877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __pyx_v_target_min = __pyx_t_4; + __pyx_t_4 = 0; + + /* "constraint/constraints.py":878 + * 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_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, 878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __pyx_v_target_max = __pyx_t_4; + __pyx_t_4 = 0; + + /* "constraint/constraints.py":879 + * 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, 879, __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_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 867, __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, 867, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __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, 879, __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, 867, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 879, __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_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); ++__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, 867, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 879, __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_2, __pyx_t_6)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); #else - __pyx_t_1 = __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_1)) __PYX_ERR(0, 867, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_7(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { + __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, 867, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 879, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); - __pyx_t_1 = 0; - - /* "constraint/constraints.py":868 - * maxprod = self._maxprod - * for variable in variables: - * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< - * continue - * domain = domains[variable] -*/ - __pyx_t_12 = (__pyx_v_variable_with_lt1 != Py_None); - if (__pyx_t_12) { - } else { - __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, 868, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 868, __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) { + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":869 - * for variable in variables: - * if variable_with_lt1 is not None and variable_with_lt1 != variable: - * continue # <<<<<<<<<<<<<< - * domain = domains[variable] + /* "constraint/constraints.py":880 + * 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] * for value in domain[:]: */ - goto __pyx_L13_continue; - - /* "constraint/constraints.py":868 - * maxprod = self._maxprod - * for variable in variables: - * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< - * continue - * domain = domains[variable] -*/ + __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_2, __pyx_v_domains}; + __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __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, 880, __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_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 880, __pyx_L1_error) + __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, 880, __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_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, 880, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __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, 880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __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, 880, __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_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, 880, __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; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_L6_unpacking_done:; } + __Pyx_XDECREF_SET(__pyx_v_other_min, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_other_max, __pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/constraints.py":870 - * if variable_with_lt1 is not None and variable_with_lt1 != variable: - * continue - * domain = domains[variable] # <<<<<<<<<<<<<< + /* "constraint/constraints.py":881 + * 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[:]: - * if value > maxprod: + * candidates = [value * other_min, value * other_max] */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":871 - * continue - * domain = domains[variable] + /* "constraint/constraints.py":882 + * other_min, other_max = self._get_product_bounds(domains, exclude_var=var) + * domain = domains[var] * for value in domain[:]: # <<<<<<<<<<<<<< - * if value > maxprod: - * domain.remove(value) + * candidates = [value * other_min, value * other_max] + * minval, maxval = min(candidates), max(candidates) */ - __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, 871, __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_13 = 0; - __pyx_t_14 = NULL; + __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, 882, __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_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 871, __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, 871, __pyx_L1_error) + __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __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, 882, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { - if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { + if (likely(!__pyx_t_11)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + 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, 871, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 882, __pyx_L1_error) #endif - if (__pyx_t_13 >= __pyx_temp) break; + if (__pyx_t_10 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_13); - ++__pyx_t_13; + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_10); + ++__pyx_t_10; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); + 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, 871, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 882, __pyx_L1_error) #endif - if (__pyx_t_13 >= __pyx_temp) break; + if (__pyx_t_10 >= __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_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_10); #endif - ++__pyx_t_13; + ++__pyx_t_10; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 882, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_14(__pyx_t_4); - if (unlikely(!__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, 871, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 882, __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":872 - * 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, 872, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 872, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_11) { + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":873 + /* "constraint/constraints.py":883 + * domain = domains[var] * for value in domain[:]: - * if value > maxprod: - * domain.remove(value) # <<<<<<<<<<<<<< - * elif value == 0 and maxprod < 0: - * domain.remove(value) + * candidates = [value * other_min, value * other_max] # <<<<<<<<<<<<<< + * minval, maxval = min(candidates), max(candidates) + * if maxval < target_min or minval > target_max: */ - __pyx_t_3 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_3); - __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, 873, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = PyNumber_Multiply(__pyx_v_value, __pyx_v_other_min); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 883, __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, 883, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 883, __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, 883, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 883, __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":872 - * domain = domains[variable] + /* "constraint/constraints.py":884 * for value in domain[:]: - * if value > maxprod: # <<<<<<<<<<<<<< + * candidates = [value * other_min, value * other_max] + * minval, maxval = min(candidates), max(candidates) # <<<<<<<<<<<<<< + * if maxval < target_min or minval > target_max: * domain.remove(value) - * elif value == 0 and maxprod < 0: */ - goto __pyx_L20; + __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_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, 884, __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_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, 884, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __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; - /* "constraint/constraints.py":874 - * if value > maxprod: - * domain.remove(value) - * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< + /* "constraint/constraints.py":885 + * 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_12 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 874, __pyx_L1_error) - if (__pyx_t_12) { + __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, 885, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 885, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_14) { } else { - __pyx_t_11 = __pyx_t_12; - goto __pyx_L21_bool_binop_done; + __pyx_t_13 = __pyx_t_14; + goto __pyx_L10_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, 874, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 874, __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) { + __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, 885, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 885, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_13 = __pyx_t_14; + __pyx_L10_bool_binop_done:; + if (__pyx_t_13) { - /* "constraint/constraints.py":875 - * domain.remove(value) - * elif value == 0 and maxprod < 0: + /* "constraint/constraints.py":886 + * minval, maxval = min(candidates), max(candidates) + * if maxval < target_min or minval > target_max: * domain.remove(value) # <<<<<<<<<<<<<< * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * 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_8 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_8); __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, 875, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 886, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":874 - * if value > maxprod: - * domain.remove(value) - * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< + /* "constraint/constraints.py":885 + * 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_L20:; - /* "constraint/constraints.py":871 - * continue - * domain = domains[variable] + /* "constraint/constraints.py":882 + * other_min, other_max = self._get_product_bounds(domains, exclude_var=var) + * domain = domains[var] * for value in domain[:]: # <<<<<<<<<<<<<< - * if value > maxprod: - * domain.remove(value) + * candidates = [value * other_min, value * other_max] + * minval, maxval = min(candidates), max(candidates) */ } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":867 - * # 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: - * continue + /* "constraint/constraints.py":879 + * 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_L13_continue:; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":849 - * self._maxprod = maxprod + /* "constraint/constraints.py":873 + * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) @@ -22924,40 +23754,45 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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:; - __Pyx_XDECREF(__pyx_v_variable_with_lt1); - __Pyx_XDECREF(__pyx_v_variable); - __Pyx_XDECREF(__pyx_v_contains_lt1); - __Pyx_XDECREF(__pyx_v_maxprod); + __Pyx_XDECREF(__pyx_v_target_domain); + __Pyx_XDECREF(__pyx_v_target_min); + __Pyx_XDECREF(__pyx_v_target_max); + __Pyx_XDECREF(__pyx_v_var); + __Pyx_XDECREF(__pyx_v_other_min); + __Pyx_XDECREF(__pyx_v_other_max); __Pyx_XDECREF(__pyx_v_domain); __Pyx_XDECREF(__pyx_v_value); - __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator9); + __Pyx_XDECREF(__pyx_v_candidates); + __Pyx_XDECREF(__pyx_v_minval); + __Pyx_XDECREF(__pyx_v_maxval); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":877 +/* "constraint/constraints.py":888 * domain.remove(value) * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * maxprod = self._maxprod - * prod = 1 + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * if self.target_var not in assignments: + * return True */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_5__call__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_27VariableExactProdConstraint_9__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_17MaxProdConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MaxProdConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_5__call__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_27VariableExactProdConstraint_9__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_27VariableExactProdConstraint_9__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_27VariableExactProdConstraint_9__call__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -22965,7 +23800,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_variables = 0; + CYTHON_UNUSED PyObject *__pyx_v_variables = 0; PyObject *__pyx_v_domains = 0; PyObject *__pyx_v_assignments = 0; PyObject *__pyx_v_forwardcheck = 0; @@ -22991,53 +23826,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, 877, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 888, __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, 877, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 888, __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, 877, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 888, __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, 877, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 888, __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, 877, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 888, __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, 877, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 888, __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, 877, __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, 888, __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, 877, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 888, __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, 877, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 888, __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, 877, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 888, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 877, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 888, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 877, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 888, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 877, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 888, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -23051,20 +23886,20 @@ 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, 877, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 888, __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.MaxProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.VariableExactProdConstraint.__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, 877, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 877, __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); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 888, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 888, __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 */ goto __pyx_L0; @@ -23082,666 +23917,1702 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* 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) { - PyObject *__pyx_v_maxprod = NULL; - PyObject *__pyx_v_prod = NULL; - int __pyx_v_missing; - PyObject *__pyx_v_missing_lt1 = NULL; - PyObject *__pyx_v_variable = NULL; - PyObject *__pyx_v_contains_lt1 = NULL; - PyObject *__pyx_v_domain = NULL; - PyObject *__pyx_v_value = NULL; +/* "constraint/constraints.py":911 + * 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) # <<<<<<<<<<<<<< + * possible_max = max(assigned_product * c for c in candidates) + * +*/ + +static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_8__call___genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *__pyx_cur_scope; 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 *); - 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; - PyObject *(*__pyx_t_14)(PyObject *); + 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_13_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_13_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + 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, 911, __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___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, 911, __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___2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_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_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_L6_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, 911, __pyx_L1_error) + } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 911, __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, 911, __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, 911, __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, 911, __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, 911, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 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_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 1; + return __pyx_r; + __pyx_L6_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; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 911, __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_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; +} +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":912 + * 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: +*/ + +static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_8__call___3genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10constraint_11constraints___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_11constraints___pyx_scope_struct_14_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_14_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + 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, 912, __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___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, 912, __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___5generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_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_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_L6_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, 912, __pyx_L1_error) + } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 912, __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, 912, __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, 912, __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, 912, __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, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 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_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 1; + return __pyx_r; + __pyx_L6_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; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 912, __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_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; +} +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":926 + * 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, 926, __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, 926, __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, 926, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 926, __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, 926, __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, 926, __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, 926, __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, 926, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 926, __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":888 + * 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 +*/ + +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) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *__pyx_cur_scope; + 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_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; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + size_t __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + 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; __Pyx_RefNannySetupContext("__call__", 0); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12___call__(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__, __pyx_mstate_global->__pyx_empty_tuple, NULL); + 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, 888, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } - /* "constraint/constraints.py":878 + /* "constraint/constraints.py":889 + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * if self.target_var not in assignments: # <<<<<<<<<<<<<< + * return True * - * 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, 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, 889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_maxprod = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 889, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { - /* "constraint/constraints.py":879 - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - * maxprod = self._maxprod - * prod = 1 # <<<<<<<<<<<<<< - * missing = False - * missing_lt1 = [] + /* "constraint/constraints.py":890 + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * if self.target_var not in assignments: + * return True # <<<<<<<<<<<<<< + * + * target_value = assignments[self.target_var] */ - __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); - __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; - /* "constraint/constraints.py":880 - * maxprod = self._maxprod - * prod = 1 - * missing = False # <<<<<<<<<<<<<< - * missing_lt1 = [] - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + /* "constraint/constraints.py":889 + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * if self.target_var not in assignments: # <<<<<<<<<<<<<< + * return True + * */ - __pyx_v_missing = 0; + } - /* "constraint/constraints.py":881 - * prod = 1 - * missing = False - * missing_lt1 = [] # <<<<<<<<<<<<<< - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): - * if variable in assignments: + /* "constraint/constraints.py":892 + * return True + * + * target_value = assignments[self.target_var] # <<<<<<<<<<<<<< + * assigned_product = 1 + * unassigned_vars = [] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __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, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_missing_lt1 = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __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":882 - * missing = False - * missing_lt1 = [] - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< - * if variable in assignments: - * prod *= assignments[variable] + /* "constraint/constraints.py":893 + * + * target_value = assignments[self.target_var] + * assigned_product = 1 # <<<<<<<<<<<<<< + * unassigned_vars = [] + * */ - __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, 882, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = 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, 882, __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_INCREF(__pyx_mstate_global->__pyx_int_1); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1); + __pyx_cur_scope->__pyx_v_assigned_product = __pyx_mstate_global->__pyx_int_1; + + /* "constraint/constraints.py":894 + * 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, 894, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_unassigned_vars = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "constraint/constraints.py":896 + * 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, 896, __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_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __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, 882, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __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, 896, __pyx_L1_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_3))) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + 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, 882, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 896, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + ++__pyx_t_4; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + 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, 882, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 896, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + 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_3, __pyx_t_6)); + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); #endif - ++__pyx_t_6; + ++__pyx_t_4; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_7(__pyx_t_3); - if (unlikely(!__pyx_t_1)) { + __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, 882, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 896, __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, 882, __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_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 882, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __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, 882, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __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_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 882, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __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, 882, __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; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 882, __pyx_L1_error) - __pyx_L6_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_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":883 - * missing_lt1 = [] - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): - * if variable in assignments: # <<<<<<<<<<<<<< - * prod *= assignments[variable] + /* "constraint/constraints.py":897 + * + * for var in self.product_vars: + * if var in assignments: # <<<<<<<<<<<<<< + * assigned_product *= assignments[var] * else: */ - __pyx_t_10 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 883, __pyx_L1_error) - if (__pyx_t_10) { + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 897, __pyx_L1_error) + if (__pyx_t_2) { - /* "constraint/constraints.py":884 - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): - * if variable in assignments: - * prod *= assignments[variable] # <<<<<<<<<<<<<< + /* "constraint/constraints.py":898 + * for var in self.product_vars: + * if var in assignments: + * assigned_product *= assignments[var] # <<<<<<<<<<<<<< * else: - * missing = True + * unassigned_vars.append(var) */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __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, 884, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 898, __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, 898, __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); + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_assigned_product, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; - /* "constraint/constraints.py":883 - * missing_lt1 = [] - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): - * if variable in assignments: # <<<<<<<<<<<<<< - * prod *= assignments[variable] + /* "constraint/constraints.py":897 + * + * for var in self.product_vars: + * if var in assignments: # <<<<<<<<<<<<<< + * assigned_product *= assignments[var] * else: */ - goto __pyx_L7; + goto __pyx_L6; } - /* "constraint/constraints.py":886 - * prod *= assignments[variable] + /* "constraint/constraints.py":900 + * assigned_product *= assignments[var] * else: - * missing = True # <<<<<<<<<<<<<< - * if contains_lt1: - * missing_lt1.append(variable) + * unassigned_vars.append(var) # <<<<<<<<<<<<<< + * + * if isinstance(assigned_product, float): */ /*else*/ { - __pyx_v_missing = 1; + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_unassigned_vars, __pyx_v_var); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 900, __pyx_L1_error) + } + __pyx_L6:; - /* "constraint/constraints.py":887 - * 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, 887, __pyx_L1_error) - if (__pyx_t_10) { - - /* "constraint/constraints.py":888 - * 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, 888, __pyx_L1_error) - - /* "constraint/constraints.py":887 - * else: - * missing = True - * if contains_lt1: # <<<<<<<<<<<<<< - * missing_lt1.append(variable) - * if isinstance(prod, float): -*/ - } - } - __pyx_L7:; - - /* "constraint/constraints.py":882 - * missing = False - * missing_lt1 = [] - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< - * if variable in assignments: - * prod *= assignments[variable] + /* "constraint/constraints.py":896 + * unassigned_vars = [] + * + * for var in self.product_vars: # <<<<<<<<<<<<<< + * if var in assignments: + * assigned_product *= assignments[var] */ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":889 - * 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: + /* "constraint/constraints.py":902 + * unassigned_vars.append(var) + * + * if isinstance(assigned_product, float): # <<<<<<<<<<<<<< + * assigned_product = round(assigned_product, 10) + * */ - __pyx_t_10 = PyFloat_Check(__pyx_v_prod); - if (__pyx_t_10) { + __pyx_t_1 = __pyx_cur_scope->__pyx_v_assigned_product; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyFloat_Check(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { - /* "constraint/constraints.py":890 - * 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 + /* "constraint/constraints.py":903 + * + * if isinstance(assigned_product, float): + * assigned_product = round(assigned_product, 10) # <<<<<<<<<<<<<< + * + * if not unassigned_vars: */ - __pyx_t_2 = NULL; + __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_1 = __pyx_builtin_round; - __pyx_t_5 = 1; + __pyx_t_3 = __pyx_builtin_round; + __pyx_t_8 = 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, 890, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + 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_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, 903, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_assigned_product); + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_assigned_product, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":889 - * 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: + /* "constraint/constraints.py":902 + * unassigned_vars.append(var) + * + * if isinstance(assigned_product, float): # <<<<<<<<<<<<<< + * assigned_product = round(assigned_product, 10) + * */ } - /* "constraint/constraints.py":891 - * if isinstance(prod, float): - * prod = round(prod, 10) - * if (not missing or len(missing_lt1) == 0) and prod > maxprod: # <<<<<<<<<<<<<< - * return False - * if forwardcheck: + /* "constraint/constraints.py":905 + * assigned_product = round(assigned_product, 10) + * + * if not unassigned_vars: # <<<<<<<<<<<<<< + * return assigned_product == target_value + * */ - __pyx_t_12 = (!__pyx_v_missing); - if (!__pyx_t_12) { - } else { - goto __pyx_L13_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, 891, __pyx_L1_error) - __pyx_t_12 = (__pyx_t_6 == 0); - if (__pyx_t_12) { - } else { - __pyx_t_10 = __pyx_t_12; - goto __pyx_L12_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, 891, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 891, __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_2 = (__Pyx_PyList_GET_SIZE(__pyx_v_unassigned_vars) != 0); + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 905, __pyx_L1_error) + __pyx_t_9 = (!__pyx_t_2); + if (__pyx_t_9) { - /* "constraint/constraints.py":892 - * prod = round(prod, 10) - * if (not missing or len(missing_lt1) == 0) and prod > maxprod: - * return False # <<<<<<<<<<<<<< - * if forwardcheck: - * for variable in variables: + /* "constraint/constraints.py":906 + * + * if not unassigned_vars: + * return assigned_product == target_value # <<<<<<<<<<<<<< + * + * # Partial assignment check feasibility */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; + __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, 906, __pyx_L1_error) + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":891 - * if isinstance(prod, float): - * prod = round(prod, 10) - * if (not missing or len(missing_lt1) == 0) and prod > maxprod: # <<<<<<<<<<<<<< - * return False - * if forwardcheck: + /* "constraint/constraints.py":905 + * assigned_product = round(assigned_product, 10) + * + * if not unassigned_vars: # <<<<<<<<<<<<<< + * return assigned_product == target_value + * */ } - /* "constraint/constraints.py":893 - * 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): + /* "constraint/constraints.py":909 + * + * # 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])] + * possible_min = min(assigned_product * c for c in candidates) */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 893, __pyx_L1_error) - if (__pyx_t_10) { + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 909, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_v_unassigned_vars; __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = 0; + for (;;) { + { + 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, 909, __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_4; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 909, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_v, __pyx_t_6); + __pyx_t_6 = 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, 909, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_12); + __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)); + __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, 909, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_6); + } + __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, 909, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_13); + __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, 909, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_11); + } + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 909, __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, 909, __pyx_L12_error); + __Pyx_GIVEREF(__pyx_t_11); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 909, __pyx_L12_error); + __pyx_t_6 = 0; + __pyx_t_11 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 909, __pyx_L12_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_v); __pyx_9genexpr13__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; + 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":894 - * return False - * 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] + /* "constraint/constraints.py":910 + * # 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])] # <<<<<<<<<<<<<< + * possible_min = min(assigned_product * c for c in candidates) + * possible_max = max(assigned_product * c for c in candidates) */ - 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; + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 910, __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, 910, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_3); + { /* enter inner scope */ + __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 910, __pyx_L24_error) + __Pyx_GOTREF(__pyx_t_10); + __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, 910, __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_4; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 910, __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; + 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, 910, __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_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, 910, __pyx_L24_error) + __Pyx_XGOTREF(__pyx_t_13); + __pyx_t_12 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 910, __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, 910, __pyx_L24_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 910, __pyx_L24_error) + __Pyx_GOTREF(__pyx_t_12); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_14 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 910, __pyx_L24_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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; + __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, 910, __pyx_L24_error) + __pyx_t_15 = NULL; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L28_unpacking_done; + __pyx_L27_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, 910, __pyx_L24_error) + __pyx_L28_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_lo, __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, 910, __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, 910, __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, 910, __pyx_L24_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 910, __pyx_L24_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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; + 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; + 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, 910, __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, 910, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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); + __pyx_t_4 = 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, 894, __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, 894, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 910, __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, 910, __pyx_L19_error) } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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_11))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + 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, 894, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 910, __pyx_L19_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_10 = __Pyx_PyList_GetItemRef(__pyx_t_11, __pyx_t_4); + ++__pyx_t_4; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + 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, 894, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 910, __pyx_L19_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + 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_3, __pyx_t_6)); + __pyx_t_10 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_4)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_4); #endif - ++__pyx_t_6; + ++__pyx_t_4; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 894, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 910, __pyx_L19_error) } else { - __pyx_t_1 = __pyx_t_7(__pyx_t_3); - if (unlikely(!__pyx_t_1)) { + __pyx_t_10 = __pyx_t_5(__pyx_t_11); + 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, 894, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 910, __pyx_L19_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_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_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, 910, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_10); + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 910, __pyx_L19_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_p); __pyx_9genexpr14__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; + 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":911 + * 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) # <<<<<<<<<<<<<< + * possible_max = max(assigned_product * c for c in candidates) + * +*/ + __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, 911, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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)); + __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, 911, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __pyx_v_possible_min = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":912 + * 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, 912, __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; + __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, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __pyx_v_possible_max = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":914 + * 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, 914, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 914, __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, 914, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 914, __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":915 + * + * if target_value < possible_min or target_value > possible_max: + * return False # <<<<<<<<<<<<<< + * + * if forwardcheck: +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "constraint/constraints.py":914 + * possible_max = max(assigned_product * c for c in candidates) + * + * if target_value < possible_min or target_value > possible_max: # <<<<<<<<<<<<<< + * return False + * +*/ + } + + /* "constraint/constraints.py":917 + * 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, 917, __pyx_L1_error) + if (__pyx_t_9) { - /* "constraint/constraints.py":895 + /* "constraint/constraints.py":918 + * * 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[:]: + * 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_12 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 895, __pyx_L1_error) - if (__pyx_t_12) { - } else { - __pyx_t_10 = __pyx_t_12; - goto __pyx_L19_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, 895, __pyx_L1_error) - if (!__pyx_t_12) { - } else { - __pyx_t_10 = __pyx_t_12; - goto __pyx_L19_bool_binop_done; + __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, 918, __pyx_L1_error) + #endif + if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_13 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 895, __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_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + ++__pyx_t_4; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 918, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":896 - * 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: + /* "constraint/constraints.py":919 + * 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])] */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); - __pyx_t_1 = 0; + { /* enter inner scope */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 919, __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, 919, __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, 919, __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, 919, __pyx_L41_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 919, __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, 919, __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":897 - * 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) + /* "constraint/constraints.py":920 + * 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])] + * */ - __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, 897, __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; + { /* enter inner scope */ + __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 920, __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, 920, __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, 920, __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, 920, __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, 920, __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, 920, __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, 920, __pyx_L51_error) + __Pyx_GOTREF(__pyx_t_13); + } + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 920, __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, 920, __pyx_L51_error); + __Pyx_GIVEREF(__pyx_t_13); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_13) != (0)) __PYX_ERR(0, 920, __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, 920, __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, 920, __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, 920, __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, 920, __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":921 + * 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, 921, __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, 921, __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, 921, __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, 921, __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, 921, __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, 921, __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, 921, __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, 921, __pyx_L63_error) + __Pyx_XGOTREF(__pyx_t_6); + __pyx_t_17 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 921, __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, 921, __pyx_L63_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_17 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 921, __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, 921, __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, 921, __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, 921, __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, 921, __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, 921, __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, 921, __pyx_L63_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_13))) __PYX_ERR(0, 921, __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, 921, __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, 921, __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_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 897, __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, 897, __pyx_L1_error) + __pyx_t_16 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 921, __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, 921, __pyx_L58_error) } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; for (;;) { - if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_12))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + 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, 897, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 921, __pyx_L58_error) #endif - if (__pyx_t_13 >= __pyx_temp) break; + if (__pyx_t_16 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_13); - ++__pyx_t_13; + __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_2); + 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, 897, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 921, __pyx_L58_error) #endif - if (__pyx_t_13 >= __pyx_temp) break; + 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_2, __pyx_t_13)); + __pyx_t_10 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_16)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_16); #endif - ++__pyx_t_13; + ++__pyx_t_16; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 897, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 921, __pyx_L58_error) } else { - __pyx_t_1 = __pyx_t_14(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { + __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, 897, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 921, __pyx_L58_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_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, 921, __pyx_L58_error) + __Pyx_GOTREF(__pyx_t_10); + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 921, __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":898 - * domain = domains[variable] - * for value in domain[:]: - * if prod * value > maxprod: # <<<<<<<<<<<<<< - * domain.hideValue(value) - * if not domain: + /* "constraint/constraints.py":923 + * 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_1 = PyNumber_Multiply(__pyx_v_prod, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __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, 898, __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, 898, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_10) { + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":899 - * for value in domain[:]: - * if prod * value > maxprod: - * domain.hideValue(value) # <<<<<<<<<<<<<< - * if not domain: - * return False + /* "constraint/constraints.py":924 + * + * 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_1 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = 0; + __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, 924, __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, 924, __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, 924, __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))) { { - 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, 899, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + 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, 924, __pyx_L1_error) + #endif + if (__pyx_t_16 >= __pyx_temp) break; } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __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, 924, __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, 924, __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, 924, __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":898 - * domain = domains[variable] - * for value in domain[:]: - * if prod * value > maxprod: # <<<<<<<<<<<<<< - * domain.hideValue(value) - * if not domain: + /* "constraint/constraints.py":925 + * 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, 925, __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, 925, __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, 925, __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, 925, __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, 925, __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, 925, __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":897 - * 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) + /* "constraint/constraints.py":926 + * 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_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __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, 926, __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, 926, __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, 926, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_9) { - /* "constraint/constraints.py":900 - * if prod * value > maxprod: - * domain.hideValue(value) - * if not domain: # <<<<<<<<<<<<<< - * return False - * return True + /* "constraint/constraints.py":927 + * 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_10 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 900, __pyx_L1_error) - __pyx_t_12 = (!__pyx_t_10); - if (__pyx_t_12) { - - /* "constraint/constraints.py":901 - * domain.hideValue(value) - * if not domain: - * return False # <<<<<<<<<<<<<< - * return True + __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, 927, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "constraint/constraints.py":926 + * 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":924 * + * 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_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L0; + } + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "constraint/constraints.py":900 - * if prod * value > maxprod: - * domain.hideValue(value) - * if not domain: # <<<<<<<<<<<<<< - * return False + /* "constraint/constraints.py":928 + * 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, 928, __pyx_L1_error) + __pyx_t_2 = (!__pyx_t_9); + if (__pyx_t_2) { + + /* "constraint/constraints.py":929 + * 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":895 - * 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[:]: + /* "constraint/constraints.py":928 + * if all(c != target_value for c in candidates): + * domain.hideValue(value) + * if not domain: # <<<<<<<<<<<<<< + * return False + * */ } - /* "constraint/constraints.py":894 - * return False + /* "constraint/constraints.py":918 + * * 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 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_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":893 - * if (not missing or len(missing_lt1) == 0) and prod > maxprod: + /* "constraint/constraints.py":917 * return False + * * if forwardcheck: # <<<<<<<<<<<<<< - * for variable in variables: - * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): + * for var in unassigned_vars: + * others = [v for v in unassigned_vars if v != var] */ } - /* "constraint/constraints.py":902 - * if not domain: - * return False + /* "constraint/constraints.py":931 + * return False + * * return True # <<<<<<<<<<<<<< * * @@ -23751,55 +25622,77 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":877 + /* "constraint/constraints.py":888 * domain.remove(value) * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * maxprod = self._maxprod - * prod = 1 + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * if self.target_var not in assignments: + * return True */ /* 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_8); - __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_6); + __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); + __Pyx_AddTraceback("constraint.constraints.VariableExactProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_maxprod); - __Pyx_XDECREF(__pyx_v_prod); - __Pyx_XDECREF(__pyx_v_missing_lt1); - __Pyx_XDECREF(__pyx_v_variable); - __Pyx_XDECREF(__pyx_v_contains_lt1); + __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_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":916 +/* "constraint/constraints.py":945 * """ * - * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< - * """Instantiate a MinProdConstraint. + * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< + * """Instantiate a MaxProdConstraint. * */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_1__init__(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_17MinProdConstraint___init__, "Instantiate a MinProdConstraint.\n\n Args:\n minprod: Value to be considered as the maximum product\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_17MinProdConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MinProdConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_17MinProdConstraint___init__}; -static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_1__init__(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_17MaxProdConstraint___init__, "Instantiate a MaxProdConstraint.\n\n Args:\n maxprod: Value to be considered as the maximum product\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_17MaxProdConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MaxProdConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_17MaxProdConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -23807,7 +25700,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_minprod = 0; + PyObject *__pyx_v_maxprod = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -23828,52 +25721,52 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #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_minprod,0}; + 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, 916, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 945, __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, 916, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 945, __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, 916, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 945, __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, 916, __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, 945, __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, 916, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 945, __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, 916, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 945, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 916, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 945, __pyx_L3_error) } __pyx_v_self = values[0]; - __pyx_v_minprod = values[1]; + __pyx_v_maxprod = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 916, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 945, __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.MinProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_17MinProdConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_minprod); + __pyx_r = __pyx_pf_10constraint_11constraints_17MaxProdConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_maxprod); /* function exit code */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -23883,7 +25776,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_minprod) { +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 int __pyx_lineno = 0; @@ -23891,20 +25784,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":922 - * minprod: Value to be considered as the maximum product + /* "constraint/constraints.py":951 + * maxprod: Value to be considered as the maximum product * """ - * self._minprod = minprod # <<<<<<<<<<<<<< + * self._maxprod = maxprod # <<<<<<<<<<<<<< * * 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, 922, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxprod_2, __pyx_v_maxprod) < 0) __PYX_ERR(0, 951, __pyx_L1_error) - /* "constraint/constraints.py":916 + /* "constraint/constraints.py":945 * """ * - * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< - * """Instantiate a MinProdConstraint. + * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< + * """Instantiate a MaxProdConstraint. * */ @@ -23912,7 +25805,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -23920,8 +25813,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ return __pyx_r; } -/* "constraint/constraints.py":924 - * self._minprod = minprod +/* "constraint/constraints.py":953 + * self._maxprod = maxprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) @@ -23929,15 +25822,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_3preProcess(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_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_17MinProdConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MinProdConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_3preProcess(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_17MaxProdConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MaxProdConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_3preProcess(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -23971,50 +25864,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, 924, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 953, __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, 924, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 953, __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, 924, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 953, __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, 924, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 953, __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, 924, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 953, __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, 924, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 953, __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, 924, __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, 953, __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, 924, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 953, __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, 924, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 953, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 924, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 953, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 924, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 953, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 924, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 953, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 924, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 953, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -24024,21 +25917,21 @@ 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, 924, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 953, __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.MinProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.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, 924, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 924, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 924, __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); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 953, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 953, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 953, __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 */ goto __pyx_L0; @@ -24056,12 +25949,184 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* 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) { - PyObject *__pyx_v_minprod = NULL; +/* "constraint/constraints.py":960 + * 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): +*/ + +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_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_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_16_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 960, __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_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, 960, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.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_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_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; + 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, 960, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 960, __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, 960, __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, 960, __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, 960, __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, 960, __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, 960, __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, 960, __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, 960, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 960, __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":953 + * self._maxprod = maxprod + * + * 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_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) { + PyObject *__pyx_v_variable_with_lt1 = NULL; PyObject *__pyx_v_variable = NULL; + PyObject *__pyx_v_contains_lt1 = NULL; + PyObject *__pyx_v_maxprod = NULL; PyObject *__pyx_v_domain = NULL; PyObject *__pyx_v_value = NULL; + PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator12 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -24071,26 +26136,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro size_t __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); - Py_ssize_t __pyx_t_8; - PyObject *(*__pyx_t_9)(PyObject *); - int __pyx_t_10; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *(*__pyx_t_10)(PyObject *); int __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + PyObject *(*__pyx_t_14)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":925 + /* "constraint/constraints.py":954 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< * - * # prune the associated variables of values > minprod + * # 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, 925, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 954, __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, 925, __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, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -24110,38 +26178,48 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro __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_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, 925, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":928 + /* "constraint/constraints.py":957 * - * # prune the associated variables of values > minprod - * minprod = self._minprod # <<<<<<<<<<<<<< + * # 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: - * 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, 928, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_minprod = __pyx_t_1; - __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1, __pyx_t_1) < 0) __PYX_ERR(0, 957, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":929 - * # prune the associated variables of values > minprod - * minprod = self._minprod + /* "constraint/constraints.py":958 + * # 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: + * contains_lt1 = any(value < 1 for value in domains[variable]) +*/ + __Pyx_INCREF(Py_None); + __pyx_v_variable_with_lt1 = Py_None; + + /* "constraint/constraints.py":959 + * self._variable_contains_lt1: list[bool] = list() + * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: + * contains_lt1 = any(value < 1 for value in domains[variable]) + * self._variable_contains_lt1.append(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_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, 929, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __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, 929, __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, 959, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -24149,7 +26227,7 @@ 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, 929, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 959, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -24159,7 +26237,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro { 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, 929, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 959, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -24170,13 +26248,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 929, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 959, __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, 929, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 959, __pyx_L1_error) PyErr_Clear(); } break; @@ -24186,150 +26264,539 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":930 - * minprod = self._minprod + /* "constraint/constraints.py":960 + * variable_with_lt1 = None * for variable in variables: - * domain = domains[variable] # <<<<<<<<<<<<<< - * for value in domain[:]: - * if value == 0 and minprod > 0: + * 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, 930, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 960, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_domain, __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, 960, __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, 960, __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":931 + /* "constraint/constraints.py":961 * for variable in variables: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value == 0 and minprod > 0: - * domain.remove(value) + * 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_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, 931, __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, 961, __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, 931, __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, 931, __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, 961, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - for (;;) { - if (likely(!__pyx_t_9)) { - 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, 931, __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_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, 931, __pyx_L1_error) - #endif - if (__pyx_t_8 >= __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_8)); - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); - #endif - ++__pyx_t_8; - } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 931, __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, 931, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); - __pyx_t_4 = 0; - /* "constraint/constraints.py":932 - * domain = domains[variable] - * for value in domain[:]: - * if value == 0 and minprod > 0: # <<<<<<<<<<<<<< - * domain.remove(value) - * + /* "constraint/constraints.py":959 + * self._variable_contains_lt1: list[bool] = list() + * 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) */ - __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, 932, __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, 932, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 932, __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) { + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":933 - * for value in domain[:]: - * if value == 0 and minprod > 0: - * domain.remove(value) # <<<<<<<<<<<<<< - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + /* "constraint/constraints.py":962 + * 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: + * if variable_with_lt1 is not None: */ - __pyx_t_3 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_5 = 0; + __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, 962, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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)); + __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, 962, __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_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, 962, __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, 962, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { { - 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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 933, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + 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) + #endif + if (__pyx_t_6 >= __pyx_temp) break; } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "constraint/constraints.py":932 - * domain = domains[variable] - * for value in domain[:]: - * if value == 0 and minprod > 0: # <<<<<<<<<<<<<< - * domain.remove(value) - * -*/ + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6); + ++__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, 962, __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_2, __pyx_t_6)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 962, __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, 962, __pyx_L1_error) + PyErr_Clear(); + } + break; } - - /* "constraint/constraints.py":931 - * for variable in variables: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value == 0 and minprod > 0: - * domain.remove(value) -*/ } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "constraint/constraints.py":929 - * # prune the associated variables of values > minprod - * minprod = self._minprod - * for variable in variables: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: -*/ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __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, 962, __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_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 962, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 962, __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, 962, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 962, __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, 962, __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; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_10 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_unpacking_done; + __pyx_L8_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, 962, __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_t_4 = 0; - /* "constraint/constraints.py":924 - * self._minprod = minprod + /* "constraint/constraints.py":963 + * self._variable_contains_lt1.append(contains_lt1) + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if contains_lt1 is True: # <<<<<<<<<<<<<< + * if variable_with_lt1 is not None: + * # if more than one associated variables contain less than 1, we can't prune +*/ + __pyx_t_11 = (__pyx_v_contains_lt1 == Py_True); + if (__pyx_t_11) { + + /* "constraint/constraints.py":964 + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if contains_lt1 is True: + * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< + * # if more than one associated variables contain less than 1, we can't prune + * return +*/ + __pyx_t_11 = (__pyx_v_variable_with_lt1 != Py_None); + if (__pyx_t_11) { + + /* "constraint/constraints.py":966 + * if variable_with_lt1 is not None: + * # if more than one associated variables contain less than 1, we can't prune + * return # <<<<<<<<<<<<<< + * variable_with_lt1 = variable + * +*/ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; + + /* "constraint/constraints.py":964 + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if contains_lt1 is True: + * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< + * # if more than one associated variables contain less than 1, we can't prune + * return +*/ + } + + /* "constraint/constraints.py":967 + * # if more than one associated variables contain less than 1, we can't prune + * return + * variable_with_lt1 = variable # <<<<<<<<<<<<<< + * + * # prune the associated variables of values > maxprod +*/ + __Pyx_INCREF(__pyx_v_variable); + __Pyx_DECREF_SET(__pyx_v_variable_with_lt1, __pyx_v_variable); + + /* "constraint/constraints.py":963 + * self._variable_contains_lt1.append(contains_lt1) + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if contains_lt1 is True: # <<<<<<<<<<<<<< + * if variable_with_lt1 is not None: + * # if more than one associated variables contain less than 1, we can't prune +*/ + } + + /* "constraint/constraints.py":962 + * 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: + * if variable_with_lt1 is not None: +*/ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":970 + * + * # 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, 970, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_maxprod = __pyx_t_2; + __pyx_t_2 = 0; + + /* "constraint/constraints.py":971 + * # 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: + * continue +*/ + 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; + } else { + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 971, __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, 971, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_7)) { + 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, 971, __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_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, 971, __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_2, __pyx_t_6)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __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, 971, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":972 + * maxprod = self._maxprod + * for variable in variables: + * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< + * continue + * domain = domains[variable] +*/ + __pyx_t_12 = (__pyx_v_variable_with_lt1 != Py_None); + if (__pyx_t_12) { + } else { + __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, 972, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 972, __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":973 + * for variable in variables: + * if variable_with_lt1 is not None and variable_with_lt1 != variable: + * continue # <<<<<<<<<<<<<< + * domain = domains[variable] + * for value in domain[:]: +*/ + goto __pyx_L13_continue; + + /* "constraint/constraints.py":972 + * maxprod = self._maxprod + * for variable in variables: + * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< + * continue + * domain = domains[variable] +*/ + } + + /* "constraint/constraints.py":974 + * 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, 974, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":975 + * 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, 975, __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_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, 975, __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, 975, __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))) { + { + 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, 975, __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_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, 975, __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)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); + #endif + ++__pyx_t_13; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_14(__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, 975, __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":976 + * 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, 976, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 976, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_11) { + + /* "constraint/constraints.py":977 + * 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_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, 977, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":976 + * domain = domains[variable] + * for value in domain[:]: + * if value > maxprod: # <<<<<<<<<<<<<< + * domain.remove(value) + * elif value == 0 and maxprod < 0: +*/ + goto __pyx_L20; + } + + /* "constraint/constraints.py":978 + * 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, 978, __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, 978, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 978, __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":979 + * 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_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, 979, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":978 + * if value > maxprod: + * domain.remove(value) + * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< + * domain.remove(value) + * +*/ + } + __pyx_L20:; + + /* "constraint/constraints.py":975 + * continue + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value > maxprod: + * domain.remove(value) +*/ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":971 + * # 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: + * continue +*/ + __pyx_L13_continue:; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":953 + * self._maxprod = maxprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) @@ -24344,36 +26811,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_minprod); + __Pyx_XDECREF(__pyx_v_variable_with_lt1); __Pyx_XDECREF(__pyx_v_variable); + __Pyx_XDECREF(__pyx_v_contains_lt1); + __Pyx_XDECREF(__pyx_v_maxprod); __Pyx_XDECREF(__pyx_v_domain); __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator12); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":935 +/* "constraint/constraints.py":981 * 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: + * maxprod = self._maxprod + * prod = 1 */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_5__call__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_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_17MinProdConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MinProdConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_5__call__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_17MaxProdConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MaxProdConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_5__call__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -24382,9 +26853,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_variables = 0; - CYTHON_UNUSED PyObject *__pyx_v_domains = 0; + PyObject *__pyx_v_domains = 0; PyObject *__pyx_v_assignments = 0; - CYTHON_UNUSED PyObject *__pyx_v_forwardcheck = 0; + PyObject *__pyx_v_forwardcheck = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -24407,53 +26878,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, 935, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 981, __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, 935, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 981, __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, 935, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 981, __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, 935, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 981, __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, 935, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 981, __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, 935, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 981, __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, 935, __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, 981, __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, 935, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 981, __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, 935, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 981, __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, 935, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 981, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 935, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 981, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 935, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 981, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 935, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 981, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -24467,20 +26938,20 @@ 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, 935, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 981, __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.MinProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__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, 935, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 935, __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); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 981, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 981, __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 */ goto __pyx_L0; @@ -24499,488 +26970,742 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -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) { - PyObject *__pyx_v_variable = NULL; - PyObject *__pyx_v_minprod = NULL; +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; PyObject *__pyx_v_prod = NULL; + int __pyx_v_missing; + PyObject *__pyx_v_missing_lt1 = NULL; + PyObject *__pyx_v_variable = NULL; + PyObject *__pyx_v_contains_lt1 = NULL; + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_value = 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_2 = NULL; + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - size_t __pyx_t_7; + 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)(PyObject *); + int __pyx_t_10; + int __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __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":937 + /* "constraint/constraints.py":982 + * * 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 + * maxprod = self._maxprod # <<<<<<<<<<<<<< + * prod = 1 + * missing = False */ - 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, 937, __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, 982, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_maxprod = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":983 + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * maxprod = self._maxprod + * prod = 1 # <<<<<<<<<<<<<< + * missing = False + * missing_lt1 = [] +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); + __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; + + /* "constraint/constraints.py":984 + * maxprod = self._maxprod + * prod = 1 + * missing = False # <<<<<<<<<<<<<< + * missing_lt1 = [] + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): +*/ + __pyx_v_missing = 0; + + /* "constraint/constraints.py":985 + * prod = 1 + * missing = False + * missing_lt1 = [] # <<<<<<<<<<<<<< + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if variable in assignments: +*/ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 985, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_missing_lt1 = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":986 + * missing = False + * missing_lt1 = [] + * 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, 986, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = 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, 986, __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, 937, __pyx_L1_error) } + 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; + } else { + __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 986, __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, 986, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(!__pyx_t_7)) { + 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, 937, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 986, __pyx_L1_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); - ++__pyx_t_2; + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_6); + ++__pyx_t_6; } 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, 937, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 986, __pyx_L1_error) #endif - if (__pyx_t_2 >= __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_1, __pyx_t_2)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); #endif - ++__pyx_t_2; + ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 937, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { + __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, 937, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 986, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_4); + __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, 986, __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_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __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, 986, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __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_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 986, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __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, 986, __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; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 986, __pyx_L1_error) + __pyx_L6_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; - /* "constraint/constraints.py":938 - * # check if each variable is in the assignments - * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< - * return True - * + /* "constraint/constraints.py":987 + * missing_lt1 = [] + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if variable in assignments: # <<<<<<<<<<<<<< + * prod *= assignments[variable] + * else: */ - __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 938, __pyx_L1_error) - if (__pyx_t_5) { + __pyx_t_10 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 987, __pyx_L1_error) + if (__pyx_t_10) { - /* "constraint/constraints.py":939 - * for variable in variables: - * if variable not in assignments: - * return True # <<<<<<<<<<<<<< - * - * # with each variable assigned, sum the values + /* "constraint/constraints.py":988 + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if variable in assignments: + * prod *= assignments[variable] # <<<<<<<<<<<<<< + * else: + * missing = True */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 988, __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, 988, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; + __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/constraints.py":938 - * # check if each variable is in the assignments - * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< - * return True - * + /* "constraint/constraints.py":987 + * missing_lt1 = [] + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if variable in assignments: # <<<<<<<<<<<<<< + * prod *= assignments[variable] + * else: */ + goto __pyx_L7; } - /* "constraint/constraints.py":937 - * 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 + /* "constraint/constraints.py":990 + * prod *= assignments[variable] + * else: + * missing = True # <<<<<<<<<<<<<< + * if contains_lt1: + * missing_lt1.append(variable) */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /*else*/ { + __pyx_v_missing = 1; - /* "constraint/constraints.py":942 - * - * # with each variable assigned, sum the values - * minprod = self._minprod # <<<<<<<<<<<<<< - * prod = 1 - * for variable in variables: + /* "constraint/constraints.py":991 + * else: + * missing = True + * if contains_lt1: # <<<<<<<<<<<<<< + * missing_lt1.append(variable) + * if isinstance(prod, float): */ - __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, 942, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_minprod = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_contains_lt1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 991, __pyx_L1_error) + if (__pyx_t_10) { - /* "constraint/constraints.py":943 - * # with each variable assigned, sum the values - * minprod = self._minprod - * prod = 1 # <<<<<<<<<<<<<< - * for variable in variables: - * prod *= assignments[variable] + /* "constraint/constraints.py":992 + * missing = True + * if contains_lt1: + * missing_lt1.append(variable) # <<<<<<<<<<<<<< + * if isinstance(prod, float): + * prod = round(prod, 10) */ - __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); - __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_missing_lt1, __pyx_v_variable); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 992, __pyx_L1_error) - /* "constraint/constraints.py":944 - * minprod = self._minprod - * prod = 1 - * for variable in variables: # <<<<<<<<<<<<<< - * prod *= assignments[variable] + /* "constraint/constraints.py":991 + * else: + * missing = True + * if contains_lt1: # <<<<<<<<<<<<<< + * missing_lt1.append(variable) * if isinstance(prod, float): */ - 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, 944, __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, 944, __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, 944, __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, 944, __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, 944, __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, 944, __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":945 - * 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, 945, __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, 945, __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; + __pyx_L7:; - /* "constraint/constraints.py":944 - * minprod = self._minprod - * prod = 1 - * for variable in variables: # <<<<<<<<<<<<<< - * prod *= assignments[variable] - * if isinstance(prod, float): + /* "constraint/constraints.py":986 + * missing = False + * missing_lt1 = [] + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< + * if variable in assignments: + * prod *= assignments[variable] */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":946 - * for variable in variables: - * prod *= assignments[variable] + /* "constraint/constraints.py":993 + * if contains_lt1: + * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< * prod = round(prod, 10) - * return prod >= minprod + * if (not missing or len(missing_lt1) == 0) and prod > maxprod: */ - __pyx_t_5 = PyFloat_Check(__pyx_v_prod); - if (__pyx_t_5) { + __pyx_t_10 = PyFloat_Check(__pyx_v_prod); + if (__pyx_t_10) { - /* "constraint/constraints.py":947 - * prod *= assignments[variable] + /* "constraint/constraints.py":994 + * missing_lt1.append(variable) * if isinstance(prod, float): * prod = round(prod, 10) # <<<<<<<<<<<<<< - * return prod >= minprod - * + * if (not missing or len(missing_lt1) == 0) and prod > maxprod: + * return False */ - __pyx_t_6 = NULL; + __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_4 = __pyx_builtin_round; - __pyx_t_7 = 1; + __pyx_t_1 = __pyx_builtin_round; + __pyx_t_5 = 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_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, 947, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_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, 994, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":946 - * for variable in variables: - * prod *= assignments[variable] + /* "constraint/constraints.py":993 + * if contains_lt1: + * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< * prod = round(prod, 10) - * return prod >= minprod + * if (not missing or len(missing_lt1) == 0) and prod > maxprod: */ } - /* "constraint/constraints.py":948 + /* "constraint/constraints.py":995 * if isinstance(prod, float): * prod = round(prod, 10) - * return prod >= minprod # <<<<<<<<<<<<<< - * - * + * if (not missing or len(missing_lt1) == 0) and prod > maxprod: # <<<<<<<<<<<<<< + * return False + * if forwardcheck: */ - __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, 948, __pyx_L1_error) - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_12 = (!__pyx_v_missing); + if (!__pyx_t_12) { + } else { + goto __pyx_L13_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, 995, __pyx_L1_error) + __pyx_t_12 = (__pyx_t_6 == 0); + if (__pyx_t_12) { + } else { + __pyx_t_10 = __pyx_t_12; + goto __pyx_L12_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, 995, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 995, __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) { - /* "constraint/constraints.py":935 - * 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: + /* "constraint/constraints.py":996 + * prod = round(prod, 10) + * if (not missing or len(missing_lt1) == 0) and prod > maxprod: + * return False # <<<<<<<<<<<<<< + * if forwardcheck: + * for variable in variables: */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_variable); - __Pyx_XDECREF(__pyx_v_minprod); - __Pyx_XDECREF(__pyx_v_prod); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "constraint/constraints.py":995 + * if isinstance(prod, float): + * prod = round(prod, 10) + * if (not missing or len(missing_lt1) == 0) and prod > maxprod: # <<<<<<<<<<<<<< + * return False + * if forwardcheck: +*/ + } -/* "constraint/constraints.py":962 - * """ - * - * def __init__(self, set): # <<<<<<<<<<<<<< - * """Initialization method. - * + /* "constraint/constraints.py":997 + * 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, 997, __pyx_L1_error) + if (__pyx_t_10) { -/* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_1__init__(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_15InSetConstraint___init__, "Initialization method.\n\n Args:\n set (set): Set of allowed values\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_15InSetConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_15InSetConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_15InSetConstraint___init__}; -static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_1__init__(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_set = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (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_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, 962, __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, 962, __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, 962, __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, 962, __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, 962, __pyx_L3_error) } - } - } else if (unlikely(__pyx_nargs != 2)) { - goto __pyx_L5_argtuple_error; + /* "constraint/constraints.py":998 + * return False + * 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] +*/ + 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; } else { - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 962, __pyx_L3_error) - values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 962, __pyx_L3_error) + __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 998, __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, 998, __pyx_L1_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, 962, __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.InSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_15InSetConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_set); - - /* 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_15InSetConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); + for (;;) { + 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, 998, __pyx_L1_error) + #endif + if (__pyx_t_6 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_6); + ++__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, 998, __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_3, __pyx_t_6)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __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, 998, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":968 - * set (set): Set of allowed values - * """ - * self._set = set # <<<<<<<<<<<<<< - * - * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 + /* "constraint/constraints.py":999 + * 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[:]: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2, __pyx_v_set) < 0) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_12 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 999, __pyx_L1_error) + if (__pyx_t_12) { + } else { + __pyx_t_10 = __pyx_t_12; + goto __pyx_L19_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, 999, __pyx_L1_error) + if (!__pyx_t_12) { + } else { + __pyx_t_10 = __pyx_t_12; + goto __pyx_L19_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, 999, __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) { - /* "constraint/constraints.py":962 - * """ - * - * def __init__(self, set): # <<<<<<<<<<<<<< - * """Initialization method. - * + /* "constraint/constraints.py":1000 + * 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, 1000, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.InSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; + /* "constraint/constraints.py":1001 + * 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, 1001, __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; + } else { + __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __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, 1001, __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))) { + { + 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, 1001, __pyx_L1_error) + #endif + if (__pyx_t_13 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_13); + ++__pyx_t_13; + } 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, 1001, __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_2, __pyx_t_13)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); + #endif + ++__pyx_t_13; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_14(__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, 1001, __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":1002 + * 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, 1002, __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, 1002, __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, 1002, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_10) { + + /* "constraint/constraints.py":1003 + * 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; + { + 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, 1003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":1002 + * domain = domains[variable] + * for value in domain[:]: + * if prod * value > maxprod: # <<<<<<<<<<<<<< + * domain.hideValue(value) + * if not domain: +*/ + } + + /* "constraint/constraints.py":1001 + * 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_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":1004 + * 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, 1004, __pyx_L1_error) + __pyx_t_12 = (!__pyx_t_10); + if (__pyx_t_12) { + + /* "constraint/constraints.py":1005 + * 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_3); __pyx_t_3 = 0; + goto __pyx_L0; + + /* "constraint/constraints.py":1004 + * if prod * value > maxprod: + * domain.hideValue(value) + * if not domain: # <<<<<<<<<<<<<< + * return False + * return True +*/ + } + + /* "constraint/constraints.py":999 + * 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[:]: +*/ + } + + /* "constraint/constraints.py":998 + * return False + * 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] +*/ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":997 + * 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): +*/ + } + + /* "constraint/constraints.py":1006 + * if not domain: + * return False + * return True # <<<<<<<<<<<<<< + * + * +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "constraint/constraints.py":981 + * domain.remove(value) + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * maxprod = self._maxprod + * prod = 1 +*/ + + /* 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_8); + __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_maxprod); + __Pyx_XDECREF(__pyx_v_prod); + __Pyx_XDECREF(__pyx_v_missing_lt1); + __Pyx_XDECREF(__pyx_v_variable); + __Pyx_XDECREF(__pyx_v_contains_lt1); + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":970 - * self._set = set +/* "constraint/constraints.py":1020 + * """ + * + * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< + * """Instantiate a MinProdConstraint. * - * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * # preProcess() will remove it. - * raise RuntimeError("Can't happen") */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_3__call__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_1__init__(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_15InSetConstraint_3__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_15InSetConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_3__call__(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_17MinProdConstraint___init__, "Instantiate a MinProdConstraint.\n\n Args:\n minprod: Value to be considered as the maximum product\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_17MinProdConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MinProdConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_17MinProdConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_1__init__(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; + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_minprod = 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}; + PyObject* values[2] = {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); + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -24990,80 +27715,52 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #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,0}; + 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, 970, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1020, __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, 970, __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, 970, __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, 970, __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, 970, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1020, __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, 970, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1020, __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, 970, __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, 970, __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, 1020, __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, 1020, __pyx_L3_error) } } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_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, 970, __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, 970, __pyx_L3_error) - values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 970, __pyx_L3_error) - values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 970, __pyx_L3_error) - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 970, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_error; - } - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1020, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1020, __pyx_L3_error) } __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_minprod = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 970, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1020, __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.InSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); + __pyx_r = __pyx_pf_10constraint_11constraints_17MinProdConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_minprod); /* function exit code */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -25073,79 +27770,61 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_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) { +static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_minprod) { 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); + __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":972 - * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 - * # preProcess() will remove it. - * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< + /* "constraint/constraints.py":1026 + * 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 */ - __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_RuntimeError); - __pyx_t_3 = __pyx_builtin_RuntimeError; - __pyx_t_4 = 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_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, 972, __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, 972, __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, 1026, __pyx_L1_error) - /* "constraint/constraints.py":970 - * self._set = set + /* "constraint/constraints.py":1020 + * """ + * + * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< + * """Instantiate a MinProdConstraint. * - * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * # preProcess() will remove it. - * raise RuntimeError("Can't happen") */ /* 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_AddTraceback("constraint.constraints.InSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; + __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":974 - * raise RuntimeError("Can't happen") +/* "constraint/constraints.py":1028 + * self._minprod = minprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * set = self._set - * for variable in variables: + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_5preProcess(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_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_15InSetConstraint_5preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_15InSetConstraint_5preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_5preProcess(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_17MinProdConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MinProdConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_3preProcess(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -25179,50 +27858,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, 974, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1028, __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, 974, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1028, __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, 974, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1028, __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, 974, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1028, __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, 974, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1028, __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, 974, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1028, __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, 974, __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, 1028, __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, 974, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1028, __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, 974, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1028, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 974, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1028, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 974, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1028, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 974, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1028, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 974, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1028, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -25232,21 +27911,21 @@ 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, 974, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1028, __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.InSetConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.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, 974, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 974, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 974, __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); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1028, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1028, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1028, __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 */ goto __pyx_L0; @@ -25265,91 +27944,126 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProcess(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_set = NULL; +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) { + PyObject *__pyx_v_minprod = NULL; PyObject *__pyx_v_variable = NULL; PyObject *__pyx_v_domain = NULL; PyObject *__pyx_v_value = 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_2 = NULL; + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; + size_t __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); - int __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - size_t __pyx_t_10; - PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_t_10; + int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":975 + /* "constraint/constraints.py":1029 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - * set = self._set # <<<<<<<<<<<<<< + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< + * + * # 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, 1029, __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, 1029, __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(__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, 1029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":1032 + * + * # 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_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __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, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_set = __pyx_t_1; + __pyx_v_minprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":976 - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - * set = self._set + /* "constraint/constraints.py":1033 + * # prune the associated variables of values > minprod + * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: */ 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; + __pyx_t_6 = 0; + __pyx_t_7 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __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, 976, __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, 1033, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_3)) { + 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, 976, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1033, __pyx_L1_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); - ++__pyx_t_2; + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + ++__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, 976, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1033, __pyx_L1_error) #endif - if (__pyx_t_2 >= __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_1, __pyx_t_2)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); #endif - ++__pyx_t_2; + ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1033, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); + __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, 976, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1033, __pyx_L1_error) PyErr_Clear(); } break; @@ -25359,71 +28073,71 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":977 - * set = self._set + /* "constraint/constraints.py":1034 + * minprod = self._minprod * for variable in variables: * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: - * if value not in set: + * 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, 977, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":978 + /* "constraint/constraints.py":1035 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< - * if value not in set: + * 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, 978, __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, 1035, __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; + __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); + __pyx_t_8 = 0; + __pyx_t_9 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 978, __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, 978, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1035, __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, 1035, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_5))) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); + 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, 978, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1035, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_8 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_8); + ++__pyx_t_8; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); + 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, 978, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1035, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_8 >= __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_6)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); #endif - ++__pyx_t_6; + ++__pyx_t_8; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 978, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1035, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_7(__pyx_t_5); + __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, 978, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1035, __pyx_L1_error) PyErr_Clear(); } break; @@ -25433,88 +28147,67 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":979 + /* "constraint/constraints.py":1036 * domain = domains[variable] * for value in domain[:]: - * if value not in set: # <<<<<<<<<<<<<< + * if value == 0 and minprod > 0: # <<<<<<<<<<<<<< * 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, 979, __pyx_L1_error) - if (__pyx_t_8) { + __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, 1036, __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, 1036, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1036, __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":980 + /* "constraint/constraints.py":1037 * for value in domain[:]: - * if value not in set: + * if value == 0 and minprod > 0: * domain.remove(value) # <<<<<<<<<<<<<< - * vconstraints[variable].remove((self, variables)) - * constraints.remove((self, variables)) + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 */ - __pyx_t_9 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_9); - __pyx_t_10 = 0; + __pyx_t_3 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = 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_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 980, __pyx_L1_error) + 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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":979 + /* "constraint/constraints.py":1036 * domain = domains[variable] * for value in domain[:]: - * if value not in set: # <<<<<<<<<<<<<< + * if value == 0 and minprod > 0: # <<<<<<<<<<<<<< * domain.remove(value) - * vconstraints[variable].remove((self, variables)) + * */ } - /* "constraint/constraints.py":978 + /* "constraint/constraints.py":1035 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< - * if value not in set: - * domain.remove(value) -*/ - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "constraint/constraints.py":981 - * if value not in set: + * if value == 0 and minprod > 0: * 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, 981, __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, 981, __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, 981, __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, 981, __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_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, 981, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":976 - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - * set = self._set + /* "constraint/constraints.py":1033 + * # prune the associated variables of values > minprod + * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: @@ -25522,56 +28215,481 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":982 - * domain.remove(value) - * vconstraints[variable].remove((self, variables)) - * constraints.remove((self, variables)) # <<<<<<<<<<<<<< + /* "constraint/constraints.py":1028 + * 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_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __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, 982, __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, 982, __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, 982, __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":974 - * raise RuntimeError("Can't happen") + /* 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_AddTraceback("constraint.constraints.MinProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_minprod); + __Pyx_XDECREF(__pyx_v_variable); + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":1039 + * domain.remove(value) * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * set = self._set + * 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: */ +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_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_17MinProdConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MinProdConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_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 +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_variables = 0; + CYTHON_UNUSED PyObject *__pyx_v_domains = 0; + PyObject *__pyx_v_assignments = 0; + CYTHON_UNUSED PyObject *__pyx_v_forwardcheck = 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("__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,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, 1039, __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, 1039, __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, 1039, __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, 1039, __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, 1039, __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, 1039, __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, 1039, __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, 1039, __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, 1039, __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, 1039, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1039, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1039, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1039, __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, 1039, __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.MinProdConstraint.__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, 1039, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1039, __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 */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); 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_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) { + PyObject *__pyx_v_variable = NULL; + PyObject *__pyx_v_minprod = NULL; + PyObject *__pyx_v_prod = 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_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "constraint/constraints.py":1041 + * 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, 1041, __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, 1041, __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, 1041, __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, 1041, __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, 1041, __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, 1041, __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":1042 + * # 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, 1042, __pyx_L1_error) + if (__pyx_t_5) { + + /* "constraint/constraints.py":1043 + * 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":1042 + * # check if each variable is in the assignments + * for variable in variables: + * if variable not in assignments: # <<<<<<<<<<<<<< + * return True + * +*/ + } + + /* "constraint/constraints.py":1041 + * 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":1046 + * + * # 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, 1046, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_minprod = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":1047 + * # with each variable assigned, sum the values + * minprod = self._minprod + * prod = 1 # <<<<<<<<<<<<<< + * for variable in variables: + * prod *= assignments[variable] +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); + __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; + + /* "constraint/constraints.py":1048 + * minprod = self._minprod + * prod = 1 + * for variable in variables: # <<<<<<<<<<<<<< + * prod *= assignments[variable] + * if isinstance(prod, float): +*/ + 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, 1048, __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, 1048, __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, 1048, __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, 1048, __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, 1048, __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, 1048, __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":1049 + * 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, 1049, __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, 1049, __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":1048 + * minprod = self._minprod + * prod = 1 + * for variable in variables: # <<<<<<<<<<<<<< + * prod *= assignments[variable] + * if isinstance(prod, float): +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":1050 + * for variable in variables: + * prod *= assignments[variable] + * if isinstance(prod, float): # <<<<<<<<<<<<<< + * prod = round(prod, 10) + * return prod >= minprod +*/ + __pyx_t_5 = PyFloat_Check(__pyx_v_prod); + if (__pyx_t_5) { + + /* "constraint/constraints.py":1051 + * prod *= assignments[variable] + * if isinstance(prod, float): + * prod = round(prod, 10) # <<<<<<<<<<<<<< + * return prod >= minprod + * +*/ + __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_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, 1051, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":1050 + * for variable in variables: + * prod *= assignments[variable] + * if isinstance(prod, float): # <<<<<<<<<<<<<< + * prod = round(prod, 10) + * return prod >= minprod +*/ + } + + /* "constraint/constraints.py":1052 + * if isinstance(prod, float): + * prod = round(prod, 10) + * return prod >= minprod # <<<<<<<<<<<<<< + * + * +*/ + __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, 1052, __pyx_L1_error) + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "constraint/constraints.py":1039 + * 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: +*/ + + /* function exit code */ + __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_AddTraceback("constraint.constraints.InSetConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_set); __Pyx_XDECREF(__pyx_v_variable); - __Pyx_XDECREF(__pyx_v_domain); - __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_minprod); + __Pyx_XDECREF(__pyx_v_prod); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":996 +/* "constraint/constraints.py":1066 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -25580,16 +28698,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_1__init__(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_18NotInSetConstraint___init__, "Initialization method.\n\n Args:\n set (set): Set of disallowed values\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_18NotInSetConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18NotInSetConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_18NotInSetConstraint___init__}; -static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_1__init__(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_15InSetConstraint___init__, "Initialization method.\n\n Args:\n set (set): Set of allowed values\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_15InSetConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_15InSetConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_15InSetConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -25620,50 +28738,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,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, 996, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1066, __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, 996, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1066, __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, 996, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1066, __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, 996, __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, 1066, __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, 996, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1066, __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, 996, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1066, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 996, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1066, __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, 996, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1066, __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.NotInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.InSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_18NotInSetConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_set); + __pyx_r = __pyx_pf_10constraint_11constraints_15InSetConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_set); /* function exit code */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -25673,7 +28791,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set) { +static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; @@ -25681,16 +28799,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1002 - * set (set): Set of disallowed values + /* "constraint/constraints.py":1072 + * 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, 1002, __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, 1072, __pyx_L1_error) - /* "constraint/constraints.py":996 + /* "constraint/constraints.py":1066 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -25702,7 +28820,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.NotInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.InSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -25710,7 +28828,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init return __pyx_r; } -/* "constraint/constraints.py":1004 +/* "constraint/constraints.py":1074 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -25719,15 +28837,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_3__call__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_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_18NotInSetConstraint_3__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18NotInSetConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_3__call__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_15InSetConstraint_3__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_15InSetConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_3__call__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -25761,53 +28879,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, 1004, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1074, __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, 1004, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1074, __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, 1004, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1074, __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, 1004, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1074, __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, 1004, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1074, __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, 1004, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1074, __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, 1004, __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, 1074, __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, 1004, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1074, __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, 1004, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1074, __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, 1004, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1074, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1004, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1074, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1004, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1074, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1004, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1074, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -25821,18 +28939,18 @@ 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, 1004, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1074, __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.NotInSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.InSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); + __pyx_r = __pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -25842,7 +28960,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_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) { +static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_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) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -25854,7 +28972,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1006 + /* "constraint/constraints.py":1076 * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 * # preProcess() will remove it. * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< @@ -25870,14 +28988,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal __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, 1006, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1076, __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, 1006, __pyx_L1_error) + __PYX_ERR(0, 1076, __pyx_L1_error) - /* "constraint/constraints.py":1004 + /* "constraint/constraints.py":1074 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -25890,14 +29008,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal __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_AddTraceback("constraint.constraints.InSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":1008 +/* "constraint/constraints.py":1078 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -25906,15 +29024,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_5preProcess(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_5preProcess(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_18NotInSetConstraint_5preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18NotInSetConstraint_5preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_5preProcess(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_15InSetConstraint_5preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_15InSetConstraint_5preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_5preProcess(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -25948,50 +29066,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, 1008, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1078, __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, 1008, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1078, __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, 1008, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1078, __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, 1008, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1078, __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, 1008, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1078, __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, 1008, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1078, __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, 1008, __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, 1078, __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, 1008, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1078, __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, 1008, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1078, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1008, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1078, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1008, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1078, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1008, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1078, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1008, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1078, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -26001,21 +29119,21 @@ 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, 1008, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1078, __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.NotInSetConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.InSetConstraint.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, 1008, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1008, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1008, __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); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1078, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1078, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1078, __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 */ goto __pyx_L0; @@ -26034,7 +29152,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4preProcess(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) { +static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProcess(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_set = NULL; PyObject *__pyx_v_variable = NULL; PyObject *__pyx_v_domain = NULL; @@ -26057,19 +29175,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1009 + /* "constraint/constraints.py":1079 * * 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, 1009, __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, 1079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1010 + /* "constraint/constraints.py":1080 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -26081,9 +29199,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, 1010, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1080, __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, 1010, __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, 1080, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -26091,7 +29209,7 @@ 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, 1010, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1080, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -26101,7 +29219,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr { 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, 1010, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1080, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -26112,13 +29230,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1010, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1080, __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, 1010, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1080, __pyx_L1_error) PyErr_Clear(); } break; @@ -26128,35 +29246,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":1011 + /* "constraint/constraints.py":1081 * set = self._set * for variable in variables: * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: - * if value in set: + * 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, 1011, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1012 + /* "constraint/constraints.py":1082 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< - * if value in set: + * 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, 1012, __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, 1082, __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, 1012, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1082, __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, 1012, __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, 1082, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -26165,7 +29283,7 @@ 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, 1012, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1082, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -26175,7 +29293,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr { 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, 1012, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1082, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -26186,13 +29304,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1012, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1082, __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, 1012, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1082, __pyx_L1_error) PyErr_Clear(); } break; @@ -26202,19 +29320,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1013 + /* "constraint/constraints.py":1083 * domain = domains[variable] * for value in domain[:]: - * if value in set: # <<<<<<<<<<<<<< + * 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_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1013, __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, 1083, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1014 + /* "constraint/constraints.py":1084 * for value in domain[:]: - * if value in set: + * if value not in set: * domain.remove(value) # <<<<<<<<<<<<<< * vconstraints[variable].remove((self, variables)) * constraints.remove((self, variables)) @@ -26226,49 +29344,49 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr 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_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1014, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1013 + /* "constraint/constraints.py":1083 * domain = domains[variable] * for value in domain[:]: - * if value in set: # <<<<<<<<<<<<<< + * if value not in set: # <<<<<<<<<<<<<< * domain.remove(value) * vconstraints[variable].remove((self, variables)) */ } - /* "constraint/constraints.py":1012 + /* "constraint/constraints.py":1082 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< - * if value in set: + * if value not in set: * domain.remove(value) */ } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1015 - * if value in set: + /* "constraint/constraints.py":1085 + * 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, 1015, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1085, __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, 1015, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1085, __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, 1015, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1085, __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, 1015, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1085, __pyx_L1_error); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11}; @@ -26276,12 +29394,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr __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, 1015, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1085, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1010 + /* "constraint/constraints.py":1080 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -26291,27 +29409,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1016 + /* "constraint/constraints.py":1086 * 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, 1016, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1086, __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, 1016, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1086, __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, 1016, __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, 1016, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1086, __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, 1086, __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":1008 + /* "constraint/constraints.py":1078 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -26328,7 +29446,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); - __Pyx_AddTraceback("constraint.constraints.NotInSetConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.InSetConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_set); @@ -26340,25 +29458,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr return __pyx_r; } -/* "constraint/constraints.py":1030 +/* "constraint/constraints.py":1100 * """ * - * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< + * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_1__init__(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_19SomeInSetConstraint___init__, "Initialization method.\n\n Args:\n set (set): Set of values to be checked\n n (int): Minimum number of assigned values that should be\n present in set (default is 1)\n exact (bool): Whether the number of assigned values which\n are present in set must be exactly `n`\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_19SomeInSetConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_19SomeInSetConstraint___init__}; -static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_1__init__(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_18NotInSetConstraint___init__, "Initialization method.\n\n Args:\n set (set): Set of disallowed values\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_18NotInSetConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18NotInSetConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_18NotInSetConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -26367,13 +29485,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_set = 0; - PyObject *__pyx_v_n = 0; - PyObject *__pyx_v_exact = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[4] = {0,0,0,0}; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -26389,77 +29505,52 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #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_set,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_exact,0}; + 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, 1030, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1100, __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, 1030, __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, 1030, __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, 1030, __pyx_L3_error) + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1100, __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, 1030, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1100, __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, 1030, __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))); + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 1100, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, i); __PYX_ERR(0, 1030, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1100, __pyx_L3_error) } } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_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, 1030, __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, 1030, __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, 1030, __pyx_L3_error) - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1030, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_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))); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1100, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1100, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_set = values[1]; - __pyx_v_n = values[2]; - __pyx_v_exact = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1030, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1100, __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.SomeInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.NotInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_19SomeInSetConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_set, __pyx_v_n, __pyx_v_exact); + __pyx_r = __pyx_pf_10constraint_11constraints_18NotInSetConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_set); /* function exit code */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -26469,7 +29560,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set, PyObject *__pyx_v_n, PyObject *__pyx_v_exact) { +static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; @@ -26477,37 +29568,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1040 - * are present in set must be exactly `n` + /* "constraint/constraints.py":1106 + * set (set): Set of disallowed values * """ * 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, 1040, __pyx_L1_error) - - /* "constraint/constraints.py":1041 - * """ - * 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, 1041, __pyx_L1_error) - - /* "constraint/constraints.py":1042 - * self._set = set - * self._n = n - * self._exact = exact # <<<<<<<<<<<<<< * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * def __call__(self, variables, domains, assignments, 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, 1042, __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, 1106, __pyx_L1_error) - /* "constraint/constraints.py":1030 + /* "constraint/constraints.py":1100 * """ * - * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< + * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -26516,7 +29589,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.SomeInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.NotInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -26524,35 +29597,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini return __pyx_r; } -/* "constraint/constraints.py":1044 - * self._exact = exact +/* "constraint/constraints.py":1108 + * self._set = set * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * set = self._set - * missing = 0 + * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * # preProcess() will remove it. + * raise RuntimeError("Can't happen") */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_3__call__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_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_19SomeInSetConstraint_3__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_3__call__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_18NotInSetConstraint_3__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18NotInSetConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_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 ) { - PyObject *__pyx_v_self = 0; - 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_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; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -26575,53 +29648,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, 1044, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1108, __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, 1044, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1108, __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, 1044, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1108, __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, 1044, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1108, __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, 1044, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1108, __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, 1044, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1108, __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, 1044, __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, 1108, __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, 1044, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1108, __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, 1044, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1108, __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, 1044, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1108, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1044, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1108, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1044, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1108, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1044, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1108, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -26629,26 +29702,207 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; - __pyx_v_domains = ((PyObject*)values[2]); - __pyx_v_assignments = ((PyObject*)values[3]); + __pyx_v_domains = values[2]; + __pyx_v_assignments = 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, 1044, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1108, __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.SomeInSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.NotInSetConstraint.__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, 1044, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1044, __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); + __pyx_r = __pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); + + /* 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_18NotInSetConstraint_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) { + 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":1110 + * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 + * # preProcess() will remove it. + * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< + * + * 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; + { + 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_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, 1110, __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, 1110, __pyx_L1_error) + + /* "constraint/constraints.py":1108 + * self._set = set + * + * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * # preProcess() will remove it. + * raise RuntimeError("Can't happen") +*/ + + /* 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.NotInSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":1112 + * 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: +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_5preProcess(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_18NotInSetConstraint_5preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_18NotInSetConstraint_5preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_5preProcess(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, 1112, __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, 1112, __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, 1112, __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, 1112, __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, 1112, __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, 1112, __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, 1112, __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, 1112, __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, 1112, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1112, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1112, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1112, __pyx_L3_error) + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1112, __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, 1112, __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.NotInSetConstraint.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, 1112, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1112, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1112, __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 */ goto __pyx_L0; @@ -26667,10 +29921,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -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) { +static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4preProcess(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_set = NULL; - PyObject *__pyx_v_missing = NULL; - PyObject *__pyx_v_found = NULL; PyObject *__pyx_v_variable = NULL; PyObject *__pyx_v_domain = NULL; PyObject *__pyx_v_value = NULL; @@ -26680,65 +29932,45 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca 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; - int __pyx_t_7; - Py_ssize_t __pyx_t_8; - PyObject *(*__pyx_t_9)(PyObject *); - PyObject *__pyx_t_10 = NULL; - size_t __pyx_t_11; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + size_t __pyx_t_10; + PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 0); + __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1045 + /* "constraint/constraints.py":1113 * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set # <<<<<<<<<<<<<< - * missing = 0 - * found = 0 + * 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, 1045, __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, 1113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1046 - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - * set = self._set - * missing = 0 # <<<<<<<<<<<<<< - * found = 0 - * for variable in variables: -*/ - __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); - __pyx_v_missing = __pyx_mstate_global->__pyx_int_0; - - /* "constraint/constraints.py":1047 + /* "constraint/constraints.py":1114 + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set - * missing = 0 - * found = 0 # <<<<<<<<<<<<<< - * for variable in variables: - * if variable in assignments: -*/ - __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); - __pyx_v_found = __pyx_mstate_global->__pyx_int_0; - - /* "constraint/constraints.py":1048 - * missing = 0 - * found = 0 * for variable in variables: # <<<<<<<<<<<<<< - * if variable in assignments: - * found += assignments[variable] in set + * domain = domains[variable] + * for value in domain[:]: */ 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, 1048, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1114, __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, 1048, __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, 1114, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -26746,7 +29978,7 @@ 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, 1048, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1114, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -26756,7 +29988,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { 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, 1048, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1114, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -26767,13 +29999,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1048, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1114, __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, 1048, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1114, __pyx_L1_error) PyErr_Clear(); } break; @@ -26783,117 +30015,772 @@ 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":1049 - * found = 0 + /* "constraint/constraints.py":1115 + * set = self._set * for variable in variables: - * if variable in assignments: # <<<<<<<<<<<<<< - * found += assignments[variable] in set - * else: + * domain = domains[variable] # <<<<<<<<<<<<<< + * for value in domain[:]: + * if value in set: */ - __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1049, __pyx_L1_error) - if (__pyx_t_5) { + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":1050 + /* "constraint/constraints.py":1116 * for variable in variables: - * if variable in assignments: - * found += assignments[variable] in set # <<<<<<<<<<<<<< - * else: - * missing += 1 + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value in set: + * domain.remove(value) */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1050, __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, 1050, __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, 1050, __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, 1050, __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_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, 1116, __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, 1116, __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, 1116, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + for (;;) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_5))) { + { + 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, 1116, __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_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, 1116, __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_5, __pyx_t_6)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1116, __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, 1116, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":1049 - * found = 0 + /* "constraint/constraints.py":1117 + * 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, 1117, __pyx_L1_error) + if (__pyx_t_8) { + + /* "constraint/constraints.py":1118 + * for value in domain[:]: + * if value in set: + * domain.remove(value) # <<<<<<<<<<<<<< + * vconstraints[variable].remove((self, variables)) + * constraints.remove((self, variables)) +*/ + __pyx_t_9 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_9); + __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_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":1117 + * domain = domains[variable] + * for value in domain[:]: + * if value in set: # <<<<<<<<<<<<<< + * domain.remove(value) + * vconstraints[variable].remove((self, variables)) +*/ + } + + /* "constraint/constraints.py":1116 * for variable in variables: - * if variable in assignments: # <<<<<<<<<<<<<< - * found += assignments[variable] in set - * else: + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value in set: + * domain.remove(value) */ - goto __pyx_L5; } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1052 - * found += assignments[variable] in set - * else: - * missing += 1 # <<<<<<<<<<<<<< - * if missing: - * if self._exact: + /* "constraint/constraints.py":1119 + * if value in set: + * domain.remove(value) + * vconstraints[variable].remove((self, variables)) # <<<<<<<<<<<<<< + * constraints.remove((self, variables)) + * */ - /*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, 1052, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF_SET(__pyx_v_missing, __pyx_t_6); - __pyx_t_6 = 0; + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1119, __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, 1119, __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, 1119, __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, 1119, __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_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, 1119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_L5:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1048 - * missing = 0 - * found = 0 + /* "constraint/constraints.py":1114 + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 + * set = self._set * for variable in variables: # <<<<<<<<<<<<<< - * if variable in assignments: - * found += assignments[variable] in set + * domain = domains[variable] + * for value in domain[:]: */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1053 - * else: - * missing += 1 - * if missing: # <<<<<<<<<<<<<< - * if self._exact: - * if not (found <= self._n <= missing + found): + /* "constraint/constraints.py":1120 + * domain.remove(value) + * vconstraints[variable].remove((self, variables)) + * constraints.remove((self, variables)) # <<<<<<<<<<<<<< + * + * */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_missing); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1053, __pyx_L1_error) - if (__pyx_t_5) { + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1120, __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, 1120, __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, 1120, __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, 1120, __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":1054 - * missing += 1 - * if missing: - * if self._exact: # <<<<<<<<<<<<<< - * if not (found <= self._n <= missing + found): - * return False + /* "constraint/constraints.py":1112 + * 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_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __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, 1054, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - /* "constraint/constraints.py":1055 - * if missing: - * if self._exact: - * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< + /* 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); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("constraint.constraints.NotInSetConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_set); + __Pyx_XDECREF(__pyx_v_variable); + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":1134 + * """ + * + * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_1__init__(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_19SomeInSetConstraint___init__, "Initialization method.\n\n Args:\n set (set): Set of values to be checked\n n (int): Minimum number of assigned values that should be\n present in set (default is 1)\n exact (bool): Whether the number of assigned values which\n are present in set must be exactly `n`\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_19SomeInSetConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_19SomeInSetConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_1__init__(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_set = 0; + PyObject *__pyx_v_n = 0; + PyObject *__pyx_v_exact = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {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("__init__ (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_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, 1134, __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, 1134, __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, 1134, __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, 1134, __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, 1134, __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, 1134, __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, 1134, __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, 1134, __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, 1134, __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, 1134, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1134, __pyx_L3_error) + break; + default: goto __pyx_L5_argtuple_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))); + } + __pyx_v_self = values[0]; + __pyx_v_set = values[1]; + __pyx_v_n = values[2]; + __pyx_v_exact = values[3]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1134, __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.SomeInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10constraint_11constraints_19SomeInSetConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_set, __pyx_v_n, __pyx_v_exact); + + /* 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_19SomeInSetConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set, PyObject *__pyx_v_n, PyObject *__pyx_v_exact) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "constraint/constraints.py":1144 + * 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, 1144, __pyx_L1_error) + + /* "constraint/constraints.py":1145 + * """ + * 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, 1145, __pyx_L1_error) + + /* "constraint/constraints.py":1146 + * 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, 1146, __pyx_L1_error) + + /* "constraint/constraints.py":1134 + * """ + * + * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.SomeInSetConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":1148 + * self._exact = exact + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * set = self._set + * missing = 0 +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_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_19SomeInSetConstraint_3__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_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 +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_variables = 0; + PyObject *__pyx_v_domains = 0; + PyObject *__pyx_v_assignments = 0; + PyObject *__pyx_v_forwardcheck = 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("__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,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, 1148, __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, 1148, __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, 1148, __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, 1148, __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, 1148, __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, 1148, __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, 1148, __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, 1148, __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, 1148, __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, 1148, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1148, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1148, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1148, __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, 1148, __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.SomeInSetConstraint.__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, 1148, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1148, __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 */ + 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_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) { + PyObject *__pyx_v_set = NULL; + PyObject *__pyx_v_missing = NULL; + PyObject *__pyx_v_found = NULL; + PyObject *__pyx_v_variable = NULL; + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_value = 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; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + PyObject *__pyx_t_10 = NULL; + size_t __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "constraint/constraints.py":1149 + * + * 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, 1149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_set = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":1150 + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * set = self._set + * missing = 0 # <<<<<<<<<<<<<< + * found = 0 + * for variable in variables: +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_missing = __pyx_mstate_global->__pyx_int_0; + + /* "constraint/constraints.py":1151 + * set = self._set + * missing = 0 + * found = 0 # <<<<<<<<<<<<<< + * for variable in variables: + * if variable in assignments: +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_found = __pyx_mstate_global->__pyx_int_0; + + /* "constraint/constraints.py":1152 + * missing = 0 + * found = 0 + * for variable in variables: # <<<<<<<<<<<<<< + * if variable in assignments: + * found += assignments[variable] in set +*/ + 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, 1152, __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, 1152, __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, 1152, __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, 1152, __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, 1152, __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, 1152, __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":1153 + * 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, 1153, __pyx_L1_error) + if (__pyx_t_5) { + + /* "constraint/constraints.py":1154 + * 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, 1154, __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, 1154, __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, 1154, __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, 1154, __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":1153 + * found = 0 + * for variable in variables: + * if variable in assignments: # <<<<<<<<<<<<<< + * found += assignments[variable] in set + * else: +*/ + goto __pyx_L5; + } + + /* "constraint/constraints.py":1156 + * found += assignments[variable] in set + * else: + * missing += 1 # <<<<<<<<<<<<<< + * if missing: + * 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, 1156, __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":1152 + * missing = 0 + * found = 0 + * for variable in variables: # <<<<<<<<<<<<<< + * if variable in assignments: + * found += assignments[variable] in set +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":1157 + * 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, 1157, __pyx_L1_error) + if (__pyx_t_5) { + + /* "constraint/constraints.py":1158 + * 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, 1158, __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, 1158, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "constraint/constraints.py":1159 + * 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, 1055, __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, 1159, __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, 1055, __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, 1159, __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, 1055, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1159, __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, 1055, __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, 1159, __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, 1055, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1159, __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":1056 + /* "constraint/constraints.py":1160 * if self._exact: * if not (found <= self._n <= missing + found): * return False # <<<<<<<<<<<<<< @@ -26905,7 +30792,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1055 + /* "constraint/constraints.py":1159 * if missing: * if self._exact: * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< @@ -26914,7 +30801,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1054 + /* "constraint/constraints.py":1158 * missing += 1 * if missing: * if self._exact: # <<<<<<<<<<<<<< @@ -26924,7 +30811,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L8; } - /* "constraint/constraints.py":1058 + /* "constraint/constraints.py":1162 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -26932,18 +30819,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, 1058, __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, 1162, __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, 1058, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __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, 1058, __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, 1162, __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, 1058, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1162, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":1059 + /* "constraint/constraints.py":1163 * else: * if self._n > missing + found: * return False # <<<<<<<<<<<<<< @@ -26955,7 +30842,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1058 + /* "constraint/constraints.py":1162 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -26966,33 +30853,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __pyx_L8:; - /* "constraint/constraints.py":1060 + /* "constraint/constraints.py":1164 * 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, 1060, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1164, __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, 1060, __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, 1164, __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, 1060, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1164, __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, 1060, __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, 1164, __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, 1060, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1164, __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":1063 + /* "constraint/constraints.py":1167 * # All unassigned variables must be assigned to * # values in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -27004,9 +30891,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, 1063, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1167, __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, 1063, __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, 1167, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -27014,7 +30901,7 @@ 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, 1063, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1167, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -27024,7 +30911,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { 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, 1063, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1167, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -27035,13 +30922,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1063, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1167, __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, 1063, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1167, __pyx_L1_error) PyErr_Clear(); } break; @@ -27051,45 +30938,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":1064 + /* "constraint/constraints.py":1168 * # 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, 1064, __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, 1168, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1065 + /* "constraint/constraints.py":1169 * 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, 1065, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1066 + /* "constraint/constraints.py":1170 * 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, 1066, __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, 1170, __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, 1066, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1170, __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, 1066, __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, 1170, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -27098,7 +30985,7 @@ 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, 1066, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1170, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -27108,7 +30995,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { 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, 1066, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1170, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -27119,13 +31006,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __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, 1066, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1170, __pyx_L1_error) PyErr_Clear(); } break; @@ -27135,17 +31022,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":1067 + /* "constraint/constraints.py":1171 * 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, 1067, __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, 1171, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1068 + /* "constraint/constraints.py":1172 * for value in domain[:]: * if value not in set: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -27159,12 +31046,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca 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_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1067 + /* "constraint/constraints.py":1171 * domain = domains[variable] * for value in domain[:]: * if value not in set: # <<<<<<<<<<<<<< @@ -27173,7 +31060,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1066 + /* "constraint/constraints.py":1170 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -27183,18 +31070,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1069 + /* "constraint/constraints.py":1173 * 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, 1069, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1173, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_7); if (__pyx_t_5) { - /* "constraint/constraints.py":1070 + /* "constraint/constraints.py":1174 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -27207,7 +31094,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":1069 + /* "constraint/constraints.py":1173 * if value not in set: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -27216,7 +31103,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1064 + /* "constraint/constraints.py":1168 * # values in the set. * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -27225,7 +31112,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1063 + /* "constraint/constraints.py":1167 * # All unassigned variables must be assigned to * # values in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -27235,7 +31122,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1060 + /* "constraint/constraints.py":1164 * if self._n > missing + found: * return False * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< @@ -27244,7 +31131,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1053 + /* "constraint/constraints.py":1157 * else: * missing += 1 * if missing: # <<<<<<<<<<<<<< @@ -27254,7 +31141,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L7; } - /* "constraint/constraints.py":1072 + /* "constraint/constraints.py":1176 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -27262,28 +31149,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, 1072, __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, 1176, __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, 1072, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1073 + /* "constraint/constraints.py":1177 * 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, 1073, __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, 1177, __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, 1073, __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, 1177, __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, 1073, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1074 + /* "constraint/constraints.py":1178 * if self._exact: * if found != self._n: * return False # <<<<<<<<<<<<<< @@ -27295,7 +31182,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1073 + /* "constraint/constraints.py":1177 * else: * if self._exact: * if found != self._n: # <<<<<<<<<<<<<< @@ -27304,7 +31191,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1072 + /* "constraint/constraints.py":1176 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -27314,7 +31201,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L23; } - /* "constraint/constraints.py":1076 + /* "constraint/constraints.py":1180 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -27322,15 +31209,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, 1076, __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, 1180, __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, 1076, __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, 1180, __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, 1076, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1077 + /* "constraint/constraints.py":1181 * else: * if found < self._n: * return False # <<<<<<<<<<<<<< @@ -27342,7 +31229,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1076 + /* "constraint/constraints.py":1180 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -27355,7 +31242,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __pyx_L7:; - /* "constraint/constraints.py":1078 + /* "constraint/constraints.py":1182 * if found < self._n: * return False * return True # <<<<<<<<<<<<<< @@ -27367,7 +31254,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1044 + /* "constraint/constraints.py":1148 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -27395,7 +31282,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca return __pyx_r; } -/* "constraint/constraints.py":1092 +/* "constraint/constraints.py":1196 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -27446,50 +31333,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, 1092, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1196, __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, 1092, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1196, __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, 1092, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1196, __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, 1092, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1196, __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, 1092, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1196, __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, 1092, __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, 1196, __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, 1092, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, i); __PYX_ERR(0, 1196, __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, 1092, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1196, __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, 1092, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1196, __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, 1092, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1196, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1092, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1196, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -27503,7 +31390,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, 1092, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1196, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27532,34 +31419,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1102 + /* "constraint/constraints.py":1206 * 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, 1102, __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, 1206, __pyx_L1_error) - /* "constraint/constraints.py":1103 + /* "constraint/constraints.py":1207 * """ * 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, 1103, __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, 1207, __pyx_L1_error) - /* "constraint/constraints.py":1104 + /* "constraint/constraints.py":1208 * 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, 1104, __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, 1208, __pyx_L1_error) - /* "constraint/constraints.py":1092 + /* "constraint/constraints.py":1196 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -27579,7 +31466,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ return __pyx_r; } -/* "constraint/constraints.py":1106 +/* "constraint/constraints.py":1210 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -27630,53 +31517,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, 1106, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1210, __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, 1106, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1210, __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, 1106, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1210, __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, 1106, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1210, __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, 1106, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1210, __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, 1106, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1210, __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, 1106, __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, 1210, __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, 1106, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1210, __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, 1106, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1210, __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, 1106, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1210, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1106, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1210, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1106, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1210, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1106, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1210, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -27690,7 +31577,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, 1106, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1210, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27701,8 +31588,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, 1106, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1106, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1210, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1210, __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 */ @@ -27747,19 +31634,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1107 + /* "constraint/constraints.py":1211 * * 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, 1107, __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, 1211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1108 + /* "constraint/constraints.py":1212 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * set = self._set * missing = 0 # <<<<<<<<<<<<<< @@ -27769,7 +31656,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":1109 + /* "constraint/constraints.py":1213 * set = self._set * missing = 0 * found = 0 # <<<<<<<<<<<<<< @@ -27779,7 +31666,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":1110 + /* "constraint/constraints.py":1214 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -27791,9 +31678,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, 1110, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1214, __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, 1110, __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, 1214, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -27801,7 +31688,7 @@ 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, 1110, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1214, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -27811,7 +31698,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_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, 1110, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1214, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -27822,13 +31709,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1110, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1214, __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, 1110, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1214, __pyx_L1_error) PyErr_Clear(); } break; @@ -27838,36 +31725,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":1111 + /* "constraint/constraints.py":1215 * 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, 1111, __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, 1215, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1112 + /* "constraint/constraints.py":1216 * 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, 1112, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1216, __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, 1112, __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, 1216, __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, 1112, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1216, __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, 1112, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_found, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1216, __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":1111 + /* "constraint/constraints.py":1215 * found = 0 * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -27877,7 +31764,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L5; } - /* "constraint/constraints.py":1114 + /* "constraint/constraints.py":1218 * found += assignments[variable] not in set * else: * missing += 1 # <<<<<<<<<<<<<< @@ -27885,14 +31772,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, 1114, __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, 1218, __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":1110 + /* "constraint/constraints.py":1214 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -27902,53 +31789,53 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1115 + /* "constraint/constraints.py":1219 * 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, 1115, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_missing); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1219, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1116 + /* "constraint/constraints.py":1220 * 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, 1116, __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, 1220, __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, 1116, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1117 + /* "constraint/constraints.py":1221 * 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, 1117, __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, 1221, __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, 1117, __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, 1221, __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, 1117, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1221, __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, 1117, __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, 1221, __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, 1117, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1221, __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":1118 + /* "constraint/constraints.py":1222 * if self._exact: * if not (found <= self._n <= missing + found): * return False # <<<<<<<<<<<<<< @@ -27960,7 +31847,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1117 + /* "constraint/constraints.py":1221 * if missing: * if self._exact: * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< @@ -27969,7 +31856,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1116 + /* "constraint/constraints.py":1220 * missing += 1 * if missing: * if self._exact: # <<<<<<<<<<<<<< @@ -27979,7 +31866,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L8; } - /* "constraint/constraints.py":1120 + /* "constraint/constraints.py":1224 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -27987,18 +31874,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, 1120, __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, 1224, __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, 1120, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __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, 1120, __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, 1224, __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, 1120, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":1121 + /* "constraint/constraints.py":1225 * else: * if self._n > missing + found: * return False # <<<<<<<<<<<<<< @@ -28010,7 +31897,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1120 + /* "constraint/constraints.py":1224 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -28021,33 +31908,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __pyx_L8:; - /* "constraint/constraints.py":1122 + /* "constraint/constraints.py":1226 * 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, 1122, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1226, __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, 1122, __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, 1226, __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, 1122, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __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, 1122, __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, 1226, __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, 1122, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1226, __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":1125 + /* "constraint/constraints.py":1229 * # All unassigned variables must be assigned to * # values not in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -28059,9 +31946,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, 1125, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1229, __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, 1125, __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, 1229, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -28069,7 +31956,7 @@ 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, 1125, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1229, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -28079,7 +31966,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ { 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, 1125, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1229, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -28090,13 +31977,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1125, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1229, __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, 1125, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1229, __pyx_L1_error) PyErr_Clear(); } break; @@ -28106,45 +31993,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":1126 + /* "constraint/constraints.py":1230 * # 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, 1126, __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, 1230, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1127 + /* "constraint/constraints.py":1231 * 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, 1127, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1128 + /* "constraint/constraints.py":1232 * 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, 1128, __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, 1232, __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, 1128, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1232, __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, 1128, __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, 1232, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -28153,7 +32040,7 @@ 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, 1128, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1232, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -28163,7 +32050,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ { 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, 1128, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1232, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -28174,13 +32061,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1128, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1232, __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, 1128, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1232, __pyx_L1_error) PyErr_Clear(); } break; @@ -28190,17 +32077,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":1129 + /* "constraint/constraints.py":1233 * 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, 1129, __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, 1233, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1130 + /* "constraint/constraints.py":1234 * for value in domain[:]: * if value in set: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -28214,12 +32101,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ 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_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1130, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1129 + /* "constraint/constraints.py":1233 * domain = domains[variable] * for value in domain[:]: * if value in set: # <<<<<<<<<<<<<< @@ -28228,7 +32115,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1128 + /* "constraint/constraints.py":1232 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -28238,18 +32125,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1131 + /* "constraint/constraints.py":1235 * 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, 1131, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1235, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_7); if (__pyx_t_5) { - /* "constraint/constraints.py":1132 + /* "constraint/constraints.py":1236 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -28262,7 +32149,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1131 + /* "constraint/constraints.py":1235 * if value in set: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -28271,7 +32158,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1126 + /* "constraint/constraints.py":1230 * # values not in the set. * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -28280,7 +32167,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1125 + /* "constraint/constraints.py":1229 * # All unassigned variables must be assigned to * # values not in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -28290,7 +32177,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1122 + /* "constraint/constraints.py":1226 * if self._n > missing + found: * return False * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< @@ -28299,7 +32186,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1115 + /* "constraint/constraints.py":1219 * else: * missing += 1 * if missing: # <<<<<<<<<<<<<< @@ -28309,7 +32196,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L7; } - /* "constraint/constraints.py":1134 + /* "constraint/constraints.py":1238 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -28317,28 +32204,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, 1134, __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, 1238, __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, 1134, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1135 + /* "constraint/constraints.py":1239 * 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, 1135, __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, 1239, __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, 1135, __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, 1239, __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, 1135, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1136 + /* "constraint/constraints.py":1240 * if self._exact: * if found != self._n: * return False # <<<<<<<<<<<<<< @@ -28350,181 +32237,850 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1135 - * else: - * if self._exact: - * if found != self._n: # <<<<<<<<<<<<<< - * return False - * else: -*/ - } + /* "constraint/constraints.py":1239 + * else: + * if self._exact: + * if found != self._n: # <<<<<<<<<<<<<< + * return False + * else: +*/ + } + + /* "constraint/constraints.py":1238 + * return False + * else: + * if self._exact: # <<<<<<<<<<<<<< + * if found != self._n: + * return False +*/ + goto __pyx_L23; + } + + /* "constraint/constraints.py":1242 + * return False + * else: + * if found < self._n: # <<<<<<<<<<<<<< + * return False + * 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, 1242, __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, 1242, __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, 1242, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + + /* "constraint/constraints.py":1243 + * 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":1242 + * return False + * else: + * if found < self._n: # <<<<<<<<<<<<<< + * return False + * return True +*/ + } + } + __pyx_L23:; + } + __pyx_L7:; + + /* "constraint/constraints.py":1244 + * 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":1210 + * self._exact = exact + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * set = self._set + * missing = 0 +*/ + + /* 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_10); + __Pyx_AddTraceback("constraint.constraints.SomeNotInSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_set); + __Pyx_XDECREF(__pyx_v_missing); + __Pyx_XDECREF(__pyx_v_found); + __Pyx_XDECREF(__pyx_v_variable); + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_value); + __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); + 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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_defaults) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->arg0); + #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); + } + #endif +} + +static int __pyx_tp_traverse_10constraint_11constraints___pyx_defaults(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_defaults *p = (struct __pyx_defaults *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } + if (p->arg0) { + e = (*v)(p->arg0, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_10constraint_11constraints___pyx_defaults(PyObject *o) { + PyObject* tmp; + struct __pyx_defaults *p = (struct __pyx_defaults *)o; + tmp = ((PyObject*)p->arg0); + p->arg0 = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_defaults_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_defaults}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_defaults}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_defaults}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_defaults}, + {0, 0}, +}; +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, + __pyx_type_10constraint_11constraints___pyx_defaults_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_defaults = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_defaults", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_defaults, /*tp_traverse*/ + __pyx_tp_clear_10constraint_11constraints___pyx_defaults, /*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_defaults, /*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 PY_VERSION_HEX >= 0x030800b1 && (!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__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)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct__genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr)); + (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; +} + +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct__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 (((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)))) { + __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 + { + #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); + } + #endif + } +} + +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__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__genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct__genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct__genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_spec = { + "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, + __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct__genexpr", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__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__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 PY_VERSION_HEX >= 0x030800b1 && (!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_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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess)); + (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; +} + +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_preProcess) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + 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)))) { + __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 + { + #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); + } + #endif + } +} + +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_1_preProcess(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess *)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_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_1_preProcess(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_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_1_preProcess_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_preProcess}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_1_preProcess}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_1_preProcess}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_preProcess}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_1_preProcess_spec = { + "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, + __pyx_type_10constraint_11constraints___pyx_scope_struct_1_preProcess_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_1_preProcess = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct_1_preProcess", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*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*/ + 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_1_preProcess, /*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 PY_VERSION_HEX >= 0x030800b1 && (!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_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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr)); + (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/constraints.py":1134 - * return False - * else: - * if self._exact: # <<<<<<<<<<<<<< - * if found != self._n: - * return False -*/ - goto __pyx_L23; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_genexpr) { + if (PyObject_CallFinalizerFromDealloc(o)) return; } - - /* "constraint/constraints.py":1138 - * return False - * else: - * if found < self._n: # <<<<<<<<<<<<<< - * return False - * 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, 1138, __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, 1138, __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, 1138, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_5) { - - /* "constraint/constraints.py":1139 - * 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":1138 - * return False - * else: - * if found < self._n: # <<<<<<<<<<<<<< - * return False - * return True -*/ - } + } + #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 (((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)))) { + __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 + { + #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); } - __pyx_L23:; + #endif } - __pyx_L7:; - - /* "constraint/constraints.py":1140 - * 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":1106 - * self._exact = exact - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * set = self._set - * missing = 0 -*/ +} - /* 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_10); - __Pyx_AddTraceback("constraint.constraints.SomeNotInSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_set); - __Pyx_XDECREF(__pyx_v_missing); - __Pyx_XDECREF(__pyx_v_found); - __Pyx_XDECREF(__pyx_v_variable); - __Pyx_XDECREF(__pyx_v_domain); - __Pyx_XDECREF(__pyx_v_value); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_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; } -/* #### Code section: module_exttypes ### */ +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr_spec = { + "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, + __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr_slots, +}; +#else -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_defaults(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct_2_genexpr", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_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_2_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 PY_VERSION_HEX >= 0x030800b1 && (!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_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 - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; + #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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr)); + (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; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_defaults(PyObject *o) { - struct __pyx_defaults *p = (struct __pyx_defaults *)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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_defaults) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->arg0); - #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); - #else + 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 (((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)))) { + __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 { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); - if (tp_free) tp_free(o); + #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); + } + #endif } - #endif } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_defaults(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_defaults *p = (struct __pyx_defaults *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } - if (p->arg0) { - e = (*v)(p->arg0, 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; -} - -static int __pyx_tp_clear_10constraint_11constraints___pyx_defaults(PyObject *o) { - PyObject* tmp; - struct __pyx_defaults *p = (struct __pyx_defaults *)o; - tmp = ((PyObject*)p->arg0); - p->arg0 = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_defaults_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_defaults}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_defaults}, - {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_defaults}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_defaults}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_defaults_spec = { - "constraint.constraints.__pyx_defaults", - sizeof(struct __pyx_defaults), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_spec = { + "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, - __pyx_type_10constraint_11constraints___pyx_defaults_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_defaults = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_defaults", /*tp_name*/ - sizeof(struct __pyx_defaults), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_3_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_defaults, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -28546,8 +33102,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_defaults = { 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_defaults, /*tp_traverse*/ - __pyx_tp_clear_10constraint_11constraints___pyx_defaults, /*tp_clear*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -28564,7 +33120,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_defaults = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_defaults, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -28597,16 +33153,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_defaults = { }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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__genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr)); + 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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -28619,11 +33175,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct__gen 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct__genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -28632,8 +33188,8 @@ 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)))) { - __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); + 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)))) { + __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 { @@ -28648,9 +33204,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct__gene } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -28664,27 +33220,27 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__gene return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct__genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct__genexpr}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_spec = { - "constraint.constraints.__pyx_scope_struct__genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_spec = { + "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, - __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct__genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_4_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct__genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -28706,7 +33262,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct__ge 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -28724,7 +33280,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct__ge #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct__genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -28757,16 +33313,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct__ge }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_preProcess(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_1_preProcess > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess)); + 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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -28779,11 +33335,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_pr 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_preProcess) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_preProcess) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -28792,8 +33348,8 @@ 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)))) { - __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); + 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)))) { + __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 { @@ -28808,9 +33364,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_pre } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_1_preProcess(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_preProcess(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -28824,9 +33380,9 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_1_pre return 0; } -static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_1_preProcess(PyObject *o) { +static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_5_preProcess(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *)o; tmp = ((PyObject*)p->__pyx_v_domains); p->__pyx_v_domains = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); @@ -28836,28 +33392,28 @@ static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_1_prePro return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_1_preProcess_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_preProcess}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_1_preProcess}, - {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_1_preProcess}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_preProcess}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_preProcess}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_preProcess}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_5_preProcess}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_preProcess}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_1_preProcess_spec = { - "constraint.constraints.__pyx_scope_struct_1_preProcess", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess_spec = { + "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, - __pyx_type_10constraint_11constraints___pyx_scope_struct_1_preProcess_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_1_preProcess = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_1_preProcess", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_5_preProcess", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_preProcess, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_preProcess, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -28879,8 +33435,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_1_p 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*/ 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*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_preProcess, /*tp_traverse*/ + __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_5_preProcess, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -28897,7 +33453,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_1_p #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_preProcess, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_preProcess, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -28930,16 +33486,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_1_p }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_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)))) { - 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -28952,11 +33508,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_ge 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; +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((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_2_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_6_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -28967,8 +33523,8 @@ 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)))) { - __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); + 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); } else #endif { @@ -28983,9 +33539,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_gen } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { +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_2_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr *)o; + 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; @@ -29005,27 +33561,27 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_gen return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_genexpr}, +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_2_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_2_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr), +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|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_2_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr), /*tp_basicsize*/ + "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_2_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_6_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -29047,7 +33603,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_g 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_6_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -29065,7 +33621,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_g #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_6_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -29098,16 +33654,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_g }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_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)))) { - 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -29120,23 +33676,21 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_ge 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; +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((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_3_genexpr) { + 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_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_value); #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)))) { - __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); + 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); } else #endif { @@ -29151,49 +33705,43 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_gen } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { +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_3_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr *)o; + 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_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_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_3_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr}, +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_3_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_3_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr), +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|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_3_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ + "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_3_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_7_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -29215,7 +33763,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_g 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_7_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -29233,7 +33781,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_g #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_7_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -29266,16 +33814,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_g }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_11constraints___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_11constraints___pyx_scope_struct_4_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -29288,11 +33836,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_ge 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; +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; #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_4_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_8_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -29301,8 +33849,8 @@ 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)))) { - __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); + 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); } else #endif { @@ -29317,9 +33865,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_gen } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_8_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -29333,27 +33881,27 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_gen return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr}, +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}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_4_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr), +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), 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_4_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_8_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_8_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_4_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_8_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_8_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -29375,7 +33923,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_g 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_8_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -29393,7 +33941,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_g #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_8_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -29426,16 +33974,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_g }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_preProcess(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_9_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)))) { - 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -29448,11 +33996,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_pr 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; +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; #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_5_preProcess) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_9_preProcess) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -29461,8 +34009,8 @@ 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)))) { - __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); + 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); } else #endif { @@ -29477,9 +34025,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_pre } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_preProcess(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_9_preProcess(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -29493,9 +34041,9 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_pre return 0; } -static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_5_preProcess(PyObject *o) { +static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_9_preProcess(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *)o; + 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); @@ -29505,28 +34053,28 @@ static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_5_prePro return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_preProcess}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_preProcess}, - {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_5_preProcess}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_preProcess}, +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}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess_spec = { - "constraint.constraints.__pyx_scope_struct_5_preProcess", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess), +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), 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_5_preProcess_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_9_preProcess_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_9_preProcess = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_5_preProcess", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_9_preProcess", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_preProcess, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_9_preProcess, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -29548,8 +34096,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_p 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*/ 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*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_9_preProcess, /*tp_traverse*/ + __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_9_preProcess, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -29566,7 +34114,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_p #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_preProcess, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_9_preProcess, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -29599,16 +34147,16 @@ 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_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_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -29621,11 +34169,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_6_ge 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_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_6_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_10_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -29636,8 +34184,8 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_6_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_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 (((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); } else #endif { @@ -29652,9 +34200,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_6_gen } } -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_10_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; + 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; @@ -29674,27 +34222,27 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_6_gen 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_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_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_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_6_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_10_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*/ + "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_6_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_10_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -29716,7 +34264,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_6_g 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_6_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_10_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -29734,7 +34282,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_10_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -29767,16 +34315,16 @@ 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_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_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -29789,11 +34337,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_7_ge 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_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_7_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -29802,8 +34350,8 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_7_gen 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_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 (((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); } else #endif { @@ -29818,9 +34366,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_7_gen } } -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_11_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_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; @@ -29834,27 +34382,27 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_7_gen 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_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_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_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_7_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_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_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_7_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -29876,7 +34424,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_7_g 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_7_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -29894,7 +34442,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_11_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -29927,16 +34475,16 @@ 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_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_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_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__)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -29949,21 +34497,21 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_8_ge 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_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_8_genexpr) { + 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_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_m); + Py_CLEAR(p->__pyx_v_assigned_product); + Py_CLEAR(p->__pyx_v_target_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 (((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); } else #endif { @@ -29978,43 +34526,56 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_8_gen } } -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_12___call__(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_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_genexpr_arg_0) { - e = (*v)(p->__pyx_genexpr_arg_0, 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_v_m) { - e = (*v)(p->__pyx_v_m, 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_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_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_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_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_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_8_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_12___call___slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_8_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_12___call__ = { 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_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_8_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12___call__, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -30036,8 +34597,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_8_g 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_8_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*/ @@ -30054,7 +34615,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_12___call__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -30087,16 +34648,16 @@ 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_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_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -30109,21 +34670,23 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_9_pr 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_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_9_preProcess) { + 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_v_domains); - Py_CLEAR(p->__pyx_v_var); + 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_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 (((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); } else #endif { @@ -30138,56 +34701,49 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_9_pre } } -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_13_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_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_v_domains) { - e = (*v)(p->__pyx_v_domains, 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_var) { - e = (*v)(p->__pyx_v_var, 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_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_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_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_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_9_preProcess_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_9_preProcess = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_13_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_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_9_preProcess, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -30209,8 +34765,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_9_p 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*/ 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_13_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -30227,7 +34783,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_13_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -30260,16 +34816,16 @@ 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_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_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -30282,11 +34838,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_10_g 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_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_10_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_14_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -30294,11 +34850,11 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_10_ge 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_v_c); Py_CLEAR(p->__pyx_t_0); #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 (((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); } else #endif { @@ -30313,9 +34869,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_10_ge } } -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_14_genexpr(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_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; @@ -30326,8 +34882,8 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_10_ge 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_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; @@ -30335,27 +34891,27 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_10_ge 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_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_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_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_10_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_14_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_14_genexpr = { 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_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_10_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_14_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -30377,7 +34933,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_10_ 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_10_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_14_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -30395,7 +34951,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_14_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -30428,16 +34984,16 @@ 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_15_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -30450,21 +35006,22 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_11_g 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_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; #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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_15_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); #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 (((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); } else #endif { @@ -30479,43 +35036,46 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_ge } } -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_15_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_15_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_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; } 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_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}, {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_15_genexpr_spec = { + "constraint.constraints.__pyx_scope_struct_15_genexpr", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_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, + __pyx_type_10constraint_11constraints___pyx_scope_struct_15_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_15_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_15_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_15_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -30537,7 +35097,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_ 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_15_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -30555,7 +35115,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_15_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -30588,16 +35148,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_ }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12_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_12_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_12_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_12_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_16_genexpr > 0) & (int)(t->tp_basicsize == 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -30610,11 +35170,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12_g return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12_genexpr(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_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_12_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_16_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -30623,8 +35183,8 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12_ge 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_12_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_12_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_12_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_16_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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 { @@ -30639,9 +35199,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12_ge } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_12_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_12_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_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; @@ -30655,27 +35215,27 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_12_ge return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_12_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12_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_12_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_12_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_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_12_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_16_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_16_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_12_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_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_12_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_16_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -30697,7 +35257,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_12_ 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_12_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_16_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -30715,7 +35275,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_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*/ @@ -30802,15 +35362,15 @@ 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, 63, __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, 63, __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, 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) #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, 63, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults) < 0) __PYX_ERR(0, 64, __pyx_L1_error) #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)) { @@ -30818,15 +35378,15 @@ 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, 392, __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, 392, __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, 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) #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, 392, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 393, __pyx_L1_error) #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)) { @@ -30834,15 +35394,15 @@ 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, 395, __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, 395, __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, 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) #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, 395, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess) < 0) __PYX_ERR(0, 396, __pyx_L1_error) #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)) { @@ -30850,15 +35410,15 @@ 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, 409, __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, 409, __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, 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) #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, 409, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 410, __pyx_L1_error) #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)) { @@ -30866,15 +35426,15 @@ 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, 410, __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, 410, __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, 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) #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, 410, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 411, __pyx_L1_error) #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)) { @@ -30882,15 +35442,15 @@ 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, 539, __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, 539, __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, 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) #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, 539, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 540, __pyx_L1_error) #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)) { @@ -30898,15 +35458,15 @@ 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, 542, __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, 542, __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, 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) #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, 542, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess) < 0) __PYX_ERR(0, 543, __pyx_L1_error) #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)) { @@ -30914,15 +35474,15 @@ 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, 550, __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, 550, __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, 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) #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, 550, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 551, __pyx_L1_error) #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)) { @@ -30930,15 +35490,15 @@ 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, 613, __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, 613, __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, 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) #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, 613, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 614, __pyx_L1_error) #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)) { @@ -30946,15 +35506,15 @@ 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, 709, __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, 709, __pyx_L1_error) + __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) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_genexpr = &__pyx_type_10constraint_11constraints___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_11constraints___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(0, 709, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(0, 710, __pyx_L1_error) #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)) { @@ -30962,15 +35522,15 @@ 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_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, 712, __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, 712, __pyx_L1_error) + __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) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_preProcess = &__pyx_type_10constraint_11constraints___pyx_scope_struct_9_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_9_preProcess) < 0) __PYX_ERR(0, 712, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_preProcess) < 0) __PYX_ERR(0, 713, __pyx_L1_error) #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)) { @@ -30978,15 +35538,15 @@ 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_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, 720, __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, 720, __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, 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) #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, 720, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr) < 0) __PYX_ERR(0, 721, __pyx_L1_error) #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)) { @@ -30994,15 +35554,15 @@ 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, 779, __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, 779, __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, 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) #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, 779, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr) < 0) __PYX_ERR(0, 780, __pyx_L1_error) #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)) { @@ -31010,19 +35570,83 @@ 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_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr)) __PYX_ERR(0, 856, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(0, 856, __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, 888, __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, 888, __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, 888, __pyx_L1_error) + #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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__->tp_getattro = PyObject_GenericGetAttr; + } + #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, 911, __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, 911, __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, 911, __pyx_L1_error) + #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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr->tp_getattro = PyObject_GenericGetAttr; + } + #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, 912, __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, 912, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr; + __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_12_genexpr) < 0) __PYX_ERR(0, 856, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr) < 0) __PYX_ERR(0, 912, __pyx_L1_error) #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_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr->tp_getattro = PyObject_GenericGetAttr; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr->tp_getattro = PyObject_GenericGetAttr; + } + #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, 926, __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, 926, __pyx_L1_error) + #else + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_15_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_15_genexpr) < 0) __PYX_ERR(0, 926, __pyx_L1_error) + #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; + } + #endif + #if CYTHON_USE_TYPE_SPECS + __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, 960, __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, 960, __pyx_L1_error) + #else + __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_genexpr) < 0) __PYX_ERR(0, 960, __pyx_L1_error) + #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_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 __Pyx_RefNannyFinishContext(); @@ -31366,7 +35990,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); * 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); @@ -31391,8 +36015,8 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); * from constraint.domain import Unassigned * from typing import Callable, Union, Optional * from collections.abc import Sequence # <<<<<<<<<<<<<< + * from itertools import product * - * class Constraint: */ __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); @@ -31405,161 +36029,179 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":7 + /* "constraint/constraints.py":6 + * from typing import Callable, Union, Optional * from collections.abc import Sequence + * from itertools import product # <<<<<<<<<<<<<< + * + * 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) + __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; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":8 + * from itertools import product * * class Constraint: # <<<<<<<<<<<<<< * """Abstract base class for constraints.""" * */ - __pyx_t_3 = __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_3)) __PYX_ERR(0, 7, __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_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_GOTREF(__pyx_t_2); - /* "constraint/constraints.py":10 + /* "constraint/constraints.py":11 * """Abstract base class for constraints.""" * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # <<<<<<<<<<<<<< * """Perform the constraint checking. * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 10, __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, 10, __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, 10, __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[10])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error) + __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[13])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0]); - __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_call, __pyx_t_4) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + __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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":35 + /* "constraint/constraints.py":36 * 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, 35, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __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, 35, __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, 35, __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, 35, __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, 35, __pyx_L1_error) - __pyx_t_2 = __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[11])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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[14])); 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); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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":63 + /* "constraint/constraints.py":64 * vconstraints[variable].remove((self, variables)) * * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): # <<<<<<<<<<<<<< * """Helper method for generic forward checking. * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 63, __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, 63, __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, 63, __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[12])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error) + __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[15])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __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, 63, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error) + 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) __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_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_forwardCheck, __pyx_t_4) < 0) __PYX_ERR(0, 63, __pyx_L1_error) + __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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":7 - * from collections.abc import Sequence + /* "constraint/constraints.py":8 + * from itertools import product * * 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_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7, __pyx_L1_error) + __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, 7, __pyx_L1_error) + 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":104 + /* "constraint/constraints.py":105 * * * class FunctionConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint which wraps a function defining the constraint logic. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __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, 104, __pyx_L1_error) + __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_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_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, 104, __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, 104, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __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, 104, __pyx_L1_error) + __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_3 != __pyx_t_4) { - if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 104, __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, 105, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":125 + /* "constraint/constraints.py":126 * """ * * 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, 125, __pyx_L1_error) + __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, 125, __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, 125, __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[13])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __pyx_L1_error) + 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[16])); 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[1]); + __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, 125, __pyx_L1_error) + 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; - /* "constraint/constraints.py":137 + /* "constraint/constraints.py":138 * 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, 137, __pyx_L1_error) + __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, 137, __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, 137, __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, 137, __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[14])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __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, 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[17])); 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, 137, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 138, __pyx_L1_error) - /* "constraint/constraints.py":143 + /* "constraint/constraints.py":144 * 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, 143, __pyx_L1_error) + __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_GOTREF(__pyx_t_7); __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_4)->arg0 = __pyx_t_7; __Pyx_GIVEREF(__pyx_t_7); @@ -31567,219 +36209,219 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 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, 137, __pyx_L1_error) + 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; - /* "constraint/constraints.py":104 + /* "constraint/constraints.py":105 * * * class FunctionConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint which wraps a function defining the constraint logic. * */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) + __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, 104, __pyx_L1_error) + 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":190 + /* "constraint/constraints.py":191 * 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_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __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, 190, __pyx_L1_error) + __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_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, 190, __pyx_L1_error) + __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_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 190, __pyx_L1_error) + __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_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_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __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, 190, __pyx_L1_error) + __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_3 != __pyx_t_2) { - if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 190, __pyx_L1_error) + 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) } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":193 + /* "constraint/constraints.py":194 * """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_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_func, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 193, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_assigned, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(0, 193, __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[15])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) + __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[18])); 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[1]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 193, __pyx_L1_error) + __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; - /* "constraint/constraints.py":197 + /* "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") * */ - __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[16])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error) + __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[19])); 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, 197, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_6)->arg0 = __pyx_t_2; - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; + 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, 197, __pyx_L1_error) + 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; - /* "constraint/constraints.py":190 + /* "constraint/constraints.py":191 * 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_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) + __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, 190, __pyx_L1_error) + 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_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":201 + /* "constraint/constraints.py":202 * * * class AllDifferentConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of all given variables are different. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __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, 201, __pyx_L1_error) + __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_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __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, 201, __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, 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_3, __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, 201, __pyx_L1_error) + __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_3 != __pyx_t_5) { - if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 201, __pyx_L1_error) + 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":212 + /* "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, 212, __pyx_L1_error) + __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, 212, __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, 212, __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, 212, __pyx_L1_error) - __pyx_t_2 = __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[17])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 212, __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, 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[20])); 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":218 + /* "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, 218, __pyx_L1_error) + __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_2)->arg0 = __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_2, __pyx_pf_10constraint_11constraints_6__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_5); + __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_2) < 0) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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":201 + /* "constraint/constraints.py":202 * * * class AllDifferentConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of all given variables are different. * */ - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __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, 201, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __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_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":239 + /* "constraint/constraints.py":240 * * * class AllEqualConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of all given variables are equal. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __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, 239, __pyx_L1_error) + __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_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __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, 239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __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_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __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); - if (__pyx_t_3 != __pyx_t_4) { - if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 239, __pyx_L1_error) + __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":250 + /* "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, 250, __pyx_L1_error) + __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, 250, __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, 250, __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, 250, __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[18])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __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, 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[21])); 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, 250, __pyx_L1_error) + 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":256 + /* "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, 256, __pyx_L1_error) + __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_GOTREF(__pyx_t_7); __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_5)->arg0 = __pyx_t_7; __Pyx_GIVEREF(__pyx_t_7); @@ -31787,1191 +36429,1312 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 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_2, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 250, __pyx_L1_error) + 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":239 + /* "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_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 239, __pyx_L1_error) + __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, 239, __pyx_L1_error) + 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) __Pyx_DECREF(__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; __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":277 + /* "constraint/constraints.py":278 * * * class ExactSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum exactly to a given amount. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __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, 277, __pyx_L1_error) + __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_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_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, 277, __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, 277, __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, 278, __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_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, 277, __pyx_L1_error) + __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_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, 277, __pyx_L1_error) + 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) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":288 + /* "constraint/constraints.py":289 * """ * * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 289, __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, 288, __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, 288, __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[19])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) + 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[22])); 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[2]); + __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, 288, __pyx_L1_error) + 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":300 + /* "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, 300, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __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, 300, __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, 300, __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, 300, __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, 300, __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[20])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __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, 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[23])); 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, 300, __pyx_L1_error) + 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; - /* "constraint/constraints.py":317 + /* "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 */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 317, __pyx_L1_error) + __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, 317, __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, 317, __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, 317, __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[21])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __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, 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[24])); 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[0]); + __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_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 317, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":277 + /* "constraint/constraints.py":278 * * * class ExactSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum exactly to a given amount. * */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 277, __pyx_L1_error) + __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_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, 277, __pyx_L1_error) + 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) __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; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":365 + /* "constraint/constraints.py":366 * return sum == exactsum * * class VariableExactSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the sum of variables equals the value of another variable. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __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, 365, __pyx_L1_error) + __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_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, 365, __pyx_L1_error) + __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 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 365, __pyx_L1_error) + __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_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_3, __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, 365, __pyx_L1_error) + __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_GOTREF(__pyx_t_4); - if (__pyx_t_3 != __pyx_t_2) { - if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 365, __pyx_L1_error) + 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) } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":376 + /* "constraint/constraints.py":377 * """ * - * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 376, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_sum_vars, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 376, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Optional_Sequence) < 0) __PYX_ERR(0, 376, __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[22])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error) + __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[25])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 377, __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_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 376, __pyx_L1_error) + __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; - /* "constraint/constraints.py":395 + /* "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) * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) + __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, 395, __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, 395, __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, 395, __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, 395, __pyx_L1_error) - __pyx_t_2 = __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[23])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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[26])); 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_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_2) < 0) __PYX_ERR(0, 395, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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":417 + /* "constraint/constraints.py":418 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 417, __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, 417, __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, 417, __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[24])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 417, __pyx_L1_error) + __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[27])); 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[0]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 417, __pyx_L1_error) + __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":365 + /* "constraint/constraints.py":366 * return sum == exactsum * * class VariableExactSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the sum of variables equals the value of another variable. * */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 365, __pyx_L1_error) + __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_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, 365, __pyx_L1_error) + 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) __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_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":469 + /* "constraint/constraints.py":470 * * * class MinSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum at least to a given amount. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __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, 469, __pyx_L1_error) + __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_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_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, 469, __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, 469, __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, 470, __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_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __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, 469, __pyx_L1_error) + __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_GOTREF(__pyx_t_6); - if (__pyx_t_3 != __pyx_t_5) { - if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 469, __pyx_L1_error) + 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) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":480 + /* "constraint/constraints.py":481 * """ * * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 481, __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, 480, __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, 480, __pyx_L1_error) - __pyx_t_2 = __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[25])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[2]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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[28])); 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); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(0, 480, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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":492 + /* "constraint/constraints.py":493 * self._multipliers = multipliers * * 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_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 492, __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, 492, __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, 492, __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[26])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 492, __pyx_L1_error) + __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[29])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[0]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 492, __pyx_L1_error) + __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_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":469 + /* "constraint/constraints.py":470 * * * class MinSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum at least to a given amount. * */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 469, __pyx_L1_error) + __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_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, 469, __pyx_L1_error) + 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) __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":512 + /* "constraint/constraints.py":513 * return sum >= minsum * * class VariableMinSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the sum of variables sum at least to the value of another variable. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __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, 512, __pyx_L1_error) + __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_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_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, 512, __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, 512, __pyx_L1_error) + __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_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_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __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, 512, __pyx_L1_error) + __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_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, 512, __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, 513, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":523 + /* "constraint/constraints.py":524 * """ # noqa: E501 * - * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __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, 523, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sum_vars, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 523, __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, 523, __pyx_L1_error) - __pyx_t_2 = __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[27])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[2]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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[30])); 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); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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; - /* "constraint/constraints.py":542 + /* "constraint/constraints.py":543 * 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_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 542, __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, 542, __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, 542, __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, 542, __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[28])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error) + __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[31])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __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_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 542, __pyx_L1_error) + __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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":555 + /* "constraint/constraints.py":556 * 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, 555, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __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, 555, __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, 555, __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, 555, __pyx_L1_error) - __pyx_t_2 = __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[29])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[0]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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[32])); 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); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_2) < 0) __PYX_ERR(0, 555, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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; - /* "constraint/constraints.py":512 + /* "constraint/constraints.py":513 * return sum >= minsum * * class VariableMinSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the sum of variables sum at least to the value of another variable. * */ - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __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, 512, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __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_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":583 + /* "constraint/constraints.py":584 * * * class MaxSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum up to a given amount. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __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, 583, __pyx_L1_error) + __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_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_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, 583, __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, 583, __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_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_2)) __PYX_ERR(0, 583, __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, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__pyx_t_3 != __pyx_t_6) { - if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __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); + 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) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":594 + /* "constraint/constraints.py":595 * """ * * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 594, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 595, __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, 594, __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, 594, __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[30])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 594, __pyx_L1_error) + 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[33])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[2]); + __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_2, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 594, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":606 + /* "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) * */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __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, 606, __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, 606, __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, 606, __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, 606, __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[31])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 606, __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, 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[34])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 607, __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_2, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 606, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":641 + /* "constraint/constraints.py":642 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers * maxsum = self._maxsum */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 642, __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, 641, __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, 641, __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, 641, __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[32])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __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, 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[35])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0]); + __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_2, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 641, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 642, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":583 + /* "constraint/constraints.py":584 * * * class MaxSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum up to a given amount. * */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error) + __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_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, 583, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":682 + /* "constraint/constraints.py":683 * * * class VariableMaxSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the sum of variables sum at most to the value of another variable. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __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, 682, __pyx_L1_error) + __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_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_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, 682, __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, 682, __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, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __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, 682, __pyx_L1_error) + __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_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, 682, __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, 683, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":693 + /* "constraint/constraints.py":694 * """ # noqa: E501 * - * def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __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, 693, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_sum_vars, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 693, __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, 693, __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[33])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 693, __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, 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[36])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[2]); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[3]); __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, 693, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":712 + /* "constraint/constraints.py":713 * 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, 712, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __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, 712, __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, 712, __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, 712, __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, 712, __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[34])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 712, __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, 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[37])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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, 712, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":725 + /* "constraint/constraints.py":726 * 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, 725, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 726, __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, 725, __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, 725, __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, 725, __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[35])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 725, __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, 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[38])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[0]); + __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, 725, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":682 + /* "constraint/constraints.py":683 * * * class VariableMaxSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the sum of variables sum at most to the value of another variable. * */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L1_error) + __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_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, 682, __pyx_L1_error) + 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) __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; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":753 + /* "constraint/constraints.py":754 * * * class ExactProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product of exactly a given amount. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __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, 753, __pyx_L1_error) + __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_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, 753, __pyx_L1_error) + __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_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __pyx_L1_error) + __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_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_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __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, 753, __pyx_L1_error) + __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_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, 753, __pyx_L1_error) + 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) } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":764 + /* "constraint/constraints.py":765 * """ * * def __init__(self, exactprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate an ExactProdConstraint. * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exactprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 764, __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[36])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 764, __pyx_L1_error) + __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[39])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 765, __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_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(0, 764, __pyx_L1_error) + __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) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":772 + /* "constraint/constraints.py":773 * self._exactprod = exactprod * * 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, 772, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 773, __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, 772, __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, 772, __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, 772, __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, 772, __pyx_L1_error) - __pyx_t_2 = __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[37])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 772, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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[40])); 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); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_2) < 0) __PYX_ERR(0, 772, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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; - /* "constraint/constraints.py":800 + /* "constraint/constraints.py":801 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * exactprod = self._exactprod * prod = 1 */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 800, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 800, __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, 800, __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, 800, __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[38])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 800, __pyx_L1_error) + __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[41])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[0]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 800, __pyx_L1_error) + __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_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":753 + /* "constraint/constraints.py":754 * * * class ExactProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product of exactly a given amount. * */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 753, __pyx_L1_error) + __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_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, 753, __pyx_L1_error) + 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) __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 + * + * 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, 828, __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_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_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_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_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) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":839 + * """ + * + * def __init__(self, target_var: str, product_vars: Sequence[str]): # <<<<<<<<<<<<<< + * """Instantiate a VariableExactProdConstraint. + * +*/ + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 839, __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[42])); 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); + __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":830 + /* "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[43])); 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":867 + * return min(products), max(products) * - * class MaxProdConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables create a product up to at most a given amount. + * 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[44])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __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, 867, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":873 + * return prod + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 830, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 873, __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, 830, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 873, __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, 873, __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, 873, __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, 873, __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[45])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __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; - __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 830, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 873, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":888 + * 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_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __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, 888, __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, 888, __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, 888, __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[46])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 888, __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, 888, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":828 + * return True + * + * class VariableExactProdConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that the product of variables equals 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); - __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 830, __pyx_L1_error) + 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_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":934 + * + * + * 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, 934, __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, 934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __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_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 830, __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, 934, __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, 934, __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, 830, __pyx_L1_error) + __pyx_t_3 = __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_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 934, __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, 934, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":841 + /* "constraint/constraints.py":945 * """ * * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MaxProdConstraint. * */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 841, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 945, __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_Union_int_float) < 0) __PYX_ERR(0, 945, __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[47])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_maxprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 841, __pyx_L1_error) - __pyx_t_2 = __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[39])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __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_init, __pyx_t_4) < 0) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(0, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":849 + /* "constraint/constraints.py":953 * self._maxprod = maxprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 849, __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, 849, __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, 849, __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, 849, __pyx_L1_error) - __pyx_t_4 = __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[40])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 849, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 953, __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_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 849, __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, 953, __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, 953, __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, 953, __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, 953, __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[48])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 953, __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_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":877 + /* "constraint/constraints.py":981 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * maxprod = self._maxprod * prod = 1 */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 981, __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, 981, __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, 981, __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, 981, __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[49])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 981, __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, 877, __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, 877, __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, 877, __pyx_L1_error) - __pyx_t_2 = __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[41])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 877, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[0]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); + __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, 981, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_2) < 0) __PYX_ERR(0, 877, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":830 + /* "constraint/constraints.py":934 * * * class MaxProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product up to at most a given amount. * */ - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 830, __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, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __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_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 934, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 934, __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_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":905 + /* "constraint/constraints.py":1009 * * * class MinProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product up to at least a given amount. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 905, __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, 905, __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, 905, __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, 905, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __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, 1009, __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_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_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __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, 1009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__pyx_t_3 != __pyx_t_6) { - if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 905, __pyx_L1_error) + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __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_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_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1009, __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, 1009, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":916 + /* "constraint/constraints.py":1020 * """ * * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MinProdConstraint. * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 916, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1020, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_minprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 1020, __pyx_L1_error) + __pyx_t_6 = __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[50])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1020, __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, 916, __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[42])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 916, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __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_init, __pyx_t_6) < 0) __PYX_ERR(0, 1020, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 916, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":924 + /* "constraint/constraints.py":1028 * 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_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 924, __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, 924, __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, 924, __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, 924, __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, 924, __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[43])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 924, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1028, __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_2, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 924, __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, 1028, __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, 1028, __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, 1028, __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, 1028, __pyx_L1_error) + __pyx_t_5 = __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[51])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1028, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __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, 1028, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":935 + /* "constraint/constraints.py":1039 * 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_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 935, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1039, __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, 1039, __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, 1039, __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, 1039, __pyx_L1_error) + __pyx_t_6 = __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[52])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __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, 935, __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, 935, __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, 935, __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[44])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 935, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __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, 1039, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 935, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":905 + /* "constraint/constraints.py":1009 * * * class MinProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product up to at least a given amount. * */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 905, __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, 905, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 1009, __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_2); __pyx_t_2 = 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":951 + /* "constraint/constraints.py":1055 * * * class InSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are present in the given set. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 951, __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, 951, __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, 951, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1055, __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, 1055, __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, 951, __pyx_L1_error) + __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, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __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_4)) __PYX_ERR(0, 951, __pyx_L1_error) + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1055, __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, 951, __pyx_L1_error) + __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, 1055, __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, 1055, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":962 + /* "constraint/constraints.py":1066 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_5 = __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[45])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 962, __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, 962, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __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[53])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1066, __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, 1066, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":970 + /* "constraint/constraints.py":1074 * 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_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[46])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 970, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[0]); - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 970, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __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[54])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1074, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[1]); + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_3) < 0) __PYX_ERR(0, 1074, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":974 + /* "constraint/constraints.py":1078 * 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, 974, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1078, __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, 1078, __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, 1078, __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, 1078, __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, 1078, __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[55])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1078, __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, 974, __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, 974, __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, 974, __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, 974, __pyx_L1_error) - __pyx_t_6 = __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[47])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 974, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __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_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 1078, __pyx_L1_error) __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, 974, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":951 + /* "constraint/constraints.py":1055 * * * class InSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are present in the given set. * */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 951, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 951, __pyx_L1_error) + __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, 1055, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 1055, __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; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":985 + /* "constraint/constraints.py":1089 * * * class NotInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are not present in the given set. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 985, __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, 985, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1089, __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, 985, __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, 985, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1089, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __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_6)) __PYX_ERR(0, 985, __pyx_L1_error) + __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, 1089, __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, 1089, __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, 985, __pyx_L1_error) + __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, 1089, __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, 1089, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":996 + /* "constraint/constraints.py":1100 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_2 = __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[48])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 996, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(0, 996, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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[56])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 1100, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1004 + /* "constraint/constraints.py":1108 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * # preProcess() will remove it. * raise RuntimeError("Can't happen") */ - __pyx_t_2 = __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[49])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[0]); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_2) < 0) __PYX_ERR(0, 1004, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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[57])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1108, __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_call, __pyx_t_4) < 0) __PYX_ERR(0, 1108, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1008 + /* "constraint/constraints.py":1112 * 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_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1008, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1008, __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, 1008, __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, 1008, __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, 1008, __pyx_L1_error) - __pyx_t_5 = __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[50])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1008, __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_6, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 1008, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1112, __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, 1112, __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, 1112, __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, 1112, __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, 1112, __pyx_L1_error) + __pyx_t_3 = __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[58])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __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_preProcess, __pyx_t_3) < 0) __PYX_ERR(0, 1112, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":985 + /* "constraint/constraints.py":1089 * * * class NotInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are not present in the given set. * */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 985, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 985, __pyx_L1_error) + __pyx_t_3 = __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_3)) __PYX_ERR(0, 1089, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 1089, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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":1019 + /* "constraint/constraints.py":1123 * * * 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_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1019, __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, 1019, __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, 1019, __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, 1019, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1123, __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, 1123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __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_5)) __PYX_ERR(0, 1019, __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, 1123, __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, 1123, __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, 1019, __pyx_L1_error) + __pyx_t_3 = __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_3)) __PYX_ERR(0, 1123, __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, 1123, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1030 + /* "constraint/constraints.py":1134 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_4 = __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[51])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1030, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[3]); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 1030, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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[59])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[4]); + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 1134, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1044 + /* "constraint/constraints.py":1148 * 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, 1044, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1148, __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, 1148, __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, 1148, __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, 1148, __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[60])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1148, __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, 1044, __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, 1044, __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, 1044, __pyx_L1_error) - __pyx_t_2 = __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[52])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1044, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[0]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); + __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, 1148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_2) < 0) __PYX_ERR(0, 1044, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1019 + /* "constraint/constraints.py":1123 * * * class SomeInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that at least some of the values of given variables must be present in a given set. * */ - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1019, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 1019, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __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_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 1123, __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_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1081 + /* "constraint/constraints.py":1185 * * * 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_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1081, __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, 1081, __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, 1081, __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, 1081, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1185, __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, 1185, __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_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_2)) __PYX_ERR(0, 1081, __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, 1185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__pyx_t_3 != __pyx_t_6) { - if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1185, __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_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, 1185, __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, 1185, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1092 + /* "constraint/constraints.py":1196 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_6 = __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[53])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1092, __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_init, __pyx_t_6) < 0) __PYX_ERR(0, 1092, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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[61])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1196, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[4]); + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(0, 1196, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1106 + /* "constraint/constraints.py":1210 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * missing = 0 */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1106, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1210, __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, 1210, __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, 1210, __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, 1210, __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[62])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __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, 1106, __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, 1106, __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, 1106, __pyx_L1_error) - __pyx_t_4 = __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[54])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __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, 1210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 1106, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1081 + /* "constraint/constraints.py":1185 * * * 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_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1081, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 1185, __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_2); __pyx_t_2 = 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":1 * """Module containing the code for constraint definitions.""" # <<<<<<<<<<<<<< * * from constraint.domain import Unassigned */ - __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 ---*/ @@ -33053,6 +37816,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_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 */ @@ -33115,6 +37879,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -33124,6 +37889,13 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -33145,13 +37917,19 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_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 */ @@ -33165,7 +37943,10 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -33174,6 +37955,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -33183,12 +37965,16 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -33196,12 +37982,14 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_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 */ @@ -33213,16 +38001,28 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_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_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_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_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 */ @@ -33233,6 +38033,9 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_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 */ @@ -33240,9 +38043,11 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_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_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 */ @@ -33262,14 +38067,14 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, c 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, 198, __pyx_L1_error) - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 305, __pyx_L1_error) - __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_round); if (!__pyx_builtin_round) __PYX_ERR(0, 329, __pyx_L1_error) - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 391, __pyx_L1_error) - __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_max); if (!__pyx_builtin_max) __PYX_ERR(0, 404, __pyx_L1_error) - __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 409, __pyx_L1_error) - __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_min); if (!__pyx_builtin_min) __PYX_ERR(0, 414, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 972, __pyx_L1_error) + __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, 1076, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -33281,60 +38086,71 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "constraint/constraints.py":57 + /* "constraint/constraints.py":58 * 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, 57, __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, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); - /* "constraint/constraints.py":10 + /* "constraint/constraints.py":860 + * 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, 860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); + + /* "constraint/constraints.py":11 * """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[0] = PyTuple_Pack(1, ((PyObject*)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); + __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_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); - /* "constraint/constraints.py":125 + /* "constraint/constraints.py":126 * """ * * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(1, ((PyObject*)Py_True)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); + __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_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); - /* "constraint/constraints.py":288 + /* "constraint/constraints.py":289 * """ * * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); + __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_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); - /* "constraint/constraints.py":1030 + /* "constraint/constraints.py":1134 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * */ - __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, 1030, __pyx_L1_error) - __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); + __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, 1134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]); __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -33365,10 +38181,10 @@ static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { unsigned int argcount : 3; unsigned int num_posonly_args : 1; unsigned int num_kwonly_args : 1; - unsigned int nlocals : 5; + unsigned int nlocals : 6; unsigned int flags : 10; unsigned int first_line : 11; - unsigned int line_table_length : 13; + unsigned int line_table_length : 14; } __Pyx_PyCode_New_function_description; /* NewCodeObj.proto */ static PyObject* __Pyx_PyCode_New( @@ -33385,279 +38201,319 @@ 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), 392, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 393, 2}; 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 409, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 410, 2}; 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; } { - 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), 411, 2}; 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 539, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 540, 2}; 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 550, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 551, 2}; 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), 613, 2}; + 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 709, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 710, 2}; 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 720, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 721, 2}; 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 779, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 780, 2}; 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 856, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 911, 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), 912, 2}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 926, 2}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 960, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_value}; - __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_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; + __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, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 10, 20}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 11, 20}; 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[10] = __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[10])) 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_call, __pyx_k_55H_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 35, 109}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 36, 109}; 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[11] = __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[11])) 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_preProcess, __pyx_k_77JJeef_3a_Q_y_WAQ_q_4t1Kz_1_wb, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 63, 151}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 64, 151}; 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[12] = __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[12])) goto bad; + __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_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[15])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 125, 25}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 126, 25}; 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[13] = __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[13])) 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_init, __pyx_k_Zz_IQ_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 137, 142}; + const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 138, 142}; 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[14] = __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[14])) 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_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[17])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 193, 23}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 194, 23}; 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[15] = __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[15])) 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_init, __pyx_k_U_A_IQ_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 197, 19}; + const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 198, 19}; 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[16] = __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[16])) 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_call, __pyx_k_88XXY, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 212, 146}; + const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 213, 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_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[17] = __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[17])) 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_k_A_q_L_Kt1Ja_vWA_6_A_1_AYa_1_A_9G, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 250, 160}; + const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 251, 160}; 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[18] = __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[18])) 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_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[21])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 288, 27}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 289, 27}; 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[19] = __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[19])) 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_init, __pyx_k_4M_M_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 300, 149}; + 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[20] = __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[20])) 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_preProcess, __pyx_k_77JJeef_QfKy_Q_d_4q_1_1Kq_IV1_v, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 317, 375}; + 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[21] = __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[21])) 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_k_55H_a_d_4q_a_1_1Kq_9Cq_az_1_a_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 376, 86}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 377, 86}; 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[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_M_N_L_A_1_3a_Cs_Rs_J_b_3c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) 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_k_a_N_L_A_1_3a_Cs_Rs_J_b_3c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 395, 220}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 396, 220}; 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[23] = __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[23])) goto bad; + __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_k_77JJeef_QfKy_Q_d_1_3at_a_IV1_vR, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 417, 347}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 418, 347}; 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[24] = __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[24])) goto bad; + __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_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[27])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 480, 27}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 481, 27}; 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[25] = __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[25])) 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_k_2_q_Kq_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 492, 135}; + 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[26] = __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[26])) 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_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[29])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 523, 86}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 524, 86}; 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_M_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[30] = __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[30])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 542, 114}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 543, 114}; 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[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_4q_t1_S_A_IV1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) 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_preProcess, __pyx_k_77JJeef_QfKy_Q_d_4q_t1_S_A_IV1, 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), 555, 184}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 556, 184}; 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[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_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad; + __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_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[32])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 594, 27}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 595, 27}; 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[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[33] = __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[33])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 606, 257}; + 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[31] = __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[31])) 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_preProcess, __pyx_k_77JJeef_QfKy_Q_6Q_L_7_gQa_q_d_Q, 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), 641, 334}; + 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[32] = __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[32])) 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_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[35])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 693, 86}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 694, 86}; 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[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_M_N_L_A_1_3a_Cs_Rs_J_b_3c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) 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_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[36])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 712, 114}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 713, 114}; 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[34] = __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[34])) 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_preProcess, __pyx_k_77JJeef_QfKy_Q_d_4q_t1_S_A_IV1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[37])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 725, 184}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 726, 184}; 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[35] = __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[35])) goto bad; + __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_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[38])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 764, 14}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 765, 14}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exactprod}; - __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_init, __pyx_k_N, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad; + __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_init, __pyx_k_N, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 772, 216}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 773, 216}; 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[37] = __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[37])) 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_preProcess, __pyx_k_77JJeef_QfKy_Q_6a_A_L_gQ_waq_J, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 800, 258}; + 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[38] = __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[38])) 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_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[41])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 839, 25}; + 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[42] = __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[42])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 849, 151}; + 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[43] = __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_3avS_Qb_E_4q_3a_Qb, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 867, 24}; + 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[44] = __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[44])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 841, 14}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 873, 167}; + 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[45] = __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[45])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 32, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 888, 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[46] = __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[46])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 945, 14}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_maxprod}; - __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_init, __pyx_k_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) 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_init, __pyx_k_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[47])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 849, 216}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 953, 216}; 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[40] = __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[40])) 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_preProcess, __pyx_k_77JJeef_QfKy_Q_6a_A_L_gQ_waq_J_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 877, 248}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 981, 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[41] = __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[41])) 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_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[49])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 916, 14}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1020, 14}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_minprod}; - __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_init, __pyx_k_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad; + __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_init, __pyx_k_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[50])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 924, 92}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1028, 92}; 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[43] = __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[43])) 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_preProcess, __pyx_k_77JJeef_QfKy_Q_a_L_WAQ_q_6_Bd_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[51])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 935, 95}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1039, 95}; 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[44] = __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[44])) 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_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[52])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 962, 11}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1066, 11}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set}; - __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_init, __pyx_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) 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_init, __pyx_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[53])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 970, 14}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1074, 14}; 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[46] = __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[46])) 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_call, __pyx_k_8_l_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[54])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 974, 91}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1078, 91}; 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[47] = __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[47])) 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_preProcess, __pyx_k_77JJeef_d_L_WAQ_q_6_6_7_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[55])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 996, 11}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1100, 11}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set}; - __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_init, __pyx_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) 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_init, __pyx_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[56])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1004, 14}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1108, 14}; 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[49] = __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[49])) 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_call, __pyx_k_8_l_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[57])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1008, 91}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1112, 91}; 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[50] = __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[50])) 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_preProcess, __pyx_k_77JJeef_d_L_WAQ_q_6_A_6_7_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[58])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1030, 30}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1134, 30}; 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[51] = __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[51])) 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_k_E_HA_F_Ja, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[59])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1044, 249}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1148, 249}; 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[52] = __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[52])) 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_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[60])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1092, 30}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1196, 30}; 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[53] = __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[53])) goto bad; + __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_init, __pyx_k_E_HA_F_Ja, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[61])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1106, 249}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1210, 249}; 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[54] = __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[54])) 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_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[62])) goto bad; } Py_DECREF(tuple_dedup_map); return 0; @@ -36375,6 +41231,51 @@ static CYTHON_INLINE int __Pyx_PyLong_BoolNeObjC(PyObject *op1, PyObject *op2, l PyObject_RichCompare(op1, op2, Py_NE)); } +/* PyObjectVectorCallKwBuilder */ +#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); + args[n] = value; + return 0; +} +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_VectorcallBuilder_AddArgStr; + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n); +} +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + PyObject *pyKey = PyUnicode_FromString(key); + if (!pyKey) return -1; + return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n); +} +#else // CYTHON_VECTORCALL +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) { + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return PyDict_SetItem(builder, key, value); +} +#endif + +/* PyObjectVectorCallMethodKwBuilder */ +#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000 +static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) { + PyObject *result; + PyObject *obj = PyObject_GetAttr(args[0], name); + if (unlikely(!obj)) + return NULL; + result = __Pyx_Object_Vectorcall_CallFromBuilder(obj, args+1, nargsf-1, kwnames); + Py_DECREF(obj); + return result; +} +#endif + /* CallTypeTraverse */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #else @@ -38490,38 +43391,6 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } #endif -/* PyObjectVectorCallKwBuilder */ -#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); - args[n] = value; - return 0; -} -CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { - (void)__Pyx_VectorcallBuilder_AddArgStr; - if (unlikely(!PyUnicode_Check(key))) { - PyErr_SetString(PyExc_TypeError, "keywords must be strings"); - return -1; - } - return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n); -} -static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) { - PyObject *pyKey = PyUnicode_FromString(key); - if (!pyKey) return -1; - return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n); -} -#else // CYTHON_VECTORCALL -CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) { - if (unlikely(!PyUnicode_Check(key))) { - PyErr_SetString(PyExc_TypeError, "keywords must be strings"); - return -1; - } - return PyDict_SetItem(builder, key, value); -} -#endif - /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC diff --git a/constraint/constraints.py b/constraint/constraints.py index 0302da3..fd7542b 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -3,6 +3,7 @@ from constraint.domain import Unassigned from typing import Callable, Union, Optional from collections.abc import Sequence +from itertools import product class Constraint: """Abstract base class for constraints.""" @@ -373,7 +374,7 @@ class VariableExactSumConstraint(Constraint): [[('a', 1), ('b', 1), ('c', 2)], [('a', 1), ('b', 2), ('c', 3)], [('a', 2), ('b', 1), ('c', 3)]] """ - def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): + def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): """Initialization method. Args: @@ -520,7 +521,7 @@ class VariableMinSumConstraint(Constraint): [[('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)]] """ # noqa: E501 - def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): + def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): """Initialization method. Args: @@ -690,7 +691,7 @@ class VariableMaxSumConstraint(Constraint): [[('a', 1), ('b', 1), ('c', 3)], [('a', 1), ('b', 1), ('c', 4)], [('a', 1), ('b', 3), ('c', 4)], [('a', 3), ('b', 1), ('c', 4)]] """ # noqa: E501 - def __init__(self, target_var: str, sum_vars: Sequence, multipliers: Optional[Sequence] = None): + def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): """Initialization method. Args: @@ -824,7 +825,110 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar return False return True +class VariableExactProdConstraint(Constraint): + """Constraint enforcing that the product of variables equals the value of another variable. + Example: + >>> problem = Problem() + >>> problem.addVariables(["a", "b", "c"], [1, 2]) + >>> 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]): + """Instantiate a VariableExactProdConstraint. + + Args: + target_var (Variable): The target variable to match. + product_vars (sequence of Variables): The variables to calculate the product of. + """ + self.target_var = target_var + 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: + if var == exclude_var: + continue + dom = domain_dict[var] + bounds.append((min(dom), max(dom))) + + 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 + 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) + + def _safe_product(self, values): + prod = 1 + for v in values: + prod *= v + return prod + + def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 + Constraint.preProcess(self, variables, domains, constraints, vconstraints) + + 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) + 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: + 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 + + target_value = assignments[self.target_var] + assigned_product = 1 + unassigned_vars = [] + + for var in self.product_vars: + if var in assignments: + assigned_product *= assignments[var] + else: + unassigned_vars.append(var) + + if isinstance(assigned_product, float): + assigned_product = round(assigned_product, 10) + + if not unassigned_vars: + return assigned_product == target_value + + # 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])] + 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: + 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 + + return True class MaxProdConstraint(Constraint): diff --git a/constraint/parser.c b/constraint/parser.c index 0b4333b..8b1c5fd 100644 --- a/constraint/parser.c +++ b/constraint/parser.c @@ -1510,7 +1510,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constrai struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr; -/* "constraint/parser.py":27 +/* "constraint/parser.py":28 * ) * * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< @@ -1525,12 +1525,12 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions { }; -/* "constraint/parser.py":75 +/* "constraint/parser.py":76 * return split_restrictions * * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, MaxProdConstraint]]: # noqa: E501 + * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint]]: # noqa: E501 */ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint { PyObject_HEAD @@ -1544,7 +1544,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint }; -/* "constraint/parser.py":80 +/* "constraint/parser.py":81 * """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): # <<<<<<<<<<<<<< @@ -1566,7 +1566,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr { }; -/* "constraint/parser.py":91 +/* "constraint/parser.py":92 * * # split the string on the comparison and remove leading and trailing whitespace * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< @@ -1583,7 +1583,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr { }; -/* "constraint/parser.py":95 +/* "constraint/parser.py":96 * # if we have an inverse operation, rewrite to the other side * supported_operators = ["**", "*", "+", "-", "/"] * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) # <<<<<<<<<<<<<< @@ -1598,7 +1598,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr { }; -/* "constraint/parser.py":96 +/* "constraint/parser.py":97 * supported_operators = ["**", "*", "+", "-", "/"] * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) * unique_operators_right = set(s.strip() for s in list(right) if s in supported_operators) # <<<<<<<<<<<<<< @@ -1613,7 +1613,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr { }; -/* "constraint/parser.py":134 +/* "constraint/parser.py":135 * * # we have a potentially rewritten restriction, split again * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< @@ -1630,7 +1630,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr { }; -/* "constraint/parser.py":155 +/* "constraint/parser.py":156 * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] * # find all unique variable_supported_operators in the restriction, can have at most one * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) # <<<<<<<<<<<<<< @@ -1645,7 +1645,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr { }; -/* "constraint/parser.py":157 +/* "constraint/parser.py":158 * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 # <<<<<<<<<<<<<< @@ -1660,7 +1660,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr { }; -/* "constraint/parser.py":215 +/* "constraint/parser.py":219 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< @@ -1675,7 +1675,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr { }; -/* "constraint/parser.py":222 +/* "constraint/parser.py":226 * 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): # <<<<<<<<<<<<<< @@ -1690,7 +1690,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr { }; -/* "constraint/parser.py":245 +/* "constraint/parser.py":249 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< @@ -1704,7 +1704,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constrai }; -/* "constraint/parser.py":264 +/* "constraint/parser.py":268 * 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): # <<<<<<<<<<<<<< @@ -1719,7 +1719,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr { }; -/* "constraint/parser.py":274 +/* "constraint/parser.py":278 * * # remove functionally duplicate restrictions (preserves order and whitespace) * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< @@ -2986,17 +2986,18 @@ 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_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_swapped_side_first_variable[] = "swapped_side_first_variable"; static const char __pyx_k_CompilableFunctionConstraint[] = "CompilableFunctionConstraint"; 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#\2408\2501\330\010$\240H\250A\340\010\013\2103\210a\320\017&\240b\250\002\250$\250c\260\021\3202J\310\"\310A\340\014\023\2201\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*\250\"\250G\2601\3204J\310(\320Ri\320ij\330\014\017\320\017+\2503\250a\340\020\027\220q\340\020.\320.I\310\026\310q\320PQ\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(E\300\\\320QX\320XY\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(E\300\\\320QX\320XY\360\006\000\r\023\220(\230%\230x\240q\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\250A\330\014\030\230\001\230\021\230&\240\003\2404\240u\250D\260\001\260\025\260b\270\007\270s\300\"\300G\3101\340\014\"\240(\250!\340\014\017\210s\220!\320\023%\240S\250\002\320*<\320R\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_Ya_1_Q2_U_V_U_6_Q_q_t4uA_d_4y_a[] = "\320\000%\320%=\270Y\300a\360\006\000\005\034\2301\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\360V\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."; @@ -3124,7 +3125,7 @@ typedef struct { PyObject *__pyx_slice[4]; PyObject *__pyx_tuple[4]; PyObject *__pyx_codeobj_tab[20]; - PyObject *__pyx_string_tab[194]; + PyObject *__pyx_string_tab[195]; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_neg_1; @@ -3267,175 +3268,176 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_VariableExactSumConstraint __pyx_string_tab[25] -#define __pyx_n_u_VariableMaxSumConstraint __pyx_string_tab[26] -#define __pyx_n_u_VariableMinSumConstraint __pyx_string_tab[27] -#define __pyx_kp_u__10 __pyx_string_tab[28] -#define __pyx_kp_u__11 __pyx_string_tab[29] -#define __pyx_kp_u__12 __pyx_string_tab[30] -#define __pyx_kp_u__13 __pyx_string_tab[31] -#define __pyx_kp_u__14 __pyx_string_tab[32] -#define __pyx_kp_u__15 __pyx_string_tab[33] -#define __pyx_kp_u__16 __pyx_string_tab[34] -#define __pyx_kp_u__17 __pyx_string_tab[35] -#define __pyx_kp_u__18 __pyx_string_tab[36] -#define __pyx_kp_u__19 __pyx_string_tab[37] -#define __pyx_kp_u__2 __pyx_string_tab[38] -#define __pyx_kp_u__20 __pyx_string_tab[39] -#define __pyx_kp_u__21 __pyx_string_tab[40] -#define __pyx_kp_u__22 __pyx_string_tab[41] -#define __pyx_kp_u__23 __pyx_string_tab[42] -#define __pyx_kp_u__24 __pyx_string_tab[43] -#define __pyx_kp_u__3 __pyx_string_tab[44] -#define __pyx_kp_u__4 __pyx_string_tab[45] -#define __pyx_kp_u__5 __pyx_string_tab[46] -#define __pyx_kp_u__6 __pyx_string_tab[47] -#define __pyx_kp_u__7 __pyx_string_tab[48] -#define __pyx_kp_u__8 __pyx_string_tab[49] -#define __pyx_kp_u__9 __pyx_string_tab[50] -#define __pyx_kp_u_a_zA_Z__a_zA_Z__0_9 __pyx_string_tab[51] -#define __pyx_kp_u_add_note __pyx_string_tab[52] -#define __pyx_kp_u_and __pyx_string_tab[53] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[54] -#define __pyx_n_u_class_getitem __pyx_string_tab[55] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[56] -#define __pyx_n_u_close __pyx_string_tab[57] -#define __pyx_n_u_co_consts __pyx_string_tab[58] -#define __pyx_n_u_code_object __pyx_string_tab[59] -#define __pyx_n_u_comparator __pyx_string_tab[60] -#define __pyx_n_u_comparators __pyx_string_tab[61] -#define __pyx_n_u_comparators_found __pyx_string_tab[62] -#define __pyx_n_u_comparators_indices __pyx_string_tab[63] -#define __pyx_n_u_compile __pyx_string_tab[64] -#define __pyx_n_u_compile_to_constraints __pyx_string_tab[65] -#define __pyx_n_u_compiled_constraints __pyx_string_tab[66] -#define __pyx_n_u_constraint __pyx_string_tab[67] -#define __pyx_n_u_constraint_constraints __pyx_string_tab[68] -#define __pyx_n_u_constraint_parser __pyx_string_tab[69] -#define __pyx_kp_u_constraint_parser_py __pyx_string_tab[70] -#define __pyx_n_u_constraints __pyx_string_tab[71] -#define __pyx_kp_u_def_r __pyx_string_tab[72] -#define __pyx_n_u_dict __pyx_string_tab[73] -#define __pyx_kp_u_disable __pyx_string_tab[74] -#define __pyx_n_u_domains __pyx_string_tab[75] -#define __pyx_kp_u_enable __pyx_string_tab[76] -#define __pyx_n_u_end __pyx_string_tab[77] -#define __pyx_n_u_equalities_found __pyx_string_tab[78] -#define __pyx_n_u_eval __pyx_string_tab[79] -#define __pyx_n_u_exec __pyx_string_tab[80] -#define __pyx_n_u_finalized_constraint __pyx_string_tab[81] -#define __pyx_n_u_findall __pyx_string_tab[82] -#define __pyx_n_u_finditer __pyx_string_tab[83] -#define __pyx_n_u_fromkeys __pyx_string_tab[84] -#define __pyx_n_u_func __pyx_string_tab[85] -#define __pyx_n_u_func_2 __pyx_string_tab[86] -#define __pyx_kp_u_gc __pyx_string_tab[87] -#define __pyx_n_u_genexpr __pyx_string_tab[88] -#define __pyx_n_u_group __pyx_string_tab[89] -#define __pyx_n_u_i __pyx_string_tab[90] -#define __pyx_n_u_index __pyx_string_tab[91] -#define __pyx_n_u_inequalities_found __pyx_string_tab[92] -#define __pyx_n_u_initializing __pyx_string_tab[93] -#define __pyx_n_u_is_coroutine __pyx_string_tab[94] -#define __pyx_kp_u_is_neither_a_string_or_Constrai __pyx_string_tab[95] -#define __pyx_n_u_is_or_evals_to_number __pyx_string_tab[96] -#define __pyx_kp_u_isenabled __pyx_string_tab[97] -#define __pyx_n_u_key __pyx_string_tab[98] -#define __pyx_n_u_left __pyx_string_tab[99] -#define __pyx_n_u_left_num __pyx_string_tab[100] -#define __pyx_n_u_left_remainder __pyx_string_tab[101] -#define __pyx_n_u_left_swap __pyx_string_tab[102] -#define __pyx_kp_u_list_str __pyx_string_tab[103] -#define __pyx_kp_u_list_tuple_Constraint_list_str_U __pyx_string_tab[104] -#define __pyx_kp_u_list_tuple_Union_Constraint_str __pyx_string_tab[105] -#define __pyx_n_u_m __pyx_string_tab[106] -#define __pyx_n_u_main __pyx_string_tab[107] -#define __pyx_n_u_match_object __pyx_string_tab[108] -#define __pyx_n_u_module __pyx_string_tab[109] -#define __pyx_n_u_name __pyx_string_tab[110] -#define __pyx_n_u_next __pyx_string_tab[111] -#define __pyx_n_u_next_stop __pyx_string_tab[112] -#define __pyx_n_u_number __pyx_string_tab[113] -#define __pyx_n_u_number_is_int __pyx_string_tab[114] -#define __pyx_n_u_o __pyx_string_tab[115] -#define __pyx_n_u_operator __pyx_string_tab[116] -#define __pyx_n_u_operators __pyx_string_tab[117] -#define __pyx_n_u_operators_found __pyx_string_tab[118] -#define __pyx_kp_u_or __pyx_string_tab[119] -#define __pyx_n_u_p __pyx_string_tab[120] -#define __pyx_n_u_param __pyx_string_tab[121] -#define __pyx_n_u_params __pyx_string_tab[122] -#define __pyx_kp_u_params_params_index __pyx_string_tab[123] -#define __pyx_n_u_params_used __pyx_string_tab[124] -#define __pyx_n_u_params_used_list __pyx_string_tab[125] -#define __pyx_n_u_parse_restrictions __pyx_string_tab[126] -#define __pyx_n_u_parse_restrictions_locals_genexp __pyx_string_tab[127] -#define __pyx_n_u_parse_restrictions_locals_replac __pyx_string_tab[128] -#define __pyx_n_u_parse_restrictions_locals_replac_2 __pyx_string_tab[129] -#define __pyx_n_u_parse_restrictions_locals_to_equ __pyx_string_tab[130] -#define __pyx_n_u_parse_restrictions_locals_to_equ_2 __pyx_string_tab[131] -#define __pyx_n_u_parse_restrictions_locals_to_mul __pyx_string_tab[132] -#define __pyx_n_u_parse_restrictions_locals_to_num __pyx_string_tab[133] -#define __pyx_n_u_parse_restrictions_locals_to_num_2 __pyx_string_tab[134] -#define __pyx_n_u_parse_restrictions_locals_to_num_3 __pyx_string_tab[135] -#define __pyx_n_u_parse_restrictions_locals_to_num_4 __pyx_string_tab[136] -#define __pyx_n_u_parsed_restriction __pyx_string_tab[137] -#define __pyx_n_u_parsed_restrictions __pyx_string_tab[138] -#define __pyx_n_u_picklable __pyx_string_tab[139] -#define __pyx_n_u_pop __pyx_string_tab[140] -#define __pyx_n_u_prev_stop __pyx_string_tab[141] -#define __pyx_n_u_qualname __pyx_string_tab[142] -#define __pyx_n_u_r __pyx_string_tab[143] -#define __pyx_n_u_range __pyx_string_tab[144] -#define __pyx_n_u_re __pyx_string_tab[145] -#define __pyx_n_u_regex_match_variable __pyx_string_tab[146] -#define __pyx_n_u_replace __pyx_string_tab[147] -#define __pyx_n_u_replace_params __pyx_string_tab[148] -#define __pyx_n_u_replace_params_split __pyx_string_tab[149] -#define __pyx_n_u_res __pyx_string_tab[150] -#define __pyx_n_u_restriction __pyx_string_tab[151] -#define __pyx_n_u_restrictions __pyx_string_tab[152] -#define __pyx_n_u_restrictions_cleaned __pyx_string_tab[153] -#define __pyx_n_u_restrictions_cleaned_unique __pyx_string_tab[154] -#define __pyx_n_u_restrictions_unique_indices __pyx_string_tab[155] -#define __pyx_n_u_return __pyx_string_tab[156] -#define __pyx_kp_u_return_2 __pyx_string_tab[157] -#define __pyx_n_u_right __pyx_string_tab[158] -#define __pyx_n_u_right_num __pyx_string_tab[159] -#define __pyx_n_u_right_remainder __pyx_string_tab[160] -#define __pyx_n_u_right_swap __pyx_string_tab[161] -#define __pyx_n_u_s __pyx_string_tab[162] -#define __pyx_n_u_search __pyx_string_tab[163] -#define __pyx_n_u_send __pyx_string_tab[164] -#define __pyx_n_u_spec __pyx_string_tab[165] -#define __pyx_n_u_split __pyx_string_tab[166] -#define __pyx_n_u_split_restrictions __pyx_string_tab[167] -#define __pyx_n_u_splitted __pyx_string_tab[168] -#define __pyx_n_u_start __pyx_string_tab[169] -#define __pyx_n_u_str __pyx_string_tab[170] -#define __pyx_kp_u_string __pyx_string_tab[171] -#define __pyx_n_u_strip __pyx_string_tab[172] -#define __pyx_n_u_sub __pyx_string_tab[173] -#define __pyx_n_u_supported_operators __pyx_string_tab[174] -#define __pyx_n_u_swapped_side_first_variable __pyx_string_tab[175] -#define __pyx_n_u_temp_copy __pyx_string_tab[176] -#define __pyx_n_u_test __pyx_string_tab[177] -#define __pyx_n_u_throw __pyx_string_tab[178] -#define __pyx_n_u_to_equality_constraint __pyx_string_tab[179] -#define __pyx_n_u_to_multiple_restrictions __pyx_string_tab[180] -#define __pyx_n_u_to_numeric_constraint __pyx_string_tab[181] -#define __pyx_n_u_tune_params __pyx_string_tab[182] -#define __pyx_n_u_types __pyx_string_tab[183] -#define __pyx_n_u_typing __pyx_string_tab[184] -#define __pyx_n_u_union __pyx_string_tab[185] -#define __pyx_n_u_unique_operators __pyx_string_tab[186] -#define __pyx_n_u_unique_operators_left __pyx_string_tab[187] -#define __pyx_n_u_unique_operators_right __pyx_string_tab[188] -#define __pyx_n_u_v __pyx_string_tab[189] -#define __pyx_n_u_value __pyx_string_tab[190] -#define __pyx_n_u_variable_supported_operators __pyx_string_tab[191] -#define __pyx_n_u_variables __pyx_string_tab[192] -#define __pyx_n_u_variables_on_left __pyx_string_tab[193] +#define __pyx_n_u_VariableExactProdConstraint __pyx_string_tab[25] +#define __pyx_n_u_VariableExactSumConstraint __pyx_string_tab[26] +#define __pyx_n_u_VariableMaxSumConstraint __pyx_string_tab[27] +#define __pyx_n_u_VariableMinSumConstraint __pyx_string_tab[28] +#define __pyx_kp_u__10 __pyx_string_tab[29] +#define __pyx_kp_u__11 __pyx_string_tab[30] +#define __pyx_kp_u__12 __pyx_string_tab[31] +#define __pyx_kp_u__13 __pyx_string_tab[32] +#define __pyx_kp_u__14 __pyx_string_tab[33] +#define __pyx_kp_u__15 __pyx_string_tab[34] +#define __pyx_kp_u__16 __pyx_string_tab[35] +#define __pyx_kp_u__17 __pyx_string_tab[36] +#define __pyx_kp_u__18 __pyx_string_tab[37] +#define __pyx_kp_u__19 __pyx_string_tab[38] +#define __pyx_kp_u__2 __pyx_string_tab[39] +#define __pyx_kp_u__20 __pyx_string_tab[40] +#define __pyx_kp_u__21 __pyx_string_tab[41] +#define __pyx_kp_u__22 __pyx_string_tab[42] +#define __pyx_kp_u__23 __pyx_string_tab[43] +#define __pyx_kp_u__24 __pyx_string_tab[44] +#define __pyx_kp_u__3 __pyx_string_tab[45] +#define __pyx_kp_u__4 __pyx_string_tab[46] +#define __pyx_kp_u__5 __pyx_string_tab[47] +#define __pyx_kp_u__6 __pyx_string_tab[48] +#define __pyx_kp_u__7 __pyx_string_tab[49] +#define __pyx_kp_u__8 __pyx_string_tab[50] +#define __pyx_kp_u__9 __pyx_string_tab[51] +#define __pyx_kp_u_a_zA_Z__a_zA_Z__0_9 __pyx_string_tab[52] +#define __pyx_kp_u_add_note __pyx_string_tab[53] +#define __pyx_kp_u_and __pyx_string_tab[54] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[55] +#define __pyx_n_u_class_getitem __pyx_string_tab[56] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[57] +#define __pyx_n_u_close __pyx_string_tab[58] +#define __pyx_n_u_co_consts __pyx_string_tab[59] +#define __pyx_n_u_code_object __pyx_string_tab[60] +#define __pyx_n_u_comparator __pyx_string_tab[61] +#define __pyx_n_u_comparators __pyx_string_tab[62] +#define __pyx_n_u_comparators_found __pyx_string_tab[63] +#define __pyx_n_u_comparators_indices __pyx_string_tab[64] +#define __pyx_n_u_compile __pyx_string_tab[65] +#define __pyx_n_u_compile_to_constraints __pyx_string_tab[66] +#define __pyx_n_u_compiled_constraints __pyx_string_tab[67] +#define __pyx_n_u_constraint __pyx_string_tab[68] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[69] +#define __pyx_n_u_constraint_parser __pyx_string_tab[70] +#define __pyx_kp_u_constraint_parser_py __pyx_string_tab[71] +#define __pyx_n_u_constraints __pyx_string_tab[72] +#define __pyx_kp_u_def_r __pyx_string_tab[73] +#define __pyx_n_u_dict __pyx_string_tab[74] +#define __pyx_kp_u_disable __pyx_string_tab[75] +#define __pyx_n_u_domains __pyx_string_tab[76] +#define __pyx_kp_u_enable __pyx_string_tab[77] +#define __pyx_n_u_end __pyx_string_tab[78] +#define __pyx_n_u_equalities_found __pyx_string_tab[79] +#define __pyx_n_u_eval __pyx_string_tab[80] +#define __pyx_n_u_exec __pyx_string_tab[81] +#define __pyx_n_u_finalized_constraint __pyx_string_tab[82] +#define __pyx_n_u_findall __pyx_string_tab[83] +#define __pyx_n_u_finditer __pyx_string_tab[84] +#define __pyx_n_u_fromkeys __pyx_string_tab[85] +#define __pyx_n_u_func __pyx_string_tab[86] +#define __pyx_n_u_func_2 __pyx_string_tab[87] +#define __pyx_kp_u_gc __pyx_string_tab[88] +#define __pyx_n_u_genexpr __pyx_string_tab[89] +#define __pyx_n_u_group __pyx_string_tab[90] +#define __pyx_n_u_i __pyx_string_tab[91] +#define __pyx_n_u_index __pyx_string_tab[92] +#define __pyx_n_u_inequalities_found __pyx_string_tab[93] +#define __pyx_n_u_initializing __pyx_string_tab[94] +#define __pyx_n_u_is_coroutine __pyx_string_tab[95] +#define __pyx_kp_u_is_neither_a_string_or_Constrai __pyx_string_tab[96] +#define __pyx_n_u_is_or_evals_to_number __pyx_string_tab[97] +#define __pyx_kp_u_isenabled __pyx_string_tab[98] +#define __pyx_n_u_key __pyx_string_tab[99] +#define __pyx_n_u_left __pyx_string_tab[100] +#define __pyx_n_u_left_num __pyx_string_tab[101] +#define __pyx_n_u_left_remainder __pyx_string_tab[102] +#define __pyx_n_u_left_swap __pyx_string_tab[103] +#define __pyx_kp_u_list_str __pyx_string_tab[104] +#define __pyx_kp_u_list_tuple_Constraint_list_str_U __pyx_string_tab[105] +#define __pyx_kp_u_list_tuple_Union_Constraint_str __pyx_string_tab[106] +#define __pyx_n_u_m __pyx_string_tab[107] +#define __pyx_n_u_main __pyx_string_tab[108] +#define __pyx_n_u_match_object __pyx_string_tab[109] +#define __pyx_n_u_module __pyx_string_tab[110] +#define __pyx_n_u_name __pyx_string_tab[111] +#define __pyx_n_u_next __pyx_string_tab[112] +#define __pyx_n_u_next_stop __pyx_string_tab[113] +#define __pyx_n_u_number __pyx_string_tab[114] +#define __pyx_n_u_number_is_int __pyx_string_tab[115] +#define __pyx_n_u_o __pyx_string_tab[116] +#define __pyx_n_u_operator __pyx_string_tab[117] +#define __pyx_n_u_operators __pyx_string_tab[118] +#define __pyx_n_u_operators_found __pyx_string_tab[119] +#define __pyx_kp_u_or __pyx_string_tab[120] +#define __pyx_n_u_p __pyx_string_tab[121] +#define __pyx_n_u_param __pyx_string_tab[122] +#define __pyx_n_u_params __pyx_string_tab[123] +#define __pyx_kp_u_params_params_index __pyx_string_tab[124] +#define __pyx_n_u_params_used __pyx_string_tab[125] +#define __pyx_n_u_params_used_list __pyx_string_tab[126] +#define __pyx_n_u_parse_restrictions __pyx_string_tab[127] +#define __pyx_n_u_parse_restrictions_locals_genexp __pyx_string_tab[128] +#define __pyx_n_u_parse_restrictions_locals_replac __pyx_string_tab[129] +#define __pyx_n_u_parse_restrictions_locals_replac_2 __pyx_string_tab[130] +#define __pyx_n_u_parse_restrictions_locals_to_equ __pyx_string_tab[131] +#define __pyx_n_u_parse_restrictions_locals_to_equ_2 __pyx_string_tab[132] +#define __pyx_n_u_parse_restrictions_locals_to_mul __pyx_string_tab[133] +#define __pyx_n_u_parse_restrictions_locals_to_num __pyx_string_tab[134] +#define __pyx_n_u_parse_restrictions_locals_to_num_2 __pyx_string_tab[135] +#define __pyx_n_u_parse_restrictions_locals_to_num_3 __pyx_string_tab[136] +#define __pyx_n_u_parse_restrictions_locals_to_num_4 __pyx_string_tab[137] +#define __pyx_n_u_parsed_restriction __pyx_string_tab[138] +#define __pyx_n_u_parsed_restrictions __pyx_string_tab[139] +#define __pyx_n_u_picklable __pyx_string_tab[140] +#define __pyx_n_u_pop __pyx_string_tab[141] +#define __pyx_n_u_prev_stop __pyx_string_tab[142] +#define __pyx_n_u_qualname __pyx_string_tab[143] +#define __pyx_n_u_r __pyx_string_tab[144] +#define __pyx_n_u_range __pyx_string_tab[145] +#define __pyx_n_u_re __pyx_string_tab[146] +#define __pyx_n_u_regex_match_variable __pyx_string_tab[147] +#define __pyx_n_u_replace __pyx_string_tab[148] +#define __pyx_n_u_replace_params __pyx_string_tab[149] +#define __pyx_n_u_replace_params_split __pyx_string_tab[150] +#define __pyx_n_u_res __pyx_string_tab[151] +#define __pyx_n_u_restriction __pyx_string_tab[152] +#define __pyx_n_u_restrictions __pyx_string_tab[153] +#define __pyx_n_u_restrictions_cleaned __pyx_string_tab[154] +#define __pyx_n_u_restrictions_cleaned_unique __pyx_string_tab[155] +#define __pyx_n_u_restrictions_unique_indices __pyx_string_tab[156] +#define __pyx_n_u_return __pyx_string_tab[157] +#define __pyx_kp_u_return_2 __pyx_string_tab[158] +#define __pyx_n_u_right __pyx_string_tab[159] +#define __pyx_n_u_right_num __pyx_string_tab[160] +#define __pyx_n_u_right_remainder __pyx_string_tab[161] +#define __pyx_n_u_right_swap __pyx_string_tab[162] +#define __pyx_n_u_s __pyx_string_tab[163] +#define __pyx_n_u_search __pyx_string_tab[164] +#define __pyx_n_u_send __pyx_string_tab[165] +#define __pyx_n_u_spec __pyx_string_tab[166] +#define __pyx_n_u_split __pyx_string_tab[167] +#define __pyx_n_u_split_restrictions __pyx_string_tab[168] +#define __pyx_n_u_splitted __pyx_string_tab[169] +#define __pyx_n_u_start __pyx_string_tab[170] +#define __pyx_n_u_str __pyx_string_tab[171] +#define __pyx_kp_u_string __pyx_string_tab[172] +#define __pyx_n_u_strip __pyx_string_tab[173] +#define __pyx_n_u_sub __pyx_string_tab[174] +#define __pyx_n_u_supported_operators __pyx_string_tab[175] +#define __pyx_n_u_swapped_side_first_variable __pyx_string_tab[176] +#define __pyx_n_u_temp_copy __pyx_string_tab[177] +#define __pyx_n_u_test __pyx_string_tab[178] +#define __pyx_n_u_throw __pyx_string_tab[179] +#define __pyx_n_u_to_equality_constraint __pyx_string_tab[180] +#define __pyx_n_u_to_multiple_restrictions __pyx_string_tab[181] +#define __pyx_n_u_to_numeric_constraint __pyx_string_tab[182] +#define __pyx_n_u_tune_params __pyx_string_tab[183] +#define __pyx_n_u_types __pyx_string_tab[184] +#define __pyx_n_u_typing __pyx_string_tab[185] +#define __pyx_n_u_union __pyx_string_tab[186] +#define __pyx_n_u_unique_operators __pyx_string_tab[187] +#define __pyx_n_u_unique_operators_left __pyx_string_tab[188] +#define __pyx_n_u_unique_operators_right __pyx_string_tab[189] +#define __pyx_n_u_v __pyx_string_tab[190] +#define __pyx_n_u_value __pyx_string_tab[191] +#define __pyx_n_u_variable_supported_operators __pyx_string_tab[192] +#define __pyx_n_u_variables __pyx_string_tab[193] +#define __pyx_n_u_variables_on_left __pyx_string_tab[194] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3489,7 +3491,7 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { 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<20; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<194; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<195; ++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); @@ -3546,7 +3548,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void 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<20; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<194; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<195; ++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); @@ -3555,7 +3557,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void #endif /* #### Code section: module_code ### */ -/* "constraint/parser.py":27 +/* "constraint/parser.py":28 * ) * * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< @@ -3604,39 +3606,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, 27, __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 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 27, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 28, __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, 27, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 28, __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, 27, __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, 28, __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, 27, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("parse_restrictions", 1, 2, 2, i); __PYX_ERR(0, 28, __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, 27, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 28, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 27, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 28, __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, 27, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("parse_restrictions", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 28, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3647,8 +3649,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, 27, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tune_params), (&PyDict_Type), 0, "tune_params", 2))) __PYX_ERR(0, 27, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restrictions), (&PyList_Type), 0, "restrictions", 2))) __PYX_ERR(0, 28, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tune_params), (&PyDict_Type), 0, "tune_params", 2))) __PYX_ERR(0, 28, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_parse_restrictions(__pyx_self, __pyx_v_restrictions, __pyx_v_tune_params); /* function exit code */ @@ -3668,7 +3670,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "constraint/parser.py":32 +/* "constraint/parser.py":33 * regex_match_variable = r"([a-zA-Z_$][a-zA-Z_$0-9]*)" * * def replace_params(match_object): # <<<<<<<<<<<<<< @@ -3715,32 +3717,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, 32, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 33, __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, 32, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 33, __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, 32, __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, 33, __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, 32, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("replace_params", 1, 1, 1, i); __PYX_ERR(0, 33, __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, 32, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 33, __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, 32, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("replace_params", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 33, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3779,7 +3781,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":33 + /* "constraint/parser.py":34 * * def replace_params(match_object): * key = match_object.group(1) # <<<<<<<<<<<<<< @@ -3793,40 +3795,40 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para 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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_key = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":34 + /* "constraint/parser.py":35 * 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, 34, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 35, __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, 34, __pyx_L1_error) + __PYX_ERR(0, 35, __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, 34, __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, 35, __pyx_L1_error) if (__pyx_t_4) { - /* "constraint/parser.py":35 + /* "constraint/parser.py":36 * 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, 35, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_param = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":36 + /* "constraint/parser.py":37 * if key in tune_params: * param = str(key) * return "params[params_index['" + param + "']]" # <<<<<<<<<<<<<< @@ -3834,16 +3836,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, 36, __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, 37, __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, 36, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __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":34 + /* "constraint/parser.py":35 * def replace_params(match_object): * key = match_object.group(1) * if key in tune_params: # <<<<<<<<<<<<<< @@ -3852,7 +3854,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para */ } - /* "constraint/parser.py":38 + /* "constraint/parser.py":39 * return "params[params_index['" + param + "']]" * else: * return key # <<<<<<<<<<<<<< @@ -3866,7 +3868,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para goto __pyx_L0; } - /* "constraint/parser.py":32 + /* "constraint/parser.py":33 * regex_match_variable = r"([a-zA-Z_$][a-zA-Z_$0-9]*)" * * def replace_params(match_object): # <<<<<<<<<<<<<< @@ -3888,7 +3890,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para return __pyx_r; } -/* "constraint/parser.py":40 +/* "constraint/parser.py":41 * return key * * def replace_params_split(match_object): # <<<<<<<<<<<<<< @@ -3935,32 +3937,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, 40, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 41, __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, 40, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 41, __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, 40, __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, 41, __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, 40, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("replace_params_split", 1, 1, 1, i); __PYX_ERR(0, 41, __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, 40, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 41, __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, 40, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("replace_params_split", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 41, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4000,7 +4002,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":42 + /* "constraint/parser.py":43 * def replace_params_split(match_object): * # careful: has side-effect of adding to set `params_used` * key = match_object.group(1) # <<<<<<<<<<<<<< @@ -4014,54 +4016,54 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par 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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_key = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":43 + /* "constraint/parser.py":44 * # 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, 43, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 44, __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, 43, __pyx_L1_error) + __PYX_ERR(0, 44, __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, 43, __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, 44, __pyx_L1_error) if (__pyx_t_4) { - /* "constraint/parser.py":44 + /* "constraint/parser.py":45 * 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, 44, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_param = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":45 + /* "constraint/parser.py":46 * 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, 45, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_v_params_used)) { __Pyx_RaiseClosureNameError("params_used"); __PYX_ERR(0, 46, __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, 45, __pyx_L1_error) + __PYX_ERR(0, 46, __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, 45, __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, 46, __pyx_L1_error) - /* "constraint/parser.py":46 + /* "constraint/parser.py":47 * param = str(key) * params_used.add(param) * return param # <<<<<<<<<<<<<< @@ -4073,7 +4075,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par __pyx_r = __pyx_v_param; goto __pyx_L0; - /* "constraint/parser.py":43 + /* "constraint/parser.py":44 * # careful: has side-effect of adding to set `params_used` * key = match_object.group(1) * if key in tune_params: # <<<<<<<<<<<<<< @@ -4082,7 +4084,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par */ } - /* "constraint/parser.py":48 + /* "constraint/parser.py":49 * return param * else: * return key # <<<<<<<<<<<<<< @@ -4096,7 +4098,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par goto __pyx_L0; } - /* "constraint/parser.py":40 + /* "constraint/parser.py":41 * return key * * def replace_params_split(match_object): # <<<<<<<<<<<<<< @@ -4118,7 +4120,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par return __pyx_r; } -/* "constraint/parser.py":50 +/* "constraint/parser.py":51 * return key * * def to_multiple_restrictions(restrictions: list[str]) -> list[str]: # <<<<<<<<<<<<<< @@ -4166,32 +4168,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, 50, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 51, __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, 50, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 51, __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, 50, __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, 51, __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, 50, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_multiple_restrictions", 1, 1, 1, i); __PYX_ERR(0, 51, __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, 50, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 51, __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, 50, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("to_multiple_restrictions", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 51, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4202,7 +4204,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, 50, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restrictions), (&PyList_Type), 0, "restrictions", 2))) __PYX_ERR(0, 51, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple_restrictions(__pyx_self, __pyx_v_restrictions); /* function exit code */ @@ -4253,19 +4255,19 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple int __pyx_clineno = 0; __Pyx_RefNannySetupContext("to_multiple_restrictions", 0); - /* "constraint/parser.py":52 + /* "constraint/parser.py":53 * 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, 52, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_split_restrictions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":53 + /* "constraint/parser.py":54 * """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: # <<<<<<<<<<<<<< @@ -4278,45 +4280,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, 53, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 54, __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, 53, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":55 + /* "constraint/parser.py":56 * 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, 55, __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, 56, __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, 55, __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, 56, __pyx_L1_error) __pyx_t_4 = __pyx_t_5; __pyx_L6_bool_binop_done:; if (__pyx_t_4) { - /* "constraint/parser.py":56 + /* "constraint/parser.py":57 * # 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, 56, __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, 57, __pyx_L1_error) - /* "constraint/parser.py":57 + /* "constraint/parser.py":58 * if " and " in res or " or " in res: * split_restrictions.append(res) * continue # <<<<<<<<<<<<<< @@ -4325,7 +4327,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple */ goto __pyx_L3_continue; - /* "constraint/parser.py":55 + /* "constraint/parser.py":56 * for res in restrictions: * # if there are logic chains in the restriction, skip splitting further * if " and " in res or " or " in res: # <<<<<<<<<<<<<< @@ -4334,31 +4336,31 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple */ } - /* "constraint/parser.py":59 + /* "constraint/parser.py":60 * 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, 59, __pyx_L1_error) + __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __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, 59, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_mstate_global->__pyx_kp_u__2) != (0)) __PYX_ERR(0, 60, __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, 59, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_kp_u__3) != (0)) __PYX_ERR(0, 60, __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, 59, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_mstate_global->__pyx_kp_u__4) != (0)) __PYX_ERR(0, 60, __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, 59, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_mstate_global->__pyx_kp_u__5) != (0)) __PYX_ERR(0, 60, __pyx_L1_error); __Pyx_XDECREF_SET(__pyx_v_comparators, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "constraint/parser.py":60 + /* "constraint/parser.py":61 * # find the indices of splittable comparators * comparators = ["<=", ">=", ">", "<"] * comparators_indices = [(m.start(0), m.end(0)) for m in re.finditer("|".join(comparators), res)] # <<<<<<<<<<<<<< @@ -4366,15 +4368,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, 60, __pyx_L10_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __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, 60, __pyx_L10_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 61, __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, 60, __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, 61, __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, 60, __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, 61, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS @@ -4394,7 +4396,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __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, 60, __pyx_L10_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); } if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { @@ -4402,9 +4404,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, 60, __pyx_L10_error) + __pyx_t_12 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 61, __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, 60, __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, 61, __pyx_L10_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { @@ -4413,7 +4415,7 @@ 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, 60, __pyx_L10_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 61, __pyx_L10_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -4423,7 +4425,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple { 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, 60, __pyx_L10_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 61, __pyx_L10_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -4434,13 +4436,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __pyx_L10_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __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, 60, __pyx_L10_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 61, __pyx_L10_error) PyErr_Clear(); } break; @@ -4456,7 +4458,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple 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_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __pyx_L10_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_8 = __pyx_7genexpr__pyx_v_m; @@ -4466,18 +4468,18 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L10_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 61, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); } - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 60, __pyx_L10_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 61, __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, 60, __pyx_L10_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 61, __pyx_L10_error); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 60, __pyx_L10_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 61, __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, 60, __pyx_L10_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 61, __pyx_L10_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -4491,27 +4493,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":61 + /* "constraint/parser.py":62 * 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, 61, __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, 62, __pyx_L1_error) __pyx_t_4 = (__pyx_t_12 <= 1); if (__pyx_t_4) { - /* "constraint/parser.py":63 + /* "constraint/parser.py":64 * 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, 63, __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, 64, __pyx_L1_error) - /* "constraint/parser.py":64 + /* "constraint/parser.py":65 * # this can't be split further * split_restrictions.append(res) * continue # <<<<<<<<<<<<<< @@ -4520,7 +4522,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple */ goto __pyx_L3_continue; - /* "constraint/parser.py":61 + /* "constraint/parser.py":62 * comparators = ["<=", ">=", ">", "<"] * comparators_indices = [(m.start(0), m.end(0)) for m in re.finditer("|".join(comparators), res)] * if len(comparators_indices) <= 1: # <<<<<<<<<<<<<< @@ -4529,7 +4531,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple */ } - /* "constraint/parser.py":66 + /* "constraint/parser.py":67 * continue * # split the restrictions from the previous to the next comparator * for index in range(len(comparators_indices)): # <<<<<<<<<<<<<< @@ -4539,8 +4541,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __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, 66, __pyx_L1_error) - __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __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_9 = PyLong_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = 1; { @@ -4549,7 +4551,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __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, 66, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { @@ -4557,9 +4559,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_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 67, __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, 66, __pyx_L1_error) + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 67, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -4568,7 +4570,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple { 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, 66, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 67, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -4578,7 +4580,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple { 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, 66, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 67, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -4589,13 +4591,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __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, 66, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 67, __pyx_L1_error) PyErr_Clear(); } break; @@ -4605,7 +4607,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":67 + /* "constraint/parser.py":68 * # split the restrictions from the previous to the next comparator * for index in range(len(comparators_indices)): * temp_copy = res # <<<<<<<<<<<<<< @@ -4615,26 +4617,26 @@ 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":68 + /* "constraint/parser.py":69 * 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, 68, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 68, __pyx_L1_error) + __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, 69, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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, 68, __pyx_L1_error) + __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, 69, __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, 68, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_comparators_indices, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 69, __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); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_10, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 69, __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, 68, __pyx_L1_error) + __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, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_3 = __pyx_t_10; @@ -4646,34 +4648,34 @@ 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":70 + /* "constraint/parser.py":71 * 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, 70, __pyx_L1_error) - __pyx_t_10 = PyLong_FromSsize_t((__pyx_t_14 - 1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_GET_SIZE(__pyx_v_comparators_indices); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_10 = PyLong_FromSsize_t((__pyx_t_14 - 1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 71, __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, 70, __pyx_L1_error) + __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, 71, __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, 70, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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, 70, __pyx_L1_error) + __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, 71, __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, 70, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_comparators_indices, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 71, __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); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 71, __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_t_14 = PyObject_Length(__pyx_v_temp_copy); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 70, __pyx_L1_error) - __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_14 = PyObject_Length(__pyx_v_temp_copy); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = __pyx_t_9; __pyx_t_9 = 0; @@ -4681,14 +4683,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __Pyx_XDECREF_SET(__pyx_v_next_stop, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":72 + /* "constraint/parser.py":73 * 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, 72, __pyx_L1_error) + __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, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = __pyx_t_10; __Pyx_INCREF(__pyx_t_9); @@ -4698,13 +4700,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __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, 72, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __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, 72, __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, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":66 + /* "constraint/parser.py":67 * continue * # split the restrictions from the previous to the next comparator * for index in range(len(comparators_indices)): # <<<<<<<<<<<<<< @@ -4714,7 +4716,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/parser.py":53 + /* "constraint/parser.py":54 * """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: # <<<<<<<<<<<<<< @@ -4725,7 +4727,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":73 + /* "constraint/parser.py":74 * ) * split_restrictions.append(temp_copy[prev_stop:next_stop].strip()) * return split_restrictions # <<<<<<<<<<<<<< @@ -4737,7 +4739,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __pyx_r = __pyx_v_split_restrictions; goto __pyx_L0; - /* "constraint/parser.py":50 + /* "constraint/parser.py":51 * return key * * def to_multiple_restrictions(restrictions: list[str]) -> list[str]: # <<<<<<<<<<<<<< @@ -4770,12 +4772,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple return __pyx_r; } -/* "constraint/parser.py":75 +/* "constraint/parser.py":76 * return split_restrictions * * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, MaxProdConstraint]]: # noqa: E501 + * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint]]: # noqa: E501 */ /* Python wrapper */ @@ -4819,39 +4821,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, 75, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 76, __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, 75, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 76, __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, 75, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 76, __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, 75, __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, 76, __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, 75, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_numeric_constraint", 1, 2, 2, i); __PYX_ERR(0, 76, __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, 75, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 76, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 75, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 76, __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, 75, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("to_numeric_constraint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 76, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4862,8 +4864,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, 76, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 76, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restriction), (&PyUnicode_Type), 0, "restriction", 2))) __PYX_ERR(0, 77, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 77, __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 */ @@ -4883,7 +4885,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "constraint/parser.py":137 +/* "constraint/parser.py":138 * * # find out which side is the constant number * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< @@ -4930,32 +4932,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { 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, 137, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 138, __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, 137, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 138, __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, 137, __pyx_L3_error) + 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, 138, __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, 137, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("is_or_evals_to_number", 1, 1, 1, i); __PYX_ERR(0, 138, __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, 137, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 138, __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, 137, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("is_or_evals_to_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 138, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4966,7 +4968,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __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, 137, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_s), (&PyUnicode_Type), 0, "s", 2))) __PYX_ERR(0, 138, __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 */ @@ -5007,7 +5009,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_or_evals_to_number", 0); - /* "constraint/parser.py":138 + /* "constraint/parser.py":139 * # find out which side is the constant number * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: * try: # <<<<<<<<<<<<<< @@ -5023,7 +5025,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "constraint/parser.py":140 + /* "constraint/parser.py":141 * try: * # check if it's a number or solvable to a number (e.g. '32*2') * number = eval(s) # <<<<<<<<<<<<<< @@ -5033,15 +5035,15 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __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, 140, __pyx_L3_error) + __pyx_t_7 = __Pyx_Globals(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 141, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 140, __pyx_L3_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 141, __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, 140, __pyx_L3_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_number, __pyx_v_number) < 0) __PYX_ERR(0, 141, __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, 140, __pyx_L3_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_s, __pyx_v_s) < 0) __PYX_ERR(0, 141, __pyx_L3_error) } __pyx_t_9 = 1; { @@ -5051,13 +5053,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __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, 140, __pyx_L3_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_number = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/parser.py":141 + /* "constraint/parser.py":142 * # check if it's a number or solvable to a number (e.g. '32*2') * number = eval(s) * assert isinstance(number, (int, float)) # <<<<<<<<<<<<<< @@ -5077,14 +5079,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_L9_bool_binop_done:; if (unlikely(!__pyx_t_10)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 141, __pyx_L3_error) + __PYX_ERR(0, 142, __pyx_L3_error) } } #else - if ((1)); else __PYX_ERR(0, 141, __pyx_L3_error) + if ((1)); else __PYX_ERR(0, 142, __pyx_L3_error) #endif - /* "constraint/parser.py":142 + /* "constraint/parser.py":143 * number = eval(s) * assert isinstance(number, (int, float)) * return number # <<<<<<<<<<<<<< @@ -5096,7 +5098,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_r = __pyx_v_number; goto __pyx_L7_try_return; - /* "constraint/parser.py":138 + /* "constraint/parser.py":139 * # find out which side is the constant number * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: * try: # <<<<<<<<<<<<<< @@ -5111,7 +5113,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/parser.py":143 + /* "constraint/parser.py":144 * assert isinstance(number, (int, float)) * return number * except Exception: # <<<<<<<<<<<<<< @@ -5122,7 +5124,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric if (__pyx_t_12) { __Pyx_ErrRestore(0,0,0); - /* "constraint/parser.py":145 + /* "constraint/parser.py":146 * except Exception: * # it's not a solvable subexpression, return None * return None # <<<<<<<<<<<<<< @@ -5135,7 +5137,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric } goto __pyx_L5_except_error; - /* "constraint/parser.py":138 + /* "constraint/parser.py":139 * # find out which side is the constant number * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: * try: # <<<<<<<<<<<<<< @@ -5162,7 +5164,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric goto __pyx_L0; } - /* "constraint/parser.py":137 + /* "constraint/parser.py":138 * * # find out which side is the constant number * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< @@ -5188,7 +5190,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric 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":80 +/* "constraint/parser.py":81 * """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): # <<<<<<<<<<<<<< @@ -5208,7 +5210,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_3_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 80, __pyx_L1_error) + __PYX_ERR(0, 81, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5216,7 +5218,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_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, 80, __pyx_L1_error) + __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, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5254,16 +5256,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, 80, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 80, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 81, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 81, __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, 80, __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, 81, __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, 80, __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, 81, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -5271,7 +5273,7 @@ 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, 80, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 81, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5281,7 +5283,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 80, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 81, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5292,13 +5294,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __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, 80, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 81, __pyx_L1_error) PyErr_Clear(); } break; @@ -5369,7 +5371,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_2_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 80, __pyx_L1_error) + __PYX_ERR(0, 81, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5380,7 +5382,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, 80, __pyx_L1_error) + __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, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5419,40 +5421,40 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 80, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 80, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 81, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 81, __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, 80, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 81, __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, 80, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __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_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 80, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 81, __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 subscriptable"); - __PYX_ERR(0, 80, __pyx_L1_error) + __PYX_ERR(0, 81, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_tune_params, __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_tune_params, __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7genexpr_genexpr(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_4 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7genexpr_genexpr(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { @@ -5494,7 +5496,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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 */ -/* "constraint/parser.py":91 +/* "constraint/parser.py":92 * * # split the string on the comparison and remove leading and trailing whitespace * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< @@ -5514,7 +5516,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_4_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 91, __pyx_L1_error) + __PYX_ERR(0, 92, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5525,7 +5527,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, 91, __pyx_L1_error) + __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, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5565,11 +5567,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __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, 91, __pyx_L1_error) + __PYX_ERR(0, 92, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 91, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 91, __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, 91, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 92, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 92, __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, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -5578,13 +5580,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 91, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 92, __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, 91, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __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); @@ -5597,7 +5599,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_r = __pyx_t_1; @@ -5616,7 +5618,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_2); __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 91, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 92, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -5644,7 +5646,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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 */ -/* "constraint/parser.py":95 +/* "constraint/parser.py":96 * # if we have an inverse operation, rewrite to the other side * supported_operators = ["**", "*", "+", "-", "/"] * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) # <<<<<<<<<<<<<< @@ -5664,7 +5666,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_5_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 95, __pyx_L1_error) + __PYX_ERR(0, 96, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5675,7 +5677,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_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, 95, __pyx_L1_error) + __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, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5713,11 +5715,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 95, __pyx_L1_error) - __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 95, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 95, __pyx_L1_error) } - __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 96, __pyx_L1_error) } + __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -5726,20 +5728,20 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 95, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 96, __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, 95, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __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_supported_operators)) { __Pyx_RaiseClosureNameError("supported_operators"); __PYX_ERR(0, 95, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_s, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_supported_operators, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 95, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_supported_operators)) { __Pyx_RaiseClosureNameError("supported_operators"); __PYX_ERR(0, 96, __pyx_L1_error) } + __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_s, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_supported_operators, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 96, __pyx_L1_error) if (__pyx_t_4) { __pyx_t_5 = __pyx_cur_scope->__pyx_v_s; __Pyx_INCREF(__pyx_t_5); @@ -5748,10 +5750,10 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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, 95, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 95, __pyx_L1_error) + if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } } @@ -5781,7 +5783,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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 */ -/* "constraint/parser.py":96 +/* "constraint/parser.py":97 * supported_operators = ["**", "*", "+", "-", "/"] * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) * unique_operators_right = set(s.strip() for s in list(right) if s in supported_operators) # <<<<<<<<<<<<<< @@ -5801,7 +5803,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, 96, __pyx_L1_error) + __PYX_ERR(0, 97, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5812,7 +5814,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, 96, __pyx_L1_error) + __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, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5850,11 +5852,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 96, __pyx_L1_error) - __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 96, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 96, __pyx_L1_error) } - __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 97, __pyx_L1_error) } + __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -5863,20 +5865,20 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 96, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 97, __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, 96, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __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_supported_operators)) { __Pyx_RaiseClosureNameError("supported_operators"); __PYX_ERR(0, 96, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_s, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_supported_operators, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 96, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_supported_operators)) { __Pyx_RaiseClosureNameError("supported_operators"); __PYX_ERR(0, 97, __pyx_L1_error) } + __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_s, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_supported_operators, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 97, __pyx_L1_error) if (__pyx_t_4) { __pyx_t_5 = __pyx_cur_scope->__pyx_v_s; __Pyx_INCREF(__pyx_t_5); @@ -5885,10 +5887,10 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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, 96, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 96, __pyx_L1_error) + if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } } @@ -5918,7 +5920,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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 */ -/* "constraint/parser.py":134 +/* "constraint/parser.py":135 * * # we have a potentially rewritten restriction, split again * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< @@ -5938,7 +5940,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_7_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 134, __pyx_L1_error) + __PYX_ERR(0, 135, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5949,7 +5951,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_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, 134, __pyx_L1_error) + __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, 135, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5989,11 +5991,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __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, 134, __pyx_L1_error) + __PYX_ERR(0, 135, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 134, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 134, __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, 134, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 135, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 135, __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, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -6002,13 +6004,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 134, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 135, __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, 134, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __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); @@ -6021,7 +6023,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_r = __pyx_t_1; @@ -6040,7 +6042,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_2); __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 134, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 135, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -6068,7 +6070,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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 */ -/* "constraint/parser.py":155 +/* "constraint/parser.py":156 * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] * # find all unique variable_supported_operators in the restriction, can have at most one * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) # <<<<<<<<<<<<<< @@ -6088,7 +6090,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, 155, __pyx_L1_error) + __PYX_ERR(0, 156, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6099,7 +6101,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, 155, __pyx_L1_error) + __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, 156, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6137,11 +6139,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 155, __pyx_L1_error) - __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 155, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 155, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PySequence_ListKeepNew(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 156, __pyx_L1_error) } + __pyx_t_1 = __Pyx_PySequence_ListKeepNew(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -6150,20 +6152,20 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 155, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 156, __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, 155, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __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, 155, __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, 155, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_variable_supported_operators)) { __Pyx_RaiseClosureNameError("variable_supported_operators"); __PYX_ERR(0, 156, __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, 156, __pyx_L1_error) if (__pyx_t_4) { __pyx_t_5 = __pyx_cur_scope->__pyx_v_s; __Pyx_INCREF(__pyx_t_5); @@ -6172,10 +6174,10 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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, 155, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 155, __pyx_L1_error) + if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } } @@ -6205,7 +6207,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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 */ -/* "constraint/parser.py":157 +/* "constraint/parser.py":158 * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 # <<<<<<<<<<<<<< @@ -6225,7 +6227,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_9_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 157, __pyx_L1_error) + __PYX_ERR(0, 158, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6236,7 +6238,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, 157, __pyx_L1_error) + __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, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6276,16 +6278,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, 157, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 157, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 158, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 158, __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, 157, __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, 158, __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, 157, __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, 158, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6293,7 +6295,7 @@ 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, 157, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 158, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6303,7 +6305,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 157, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 158, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6314,13 +6316,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __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, 157, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 158, __pyx_L1_error) PyErr_Clear(); } break; @@ -6338,11 +6340,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __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, 157, __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, 157, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 158, __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, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = (!__pyx_t_7); if (__pyx_t_8) { @@ -6384,7 +6386,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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 */ -/* "constraint/parser.py":215 +/* "constraint/parser.py":219 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< @@ -6404,7 +6406,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_10_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 215, __pyx_L1_error) + __PYX_ERR(0, 219, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6415,7 +6417,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, 215, __pyx_L1_error) + __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, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6453,16 +6455,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, 215, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 215, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 219, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 219, __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, 215, __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, 219, __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, 215, __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, 219, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6470,7 +6472,7 @@ 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, 215, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 219, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6480,7 +6482,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 215, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 219, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6491,13 +6493,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __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, 215, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 219, __pyx_L1_error) PyErr_Clear(); } break; @@ -6508,9 +6510,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, 215, __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, 215, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 215, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_operator)) { __Pyx_RaiseClosureNameError("operator"); __PYX_ERR(0, 219, __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, 219, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { @@ -6551,7 +6553,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_28generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":222 +/* "constraint/parser.py":226 * 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): # <<<<<<<<<<<<<< @@ -6571,7 +6573,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_11_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 222, __pyx_L1_error) + __PYX_ERR(0, 226, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6582,7 +6584,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_28generator9, ((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, 222, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_28generator9, ((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, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6622,16 +6624,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, 222, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 222, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 226, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 226, __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, 222, __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, 226, __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, 226, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6639,7 +6641,7 @@ 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, 222, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 226, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6649,7 +6651,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 226, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6660,13 +6662,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __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, 226, __pyx_L1_error) PyErr_Clear(); } break; @@ -6684,11 +6686,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __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, 222, __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, 222, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 226, __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, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = (!__pyx_t_7); if (__pyx_t_8) { @@ -6729,12 +6731,12 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return __pyx_r; } -/* "constraint/parser.py":75 +/* "constraint/parser.py":76 * return split_restrictions * * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, MaxProdConstraint]]: # noqa: E501 + * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint]]: # noqa: E501 */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_constraint(PyObject *__pyx_self, PyObject *__pyx_v_restriction, PyObject *__pyx_v_params) { @@ -6793,7 +6795,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, 75, __pyx_L1_error) + __PYX_ERR(0, 76, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6805,7 +6807,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_params); __Pyx_INCREF(__pyx_v_restriction); - /* "constraint/parser.py":80 + /* "constraint/parser.py":81 * """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): # <<<<<<<<<<<<<< @@ -6814,7 +6816,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __pyx_t_2 = __pyx_cur_scope->__pyx_v_params; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 == 0); if (!__pyx_t_4) { @@ -6822,19 +6824,19 @@ 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, 80, __pyx_L1_error) + __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, 81, __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, 80, __pyx_L1_error) + __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = (!__pyx_t_4); __pyx_t_1 = __pyx_t_6; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":81 + /* "constraint/parser.py":82 * # 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 # <<<<<<<<<<<<<< @@ -6845,7 +6847,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":80 + /* "constraint/parser.py":81 * """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): # <<<<<<<<<<<<<< @@ -6854,34 +6856,34 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":83 + /* "constraint/parser.py":84 * return None * * comparators = ["<=", "==", ">=", ">", "<"] # <<<<<<<<<<<<<< * comparators_found = re.findall("|".join(comparators), restriction) * # check if there is exactly one comparator, if not, return None */ - __pyx_t_5 = PyList_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_5 = PyList_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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_5, 0, __pyx_mstate_global->__pyx_kp_u__2) != (0)) __PYX_ERR(0, 83, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_mstate_global->__pyx_kp_u__2) != (0)) __PYX_ERR(0, 84, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__7); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_mstate_global->__pyx_kp_u__7) != (0)) __PYX_ERR(0, 83, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_mstate_global->__pyx_kp_u__7) != (0)) __PYX_ERR(0, 84, __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_5, 2, __pyx_mstate_global->__pyx_kp_u__3) != (0)) __PYX_ERR(0, 83, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_mstate_global->__pyx_kp_u__3) != (0)) __PYX_ERR(0, 84, __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_5, 3, __pyx_mstate_global->__pyx_kp_u__4) != (0)) __PYX_ERR(0, 83, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 3, __pyx_mstate_global->__pyx_kp_u__4) != (0)) __PYX_ERR(0, 84, __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_5, 4, __pyx_mstate_global->__pyx_kp_u__5) != (0)) __PYX_ERR(0, 83, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 4, __pyx_mstate_global->__pyx_kp_u__5) != (0)) __PYX_ERR(0, 84, __pyx_L1_error); __pyx_v_comparators = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/parser.py":84 + /* "constraint/parser.py":85 * * comparators = ["<=", "==", ">=", ">", "<"] * comparators_found = re.findall("|".join(comparators), restriction) # <<<<<<<<<<<<<< @@ -6889,12 +6891,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if len(comparators_found) != 1: */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_comparators); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_7 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_comparators); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -6914,24 +6916,24 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_v_comparators_found = __pyx_t_5; __pyx_t_5 = 0; - /* "constraint/parser.py":86 + /* "constraint/parser.py":87 * comparators_found = re.findall("|".join(comparators), restriction) * # check if there is exactly one comparator, if not, return None * if len(comparators_found) != 1: # <<<<<<<<<<<<<< * return None * comparator = comparators_found[0] */ - __pyx_t_3 = PyObject_Length(__pyx_v_comparators_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_comparators_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 87, __pyx_L1_error) __pyx_t_1 = (__pyx_t_3 != 1); if (__pyx_t_1) { - /* "constraint/parser.py":87 + /* "constraint/parser.py":88 * # check if there is exactly one comparator, if not, return None * if len(comparators_found) != 1: * return None # <<<<<<<<<<<<<< @@ -6942,7 +6944,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":86 + /* "constraint/parser.py":87 * comparators_found = re.findall("|".join(comparators), restriction) * # check if there is exactly one comparator, if not, return None * if len(comparators_found) != 1: # <<<<<<<<<<<<<< @@ -6951,28 +6953,28 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":88 + /* "constraint/parser.py":89 * if len(comparators_found) != 1: * return None * comparator = comparators_found[0] # <<<<<<<<<<<<<< * * # 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); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_comparators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_comparator = __pyx_t_5; __pyx_t_5 = 0; - /* "constraint/parser.py":91 + /* "constraint/parser.py":92 * * # split the string on the comparison and remove leading and trailing whitespace * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< * * # 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, 91, __pyx_L1_error) + __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, 92, __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, 91, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (1) { @@ -6981,7 +6983,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 91, __pyx_L1_error) + __PYX_ERR(0, 92, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); @@ -6989,9 +6991,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -7003,65 +7005,65 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_cur_scope->__pyx_v_right = __pyx_t_7; __pyx_t_7 = 0; - /* "constraint/parser.py":94 + /* "constraint/parser.py":95 * * # if we have an inverse operation, rewrite to the other side * supported_operators = ["**", "*", "+", "-", "/"] # <<<<<<<<<<<<<< * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) * unique_operators_right = set(s.strip() for s in list(right) if s in supported_operators) */ - __pyx_t_8 = PyList_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_8 = PyList_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 95, __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, 94, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_mstate_global->__pyx_kp_u__8) != (0)) __PYX_ERR(0, 95, __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, 94, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_kp_u__9) != (0)) __PYX_ERR(0, 95, __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, 94, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_mstate_global->__pyx_kp_u__10) != (0)) __PYX_ERR(0, 95, __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, 94, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 3, __pyx_mstate_global->__pyx_kp_u__11) != (0)) __PYX_ERR(0, 95, __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, 94, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 4, __pyx_mstate_global->__pyx_kp_u__12) != (0)) __PYX_ERR(0, 95, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_v_supported_operators = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/parser.py":95 + /* "constraint/parser.py":96 * # if we have an inverse operation, rewrite to the other side * supported_operators = ["**", "*", "+", "-", "/"] * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) # <<<<<<<<<<<<<< * unique_operators_right = set(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" */ - __pyx_t_8 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_left); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_8 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_left); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __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, 95, __pyx_L1_error) + __pyx_t_7 = __Pyx_Generator_GetInlinedResult(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_unique_operators_left = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/parser.py":96 + /* "constraint/parser.py":97 * supported_operators = ["**", "*", "+", "-", "/"] * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) * unique_operators_right = set(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" * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: */ - __pyx_t_7 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_right); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_7 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_right); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_8 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_unique_operators_right = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/parser.py":98 + /* "constraint/parser.py":99 * unique_operators_right = set(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" * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: # <<<<<<<<<<<<<< @@ -7070,9 +7072,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ if (unlikely(__pyx_v_unique_operators_left == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 98, __pyx_L1_error) + __PYX_ERR(0, 99, __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, 98, __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, 99, __pyx_L1_error) __pyx_t_6 = (__pyx_t_3 > 0); if (__pyx_t_6) { } else { @@ -7081,15 +7083,15 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ } if (unlikely(__pyx_v_unique_operators_right == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 98, __pyx_L1_error) + __PYX_ERR(0, 99, __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, 98, __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, 99, __pyx_L1_error) __pyx_t_6 = (__pyx_t_3 > 0); __pyx_t_1 = __pyx_t_6; __pyx_L8_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":100 + /* "constraint/parser.py":101 * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: * # if there are operators on both sides, we can't handle this yet * return None # <<<<<<<<<<<<<< @@ -7100,7 +7102,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":98 + /* "constraint/parser.py":99 * unique_operators_right = set(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" * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: # <<<<<<<<<<<<<< @@ -7109,30 +7111,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":101 + /* "constraint/parser.py":102 * # if there are operators on both sides, we can't handle this yet * return None * 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, 101, __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, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_unique_operators = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/parser.py":102 + /* "constraint/parser.py":103 * return None * 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_variable = re.search(regex_match_variable, left if variables_on_left else right) */ - __pyx_t_3 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 102, __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, 103, __pyx_L1_error) __pyx_t_1 = (__pyx_t_3 == 1); if (__pyx_t_1) { - /* "constraint/parser.py":103 + /* "constraint/parser.py":104 * unique_operators = unique_operators_left.union(unique_operators_right) * if len(unique_operators) == 1: * variables_on_left = len(unique_operators_left) > 0 # <<<<<<<<<<<<<< @@ -7141,15 +7143,15 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ if (unlikely(__pyx_v_unique_operators_left == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 103, __pyx_L1_error) + __PYX_ERR(0, 104, __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, 103, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyBool_FromLong((__pyx_t_3 > 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 103, __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, 104, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong((__pyx_t_3 > 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_variables_on_left = __pyx_t_8; __pyx_t_8 = 0; - /* "constraint/parser.py":104 + /* "constraint/parser.py":105 * if len(unique_operators) == 1: * variables_on_left = len(unique_operators_left) > 0 * swapped_side_first_variable = re.search(regex_match_variable, left if variables_on_left else right) # <<<<<<<<<<<<<< @@ -7157,13 +7159,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # if there is no variable on the left side, we can't handle this yet */ __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 105, __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, 104, __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, 105, __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)) { __Pyx_RaiseClosureNameError("regex_match_variable"); __PYX_ERR(0, 104, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 104, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_regex_match_variable)) { __Pyx_RaiseClosureNameError("regex_match_variable"); __PYX_ERR(0, 105, __pyx_L1_error) } + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 105, __pyx_L1_error) if (__pyx_t_1) { __Pyx_INCREF(__pyx_cur_scope->__pyx_v_left); __pyx_t_5 = __pyx_cur_scope->__pyx_v_left; @@ -7189,13 +7191,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 104, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_v_swapped_side_first_variable = __pyx_t_8; __pyx_t_8 = 0; - /* "constraint/parser.py":105 + /* "constraint/parser.py":106 * variables_on_left = len(unique_operators_left) > 0 * swapped_side_first_variable = re.search(regex_match_variable, left if variables_on_left else right) * if swapped_side_first_variable is None: # <<<<<<<<<<<<<< @@ -7205,7 +7207,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_1 = (__pyx_v_swapped_side_first_variable == Py_None); if (__pyx_t_1) { - /* "constraint/parser.py":107 + /* "constraint/parser.py":108 * if swapped_side_first_variable is None: * # if there is no variable on the left side, we can't handle this yet * return None # <<<<<<<<<<<<<< @@ -7216,7 +7218,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":105 + /* "constraint/parser.py":106 * variables_on_left = len(unique_operators_left) > 0 * swapped_side_first_variable = re.search(regex_match_variable, left if variables_on_left else right) * if swapped_side_first_variable is None: # <<<<<<<<<<<<<< @@ -7225,7 +7227,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":109 + /* "constraint/parser.py":110 * return None * else: * swapped_side_first_variable = swapped_side_first_variable.group(0) # <<<<<<<<<<<<<< @@ -7240,83 +7242,83 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ 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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 109, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_DECREF_SET(__pyx_v_swapped_side_first_variable, __pyx_t_8); __pyx_t_8 = 0; } - /* "constraint/parser.py":110 + /* "constraint/parser.py":111 * else: * swapped_side_first_variable = swapped_side_first_variable.group(0) * if "-" in unique_operators: # <<<<<<<<<<<<<< * 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, 110, __pyx_L1_error) + __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, 111, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":111 + /* "constraint/parser.py":112 * swapped_side_first_variable = swapped_side_first_variable.group(0) * 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_variable):] */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 111, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 112, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_1); if (__pyx_t_6) { - /* "constraint/parser.py":113 + /* "constraint/parser.py":114 * if not variables_on_left: * # e.g. "G == B-M" becomes "G+M == B" * right_remainder = right[len(swapped_side_first_variable):] # <<<<<<<<<<<<<< * left_swap = right_remainder.replace("-", "+") * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" */ - __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 113, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_right, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_right, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_right_remainder = __pyx_t_8; __pyx_t_8 = 0; - /* "constraint/parser.py":114 + /* "constraint/parser.py":115 * # e.g. "G == B-M" becomes "G+M == B" * right_remainder = right[len(swapped_side_first_variable):] * left_swap = right_remainder.replace("-", "+") # <<<<<<<<<<<<<< * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" * else: */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_left_swap = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/parser.py":115 + /* "constraint/parser.py":116 * right_remainder = right[len(swapped_side_first_variable):] * left_swap = right_remainder.replace("-", "+") * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" # <<<<<<<<<<<<<< * else: * # e.g. "B-M == G" becomes "B == G+M" */ - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_10[0] = __pyx_t_2; __pyx_t_10[1] = __pyx_t_8; __pyx_t_10[2] = __pyx_t_5; __pyx_t_10[3] = __pyx_t_7; __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7)); - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 115, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -7325,7 +7327,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF_SET(__pyx_v_restriction, ((PyObject*)__pyx_t_11)); __pyx_t_11 = 0; - /* "constraint/parser.py":111 + /* "constraint/parser.py":112 * swapped_side_first_variable = swapped_side_first_variable.group(0) * if "-" in unique_operators: * if not variables_on_left: # <<<<<<<<<<<<<< @@ -7335,7 +7337,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ goto __pyx_L13; } - /* "constraint/parser.py":118 + /* "constraint/parser.py":119 * else: * # e.g. "B-M == G" becomes "B == G+M" * left_remainder = left[len(swapped_side_first_variable):] # <<<<<<<<<<<<<< @@ -7343,48 +7345,48 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" */ /*else*/ { - __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 118, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_left, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_left, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_v_left_remainder = __pyx_t_11; __pyx_t_11 = 0; - /* "constraint/parser.py":119 + /* "constraint/parser.py":120 * # e.g. "B-M == G" becomes "B == G+M" * left_remainder = left[len(swapped_side_first_variable):] * right_swap = left_remainder.replace("-", "+") # <<<<<<<<<<<<<< * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" * if "/" in unique_operators: */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_v_right_swap = __pyx_t_7; __pyx_t_7 = 0; - /* "constraint/parser.py":120 + /* "constraint/parser.py":121 * left_remainder = left[len(swapped_side_first_variable):] * right_swap = left_remainder.replace("-", "+") * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" # <<<<<<<<<<<<<< * if "/" in unique_operators: * if not variables_on_left: */ - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10[0] = __pyx_t_7; __pyx_t_10[1] = __pyx_t_11; __pyx_t_10[2] = __pyx_t_5; __pyx_t_10[3] = __pyx_t_8; __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8)); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __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; @@ -7395,7 +7397,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ } __pyx_L13:; - /* "constraint/parser.py":110 + /* "constraint/parser.py":111 * else: * swapped_side_first_variable = swapped_side_first_variable.group(0) * if "-" in unique_operators: # <<<<<<<<<<<<<< @@ -7404,76 +7406,76 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":121 + /* "constraint/parser.py":122 * right_swap = left_remainder.replace("-", "+") * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" * if "/" in unique_operators: # <<<<<<<<<<<<<< * 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, 121, __pyx_L1_error) + __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, 122, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":122 + /* "constraint/parser.py":123 * restriction = f"{swapped_side_first_variable}{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_variable):] */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 123, __pyx_L1_error) __pyx_t_1 = (!__pyx_t_6); if (__pyx_t_1) { - /* "constraint/parser.py":124 + /* "constraint/parser.py":125 * if not variables_on_left: * # e.g. "G == B/M" becomes "G*M == B" * right_remainder = right[len(swapped_side_first_variable):] # <<<<<<<<<<<<<< * left_swap = right_remainder.replace("/", "*") * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" */ - __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 124, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_right, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_right, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_right_remainder, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":125 + /* "constraint/parser.py":126 * # e.g. "G == B/M" becomes "G*M == B" * right_remainder = right[len(swapped_side_first_variable):] * left_swap = right_remainder.replace("/", "*") # <<<<<<<<<<<<<< * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" * else: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_left_swap, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/parser.py":126 + /* "constraint/parser.py":127 * right_remainder = right[len(swapped_side_first_variable):] * left_swap = right_remainder.replace("/", "*") * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" # <<<<<<<<<<<<<< * else: * # e.g. "B/M == G" becomes "B == G*M" */ - __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10[0] = __pyx_t_8; __pyx_t_10[1] = __pyx_t_2; __pyx_t_10[2] = __pyx_t_5; __pyx_t_10[3] = __pyx_t_11; __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11)); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 126, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __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; @@ -7482,7 +7484,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF_SET(__pyx_v_restriction, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; - /* "constraint/parser.py":122 + /* "constraint/parser.py":123 * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" * if "/" in unique_operators: * if not variables_on_left: # <<<<<<<<<<<<<< @@ -7492,7 +7494,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ goto __pyx_L15; } - /* "constraint/parser.py":129 + /* "constraint/parser.py":130 * else: * # e.g. "B/M == G" becomes "B == G*M" * left_remainder = left[len(swapped_side_first_variable):] # <<<<<<<<<<<<<< @@ -7500,48 +7502,48 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" */ /*else*/ { - __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 129, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_left, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_left, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_left_remainder, __pyx_t_7); __pyx_t_7 = 0; - /* "constraint/parser.py":130 + /* "constraint/parser.py":131 * # e.g. "B/M == G" becomes "B == G*M" * left_remainder = left[len(swapped_side_first_variable):] * right_swap = left_remainder.replace("/", "*") # <<<<<<<<<<<<<< * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" * */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_right_swap, __pyx_t_11); __pyx_t_11 = 0; - /* "constraint/parser.py":131 + /* "constraint/parser.py":132 * left_remainder = left[len(swapped_side_first_variable):] * right_swap = left_remainder.replace("/", "*") * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" # <<<<<<<<<<<<<< * * # we have a potentially rewritten restriction, split again */ - __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10[0] = __pyx_t_11; __pyx_t_10[1] = __pyx_t_7; __pyx_t_10[2] = __pyx_t_5; __pyx_t_10[3] = __pyx_t_2; __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2)); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 131, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -7552,7 +7554,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ } __pyx_L15:; - /* "constraint/parser.py":121 + /* "constraint/parser.py":122 * right_swap = left_remainder.replace("-", "+") * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" * if "/" in unique_operators: # <<<<<<<<<<<<<< @@ -7561,16 +7563,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":134 + /* "constraint/parser.py":135 * * # we have a potentially rewritten restriction, split again * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< * * # find out which side is the constant number */ - __pyx_t_8 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_14genexpr(NULL, __pyx_v_restriction, __pyx_v_comparator); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_8 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_14genexpr(NULL, __pyx_v_restriction, __pyx_v_comparator); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 135, __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, 134, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (1) { @@ -7579,7 +7581,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 134, __pyx_L1_error) + __PYX_ERR(0, 135, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); @@ -7587,9 +7589,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -7603,7 +7605,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/parser.py":102 + /* "constraint/parser.py":103 * return None * unique_operators = unique_operators_left.union(unique_operators_right) * if len(unique_operators) == 1: # <<<<<<<<<<<<<< @@ -7612,25 +7614,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":137 + /* "constraint/parser.py":138 * * # 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, 137, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __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, 137, __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, 137, __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[10])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __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, 138, __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, 138, __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[10])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 138, __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":148 + /* "constraint/parser.py":149 * * # 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) # <<<<<<<<<<<<<< @@ -7639,14 +7641,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __pyx_t_5 = __pyx_cur_scope->__pyx_v_left; __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, 148, __pyx_L1_error) - __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_is_or_evals_to_number(__pyx_v_is_or_evals_to_number, ((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_5))) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_is_or_evals_to_number(__pyx_v_is_or_evals_to_number, ((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_left_num = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/parser.py":149 + /* "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) # <<<<<<<<<<<<<< @@ -7655,19 +7657,19 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __pyx_t_2 = __pyx_cur_scope->__pyx_v_right; __Pyx_INCREF(__pyx_t_2); - if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 149, __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_t_2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 150, __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_t_2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_right_num = __pyx_t_5; __pyx_t_5 = 0; - /* "constraint/parser.py":150 + /* "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) { @@ -7692,35 +7694,38 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_L17_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":152 + /* "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] * # find all unique variable_supported_operators in the restriction, can have at most one */ - __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __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, 152, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_mstate_global->__pyx_kp_u__10) != (0)) __PYX_ERR(0, 153, __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_5, 1, __pyx_mstate_global->__pyx_kp_u__9) != (0)) __PYX_ERR(0, 153, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_v_variable_supported_operators = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/parser.py":153 + /* "constraint/parser.py":154 * # 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] # <<<<<<<<<<<<<< * # find all unique variable_supported_operators in the restriction, can have at most one * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) */ { /* enter inner scope */ - __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L23_error) + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 154, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyNumber_Add(__pyx_cur_scope->__pyx_v_left, __pyx_cur_scope->__pyx_v_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L23_error) + __pyx_t_2 = PyNumber_Add(__pyx_cur_scope->__pyx_v_left, __pyx_cur_scope->__pyx_v_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PySequence_ListKeepNew(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 153, __pyx_L23_error) + __pyx_t_8 = __Pyx_PySequence_ListKeepNew(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 154, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2); @@ -7730,17 +7735,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ { 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, 153, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 154, __pyx_L23_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); ++__pyx_t_3; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 153, __pyx_L23_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 154, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_s, __pyx_t_8); __pyx_t_8 = 0; - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_8genexpr7__pyx_v_s, __pyx_cur_scope->__pyx_v_variable_supported_operators, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 153, __pyx_L23_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_8genexpr7__pyx_v_s, __pyx_cur_scope->__pyx_v_variable_supported_operators, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 154, __pyx_L23_error) if (__pyx_t_1) { __pyx_t_7 = __pyx_8genexpr7__pyx_v_s; __Pyx_INCREF(__pyx_t_7); @@ -7749,10 +7754,10 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ 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, 153, __pyx_L23_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 154, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_8); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 153, __pyx_L23_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 154, __pyx_L23_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } } @@ -7767,25 +7772,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_v_variables = __pyx_t_5; __pyx_t_5 = 0; - /* "constraint/parser.py":155 + /* "constraint/parser.py":156 * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] * # find all unique variable_supported_operators in the restriction, can have at most one * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) # <<<<<<<<<<<<<< * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 */ - __pyx_t_5 = PyNumber_Add(__pyx_cur_scope->__pyx_v_left, __pyx_cur_scope->__pyx_v_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_cur_scope->__pyx_v_left, __pyx_cur_scope->__pyx_v_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_17genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_17genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_unique_operators, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "constraint/parser.py":157 + /* "constraint/parser.py":158 * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 # <<<<<<<<<<<<<< @@ -7794,21 +7799,21 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ if (unlikely(__pyx_v_unique_operators == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 157, __pyx_L1_error) + __PYX_ERR(0, 158, __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, 157, __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, 158, __pyx_L1_error) __pyx_t_6 = (__pyx_t_3 <= 1); if (__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L30_bool_binop_done; } - __pyx_t_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_20genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_variables); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_20genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_variables); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __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, 157, __pyx_L1_error) + __pyx_t_2 = __Pyx_Generator_GetInlinedResult(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { } else { @@ -7817,7 +7822,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ } __pyx_t_2 = __pyx_cur_scope->__pyx_v_left; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = (__pyx_t_3 == 1); if (!__pyx_t_6) { @@ -7827,14 +7832,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ } __pyx_t_2 = __pyx_cur_scope->__pyx_v_right; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = (__pyx_t_3 == 1); __pyx_t_1 = __pyx_t_6; __pyx_L30_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":158 + /* "constraint/parser.py":159 * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 * variables_on_left = len(right) == 1 # <<<<<<<<<<<<<< @@ -7843,14 +7848,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __pyx_t_2 = __pyx_cur_scope->__pyx_v_right; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_t_3 == 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_t_3 == 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_variables_on_left, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":159 + /* "constraint/parser.py":160 * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 * variables_on_left = len(right) == 1 * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": # <<<<<<<<<<<<<< @@ -7859,37 +7864,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ if (unlikely(__pyx_v_unique_operators == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 159, __pyx_L1_error) + __PYX_ERR(0, 160, __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, 159, __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, 160, __pyx_L1_error) __pyx_t_6 = (__pyx_t_3 == 0); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L35_bool_binop_done; } - __pyx_t_2 = PyObject_GetIter(__pyx_v_unique_operators); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_2 = PyObject_GetIter(__pyx_v_unique_operators); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __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, 159, __pyx_L1_error) + __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, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __pyx_t_6; __pyx_L35_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":160 + /* "constraint/parser.py":161 * variables_on_left = len(right) == 1 * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": * if comparator == "==": # <<<<<<<<<<<<<< * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 * elif 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, 160, __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, 161, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":161 + /* "constraint/parser.py":162 * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": * if comparator == "==": * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 # <<<<<<<<<<<<<< @@ -7897,14 +7902,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # "B+C <= A" (maxsum) if variables_on_left else "A <= B+C" (minsum) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 162, __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, 161, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 162, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 162, __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, 161, __pyx_L1_error) + __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, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -7925,18 +7930,18 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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, 161, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 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, 161, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 162, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 162, __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, 161, __pyx_L1_error) + __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, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -7957,7 +7962,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_5 = __pyx_t_2; @@ -7967,7 +7972,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":160 + /* "constraint/parser.py":161 * variables_on_left = len(right) == 1 * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": * if comparator == "==": # <<<<<<<<<<<<<< @@ -7976,17 +7981,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":162 + /* "constraint/parser.py":163 * 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 VariableMaxSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMinSumConstraint(variables[0], variables[1:]) # noqa: E501 */ - __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, 162, __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, 163, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":164 + /* "constraint/parser.py":165 * 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 # <<<<<<<<<<<<<< @@ -7994,14 +7999,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # "B+C >= A" (minsum) if variables_on_left else "A >= B+C" (maxsum) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 165, __pyx_L1_error) if (__pyx_t_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, 164, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 165, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 165, __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, 164, __pyx_L1_error) + __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, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -8022,18 +8027,18 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 164, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 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, 164, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 165, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 165, __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, 164, __pyx_L1_error) + __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, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -8054,7 +8059,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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, 164, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_5 = __pyx_t_2; @@ -8064,7 +8069,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":162 + /* "constraint/parser.py":163 * if comparator == "==": * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 * elif comparator == "<=": # <<<<<<<<<<<<<< @@ -8073,32 +8078,32 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":165 + /* "constraint/parser.py":166 * # "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 VariableMinSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxSumConstraint(variables[0], variables[1:]) # noqa: E501 */ - __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, 165, __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, 166, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":167 + /* "constraint/parser.py":168 * 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 # <<<<<<<<<<<<<< - * - * # left_num and right_num can't be both None or both a constant + * elif next(iter(unique_operators)) == "*": + * if comparator == "==": */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 168, __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, 167, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 168, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 168, __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, 167, __pyx_L1_error) + __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, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -8119,18 +8124,18 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 0; } else { __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 168, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 168, __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, 167, __pyx_L1_error) + __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, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -8151,7 +8156,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 167, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_5 = __pyx_t_2; @@ -8161,7 +8166,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":165 + /* "constraint/parser.py":166 * # "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 == ">=": # <<<<<<<<<<<<<< @@ -8170,16 +8175,140 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":159 + /* "constraint/parser.py":160 * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 * variables_on_left = len(right) == 1 * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": # <<<<<<<<<<<<<< * if comparator == "==": * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 +*/ + goto __pyx_L34; + } + + /* "constraint/parser.py":169 + * # "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 next(iter(unique_operators)) == "*": # <<<<<<<<<<<<<< + * if comparator == "==": + * return VariableExactProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactProdConstraint(variables[0], variables[1:]) # noqa: E501 +*/ + __pyx_t_5 = PyObject_GetIter(__pyx_v_unique_operators); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + /* "constraint/parser.py":170 + * return VariableMinSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxSumConstraint(variables[0], variables[1:]) # noqa: E501 + * elif next(iter(unique_operators)) == "*": + * if comparator == "==": # <<<<<<<<<<<<<< + * return VariableExactProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactProdConstraint(variables[0], variables[1:]) # noqa: E501 + * +*/ + __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, 170, __pyx_L1_error) + if (__pyx_t_1) { + + /* "constraint/parser.py":171 + * elif next(iter(unique_operators)) == "*": + * if comparator == "==": + * return VariableExactProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactProdConstraint(variables[0], variables[1:]) # noqa: E501 # <<<<<<<<<<<<<< + * + * # left_num and right_num can't be both None or both a constant +*/ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 171, __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, 171, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 171, __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, 171, __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); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __pyx_t_9 = 0; + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_11, __pyx_t_12}; + __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_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + } + __pyx_t_2 = __pyx_t_5; + __pyx_t_5 = 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, 171, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 171, __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, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __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); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_7); + __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_5 = __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; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + } + __pyx_t_2 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "constraint/parser.py":170 + * return VariableMinSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxSumConstraint(variables[0], variables[1:]) # noqa: E501 + * elif next(iter(unique_operators)) == "*": + * if comparator == "==": # <<<<<<<<<<<<<< + * return VariableExactProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactProdConstraint(variables[0], variables[1:]) # noqa: E501 + * +*/ + } + + /* "constraint/parser.py":169 + * # "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 next(iter(unique_operators)) == "*": # <<<<<<<<<<<<<< + * if comparator == "==": + * return VariableExactProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactProdConstraint(variables[0], variables[1:]) # noqa: E501 */ } + __pyx_L34:; - /* "constraint/parser.py":157 + /* "constraint/parser.py":158 * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 # <<<<<<<<<<<<<< @@ -8188,7 +8317,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":170 + /* "constraint/parser.py":174 * * # left_num and right_num can't be both None or both a constant * return None # <<<<<<<<<<<<<< @@ -8199,16 +8328,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":150 + /* "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":174 + /* "constraint/parser.py":178 * # 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) # <<<<<<<<<<<<<< @@ -8217,97 +8346,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_cur_scope->__pyx_v_right; - __Pyx_INCREF(__pyx_t_8); + __pyx_t_12 = __pyx_cur_scope->__pyx_v_right; + __Pyx_INCREF(__pyx_t_12); __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, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + PyObject *__pyx_callargs[2] = {__pyx_t_12, 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_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __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, 174, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 174, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_left_num) != (0)) __PYX_ERR(0, 178, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 178, __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, 174, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_5 = __pyx_t_8; - __pyx_t_8 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 2, Py_False) != (0)) __PYX_ERR(0, 178, __pyx_L1_error); + __pyx_t_5 = 0; + __pyx_t_2 = __pyx_t_12; + __pyx_t_12 = 0; } else { - __pyx_t_2 = __pyx_cur_scope->__pyx_v_left; - __Pyx_INCREF(__pyx_t_2); + __pyx_t_5 = __pyx_cur_scope->__pyx_v_left; + __Pyx_INCREF(__pyx_t_5); __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, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; + __pyx_t_12 = __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_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); } - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __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, 174, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 174, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_right_num) != (0)) __PYX_ERR(0, 178, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_12); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_12) != (0)) __PYX_ERR(0, 178, __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, 174, __pyx_L1_error); - __pyx_t_8 = 0; - __pyx_t_5 = __pyx_t_2; - __pyx_t_2 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, Py_True) != (0)) __PYX_ERR(0, 178, __pyx_L1_error); + __pyx_t_12 = 0; + __pyx_t_2 = __pyx_t_5; + __pyx_t_5 = 0; } - if (likely(__pyx_t_5 != Py_None)) { - PyObject* sequence = __pyx_t_5; + if (likely(__pyx_t_2 != Py_None)) { + PyObject* sequence = __pyx_t_2; 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, 173, __pyx_L1_error) + __PYX_ERR(0, 177, __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_5 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_5); + __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_12); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_8); - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); - __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); #endif - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 173, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 177, __pyx_L1_error) } - /* "constraint/parser.py":173 + /* "constraint/parser.py":177 * * # 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_5; + __pyx_t_5 = 0; + __pyx_v_variables = __pyx_t_12; + __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_v_variables_on_left, __pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF_SET(__pyx_v_variables_on_left, __pyx_t_7); - __pyx_t_7 = 0; - /* "constraint/parser.py":178 + /* "constraint/parser.py":182 * * # if the number is an integer, we can map '>' to '>=' and '<' to '<=' by changing the number (does not work with floating points!) # noqa: E501 * number_is_int = isinstance(number, int) # <<<<<<<<<<<<<< @@ -8317,7 +8446,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_1 = PyLong_Check(__pyx_v_number); __pyx_v_number_is_int = __pyx_t_1; - /* "constraint/parser.py":179 + /* "constraint/parser.py":183 * # if the number is an integer, we can map '>' to '>=' and '<' to '<=' by changing the number (does not work with floating points!) # noqa: E501 * number_is_int = isinstance(number, int) * if number_is_int: # <<<<<<<<<<<<<< @@ -8326,49 +8455,49 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ if (__pyx_v_number_is_int) { - /* "constraint/parser.py":180 + /* "constraint/parser.py":184 * number_is_int = isinstance(number, int) * if number_is_int: * if comparator == "<": # <<<<<<<<<<<<<< * if variables_on_left: * # (x < 2) == (x <= 2-1) */ - __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, 180, __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, 184, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":181 + /* "constraint/parser.py":185 * if number_is_int: * if comparator == "<": * if variables_on_left: # <<<<<<<<<<<<<< * # (x < 2) == (x <= 2-1) * number -= 1 */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 185, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":183 + /* "constraint/parser.py":187 * if variables_on_left: * # (x < 2) == (x <= 2-1) * number -= 1 # <<<<<<<<<<<<<< * else: * # (2 < x) == (2+1 <= x) */ - __pyx_t_5 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_5); - __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/parser.py":181 + /* "constraint/parser.py":185 * if number_is_int: * if comparator == "<": * if variables_on_left: # <<<<<<<<<<<<<< * # (x < 2) == (x <= 2-1) * number -= 1 */ - goto __pyx_L40; + goto __pyx_L41; } - /* "constraint/parser.py":186 + /* "constraint/parser.py":190 * else: * # (2 < x) == (2+1 <= x) * number += 1 # <<<<<<<<<<<<<< @@ -8376,66 +8505,66 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if variables_on_left: */ /*else*/ { - __pyx_t_5 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_5); - __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_2); + __pyx_t_2 = 0; } - __pyx_L40:; + __pyx_L41:; - /* "constraint/parser.py":180 + /* "constraint/parser.py":184 * number_is_int = isinstance(number, int) * if number_is_int: * if comparator == "<": # <<<<<<<<<<<<<< * if variables_on_left: * # (x < 2) == (x <= 2-1) */ - goto __pyx_L39; + goto __pyx_L40; } - /* "constraint/parser.py":187 + /* "constraint/parser.py":191 * # (2 < x) == (2+1 <= x) * number += 1 * elif comparator == ">": # <<<<<<<<<<<<<< * if variables_on_left: * # (x > 2) == (x >= 2+1) */ - __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, 187, __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, 191, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":188 + /* "constraint/parser.py":192 * number += 1 * elif comparator == ">": * if variables_on_left: # <<<<<<<<<<<<<< * # (x > 2) == (x >= 2+1) * number += 1 */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 192, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":190 + /* "constraint/parser.py":194 * if variables_on_left: * # (x > 2) == (x >= 2+1) * number += 1 # <<<<<<<<<<<<<< * else: * # (2 > x) == (2-1 >= x) */ - __pyx_t_5 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_5); - __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/parser.py":188 + /* "constraint/parser.py":192 * number += 1 * elif comparator == ">": * if variables_on_left: # <<<<<<<<<<<<<< * # (x > 2) == (x >= 2+1) * number += 1 */ - goto __pyx_L41; + goto __pyx_L42; } - /* "constraint/parser.py":193 + /* "constraint/parser.py":197 * else: * # (2 > x) == (2-1 >= x) * number -= 1 # <<<<<<<<<<<<<< @@ -8443,14 +8572,14 @@ 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_5 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_5); - __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_2); + __pyx_t_2 = 0; } - __pyx_L41:; + __pyx_L42:; - /* "constraint/parser.py":187 + /* "constraint/parser.py":191 * # (2 < x) == (2+1 <= x) * number += 1 * elif comparator == ">": # <<<<<<<<<<<<<< @@ -8458,9 +8587,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # (x > 2) == (x >= 2+1) */ } - __pyx_L39:; + __pyx_L40:; - /* "constraint/parser.py":179 + /* "constraint/parser.py":183 * # if the number is an integer, we can map '>' to '>=' and '<' to '<=' by changing the number (does not work with floating points!) # noqa: E501 * number_is_int = isinstance(number, int) * if number_is_int: # <<<<<<<<<<<<<< @@ -8469,100 +8598,100 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":196 + /* "constraint/parser.py":200 * * # 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, 196, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __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, 196, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_mstate_global->__pyx_kp_u__13) != (0)) __PYX_ERR(0, 200, __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, 196, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_kp_u__14) != (0)) __PYX_ERR(0, 200, __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, 196, __pyx_L1_error); - __pyx_v_operators = ((PyObject*)__pyx_t_5); - __pyx_t_5 = 0; + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_mstate_global->__pyx_kp_u__15) != (0)) __PYX_ERR(0, 200, __pyx_L1_error); + __pyx_v_operators = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/parser.py":197 + /* "constraint/parser.py":201 * # 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, 197, __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, 197, __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, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_operators); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __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_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_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __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; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_12, __pyx_v_variables}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __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_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_v_operators_found = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_operators_found = __pyx_t_2; + __pyx_t_2 = 0; - /* "constraint/parser.py":198 + /* "constraint/parser.py":202 * 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, 198, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_operators_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 202, __pyx_L1_error) __pyx_t_1 = (__pyx_t_3 == 0); if (__pyx_t_1) { - /* "constraint/parser.py":200 + /* "constraint/parser.py":204 * 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, 200, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __pyx_cur_scope->__pyx_v_params; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = (__pyx_t_3 != 1); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L44_bool_binop_done; + goto __pyx_L45_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, 200, __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, 204, __pyx_L1_error) __pyx_t_1 = __pyx_t_6; - __pyx_L44_bool_binop_done:; + __pyx_L45_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":202 + /* "constraint/parser.py":206 * if len(params) != 1 or variables not in params: * # there were more than one variable but no operator * return None # <<<<<<<<<<<<<< @@ -8573,7 +8702,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":200 + /* "constraint/parser.py":204 * if len(operators_found) == 0: * # no operators found, return only based on comparator * if len(params) != 1 or variables not in params: # <<<<<<<<<<<<<< @@ -8582,17 +8711,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":205 + /* "constraint/parser.py":209 * # 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 == "<" and number_is_int): */ - __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, 205, __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, 209, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":206 + /* "constraint/parser.py":210 * # if there are restrictions with a single variable, it will be used to prune the domain at the start * elif comparator == "==": * return ExactSumConstraint(number) # <<<<<<<<<<<<<< @@ -8600,34 +8729,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, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __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_12))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_12); + assert(__pyx_t_5); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_12, __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, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_number}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __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_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/parser.py":205 + /* "constraint/parser.py":209 * # 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 == "==": # <<<<<<<<<<<<<< @@ -8636,30 +8765,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":207 + /* "constraint/parser.py":211 * elif comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): */ - __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, 207, __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, 211, __pyx_L1_error) if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L46_bool_binop_done; + goto __pyx_L47_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, 207, __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, 211, __pyx_L1_error) if (__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L46_bool_binop_done; + goto __pyx_L47_bool_binop_done; } __pyx_t_1 = __pyx_v_number_is_int; - __pyx_L46_bool_binop_done:; + __pyx_L47_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":208 + /* "constraint/parser.py":212 * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< @@ -8667,65 +8796,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, 208, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 212, __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, 208, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __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_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_7, __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_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, 208, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_number}; + __pyx_t_12 = __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_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); } - __pyx_t_5 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_2 = __pyx_t_12; + __pyx_t_12 = 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, 208, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __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_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_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __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, 208, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_number}; + __pyx_t_12 = __Pyx_PyObject_FastCall(__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_12)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); } - __pyx_t_5 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_2 = __pyx_t_12; + __pyx_t_12 = 0; } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/parser.py":207 + /* "constraint/parser.py":211 * elif comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< @@ -8734,30 +8863,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":209 + /* "constraint/parser.py":213 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< * 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, 209, __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, 213, __pyx_L1_error) if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L49_bool_binop_done; + goto __pyx_L50_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, 209, __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, 213, __pyx_L1_error) if (__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L49_bool_binop_done; + goto __pyx_L50_bool_binop_done; } __pyx_t_1 = __pyx_v_number_is_int; - __pyx_L49_bool_binop_done:; + __pyx_L50_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":210 + /* "constraint/parser.py":214 * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) # <<<<<<<<<<<<<< @@ -8765,65 +8894,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, 210, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 214, __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, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __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_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_7, __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_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, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_number}; + __pyx_t_12 = __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_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); } - __pyx_t_5 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_2 = __pyx_t_12; + __pyx_t_12 = 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, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __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_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_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __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, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_number}; + __pyx_t_12 = __Pyx_PyObject_FastCall(__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_12)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); } - __pyx_t_5 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_2 = __pyx_t_12; + __pyx_t_12 = 0; } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/parser.py":209 + /* "constraint/parser.py":213 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< @@ -8832,36 +8961,36 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":211 + /* "constraint/parser.py":215 * elif comparator == ">=" or (comparator == ">" and number_is_int): * 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_t_12 = 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, 211, __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, 211, __pyx_L1_error) + __pyx_t_5 = __pyx_builtin_ValueError; + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 215, __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, 215, __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_12, __pyx_t_11}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__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_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 215, __pyx_L1_error) - /* "constraint/parser.py":198 + /* "constraint/parser.py":202 * operators = [r"\*\*", r"\*", r"\+"] * operators_found = re.findall(str("|".join(operators)), variables) * if len(operators_found) == 0: # <<<<<<<<<<<<<< @@ -8870,37 +8999,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":214 + /* "constraint/parser.py":218 * * # 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); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __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_2 = __Pyx_GetItemInt(__pyx_v_operators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_cur_scope->__pyx_v_operator = __pyx_t_2; + __pyx_t_2 = 0; - /* "constraint/parser.py":215 + /* "constraint/parser.py":219 * # 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_23genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_operators_found); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __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, 215, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_23genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_operators_found); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __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, 215, __pyx_L1_error) + __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 219, __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, 219, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = (!__pyx_t_1); if (__pyx_t_6) { - /* "constraint/parser.py":217 + /* "constraint/parser.py":221 * 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 # <<<<<<<<<<<<<< @@ -8911,7 +9040,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":215 + /* "constraint/parser.py":219 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< @@ -8920,66 +9049,66 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":220 + /* "constraint/parser.py":224 * * # 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_2 = __pyx_v_variables; + __Pyx_INCREF(__pyx_t_2); __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, 220, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_operator}; + __pyx_t_5 = __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_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_v_splitted = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_splitted = __pyx_t_5; + __pyx_t_5 = 0; - /* "constraint/parser.py":222 + /* "constraint/parser.py":226 * 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, 222, __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, 222, __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, 226, __pyx_L1_error) + __pyx_t_5 = __pyx_cur_scope->__pyx_v_params; + __Pyx_INCREF(__pyx_t_5); + __pyx_t_13 = __Pyx_PyList_GET_SIZE(__pyx_t_5); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = (__pyx_t_3 == __pyx_t_13); if (__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L54_bool_binop_done; + goto __pyx_L55_bool_binop_done; } - __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_26genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_splitted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __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, 222, __pyx_L1_error) + __pyx_t_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_26genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_splitted); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __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, 222, __pyx_L1_error) + __pyx_t_2 = __Pyx_Generator_GetInlinedResult(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __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, 226, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __pyx_t_1; - __pyx_L54_bool_binop_done:; + __pyx_L55_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":224 + /* "constraint/parser.py":228 * 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, 224, __pyx_L1_error) + __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, 228, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":226 + /* "constraint/parser.py":230 * if operator == "**": * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None # <<<<<<<<<<<<<< @@ -8990,7 +9119,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":224 + /* "constraint/parser.py":228 * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): * # map to a Constraint * if operator == "**": # <<<<<<<<<<<<<< @@ -8999,27 +9128,27 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":227 + /* "constraint/parser.py":231 * # 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, 227, __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, 231, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":228 + /* "constraint/parser.py":232 * return None * elif operator == "*": * if comparator == "==": # <<<<<<<<<<<<<< * return ExactProdConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): */ - __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, 228, __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, 232, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":229 + /* "constraint/parser.py":233 * elif operator == "*": * if comparator == "==": * return ExactProdConstraint(number) # <<<<<<<<<<<<<< @@ -9027,34 +9156,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, 229, __pyx_L1_error) + __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __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); + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11); + assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__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_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; + PyObject *__pyx_callargs[2] = {__pyx_t_5, __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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 229, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/parser.py":228 + /* "constraint/parser.py":232 * return None * elif operator == "*": * if comparator == "==": # <<<<<<<<<<<<<< @@ -9063,30 +9192,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":230 + /* "constraint/parser.py":234 * if comparator == "==": * return ExactProdConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): */ - __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, 230, __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, 234, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L58_bool_binop_done; + goto __pyx_L59_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, 230, __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, 234, __pyx_L1_error) if (__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L58_bool_binop_done; + goto __pyx_L59_bool_binop_done; } __pyx_t_6 = __pyx_v_number_is_int; - __pyx_L58_bool_binop_done:; + __pyx_L59_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":231 + /* "constraint/parser.py":235 * return ExactProdConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) # <<<<<<<<<<<<<< @@ -9094,65 +9223,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, 231, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 235, __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, 231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __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_12))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_12); + assert(__pyx_t_5); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_12, __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; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 231, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_number}; + __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_12, __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_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_5 = __pyx_t_11; + __pyx_t_2 = __pyx_t_11; __pyx_t_11 = 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, 231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - 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); + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5); + assert(__pyx_t_12); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __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_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, 231, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_number}; + __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__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; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_5 = __pyx_t_11; + __pyx_t_2 = __pyx_t_11; __pyx_t_11 = 0; } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/parser.py":230 + /* "constraint/parser.py":234 * if comparator == "==": * return ExactProdConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< @@ -9161,30 +9290,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":232 + /* "constraint/parser.py":236 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< * 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, 232, __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, 236, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L61_bool_binop_done; + goto __pyx_L62_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, 232, __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, 236, __pyx_L1_error) if (__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L61_bool_binop_done; + goto __pyx_L62_bool_binop_done; } __pyx_t_6 = __pyx_v_number_is_int; - __pyx_L61_bool_binop_done:; + __pyx_L62_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":233 + /* "constraint/parser.py":237 * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) # <<<<<<<<<<<<<< @@ -9192,65 +9321,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, 233, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 237, __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, 233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __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_12))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_12); + assert(__pyx_t_5); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_12, __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; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 233, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_number}; + __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_12, __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_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_5 = __pyx_t_11; + __pyx_t_2 = __pyx_t_11; __pyx_t_11 = 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, 233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - 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); + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5); + assert(__pyx_t_12); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __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_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, 233, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_number}; + __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__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; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_5 = __pyx_t_11; + __pyx_t_2 = __pyx_t_11; __pyx_t_11 = 0; } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/parser.py":232 + /* "constraint/parser.py":236 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< @@ -9259,37 +9388,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":227 + /* "constraint/parser.py":231 * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None * elif operator == "*": # <<<<<<<<<<<<<< * if comparator == "==": * return ExactProdConstraint(number) */ - goto __pyx_L56; + goto __pyx_L57; } - /* "constraint/parser.py":234 + /* "constraint/parser.py":238 * elif comparator == ">=" or (comparator == ">" and number_is_int): * 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, 234, __pyx_L1_error) + __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, 238, __pyx_L1_error) if (likely(__pyx_t_6)) { - /* "constraint/parser.py":235 + /* "constraint/parser.py":239 * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": * if comparator == "==": # <<<<<<<<<<<<<< * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): */ - __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, 235, __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, 239, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":236 + /* "constraint/parser.py":240 * elif operator == "+": * if comparator == "==": * return ExactSumConstraint(number) # <<<<<<<<<<<<<< @@ -9298,33 +9427,33 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __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, 236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_11); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __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_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __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, 236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/parser.py":235 + /* "constraint/parser.py":239 * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": * if comparator == "==": # <<<<<<<<<<<<<< @@ -9333,30 +9462,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":237 + /* "constraint/parser.py":241 * if comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): */ - __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, 237, __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, 241, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L65_bool_binop_done; + goto __pyx_L66_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, 237, __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, 241, __pyx_L1_error) if (__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L65_bool_binop_done; + goto __pyx_L66_bool_binop_done; } __pyx_t_6 = __pyx_v_number_is_int; - __pyx_L65_bool_binop_done:; + __pyx_L66_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":238 + /* "constraint/parser.py":242 * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< @@ -9364,65 +9493,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, 238, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 242, __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, 238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); + if (unlikely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12); assert(__pyx_t_11); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_12, __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_t_5 = __Pyx_PyObject_FastCall(__pyx_t_12, __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, 238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_5 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_2 = __pyx_t_5; + __pyx_t_5 = 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, 238, __pyx_L1_error) + __pyx_t_12 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __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); + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); + assert(__pyx_t_12); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__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_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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_12, __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_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_5 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_2 = __pyx_t_5; + __pyx_t_5 = 0; } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/parser.py":237 + /* "constraint/parser.py":241 * if comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< @@ -9431,30 +9560,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":239 + /* "constraint/parser.py":243 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< * 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, 239, __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, 243, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L68_bool_binop_done; + goto __pyx_L69_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, 239, __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, 243, __pyx_L1_error) if (__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L68_bool_binop_done; + goto __pyx_L69_bool_binop_done; } __pyx_t_6 = __pyx_v_number_is_int; - __pyx_L68_bool_binop_done:; + __pyx_L69_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":240 + /* "constraint/parser.py":244 * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) # <<<<<<<<<<<<<< @@ -9462,65 +9591,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, 240, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 244, __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, 240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); + if (unlikely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12); assert(__pyx_t_11); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_12, __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_t_5 = __Pyx_PyObject_FastCall(__pyx_t_12, __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, 240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_5 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_2 = __pyx_t_5; + __pyx_t_5 = 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, 240, __pyx_L1_error) + __pyx_t_12 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __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); + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); + assert(__pyx_t_12); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__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_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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_12, __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_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_5 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_2 = __pyx_t_5; + __pyx_t_5 = 0; } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/parser.py":239 + /* "constraint/parser.py":243 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< @@ -9529,17 +9658,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":234 + /* "constraint/parser.py":238 * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": # <<<<<<<<<<<<<< * if comparator == "==": * return ExactSumConstraint(number) */ - goto __pyx_L56; + goto __pyx_L57; } - /* "constraint/parser.py":242 + /* "constraint/parser.py":246 * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * else: * raise ValueError(f"Invalid operator {operator}") # <<<<<<<<<<<<<< @@ -9547,31 +9676,31 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * */ /*else*/ { - __pyx_t_2 = NULL; + __pyx_t_5 = 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, 242, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_operator, __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 246, __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, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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; + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_8}; + __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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 246, __pyx_L1_error) } - __pyx_L56:; + __pyx_L57:; - /* "constraint/parser.py":222 + /* "constraint/parser.py":226 * 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): # <<<<<<<<<<<<<< @@ -9580,7 +9709,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":243 + /* "constraint/parser.py":247 * else: * raise ValueError(f"Invalid operator {operator}") * return None # <<<<<<<<<<<<<< @@ -9591,12 +9720,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":75 + /* "constraint/parser.py":76 * return split_restrictions * * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, MaxProdConstraint]]: # noqa: E501 + * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint]]: # noqa: E501 */ /* function exit code */ @@ -9647,7 +9776,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ return __pyx_r; } -/* "constraint/parser.py":245 +/* "constraint/parser.py":249 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< @@ -9696,39 +9825,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, 245, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 249, __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, 245, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 249, __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, 249, __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, 245, __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, 249, __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, 245, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_equality_constraint", 1, 2, 2, i); __PYX_ERR(0, 249, __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, 245, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 249, __pyx_L3_error) 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, 249, __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, 245, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("to_equality_constraint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 249, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9739,8 +9868,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, 246, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 246, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restriction), (&PyUnicode_Type), 0, "restriction", 2))) __PYX_ERR(0, 250, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 250, __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 */ @@ -9761,7 +9890,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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":264 +/* "constraint/parser.py":268 * 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): # <<<<<<<<<<<<<< @@ -9781,7 +9910,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_22to_equalit if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 264, __pyx_L1_error) + __PYX_ERR(0, 268, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -9792,7 +9921,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_22to_equalit __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_2generator10, ((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_to_equ, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 264, __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[11]), (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, 268, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -9831,21 +9960,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, 264, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 264, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 268, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 268, __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, 264, __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_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __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); @@ -9858,11 +9987,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit 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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __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, 264, __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, 264, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 268, __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, 268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { @@ -9903,7 +10032,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit return __pyx_r; } -/* "constraint/parser.py":245 +/* "constraint/parser.py":249 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< @@ -9938,7 +10067,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 245, __pyx_L1_error) + __PYX_ERR(0, 249, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -9949,7 +10078,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":250 + /* "constraint/parser.py":254 * """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): # <<<<<<<<<<<<<< @@ -9958,21 +10087,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, 250, __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, 254, __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, 250, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 254, __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, 250, __pyx_L1_error) + __PYX_ERR(0, 254, __pyx_L1_error) } - __pyx_t_3 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_3 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 254, __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":251 + /* "constraint/parser.py":255 * # check if all parameters are involved * if len(params) != len(tune_params): * return None # <<<<<<<<<<<<<< @@ -9983,7 +10112,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":250 + /* "constraint/parser.py":254 * """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): # <<<<<<<<<<<<<< @@ -9992,7 +10121,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":254 + /* "constraint/parser.py":258 * * # find whether (in)equalities appear in this restriction * equalities_found = re.findall("==", restriction) # <<<<<<<<<<<<<< @@ -10000,9 +10129,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, 254, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __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, 254, __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, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = 1; @@ -10022,13 +10151,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 254, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_equalities_found = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":255 + /* "constraint/parser.py":259 * # find whether (in)equalities appear in this restriction * equalities_found = re.findall("==", restriction) * inequalities_found = re.findall("!=", restriction) # <<<<<<<<<<<<<< @@ -10036,9 +10165,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, 255, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __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, 255, __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, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = 1; @@ -10058,37 +10187,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 255, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_inequalities_found = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":257 + /* "constraint/parser.py":261 * 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, 257, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 261, __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, 257, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_4))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __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, 257, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_inequalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 261, __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, 257, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBool_FromLong((!(!__pyx_t_4))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __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, 257, __pyx_L1_error) + __pyx_t_7 = PyNumber_Xor(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 261, __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, 257, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 261, __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":258 + /* "constraint/parser.py":262 * # 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 # <<<<<<<<<<<<<< @@ -10099,7 +10228,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":257 + /* "constraint/parser.py":261 * 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)): # <<<<<<<<<<<<<< @@ -10108,22 +10237,22 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":259 + /* "constraint/parser.py":263 * 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, 259, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 263, __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); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_equalities_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 263, __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); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_inequalities_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __pyx_t_6; __pyx_t_6 = 0; @@ -10131,29 +10260,29 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __pyx_v_comparator = __pyx_t_7; __pyx_t_7 = 0; - /* "constraint/parser.py":262 + /* "constraint/parser.py":266 * * # 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, 262, __pyx_L1_error) + __pyx_t_7 = PyUnicode_Split(__pyx_v_restriction, __Pyx_NoneAsNull(__pyx_v_comparator), -1L); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_splitted = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/parser.py":264 + /* "constraint/parser.py":268 * 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, 264, __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, 268, __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, 264, __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, 268, __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) { @@ -10161,28 +10290,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, 264, __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, 268, __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, 264, __pyx_L1_error) + __pyx_t_6 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __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, 264, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 268, __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":266 + /* "constraint/parser.py":270 * 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, 266, __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, 270, __pyx_L1_error) if (__pyx_t_9) { - /* "constraint/parser.py":267 + /* "constraint/parser.py":271 * # map to a Constraint * if comparator == "==": * return AllEqualConstraint() # <<<<<<<<<<<<<< @@ -10191,7 +10320,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, 267, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS @@ -10210,14 +10339,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 267, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/parser.py":266 + /* "constraint/parser.py":270 * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): * # map to a Constraint * if comparator == "==": # <<<<<<<<<<<<<< @@ -10226,17 +10355,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":268 + /* "constraint/parser.py":272 * 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, 268, __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, 272, __pyx_L1_error) if (__pyx_t_9) { - /* "constraint/parser.py":269 + /* "constraint/parser.py":273 * return AllEqualConstraint() * elif comparator == "!=": * return AllDifferentConstraint() # <<<<<<<<<<<<<< @@ -10245,7 +10374,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, 269, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS @@ -10264,14 +10393,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 269, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/parser.py":268 + /* "constraint/parser.py":272 * if comparator == "==": * return AllEqualConstraint() * elif comparator == "!=": # <<<<<<<<<<<<<< @@ -10280,7 +10409,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":270 + /* "constraint/parser.py":274 * elif comparator == "!=": * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") # <<<<<<<<<<<<<< @@ -10291,9 +10420,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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, 270, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 274, __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, 270, __pyx_L1_error) + __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, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = 1; @@ -10303,14 +10432,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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, 270, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/parser.py":264 + /* "constraint/parser.py":268 * 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): # <<<<<<<<<<<<<< @@ -10319,7 +10448,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":271 + /* "constraint/parser.py":275 * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") * return None # <<<<<<<<<<<<<< @@ -10330,7 +10459,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":245 + /* "constraint/parser.py":249 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< @@ -10360,7 +10489,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality } 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":274 +/* "constraint/parser.py":278 * * # remove functionally duplicate restrictions (preserves order and whitespace) * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< @@ -10380,7 +10509,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(CY if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 274, __pyx_L1_error) + __PYX_ERR(0, 278, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10388,7 +10517,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_12generator11, ((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_parse_restrictions_locals_genexp, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 274, __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[12]), (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, 278, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -10425,21 +10554,21 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator1 return NULL; } __pyx_L3_first_run:; - 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 (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 278, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 278, __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, 274, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 278, __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, 274, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __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); @@ -10484,7 +10613,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator1 return __pyx_r; } -/* "constraint/parser.py":27 +/* "constraint/parser.py":28 * ) * * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< @@ -10534,7 +10663,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, 27, __pyx_L1_error) + __PYX_ERR(0, 28, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10543,7 +10672,7 @@ 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":30 + /* "constraint/parser.py":31 * """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]*)" # <<<<<<<<<<<<<< @@ -10554,103 +10683,103 @@ 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":32 + /* "constraint/parser.py":33 * regex_match_variable = r"([a-zA-Z_$][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[13])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __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[13])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_replace_params = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":40 + /* "constraint/parser.py":41 * 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[14])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __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[14])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_replace_params_split = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":50 + /* "constraint/parser.py":51 * 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, 50, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __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, 50, __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, 50, __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[15])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __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, 51, __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, 51, __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[15])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __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":75 + /* "constraint/parser.py":76 * return split_restrictions * * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, MaxProdConstraint]]: # noqa: E501 + * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint]]: # noqa: E501 */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __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, 75, __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, 75, __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, 75, __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[16])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __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, 76, __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, 76, __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, 76, __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[16])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __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":245 + /* "constraint/parser.py":249 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __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, 245, __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, 245, __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, 245, __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[17])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __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, 249, __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, 249, __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, 249, __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[17])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __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":274 + /* "constraint/parser.py":278 * * # 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] */ - __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(NULL, __pyx_v_restrictions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __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, 278, __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, 274, __pyx_L1_error) + __pyx_t_1 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __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, 274, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "constraint/parser.py":276 + /* "constraint/parser.py":280 * if all(isinstance(r, str) for r in restrictions): * # clean the restriction strings to functional equivalence * restrictions_cleaned = [r.replace(' ', '') for r in restrictions] # <<<<<<<<<<<<<< @@ -10658,7 +10787,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * # 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, 276, __pyx_L6_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_v_restrictions; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; @@ -10666,22 +10795,22 @@ 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, 276, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 280, __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_4; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L6_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_r, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr14__pyx_v_r, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L6_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr14__pyx_v_r, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __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, 276, __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, 280, __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, 276, __pyx_L6_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 280, __pyx_L6_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -10695,7 +10824,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __pyx_v_restrictions_cleaned = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":277 + /* "constraint/parser.py":281 * # 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 # <<<<<<<<<<<<<< @@ -10709,16 +10838,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED 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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __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, 277, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __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":279 + /* "constraint/parser.py":283 * 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] # <<<<<<<<<<<<<< @@ -10726,7 +10855,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * */ { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __pyx_L13_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __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; @@ -10734,19 +10863,19 @@ 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, 279, __pyx_L13_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 283, __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_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L13_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 283, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_9genexpr15__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_9genexpr15__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L13_error) + __pyx_t_6 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyList_Type__index, __pyx_v_restrictions_cleaned, __pyx_9genexpr15__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 283, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 279, __pyx_L13_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 283, __pyx_L13_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10760,7 +10889,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __pyx_v_restrictions_unique_indices = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":280 + /* "constraint/parser.py":284 * # 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] # <<<<<<<<<<<<<< @@ -10768,7 +10897,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, 280, __pyx_L20_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __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; @@ -10776,19 +10905,19 @@ 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, 280, __pyx_L20_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 284, __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_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L20_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_9genexpr16__pyx_v_i, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_restrictions, __pyx_9genexpr16__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L20_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_restrictions, __pyx_9genexpr16__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 280, __pyx_L20_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 284, __pyx_L20_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10802,7 +10931,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __Pyx_DECREF_SET(__pyx_v_restrictions, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "constraint/parser.py":274 + /* "constraint/parser.py":278 * * # remove functionally duplicate restrictions (preserves order and whitespace) * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< @@ -10811,32 +10940,32 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":283 + /* "constraint/parser.py":287 * * # 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, 283, __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, 287, __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, 283, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_restrictions, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "constraint/parser.py":285 + /* "constraint/parser.py":289 * 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, 285, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_parsed_restrictions = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":286 + /* "constraint/parser.py":290 * # split into functions that only take their relevant parameters * parsed_restrictions = list() * for res in restrictions: # <<<<<<<<<<<<<< @@ -10845,7 +10974,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, 286, __pyx_L1_error) + __PYX_ERR(0, 290, __pyx_L1_error) } __pyx_t_2 = __pyx_v_restrictions; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; @@ -10853,32 +10982,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, 286, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 290, __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_4; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":287 + /* "constraint/parser.py":291 * 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, 287, __pyx_L1_error) + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __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":288 + /* "constraint/parser.py":292 * for res in restrictions: * params_used: set[str] = set() * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() # <<<<<<<<<<<<<< @@ -10886,9 +11015,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, 288, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 292, __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, 288, __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, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_7 = 1; @@ -10908,7 +11037,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __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_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, 288, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __pyx_t_5; @@ -10919,25 +11048,25 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __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_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, 288, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __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":289 + /* "constraint/parser.py":293 * 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, 289, __pyx_L1_error) + __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_v_params_used); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __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":290 + /* "constraint/parser.py":294 * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() * params_used_list = list(params_used) * finalized_constraint = None # <<<<<<<<<<<<<< @@ -10947,25 +11076,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":291 + /* "constraint/parser.py":295 * 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, 291, __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, 295, __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, 291, __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, 295, __pyx_L1_error) __pyx_t_3 = __pyx_t_11; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - /* "constraint/parser.py":293 + /* "constraint/parser.py":297 * if " or " not in res and " and " not in res: * # if applicable, strip the outermost round brackets * while ( # <<<<<<<<<<<<<< @@ -10974,16 +11103,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ while (1) { - /* "constraint/parser.py":294 + /* "constraint/parser.py":298 * # 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); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parsed_restriction, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __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, 294, __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, 298, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { } else { @@ -10991,16 +11120,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":295 + /* "constraint/parser.py":299 * 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); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parsed_restriction, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __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, 295, __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, 299, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { } else { @@ -11008,16 +11137,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":296 + /* "constraint/parser.py":300 * 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, 296, __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, 300, __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, 296, __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, 300, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { } else { @@ -11025,48 +11154,48 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":297 + /* "constraint/parser.py":301 * 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, 297, __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, 301, __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, 297, __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, 301, __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":299 + /* "constraint/parser.py":303 * 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, 299, __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, 303, __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":301 + /* "constraint/parser.py":305 * 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, 301, __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, 301, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_parsed_restriction))||((__pyx_v_parsed_restriction) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_parsed_restriction))) __PYX_ERR(0, 305, __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, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":302 + /* "constraint/parser.py":306 * # 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: # <<<<<<<<<<<<<< @@ -11076,20 +11205,20 @@ 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":304 + /* "constraint/parser.py":308 * 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, 304, __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, 304, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_parsed_restriction))||((__pyx_v_parsed_restriction) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_parsed_restriction))) __PYX_ERR(0, 308, __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, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":302 + /* "constraint/parser.py":306 * # 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: # <<<<<<<<<<<<<< @@ -11098,7 +11227,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":291 + /* "constraint/parser.py":295 * params_used_list = list(params_used) * finalized_constraint = None * if " or " not in res and " and " not in res: # <<<<<<<<<<<<<< @@ -11107,7 +11236,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":305 + /* "constraint/parser.py":309 * # 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: # <<<<<<<<<<<<<< @@ -11117,16 +11246,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":307 + /* "constraint/parser.py":311 * 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, 307, __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, 311, __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, 307, __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, 311, __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; @@ -11134,14 +11263,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, 307, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __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":305 + /* "constraint/parser.py":309 * # 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: # <<<<<<<<<<<<<< @@ -11150,25 +11279,25 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":308 + /* "constraint/parser.py":312 * # 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, 308, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __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, 308, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_finalized_constraint) != (0)) __PYX_ERR(0, 312, __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, 308, __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, 308, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_params_used_list) != (0)) __PYX_ERR(0, 312, __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, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/parser.py":286 + /* "constraint/parser.py":290 * # split into functions that only take their relevant parameters * parsed_restrictions = list() * for res in restrictions: # <<<<<<<<<<<<<< @@ -11178,7 +11307,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":310 + /* "constraint/parser.py":314 * parsed_restrictions.append((finalized_constraint, params_used_list)) * * return parsed_restrictions # <<<<<<<<<<<<<< @@ -11190,7 +11319,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __pyx_r = __pyx_v_parsed_restrictions; goto __pyx_L0; - /* "constraint/parser.py":27 + /* "constraint/parser.py":28 * ) * * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< @@ -11234,7 +11363,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED return __pyx_r; } -/* "constraint/parser.py":312 +/* "constraint/parser.py":316 * return parsed_restrictions * * def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 # <<<<<<<<<<<<<< @@ -11284,41 +11413,41 @@ 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, 312, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 316, __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, 312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 316, __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, 312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 316, __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, 312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 316, __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, 312, __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, 316, __pyx_L3_error) 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, 312, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("compile_to_constraints", 0, 2, 3, i); __PYX_ERR(0, 316, __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, 312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 316, __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, 312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 316, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 316, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -11330,7 +11459,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, 312, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compile_to_constraints", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 316, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11341,8 +11470,8 @@ 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, 312, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 312, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 316, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 316, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_2compile_to_constraints(__pyx_self, __pyx_v_constraints, __pyx_v_domains, __pyx_v_picklable); /* function exit code */ @@ -11391,7 +11520,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compile_to_constraints", 0); - /* "constraint/parser.py":323 + /* "constraint/parser.py":327 * 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 * parsed_restrictions = parse_restrictions(constraints, domains) # <<<<<<<<<<<<<< @@ -11399,7 +11528,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * 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, 323, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_parse_restrictions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -11418,25 +11547,25 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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_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, 323, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_parsed_restrictions = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":324 + /* "constraint/parser.py":328 * """ # noqa: E501 * parsed_restrictions = parse_restrictions(constraints, domains) * compiled_constraints: list[tuple[Constraint, list[str], Union[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, 324, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_compiled_constraints = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":325 + /* "constraint/parser.py":329 * parsed_restrictions = parse_restrictions(constraints, domains) * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: # <<<<<<<<<<<<<< @@ -11448,9 +11577,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, 325, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parsed_restrictions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __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, 325, __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, 329, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { @@ -11458,7 +11587,7 @@ 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, 325, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 329, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -11468,7 +11597,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN { 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, 325, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 329, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -11479,13 +11608,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __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, 325, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 329, __pyx_L1_error) PyErr_Clear(); } break; @@ -11498,7 +11627,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, 325, __pyx_L1_error) + __PYX_ERR(0, 329, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -11508,22 +11637,22 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __Pyx_INCREF(__pyx_t_7); } else { __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 329, __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, 325, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 329, __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, 325, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 329, __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); @@ -11531,7 +11660,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, 325, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 329, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -11539,7 +11668,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, 325, __pyx_L1_error) + __PYX_ERR(0, 329, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_restriction, __pyx_t_2); @@ -11547,7 +11676,7 @@ 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":326 + /* "constraint/parser.py":330 * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: * if isinstance(restriction, str): # <<<<<<<<<<<<<< @@ -11557,17 +11686,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":328 + /* "constraint/parser.py":332 * 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, 328, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_picklable); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 332, __pyx_L1_error) if (__pyx_t_10) { - /* "constraint/parser.py":329 + /* "constraint/parser.py":333 * # if it's a string, wrap it in a (compilable or compiled) function constraint * if picklable: * constraint = CompilableFunctionConstraint(restriction) # <<<<<<<<<<<<<< @@ -11575,7 +11704,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, 329, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -11594,13 +11723,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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_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, 329, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":328 + /* "constraint/parser.py":332 * if isinstance(restriction, str): * # if it's a string, wrap it in a (compilable or compiled) function constraint * if picklable: # <<<<<<<<<<<<<< @@ -11610,7 +11739,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L8; } - /* "constraint/parser.py":331 + /* "constraint/parser.py":335 * constraint = CompilableFunctionConstraint(restriction) * else: * code_object = compile(restriction, "", "exec") # <<<<<<<<<<<<<< @@ -11627,13 +11756,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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_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, 331, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 335, __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":332 + /* "constraint/parser.py":336 * else: * code_object = compile(restriction, "", "exec") * func = FunctionType(code_object.co_consts[0], globals()) # <<<<<<<<<<<<<< @@ -11641,14 +11770,14 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * 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, 332, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __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, 332, __pyx_L1_error) + __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, 336, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 332, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 336, __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, 332, __pyx_L1_error) + __pyx_t_8 = __Pyx_Globals(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -11669,13 +11798,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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, 332, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":333 + /* "constraint/parser.py":337 * code_object = compile(restriction, "", "exec") * func = FunctionType(code_object.co_consts[0], globals()) * constraint = FunctionConstraint(func) # <<<<<<<<<<<<<< @@ -11683,7 +11812,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * 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, 333, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -11702,7 +11831,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_3); @@ -11710,28 +11839,28 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN } __pyx_L8:; - /* "constraint/parser.py":334 + /* "constraint/parser.py":338 * 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, 334, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 338, __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, 334, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 338, __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, 334, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_params_used) != (0)) __PYX_ERR(0, 338, __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, 334, __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, 334, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_restriction) != (0)) __PYX_ERR(0, 338, __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, 338, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":326 + /* "constraint/parser.py":330 * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: * if isinstance(restriction, str): # <<<<<<<<<<<<<< @@ -11741,41 +11870,41 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L7; } - /* "constraint/parser.py":335 + /* "constraint/parser.py":339 * 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, 335, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 339, __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, 335, __pyx_L1_error) + __pyx_t_10 = PyObject_IsInstance(__pyx_v_restriction, __pyx_t_3); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(__pyx_t_10)) { - /* "constraint/parser.py":337 + /* "constraint/parser.py":341 * 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, 337, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __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, 337, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_restriction) != (0)) __PYX_ERR(0, 341, __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, 337, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_params_used) != (0)) __PYX_ERR(0, 341, __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, 337, __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, 337, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None) != (0)) __PYX_ERR(0, 341, __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, 341, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":335 + /* "constraint/parser.py":339 * constraint = FunctionConstraint(func) * compiled_constraints.append((constraint, params_used, restriction)) * elif isinstance(restriction, Constraint): # <<<<<<<<<<<<<< @@ -11785,7 +11914,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L7; } - /* "constraint/parser.py":339 + /* "constraint/parser.py":343 * compiled_constraints.append((restriction, params_used, None)) * else: * raise ValueError(f"Restriction {restriction} is neither a string or Constraint {type(restriction)}") # <<<<<<<<<<<<<< @@ -11796,16 +11925,16 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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, 339, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_restriction, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 343, __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, 339, __pyx_L1_error) + __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, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_Restriction; __pyx_t_13[1] = __pyx_t_11; __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, 339, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -11816,16 +11945,16 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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, 339, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __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, 339, __pyx_L1_error) + __PYX_ERR(0, 343, __pyx_L1_error) } __pyx_L7:; - /* "constraint/parser.py":325 + /* "constraint/parser.py":329 * parsed_restrictions = parse_restrictions(constraints, domains) * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: # <<<<<<<<<<<<<< @@ -11835,7 +11964,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":342 + /* "constraint/parser.py":346 * * # return the restrictions and used parameters * return compiled_constraints # <<<<<<<<<<<<<< @@ -11845,7 +11974,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __pyx_r = __pyx_v_compiled_constraints; goto __pyx_L0; - /* "constraint/parser.py":312 + /* "constraint/parser.py":316 * return parsed_restrictions * * def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 # <<<<<<<<<<<<<< @@ -14453,15 +14582,15 @@ 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, 27, __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, 27, __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, 28, __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, 28, __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, 27, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions) < 0) __PYX_ERR(0, 28, __pyx_L1_error) #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)) { @@ -14469,15 +14598,15 @@ 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, 75, __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, 75, __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, 76, __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, 76, __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, 75, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint) < 0) __PYX_ERR(0, 76, __pyx_L1_error) #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)) { @@ -14485,15 +14614,15 @@ 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, 80, __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, 80, __pyx_L1_error) + __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, 81, __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, 81, __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, 80, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 81, __pyx_L1_error) #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)) { @@ -14501,15 +14630,15 @@ 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, 80, __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, 80, __pyx_L1_error) + __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, 81, __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, 81, __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, 80, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 81, __pyx_L1_error) #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)) { @@ -14517,15 +14646,15 @@ 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, 91, __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, 91, __pyx_L1_error) + __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, 92, __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, 92, __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, 91, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 92, __pyx_L1_error) #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)) { @@ -14533,15 +14662,15 @@ 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, 95, __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, 95, __pyx_L1_error) + __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, 96, __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, 96, __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, 95, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 96, __pyx_L1_error) #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)) { @@ -14549,15 +14678,15 @@ 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, 96, __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, 96, __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, 97, __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, 97, __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, 96, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 97, __pyx_L1_error) #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)) { @@ -14565,15 +14694,15 @@ 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, 134, __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, 134, __pyx_L1_error) + __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, 135, __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, 135, __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, 134, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 135, __pyx_L1_error) #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)) { @@ -14581,15 +14710,15 @@ 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, 155, __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, 155, __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, 156, __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, 156, __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, 155, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(0, 156, __pyx_L1_error) #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)) { @@ -14597,15 +14726,15 @@ 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, 157, __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, 157, __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, 158, __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, 158, __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, 157, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr) < 0) __PYX_ERR(0, 158, __pyx_L1_error) #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)) { @@ -14613,15 +14742,15 @@ 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, 215, __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, 215, __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, 219, __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, 219, __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, 215, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr) < 0) __PYX_ERR(0, 219, __pyx_L1_error) #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)) { @@ -14629,15 +14758,15 @@ 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_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, 222, __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, 222, __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, 226, __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, 226, __pyx_L1_error) #else __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_genexpr) < 0) __PYX_ERR(0, 222, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr) < 0) __PYX_ERR(0, 226, __pyx_L1_error) #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_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -14645,15 +14774,15 @@ 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_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, 245, __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, 245, __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, 249, __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, 249, __pyx_L1_error) #else __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_to_equality_constraint) < 0) __PYX_ERR(0, 245, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint) < 0) __PYX_ERR(0, 249, __pyx_L1_error) #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_to_equality_constraint->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint->tp_getattro == PyObject_GenericGetAttr)) { @@ -14661,15 +14790,15 @@ 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_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, 264, __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, 264, __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, 268, __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, 268, __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, 264, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr) < 0) __PYX_ERR(0, 268, __pyx_L1_error) #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)) { @@ -14677,15 +14806,15 @@ 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_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, 274, __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, 274, __pyx_L1_error) + __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, 278, __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, 278, __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, 274, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_14_genexpr) < 0) __PYX_ERR(0, 278, __pyx_L1_error) #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)) { @@ -15064,7 +15193,7 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); * AllEqualConstraint, * Constraint, */ - __pyx_t_2 = __Pyx_PyList_Pack(14, __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); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_Pack(15, __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); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "constraint/parser.py":5 @@ -15133,45 +15262,49 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); __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) + __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) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":27 + /* "constraint/parser.py":28 * ) * * 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 */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __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, 27, __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, 27, __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, 27, __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[18])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) + 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, 28, __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, 28, __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, 28, __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[18])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __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, 27, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_parse_restrictions, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":312 + /* "constraint/parser.py":316 * return parsed_restrictions * * 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, 312, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __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, 312, __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, 312, __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, 312, __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[19])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error) + 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, 316, __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, 316, __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, 316, __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[19])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __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); __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, 312, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_compile_to_constraints, __pyx_t_3) < 0) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/parser.py":1 @@ -15220,11 +15353,11 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); typedef struct { const char *s; -#if 210 <= 65535 +#if 239 <= 65535 const unsigned short n; -#elif 210 / 2 < INT_MAX +#elif 239 / 2 < INT_MAX const unsigned int n; -#elif 210 / 2 < LONG_MAX +#elif 239 / 2 < LONG_MAX const unsigned long n; #else const Py_ssize_t n; @@ -15268,6 +15401,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_VariableMaxSumConstraint, sizeof(__pyx_k_VariableMaxSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMaxSumConstraint */ {__pyx_k_VariableMinSumConstraint, sizeof(__pyx_k_VariableMinSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMinSumConstraint */ @@ -15446,11 +15580,11 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, c 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, 66, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 211, __pyx_L1_error) - __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_eval); if (!__pyx_builtin_eval) __PYX_ERR(0, 140, __pyx_L1_error) - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 141, __pyx_L1_error) - __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_compile); if (!__pyx_builtin_compile) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_eval); if (!__pyx_builtin_eval) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_compile); if (!__pyx_builtin_compile) __PYX_ERR(0, 335, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -15462,83 +15596,83 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "constraint/parser.py":114 + /* "constraint/parser.py":115 * # e.g. "G == B-M" becomes "G+M == B" * right_remainder = right[len(swapped_side_first_variable):] * left_swap = right_remainder.replace("-", "+") # <<<<<<<<<<<<<< * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" * 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, 114, __pyx_L1_error) + __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, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); - /* "constraint/parser.py":125 + /* "constraint/parser.py":126 * # e.g. "G == B/M" becomes "G*M == B" * right_remainder = right[len(swapped_side_first_variable):] * left_swap = right_remainder.replace("/", "*") # <<<<<<<<<<<<<< * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" * 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, 125, __pyx_L1_error) + __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, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); - /* "constraint/parser.py":161 + /* "constraint/parser.py":162 * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": * 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) */ - __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, 161, __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, 162, __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, 161, __pyx_L1_error) + __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, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[1]); - /* "constraint/parser.py":276 + /* "constraint/parser.py":280 * 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 * # 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, 276, __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, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); - /* "constraint/parser.py":297 + /* "constraint/parser.py":301 * 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, 297, __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, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[2]); - /* "constraint/parser.py":299 + /* "constraint/parser.py":303 * 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, 299, __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, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[3]); - /* "constraint/parser.py":312 + /* "constraint/parser.py":316 * return parsed_restrictions * * 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_mstate_global->__pyx_tuple[3] = PyTuple_Pack(1, ((PyObject*)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 312, __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, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_RefNannyFinishContext(); @@ -15591,102 +15725,102 @@ 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), 80, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 81, 2}; 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 80, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 81, 2}; 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 91, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 92, 2}; 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; } { - 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), 96, 2}; 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_1_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, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 96, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 97, 2}; 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_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), 134, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 135, 2}; 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_q, 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), 155, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 156, 2}; 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__25, 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), 157, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 158, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; __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_A_2, 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), 215, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 219, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_o}; __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_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), 222, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 226, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; __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_k__26, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 137, 45}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 138, 45}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s, __pyx_mstate->__pyx_n_u_number}; __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_is_or_evals_to_number, __pyx_k_XQ_Qa_z_5_q_q, 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), 264, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 268, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; __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__26, 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), 274, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 278, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_r}; __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_genexpr, __pyx_k_Q_2, 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), 32, 50}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 33, 50}; 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, __pyx_k_A_l_4s_Cq_2V2Q_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, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 40, 50}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 41, 50}; 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[14] = __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[14])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 50, 251}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 51, 251}; 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[15] = __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[15])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 40, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 75, 1584}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 40, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 76, 1692}; 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_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_variable, __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_number, __pyx_mstate->__pyx_n_u_number_is_int, __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_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_global->__pyx_codeobj_tab[16] = __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[16])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 245, 222}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 249, 222}; 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[17] = __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[17])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 27, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 27, 386}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 27, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 28, 386}; 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_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[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_parse_restrictions, __pyx_k_Ya_1_Q2_U_P_U_6_Q_q_t4uA_d_4y_a, 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_parse_restrictions, __pyx_k_Ya_1_Q2_U_V_U_6_Q_q_t4uA_d_4y_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 312, 177}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 316, 177}; 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[19] = __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[19])) goto bad; } diff --git a/constraint/parser.py b/constraint/parser.py index d7db645..85ef25a 100644 --- a/constraint/parser.py +++ b/constraint/parser.py @@ -17,6 +17,7 @@ VariableExactSumConstraint, VariableMinSumConstraint, VariableMaxSumConstraint, + VariableExactProdConstraint, # TODO implement parsing for these constraints: # InSetConstraint, # NotInSetConstraint, @@ -74,7 +75,7 @@ def to_multiple_restrictions(restrictions: list[str]) -> list[str]: def to_numeric_constraint( restriction: str, params: list[str] - ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, MaxProdConstraint]]: # noqa: E501 + ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint]]: # 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): @@ -149,7 +150,7 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: 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] # find all unique variable_supported_operators in the restriction, can have at most one unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) @@ -165,6 +166,9 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: 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 next(iter(unique_operators)) == "*": + if comparator == "==": + return VariableExactProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactProdConstraint(variables[0], variables[1:]) # noqa: E501 # left_num and right_num can't be both None or both a constant return None From 5538239f12ff7ae675671793cb73b9655f2bbdfc Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Tue, 10 Jun 2025 10:21:26 +0200 Subject: [PATCH 26/87] Added test for VariableExactProdConstraint --- tests/test_parser.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_parser.py b/tests/test_parser.py index ca1c3e5..b595573 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -1,4 +1,4 @@ -from constraint import compile_to_constraints, parse_restrictions, Constraint, FunctionConstraint, CompilableFunctionConstraint, ExactProdConstraint, MinProdConstraint, MaxProdConstraint, ExactSumConstraint, VariableExactSumConstraint +from constraint import compile_to_constraints, parse_restrictions, Constraint, FunctionConstraint, CompilableFunctionConstraint, ExactProdConstraint, MinProdConstraint, MaxProdConstraint, ExactSumConstraint, VariableExactSumConstraint, VariableExactProdConstraint from collections.abc import Iterable def test_parse_restrictions(): @@ -37,7 +37,7 @@ def test_parse_restrictions(): def test_compile_to_constraints(): domains = {"x": [50, 100], "y": [0, 1]} - constraints = ["x != 320", "y == 0 or x % 32 != 0", "50 <= x * y < 100", "x == 100", "x == x+y", "100 == x-y", "x / y == 100"] # TODO change the last one to "x / y == x" once VarProd implemented + constraints = ["x != 320", "y == 0 or x % 32 != 0", "50 <= x * y < 100", "x == 100", "x == x+y", "100 == x-y", "x / y == 100", "x / y == x"] expected_constraint_types = [ FunctionConstraint, FunctionConstraint, @@ -47,6 +47,7 @@ def test_compile_to_constraints(): VariableExactSumConstraint, ExactSumConstraint, ExactProdConstraint, + VariableExactProdConstraint, ] compiled = compile_to_constraints(constraints, domains, picklable=False) From a3c115995bb28fde81b716ea18f7187e0adae0f6 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Tue, 10 Jun 2025 10:22:10 +0200 Subject: [PATCH 27/87] Implemented the VariableMinProdConstraint --- constraint/constraints.py | 186 ++++++++++++++++++++++++++++---------- 1 file changed, 140 insertions(+), 46 deletions(-) diff --git a/constraint/constraints.py b/constraint/constraints.py index fd7542b..ef6992d 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -931,6 +931,146 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar return True +class MinProdConstraint(Constraint): + """Constraint enforcing that values of given variables create a product up to at least a given amount. + + Example: + >>> problem = Problem() + >>> problem.addVariables(["a", "b"], [1, 2]) + >>> 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)]] + """ + + def __init__(self, minprod: Union[int, float]): + """Instantiate a MinProdConstraint. + + Args: + 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 + Constraint.preProcess(self, variables, domains, constraints, vconstraints) + + # prune the associated variables of values > minprod + minprod = self._minprod + for variable in variables: + domain = domains[variable] + for value in domain[:]: + if value == 0 and minprod > 0: + 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: + if variable not in assignments: + return True + + # with each variable assigned, sum the values + minprod = self._minprod + prod = 1 + for variable in variables: + prod *= assignments[variable] + if isinstance(prod, float): + prod = round(prod, 10) + return prod >= minprod + + +class VariableMinProdConstraint(Constraint): + """Constraint enforcing that the product of variables is at least the value of another variable. + + Example: + >>> problem = Problem() + >>> problem.addVariables(["a", "b", "c"], [-1, 2]) + >>> 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)]] + """ + + def __init__(self, target_var: str, product_vars: Sequence[str]): + self.target_var = target_var + self.product_vars = product_vars + + def _get_product_bounds(self, domain_dict, exclude_var=None): + bounds = [] + for var in self.product_vars: + if var == exclude_var: + continue + dom = domain_dict[var] + bounds.append((min(dom), max(dom))) + + if not bounds: + return 1, 1 + + # 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] + return min(products), max(products) + + def _safe_product(self, values): + prod = 1 + for v in values: + prod *= v + return prod + + def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): + Constraint.preProcess(self, variables, domains, constraints, vconstraints) + target_dom = domains[self.target_var] + t_min, t_max = min(target_dom), max(target_dom) + + 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] + if max(possible_prods) < t_min: + dom.remove(val) + + def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): + if self.target_var not in assignments: + return True # Can't evaluate yet + + target_value = assignments[self.target_var] + assigned_prod = 1 + unassigned = [] + + for var in self.product_vars: + if var in assignments: + assigned_prod *= assignments[var] + else: + unassigned.append(var) + + if not unassigned: + return assigned_prod >= target_value + + # 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])] + possible_prods = [assigned_prod * c for c in candidates] + if max(possible_prods) < target_value: + return False + + if forwardcheck: + 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])] + else: + other_products = [1] + + 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): + domain.hideValue(val) + if not domain: + return False + + return True + + class MaxProdConstraint(Constraint): """Constraint enforcing that values of given variables create a product up to at most a given amount. @@ -1006,52 +1146,6 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar return True -class MinProdConstraint(Constraint): - """Constraint enforcing that values of given variables create a product up to at least a given amount. - - Example: - >>> problem = Problem() - >>> problem.addVariables(["a", "b"], [1, 2]) - >>> 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)]] - """ - - def __init__(self, minprod: Union[int, float]): - """Instantiate a MinProdConstraint. - - Args: - 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 - Constraint.preProcess(self, variables, domains, constraints, vconstraints) - - # prune the associated variables of values > minprod - minprod = self._minprod - for variable in variables: - domain = domains[variable] - for value in domain[:]: - if value == 0 and minprod > 0: - 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: - if variable not in assignments: - return True - - # with each variable assigned, sum the values - minprod = self._minprod - prod = 1 - for variable in variables: - prod *= assignments[variable] - if isinstance(prod, float): - prod = round(prod, 10) - return prod >= minprod - - class InSetConstraint(Constraint): """Constraint enforcing that values of given variables are present in the given set. From 022c55d63658acfc8bf8b028c130a3463ceab8ee Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Tue, 10 Jun 2025 10:42:13 +0200 Subject: [PATCH 28/87] Implemented the VariableMaxProdConstraint --- constraint/constraints.py | 94 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/constraint/constraints.py b/constraint/constraints.py index ef6992d..b7841cf 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -1146,6 +1146,100 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar return True +class VariableMaxProdConstraint(Constraint): + """Constraint enforcing that the product of variables is at most the value of another variable. + + Example: + >>> problem = Problem() + >>> problem.addVariables(["a", "b", "c"], [-1, 2]) + >>> 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)]] + """ # noqa: E501 + + def __init__(self, target_var: str, product_vars: Sequence[str]): + self.target_var = target_var + self.product_vars = product_vars + + def _get_product_bounds(self, domain_dict, exclude_var=None): + bounds = [] + for var in self.product_vars: + if var == exclude_var: + continue + dom = domain_dict[var] + bounds.append((min(dom), max(dom))) + + if not bounds: + return 1, 1 + + # 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] + return min(products), max(products) + + def _safe_product(self, values): + prod = 1 + for v in values: + prod *= v + return prod + + def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): + Constraint.preProcess(self, variables, domains, constraints, vconstraints) + target_dom = domains[self.target_var] + t_min, t_max = min(target_dom), max(target_dom) + + 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] + if min(possible_prods) > t_max: + dom.remove(val) + + def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): + if self.target_var not in assignments: + return True # Can't evaluate yet + + target_value = assignments[self.target_var] + assigned_prod = 1 + unassigned = [] + + for var in self.product_vars: + if var in assignments: + assigned_prod *= assignments[var] + else: + unassigned.append(var) + + if not unassigned: + return assigned_prod <= target_value + + # 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])] + possible_prods = [assigned_prod * c for c in candidates] + if min(possible_prods) > target_value: + return False + + if forwardcheck: + 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])] + else: + other_products = [1] + + 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): + domain.hideValue(val) + if not domain: + return False + + return True + + class InSetConstraint(Constraint): """Constraint enforcing that values of given variables are present in the given set. From ae977941a7f9fcc14b589de08a2ddaab238ed84d Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Sat, 14 Jun 2025 20:13:37 +0200 Subject: [PATCH 29/87] Implemented parsing for the VariableMinProdConstraint and VariableMaxProdConstraint, various other imrovements to numerical constraints parser --- constraint/parser.py | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/constraint/parser.py b/constraint/parser.py index 85ef25a..dae6c31 100644 --- a/constraint/parser.py +++ b/constraint/parser.py @@ -18,6 +18,8 @@ VariableMinSumConstraint, VariableMaxSumConstraint, VariableExactProdConstraint, + VariableMinProdConstraint, + VariableMaxProdConstraint, # TODO implement parsing for these constraints: # InSetConstraint, # NotInSetConstraint, @@ -93,12 +95,14 @@ def to_numeric_constraint( # if we have an inverse operation, rewrite to the other side supported_operators = ["**", "*", "+", "-", "/"] - unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) - unique_operators_right = set(s.strip() for s in list(right) if s in 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" - if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: + 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 + 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 @@ -133,6 +137,11 @@ def to_numeric_constraint( # 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] + 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]]: @@ -151,13 +160,18 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: 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 = ['+', '*'] - variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] + # variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] + # TODO find all variables using regex_match_variable + variables = re.findall(regex_match_variable, restriction) + # find all unique variable_supported_operators in the restriction, can have at most one - unique_operators = set(s.strip() for s in list(left + 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 - if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 - variables_on_left = len(right) == 1 - if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": + 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 elif comparator == "<=": @@ -166,11 +180,17 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: 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 next(iter(unique_operators)) == "*": + 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 VariableMaxProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMinProdConstraint(variables[0], variables[1:]) + 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:]) - # left_num and right_num can't be both None or both a constant + # left_num and right_num can't both be constants, or there is some other reason we can't use a VariableConstraint return None # if one side is a number, the other side must be a variable or expression From 3859dc67ea799c718e1c18a117b434946c248bbb Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Mon, 16 Jun 2025 10:08:05 +0200 Subject: [PATCH 30/87] Extended tests for parser --- tests/test_parser.py | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/tests/test_parser.py b/tests/test_parser.py index b595573..de2c3aa 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -1,4 +1,5 @@ -from constraint import compile_to_constraints, parse_restrictions, Constraint, FunctionConstraint, CompilableFunctionConstraint, ExactProdConstraint, MinProdConstraint, MaxProdConstraint, ExactSumConstraint, VariableExactSumConstraint, VariableExactProdConstraint +from constraint import ( + compile_to_constraints, parse_restrictions, Constraint, FunctionConstraint, CompilableFunctionConstraint, ExactProdConstraint, MinProdConstraint, MaxProdConstraint, ExactSumConstraint, VariableExactSumConstraint, VariableExactProdConstraint, VariableMinProdConstraint, VariableMaxProdConstraint, MaxSumConstraint) from collections.abc import Iterable def test_parse_restrictions(): @@ -37,7 +38,19 @@ def test_parse_restrictions(): def test_compile_to_constraints(): domains = {"x": [50, 100], "y": [0, 1]} - constraints = ["x != 320", "y == 0 or x % 32 != 0", "50 <= x * y < 100", "x == 100", "x == x+y", "100 == x-y", "x / y == 100", "x / y == x"] + constraints = [ + "x != 320", + "y == 0 or x % 32 != 0", + "50 <= x * y < 100", # turns into MinProdConstraint and MaxProdConstraint + "x == 100", + "x == x+y", + "100-y >= x", + "100 == x-y", + "x / y == 100", + "x / y == x", + "x / y <= x", + "x / y >= x", + ] expected_constraint_types = [ FunctionConstraint, FunctionConstraint, @@ -45,13 +58,18 @@ def test_compile_to_constraints(): MaxProdConstraint, ExactSumConstraint, VariableExactSumConstraint, - ExactSumConstraint, - ExactProdConstraint, + 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" VariableExactProdConstraint, + VariableMinProdConstraint, + VariableMaxProdConstraint, ] compiled = compile_to_constraints(constraints, domains, picklable=False) + assert len(compiled) == len(expected_constraint_types) for r, vals, r_str in compiled: + print(r, vals, r_str) assert isinstance(r, Constraint) assert isinstance(vals, Iterable) and all(isinstance(v, str) for v in vals) if isinstance(r, (FunctionConstraint, CompilableFunctionConstraint)): @@ -60,12 +78,11 @@ def test_compile_to_constraints(): assert r_str is None # check whether the expected types match (may have to be adjusted to be order independent in future) - for i, (r, _, _) in enumerate(compiled): + 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]}" if callable(expected): assert callable(r) - else: - assert isinstance(r, expected) def test_compile_to_constraints_picklable(): domains = {"x": [50, 100], "y": [0, 1]} @@ -78,6 +95,7 @@ def test_compile_to_constraints_picklable(): ] compiled = compile_to_constraints(constraints, domains, picklable=True) + assert len(compiled) == len(expected_constraint_types) for r, vals, r_str in compiled: assert isinstance(r, Constraint) assert isinstance(vals, Iterable) and all(isinstance(v, str) for v in vals) From 69adde91723dd36c4ec3309b58f742945b333fca Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Mon, 16 Jun 2025 10:17:43 +0200 Subject: [PATCH 31/87] Improved parsing and rewriting of constraints containing constants --- constraint/parser.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/constraint/parser.py b/constraint/parser.py index dae6c31..d24c5a5 100644 --- a/constraint/parser.py +++ b/constraint/parser.py @@ -31,6 +31,7 @@ def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple """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]*)" def replace_params(match_object): key = match_object.group(1) @@ -83,6 +84,7 @@ def to_numeric_constraint( if len(params) == 0 or not all(all(isinstance(v, (int, float)) for v in tune_params[p]) for p in params): return None + restriction_unmodified = restriction comparators = ["<=", "==", ">=", ">", "<"] comparators_found = re.findall("|".join(comparators), restriction) # check if there is exactly one comparator, if not, return None @@ -106,34 +108,34 @@ 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_variable = re.search(regex_match_variable, left if variables_on_left else right) - if swapped_side_first_variable is None: + swapped_side_first_component = re.search(regex_match_variable_or_constant, left if variables_on_left else right) + if swapped_side_first_component is None: # if there is no variable on the left side, we can't handle this yet return None else: - swapped_side_first_variable = swapped_side_first_variable.group(0) + swapped_side_first_component = swapped_side_first_component.group(0) 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_variable):] + right_remainder = right[len(swapped_side_first_component):] left_swap = right_remainder.replace("-", "+") - restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" + 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_variable):] + left_remainder = left[len(swapped_side_first_component):] right_swap = left_remainder.replace("-", "+") - restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" + 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_variable):] + right_remainder = right[len(swapped_side_first_component):] left_swap = right_remainder.replace("/", "*") - restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" + 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_variable):] + left_remainder = left[len(swapped_side_first_component):] right_swap = left_remainder.replace("/", "*") - restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" + 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)) @@ -161,7 +163,6 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # if both sides are parameters, try to use the VariableConstraints variable_supported_operators = ['+', '*'] # variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] - # TODO find all variables using regex_match_variable variables = re.findall(regex_match_variable, restriction) # find all unique variable_supported_operators in the restriction, can have at most one @@ -199,6 +200,7 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: ) # if the number is an integer, we can map '>' to '>=' and '<' to '<=' by changing the number (does not work with floating points!) # noqa: E501 + # TODO instead use the smallest floating point difference in Python / ^-10 number_is_int = isinstance(number, int) if number_is_int: if comparator == "<": From 7bc9d320d181386a21e5541d7a2cd15503ed95e3 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Mon, 16 Jun 2025 10:42:41 +0200 Subject: [PATCH 32/87] Improved codestyle to be linting-compliant --- constraint/constraints.py | 16 ++++++++-------- constraint/parser.py | 11 +++++------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/constraint/constraints.py b/constraint/constraints.py index b7841cf..e5383e0 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -988,7 +988,7 @@ class VariableMinProdConstraint(Constraint): [[('a', -1), ('b', -1), ('c', -1)], [('a', 2), ('b', 2), ('c', -1)], [('a', 2), ('b', 2), ('c', 2)]] """ - def __init__(self, target_var: str, product_vars: Sequence[str]): + def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 self.target_var = target_var self.product_vars = product_vars @@ -1014,10 +1014,10 @@ def _safe_product(self, values): prod *= v return prod - def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): + 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, t_max = min(target_dom), max(target_dom) + t_min = min(target_dom) for var in self.product_vars: min_others, max_others = self._get_product_bounds(domains, exclude_var=var) @@ -1027,7 +1027,7 @@ def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple if max(possible_prods) < t_min: dom.remove(val) - def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): + 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 @@ -1157,7 +1157,7 @@ class VariableMaxProdConstraint(Constraint): [[('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)]] """ # noqa: E501 - def __init__(self, target_var: str, product_vars: Sequence[str]): + def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 self.target_var = target_var self.product_vars = product_vars @@ -1183,10 +1183,10 @@ def _safe_product(self, values): prod *= v return prod - def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): + 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, t_max = min(target_dom), max(target_dom) + t_max = max(target_dom) for var in self.product_vars: min_others, max_others = self._get_product_bounds(domains, exclude_var=var) @@ -1196,7 +1196,7 @@ def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple if min(possible_prods) > t_max: dom.remove(val) - def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): + 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 diff --git a/constraint/parser.py b/constraint/parser.py index d24c5a5..6eff77e 100644 --- a/constraint/parser.py +++ b/constraint/parser.py @@ -78,13 +78,12 @@ def to_multiple_restrictions(restrictions: list[str]) -> list[str]: def to_numeric_constraint( restriction: str, params: list[str] - ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint]]: # noqa: E501 + ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, VariableMinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint, VariableMaxProdConstraint]]: # 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): return None - restriction_unmodified = restriction comparators = ["<=", "==", ">=", ">", "<"] comparators_found = re.findall("|".join(comparators), restriction) # check if there is exactly one comparator, if not, return None @@ -108,7 +107,7 @@ 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) + 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 @@ -186,12 +185,12 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: 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:]) + 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:]) + 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 there is some other reason we can't use a VariableConstraint + # left_num and right_num can't both be constants, or for other reasons we can't use a VariableConstraint return None # if one side is a number, the other side must be a variable or expression From c4fefd2bb4e9252f115fb2656a4b3916d1897f79 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Mon, 16 Jun 2025 10:43:07 +0200 Subject: [PATCH 33/87] Re-cythonized after major changes --- constraint/constraints.c | 14450 ++++++++++++++++++++++++++++--------- constraint/domain.c | 250 +- constraint/parser.c | 5744 ++++++++------- constraint/problem.c | 312 +- constraint/solvers.c | 354 +- 5 files changed, 14885 insertions(+), 6225 deletions(-) diff --git a/constraint/constraints.c b/constraint/constraints.c index c716952..8859c2f 100644 --- a/constraint/constraints.c +++ b/constraint/constraints.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.1.1 */ +/* Generated by Cython 3.1.2 */ /* BEGIN: Cython Metadata { @@ -29,8 +29,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x03080000 #error Cython requires Python 3.8+. #else -#define __PYX_ABI_VERSION "3_1_1" -#define CYTHON_HEX_VERSION 0x030101F0 +#define __PYX_ABI_VERSION "3_1_2" +#define CYTHON_HEX_VERSION 0x030102F0 #define CYTHON_FUTURE_DIVISION 1 /* CModulePreamble */ #include @@ -445,7 +445,7 @@ END: Cython Metadata */ #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON +# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED @@ -890,11 +890,19 @@ 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_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS +#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 + #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_GetItem(o, i) + #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) + #else + #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) #endif #else #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) @@ -1302,7 +1310,9 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #endif /* __GNUC__ */ /* PretendToInitialize */ #ifdef __cplusplus +#if __cplusplus > 201103L #include +#endif template static void __Pyx_pretend_to_initialize(T* ptr) { #if __cplusplus > 201103L @@ -1511,7 +1521,11 @@ 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_genexpr; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__; +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; /* "constraint/constraints.py":64 * vconstraints[variable].remove((self, variables)) @@ -1773,19 +1787,75 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr { }; -/* "constraint/constraints.py":960 +/* "constraint/constraints.py":1030 + * 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__ { + PyObject_HEAD + PyObject *__pyx_v_target_value; +}; + + +/* "constraint/constraints.py":1066 + * 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 { + PyObject_HEAD + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__ *__pyx_outer_scope; + PyObject *__pyx_genexpr_arg_0; + PyObject *__pyx_v_p; +}; + + +/* "constraint/constraints.py":1100 * 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_16_genexpr { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_value; }; + +/* "constraint/constraints.py":1199 + * 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_19___call__ { + PyObject_HEAD + PyObject *__pyx_v_target_value; +}; + + +/* "constraint/constraints.py":1235 + * 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_20_genexpr { + PyObject_HEAD + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *__pyx_outer_scope; + PyObject *__pyx_genexpr_arg_0; + PyObject *__pyx_v_p; +}; + /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ @@ -2099,18 +2169,18 @@ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int 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)\ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (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)\ +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (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)\ +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) @@ -2430,6 +2500,15 @@ 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 */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp); +#endif + +/* SetItemOnTypeDict.proto */ +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); @@ -2457,7 +2536,11 @@ static PyObject *__Pyx_FetchSharedCythonABIModule(void); static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type); /* FetchCommonType.proto */ -static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); +static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases); + +/* CommonTypesMetaclass.proto */ +static int __pyx_CommonTypesMetaclass_init(PyObject *module); +#define __Pyx_CommonTypesMetaclass_USED /* PyMethodNew.proto */ static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); @@ -2791,6 +2874,7 @@ static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *clos #if __PYX_HAS_PY_AM_SEND == 2 static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send); #endif +static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg); /* Generator.proto */ #define __Pyx_Generator_USED @@ -2882,6 +2966,7 @@ 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"; @@ -2903,6 +2988,7 @@ 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"; @@ -2927,8 +3013,11 @@ 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"; @@ -2960,6 +3049,7 @@ 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"; @@ -2971,6 +3061,7 @@ 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"; @@ -2994,10 +3085,13 @@ 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"; @@ -3023,7 +3117,9 @@ 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"; @@ -3031,6 +3127,7 @@ 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"; @@ -3038,6 +3135,7 @@ 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"; @@ -3083,6 +3181,8 @@ static const char __pyx_k_FunctionConstraint___call[] = "FunctionConstraint.__ca 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__"; @@ -3104,14 +3204,17 @@ static const char __pyx_k_ExactSumConstraint_preProcess[] = "ExactSumConstraint. 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_q_G4q_t3a_Qa_3avS_4q_3a_Qb_E_D[] = "\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\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_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!"; @@ -3126,8 +3229,10 @@ static const char __pyx_k_77JJeef_QfKy_Q_q_A_S_S_G4q_4_1I[] = "\320\004$\320$7\3 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_3avS_Qb_E_4q_3a_Qb[] = "\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\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!"; @@ -3157,13 +3262,23 @@ static const char __pyx_k_VariableExactProdConstraint_preP[] = "VariableExactPro 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 "; @@ -3171,13 +3286,15 @@ static const char __pyx_k_Constraint_enforcing_that_values_3[] = "Constraint enf 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 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_8[] = "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_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 ### */ @@ -3232,13 +3349,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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_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 */ +static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint___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_25VariableMinProdConstraint_2_get_product_bounds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_domain_dict, PyObject *__pyx_v_exclude_var); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint_4_safe_product(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint_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_25VariableMinProdConstraint_8__call___genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ +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); /* proto */ 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_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_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 */ +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 */ +static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint_4_safe_product(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_values); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint_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_25VariableMaxProdConstraint_8__call___genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint_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_15InSetConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_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); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProcess(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 */ @@ -3266,7 +3395,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12__ 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_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_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*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ /* SmallCodeConfig */ @@ -3322,7 +3455,11 @@ typedef struct { 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_genexpr; + PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_16___call__; + 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; 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; @@ -3340,14 +3477,18 @@ typedef struct { 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_genexpr; + PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16___call__; + 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; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; __Pyx_CachedCFunction __pyx_umethod_PyList_Type__remove; PyObject *__pyx_slice[1]; PyObject *__pyx_tuple[5]; - PyObject *__pyx_codeobj_tab[63]; - PyObject *__pyx_string_tab[259]; + PyObject *__pyx_codeobj_tab[75]; + PyObject *__pyx_string_tab[288]; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_10; @@ -3434,9 +3575,32 @@ int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_15_genexpr; #endif #if CYTHON_USE_FREELISTS -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; +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__; #endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_17_genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_17_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_18_genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_18_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_19___call__[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_19___call__; +#endif + +#if CYTHON_USE_FREELISTS +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 +/* CommonTypesMetaclass.module_state_decls */ +PyTypeObject *__pyx_CommonTypesMetaclassType; + /* CachedMethodType.module_state_decls */ #if CYTHON_COMPILING_IN_LIMITED_API PyObject *__Pyx_CachedMethodType; @@ -3493,247 +3657,276 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_su __pyx_string_tab[18] -#define __pyx_kp_u_Constraint_enforcing_that_the_su_2 __pyx_string_tab[19] -#define __pyx_kp_u_Constraint_enforcing_that_the_su_3 __pyx_string_tab[20] -#define __pyx_kp_u_Constraint_enforcing_that_values __pyx_string_tab[21] -#define __pyx_kp_u_Constraint_enforcing_that_values_10 __pyx_string_tab[22] -#define __pyx_kp_u_Constraint_enforcing_that_values_2 __pyx_string_tab[23] -#define __pyx_kp_u_Constraint_enforcing_that_values_3 __pyx_string_tab[24] -#define __pyx_kp_u_Constraint_enforcing_that_values_4 __pyx_string_tab[25] -#define __pyx_kp_u_Constraint_enforcing_that_values_5 __pyx_string_tab[26] -#define __pyx_kp_u_Constraint_enforcing_that_values_6 __pyx_string_tab[27] -#define __pyx_kp_u_Constraint_enforcing_that_values_7 __pyx_string_tab[28] -#define __pyx_kp_u_Constraint_enforcing_that_values_8 __pyx_string_tab[29] -#define __pyx_kp_u_Constraint_enforcing_that_values_9 __pyx_string_tab[30] -#define __pyx_n_u_Constraint_forwardCheck __pyx_string_tab[31] -#define __pyx_n_u_Constraint_preProcess __pyx_string_tab[32] -#define __pyx_kp_u_Constraint_which_wraps_a_functio __pyx_string_tab[33] -#define __pyx_n_u_ExactProdConstraint __pyx_string_tab[34] -#define __pyx_n_u_ExactProdConstraint___call __pyx_string_tab[35] -#define __pyx_n_u_ExactProdConstraint___init __pyx_string_tab[36] -#define __pyx_n_u_ExactProdConstraint_preProcess __pyx_string_tab[37] -#define __pyx_n_u_ExactProdConstraint_preProcess_l __pyx_string_tab[38] -#define __pyx_n_u_ExactSumConstraint __pyx_string_tab[39] -#define __pyx_n_u_ExactSumConstraint___call __pyx_string_tab[40] -#define __pyx_n_u_ExactSumConstraint___init __pyx_string_tab[41] -#define __pyx_n_u_ExactSumConstraint_preProcess __pyx_string_tab[42] -#define __pyx_n_u_FunctionConstraint __pyx_string_tab[43] -#define __pyx_n_u_FunctionConstraint___call __pyx_string_tab[44] -#define __pyx_n_u_FunctionConstraint___init __pyx_string_tab[45] -#define __pyx_n_u_InSetConstraint __pyx_string_tab[46] -#define __pyx_n_u_InSetConstraint___call __pyx_string_tab[47] -#define __pyx_n_u_InSetConstraint___init __pyx_string_tab[48] -#define __pyx_n_u_InSetConstraint_preProcess __pyx_string_tab[49] -#define __pyx_kp_u_Last_multiplier_must_be_1_as_it __pyx_string_tab[50] -#define __pyx_n_u_MaxProdConstraint __pyx_string_tab[51] -#define __pyx_n_u_MaxProdConstraint___call __pyx_string_tab[52] -#define __pyx_n_u_MaxProdConstraint___init __pyx_string_tab[53] -#define __pyx_n_u_MaxProdConstraint_preProcess __pyx_string_tab[54] -#define __pyx_n_u_MaxProdConstraint_preProcess_loc __pyx_string_tab[55] -#define __pyx_n_u_MaxSumConstraint __pyx_string_tab[56] -#define __pyx_n_u_MaxSumConstraint___call __pyx_string_tab[57] -#define __pyx_n_u_MaxSumConstraint___init __pyx_string_tab[58] -#define __pyx_n_u_MaxSumConstraint_preProcess __pyx_string_tab[59] -#define __pyx_n_u_MaxSumConstraint_preProcess_loca __pyx_string_tab[60] -#define __pyx_n_u_MinProdConstraint __pyx_string_tab[61] -#define __pyx_n_u_MinProdConstraint___call __pyx_string_tab[62] -#define __pyx_n_u_MinProdConstraint___init __pyx_string_tab[63] -#define __pyx_n_u_MinProdConstraint_preProcess __pyx_string_tab[64] -#define __pyx_n_u_MinSumConstraint __pyx_string_tab[65] -#define __pyx_n_u_MinSumConstraint___call __pyx_string_tab[66] -#define __pyx_n_u_MinSumConstraint___init __pyx_string_tab[67] -#define __pyx_kp_u_Multipliers_must_be_numbers __pyx_string_tab[68] -#define __pyx_kp_u_Multipliers_must_match_sum_varia __pyx_string_tab[69] -#define __pyx_n_u_NotImplementedError __pyx_string_tab[70] -#define __pyx_n_u_NotInSetConstraint __pyx_string_tab[71] -#define __pyx_n_u_NotInSetConstraint___call __pyx_string_tab[72] -#define __pyx_n_u_NotInSetConstraint___init __pyx_string_tab[73] -#define __pyx_n_u_NotInSetConstraint_preProcess __pyx_string_tab[74] -#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[75] -#define __pyx_n_u_Optional __pyx_string_tab[76] -#define __pyx_kp_u_Optional_Sequence __pyx_string_tab[77] -#define __pyx_n_u_RuntimeError __pyx_string_tab[78] -#define __pyx_n_u_Sequence __pyx_string_tab[79] -#define __pyx_kp_u_Sequence_str __pyx_string_tab[80] -#define __pyx_n_u_SomeInSetConstraint __pyx_string_tab[81] -#define __pyx_n_u_SomeInSetConstraint___call __pyx_string_tab[82] -#define __pyx_n_u_SomeInSetConstraint___init __pyx_string_tab[83] -#define __pyx_n_u_SomeNotInSetConstraint __pyx_string_tab[84] -#define __pyx_n_u_SomeNotInSetConstraint___call __pyx_string_tab[85] -#define __pyx_n_u_SomeNotInSetConstraint___init __pyx_string_tab[86] -#define __pyx_n_u_Unassigned __pyx_string_tab[87] -#define __pyx_n_u_Union __pyx_string_tab[88] -#define __pyx_kp_u_Union_int_float __pyx_string_tab[89] -#define __pyx_n_u_VariableExactProdConstraint __pyx_string_tab[90] -#define __pyx_n_u_VariableExactProdConstraint___ca __pyx_string_tab[91] -#define __pyx_n_u_VariableExactProdConstraint___ca_2 __pyx_string_tab[92] -#define __pyx_n_u_VariableExactProdConstraint___in __pyx_string_tab[93] -#define __pyx_n_u_VariableExactProdConstraint__get __pyx_string_tab[94] -#define __pyx_n_u_VariableExactProdConstraint__saf __pyx_string_tab[95] -#define __pyx_n_u_VariableExactProdConstraint_preP __pyx_string_tab[96] -#define __pyx_n_u_VariableExactSumConstraint __pyx_string_tab[97] -#define __pyx_n_u_VariableExactSumConstraint___cal __pyx_string_tab[98] -#define __pyx_n_u_VariableExactSumConstraint___ini __pyx_string_tab[99] -#define __pyx_n_u_VariableExactSumConstraint___ini_2 __pyx_string_tab[100] -#define __pyx_n_u_VariableExactSumConstraint_prePr __pyx_string_tab[101] -#define __pyx_n_u_VariableExactSumConstraint_prePr_2 __pyx_string_tab[102] -#define __pyx_n_u_VariableMaxSumConstraint __pyx_string_tab[103] -#define __pyx_n_u_VariableMaxSumConstraint___call __pyx_string_tab[104] -#define __pyx_n_u_VariableMaxSumConstraint___init __pyx_string_tab[105] -#define __pyx_n_u_VariableMaxSumConstraint___init_2 __pyx_string_tab[106] -#define __pyx_n_u_VariableMaxSumConstraint_preProc __pyx_string_tab[107] -#define __pyx_n_u_VariableMaxSumConstraint_preProc_2 __pyx_string_tab[108] -#define __pyx_n_u_VariableMinSumConstraint __pyx_string_tab[109] -#define __pyx_n_u_VariableMinSumConstraint___call __pyx_string_tab[110] -#define __pyx_n_u_VariableMinSumConstraint___init __pyx_string_tab[111] -#define __pyx_n_u_VariableMinSumConstraint___init_2 __pyx_string_tab[112] -#define __pyx_n_u_VariableMinSumConstraint_preProc __pyx_string_tab[113] -#define __pyx_n_u_VariableMinSumConstraint_preProc_2 __pyx_string_tab[114] -#define __pyx_kp_u_Wrapper_function_for_picklable_s __pyx_string_tab[115] -#define __pyx_kp_u__2 __pyx_string_tab[116] -#define __pyx_kp_u_add_note __pyx_string_tab[117] -#define __pyx_n_u_all_bounds __pyx_string_tab[118] -#define __pyx_n_u_append __pyx_string_tab[119] -#define __pyx_n_u_assigned __pyx_string_tab[120] -#define __pyx_n_u_assigned_2 __pyx_string_tab[121] -#define __pyx_n_u_assigned_product __pyx_string_tab[122] -#define __pyx_n_u_assignments __pyx_string_tab[123] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[124] -#define __pyx_n_u_b __pyx_string_tab[125] -#define __pyx_n_u_bool __pyx_string_tab[126] -#define __pyx_n_u_bounds __pyx_string_tab[127] -#define __pyx_n_u_c __pyx_string_tab[128] -#define __pyx_n_u_call __pyx_string_tab[129] -#define __pyx_n_u_candidates __pyx_string_tab[130] -#define __pyx_n_u_class_getitem __pyx_string_tab[131] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[132] -#define __pyx_n_u_close __pyx_string_tab[133] -#define __pyx_n_u_collections_abc __pyx_string_tab[134] -#define __pyx_n_u_constraint_constraints __pyx_string_tab[135] -#define __pyx_kp_u_constraint_constraints_py __pyx_string_tab[136] -#define __pyx_n_u_constraint_domain __pyx_string_tab[137] -#define __pyx_n_u_constraints __pyx_string_tab[138] -#define __pyx_n_u_contains_lt1 __pyx_string_tab[139] -#define __pyx_n_u_contains_negative __pyx_string_tab[140] -#define __pyx_n_u_dict __pyx_string_tab[141] -#define __pyx_kp_u_disable __pyx_string_tab[142] -#define __pyx_n_u_doc __pyx_string_tab[143] -#define __pyx_n_u_dom __pyx_string_tab[144] -#define __pyx_n_u_domain __pyx_string_tab[145] -#define __pyx_n_u_domain_bounds __pyx_string_tab[146] -#define __pyx_n_u_domain_dict __pyx_string_tab[147] -#define __pyx_n_u_domains __pyx_string_tab[148] -#define __pyx_kp_u_enable __pyx_string_tab[149] -#define __pyx_n_u_exact __pyx_string_tab[150] -#define __pyx_n_u_exact_2 __pyx_string_tab[151] -#define __pyx_n_u_exactprod __pyx_string_tab[152] -#define __pyx_n_u_exactprod_2 __pyx_string_tab[153] -#define __pyx_n_u_exactsum __pyx_string_tab[154] -#define __pyx_n_u_exactsum_2 __pyx_string_tab[155] -#define __pyx_n_u_exclude_var __pyx_string_tab[156] -#define __pyx_n_u_forwardCheck __pyx_string_tab[157] -#define __pyx_n_u_forwardcheck __pyx_string_tab[158] -#define __pyx_n_u_found __pyx_string_tab[159] -#define __pyx_n_u_func __pyx_string_tab[160] -#define __pyx_n_u_func_2 __pyx_string_tab[161] -#define __pyx_n_u_func_3 __pyx_string_tab[162] -#define __pyx_kp_u_gc __pyx_string_tab[163] -#define __pyx_n_u_genexpr __pyx_string_tab[164] -#define __pyx_n_u_get __pyx_string_tab[165] -#define __pyx_n_u_get_product_bounds __pyx_string_tab[166] -#define __pyx_n_u_hi __pyx_string_tab[167] -#define __pyx_n_u_hideValue __pyx_string_tab[168] -#define __pyx_n_u_index __pyx_string_tab[169] -#define __pyx_n_u_init __pyx_string_tab[170] -#define __pyx_n_u_is_coroutine __pyx_string_tab[171] -#define __pyx_kp_u_isenabled __pyx_string_tab[172] -#define __pyx_n_u_itertools __pyx_string_tab[173] -#define __pyx_kp_u_list_tuple __pyx_string_tab[174] -#define __pyx_n_u_lo __pyx_string_tab[175] -#define __pyx_n_u_m __pyx_string_tab[176] -#define __pyx_n_u_main __pyx_string_tab[177] -#define __pyx_n_u_max __pyx_string_tab[178] -#define __pyx_n_u_maxprod __pyx_string_tab[179] -#define __pyx_n_u_maxprod_2 __pyx_string_tab[180] -#define __pyx_n_u_maxsum __pyx_string_tab[181] -#define __pyx_n_u_maxsum_2 __pyx_string_tab[182] -#define __pyx_n_u_maxval __pyx_string_tab[183] -#define __pyx_n_u_metaclass __pyx_string_tab[184] -#define __pyx_n_u_min __pyx_string_tab[185] -#define __pyx_n_u_minprod __pyx_string_tab[186] -#define __pyx_n_u_minprod_2 __pyx_string_tab[187] -#define __pyx_n_u_minsum __pyx_string_tab[188] -#define __pyx_n_u_minsum_2 __pyx_string_tab[189] -#define __pyx_n_u_minval __pyx_string_tab[190] -#define __pyx_n_u_missing __pyx_string_tab[191] -#define __pyx_n_u_missing_lt1 __pyx_string_tab[192] -#define __pyx_n_u_module __pyx_string_tab[193] -#define __pyx_n_u_mro_entries __pyx_string_tab[194] -#define __pyx_n_u_multiplier __pyx_string_tab[195] -#define __pyx_n_u_multipliers __pyx_string_tab[196] -#define __pyx_n_u_multipliers_2 __pyx_string_tab[197] -#define __pyx_n_u_n __pyx_string_tab[198] -#define __pyx_n_u_n_2 __pyx_string_tab[199] -#define __pyx_n_u_name __pyx_string_tab[200] -#define __pyx_n_u_next __pyx_string_tab[201] -#define __pyx_n_u_other_max __pyx_string_tab[202] -#define __pyx_n_u_other_min __pyx_string_tab[203] -#define __pyx_n_u_other_products __pyx_string_tab[204] -#define __pyx_n_u_others __pyx_string_tab[205] -#define __pyx_n_u_others_bounds __pyx_string_tab[206] -#define __pyx_n_u_others_max __pyx_string_tab[207] -#define __pyx_n_u_others_min __pyx_string_tab[208] -#define __pyx_n_u_p __pyx_string_tab[209] -#define __pyx_n_u_parms __pyx_string_tab[210] -#define __pyx_n_u_pop __pyx_string_tab[211] -#define __pyx_n_u_possible_max __pyx_string_tab[212] -#define __pyx_n_u_possible_min __pyx_string_tab[213] -#define __pyx_n_u_preProcess __pyx_string_tab[214] -#define __pyx_n_u_prepare __pyx_string_tab[215] -#define __pyx_n_u_prod __pyx_string_tab[216] -#define __pyx_n_u_product __pyx_string_tab[217] -#define __pyx_n_u_product_vars __pyx_string_tab[218] -#define __pyx_n_u_products __pyx_string_tab[219] -#define __pyx_n_u_qualname __pyx_string_tab[220] -#define __pyx_n_u_remove __pyx_string_tab[221] -#define __pyx_n_u_round __pyx_string_tab[222] -#define __pyx_n_u_safe_product __pyx_string_tab[223] -#define __pyx_n_u_seen __pyx_string_tab[224] -#define __pyx_n_u_self __pyx_string_tab[225] -#define __pyx_n_u_send __pyx_string_tab[226] -#define __pyx_n_u_set __pyx_string_tab[227] -#define __pyx_n_u_set_2 __pyx_string_tab[228] -#define __pyx_n_u_singlevalue __pyx_string_tab[229] -#define __pyx_n_u_str __pyx_string_tab[230] -#define __pyx_n_u_sum __pyx_string_tab[231] -#define __pyx_n_u_sum_value __pyx_string_tab[232] -#define __pyx_n_u_sum_vars __pyx_string_tab[233] -#define __pyx_n_u_target_domain __pyx_string_tab[234] -#define __pyx_n_u_target_max __pyx_string_tab[235] -#define __pyx_n_u_target_min __pyx_string_tab[236] -#define __pyx_n_u_target_value __pyx_string_tab[237] -#define __pyx_n_u_target_var __pyx_string_tab[238] -#define __pyx_n_u_temp_sum __pyx_string_tab[239] -#define __pyx_n_u_test __pyx_string_tab[240] -#define __pyx_n_u_throw __pyx_string_tab[241] -#define __pyx_n_u_typing __pyx_string_tab[242] -#define __pyx_n_u_unassigned __pyx_string_tab[243] -#define __pyx_n_u_unassigned_vars __pyx_string_tab[244] -#define __pyx_n_u_unassignedvariable __pyx_string_tab[245] -#define __pyx_n_u_v __pyx_string_tab[246] -#define __pyx_n_u_value __pyx_string_tab[247] -#define __pyx_n_u_values __pyx_string_tab[248] -#define __pyx_n_u_var __pyx_string_tab[249] -#define __pyx_n_u_variable __pyx_string_tab[250] -#define __pyx_n_u_variable_contains_lt1 __pyx_string_tab[251] -#define __pyx_n_u_variable_contains_negative __pyx_string_tab[252] -#define __pyx_n_u_variable_with_lt1 __pyx_string_tab[253] -#define __pyx_n_u_variable_with_negative __pyx_string_tab[254] -#define __pyx_n_u_variables __pyx_string_tab[255] -#define __pyx_n_u_vconstraints __pyx_string_tab[256] -#define __pyx_n_u_x __pyx_string_tab[257] -#define __pyx_n_u_zip __pyx_string_tab[258] +#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_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] +#define __pyx_n_u_hi __pyx_string_tab[184] +#define __pyx_n_u_hideValue __pyx_string_tab[185] +#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_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_maxprod __pyx_string_tab[197] +#define __pyx_n_u_maxprod_2 __pyx_string_tab[198] +#define __pyx_n_u_maxsum __pyx_string_tab[199] +#define __pyx_n_u_maxsum_2 __pyx_string_tab[200] +#define __pyx_n_u_maxval __pyx_string_tab[201] +#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] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3788,12 +3981,20 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { 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_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_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_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); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_18_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__); + 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); 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<63; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<259; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[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); @@ -3851,12 +4052,20 @@ 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_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_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_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_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); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_18_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__); + 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); 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<63; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<259; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[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); @@ -4218,7 +4427,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * 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); 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); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_variable = __pyx_t_3; __pyx_t_3 = 0; @@ -10237,7 +10446,7 @@ 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); 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); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 394, __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_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -14039,7 +14248,7 @@ 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); 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); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __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_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -18554,7 +18763,7 @@ 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); 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); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 711, __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_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -25677,22 +25886,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai /* "constraint/constraints.py":945 * """ * - * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< - * """Instantiate a MaxProdConstraint. + * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< + * """Instantiate a MinProdConstraint. * */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_1__init__(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_17MaxProdConstraint___init__, "Instantiate a MaxProdConstraint.\n\n Args:\n maxprod: Value to be considered as the maximum product\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_17MaxProdConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MaxProdConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_17MaxProdConstraint___init__}; -static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_1__init__(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_17MinProdConstraint___init__, "Instantiate a MinProdConstraint.\n\n Args:\n minprod: Value to be considered as the maximum product\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_17MinProdConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MinProdConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_17MinProdConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -25700,7 +25909,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_maxprod = 0; + PyObject *__pyx_v_minprod = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -25721,7 +25930,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #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_maxprod,0}; + 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, 945, __pyx_L3_error) if (__pyx_kwds_len > 0) { @@ -25751,7 +25960,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 945, __pyx_L3_error) } __pyx_v_self = values[0]; - __pyx_v_maxprod = values[1]; + __pyx_v_minprod = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; @@ -25762,11 +25971,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds 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.MaxProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_17MaxProdConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_maxprod); + __pyx_r = __pyx_pf_10constraint_11constraints_17MinProdConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_minprod); /* function exit code */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -25776,7 +25985,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_maxprod) { +static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_minprod) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; @@ -25785,19 +25994,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/constraints.py":951 - * maxprod: Value to be considered as the maximum product + * minprod: Value to be considered as the maximum product * """ - * self._maxprod = maxprod # <<<<<<<<<<<<<< + * 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_maxprod_2, __pyx_v_maxprod) < 0) __PYX_ERR(0, 951, __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, 951, __pyx_L1_error) /* "constraint/constraints.py":945 * """ * - * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< - * """Instantiate a MaxProdConstraint. + * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< + * """Instantiate a MinProdConstraint. * */ @@ -25805,7 +26014,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -25814,7 +26023,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ } /* "constraint/constraints.py":953 - * self._maxprod = maxprod + * self._minprod = minprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) @@ -25822,15 +26031,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_3preProcess(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_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_17MaxProdConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MaxProdConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_3preProcess(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_17MinProdConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MinProdConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_3preProcess(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -25924,14 +26133,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds 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.MaxProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.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, 953, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 953, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 953, __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); + __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 */ goto __pyx_L0; @@ -25949,184 +26158,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -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":960 - * 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): -*/ - -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_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_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_16_genexpr *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 960, __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_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, 960, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.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_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_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; - 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, 960, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 960, __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, 960, __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, 960, __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, 960, __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, 960, __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, 960, __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, 960, __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, 960, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 960, __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":953 - * self._maxprod = maxprod - * - * 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_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) { - PyObject *__pyx_v_variable_with_lt1 = NULL; +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) { + PyObject *__pyx_v_minprod = NULL; PyObject *__pyx_v_variable = NULL; - PyObject *__pyx_v_contains_lt1 = NULL; - PyObject *__pyx_v_maxprod = NULL; PyObject *__pyx_v_domain = NULL; PyObject *__pyx_v_value = NULL; - PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator12 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -26136,13 +26173,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro size_t __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); - int __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - PyObject *(*__pyx_t_10)(PyObject *); + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_t_10; int __pyx_t_11; - int __pyx_t_12; - Py_ssize_t __pyx_t_13; - PyObject *(*__pyx_t_14)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -26153,7 +26187,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * 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 values less than 1 in the associated variables + * # 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, 954, __pyx_L1_error) @@ -26185,41 +26219,31 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro /* "constraint/constraints.py":957 * - * # check if there are any values less than 1 in the associated variables - * self._variable_contains_lt1: list[bool] = list() # <<<<<<<<<<<<<< - * variable_with_lt1 = None + * # prune the associated variables of values > minprod + * minprod = self._minprod # <<<<<<<<<<<<<< * for variable in variables: + * domain = domains[variable] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __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, 957, __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, 957, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_minprod = __pyx_t_1; + __pyx_t_1 = 0; /* "constraint/constraints.py":958 - * # 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: - * contains_lt1 = any(value < 1 for value in domains[variable]) -*/ - __Pyx_INCREF(Py_None); - __pyx_v_variable_with_lt1 = Py_None; - - /* "constraint/constraints.py":959 - * self._variable_contains_lt1: list[bool] = list() - * variable_with_lt1 = None + * # prune the associated variables of values > minprod + * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< - * contains_lt1 = any(value < 1 for value in domains[variable]) - * self._variable_contains_lt1.append(contains_lt1) + * domain = domains[variable] + * for value in domain[:]: */ 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, 959, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 958, __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, 959, __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, 958, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -26227,7 +26251,7 @@ 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, 959, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 958, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -26237,7 +26261,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 959, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 958, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -26248,13 +26272,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 959, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 958, __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, 959, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 958, __pyx_L1_error) PyErr_Clear(); } break; @@ -26264,490 +26288,103 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":960 - * 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, 960, __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, 960, __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, 960, __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":961 - * 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, 961, __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, 961, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":959 - * self._variable_contains_lt1: list[bool] = list() - * 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) -*/ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "constraint/constraints.py":962 - * 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: - * 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, 962, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __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)); - __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, 962, __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_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, 962, __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, 962, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_7)) { - 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, 962, __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_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, 962, __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_2, __pyx_t_6)); - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); - #endif - ++__pyx_t_6; - } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 962, __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, 962, __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, 962, __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_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 962, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 962, __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, 962, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 962, __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, 962, __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; - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 962, __pyx_L1_error) - __pyx_t_10 = NULL; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L9_unpacking_done; - __pyx_L8_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, 962, __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_t_4 = 0; - - /* "constraint/constraints.py":963 - * self._variable_contains_lt1.append(contains_lt1) - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): - * if contains_lt1 is True: # <<<<<<<<<<<<<< - * if variable_with_lt1 is not None: - * # if more than one associated variables contain less than 1, we can't prune -*/ - __pyx_t_11 = (__pyx_v_contains_lt1 == Py_True); - if (__pyx_t_11) { - - /* "constraint/constraints.py":964 - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): - * if contains_lt1 is True: - * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< - * # if more than one associated variables contain less than 1, we can't prune - * return -*/ - __pyx_t_11 = (__pyx_v_variable_with_lt1 != Py_None); - if (__pyx_t_11) { - - /* "constraint/constraints.py":966 - * if variable_with_lt1 is not None: - * # if more than one associated variables contain less than 1, we can't prune - * return # <<<<<<<<<<<<<< - * variable_with_lt1 = variable - * -*/ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L0; - - /* "constraint/constraints.py":964 - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): - * if contains_lt1 is True: - * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< - * # if more than one associated variables contain less than 1, we can't prune - * return -*/ - } - - /* "constraint/constraints.py":967 - * # if more than one associated variables contain less than 1, we can't prune - * return - * variable_with_lt1 = variable # <<<<<<<<<<<<<< - * - * # prune the associated variables of values > maxprod -*/ - __Pyx_INCREF(__pyx_v_variable); - __Pyx_DECREF_SET(__pyx_v_variable_with_lt1, __pyx_v_variable); - - /* "constraint/constraints.py":963 - * self._variable_contains_lt1.append(contains_lt1) - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): - * if contains_lt1 is True: # <<<<<<<<<<<<<< - * if variable_with_lt1 is not None: - * # if more than one associated variables contain less than 1, we can't prune -*/ - } - - /* "constraint/constraints.py":962 - * 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: - * if variable_with_lt1 is not None: -*/ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "constraint/constraints.py":970 - * - * # 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, 970, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_maxprod = __pyx_t_2; - __pyx_t_2 = 0; - - /* "constraint/constraints.py":971 - * # 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: - * continue -*/ - 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; - } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 971, __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, 971, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_7)) { - 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, 971, __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_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, 971, __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_2, __pyx_t_6)); - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); - #endif - ++__pyx_t_6; - } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __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, 971, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); - __pyx_t_1 = 0; - - /* "constraint/constraints.py":972 - * maxprod = self._maxprod - * for variable in variables: - * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< - * continue - * domain = domains[variable] -*/ - __pyx_t_12 = (__pyx_v_variable_with_lt1 != Py_None); - if (__pyx_t_12) { - } else { - __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, 972, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 972, __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":973 - * for variable in variables: - * if variable_with_lt1 is not None and variable_with_lt1 != variable: - * continue # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: -*/ - goto __pyx_L13_continue; - - /* "constraint/constraints.py":972 - * maxprod = self._maxprod + * minprod = self._minprod * for variable in variables: - * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< - * continue - * domain = domains[variable] -*/ - } - - /* "constraint/constraints.py":974 - * if variable_with_lt1 is not None and variable_with_lt1 != variable: - * continue * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: - * if value > maxprod: + * if value == 0 and minprod > 0: */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 959, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":975 - * continue + /* "constraint/constraints.py":960 + * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< - * if value > maxprod: + * if value == 0 and minprod > 0: * 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, 975, __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_13 = 0; - __pyx_t_14 = NULL; + __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, 960, __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_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 975, __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, 975, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __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, 960, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { - if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + 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, 975, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 960, __pyx_L1_error) #endif - if (__pyx_t_13 >= __pyx_temp) break; + if (__pyx_t_8 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_13); - ++__pyx_t_13; + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_8); + ++__pyx_t_8; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); + 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, 975, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 960, __pyx_L1_error) #endif - if (__pyx_t_13 >= __pyx_temp) break; + if (__pyx_t_8 >= __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_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); #endif - ++__pyx_t_13; + ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 960, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_14(__pyx_t_4); - if (unlikely(!__pyx_t_1)) { + __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, 975, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 960, __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":976 - * 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, 976, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_11) { - - /* "constraint/constraints.py":977 - * 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_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, 977, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":976 + /* "constraint/constraints.py":961 * domain = domains[variable] * for value in domain[:]: - * if value > maxprod: # <<<<<<<<<<<<<< - * domain.remove(value) - * elif value == 0 and maxprod < 0: -*/ - goto __pyx_L20; - } - - /* "constraint/constraints.py":978 - * if value > maxprod: - * domain.remove(value) - * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< + * if value == 0 and minprod > 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, 978, __pyx_L1_error) - if (__pyx_t_12) { + __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, 961, __pyx_L1_error) + if (__pyx_t_11) { } else { - __pyx_t_11 = __pyx_t_12; - goto __pyx_L21_bool_binop_done; + __pyx_t_10 = __pyx_t_11; + goto __pyx_L8_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, 978, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 978, __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) { + __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, 961, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 961, __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":979 - * domain.remove(value) - * elif value == 0 and maxprod < 0: + /* "constraint/constraints.py":962 + * for value in domain[:]: + * if value == 0 and minprod > 0: * domain.remove(value) # <<<<<<<<<<<<<< * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 @@ -26757,46 +26394,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __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_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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 979, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 962, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":978 - * if value > maxprod: - * domain.remove(value) - * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< + /* "constraint/constraints.py":961 + * domain = domains[variable] + * for value in domain[:]: + * if value == 0 and minprod > 0: # <<<<<<<<<<<<<< * domain.remove(value) * */ } - __pyx_L20:; - /* "constraint/constraints.py":975 - * continue + /* "constraint/constraints.py":960 + * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< - * if value > maxprod: + * if value == 0 and minprod > 0: * domain.remove(value) */ } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":971 - * # prune the associated variables of values > maxprod - * maxprod = self._maxprod + /* "constraint/constraints.py":958 + * # prune the associated variables of values > minprod + * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< - * if variable_with_lt1 is not None and variable_with_lt1 != variable: - * continue + * domain = domains[variable] + * for value in domain[:]: */ - __pyx_L13_continue:; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/constraints.py":953 - * self._maxprod = maxprod + * self._minprod = minprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) @@ -26811,40 +26446,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_variable_with_lt1); + __Pyx_XDECREF(__pyx_v_minprod); __Pyx_XDECREF(__pyx_v_variable); - __Pyx_XDECREF(__pyx_v_contains_lt1); - __Pyx_XDECREF(__pyx_v_maxprod); __Pyx_XDECREF(__pyx_v_domain); __Pyx_XDECREF(__pyx_v_value); - __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator12); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":981 +/* "constraint/constraints.py":964 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * maxprod = self._maxprod - * prod = 1 + * # check if each variable is in the assignments + * for variable in variables: */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_5__call__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_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_17MaxProdConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MaxProdConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_5__call__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_17MinProdConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MinProdConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_5__call__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -26853,9 +26484,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_variables = 0; - PyObject *__pyx_v_domains = 0; + CYTHON_UNUSED 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 @@ -26878,53 +26509,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, 981, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 964, __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, 981, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 964, __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, 981, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 964, __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, 981, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 964, __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, 981, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 964, __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, 981, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 964, __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, 981, __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, 964, __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, 981, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 964, __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, 981, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 964, __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, 981, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 964, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 981, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 964, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 981, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 964, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 981, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 964, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -26938,20 +26569,20 @@ 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, 981, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 964, __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.MaxProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.__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, 981, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 981, __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); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 964, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 964, __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 */ goto __pyx_L0; @@ -26970,413 +26601,5239 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -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; - PyObject *__pyx_v_prod = NULL; - int __pyx_v_missing; - PyObject *__pyx_v_missing_lt1 = NULL; +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) { PyObject *__pyx_v_variable = NULL; - PyObject *__pyx_v_contains_lt1 = NULL; - PyObject *__pyx_v_domain = NULL; - PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_minprod = NULL; + PyObject *__pyx_v_prod = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; - 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)(PyObject *); - int __pyx_t_10; - int __pyx_t_11; - int __pyx_t_12; - Py_ssize_t __pyx_t_13; - PyObject *(*__pyx_t_14)(PyObject *); + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + size_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":982 - * - * 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, 982, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_maxprod = __pyx_t_1; - __pyx_t_1 = 0; - - /* "constraint/constraints.py":983 + /* "constraint/constraints.py":966 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - * maxprod = self._maxprod - * prod = 1 # <<<<<<<<<<<<<< - * missing = False - * missing_lt1 = [] -*/ - __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); - __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; - - /* "constraint/constraints.py":984 - * maxprod = self._maxprod - * prod = 1 - * missing = False # <<<<<<<<<<<<<< - * missing_lt1 = [] - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): -*/ - __pyx_v_missing = 0; - - /* "constraint/constraints.py":985 - * prod = 1 - * missing = False - * missing_lt1 = [] # <<<<<<<<<<<<<< - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): - * if variable in assignments: -*/ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 985, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_missing_lt1 = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "constraint/constraints.py":986 - * missing = False - * missing_lt1 = [] - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< - * if variable in assignments: - * prod *= assignments[variable] + * # check if each variable is in the assignments + * for variable in variables: # <<<<<<<<<<<<<< + * if variable not in assignments: + * return True */ - __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, 986, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = 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, 986, __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; + 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_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 986, __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, 986, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __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, 966, __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_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + 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, 986, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 966, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_6); - ++__pyx_t_6; + __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_3); + 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, 986, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 966, __pyx_L1_error) #endif - if (__pyx_t_6 >= __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_3, __pyx_t_6)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif - ++__pyx_t_6; + ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 966, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_7(__pyx_t_3); - if (unlikely(!__pyx_t_1)) { + __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, 986, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 966, __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, 986, __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_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __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, 986, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __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_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 986, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __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, 986, __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; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 986, __pyx_L1_error) - __pyx_L6_unpacking_done:; - } + __Pyx_GOTREF(__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_2); - __pyx_t_2 = 0; - /* "constraint/constraints.py":987 - * missing_lt1 = [] - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): - * if variable in assignments: # <<<<<<<<<<<<<< - * prod *= assignments[variable] - * else: + /* "constraint/constraints.py":967 + * # check if each variable is in the assignments + * for variable in variables: + * if variable not in assignments: # <<<<<<<<<<<<<< + * return True + * */ - __pyx_t_10 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 987, __pyx_L1_error) - if (__pyx_t_10) { + __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 967, __pyx_L1_error) + if (__pyx_t_5) { - /* "constraint/constraints.py":988 - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): - * if variable in assignments: - * prod *= assignments[variable] # <<<<<<<<<<<<<< - * else: - * missing = True + /* "constraint/constraints.py":968 + * for variable in variables: + * if variable not in assignments: + * return True # <<<<<<<<<<<<<< + * + * # with each variable assigned, sum the values */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 988, __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, 988, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_2); - __pyx_t_2 = 0; + goto __pyx_L0; - /* "constraint/constraints.py":987 - * missing_lt1 = [] - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): - * if variable in assignments: # <<<<<<<<<<<<<< - * prod *= assignments[variable] - * else: + /* "constraint/constraints.py":967 + * # check if each variable is in the assignments + * for variable in variables: + * if variable not in assignments: # <<<<<<<<<<<<<< + * return True + * */ - goto __pyx_L7; } - /* "constraint/constraints.py":990 - * prod *= assignments[variable] - * else: - * missing = True # <<<<<<<<<<<<<< - * if contains_lt1: - * missing_lt1.append(variable) + /* "constraint/constraints.py":966 + * 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 */ - /*else*/ { - __pyx_v_missing = 1; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":991 - * else: - * missing = True - * if contains_lt1: # <<<<<<<<<<<<<< - * missing_lt1.append(variable) - * if isinstance(prod, float): + /* "constraint/constraints.py":971 + * + * # with each variable assigned, sum the values + * minprod = self._minprod # <<<<<<<<<<<<<< + * prod = 1 + * for variable in variables: */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_contains_lt1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 991, __pyx_L1_error) - if (__pyx_t_10) { + __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, 971, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_minprod = __pyx_t_1; + __pyx_t_1 = 0; - /* "constraint/constraints.py":992 - * missing = True - * if contains_lt1: - * missing_lt1.append(variable) # <<<<<<<<<<<<<< - * if isinstance(prod, float): - * prod = round(prod, 10) + /* "constraint/constraints.py":972 + * # with each variable assigned, sum the values + * minprod = self._minprod + * prod = 1 # <<<<<<<<<<<<<< + * for variable in variables: + * prod *= assignments[variable] */ - __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_missing_lt1, __pyx_v_variable); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 992, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); + __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; - /* "constraint/constraints.py":991 - * else: - * missing = True - * if contains_lt1: # <<<<<<<<<<<<<< - * missing_lt1.append(variable) + /* "constraint/constraints.py":973 + * minprod = self._minprod + * prod = 1 + * for variable in variables: # <<<<<<<<<<<<<< + * prod *= assignments[variable] * if isinstance(prod, float): */ + 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, 973, __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, 973, __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, 973, __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, 973, __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, 973, __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, 973, __pyx_L1_error) + PyErr_Clear(); + } + break; } } - __pyx_L7:; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":986 - * missing = False - * missing_lt1 = [] - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< - * if variable in assignments: - * prod *= assignments[variable] + /* "constraint/constraints.py":974 + * 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, 974, __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, 974, __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":973 + * minprod = self._minprod + * prod = 1 + * for variable in variables: # <<<<<<<<<<<<<< + * prod *= assignments[variable] + * if isinstance(prod, float): */ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":993 - * if contains_lt1: - * missing_lt1.append(variable) + /* "constraint/constraints.py":975 + * for variable in variables: + * prod *= assignments[variable] * if isinstance(prod, float): # <<<<<<<<<<<<<< * prod = round(prod, 10) - * if (not missing or len(missing_lt1) == 0) and prod > maxprod: + * return prod >= minprod */ - __pyx_t_10 = PyFloat_Check(__pyx_v_prod); - if (__pyx_t_10) { + __pyx_t_5 = PyFloat_Check(__pyx_v_prod); + if (__pyx_t_5) { - /* "constraint/constraints.py":994 - * missing_lt1.append(variable) + /* "constraint/constraints.py":976 + * prod *= assignments[variable] * if isinstance(prod, float): * prod = round(prod, 10) # <<<<<<<<<<<<<< - * if (not missing or len(missing_lt1) == 0) and prod > maxprod: - * return False + * return prod >= minprod + * */ - __pyx_t_2 = NULL; + __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_1 = __pyx_builtin_round; - __pyx_t_5 = 1; + __pyx_t_4 = __pyx_builtin_round; + __pyx_t_7 = 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, 994, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + 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_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, 976, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":993 - * if contains_lt1: - * missing_lt1.append(variable) + /* "constraint/constraints.py":975 + * for variable in variables: + * prod *= assignments[variable] * if isinstance(prod, float): # <<<<<<<<<<<<<< * prod = round(prod, 10) - * if (not missing or len(missing_lt1) == 0) and prod > maxprod: + * return prod >= minprod */ } - /* "constraint/constraints.py":995 + /* "constraint/constraints.py":977 * if isinstance(prod, float): * prod = round(prod, 10) - * if (not missing or len(missing_lt1) == 0) and prod > maxprod: # <<<<<<<<<<<<<< - * return False - * if forwardcheck: + * return prod >= minprod # <<<<<<<<<<<<<< + * + * */ - __pyx_t_12 = (!__pyx_v_missing); - if (!__pyx_t_12) { - } else { - goto __pyx_L13_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, 995, __pyx_L1_error) - __pyx_t_12 = (__pyx_t_6 == 0); - if (__pyx_t_12) { - } else { - __pyx_t_10 = __pyx_t_12; - goto __pyx_L12_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, 995, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 995, __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_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, 977, __pyx_L1_error) + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "constraint/constraints.py":996 - * prod = round(prod, 10) - * if (not missing or len(missing_lt1) == 0) and prod > maxprod: - * return False # <<<<<<<<<<<<<< - * if forwardcheck: - * for variable in variables: + /* "constraint/constraints.py":964 + * 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_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - /* "constraint/constraints.py":995 - * if isinstance(prod, float): - * prod = round(prod, 10) - * if (not missing or len(missing_lt1) == 0) and prod > maxprod: # <<<<<<<<<<<<<< - * return False - * if forwardcheck: -*/ - } + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_variable); + __Pyx_XDECREF(__pyx_v_minprod); + __Pyx_XDECREF(__pyx_v_prod); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "constraint/constraints.py":997 - * 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): +/* "constraint/constraints.py":991 + * """ + * + * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< + * self.target_var = target_var + * self.product_vars = product_vars */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 997, __pyx_L1_error) - if (__pyx_t_10) { - /* "constraint/constraints.py":998 - * return False - * 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] -*/ - 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; +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_25VariableMinProdConstraint_1__init__(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_25VariableMinProdConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_25VariableMinProdConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_25VariableMinProdConstraint_1__init__(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_target_var = 0; + PyObject *__pyx_v_product_vars = 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("__init__ (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_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, 991, __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, 991, __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, 991, __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, 991, __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, 991, __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, 991, __pyx_L3_error) } + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; } else { - __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 998, __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, 998, __pyx_L1_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 991, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 991, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 991, __pyx_L3_error) } - for (;;) { + __pyx_v_self = values[0]; + __pyx_v_target_var = ((PyObject*)values[1]); + __pyx_v_product_vars = values[2]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 991, __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.VariableMinProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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, 991, __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 */ + 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_25VariableMinProdConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_target_var, PyObject *__pyx_v_product_vars) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "constraint/constraints.py":992 + * + * 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, 992, __pyx_L1_error) + + /* "constraint/constraints.py":993 + * 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, 993, __pyx_L1_error) + + /* "constraint/constraints.py":991 + * """ + * + * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< + * self.target_var = target_var + * self.product_vars = product_vars +*/ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.VariableMinProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":995 + * self.product_vars = product_vars + * + * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< + * bounds = [] + * for var in self.product_vars: +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_25VariableMinProdConstraint_3_get_product_bounds(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_25VariableMinProdConstraint_3_get_product_bounds = {"_get_product_bounds", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_25VariableMinProdConstraint_3_get_product_bounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_25VariableMinProdConstraint_3_get_product_bounds(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_domain_dict = 0; + PyObject *__pyx_v_exclude_var = 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("_get_product_bounds (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_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, 995, __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, 995, __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, 995, __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, 995, __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, 995, __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, 995, __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, 995, __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, 995, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 995, __pyx_L3_error) + break; + default: goto __pyx_L5_argtuple_error; + } + if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); + } + __pyx_v_self = values[0]; + __pyx_v_domain_dict = values[1]; + __pyx_v_exclude_var = values[2]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 995, __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.VariableMinProdConstraint._get_product_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10constraint_11constraints_25VariableMinProdConstraint_2_get_product_bounds(__pyx_self, __pyx_v_self, __pyx_v_domain_dict, __pyx_v_exclude_var); + + /* 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_25VariableMinProdConstraint_2_get_product_bounds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_domain_dict, PyObject *__pyx_v_exclude_var) { + PyObject *__pyx_v_bounds = NULL; + PyObject *__pyx_v_var = NULL; + 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_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + size_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *(*__pyx_t_15)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_product_bounds", 0); + + /* "constraint/constraints.py":996 + * + * 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, 996, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bounds = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":997 + * 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, 997, __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, 997, __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, 997, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_4)) { + 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, 997, __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; + } 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, 997, __pyx_L1_error) + #endif + 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_2, __pyx_t_3)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); + #endif + ++__pyx_t_3; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 997, __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, 997, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":998 + * 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, 998, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 998, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "constraint/constraints.py":999 + * for var in self.product_vars: + * if var == exclude_var: + * continue # <<<<<<<<<<<<<< + * dom = domain_dict[var] + * bounds.append((min(dom), max(dom))) +*/ + goto __pyx_L3_continue; + + /* "constraint/constraints.py":998 + * bounds = [] + * for var in self.product_vars: + * if var == exclude_var: # <<<<<<<<<<<<<< + * continue + * dom = domain_dict[var] +*/ + } + + /* "constraint/constraints.py":1000 + * if var == exclude_var: + * continue + * dom = domain_dict[var] # <<<<<<<<<<<<<< + * bounds.append((min(dom), max(dom))) + * +*/ + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_domain_dict, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1000, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":1001 + * continue + * dom = domain_dict[var] + * bounds.append((min(dom), max(dom))) # <<<<<<<<<<<<<< + * + * if not bounds: +*/ + __pyx_t_6 = NULL; + __Pyx_INCREF(__pyx_builtin_min); + __pyx_t_7 = __pyx_builtin_min; + __pyx_t_8 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_dom}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __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_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __pyx_t_6 = NULL; + __Pyx_INCREF(__pyx_builtin_max); + __pyx_t_9 = __pyx_builtin_max; + __pyx_t_8 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_dom}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __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_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + } + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1001, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 1001, __pyx_L1_error); + __pyx_t_1 = 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, 1001, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "constraint/constraints.py":997 + * def _get_product_bounds(self, domain_dict, exclude_var=None): + * bounds = [] + * for var in self.product_vars: # <<<<<<<<<<<<<< + * if var == exclude_var: + * continue +*/ + __pyx_L3_continue:; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":1003 + * bounds.append((min(dom), max(dom))) + * + * if not bounds: # <<<<<<<<<<<<<< + * return 1, 1 + * +*/ + __pyx_t_5 = (__Pyx_PyList_GET_SIZE(__pyx_v_bounds) != 0); + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_5 < 0))) __PYX_ERR(0, 1003, __pyx_L1_error) + __pyx_t_11 = (!__pyx_t_5); + if (__pyx_t_11) { + + /* "constraint/constraints.py":1004 + * + * if not bounds: + * return 1, 1 # <<<<<<<<<<<<<< + * + * # Try all corner combinations +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[0]); + __pyx_r = __pyx_mstate_global->__pyx_tuple[0]; + goto __pyx_L0; + + /* "constraint/constraints.py":1003 + * bounds.append((min(dom), max(dom))) + * + * if not bounds: # <<<<<<<<<<<<<< + * return 1, 1 + * +*/ + } + + /* "constraint/constraints.py":1007 + * + * # 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] + * return min(products), max(products) +*/ + { /* enter inner scope */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1007, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1007, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_9); + { /* enter inner scope */ + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1007, __pyx_L15_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, 1007, __pyx_L15_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + ++__pyx_t_3; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1007, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + 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, 1007, __pyx_L15_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_12); + __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, 1007, __pyx_L15_error) + __Pyx_XGOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1007, __pyx_L15_error) + __Pyx_XGOTREF(__pyx_t_13); + } + #else + __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1007, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1007, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_13); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_14 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1007, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_L18_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_L18_unpacking_failed; + __Pyx_GOTREF(__pyx_t_13); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 1007, __pyx_L15_error) + __pyx_t_15 = NULL; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L19_unpacking_done; + __pyx_L18_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, 1007, __pyx_L15_error) + __pyx_L19_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_9genexpr25__pyx_v_lo, __pyx_t_12); + __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_9genexpr25__pyx_v_hi, __pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1007, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_9genexpr25__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr25__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_9genexpr25__pyx_v_lo) != (0)) __PYX_ERR(0, 1007, __pyx_L15_error); + __Pyx_INCREF(__pyx_9genexpr25__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr25__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_9genexpr25__pyx_v_hi) != (0)) __PYX_ERR(0, 1007, __pyx_L15_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1007, __pyx_L15_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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; + goto __pyx_L21_exit_scope; + __pyx_L15_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; + goto __pyx_L10_error; + __pyx_L21_exit_scope:; + } /* exit inner scope */ + __pyx_t_1 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1007, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_1); + __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, 1007, __pyx_L10_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_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_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1007, __pyx_L10_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, 1007, __pyx_L10_error) + } + __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, 1007, __pyx_L10_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + ++__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, 1007, __pyx_L10_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3)); + #else + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); + #endif + ++__pyx_t_3; + } + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1007, __pyx_L10_error) + } else { + __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, 1007, __pyx_L10_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_9genexpr24__pyx_v_p, __pyx_t_7); + __pyx_t_7 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr24__pyx_v_p))) __PYX_ERR(0, 1007, __pyx_L10_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_p); __pyx_9genexpr24__pyx_v_p = 0; + goto __pyx_L23_exit_scope; + __pyx_L10_error:; + __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_p); __pyx_9genexpr24__pyx_v_p = 0; + goto __pyx_L1_error; + __pyx_L23_exit_scope:; + } /* exit inner scope */ + __pyx_v_candidates = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "constraint/constraints.py":1008 + * # 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] # <<<<<<<<<<<<<< + * return min(products), max(products) + * +*/ + { /* enter inner scope */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1008, __pyx_L26_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_v_candidates; __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, 1008, __pyx_L26_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + ++__pyx_t_3; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1008, __pyx_L26_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_9genexpr26__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; + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_9genexpr26__pyx_v_p}; + __pyx_t_7 = __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_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1008, __pyx_L26_error) + __Pyx_GOTREF(__pyx_t_7); + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1008, __pyx_L26_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; + goto __pyx_L30_exit_scope; + __pyx_L26_error:; + __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_p); __pyx_9genexpr26__pyx_v_p = 0; + goto __pyx_L1_error; + __pyx_L30_exit_scope:; + } /* exit inner scope */ + __pyx_v_products = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "constraint/constraints.py":1009 + * 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) # <<<<<<<<<<<<<< + * + * def _safe_product(self, values): +*/ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = NULL; + __Pyx_INCREF(__pyx_builtin_min); + __pyx_t_7 = __pyx_builtin_min; + __pyx_t_8 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_products}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __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_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_t_1 = NULL; + __Pyx_INCREF(__pyx_builtin_max); + __pyx_t_9 = __pyx_builtin_max; + __pyx_t_8 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_products}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __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_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + } + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1009, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 1009, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_7 = 0; + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; + + /* "constraint/constraints.py":995 + * self.product_vars = product_vars + * + * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< + * bounds = [] + * for var in self.product_vars: +*/ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_AddTraceback("constraint.constraints.VariableMinProdConstraint._get_product_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_bounds); + __Pyx_XDECREF(__pyx_v_var); + __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_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":1011 + * return min(products), max(products) + * + * def _safe_product(self, values): # <<<<<<<<<<<<<< + * prod = 1 + * for v in values: +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_25VariableMinProdConstraint_5_safe_product(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_25VariableMinProdConstraint_5_safe_product = {"_safe_product", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_25VariableMinProdConstraint_5_safe_product, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_25VariableMinProdConstraint_5_safe_product(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; + 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[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_safe_product (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_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, 1011, __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, 1011, __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, 1011, __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, 1011, __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, 1011, __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, 1011, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1011, __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, 1011, __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.VariableMinProdConstraint._safe_product", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10constraint_11constraints_25VariableMinProdConstraint_4_safe_product(__pyx_self, __pyx_v_self, __pyx_v_values); + + /* 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_25VariableMinProdConstraint_4_safe_product(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_v_prod = NULL; + PyObject *__pyx_v_v = 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_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_safe_product", 0); + + /* "constraint/constraints.py":1012 + * + * def _safe_product(self, values): + * prod = 1 # <<<<<<<<<<<<<< + * for v in values: + * prod *= v +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); + __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; + + /* "constraint/constraints.py":1013 + * def _safe_product(self, values): + * prod = 1 + * for v in values: # <<<<<<<<<<<<<< + * prod *= v + * return prod +*/ + if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) { + __pyx_t_1 = __pyx_v_values; __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_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __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, 1013, __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, 1013, __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, 1013, __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, 1013, __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, 1013, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); + __pyx_t_4 = 0; + + /* "constraint/constraints.py":1014 + * 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, 1014, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_4); + __pyx_t_4 = 0; + + /* "constraint/constraints.py":1013 + * def _safe_product(self, values): + * prod = 1 + * for v in values: # <<<<<<<<<<<<<< + * prod *= v + * return prod +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":1015 + * for v in values: + * prod *= v + * return prod # <<<<<<<<<<<<<< + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_prod); + __pyx_r = __pyx_v_prod; + goto __pyx_L0; + + /* "constraint/constraints.py":1011 + * return min(products), max(products) + * + * def _safe_product(self, values): # <<<<<<<<<<<<<< + * prod = 1 + * for v in values: +*/ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("constraint.constraints.VariableMinProdConstraint._safe_product", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_prod); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":1017 + * 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] +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_25VariableMinProdConstraint_7preProcess(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_25VariableMinProdConstraint_7preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_25VariableMinProdConstraint_7preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_25VariableMinProdConstraint_7preProcess(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, 1017, __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, 1017, __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, 1017, __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, 1017, __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, 1017, __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, 1017, __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, 1017, __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, 1017, __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, 1017, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1017, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1017, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1017, __pyx_L3_error) + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1017, __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, 1017, __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.VariableMinProdConstraint.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, 1017, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1017, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1017, __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 */ + 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_25VariableMinProdConstraint_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) { + PyObject *__pyx_v_target_dom = NULL; + PyObject *__pyx_v_t_min = NULL; + PyObject *__pyx_v_var = NULL; + PyObject *__pyx_v_min_others = NULL; + PyObject *__pyx_v_max_others = NULL; + PyObject *__pyx_v_dom = NULL; + PyObject *__pyx_v_val = NULL; + PyObject *__pyx_v_possible_prods = 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; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + Py_ssize_t __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); + int __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("preProcess", 0); + + /* "constraint/constraints.py":1018 + * + * 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_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1018, __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, 1018, __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(__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, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":1019 + * 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, 1019, __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, 1019, __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":1020 + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * target_dom = domains[self.target_var] + * t_min = min(target_dom) # <<<<<<<<<<<<<< + * + * 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_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, 1020, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __pyx_v_t_min = __pyx_t_4; + __pyx_t_4 = 0; + + /* "constraint/constraints.py":1022 + * 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, 1022, __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_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, 1022, __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, 1022, __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))) { + { + 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, 1022, __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_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, 1022, __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)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1022, __pyx_L1_error) + } else { + __pyx_t_4 = __pyx_t_7(__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, 1022, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); + __pyx_t_4 = 0; + + /* "constraint/constraints.py":1023 + * + * 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_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, 1023, __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, 1023, __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; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1023, __pyx_L1_error) + __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, 1023, __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); + } else { + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1023, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1023, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_1); + } + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1023, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1023, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #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, 1023, __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, 1023, __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; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 1023, __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; + + /* "constraint/constraints.py":1024 + * 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, 1024, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_4); + __pyx_t_4 = 0; + + /* "constraint/constraints.py":1025 + * 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, 1025, __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_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, 1025, __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, 1025, __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))) { + { + 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, 1025, __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_10; + } 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, 1025, __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)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); + #endif + ++__pyx_t_10; + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1025, __pyx_L1_error) + } else { + __pyx_t_4 = __pyx_t_11(__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, 1025, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); + __pyx_t_4 = 0; + + /* "constraint/constraints.py":1026 + * 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, 1026, __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, 1026, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1026, __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, 1026, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1026, __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":1027 + * for val in dom[:]: + * possible_prods = [val * min_others, val * max_others] + * if max(possible_prods) < t_min: # <<<<<<<<<<<<<< + * dom.remove(val) + * +*/ + __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_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, 1027, __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, 1027, __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, 1027, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_12) { + + /* "constraint/constraints.py":1028 + * possible_prods = [val * min_others, val * max_others] + * if max(possible_prods) < t_min: + * dom.remove(val) # <<<<<<<<<<<<<< + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 +*/ + __pyx_t_8 = __pyx_v_dom; + __Pyx_INCREF(__pyx_t_8); + __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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1028, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":1027 + * for val in dom[:]: + * possible_prods = [val * min_others, val * max_others] + * if max(possible_prods) < t_min: # <<<<<<<<<<<<<< + * dom.remove(val) + * +*/ + } + + /* "constraint/constraints.py":1025 + * 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":1022 + * 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_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":1017 + * 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] +*/ + + /* 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_8); + __Pyx_AddTraceback("constraint.constraints.VariableMinProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_target_dom); + __Pyx_XDECREF(__pyx_v_t_min); + __Pyx_XDECREF(__pyx_v_var); + __Pyx_XDECREF(__pyx_v_min_others); + __Pyx_XDECREF(__pyx_v_max_others); + __Pyx_XDECREF(__pyx_v_dom); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_possible_prods); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":1030 + * 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 +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_25VariableMinProdConstraint_9__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_25VariableMinProdConstraint_9__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_25VariableMinProdConstraint_9__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_25VariableMinProdConstraint_9__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 +) { + PyObject *__pyx_v_self = 0; + CYTHON_UNUSED PyObject *__pyx_v_variables = 0; + PyObject *__pyx_v_domains = 0; + PyObject *__pyx_v_assignments = 0; + PyObject *__pyx_v_forwardcheck = 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("__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,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, 1030, __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, 1030, __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, 1030, __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, 1030, __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, 1030, __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, 1030, __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, 1030, __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, 1030, __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, 1030, __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, 1030, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1030, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1030, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1030, __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, 1030, __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.VariableMinProdConstraint.__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, 1030, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1030, __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 */ + 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_25VariableMinProdConstraint_8__call___2generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "constraint/constraints.py":1066 + * 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: +*/ + +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; + 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); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 1066, __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_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, 1066, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.VariableMinProdConstraint.__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_25VariableMinProdConstraint_8__call___2generator12(__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); + 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, 1066, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1066, __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, 1066, __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, 1066, __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, 1066, __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, 1066, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1066, __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":1030 + * 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 +*/ + +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; + PyObject *__pyx_v_assigned_prod = NULL; + PyObject *__pyx_v_unassigned = NULL; + PyObject *__pyx_v_var = NULL; + PyObject *__pyx_v_domain_bounds = NULL; + PyObject *__pyx_v_candidates = NULL; + PyObject *__pyx_v_possible_prods = NULL; + PyObject *__pyx_v_other_unassigned = NULL; + PyObject *__pyx_v_bounds = NULL; + PyObject *__pyx_v_other_products = NULL; + 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_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + size_t __pyx_t_12; + 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; + __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); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__ *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 1030, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + + /* "constraint/constraints.py":1031 + * + * 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, 1031, __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, 1031, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "constraint/constraints.py":1032 + * 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 # <<<<<<<<<<<<<< + * + * target_value = assignments[self.target_var] +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "constraint/constraints.py":1031 + * + * 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 + * +*/ + } + + /* "constraint/constraints.py":1034 + * 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, 1034, __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, 1034, __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":1035 + * + * target_value = assignments[self.target_var] + * assigned_prod = 1 # <<<<<<<<<<<<<< + * unassigned = [] + * +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); + __pyx_v_assigned_prod = __pyx_mstate_global->__pyx_int_1; + + /* "constraint/constraints.py":1036 + * 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, 1036, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_unassigned = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "constraint/constraints.py":1038 + * 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, 1038, __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, 1038, __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, 1038, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + 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, 1038, __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; + } 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, 1038, __pyx_L1_error) + #endif + if (__pyx_t_4 >= __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_4)); + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); + #endif + ++__pyx_t_4; + } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1038, __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, 1038, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); + __pyx_t_3 = 0; + + /* "constraint/constraints.py":1039 + * + * 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, 1039, __pyx_L1_error) + if (__pyx_t_2) { + + /* "constraint/constraints.py":1040 + * 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, 1040, __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, 1040, __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":1039 + * + * for var in self.product_vars: + * if var in assignments: # <<<<<<<<<<<<<< + * assigned_prod *= assignments[var] + * else: +*/ + goto __pyx_L6; + } + + /* "constraint/constraints.py":1042 + * assigned_prod *= assignments[var] + * else: + * unassigned.append(var) # <<<<<<<<<<<<<< + * + * 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, 1042, __pyx_L1_error) + } + __pyx_L6:; + + /* "constraint/constraints.py":1038 + * unassigned = [] + * + * for var in self.product_vars: # <<<<<<<<<<<<<< + * if var in assignments: + * assigned_prod *= assignments[var] +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":1044 + * 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, 1044, __pyx_L1_error) + __pyx_t_8 = (!__pyx_t_2); + if (__pyx_t_8) { + + /* "constraint/constraints.py":1045 + * + * if not unassigned: + * return assigned_prod >= target_value # <<<<<<<<<<<<<< + * + * # 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, 1045, __pyx_L1_error) + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "constraint/constraints.py":1044 + * unassigned.append(var) + * + * if not unassigned: # <<<<<<<<<<<<<< + * return assigned_prod >= target_value + * +*/ + } + + /* "constraint/constraints.py":1048 + * + * # 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])] + * 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, 1048, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_6); + __pyx_t_4 = 0; + for (;;) { + { + 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, 1048, __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_4; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1048, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_9genexpr27__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, 1048, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = 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)); + __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, 1048, __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, 1048, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = 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, 1048, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_10); + } + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1048, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1048, __pyx_L11_error); + __Pyx_GIVEREF(__pyx_t_10); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1048, __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, 1048, __pyx_L11_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_v); __pyx_9genexpr27__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; + 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":1049 + * # 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])] # <<<<<<<<<<<<<< + * possible_prods = [assigned_prod * c for c in candidates] + * if max(possible_prods) < target_value: +*/ + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __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, 1049, __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, 1049, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_9); + __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, 1049, __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_4; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1049, __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; + 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, 1049, __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_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, 1049, __pyx_L23_error) + __Pyx_XGOTREF(__pyx_t_13); + __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1049, __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, 1049, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1049, __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, 1049, __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; + __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, 1049, __pyx_L23_error) + __pyx_t_15 = NULL; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L27_unpacking_done; + __pyx_L26_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, 1049, __pyx_L23_error) + __pyx_L27_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_9genexpr29__pyx_v_lo, __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, 1049, __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, 1049, __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, 1049, __pyx_L23_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1049, __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; + 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; + 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, 1049, __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, 1049, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_9); + __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); + __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, 1049, __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, 1049, __pyx_L18_error) + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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, 1049, __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_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, 1049, __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)); + #else + __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_4); + #endif + ++__pyx_t_4; + } + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1049, __pyx_L18_error) + } else { + __pyx_t_9 = __pyx_t_5(__pyx_t_10); + 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, 1049, __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_t_6 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_6); + __pyx_t_12 = 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)); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1049, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_9); + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1049, __pyx_L18_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_p); __pyx_9genexpr28__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; + 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":1050 + * 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] # <<<<<<<<<<<<<< + * if max(possible_prods) < target_value: + * return False +*/ + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __pyx_v_candidates; __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, 1050, __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_4; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1050, __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, 1050, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_9); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1050, __pyx_L34_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_c); __pyx_9genexpr30__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; + 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":1051 + * 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: # <<<<<<<<<<<<<< + * return False + * +*/ + __pyx_t_10 = NULL; + __Pyx_INCREF(__pyx_builtin_max); + __pyx_t_9 = __pyx_builtin_max; + __pyx_t_12 = 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_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, 1051, __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, 1051, __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, 1051, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_8) { + + /* "constraint/constraints.py":1052 + * possible_prods = [assigned_prod * c for c in candidates] + * if max(possible_prods) < target_value: + * return False # <<<<<<<<<<<<<< + * + * if forwardcheck: +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "constraint/constraints.py":1051 + * 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: # <<<<<<<<<<<<<< + * return False + * +*/ + } + + /* "constraint/constraints.py":1054 + * 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, 1054, __pyx_L1_error) + if (__pyx_t_8) { + + /* "constraint/constraints.py":1055 + * + * 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_4 = 0; + for (;;) { + { + 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, 1055, __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_4; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":1056 + * if forwardcheck: + * 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] +*/ + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1056, __pyx_L45_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __pyx_v_unassigned; __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, 1056, __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_16; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1056, __pyx_L45_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr31__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, 1056, __pyx_L45_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1056, __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, 1056, __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; + goto __pyx_L50_exit_scope; + __pyx_L45_error:; + __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_v); __pyx_9genexpr31__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":1057 + * 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, 1057, __pyx_L1_error) + if (__pyx_t_8) { + + /* "constraint/constraints.py":1058 + * 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])] + * else: +*/ + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1058, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __pyx_v_other_unassigned; __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, 1058, __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_16; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1058, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr32__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, 1058, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = 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_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, 1058, __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, 1058, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_12 = 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, 1058, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_11); + } + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1058, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1058, __pyx_L54_error); + __Pyx_GIVEREF(__pyx_t_11); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 1058, __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, 1058, __pyx_L54_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_v); __pyx_9genexpr32__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; + 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":1059 + * 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])] # <<<<<<<<<<<<<< + * else: + * other_products = [1] +*/ + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1059, __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, 1059, __pyx_L61_error) + __Pyx_GOTREF(__pyx_t_10); + { /* enter inner scope */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1059, __pyx_L66_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __pyx_v_bounds; __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, 1059, __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_16; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1059, __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; + 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, 1059, __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_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, 1059, __pyx_L66_error) + __Pyx_XGOTREF(__pyx_t_14); + __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1059, __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, 1059, __pyx_L66_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1059, __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, 1059, __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; + __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, 1059, __pyx_L66_error) + __pyx_t_15 = NULL; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + goto __pyx_L70_unpacking_done; + __pyx_L69_unpacking_failed:; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_15 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 1059, __pyx_L66_error) + __pyx_L70_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_9genexpr34__pyx_v_lo, __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, 1059, __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, 1059, __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, 1059, __pyx_L66_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1059, __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; + 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; + 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, 1059, __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, 1059, __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_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, 1059, __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, 1059, __pyx_L61_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 1059, __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_16; + } 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, 1059, __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)); + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_16); + #endif + ++__pyx_t_16; + } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1059, __pyx_L61_error) + } else { + __pyx_t_3 = __pyx_t_5(__pyx_t_11); + 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, 1059, __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; + { + 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, 1059, __pyx_L61_error) + __Pyx_GOTREF(__pyx_t_3); + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1059, __pyx_L61_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_p); __pyx_9genexpr33__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; + 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":1057 + * 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])] +*/ + goto __pyx_L51; + } + + /* "constraint/constraints.py":1061 + * other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in bounds])] + * else: + * other_products = [1] # <<<<<<<<<<<<<< + * + * domain = domains[var] +*/ + /*else*/ { + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1061, __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, 1061, __pyx_L1_error); + __Pyx_XDECREF_SET(__pyx_v_other_products, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + } + __pyx_L51:; + + /* "constraint/constraints.py":1063 + * 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, 1063, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":1064 + * + * 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, 1064, __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_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, 1064, __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, 1064, __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))) { + { + 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, 1064, __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_16; + } 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, 1064, __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)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_16); + #endif + ++__pyx_t_16; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1064, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_5(__pyx_t_11); + 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, 1064, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":1065 + * 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): + * domain.hideValue(val) +*/ + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1065, __pyx_L79_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_v_other_products; __Pyx_INCREF(__pyx_t_3); + __pyx_t_18 = 0; + for (;;) { + { + 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, 1065, __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_18; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1065, __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, 1065, __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, 1065, __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, 1065, __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; + goto __pyx_L83_exit_scope; + __pyx_L79_error:; + __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_o); __pyx_9genexpr35__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":1066 + * 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, 1066, __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, 1066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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, 1066, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_8) { + + /* "constraint/constraints.py":1067 + * 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: + * return False +*/ + __pyx_t_1 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_12 = 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_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":1066 + * 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: +*/ + } + + /* "constraint/constraints.py":1064 + * + * 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_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "constraint/constraints.py":1068 + * 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, 1068, __pyx_L1_error) + __pyx_t_2 = (!__pyx_t_8); + if (__pyx_t_2) { + + /* "constraint/constraints.py":1069 + * domain.hideValue(val) + * if not domain: + * return False # <<<<<<<<<<<<<< + * + * return True +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L0; + + /* "constraint/constraints.py":1068 + * if all(p < target_value for p in prods): + * domain.hideValue(val) + * if not domain: # <<<<<<<<<<<<<< + * return False + * +*/ + } + + /* "constraint/constraints.py":1055 + * + * if forwardcheck: + * for var in unassigned: # <<<<<<<<<<<<<< + * other_unassigned = [v for v in unassigned if v != var] + * if other_unassigned: +*/ + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "constraint/constraints.py":1054 + * return False + * + * if forwardcheck: # <<<<<<<<<<<<<< + * for var in unassigned: + * other_unassigned = [v for v in unassigned if v != var] +*/ + } + + /* "constraint/constraints.py":1071 + * return False + * + * return True # <<<<<<<<<<<<<< + * + * +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "constraint/constraints.py":1030 + * 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 +*/ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_AddTraceback("constraint.constraints.VariableMinProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_assigned_prod); + __Pyx_XDECREF(__pyx_v_unassigned); + __Pyx_XDECREF(__pyx_v_var); + __Pyx_XDECREF(__pyx_v_domain_bounds); + __Pyx_XDECREF(__pyx_v_candidates); + __Pyx_XDECREF(__pyx_v_possible_prods); + __Pyx_XDECREF(__pyx_v_other_unassigned); + __Pyx_XDECREF(__pyx_v_bounds); + __Pyx_XDECREF(__pyx_v_other_products); + __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_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":1085 + * """ + * + * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< + * """Instantiate a MaxProdConstraint. + * +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_1__init__(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_17MaxProdConstraint___init__, "Instantiate a MaxProdConstraint.\n\n Args:\n maxprod: Value to be considered as the maximum product\n "); +static PyMethodDef __pyx_mdef_10constraint_11constraints_17MaxProdConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MaxProdConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_17MaxProdConstraint___init__}; +static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_1__init__(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_maxprod = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (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_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, 1085, __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, 1085, __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, 1085, __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, 1085, __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, 1085, __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, 1085, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1085, __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, 1085, __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.MaxProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10constraint_11constraints_17MaxProdConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_maxprod); + + /* 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_17MaxProdConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_maxprod) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "constraint/constraints.py":1091 + * maxprod: Value to be considered as the maximum product + * """ + * self._maxprod = maxprod # <<<<<<<<<<<<<< + * + * 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, 1091, __pyx_L1_error) + + /* "constraint/constraints.py":1085 + * """ + * + * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< + * """Instantiate a MaxProdConstraint. + * +*/ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":1093 + * self._maxprod = maxprod + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_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_17MaxProdConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MaxProdConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_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, 1093, __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, 1093, __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, 1093, __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, 1093, __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, 1093, __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, 1093, __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, 1093, __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, 1093, __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, 1093, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1093, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1093, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1093, __pyx_L3_error) + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1093, __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, 1093, __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.MaxProdConstraint.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, 1093, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1093, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1093, __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 */ + 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_17MaxProdConstraint_10preProcess_2generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "constraint/constraints.py":1100 + * 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): +*/ + +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; + 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, 1100, __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_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, 1100, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.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_17MaxProdConstraint_10preProcess_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, 1100, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1100, __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, 1100, __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, 1100, __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, 1100, __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, 1100, __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, 1100, __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, 1100, __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, 1100, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1100, __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":1093 + * self._maxprod = maxprod + * + * 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_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) { + PyObject *__pyx_v_variable_with_lt1 = NULL; + PyObject *__pyx_v_variable = NULL; + PyObject *__pyx_v_contains_lt1 = NULL; + 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_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 *); + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *(*__pyx_t_10)(PyObject *); + int __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + PyObject *(*__pyx_t_14)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("preProcess", 0); + + /* "constraint/constraints.py":1094 + * + * 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 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, 1094, __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, 1094, __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(__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, 1094, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":1097 + * + * # 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, 1097, __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, 1097, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":1098 + * # 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: + * contains_lt1 = any(value < 1 for value in domains[variable]) +*/ + __Pyx_INCREF(Py_None); + __pyx_v_variable_with_lt1 = Py_None; + + /* "constraint/constraints.py":1099 + * self._variable_contains_lt1: list[bool] = list() + * 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) +*/ + 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, 1099, __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, 1099, __pyx_L1_error) + } + for (;;) { + 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, 1099, __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_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, 1099, __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_1, __pyx_t_6)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1099, __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, 1099, __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":1100 + * 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, 1100, __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, 1100, __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, 1100, __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":1101 + * 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, 1101, __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, 1101, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":1099 + * self._variable_contains_lt1: list[bool] = list() + * 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) +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":1102 + * 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: + * 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, 1102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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)); + __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, 1102, __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_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, 1102, __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, 1102, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_7)) { + 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, 1102, __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_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, 1102, __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_2, __pyx_t_6)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __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, 1102, __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, 1102, __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_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1102, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1102, __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, 1102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1102, __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, 1102, __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; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1102, __pyx_L1_error) + __pyx_t_10 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_unpacking_done; + __pyx_L8_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, 1102, __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_t_4 = 0; + + /* "constraint/constraints.py":1103 + * self._variable_contains_lt1.append(contains_lt1) + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if contains_lt1 is True: # <<<<<<<<<<<<<< + * if variable_with_lt1 is not None: + * # if more than one associated variables contain less than 1, we can't prune +*/ + __pyx_t_11 = (__pyx_v_contains_lt1 == Py_True); + if (__pyx_t_11) { + + /* "constraint/constraints.py":1104 + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if contains_lt1 is True: + * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< + * # if more than one associated variables contain less than 1, we can't prune + * return +*/ + __pyx_t_11 = (__pyx_v_variable_with_lt1 != Py_None); + if (__pyx_t_11) { + + /* "constraint/constraints.py":1106 + * if variable_with_lt1 is not None: + * # if more than one associated variables contain less than 1, we can't prune + * return # <<<<<<<<<<<<<< + * variable_with_lt1 = variable + * +*/ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; + + /* "constraint/constraints.py":1104 + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if contains_lt1 is True: + * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< + * # if more than one associated variables contain less than 1, we can't prune + * return +*/ + } + + /* "constraint/constraints.py":1107 + * # if more than one associated variables contain less than 1, we can't prune + * return + * variable_with_lt1 = variable # <<<<<<<<<<<<<< + * + * # prune the associated variables of values > maxprod +*/ + __Pyx_INCREF(__pyx_v_variable); + __Pyx_DECREF_SET(__pyx_v_variable_with_lt1, __pyx_v_variable); + + /* "constraint/constraints.py":1103 + * self._variable_contains_lt1.append(contains_lt1) + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if contains_lt1 is True: # <<<<<<<<<<<<<< + * if variable_with_lt1 is not None: + * # if more than one associated variables contain less than 1, we can't prune +*/ + } + + /* "constraint/constraints.py":1102 + * 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: + * if variable_with_lt1 is not None: +*/ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":1110 + * + * # 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, 1110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_maxprod = __pyx_t_2; + __pyx_t_2 = 0; + + /* "constraint/constraints.py":1111 + * # 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: + * continue +*/ + 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; + } else { + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1111, __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, 1111, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_7)) { + 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, 1111, __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_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, 1111, __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_2, __pyx_t_6)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1111, __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, 1111, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":1112 + * maxprod = self._maxprod + * for variable in variables: + * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< + * continue + * domain = domains[variable] +*/ + __pyx_t_12 = (__pyx_v_variable_with_lt1 != Py_None); + if (__pyx_t_12) { + } else { + __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, 1112, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1112, __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":1113 + * for variable in variables: + * if variable_with_lt1 is not None and variable_with_lt1 != variable: + * continue # <<<<<<<<<<<<<< + * domain = domains[variable] + * for value in domain[:]: +*/ + goto __pyx_L13_continue; + + /* "constraint/constraints.py":1112 + * maxprod = self._maxprod + * for variable in variables: + * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< + * continue + * domain = domains[variable] +*/ + } + + /* "constraint/constraints.py":1114 + * 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, 1114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":1115 + * 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, 1115, __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_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, 1115, __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, 1115, __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))) { + { + 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, 1115, __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_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, 1115, __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)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); + #endif + ++__pyx_t_13; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1115, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_14(__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, 1115, __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":1116 + * 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, 1116, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1116, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_11) { + + /* "constraint/constraints.py":1117 + * 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_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, 1117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":1116 + * domain = domains[variable] + * for value in domain[:]: + * if value > maxprod: # <<<<<<<<<<<<<< + * domain.remove(value) + * elif value == 0 and maxprod < 0: +*/ + goto __pyx_L20; + } + + /* "constraint/constraints.py":1118 + * 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, 1118, __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, 1118, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1118, __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":1119 + * 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_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, 1119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":1118 + * if value > maxprod: + * domain.remove(value) + * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< + * domain.remove(value) + * +*/ + } + __pyx_L20:; + + /* "constraint/constraints.py":1115 + * continue + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value > maxprod: + * domain.remove(value) +*/ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":1111 + * # 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: + * continue +*/ + __pyx_L13_continue:; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":1093 + * self._maxprod = maxprod + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * +*/ + + /* 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.MaxProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_variable_with_lt1); + __Pyx_XDECREF(__pyx_v_variable); + __Pyx_XDECREF(__pyx_v_contains_lt1); + __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_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":1121 + * domain.remove(value) + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * maxprod = self._maxprod + * prod = 1 +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_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_17MaxProdConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MaxProdConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_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 +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_variables = 0; + PyObject *__pyx_v_domains = 0; + PyObject *__pyx_v_assignments = 0; + PyObject *__pyx_v_forwardcheck = 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("__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,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, 1121, __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, 1121, __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, 1121, __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, 1121, __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, 1121, __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, 1121, __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, 1121, __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, 1121, __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, 1121, __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, 1121, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1121, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1121, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1121, __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, 1121, __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.MaxProdConstraint.__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, 1121, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1121, __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 */ + 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_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; + PyObject *__pyx_v_prod = NULL; + int __pyx_v_missing; + PyObject *__pyx_v_missing_lt1 = NULL; + PyObject *__pyx_v_variable = NULL; + PyObject *__pyx_v_contains_lt1 = NULL; + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_value = 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; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + 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; + 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":1122 + * + * 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, 1122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_maxprod = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":1123 + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * maxprod = self._maxprod + * prod = 1 # <<<<<<<<<<<<<< + * missing = False + * missing_lt1 = [] +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); + __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; + + /* "constraint/constraints.py":1124 + * maxprod = self._maxprod + * prod = 1 + * missing = False # <<<<<<<<<<<<<< + * missing_lt1 = [] + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): +*/ + __pyx_v_missing = 0; + + /* "constraint/constraints.py":1125 + * prod = 1 + * missing = False + * missing_lt1 = [] # <<<<<<<<<<<<<< + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if variable in assignments: +*/ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_missing_lt1 = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":1126 + * missing = False + * missing_lt1 = [] + * 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, 1126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = 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, 1126, __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; + } else { + __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1126, __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, 1126, __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))) { + { + 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, 1126, __pyx_L1_error) + #endif + if (__pyx_t_6 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_6); + ++__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, 1126, __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_3, __pyx_t_6)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1126, __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, 1126, __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, 1126, __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_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1126, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1126, __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, 1126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1126, __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_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __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, 1126, __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; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 1126, __pyx_L1_error) + __pyx_L6_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; + + /* "constraint/constraints.py":1127 + * missing_lt1 = [] + * 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, 1127, __pyx_L1_error) + if (__pyx_t_10) { + + /* "constraint/constraints.py":1128 + * 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, 1128, __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, 1128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_2); + __pyx_t_2 = 0; + + /* "constraint/constraints.py":1127 + * missing_lt1 = [] + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if variable in assignments: # <<<<<<<<<<<<<< + * prod *= assignments[variable] + * else: +*/ + goto __pyx_L7; + } + + /* "constraint/constraints.py":1130 + * prod *= assignments[variable] + * else: + * missing = True # <<<<<<<<<<<<<< + * if contains_lt1: + * missing_lt1.append(variable) +*/ + /*else*/ { + __pyx_v_missing = 1; + + /* "constraint/constraints.py":1131 + * 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, 1131, __pyx_L1_error) + if (__pyx_t_10) { + + /* "constraint/constraints.py":1132 + * 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, 1132, __pyx_L1_error) + + /* "constraint/constraints.py":1131 + * else: + * missing = True + * if contains_lt1: # <<<<<<<<<<<<<< + * missing_lt1.append(variable) + * if isinstance(prod, float): +*/ + } + } + __pyx_L7:; + + /* "constraint/constraints.py":1126 + * missing = False + * missing_lt1 = [] + * 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; + + /* "constraint/constraints.py":1133 + * 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) { + + /* "constraint/constraints.py":1134 + * 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; + { + 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, 1134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_3); + __pyx_t_3 = 0; + + /* "constraint/constraints.py":1133 + * 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: +*/ + } + + /* "constraint/constraints.py":1135 + * 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) { + } else { + goto __pyx_L13_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, 1135, __pyx_L1_error) + __pyx_t_12 = (__pyx_t_6 == 0); + if (__pyx_t_12) { + } else { + __pyx_t_10 = __pyx_t_12; + goto __pyx_L12_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, 1135, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1135, __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) { + + /* "constraint/constraints.py":1136 + * prod = round(prod, 10) + * if (not missing or len(missing_lt1) == 0) and prod > maxprod: + * return False # <<<<<<<<<<<<<< + * if forwardcheck: + * for variable in variables: +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "constraint/constraints.py":1135 + * if isinstance(prod, float): + * prod = round(prod, 10) + * if (not missing or len(missing_lt1) == 0) and prod > maxprod: # <<<<<<<<<<<<<< + * return False + * if forwardcheck: +*/ + } + + /* "constraint/constraints.py":1137 + * 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, 1137, __pyx_L1_error) + if (__pyx_t_10) { + + /* "constraint/constraints.py":1138 + * return False + * 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] +*/ + 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; + } else { + __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1138, __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, 1138, __pyx_L1_error) + } + for (;;) { 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, 998, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1138, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -27386,7 +31843,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 998, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1138, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -27397,304 +31854,1123 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1138, __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, 998, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1138, __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_1); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":1139 + * 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, 1139, __pyx_L1_error) + if (__pyx_t_12) { + } else { + __pyx_t_10 = __pyx_t_12; + goto __pyx_L19_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, 1139, __pyx_L1_error) + if (!__pyx_t_12) { + } else { + __pyx_t_10 = __pyx_t_12; + goto __pyx_L19_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, 1139, __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) { + + /* "constraint/constraints.py":1140 + * 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, 1140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":1141 + * 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, 1141, __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; + } else { + __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1141, __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, 1141, __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))) { + { + 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, 1141, __pyx_L1_error) + #endif + if (__pyx_t_13 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_13); + ++__pyx_t_13; + } 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, 1141, __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_2, __pyx_t_13)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); + #endif + ++__pyx_t_13; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_14(__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, 1141, __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":1142 + * 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, 1142, __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, 1142, __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, 1142, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_10) { + + /* "constraint/constraints.py":1143 + * 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; + { + 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, 1143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":1142 + * domain = domains[variable] + * for value in domain[:]: + * if prod * value > maxprod: # <<<<<<<<<<<<<< + * domain.hideValue(value) + * if not domain: +*/ + } + + /* "constraint/constraints.py":1141 + * 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_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":1144 + * 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, 1144, __pyx_L1_error) + __pyx_t_12 = (!__pyx_t_10); + if (__pyx_t_12) { + + /* "constraint/constraints.py":1145 + * 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_3); __pyx_t_3 = 0; + goto __pyx_L0; + + /* "constraint/constraints.py":1144 + * if prod * value > maxprod: + * domain.hideValue(value) + * if not domain: # <<<<<<<<<<<<<< + * return False + * return True +*/ + } + + /* "constraint/constraints.py":1139 + * 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[:]: +*/ + } + + /* "constraint/constraints.py":1138 + * return False + * 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] +*/ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":1137 + * 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): +*/ + } + + /* "constraint/constraints.py":1146 + * if not domain: + * return False + * return True # <<<<<<<<<<<<<< + * + * +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "constraint/constraints.py":1121 + * domain.remove(value) + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * maxprod = self._maxprod + * prod = 1 +*/ + + /* 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_8); + __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_maxprod); + __Pyx_XDECREF(__pyx_v_prod); + __Pyx_XDECREF(__pyx_v_missing_lt1); + __Pyx_XDECREF(__pyx_v_variable); + __Pyx_XDECREF(__pyx_v_contains_lt1); + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":1160 + * """ # noqa: E501 + * + * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< + * self.target_var = target_var + * self.product_vars = product_vars +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_25VariableMaxProdConstraint_1__init__(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_25VariableMaxProdConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_25VariableMaxProdConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_25VariableMaxProdConstraint_1__init__(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_target_var = 0; + PyObject *__pyx_v_product_vars = 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("__init__ (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_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, 1160, __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, 1160, __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, 1160, __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, 1160, __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, 1160, __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, 1160, __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, 1160, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1160, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1160, __pyx_L3_error) + } + __pyx_v_self = values[0]; + __pyx_v_target_var = ((PyObject*)values[1]); + __pyx_v_product_vars = values[2]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1160, __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.VariableMaxProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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, 1160, __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 */ + 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_25VariableMaxProdConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_target_var, PyObject *__pyx_v_product_vars) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "constraint/constraints.py":1161 + * + * 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, 1161, __pyx_L1_error) + + /* "constraint/constraints.py":1162 + * 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, 1162, __pyx_L1_error) + + /* "constraint/constraints.py":1160 + * """ # noqa: E501 + * + * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< + * self.target_var = target_var + * self.product_vars = product_vars +*/ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.VariableMaxProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":1164 + * self.product_vars = product_vars + * + * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< + * bounds = [] + * for var in self.product_vars: +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_25VariableMaxProdConstraint_3_get_product_bounds(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_25VariableMaxProdConstraint_3_get_product_bounds = {"_get_product_bounds", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_25VariableMaxProdConstraint_3_get_product_bounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_25VariableMaxProdConstraint_3_get_product_bounds(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_domain_dict = 0; + PyObject *__pyx_v_exclude_var = 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("_get_product_bounds (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_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, 1164, __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) + 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) + 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) + 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, 1164, __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, 1164, __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, 1164, __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) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1164, __pyx_L3_error) + break; + default: goto __pyx_L5_argtuple_error; + } + if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); + } + __pyx_v_self = values[0]; + __pyx_v_domain_dict = values[1]; + __pyx_v_exclude_var = values[2]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1164, __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.VariableMaxProdConstraint._get_product_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint_2_get_product_bounds(__pyx_self, __pyx_v_self, __pyx_v_domain_dict, __pyx_v_exclude_var); - /* "constraint/constraints.py":999 - * 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[:]: + /* 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_25VariableMaxProdConstraint_2_get_product_bounds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_domain_dict, PyObject *__pyx_v_exclude_var) { + PyObject *__pyx_v_bounds = NULL; + PyObject *__pyx_v_var = NULL; + 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_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + size_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *(*__pyx_t_15)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_product_bounds", 0); + + /* "constraint/constraints.py":1165 + * + * def _get_product_bounds(self, domain_dict, exclude_var=None): + * bounds = [] # <<<<<<<<<<<<<< + * for var in self.product_vars: + * if var == exclude_var: */ - __pyx_t_12 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 999, __pyx_L1_error) - if (__pyx_t_12) { + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bounds = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":1166 + * 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, 1166, __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, 1166, __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, 1166, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_4)) { + 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, 1166, __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; } else { - __pyx_t_10 = __pyx_t_12; - goto __pyx_L19_bool_binop_done; + { + 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, 1166, __pyx_L1_error) + #endif + 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_2, __pyx_t_3)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); + #endif + ++__pyx_t_3; } - __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable, __pyx_v_missing_lt1, Py_NE)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 999, __pyx_L1_error) - if (!__pyx_t_12) { - } else { - __pyx_t_10 = __pyx_t_12; - goto __pyx_L19_bool_binop_done; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1166, __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, 1166, __pyx_L1_error) + PyErr_Clear(); + } + break; } - __pyx_t_13 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 999, __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_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":1000 - * 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: + /* "constraint/constraints.py":1167 + * bounds = [] + * for var in self.product_vars: + * if var == exclude_var: # <<<<<<<<<<<<<< + * continue + * dom = domain_dict[var] */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1000, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); - __pyx_t_1 = 0; + __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, 1167, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1167, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { - /* "constraint/constraints.py":1001 - * 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) + /* "constraint/constraints.py":1168 + * for var in self.product_vars: + * if var == exclude_var: + * continue # <<<<<<<<<<<<<< + * dom = domain_dict[var] + * bounds.append((min(dom), max(dom))) */ - __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, 1001, __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; - } else { - __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __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, 1001, __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))) { - { - 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, 1001, __pyx_L1_error) - #endif - if (__pyx_t_13 >= __pyx_temp) break; - } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_13); - ++__pyx_t_13; - } 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, 1001, __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_2, __pyx_t_13)); - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); - #endif - ++__pyx_t_13; - } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error) - } else { - __pyx_t_1 = __pyx_t_14(__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, 1001, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); - __pyx_t_1 = 0; + goto __pyx_L3_continue; - /* "constraint/constraints.py":1002 - * domain = domains[variable] - * for value in domain[:]: - * if prod * value > maxprod: # <<<<<<<<<<<<<< - * domain.hideValue(value) - * if not domain: + /* "constraint/constraints.py":1167 + * bounds = [] + * for var in self.product_vars: + * if var == exclude_var: # <<<<<<<<<<<<<< + * continue + * dom = domain_dict[var] */ - __pyx_t_1 = PyNumber_Multiply(__pyx_v_prod, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __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, 1002, __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, 1002, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_10) { + } - /* "constraint/constraints.py":1003 - * for value in domain[:]: - * if prod * value > maxprod: - * domain.hideValue(value) # <<<<<<<<<<<<<< - * if not domain: - * return False + /* "constraint/constraints.py":1169 + * if var == exclude_var: + * continue + * dom = domain_dict[var] # <<<<<<<<<<<<<< + * bounds.append((min(dom), max(dom))) + * */ - __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_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, 1003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_domain_dict, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":1002 - * domain = domains[variable] - * for value in domain[:]: - * if prod * value > maxprod: # <<<<<<<<<<<<<< - * domain.hideValue(value) - * if not domain: + /* "constraint/constraints.py":1170 + * continue + * dom = domain_dict[var] + * bounds.append((min(dom), max(dom))) # <<<<<<<<<<<<<< + * + * if not bounds: */ - } + __pyx_t_6 = NULL; + __Pyx_INCREF(__pyx_builtin_min); + __pyx_t_7 = __pyx_builtin_min; + __pyx_t_8 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_dom}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __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_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __pyx_t_6 = NULL; + __Pyx_INCREF(__pyx_builtin_max); + __pyx_t_9 = __pyx_builtin_max; + __pyx_t_8 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_dom}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __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_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + } + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1170, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 1170, __pyx_L1_error); + __pyx_t_1 = 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, 1170, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":1001 - * 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) + /* "constraint/constraints.py":1166 + * def _get_product_bounds(self, domain_dict, exclude_var=None): + * bounds = [] + * for var in self.product_vars: # <<<<<<<<<<<<<< + * if var == exclude_var: + * continue */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_L3_continue:; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1004 - * if prod * value > maxprod: - * domain.hideValue(value) - * if not domain: # <<<<<<<<<<<<<< - * return False - * return True + /* "constraint/constraints.py":1172 + * bounds.append((min(dom), max(dom))) + * + * if not bounds: # <<<<<<<<<<<<<< + * return 1, 1 + * */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1004, __pyx_L1_error) - __pyx_t_12 = (!__pyx_t_10); - if (__pyx_t_12) { + __pyx_t_5 = (__Pyx_PyList_GET_SIZE(__pyx_v_bounds) != 0); + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_5 < 0))) __PYX_ERR(0, 1172, __pyx_L1_error) + __pyx_t_11 = (!__pyx_t_5); + if (__pyx_t_11) { - /* "constraint/constraints.py":1005 - * domain.hideValue(value) - * if not domain: - * return False # <<<<<<<<<<<<<< - * return True + /* "constraint/constraints.py":1173 * + * if not bounds: + * return 1, 1 # <<<<<<<<<<<<<< + * + * # Try all corner combinations */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L0; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[0]); + __pyx_r = __pyx_mstate_global->__pyx_tuple[0]; + goto __pyx_L0; - /* "constraint/constraints.py":1004 - * if prod * value > maxprod: - * domain.hideValue(value) - * if not domain: # <<<<<<<<<<<<<< - * return False - * return True + /* "constraint/constraints.py":1172 + * bounds.append((min(dom), max(dom))) + * + * if not bounds: # <<<<<<<<<<<<<< + * return 1, 1 + * */ - } + } - /* "constraint/constraints.py":999 - * 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[:]: + /* "constraint/constraints.py":1176 + * + * # 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] + * return min(products), max(products) */ + { /* enter inner scope */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1176, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1176, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_9); + { /* enter inner scope */ + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1176, __pyx_L15_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, 1176, __pyx_L15_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + ++__pyx_t_3; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1176, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + 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, 1176, __pyx_L15_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_12); + __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, 1176, __pyx_L15_error) + __Pyx_XGOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1176, __pyx_L15_error) + __Pyx_XGOTREF(__pyx_t_13); + } + #else + __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1176, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1176, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_13); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_14 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1176, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_L18_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_L18_unpacking_failed; + __Pyx_GOTREF(__pyx_t_13); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 1176, __pyx_L15_error) + __pyx_t_15 = NULL; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L19_unpacking_done; + __pyx_L18_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, 1176, __pyx_L15_error) + __pyx_L19_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_9genexpr39__pyx_v_lo, __pyx_t_12); + __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_9genexpr39__pyx_v_hi, __pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1176, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_9genexpr39__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr39__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_9genexpr39__pyx_v_lo) != (0)) __PYX_ERR(0, 1176, __pyx_L15_error); + __Pyx_INCREF(__pyx_9genexpr39__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr39__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_9genexpr39__pyx_v_hi) != (0)) __PYX_ERR(0, 1176, __pyx_L15_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1176, __pyx_L15_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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; + goto __pyx_L21_exit_scope; + __pyx_L15_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; + goto __pyx_L10_error; + __pyx_L21_exit_scope:; + } /* exit inner scope */ + __pyx_t_1 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1176, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_1); + __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, 1176, __pyx_L10_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_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_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1176, __pyx_L10_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, 1176, __pyx_L10_error) + } + __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, 1176, __pyx_L10_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + ++__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, 1176, __pyx_L10_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3)); + #else + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); + #endif + ++__pyx_t_3; + } + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1176, __pyx_L10_error) + } else { + __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, 1176, __pyx_L10_error) + PyErr_Clear(); + } + break; + } } - - /* "constraint/constraints.py":998 - * return False - * 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] -*/ + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_9genexpr38__pyx_v_p, __pyx_t_7); + __pyx_t_7 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr38__pyx_v_p))) __PYX_ERR(0, 1176, __pyx_L10_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_p); __pyx_9genexpr38__pyx_v_p = 0; + goto __pyx_L23_exit_scope; + __pyx_L10_error:; + __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_p); __pyx_9genexpr38__pyx_v_p = 0; + goto __pyx_L1_error; + __pyx_L23_exit_scope:; + } /* exit inner scope */ + __pyx_v_candidates = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/constraints.py":997 - * 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): + /* "constraint/constraints.py":1177 + * # 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] # <<<<<<<<<<<<<< + * return min(products), max(products) + * */ - } + { /* enter inner scope */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L26_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_v_candidates; __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, 1177, __pyx_L26_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + ++__pyx_t_3; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1177, __pyx_L26_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_9genexpr40__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; + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_9genexpr40__pyx_v_p}; + __pyx_t_7 = __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_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1177, __pyx_L26_error) + __Pyx_GOTREF(__pyx_t_7); + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1177, __pyx_L26_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; + goto __pyx_L30_exit_scope; + __pyx_L26_error:; + __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_p); __pyx_9genexpr40__pyx_v_p = 0; + goto __pyx_L1_error; + __pyx_L30_exit_scope:; + } /* exit inner scope */ + __pyx_v_products = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/constraints.py":1006 - * if not domain: - * return False - * return True # <<<<<<<<<<<<<< - * + /* "constraint/constraints.py":1178 + * 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) # <<<<<<<<<<<<<< * + * def _safe_product(self, values): */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; + __pyx_t_1 = NULL; + __Pyx_INCREF(__pyx_builtin_min); + __pyx_t_7 = __pyx_builtin_min; + __pyx_t_8 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_products}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __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_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_t_1 = NULL; + __Pyx_INCREF(__pyx_builtin_max); + __pyx_t_9 = __pyx_builtin_max; + __pyx_t_8 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_products}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __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_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + } + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1178, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 1178, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_7 = 0; + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; goto __pyx_L0; - /* "constraint/constraints.py":981 - * domain.remove(value) + /* "constraint/constraints.py":1164 + * self.product_vars = product_vars * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * maxprod = self._maxprod - * prod = 1 + * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< + * bounds = [] + * for var in self.product_vars: */ /* 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_8); - __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_AddTraceback("constraint.constraints.VariableMaxProdConstraint._get_product_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_maxprod); - __Pyx_XDECREF(__pyx_v_prod); - __Pyx_XDECREF(__pyx_v_missing_lt1); - __Pyx_XDECREF(__pyx_v_variable); - __Pyx_XDECREF(__pyx_v_contains_lt1); - __Pyx_XDECREF(__pyx_v_domain); - __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_bounds); + __Pyx_XDECREF(__pyx_v_var); + __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_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":1020 - * """ - * - * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< - * """Instantiate a MinProdConstraint. +/* "constraint/constraints.py":1180 + * return min(products), max(products) * + * def _safe_product(self, values): # <<<<<<<<<<<<<< + * prod = 1 + * for v in values: */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_25VariableMaxProdConstraint_5_safe_product(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_17MinProdConstraint___init__, "Instantiate a MinProdConstraint.\n\n Args:\n minprod: Value to be considered as the maximum product\n "); -static PyMethodDef __pyx_mdef_10constraint_11constraints_17MinProdConstraint_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MinProdConstraint_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_17MinProdConstraint___init__}; -static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_1__init__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_25VariableMaxProdConstraint_5_safe_product = {"_safe_product", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_25VariableMaxProdConstraint_5_safe_product, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_25VariableMaxProdConstraint_5_safe_product(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_minprod = 0; + CYTHON_UNUSED PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_values = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -27705,7 +32981,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + __Pyx_RefNannySetupContext("_safe_product (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -27715,52 +32991,52 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #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_minprod,0}; + 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, 1020, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1180, __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, 1020, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1180, __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, 1020, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1180, __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, 1020, __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, 1180, __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, 1020, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, i); __PYX_ERR(0, 1180, __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, 1020, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1180, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1020, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1180, __pyx_L3_error) } __pyx_v_self = values[0]; - __pyx_v_minprod = values[1]; + __pyx_v_values = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1020, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1180, __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.MinProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.VariableMaxProdConstraint._safe_product", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_17MinProdConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_minprod); + __pyx_r = __pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint_4_safe_product(__pyx_self, __pyx_v_self, __pyx_v_values); /* function exit code */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -27770,61 +33046,163 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_minprod) { +static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint_4_safe_product(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_values) { + PyObject *__pyx_v_prod = NULL; + PyObject *__pyx_v_v = 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_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); + __Pyx_RefNannySetupContext("_safe_product", 0); - /* "constraint/constraints.py":1026 - * minprod: Value to be considered as the maximum product - * """ - * self._minprod = minprod # <<<<<<<<<<<<<< + /* "constraint/constraints.py":1181 * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 + * def _safe_product(self, values): + * prod = 1 # <<<<<<<<<<<<<< + * for v in values: + * prod *= v */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_minprod_2, __pyx_v_minprod) < 0) __PYX_ERR(0, 1026, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); + __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; - /* "constraint/constraints.py":1020 - * """ + /* "constraint/constraints.py":1182 + * def _safe_product(self, values): + * prod = 1 + * for v in values: # <<<<<<<<<<<<<< + * prod *= v + * return prod +*/ + if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) { + __pyx_t_1 = __pyx_v_values; __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_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __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, 1182, __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, 1182, __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, 1182, __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, 1182, __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, 1182, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); + __pyx_t_4 = 0; + + /* "constraint/constraints.py":1183 + * prod = 1 + * for v in values: + * prod *= v # <<<<<<<<<<<<<< + * return prod * - * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< - * """Instantiate a MinProdConstraint. +*/ + __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_4); + __pyx_t_4 = 0; + + /* "constraint/constraints.py":1182 + * def _safe_product(self, values): + * prod = 1 + * for v in values: # <<<<<<<<<<<<<< + * prod *= v + * return prod +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":1184 + * for v in values: + * prod *= v + * return prod # <<<<<<<<<<<<<< + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_prod); + __pyx_r = __pyx_v_prod; + goto __pyx_L0; + + /* "constraint/constraints.py":1180 + * return min(products), max(products) * + * def _safe_product(self, values): # <<<<<<<<<<<<<< + * prod = 1 + * for v in values: */ /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("constraint.constraints.VariableMaxProdConstraint._safe_product", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_prod); + __Pyx_XDECREF(__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":1028 - * self._minprod = minprod +/* "constraint/constraints.py":1186 + * 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] */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_3preProcess(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_25VariableMaxProdConstraint_7preProcess(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_17MinProdConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MinProdConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_3preProcess(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_25VariableMaxProdConstraint_7preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_25VariableMaxProdConstraint_7preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_25VariableMaxProdConstraint_7preProcess(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -27858,50 +33236,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, 1028, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1186, __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, 1028, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1186, __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, 1028, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1186, __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, 1028, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1186, __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, 1028, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1186, __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, 1028, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1186, __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, 1028, __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, 1186, __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, 1028, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1186, __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, 1028, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1186, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1028, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1186, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1028, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1186, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1028, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1186, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1028, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1186, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -27911,21 +33289,21 @@ 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, 1028, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1186, __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.MinProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.VariableMaxProdConstraint.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, 1028, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1028, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1028, __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); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1186, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1186, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1186, __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 */ goto __pyx_L0; @@ -27944,11 +33322,15 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -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) { - PyObject *__pyx_v_minprod = NULL; - PyObject *__pyx_v_variable = NULL; - PyObject *__pyx_v_domain = NULL; - PyObject *__pyx_v_value = NULL; +static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint_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) { + PyObject *__pyx_v_target_dom = NULL; + PyObject *__pyx_v_t_max = NULL; + PyObject *__pyx_v_var = NULL; + PyObject *__pyx_v_min_others = NULL; + PyObject *__pyx_v_max_others = NULL; + PyObject *__pyx_v_dom = NULL; + PyObject *__pyx_v_val = NULL; + PyObject *__pyx_v_possible_prods = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -27958,26 +33340,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro size_t __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); - Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_8 = NULL; PyObject *(*__pyx_t_9)(PyObject *); - int __pyx_t_10; - int __pyx_t_11; + Py_ssize_t __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); + int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1029 + /* "constraint/constraints.py":1187 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< - * - * # prune the associated variables of values > minprod + * target_dom = domains[self.target_var] + * 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, 1029, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1187, __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, 1029, __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, 1187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -27997,230 +33380,361 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro __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_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, 1029, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1032 + /* "constraint/constraints.py":1188 + * 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) * - * # 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, 1032, __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, 1188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_minprod = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1188, __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":1033 - * # prune the associated variables of values > minprod - * minprod = self._minprod - * for variable in variables: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: + /* "constraint/constraints.py":1189 + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * target_dom = domains[self.target_var] + * t_max = max(target_dom) # <<<<<<<<<<<<<< + * + * for var in self.product_vars: */ - 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_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_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, 1189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __pyx_v_t_max = __pyx_t_4; + __pyx_t_4 = 0; + + /* "constraint/constraints.py":1191 + * 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, 1191, __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_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, 1033, __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, 1033, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1191, __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, 1191, __pyx_L1_error) } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { if (likely(!__pyx_t_7)) { - 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, 1033, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1191, __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_GetItemRef(__pyx_t_2, __pyx_t_6); ++__pyx_t_6; } 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, 1033, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1191, __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_1, __pyx_t_6)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1033, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1191, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_7(__pyx_t_1); + __pyx_t_4 = __pyx_t_7(__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, 1033, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1191, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1034 - * minprod = self._minprod - * for variable in variables: - * domain = domains[variable] # <<<<<<<<<<<<<< - * for value in domain[:]: - * if value == 0 and minprod > 0: + /* "constraint/constraints.py":1192 + * + * 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_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, 1192, __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, 1192, __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; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1192, __pyx_L1_error) + __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, 1192, __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); + } else { + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1192, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_1); + } + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #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, 1192, __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, 1192, __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; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 1192, __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; + + /* "constraint/constraints.py":1193 + * 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_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1034, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1035 - * for variable in variables: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value == 0 and minprod > 0: - * domain.remove(value) + /* "constraint/constraints.py":1194 + * 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_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1035, __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, 1194, __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; + __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); + __pyx_t_10 = 0; + __pyx_t_11 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1035, __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, 1035, __pyx_L1_error) + __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __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, 1194, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { - if (likely(!__pyx_t_9)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(!__pyx_t_11)) { + 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, 1035, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1194, __pyx_L1_error) #endif - if (__pyx_t_8 >= __pyx_temp) break; + if (__pyx_t_10 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_8); - ++__pyx_t_8; + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_10); + ++__pyx_t_10; } 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, 1035, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1194, __pyx_L1_error) #endif - if (__pyx_t_8 >= __pyx_temp) break; + 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_2, __pyx_t_8)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); #endif - ++__pyx_t_8; + ++__pyx_t_10; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1035, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1194, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_9(__pyx_t_2); + __pyx_t_4 = __pyx_t_11(__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, 1035, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1194, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1036 - * domain = domains[variable] - * for value in domain[:]: - * if value == 0 and minprod > 0: # <<<<<<<<<<<<<< - * domain.remove(value) + /* "constraint/constraints.py":1195 + * 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, 1195, __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, 1195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1195, __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, 1195, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1195, __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":1196 + * for val in dom[:]: + * possible_prods = [val * min_others, val * max_others] + * if min(possible_prods) > t_max: # <<<<<<<<<<<<<< + * dom.remove(val) * */ - __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, 1036, __pyx_L1_error) - if (__pyx_t_11) { - } else { - __pyx_t_10 = __pyx_t_11; - goto __pyx_L8_bool_binop_done; + __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_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, 1196, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __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, 1036, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1036, __pyx_L1_error) + __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, 1196, __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, 1196, __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) { + if (__pyx_t_12) { - /* "constraint/constraints.py":1037 - * for value in domain[:]: - * if value == 0 and minprod > 0: - * domain.remove(value) # <<<<<<<<<<<<<< + /* "constraint/constraints.py":1197 + * possible_prods = [val * min_others, val * max_others] + * if min(possible_prods) > t_max: + * dom.remove(val) # <<<<<<<<<<<<<< * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * 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_8 = __pyx_v_dom; + __Pyx_INCREF(__pyx_t_8); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; + 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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1036 - * domain = domains[variable] - * for value in domain[:]: - * if value == 0 and minprod > 0: # <<<<<<<<<<<<<< - * domain.remove(value) + /* "constraint/constraints.py":1196 + * for val in dom[:]: + * possible_prods = [val * min_others, val * max_others] + * if min(possible_prods) > t_max: # <<<<<<<<<<<<<< + * dom.remove(val) * */ } - /* "constraint/constraints.py":1035 - * for variable in variables: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value == 0 and minprod > 0: - * domain.remove(value) + /* "constraint/constraints.py":1194 + * 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_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1033 - * # prune the associated variables of values > minprod - * minprod = self._minprod - * for variable in variables: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: + /* "constraint/constraints.py":1191 + * 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1028 - * self._minprod = minprod + /* "constraint/constraints.py":1186 + * 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] */ /* function exit code */ @@ -28231,36 +33745,41 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("constraint.constraints.VariableMaxProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_minprod); - __Pyx_XDECREF(__pyx_v_variable); - __Pyx_XDECREF(__pyx_v_domain); - __Pyx_XDECREF(__pyx_v_value); + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_target_dom); + __Pyx_XDECREF(__pyx_v_t_max); + __Pyx_XDECREF(__pyx_v_var); + __Pyx_XDECREF(__pyx_v_min_others); + __Pyx_XDECREF(__pyx_v_max_others); + __Pyx_XDECREF(__pyx_v_dom); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_possible_prods); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":1039 - * domain.remove(value) +/* "constraint/constraints.py":1199 + * dom.remove(val) * - * 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 # <<<<<<<<<<<<<< + * if self.target_var not in assignments: + * return True # Can't evaluate yet */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_5__call__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_25VariableMaxProdConstraint_9__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_17MinProdConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_17MinProdConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_5__call__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_25VariableMaxProdConstraint_9__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_25VariableMaxProdConstraint_9__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_25VariableMaxProdConstraint_9__call__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -28268,10 +33787,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_variables = 0; - CYTHON_UNUSED PyObject *__pyx_v_domains = 0; + CYTHON_UNUSED PyObject *__pyx_v_variables = 0; + PyObject *__pyx_v_domains = 0; PyObject *__pyx_v_assignments = 0; - CYTHON_UNUSED PyObject *__pyx_v_forwardcheck = 0; + PyObject *__pyx_v_forwardcheck = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -28294,53 +33813,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, 1039, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1199, __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, 1039, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1199, __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, 1039, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1199, __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, 1039, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1199, __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, 1039, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1199, __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, 1039, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1199, __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, 1039, __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, 1199, __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, 1039, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1199, __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, 1039, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1199, __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, 1039, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1199, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1039, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1199, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1039, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1199, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1039, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1199, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -28354,20 +33873,20 @@ 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, 1039, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1199, __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.MinProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.VariableMaxProdConstraint.__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, 1039, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1039, __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); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1199, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1199, __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 */ goto __pyx_L0; @@ -28385,311 +33904,1455 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint_8__call___2generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* 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) { - PyObject *__pyx_v_variable = NULL; - PyObject *__pyx_v_minprod = NULL; - PyObject *__pyx_v_prod = NULL; +/* "constraint/constraints.py":1235 + * 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: +*/ + +static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint_8__call___genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_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_20_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_20_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + 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, 1235, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___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_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, 1235, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.VariableMaxProdConstraint.__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_25VariableMaxProdConstraint_8__call___2generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_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; + 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, 1235, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1235, __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, 1235, __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, 1235, __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, 1235, __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, 1235, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1235, __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":1199 + * 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 +*/ + +static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint_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_19___call__ *__pyx_cur_scope; + PyObject *__pyx_v_assigned_prod = NULL; + PyObject *__pyx_v_unassigned = NULL; + PyObject *__pyx_v_var = NULL; + PyObject *__pyx_v_domain_bounds = NULL; + PyObject *__pyx_v_candidates = NULL; + PyObject *__pyx_v_possible_prods = NULL; + PyObject *__pyx_v_other_unassigned = NULL; + PyObject *__pyx_v_bounds = NULL; + PyObject *__pyx_v_other_products = NULL; + 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_gb_10constraint_11constraints_25VariableMaxProdConstraint_8__call___2generator14 = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; - size_t __pyx_t_7; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + size_t __pyx_t_12; + 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; __Pyx_RefNannySetupContext("__call__", 0); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_19___call__(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__, __pyx_mstate_global->__pyx_empty_tuple, NULL); + 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, 1199, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + + /* "constraint/constraints.py":1200 + * + * 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, 1200, __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, 1200, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "constraint/constraints.py":1201 + * 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 # <<<<<<<<<<<<<< + * + * target_value = assignments[self.target_var] +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "constraint/constraints.py":1200 + * + * 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 + * +*/ + } + + /* "constraint/constraints.py":1203 + * 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, 1203, __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, 1203, __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":1204 + * + * target_value = assignments[self.target_var] + * assigned_prod = 1 # <<<<<<<<<<<<<< + * unassigned = [] + * +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); + __pyx_v_assigned_prod = __pyx_mstate_global->__pyx_int_1; + + /* "constraint/constraints.py":1205 + * 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, 1205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_unassigned = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "constraint/constraints.py":1207 + * 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, 1207, __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, 1207, __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, 1207, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + 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, 1207, __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; + } 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, 1207, __pyx_L1_error) + #endif + if (__pyx_t_4 >= __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_4)); + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); + #endif + ++__pyx_t_4; + } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1207, __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, 1207, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); + __pyx_t_3 = 0; + + /* "constraint/constraints.py":1208 + * + * 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, 1208, __pyx_L1_error) + if (__pyx_t_2) { + + /* "constraint/constraints.py":1209 + * 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, 1209, __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, 1209, __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":1208 + * + * for var in self.product_vars: + * if var in assignments: # <<<<<<<<<<<<<< + * assigned_prod *= assignments[var] + * else: +*/ + goto __pyx_L6; + } + + /* "constraint/constraints.py":1211 + * assigned_prod *= assignments[var] + * else: + * unassigned.append(var) # <<<<<<<<<<<<<< + * + * 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, 1211, __pyx_L1_error) + } + __pyx_L6:; + + /* "constraint/constraints.py":1207 + * unassigned = [] + * + * for var in self.product_vars: # <<<<<<<<<<<<<< + * if var in assignments: + * assigned_prod *= assignments[var] +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":1213 + * 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, 1213, __pyx_L1_error) + __pyx_t_8 = (!__pyx_t_2); + if (__pyx_t_8) { + + /* "constraint/constraints.py":1214 + * + * if not unassigned: + * return assigned_prod <= target_value # <<<<<<<<<<<<<< + * + * # 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, 1214, __pyx_L1_error) + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "constraint/constraints.py":1213 + * unassigned.append(var) + * + * if not unassigned: # <<<<<<<<<<<<<< + * return assigned_prod <= target_value + * +*/ + } + + /* "constraint/constraints.py":1217 + * + * # 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])] + * 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, 1217, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_6); + __pyx_t_4 = 0; + for (;;) { + { + 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, 1217, __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_4; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1217, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_9genexpr41__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, 1217, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = 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)); + __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, 1217, __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, 1217, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = 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, 1217, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_10); + } + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1217, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1217, __pyx_L11_error); + __Pyx_GIVEREF(__pyx_t_10); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1217, __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, 1217, __pyx_L11_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_v); __pyx_9genexpr41__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; + 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":1218 + * # 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])] # <<<<<<<<<<<<<< + * possible_prods = [assigned_prod * c for c in candidates] + * if min(possible_prods) > target_value: +*/ + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1218, __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, 1218, __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, 1218, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_9); + __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, 1218, __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_4; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1218, __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; + 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, 1218, __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_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, 1218, __pyx_L23_error) + __Pyx_XGOTREF(__pyx_t_13); + __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1218, __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, 1218, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1218, __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, 1218, __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; + __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, 1218, __pyx_L23_error) + __pyx_t_15 = NULL; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L27_unpacking_done; + __pyx_L26_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, 1218, __pyx_L23_error) + __pyx_L27_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_9genexpr43__pyx_v_lo, __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, 1218, __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, 1218, __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, 1218, __pyx_L23_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1218, __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; + 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; + 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, 1218, __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, 1218, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_9); + __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); + __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, 1218, __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, 1218, __pyx_L18_error) + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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, 1218, __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_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, 1218, __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)); + #else + __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_4); + #endif + ++__pyx_t_4; + } + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1218, __pyx_L18_error) + } else { + __pyx_t_9 = __pyx_t_5(__pyx_t_10); + 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, 1218, __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_t_6 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_6); + __pyx_t_12 = 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)); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1218, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_9); + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1218, __pyx_L18_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_9genexpr42__pyx_v_p); __pyx_9genexpr42__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; + 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":1219 + * 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] # <<<<<<<<<<<<<< + * if min(possible_prods) > target_value: + * return False +*/ + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1219, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __pyx_v_candidates; __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, 1219, __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_4; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1219, __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, 1219, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_9); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1219, __pyx_L34_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_c); __pyx_9genexpr44__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; + 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":1220 + * 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: # <<<<<<<<<<<<<< + * return False + * +*/ + __pyx_t_10 = NULL; + __Pyx_INCREF(__pyx_builtin_min); + __pyx_t_9 = __pyx_builtin_min; + __pyx_t_12 = 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_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, 1220, __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, 1220, __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, 1220, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_8) { + + /* "constraint/constraints.py":1221 + * possible_prods = [assigned_prod * c for c in candidates] + * if min(possible_prods) > target_value: + * return False # <<<<<<<<<<<<<< + * + * if forwardcheck: +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; - /* "constraint/constraints.py":1041 - * 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 + /* "constraint/constraints.py":1220 + * 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: # <<<<<<<<<<<<<< + * return False + * */ - 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, 1041, __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, 1041, __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, 1041, __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, 1041, __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); + + /* "constraint/constraints.py":1223 + * 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, 1223, __pyx_L1_error) + if (__pyx_t_8) { + + /* "constraint/constraints.py":1224 + * + * 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_4 = 0; + for (;;) { + { + 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, 1224, __pyx_L1_error) #endif - ++__pyx_t_2; + if (__pyx_t_4 >= __pyx_temp) break; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1041, __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, 1041, __pyx_L1_error) - PyErr_Clear(); + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_4); + ++__pyx_t_4; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":1225 + * if forwardcheck: + * 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] +*/ + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1225, __pyx_L45_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __pyx_v_unassigned; __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, 1225, __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_16; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1225, __pyx_L45_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr45__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, 1225, __pyx_L45_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1225, __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, 1225, __pyx_L45_error) + } } - break; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_v); __pyx_9genexpr45__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; + 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":1226 + * 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, 1226, __pyx_L1_error) + if (__pyx_t_8) { + + /* "constraint/constraints.py":1227 + * 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])] + * else: +*/ + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __pyx_v_other_unassigned; __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, 1227, __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_16; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr46__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, 1227, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = 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_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, 1227, __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, 1227, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_12 = 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, 1227, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_11); + } + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1227, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1227, __pyx_L54_error); + __Pyx_GIVEREF(__pyx_t_11); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 1227, __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, 1227, __pyx_L54_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_v); __pyx_9genexpr46__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; + 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":1228 + * 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])] # <<<<<<<<<<<<<< + * else: + * other_products = [1] +*/ + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __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, 1228, __pyx_L61_error) + __Pyx_GOTREF(__pyx_t_10); + { /* enter inner scope */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1228, __pyx_L66_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __pyx_v_bounds; __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, 1228, __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_16; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1228, __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; + 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, 1228, __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_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, 1228, __pyx_L66_error) + __Pyx_XGOTREF(__pyx_t_14); + __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1228, __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, 1228, __pyx_L66_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1228, __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, 1228, __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; + __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, 1228, __pyx_L66_error) + __pyx_t_15 = NULL; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + goto __pyx_L70_unpacking_done; + __pyx_L69_unpacking_failed:; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_15 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 1228, __pyx_L66_error) + __pyx_L70_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_9genexpr48__pyx_v_lo, __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, 1228, __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, 1228, __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, 1228, __pyx_L66_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1228, __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; + 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; + 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, 1228, __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, 1228, __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_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, 1228, __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, 1228, __pyx_L61_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 1228, __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_16; + } 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, 1228, __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)); + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_16); + #endif + ++__pyx_t_16; + } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1228, __pyx_L61_error) + } else { + __pyx_t_3 = __pyx_t_5(__pyx_t_11); + 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, 1228, __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; + { + 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, 1228, __pyx_L61_error) + __Pyx_GOTREF(__pyx_t_3); + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1228, __pyx_L61_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_p); __pyx_9genexpr47__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; + 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":1226 + * 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])] +*/ + goto __pyx_L51; } - } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); - __pyx_t_4 = 0; - /* "constraint/constraints.py":1042 - * # check if each variable is in the assignments - * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< - * return True + /* "constraint/constraints.py":1230 + * other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in bounds])] + * else: + * other_products = [1] # <<<<<<<<<<<<<< * + * domain = domains[var] */ - __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1042, __pyx_L1_error) - if (__pyx_t_5) { + /*else*/ { + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __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, 1230, __pyx_L1_error); + __Pyx_XDECREF_SET(__pyx_v_other_products, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + } + __pyx_L51:; - /* "constraint/constraints.py":1043 - * for variable in variables: - * if variable not in assignments: - * return True # <<<<<<<<<<<<<< + /* "constraint/constraints.py":1232 + * other_products = [1] * - * # with each variable assigned, sum the values + * domain = domains[var] # <<<<<<<<<<<<<< + * for val in domain[:]: + * prods = [assigned_prod * val * o for o in other_products] */ - __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_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":1042 - * # check if each variable is in the assignments - * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< - * return True + /* "constraint/constraints.py":1233 * + * 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, 1233, __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_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, 1233, __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, 1233, __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))) { + { + 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, 1233, __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_16; + } 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, 1233, __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)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_16); + #endif + ++__pyx_t_16; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1233, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_5(__pyx_t_11); + 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, 1233, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":1041 - * 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 + /* "constraint/constraints.py":1234 + * 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): + * domain.hideValue(val) */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L79_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_v_other_products; __Pyx_INCREF(__pyx_t_3); + __pyx_t_18 = 0; + for (;;) { + { + 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, 1234, __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_18; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1234, __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, 1234, __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, 1234, __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, 1234, __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; + goto __pyx_L83_exit_scope; + __pyx_L79_error:; + __Pyx_XDECREF(__pyx_9genexpr49__pyx_v_o); __pyx_9genexpr49__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":1046 - * - * # with each variable assigned, sum the values - * minprod = self._minprod # <<<<<<<<<<<<<< - * prod = 1 - * for variable in variables: + /* "constraint/constraints.py":1235 + * 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_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_minprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1046, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_minprod = __pyx_t_1; - __pyx_t_1 = 0; + __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, 1235, __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, 1235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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, 1235, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_8) { - /* "constraint/constraints.py":1047 - * # with each variable assigned, sum the values - * minprod = self._minprod - * prod = 1 # <<<<<<<<<<<<<< - * for variable in variables: - * prod *= assignments[variable] + /* "constraint/constraints.py":1236 + * 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: + * return False */ - __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); - __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; + __pyx_t_1 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_12 = 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_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1048 - * minprod = self._minprod - * prod = 1 - * for variable in variables: # <<<<<<<<<<<<<< - * prod *= assignments[variable] - * if isinstance(prod, float): + /* "constraint/constraints.py":1235 + * 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: */ - 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, 1048, __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, 1048, __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, 1048, __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, 1048, __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, 1048, __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, 1048, __pyx_L1_error) - PyErr_Clear(); - } - break; + + /* "constraint/constraints.py":1233 + * + * 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_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "constraint/constraints.py":1049 - * prod = 1 - * for variable in variables: - * prod *= assignments[variable] # <<<<<<<<<<<<<< - * if isinstance(prod, float): - * prod = round(prod, 10) + /* "constraint/constraints.py":1237 + * if all(p > target_value for p in prods): + * domain.hideValue(val) + * if not domain: # <<<<<<<<<<<<<< + * return False + * */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1049, __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, 1049, __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; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1237, __pyx_L1_error) + __pyx_t_2 = (!__pyx_t_8); + if (__pyx_t_2) { - /* "constraint/constraints.py":1048 - * minprod = self._minprod - * prod = 1 - * for variable in variables: # <<<<<<<<<<<<<< - * prod *= assignments[variable] - * if isinstance(prod, float): + /* "constraint/constraints.py":1238 + * domain.hideValue(val) + * if not domain: + * return False # <<<<<<<<<<<<<< + * + * return True */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L0; - /* "constraint/constraints.py":1050 - * for variable in variables: - * prod *= assignments[variable] - * if isinstance(prod, float): # <<<<<<<<<<<<<< - * prod = round(prod, 10) - * return prod >= minprod + /* "constraint/constraints.py":1237 + * if all(p > target_value for p in prods): + * domain.hideValue(val) + * if not domain: # <<<<<<<<<<<<<< + * return False + * */ - __pyx_t_5 = PyFloat_Check(__pyx_v_prod); - if (__pyx_t_5) { + } - /* "constraint/constraints.py":1051 - * prod *= assignments[variable] - * if isinstance(prod, float): - * prod = round(prod, 10) # <<<<<<<<<<<<<< - * return prod >= minprod + /* "constraint/constraints.py":1224 * + * if forwardcheck: + * for var in unassigned: # <<<<<<<<<<<<<< + * other_unassigned = [v for v in unassigned if v != var] + * if other_unassigned: */ - __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_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, 1051, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); } - __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":1050 - * for variable in variables: - * prod *= assignments[variable] - * if isinstance(prod, float): # <<<<<<<<<<<<<< - * prod = round(prod, 10) - * return prod >= minprod + /* "constraint/constraints.py":1223 + * return False + * + * if forwardcheck: # <<<<<<<<<<<<<< + * for var in unassigned: + * other_unassigned = [v for v in unassigned if v != var] */ } - /* "constraint/constraints.py":1052 - * if isinstance(prod, float): - * prod = round(prod, 10) - * return prod >= minprod # <<<<<<<<<<<<<< + /* "constraint/constraints.py":1240 + * return False + * + * return True # <<<<<<<<<<<<<< * * */ __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, 1052, __pyx_L1_error) - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1039 - * domain.remove(value) + /* "constraint/constraints.py":1199 + * dom.remove(val) * - * 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 # <<<<<<<<<<<<<< + * if self.target_var not in assignments: + * return True # Can't evaluate yet */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("constraint.constraints.MinProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_AddTraceback("constraint.constraints.VariableMaxProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_variable); - __Pyx_XDECREF(__pyx_v_minprod); - __Pyx_XDECREF(__pyx_v_prod); + __Pyx_XDECREF(__pyx_v_assigned_prod); + __Pyx_XDECREF(__pyx_v_unassigned); + __Pyx_XDECREF(__pyx_v_var); + __Pyx_XDECREF(__pyx_v_domain_bounds); + __Pyx_XDECREF(__pyx_v_candidates); + __Pyx_XDECREF(__pyx_v_possible_prods); + __Pyx_XDECREF(__pyx_v_other_unassigned); + __Pyx_XDECREF(__pyx_v_bounds); + __Pyx_XDECREF(__pyx_v_other_products); + __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_gb_10constraint_11constraints_25VariableMaxProdConstraint_8__call___2generator14); + __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":1066 +/* "constraint/constraints.py":1254 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -28738,39 +35401,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, 1066, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1254, __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, 1066, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1254, __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, 1066, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1254, __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, 1066, __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, 1254, __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, 1066, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1254, __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, 1066, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1254, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1066, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1254, __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, 1066, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1254, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -28799,16 +35462,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1072 + /* "constraint/constraints.py":1260 * 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, 1072, __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, 1260, __pyx_L1_error) - /* "constraint/constraints.py":1066 + /* "constraint/constraints.py":1254 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -28828,7 +35491,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( return __pyx_r; } -/* "constraint/constraints.py":1074 +/* "constraint/constraints.py":1262 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -28879,53 +35542,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, 1074, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1262, __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, 1074, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1262, __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, 1074, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1262, __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, 1074, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1262, __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, 1074, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1262, __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, 1074, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1262, __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, 1074, __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, 1262, __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, 1074, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1262, __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, 1074, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1262, __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, 1074, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1262, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1074, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1262, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1074, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1262, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1074, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1262, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -28939,7 +35602,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, 1074, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1262, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -28972,7 +35635,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1076 + /* "constraint/constraints.py":1264 * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 * # preProcess() will remove it. * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< @@ -28988,14 +35651,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ __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, 1076, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1264, __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, 1076, __pyx_L1_error) + __PYX_ERR(0, 1264, __pyx_L1_error) - /* "constraint/constraints.py":1074 + /* "constraint/constraints.py":1262 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -29015,7 +35678,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ return __pyx_r; } -/* "constraint/constraints.py":1078 +/* "constraint/constraints.py":1266 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -29066,50 +35729,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, 1078, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1266, __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, 1078, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1266, __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, 1078, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1266, __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, 1078, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1266, __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, 1078, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1266, __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, 1078, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1266, __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, 1078, __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, 1266, __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, 1078, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1266, __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, 1078, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1266, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1078, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1266, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1078, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1266, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1078, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1266, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1078, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1266, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -29119,7 +35782,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, 1078, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1266, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -29130,9 +35793,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, 1078, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1078, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1078, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1266, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1266, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1266, __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 */ @@ -29175,19 +35838,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1079 + /* "constraint/constraints.py":1267 * * 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, 1079, __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, 1267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1080 + /* "constraint/constraints.py":1268 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -29199,9 +35862,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, 1080, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1268, __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, 1080, __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, 1268, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -29209,7 +35872,7 @@ 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, 1080, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1268, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -29219,7 +35882,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce { 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, 1080, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1268, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -29230,13 +35893,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1268, __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, 1080, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1268, __pyx_L1_error) PyErr_Clear(); } break; @@ -29246,35 +35909,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":1081 + /* "constraint/constraints.py":1269 * 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, 1081, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1082 + /* "constraint/constraints.py":1270 * 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, 1082, __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, 1270, __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, 1082, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1270, __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, 1082, __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, 1270, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -29283,7 +35946,7 @@ 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, 1082, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1270, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -29293,7 +35956,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce { 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, 1082, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1270, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -29304,13 +35967,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1082, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1270, __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, 1082, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1270, __pyx_L1_error) PyErr_Clear(); } break; @@ -29320,17 +35983,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":1083 + /* "constraint/constraints.py":1271 * 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, 1083, __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, 1271, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1084 + /* "constraint/constraints.py":1272 * for value in domain[:]: * if value not in set: * domain.remove(value) # <<<<<<<<<<<<<< @@ -29344,12 +36007,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce 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_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1084, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1083 + /* "constraint/constraints.py":1271 * domain = domains[variable] * for value in domain[:]: * if value not in set: # <<<<<<<<<<<<<< @@ -29358,7 +36021,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce */ } - /* "constraint/constraints.py":1082 + /* "constraint/constraints.py":1270 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -29368,25 +36031,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1085 + /* "constraint/constraints.py":1273 * 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, 1085, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1273, __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, 1085, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1273, __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, 1085, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1273, __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, 1085, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1273, __pyx_L1_error); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11}; @@ -29394,12 +36057,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce __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, 1085, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1080 + /* "constraint/constraints.py":1268 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -29409,27 +36072,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1086 + /* "constraint/constraints.py":1274 * 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, 1086, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1274, __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, 1086, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1274, __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, 1086, __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, 1086, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1274, __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, 1274, __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":1078 + /* "constraint/constraints.py":1266 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -29458,7 +36121,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce return __pyx_r; } -/* "constraint/constraints.py":1100 +/* "constraint/constraints.py":1288 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -29507,39 +36170,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, 1100, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1288, __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, 1100, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1288, __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, 1100, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1288, __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, 1100, __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, 1288, __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, 1100, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1288, __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, 1100, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1288, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1100, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1288, __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, 1100, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1288, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -29568,16 +36231,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1106 + /* "constraint/constraints.py":1294 * 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, 1106, __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, 1294, __pyx_L1_error) - /* "constraint/constraints.py":1100 + /* "constraint/constraints.py":1288 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -29597,7 +36260,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init return __pyx_r; } -/* "constraint/constraints.py":1108 +/* "constraint/constraints.py":1296 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -29648,53 +36311,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, 1108, __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 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1108, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1296, __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, 1108, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1296, __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, 1108, __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, 1108, __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, 1108, __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, "__call__", 0) < 0) __PYX_ERR(0, 1108, __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, 1296, __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, 1108, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1296, __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, 1108, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1296, __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, 1108, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1296, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1108, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1296, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1108, __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, 1108, __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; } @@ -29708,7 +36371,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, 1108, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1296, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -29741,7 +36404,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1110 + /* "constraint/constraints.py":1298 * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 * # preProcess() will remove it. * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< @@ -29757,14 +36420,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal __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, 1110, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1298, __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, 1110, __pyx_L1_error) + __PYX_ERR(0, 1298, __pyx_L1_error) - /* "constraint/constraints.py":1108 + /* "constraint/constraints.py":1296 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -29784,7 +36447,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal return __pyx_r; } -/* "constraint/constraints.py":1112 +/* "constraint/constraints.py":1300 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -29835,50 +36498,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, 1112, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1300, __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, 1112, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1300, __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, 1112, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1300, __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, 1112, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1300, __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, 1112, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1300, __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, 1112, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1300, __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, 1112, __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, 1300, __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, 1112, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1300, __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, 1112, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1300, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1112, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1300, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1112, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1300, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1112, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1300, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1112, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1300, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -29888,7 +36551,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, 1112, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1300, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -29899,9 +36562,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, 1112, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1112, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1112, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1300, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1300, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1300, __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 */ @@ -29944,19 +36607,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1113 + /* "constraint/constraints.py":1301 * * 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, 1113, __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, 1301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1114 + /* "constraint/constraints.py":1302 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -29968,9 +36631,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, 1114, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1302, __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, 1114, __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, 1302, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -29978,7 +36641,7 @@ 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, 1114, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1302, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -29988,7 +36651,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr { 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, 1114, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1302, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -29999,13 +36662,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1114, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1302, __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, 1114, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1302, __pyx_L1_error) PyErr_Clear(); } break; @@ -30015,35 +36678,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":1115 + /* "constraint/constraints.py":1303 * 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, 1115, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1116 + /* "constraint/constraints.py":1304 * 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, 1116, __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, 1304, __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, 1116, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1304, __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, 1116, __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, 1304, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -30052,7 +36715,7 @@ 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, 1116, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1304, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -30062,7 +36725,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr { 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, 1116, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1304, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -30073,13 +36736,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1116, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1304, __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, 1116, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1304, __pyx_L1_error) PyErr_Clear(); } break; @@ -30089,17 +36752,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":1117 + /* "constraint/constraints.py":1305 * 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, 1117, __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, 1305, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1118 + /* "constraint/constraints.py":1306 * for value in domain[:]: * if value in set: * domain.remove(value) # <<<<<<<<<<<<<< @@ -30113,12 +36776,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr 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_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1118, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1117 + /* "constraint/constraints.py":1305 * domain = domains[variable] * for value in domain[:]: * if value in set: # <<<<<<<<<<<<<< @@ -30127,7 +36790,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr */ } - /* "constraint/constraints.py":1116 + /* "constraint/constraints.py":1304 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -30137,25 +36800,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1119 + /* "constraint/constraints.py":1307 * 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, 1119, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1307, __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, 1119, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1307, __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, 1119, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1307, __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, 1119, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1307, __pyx_L1_error); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11}; @@ -30163,12 +36826,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr __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, 1119, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1114 + /* "constraint/constraints.py":1302 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -30178,27 +36841,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1120 + /* "constraint/constraints.py":1308 * 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, 1120, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1308, __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, 1120, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1308, __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, 1120, __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, 1120, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1308, __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, 1308, __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":1112 + /* "constraint/constraints.py":1300 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -30227,7 +36890,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr return __pyx_r; } -/* "constraint/constraints.py":1134 +/* "constraint/constraints.py":1322 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -30278,50 +36941,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, 1134, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1322, __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, 1134, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1322, __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, 1134, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1322, __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, 1134, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1322, __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, 1134, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1322, __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, 1134, __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, 1322, __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, 1134, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, i); __PYX_ERR(0, 1322, __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, 1134, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1322, __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, 1134, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1322, __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, 1134, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1322, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1134, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1322, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -30335,7 +36998,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, 1134, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1322, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -30364,34 +37027,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1144 + /* "constraint/constraints.py":1332 * 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, 1144, __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, 1332, __pyx_L1_error) - /* "constraint/constraints.py":1145 + /* "constraint/constraints.py":1333 * """ * 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, 1145, __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, 1333, __pyx_L1_error) - /* "constraint/constraints.py":1146 + /* "constraint/constraints.py":1334 * 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, 1146, __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, 1334, __pyx_L1_error) - /* "constraint/constraints.py":1134 + /* "constraint/constraints.py":1322 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -30411,7 +37074,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini return __pyx_r; } -/* "constraint/constraints.py":1148 +/* "constraint/constraints.py":1336 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -30462,53 +37125,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, 1148, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1336, __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, 1148, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1336, __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, 1148, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1336, __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, 1148, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1336, __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, 1148, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1336, __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, 1148, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1336, __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, 1148, __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, 1336, __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, 1148, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1336, __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, 1148, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1336, __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, 1148, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1336, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1148, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1336, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1148, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1336, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1148, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1336, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -30522,7 +37185,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, 1148, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1336, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -30533,8 +37196,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, 1148, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1148, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1336, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1336, __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 */ @@ -30579,19 +37242,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1149 + /* "constraint/constraints.py":1337 * * 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, 1149, __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, 1337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1150 + /* "constraint/constraints.py":1338 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * set = self._set * missing = 0 # <<<<<<<<<<<<<< @@ -30601,7 +37264,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":1151 + /* "constraint/constraints.py":1339 * set = self._set * missing = 0 * found = 0 # <<<<<<<<<<<<<< @@ -30611,7 +37274,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":1152 + /* "constraint/constraints.py":1340 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -30623,9 +37286,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, 1152, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1340, __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, 1152, __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, 1340, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -30633,7 +37296,7 @@ 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, 1152, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1340, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -30643,7 +37306,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { 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, 1152, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1340, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -30654,13 +37317,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1152, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1340, __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, 1152, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1340, __pyx_L1_error) PyErr_Clear(); } break; @@ -30670,36 +37333,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":1153 + /* "constraint/constraints.py":1341 * 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, 1153, __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, 1341, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1154 + /* "constraint/constraints.py":1342 * 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, 1154, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1342, __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, 1154, __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, 1342, __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, 1154, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1342, __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, 1154, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_found, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1342, __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":1153 + /* "constraint/constraints.py":1341 * found = 0 * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -30709,7 +37372,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L5; } - /* "constraint/constraints.py":1156 + /* "constraint/constraints.py":1344 * found += assignments[variable] in set * else: * missing += 1 # <<<<<<<<<<<<<< @@ -30717,14 +37380,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, 1156, __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, 1344, __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":1152 + /* "constraint/constraints.py":1340 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -30734,53 +37397,53 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1157 + /* "constraint/constraints.py":1345 * 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, 1157, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_missing); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1345, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1158 + /* "constraint/constraints.py":1346 * 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, 1158, __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, 1346, __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, 1158, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1346, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1159 + /* "constraint/constraints.py":1347 * 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, 1159, __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, 1347, __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, 1159, __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, 1347, __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, 1159, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1347, __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, 1159, __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, 1347, __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, 1159, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1347, __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":1160 + /* "constraint/constraints.py":1348 * if self._exact: * if not (found <= self._n <= missing + found): * return False # <<<<<<<<<<<<<< @@ -30792,7 +37455,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1159 + /* "constraint/constraints.py":1347 * if missing: * if self._exact: * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< @@ -30801,7 +37464,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1158 + /* "constraint/constraints.py":1346 * missing += 1 * if missing: * if self._exact: # <<<<<<<<<<<<<< @@ -30811,7 +37474,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L8; } - /* "constraint/constraints.py":1162 + /* "constraint/constraints.py":1350 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -30819,18 +37482,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, 1162, __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, 1350, __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, 1162, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __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, 1162, __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, 1350, __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, 1162, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":1163 + /* "constraint/constraints.py":1351 * else: * if self._n > missing + found: * return False # <<<<<<<<<<<<<< @@ -30842,7 +37505,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1162 + /* "constraint/constraints.py":1350 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -30853,33 +37516,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __pyx_L8:; - /* "constraint/constraints.py":1164 + /* "constraint/constraints.py":1352 * 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, 1164, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1352, __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, 1164, __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, 1352, __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, 1164, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __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, 1164, __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, 1352, __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, 1164, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1352, __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":1167 + /* "constraint/constraints.py":1355 * # All unassigned variables must be assigned to * # values in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -30891,9 +37554,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, 1167, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1355, __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, 1167, __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, 1355, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -30901,7 +37564,7 @@ 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, 1167, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1355, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -30911,7 +37574,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { 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, 1167, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1355, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -30922,13 +37585,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1167, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1355, __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, 1167, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1355, __pyx_L1_error) PyErr_Clear(); } break; @@ -30938,45 +37601,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":1168 + /* "constraint/constraints.py":1356 * # 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, 1168, __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, 1356, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1169 + /* "constraint/constraints.py":1357 * 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, 1169, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1170 + /* "constraint/constraints.py":1358 * 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, 1170, __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, 1358, __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, 1170, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1358, __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, 1170, __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, 1358, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -30985,7 +37648,7 @@ 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, 1170, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1358, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -30995,7 +37658,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { 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, 1170, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1358, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -31006,13 +37669,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __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, 1170, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1358, __pyx_L1_error) PyErr_Clear(); } break; @@ -31022,17 +37685,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":1171 + /* "constraint/constraints.py":1359 * 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, 1171, __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, 1359, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1172 + /* "constraint/constraints.py":1360 * for value in domain[:]: * if value not in set: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -31046,12 +37709,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca 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_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1171 + /* "constraint/constraints.py":1359 * domain = domains[variable] * for value in domain[:]: * if value not in set: # <<<<<<<<<<<<<< @@ -31060,7 +37723,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1170 + /* "constraint/constraints.py":1358 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -31070,18 +37733,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1173 + /* "constraint/constraints.py":1361 * 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, 1173, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1361, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_7); if (__pyx_t_5) { - /* "constraint/constraints.py":1174 + /* "constraint/constraints.py":1362 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -31094,7 +37757,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":1173 + /* "constraint/constraints.py":1361 * if value not in set: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -31103,7 +37766,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1168 + /* "constraint/constraints.py":1356 * # values in the set. * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -31112,7 +37775,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1167 + /* "constraint/constraints.py":1355 * # All unassigned variables must be assigned to * # values in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -31122,7 +37785,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1164 + /* "constraint/constraints.py":1352 * if self._n > missing + found: * return False * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< @@ -31131,7 +37794,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1157 + /* "constraint/constraints.py":1345 * else: * missing += 1 * if missing: # <<<<<<<<<<<<<< @@ -31141,7 +37804,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L7; } - /* "constraint/constraints.py":1176 + /* "constraint/constraints.py":1364 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -31149,28 +37812,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, 1176, __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, 1364, __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, 1176, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1364, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1177 + /* "constraint/constraints.py":1365 * 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, 1177, __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, 1365, __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, 1177, __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, 1365, __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, 1177, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1365, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1178 + /* "constraint/constraints.py":1366 * if self._exact: * if found != self._n: * return False # <<<<<<<<<<<<<< @@ -31182,7 +37845,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1177 + /* "constraint/constraints.py":1365 * else: * if self._exact: * if found != self._n: # <<<<<<<<<<<<<< @@ -31191,7 +37854,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1176 + /* "constraint/constraints.py":1364 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -31201,7 +37864,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L23; } - /* "constraint/constraints.py":1180 + /* "constraint/constraints.py":1368 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -31209,15 +37872,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, 1180, __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, 1368, __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, 1180, __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, 1368, __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, 1180, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1368, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1181 + /* "constraint/constraints.py":1369 * else: * if found < self._n: * return False # <<<<<<<<<<<<<< @@ -31229,7 +37892,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1180 + /* "constraint/constraints.py":1368 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -31242,7 +37905,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __pyx_L7:; - /* "constraint/constraints.py":1182 + /* "constraint/constraints.py":1370 * if found < self._n: * return False * return True # <<<<<<<<<<<<<< @@ -31254,7 +37917,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1148 + /* "constraint/constraints.py":1336 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -31282,7 +37945,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca return __pyx_r; } -/* "constraint/constraints.py":1196 +/* "constraint/constraints.py":1384 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -31333,50 +37996,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, 1196, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1384, __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, 1196, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1384, __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, 1196, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1384, __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, 1196, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1384, __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, 1196, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1384, __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, 1196, __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, 1384, __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, 1196, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, i); __PYX_ERR(0, 1384, __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, 1196, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1384, __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, 1196, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1384, __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, 1196, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1384, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1196, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1384, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -31390,7 +38053,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, 1196, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1384, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -31419,34 +38082,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1206 + /* "constraint/constraints.py":1394 * 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, 1206, __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":1207 + /* "constraint/constraints.py":1395 * """ * 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, 1207, __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, 1395, __pyx_L1_error) - /* "constraint/constraints.py":1208 + /* "constraint/constraints.py":1396 * 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, 1208, __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, 1396, __pyx_L1_error) - /* "constraint/constraints.py":1196 + /* "constraint/constraints.py":1384 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -31466,7 +38129,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ return __pyx_r; } -/* "constraint/constraints.py":1210 +/* "constraint/constraints.py":1398 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -31517,53 +38180,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, 1210, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1398, __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, 1210, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1398, __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, 1210, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1398, __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, 1210, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1398, __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, 1210, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1398, __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, 1210, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1398, __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, 1210, __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, 1398, __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, 1210, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1398, __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, 1210, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1398, __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, 1210, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1398, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1210, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1398, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1210, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1398, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1210, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1398, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -31577,7 +38240,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, 1210, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1398, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -31588,8 +38251,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, 1210, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1210, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1398, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1398, __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 */ @@ -31634,19 +38297,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1211 + /* "constraint/constraints.py":1399 * * 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, 1211, __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, 1399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1212 + /* "constraint/constraints.py":1400 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * set = self._set * missing = 0 # <<<<<<<<<<<<<< @@ -31656,7 +38319,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":1213 + /* "constraint/constraints.py":1401 * set = self._set * missing = 0 * found = 0 # <<<<<<<<<<<<<< @@ -31666,7 +38329,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":1214 + /* "constraint/constraints.py":1402 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -31678,9 +38341,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, 1214, __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, 1214, __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)) { @@ -31688,7 +38351,7 @@ 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, 1214, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1402, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -31698,7 +38361,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_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, 1214, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1402, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -31709,13 +38372,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1214, __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, 1214, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1402, __pyx_L1_error) PyErr_Clear(); } break; @@ -31725,36 +38388,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":1215 + /* "constraint/constraints.py":1403 * 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, 1215, __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, 1403, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1216 + /* "constraint/constraints.py":1404 * 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, 1216, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1404, __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, 1216, __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, 1404, __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, 1216, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1404, __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, 1216, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_found, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1404, __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":1215 + /* "constraint/constraints.py":1403 * found = 0 * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -31764,7 +38427,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L5; } - /* "constraint/constraints.py":1218 + /* "constraint/constraints.py":1406 * found += assignments[variable] not in set * else: * missing += 1 # <<<<<<<<<<<<<< @@ -31772,14 +38435,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, 1218, __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, 1406, __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":1214 + /* "constraint/constraints.py":1402 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -31789,53 +38452,53 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1219 + /* "constraint/constraints.py":1407 * 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, 1219, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_missing); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1407, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1220 + /* "constraint/constraints.py":1408 * 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, 1220, __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, 1408, __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, 1220, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1221 + /* "constraint/constraints.py":1409 * 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, 1221, __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, 1409, __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, 1221, __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, 1409, __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, 1221, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1409, __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, 1221, __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, 1409, __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, 1221, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1409, __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":1222 + /* "constraint/constraints.py":1410 * if self._exact: * if not (found <= self._n <= missing + found): * return False # <<<<<<<<<<<<<< @@ -31847,7 +38510,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1221 + /* "constraint/constraints.py":1409 * if missing: * if self._exact: * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< @@ -31856,7 +38519,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1220 + /* "constraint/constraints.py":1408 * missing += 1 * if missing: * if self._exact: # <<<<<<<<<<<<<< @@ -31866,7 +38529,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L8; } - /* "constraint/constraints.py":1224 + /* "constraint/constraints.py":1412 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -31874,18 +38537,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, 1224, __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, 1412, __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, 1224, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1412, __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, 1224, __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, 1412, __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, 1224, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1412, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":1225 + /* "constraint/constraints.py":1413 * else: * if self._n > missing + found: * return False # <<<<<<<<<<<<<< @@ -31897,7 +38560,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1224 + /* "constraint/constraints.py":1412 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -31908,33 +38571,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __pyx_L8:; - /* "constraint/constraints.py":1226 + /* "constraint/constraints.py":1414 * 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, 1226, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1414, __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, 1226, __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, 1414, __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, 1226, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1414, __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, 1226, __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, 1414, __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, 1226, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1414, __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":1229 + /* "constraint/constraints.py":1417 * # All unassigned variables must be assigned to * # values not in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -31946,9 +38609,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, 1229, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1417, __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, 1229, __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, 1417, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -31956,7 +38619,7 @@ 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, 1229, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1417, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -31966,7 +38629,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ { 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, 1229, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1417, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -31977,13 +38640,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1229, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1417, __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, 1229, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1417, __pyx_L1_error) PyErr_Clear(); } break; @@ -31993,45 +38656,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":1230 + /* "constraint/constraints.py":1418 * # 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, 1230, __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, 1418, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1231 + /* "constraint/constraints.py":1419 * 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, 1231, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1232 + /* "constraint/constraints.py":1420 * 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, 1232, __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, 1420, __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, 1232, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1420, __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, 1232, __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, 1420, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -32040,7 +38703,7 @@ 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, 1232, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1420, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -32050,7 +38713,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ { 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, 1232, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1420, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -32061,13 +38724,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1232, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1420, __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, 1232, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1420, __pyx_L1_error) PyErr_Clear(); } break; @@ -32077,17 +38740,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":1233 + /* "constraint/constraints.py":1421 * 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, 1233, __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, 1421, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1234 + /* "constraint/constraints.py":1422 * for value in domain[:]: * if value in set: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -32101,12 +38764,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ 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_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1233 + /* "constraint/constraints.py":1421 * domain = domains[variable] * for value in domain[:]: * if value in set: # <<<<<<<<<<<<<< @@ -32115,7 +38778,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1232 + /* "constraint/constraints.py":1420 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -32125,18 +38788,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1235 + /* "constraint/constraints.py":1423 * 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, 1235, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1423, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_7); if (__pyx_t_5) { - /* "constraint/constraints.py":1236 + /* "constraint/constraints.py":1424 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -32149,7 +38812,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1235 + /* "constraint/constraints.py":1423 * if value in set: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -32158,7 +38821,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1230 + /* "constraint/constraints.py":1418 * # values not in the set. * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -32167,7 +38830,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1229 + /* "constraint/constraints.py":1417 * # All unassigned variables must be assigned to * # values not in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -32177,7 +38840,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1226 + /* "constraint/constraints.py":1414 * if self._n > missing + found: * return False * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< @@ -32186,7 +38849,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1219 + /* "constraint/constraints.py":1407 * else: * missing += 1 * if missing: # <<<<<<<<<<<<<< @@ -32196,7 +38859,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L7; } - /* "constraint/constraints.py":1238 + /* "constraint/constraints.py":1426 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -32204,28 +38867,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, 1238, __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, 1426, __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, 1238, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1426, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1239 + /* "constraint/constraints.py":1427 * 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, 1239, __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, 1427, __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, 1239, __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, 1427, __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, 1239, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1427, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1240 + /* "constraint/constraints.py":1428 * if self._exact: * if found != self._n: * return False # <<<<<<<<<<<<<< @@ -32237,7 +38900,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1239 + /* "constraint/constraints.py":1427 * else: * if self._exact: * if found != self._n: # <<<<<<<<<<<<<< @@ -32246,7 +38909,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1238 + /* "constraint/constraints.py":1426 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -32256,7 +38919,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L23; } - /* "constraint/constraints.py":1242 + /* "constraint/constraints.py":1430 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -32264,15 +38927,15 @@ 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, 1242, __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, 1430, __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, 1242, __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, 1430, __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, 1242, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1430, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1243 + /* "constraint/constraints.py":1431 * else: * if found < self._n: * return False # <<<<<<<<<<<<<< @@ -32283,7 +38946,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1242 + /* "constraint/constraints.py":1430 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -32296,7 +38959,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __pyx_L7:; - /* "constraint/constraints.py":1244 + /* "constraint/constraints.py":1432 * if found < self._n: * return False * return True # <<<<<<<<<<<<<< @@ -32306,7 +38969,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1210 + /* "constraint/constraints.py":1398 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -32817,16 +39480,512 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_1_p }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr)); + (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; +} + +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_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 (((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)))) { + __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 + { + #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); + } + #endif + } +} + +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_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_2_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr_spec = { + "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, + __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct_2_genexpr", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_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_2_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 PY_VERSION_HEX >= 0x030800b1 && (!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_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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr)); + (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; +} + +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_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 (((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)))) { + __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 + { + #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); + } + #endif + } +} + +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_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_3_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_spec = { + "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, + __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct_3_genexpr", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_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_3_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 PY_VERSION_HEX >= 0x030800b1 && (!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_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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr)); + (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; +} + +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_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 (((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)))) { + __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 + { + #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); + } + #endif + } +} + +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_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_4_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_spec = { + "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, + __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct_4_genexpr", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_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_4_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 PY_VERSION_HEX >= 0x030800b1 && (!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_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_2_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr)); + 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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -32839,23 +39998,21 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_ge 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_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_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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); + 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)))) { + __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 { @@ -32870,49 +40027,56 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_gen } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_preProcess(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_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_5_preProcess(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_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_2_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_genexpr}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_preProcess}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_preProcess}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_5_preProcess}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_preProcess}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_2_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess_spec = { + "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, - __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_2_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_5_preProcess", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_preProcess, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -32934,8 +40098,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_g 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_genexpr, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_preProcess, /*tp_traverse*/ + __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_5_preProcess, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -32952,7 +40116,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_g #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_preProcess, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -32985,16 +40149,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_g }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_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)))) { - 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -33007,11 +40171,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_ge 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; +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((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_3_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_6_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -33022,8 +40186,8 @@ 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)))) { - __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); + 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); } else #endif { @@ -33038,9 +40202,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_gen } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { +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_3_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr *)o; + 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; @@ -33060,27 +40224,27 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_gen return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr}, +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_3_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_3_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr), +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|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_3_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ + "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_3_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_6_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -33102,7 +40266,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_g 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_6_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -33120,7 +40284,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_g #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_6_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -33153,16 +40317,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_g }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_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)))) { - 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -33175,21 +40339,21 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_ge 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; +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((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_4_genexpr) { + 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); + Py_CLEAR(p->__pyx_v_value); #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)))) { - __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); + 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); } else #endif { @@ -33204,9 +40368,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_gen } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) { +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_4_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr *)o; + 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; @@ -33214,33 +40378,33 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_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_4_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr}, +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_4_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_4_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr), +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|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_4_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr), /*tp_basicsize*/ + "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_4_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_7_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -33262,7 +40426,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_g 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_7_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -33280,7 +40444,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_g #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_7_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -33313,16 +40477,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_g }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_preProcess(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_11constraints___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_11constraints___pyx_scope_struct_5_preProcess > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -33335,21 +40499,21 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_pr 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; +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; #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_5_preProcess) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_8_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_m); #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)))) { - __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); + 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); } else #endif { @@ -33364,56 +40528,43 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_pre } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_preProcess(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_8_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_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_m) { + e = (*v)(p->__pyx_v_m, a); if (e) return e; } return 0; } - -static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_5_preProcess(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_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_5_preProcess_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_preProcess}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_preProcess}, - {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_5_preProcess}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_preProcess}, +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}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess_spec = { - "constraint.constraints.__pyx_scope_struct_5_preProcess", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess), +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), 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_5_preProcess_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_8_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_8_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_5_preProcess", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_8_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_preProcess, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_8_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -33435,8 +40586,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_p 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*/ 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*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_8_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -33453,7 +40604,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_p #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_preProcess, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_8_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -33486,16 +40637,16 @@ 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_9_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -33508,23 +40659,21 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_6_ge 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_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; #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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_9_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 (((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); } else #endif { @@ -33539,49 +40688,56 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_6_gen } } -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_9_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_9_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_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_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_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_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}, {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_9_preProcess_spec = { + "constraint.constraints.__pyx_scope_struct_9_preProcess", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_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, + __pyx_type_10constraint_11constraints___pyx_scope_struct_9_preProcess_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_9_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_9_preProcess", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_6_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_9_preProcess, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -33603,8 +40759,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_6_g 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*/ 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_9_preProcess, /*tp_traverse*/ + __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_9_preProcess, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -33621,7 +40777,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_9_preProcess, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -33654,16 +40810,16 @@ 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_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_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -33676,21 +40832,23 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_7_ge 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_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_7_genexpr) { + 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_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 (((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); } else #endif { @@ -33705,43 +40863,49 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_7_gen } } -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_10_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_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; } + 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_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_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_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_7_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_10_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_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_7_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_10_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -33763,7 +40927,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_7_g 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_7_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_10_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -33781,7 +40945,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_10_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -33814,16 +40978,16 @@ 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_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_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -33836,21 +41000,21 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_8_ge 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_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_8_genexpr) { + 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_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 (((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); } else #endif { @@ -33865,9 +41029,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_8_gen } } -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_11_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_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; @@ -33875,33 +41039,33 @@ 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_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_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_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_8_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_8_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_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_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_8_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -33923,7 +41087,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_8_g 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_8_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -33941,7 +41105,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_11_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -33974,16 +41138,16 @@ 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_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_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_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__)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -33996,21 +41160,21 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_9_pr 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_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_9_preProcess) { + 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_v_domains); - Py_CLEAR(p->__pyx_v_var); + Py_CLEAR(p->__pyx_v_assigned_product); + Py_CLEAR(p->__pyx_v_target_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 (((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); } else #endif { @@ -34025,56 +41189,56 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_9_pre } } -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_12___call__(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_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_v_domains) { - e = (*v)(p->__pyx_v_domains, 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_v_var) { - e = (*v)(p->__pyx_v_var, 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_9_preProcess(PyObject *o) { +static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_12___call__(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); + 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_var); - p->__pyx_v_var = Py_None; Py_INCREF(Py_None); + 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_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_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_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_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_9_preProcess_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_12___call___slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_9_preProcess = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_12___call__ = { 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_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_9_preProcess, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12___call__, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -34096,8 +41260,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_9_p 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*/ 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_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*/ @@ -34114,7 +41278,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_12___call__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -34147,16 +41311,16 @@ 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_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_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -34169,11 +41333,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_10_g 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_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_10_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -34181,11 +41345,11 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_10_ge 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_v_c); Py_CLEAR(p->__pyx_t_0); #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 (((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); } else #endif { @@ -34200,9 +41364,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_10_ge } } -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_13_genexpr(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_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; @@ -34213,8 +41377,8 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_10_ge 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_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; @@ -34222,27 +41386,27 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_10_ge 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_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_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_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_10_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr = { 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_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_10_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -34264,7 +41428,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_10_ 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_10_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_13_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -34282,7 +41446,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_13_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -34315,16 +41479,16 @@ 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_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_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -34337,21 +41501,23 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_11_g 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_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_11_genexpr) { + 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_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 (((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); } else #endif { @@ -34366,43 +41532,49 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_ge } } -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_14_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_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_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_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_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_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_11_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_14_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_14_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_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_11_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_14_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -34424,7 +41596,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_ 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_14_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -34442,7 +41614,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_14_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -34475,16 +41647,16 @@ 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_15_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -34497,21 +41669,22 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12__ 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_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; #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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_15_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); #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 (((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); } else #endif { @@ -34526,56 +41699,46 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12___ } } -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_15_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_15_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_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; } - 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_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}, {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_15_genexpr_spec = { + "constraint.constraints.__pyx_scope_struct_15_genexpr", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_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, + __pyx_type_10constraint_11constraints___pyx_scope_struct_15_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_12___call__ = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_15_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_15_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12___call__, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_15_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -34597,8 +41760,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_12_ 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*/ 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_15_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -34615,7 +41778,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_15_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -34648,16 +41811,16 @@ 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_16___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_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__)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -34670,23 +41833,20 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_13_g 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_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; #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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_16___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 (((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); } else #endif { @@ -34701,49 +41861,50 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13_ge } } -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_16___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_16___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___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_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_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_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__}, {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_16___call___spec = { + "constraint.constraints.__pyx_scope_struct_16___call__", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___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, + __pyx_type_10constraint_11constraints___pyx_scope_struct_16___call___slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_16___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_16___call__", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_16___call__, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -34765,8 +41926,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_13_ 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*/ 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_16___call__, /*tp_traverse*/ + __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_16___call__, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -34783,7 +41944,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_16___call__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -34816,16 +41977,16 @@ 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_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_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -34838,11 +41999,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_14_g 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_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_14_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_17_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -34850,11 +42011,10 @@ 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 (((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); } else #endif { @@ -34869,9 +42029,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_14_ge } } -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_17_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_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; @@ -34882,36 +42042,33 @@ 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_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_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_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_14_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_17_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_14_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_17_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_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_14_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_17_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -34933,7 +42090,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_14_ 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_14_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_17_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -34951,7 +42108,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_17_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -34984,16 +42141,16 @@ 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_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_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -35006,22 +42163,21 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_15_g 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_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_15_genexpr) { + 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_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 (((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); } else #endif { @@ -35036,46 +42192,43 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_15_ge } } -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_18_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_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_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_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_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_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_15_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_18_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_15_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_18_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_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_15_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_18_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -35097,7 +42250,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_15_ 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_15_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_18_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -35115,7 +42268,173 @@ 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_18_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 PY_VERSION_HEX >= 0x030800b1 && (!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_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_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__)); + (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; +} + +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_19___call__) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_target_value); + #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); + } else + #endif + { + #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); + } + #endif + } +} + +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_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_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_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_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_19___call___slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_19___call__ = { + 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*/ + 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 + 0, /*tp_vectorcall_offset*/ + #endif + 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|Py_TPFLAGS_HAVE_FINALIZE, /*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*/ + 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_19___call__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -35148,16 +42467,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_15_ }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_16_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_16_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -35170,21 +42489,22 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_16_g return 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; +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_16_genexpr) { + 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_16_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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); + 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); } else #endif { @@ -35199,43 +42519,46 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_16_ge } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_16_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_16_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_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_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}, +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_16_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_16_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_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_16_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_20_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_16_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_20_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_16_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_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_16_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_20_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -35257,7 +42580,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_16_ 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_16_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_20_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -35275,7 +42598,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_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*/ @@ -35634,19 +42957,83 @@ 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_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, 960, __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, 960, __pyx_L1_error) + __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, 1030, __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, 1030, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_16_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16___call__ = &__pyx_type_10constraint_11constraints___pyx_scope_struct_16___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_16_genexpr) < 0) __PYX_ERR(0, 960, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16___call__) < 0) __PYX_ERR(0, 1030, __pyx_L1_error) #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_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; + 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; + } + #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, 1066, __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, 1066, __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, 1066, __pyx_L1_error) + #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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr->tp_getattro = PyObject_GenericGetAttr; + } + #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, 1100, __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, 1100, __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, 1100, __pyx_L1_error) + #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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr->tp_getattro = PyObject_GenericGetAttr; + } + #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, 1199, __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, 1199, __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, 1199, __pyx_L1_error) + #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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__->tp_getattro = PyObject_GenericGetAttr; + } + #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, 1235, __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, 1235, __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, 1235, __pyx_L1_error) + #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 __Pyx_RefNannyFinishContext(); @@ -35923,6 +43310,13 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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) + /*--- Initialize various global constants etc. ---*/ + 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 @@ -35939,10 +43333,6 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ - /*--- Initialize various global constants etc. ---*/ - 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 (__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) } @@ -36069,7 +43459,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[13])); if (unlikely(!__pyx_t_4)) __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_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); @@ -36090,7 +43480,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[14])); if (unlikely(!__pyx_t_3)) __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); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -36109,7 +43499,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[15])); if (unlikely(!__pyx_t_4)) __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_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) @@ -36170,7 +43560,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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[16])); if (unlikely(!__pyx_t_6)) __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); @@ -36190,7 +43580,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[17])); if (unlikely(!__pyx_t_4)) __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) @@ -36261,7 +43651,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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[18])); if (unlikely(!__pyx_t_6)) __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); @@ -36276,7 +43666,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); * 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[19])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L1_error) + __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) @@ -36338,7 +43728,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[20])); if (unlikely(!__pyx_t_3)) __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) @@ -36410,7 +43800,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[21])); if (unlikely(!__pyx_t_5)) __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) @@ -36481,7 +43871,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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[22])); if (unlikely(!__pyx_t_4)) __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); @@ -36502,7 +43892,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[23])); if (unlikely(!__pyx_t_6)) __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; @@ -36521,7 +43911,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[24])); if (unlikely(!__pyx_t_4)) __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_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); @@ -36579,7 +43969,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[25])); if (unlikely(!__pyx_t_6)) __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_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); @@ -36600,7 +43990,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[26])); if (unlikely(!__pyx_t_3)) __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_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -36619,7 +44009,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[27])); if (unlikely(!__pyx_t_6)) __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); @@ -36676,7 +44066,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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[28])); if (unlikely(!__pyx_t_3)) __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); @@ -36696,7 +44086,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[29])); if (unlikely(!__pyx_t_5)) __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_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); @@ -36754,7 +44144,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[30])); if (unlikely(!__pyx_t_3)) __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); @@ -36775,7 +44165,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[31])); if (unlikely(!__pyx_t_4)) __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_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -36794,7 +44184,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[32])); if (unlikely(!__pyx_t_3)) __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); @@ -36851,7 +44241,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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[33])); if (unlikely(!__pyx_t_4)) __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) __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); @@ -36872,7 +44262,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[34])); if (unlikely(!__pyx_t_6)) __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) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -36891,7 +44281,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[35])); if (unlikely(!__pyx_t_4)) __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) __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_6); @@ -36949,7 +44339,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[36])); if (unlikely(!__pyx_t_6)) __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) __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_5); @@ -36970,7 +44360,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[37])); if (unlikely(!__pyx_t_5)) __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) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -36989,7 +44379,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[38])); if (unlikely(!__pyx_t_6)) __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) __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); @@ -37045,7 +44435,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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[39])); if (unlikely(!__pyx_t_5)) __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_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -37065,7 +44455,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[40])); if (unlikely(!__pyx_t_3)) __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); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -37084,7 +44474,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[41])); if (unlikely(!__pyx_t_5)) __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_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); @@ -37141,7 +44531,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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[42])); if (unlikely(!__pyx_t_3)) __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); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -37155,7 +44545,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); * """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[43])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 849, __pyx_L1_error) + __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) @@ -37168,7 +44558,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); * 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[44])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) + __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, 867, __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, 867, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -37186,7 +44576,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 873, __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, 873, __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, 873, __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[45])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __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, 873, __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; @@ -37205,7 +44595,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 888, __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, 888, __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, 888, __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[46])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 888, __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, 888, __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); @@ -37231,8 +44621,8 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); /* "constraint/constraints.py":934 * * - * class MaxProdConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables create a product up to at most a given amount. + * 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, 934, __pyx_L1_error) @@ -37244,7 +44634,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 934, __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_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_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 934, __pyx_L1_error) + __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, 934, __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, 934, __pyx_L1_error) @@ -37254,14 +44644,14 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); /* "constraint/constraints.py":945 * """ * - * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< - * """Instantiate a MaxProdConstraint. + * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< + * """Instantiate a MinProdConstraint. * */ __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 945, __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_Union_int_float) < 0) __PYX_ERR(0, 945, __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[47])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 945, __pyx_L1_error) + 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, 945, __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, 945, __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; @@ -37269,7 +44659,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":953 - * self._maxprod = maxprod + * self._minprod = minprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) @@ -37281,449 +44671,691 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 953, __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, 953, __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, 953, __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[48])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 953, __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, 953, __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_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 953, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":981 + /* "constraint/constraints.py":964 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * maxprod = self._maxprod - * prod = 1 + * # check if each variable is in the assignments + * for variable in variables: */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 964, __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, 981, __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, 981, __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, 981, __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[49])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 981, __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, 964, __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, 964, __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, 964, __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, 964, __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_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, 981, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 964, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":934 * * - * class MaxProdConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables create a product up to at most a given amount. + * class MinProdConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of given variables create a product up to at least a given amount. * */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 934, __pyx_L1_error) + __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, 934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 934, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 934, __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_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1009 + /* "constraint/constraints.py":980 * * - * class MinProdConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables create a product up to at least a given amount. + * 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, 1009, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 980, __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, 1009, __pyx_L1_error) + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 980, __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, 1009, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 980, __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, 1009, __pyx_L1_error) + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 980, __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_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_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1009, __pyx_L1_error) + __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, 980, __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, 1009, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 980, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1020 + /* "constraint/constraints.py":991 * """ * - * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< - * """Instantiate a MinProdConstraint. - * + * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< + * self.target_var = target_var + * self.product_vars = product_vars */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1020, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_minprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 1020, __pyx_L1_error) - __pyx_t_6 = __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[50])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1020, __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, 991, __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, 991, __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, 991, __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_init, __pyx_t_6) < 0) __PYX_ERR(0, 1020, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 991, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1028 - * self._minprod = minprod + /* "constraint/constraints.py":995 + * self.product_vars = product_vars + * + * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< + * 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, 995, __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, 995, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "constraint/constraints.py":1011 + * 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, 1011, __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, 1011, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "constraint/constraints.py":1017 + * 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, 1028, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1017, __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, 1028, __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, 1028, __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, 1028, __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, 1028, __pyx_L1_error) - __pyx_t_5 = __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[51])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1028, __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, 1017, __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, 1017, __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, 1017, __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, 1017, __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, 1017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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, 1028, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 1017, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1039 - * domain.remove(value) + /* "constraint/constraints.py":1030 + * dom.remove(val) * - * 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 # <<<<<<<<<<<<<< + * 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, 1039, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1030, __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, 1039, __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, 1039, __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, 1039, __pyx_L1_error) - __pyx_t_6 = __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[52])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __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, 1030, __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, 1030, __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, 1030, __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, 1030, __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, 1039, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 1030, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1009 + /* "constraint/constraints.py":980 * * - * class MinProdConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables create a product up to at least a given amount. + * 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_MinProdConstraint, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1009, __pyx_L1_error) + __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, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 1009, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 980, __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_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1055 + /* "constraint/constraints.py":1074 * * - * class InSetConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables are present in the given set. + * 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, 1055, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1074, __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, 1055, __pyx_L1_error) + __pyx_t_3 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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, 1055, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1074, __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, 1055, __pyx_L1_error) + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1074, __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, 1055, __pyx_L1_error) + __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, 1074, __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, 1055, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 1074, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1066 + /* "constraint/constraints.py":1085 * """ * - * def __init__(self, set): # <<<<<<<<<<<<<< - * """Initialization method. + * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< + * """Instantiate a MaxProdConstraint. * */ - __pyx_t_3 = __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[53])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1085, __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, 1066, __pyx_L1_error) + 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, 1085, __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, 1085, __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, 1085, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1074 - * self._set = set + /* "constraint/constraints.py":1093 + * self._maxprod = maxprod + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * - * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * # preProcess() will remove it. - * raise RuntimeError("Can't happen") */ - __pyx_t_3 = __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[54])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1074, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1093, __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, 1093, __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, 1093, __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, 1093, __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, 1093, __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, 1093, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[1]); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_3) < 0) __PYX_ERR(0, 1074, __pyx_L1_error) + __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, 1093, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1078 - * raise RuntimeError("Can't happen") + /* "constraint/constraints.py":1121 + * domain.remove(value) * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * set = self._set - * for variable in variables: + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * maxprod = self._maxprod + * prod = 1 */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1078, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1121, __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, 1078, __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, 1078, __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, 1078, __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, 1078, __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[55])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1078, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1121, __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, 1121, __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, 1121, __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, 1121, __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_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 1078, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 1121, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1055 + /* "constraint/constraints.py":1074 * * - * class InSetConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables are present in the given set. + * 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_InSetConstraint, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1055, __pyx_L1_error) + __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, 1074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 1074, __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":1089 + /* "constraint/constraints.py":1149 * * - * class NotInSetConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables are not present in the given set. + * 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, 1089, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1149, __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, 1089, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1149, __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, 1089, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1149, __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, 1089, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1149, __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, 1089, __pyx_L1_error) + __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, 1149, __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, 1089, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 1149, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1100 - * """ - * - * def __init__(self, set): # <<<<<<<<<<<<<< - * """Initialization method. + /* "constraint/constraints.py":1160 + * """ # 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_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[56])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1100, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 1100, __pyx_L1_error) + 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, 1160, __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, 1160, __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, 1160, __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, 1160, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1108 - * self._set = set + /* "constraint/constraints.py":1164 + * self.product_vars = product_vars * - * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * # preProcess() will remove it. - * raise RuntimeError("Can't happen") + * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< + * bounds = [] + * for var in self.product_vars: */ - __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[57])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1108, __pyx_L1_error) + __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, 1164, __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, 1164, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":1180 + * 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, 1180, __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, 1180, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":1186 + * 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, 1186, __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, 1186, __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, 1186, __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, 1186, __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, 1186, __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, 1186, __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_call, __pyx_t_4) < 0) __PYX_ERR(0, 1108, __pyx_L1_error) + __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, 1186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1112 - * raise RuntimeError("Can't happen") + /* "constraint/constraints.py":1199 + * dom.remove(val) * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * set = self._set - * for variable in variables: + * 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(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1112, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1199, __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, 1112, __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, 1112, __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, 1112, __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, 1112, __pyx_L1_error) - __pyx_t_3 = __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[58])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __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, 1199, __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, 1199, __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, 1199, __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, 1199, __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_preProcess, __pyx_t_3) < 0) __PYX_ERR(0, 1112, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_3) < 0) __PYX_ERR(0, 1199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1089 + /* "constraint/constraints.py":1149 * * - * class NotInSetConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables are not present in the given set. + * 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_NotInSetConstraint, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1089, __pyx_L1_error) + __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, 1149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 1089, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 1149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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":1123 + /* "constraint/constraints.py":1243 * * - * class SomeInSetConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that at least some of the values of given variables must be present in a given set. + * 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, 1123, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1243, __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, 1123, __pyx_L1_error) + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1243, __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, 1123, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1243, __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, 1123, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1243, __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_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_3)) __PYX_ERR(0, 1123, __pyx_L1_error) + __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, 1243, __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, 1123, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 1243, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1134 + /* "constraint/constraints.py":1254 * """ * - * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< + * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * */ - __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[59])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1134, __pyx_L1_error) + __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, 1254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[4]); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 1134, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 1254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1148 - * self._exact = exact + /* "constraint/constraints.py":1262 + * self._set = set * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * 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, 1262, __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, 1262, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "constraint/constraints.py":1266 + * raise RuntimeError("Can't happen") + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set - * missing = 0 + * for variable in variables: */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1148, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1266, __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, 1148, __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, 1148, __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, 1148, __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[60])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1148, __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, 1266, __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, 1266, __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, 1266, __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, 1266, __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, 1266, __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_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, 1148, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 1266, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1123 + /* "constraint/constraints.py":1243 * * - * class SomeInSetConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that at least some of the values of given variables must be present in a given set. + * 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_SomeInSetConstraint, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1123, __pyx_L1_error) + __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, 1243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 1123, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 1243, __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_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1185 + /* "constraint/constraints.py":1277 * * - * class SomeNotInSetConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that at least some of the values of given variables must not be present in a given set. + * 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, 1185, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1277, __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, 1185, __pyx_L1_error) + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1277, __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, 1185, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1277, __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, 1185, __pyx_L1_error) + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1277, __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_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, 1185, __pyx_L1_error) + __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, 1277, __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, 1185, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 1277, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1196 + /* "constraint/constraints.py":1288 * """ * - * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< + * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * */ - __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[61])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1196, __pyx_L1_error) + __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, 1288, __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, 1288, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "constraint/constraints.py":1296 + * 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, 1296, __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, 1296, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "constraint/constraints.py":1300 + * 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, 1300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[4]); - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(0, 1196, __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, 1300, __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, 1300, __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, 1300, __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, 1300, __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, 1300, __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, 1300, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "constraint/constraints.py":1277 + * + * + * 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, 1277, __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, 1277, __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_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1210 + /* "constraint/constraints.py":1311 + * + * + * 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, 1311, __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, 1311, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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, 1311, __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, 1311, __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, 1311, __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, 1311, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":1322 + * """ + * + * 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, 1322, __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, 1322, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":1336 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * missing = 0 */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1210, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1336, __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, 1336, __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, 1336, __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, 1336, __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, 1336, __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, 1210, __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, 1210, __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, 1210, __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[62])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1210, __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_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, 1336, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "constraint/constraints.py":1311 + * + * + * 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, 1311, __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, 1311, __pyx_L1_error) __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, 1210, __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_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1185 + /* "constraint/constraints.py":1373 * * * 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_6 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1185, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1373, __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, 1373, __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, 1373, __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, 1373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 1185, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __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, 1373, __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, 1373, __pyx_L1_error) + } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":1384 + * """ + * + * 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, 1384, __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, 1384, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":1398 + * 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, 1398, __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, 1398, __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, 1398, __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, 1398, __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, 1398, __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, 1398, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":1373 + * + * + * 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, 1373, __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, 1373, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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":1 @@ -37817,6 +45449,8 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -37902,12 +45536,26 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -37921,6 +45569,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -37978,6 +45627,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -37985,6 +45635,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -38001,9 +45652,11 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -38013,9 +45666,11 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -38028,11 +45683,15 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -38043,9 +45702,11 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -38074,7 +45735,7 @@ static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { __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, 1076, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 1264, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -38141,14 +45802,14 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); - /* "constraint/constraints.py":1134 + /* "constraint/constraints.py":1322 * """ * * 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, 1134, __pyx_L1_error) + __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, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]); __Pyx_RefNannyFinishContext(); @@ -38261,259 +45922,319 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { __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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 960, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1066, 2}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1100, 2}; 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_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) 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_k_Q, 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), 1235, 2}; + 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; } { const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 11, 20}; 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[13] = __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[13])) goto bad; + __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; } { const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 36, 109}; 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[14] = __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[14])) 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_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; } { const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 64, 151}; 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[15] = __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[15])) 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_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; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 126, 25}; 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[16] = __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[16])) 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_init, __pyx_k_Zz_IQ_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 138, 142}; 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[17] = __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[17])) 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_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; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 194, 23}; 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_U_A_IQ_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) 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_init, __pyx_k_U_A_IQ_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 198, 19}; 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[19] = __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[19])) 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_call, __pyx_k_88XXY, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 213, 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_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[20] = __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[20])) 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_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; } { const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 251, 160}; 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[21] = __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[21])) 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_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; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 289, 27}; 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[22] = __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[22])) 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_init, __pyx_k_4M_M_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) 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[23] = __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[23])) 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_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, 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[24] = __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[24])) goto bad; + __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 = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 377, 86}; 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[25] = __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[25])) goto bad; + __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; } { const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 396, 220}; 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[26] = __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[26])) 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_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; } { const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 418, 347}; 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[27] = __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[27])) 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_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; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 481, 27}; 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[28] = __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[28])) 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_init, __pyx_k_2_q_Kq_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) 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[29] = __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[29])) 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_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 = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 524, 86}; 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[30] = __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[30])) goto bad; + __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; } { const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 543, 114}; 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[31] = __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[31])) goto bad; + __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; } { const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 556, 184}; 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[32] = __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[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_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; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 595, 27}; 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[33] = __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[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_init, __pyx_k_2_q_Kq_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) 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[34] = __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[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_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, 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[35] = __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[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_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 = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 694, 86}; 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[36] = __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[36])) goto bad; + __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; } { const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 713, 114}; 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[37] = __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[37])) goto bad; + __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; } { const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 726, 184}; 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[38] = __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[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_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; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 765, 14}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exactprod}; - __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_init, __pyx_k_N, 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_init, __pyx_k_N, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 773, 216}; 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[40] = __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[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_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; } { 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[41] = __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[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_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 = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 839, 25}; 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[42] = __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[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_init, __pyx_k_6a_N_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[44])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 849, 151}; 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[43] = __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_3avS_Qb_E_4q_3a_Qb, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) goto bad; + __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_3avS_Qb_E_4q_3a_Qb, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 867, 24}; 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[44] = __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[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_safe_product, __pyx_k_A_q_E_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[46])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 873, 167}; 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[45] = __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[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_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; } { const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 32, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 888, 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[46] = __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[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_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 = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 945, 14}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 953, 92}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 964, 95}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 991, 23}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 995, 138}; + 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_3avS_4q_3a_Qb_E_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[53])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1011, 24}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1017, 138}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 31, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1030, 395}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1085, 14}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_maxprod}; - __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_init, __pyx_k_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[47])) 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_init, __pyx_k_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[57])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 953, 216}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1093, 216}; 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[48] = __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[48])) 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_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; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 981, 248}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1121, 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[49] = __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[49])) 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_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 = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1020, 14}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_minprod}; - __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_init, __pyx_k_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[50])) goto bad; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1160, 23}; + 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; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1028, 92}; - 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[51] = __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[51])) goto bad; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1164, 138}; + 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_3avS_4q_3a_Qb_E_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[61])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1039, 95}; - 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[52] = __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[52])) goto bad; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1180, 24}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1186, 138}; + 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; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1066, 11}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 31, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1199, 395}; + 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; + } + { + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1254, 11}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set}; - __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_init, __pyx_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[53])) 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_init, __pyx_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[65])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1074, 14}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1262, 14}; 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[54] = __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[54])) 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_k_8_l_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[66])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1078, 91}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1266, 91}; 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[55] = __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[55])) 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_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; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1100, 11}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1288, 11}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set}; - __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_init, __pyx_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[56])) 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_init, __pyx_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[68])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1108, 14}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1296, 14}; 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[57] = __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[57])) 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_call, __pyx_k_8_l_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[69])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1112, 91}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1300, 91}; 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[58] = __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[58])) 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_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; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1134, 30}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1322, 30}; 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[59] = __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[59])) 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_init, __pyx_k_E_HA_F_Ja, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[71])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1148, 249}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1336, 249}; 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[60] = __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[60])) 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_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; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1196, 30}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1384, 30}; 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[61] = __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[61])) 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_k_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), 1210, 249}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1398, 249}; 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[62] = __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[62])) 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_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; } Py_DECREF(tuple_dedup_map); return 0; @@ -41295,24 +49016,83 @@ static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visi } #endif +/* LimitedApiGetTypeDict */ +#if CYTHON_COMPILING_IN_LIMITED_API +static Py_ssize_t __Pyx_GetTypeDictOffset(void) { + PyObject *tp_dictoffset_o; + Py_ssize_t tp_dictoffset; + tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__"); + if (unlikely(!tp_dictoffset_o)) return -1; + tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o); + Py_DECREF(tp_dictoffset_o); + if (unlikely(tp_dictoffset == 0)) { + PyErr_SetString( + PyExc_TypeError, + "'type' doesn't have a dictoffset"); + return -1; + } else if (unlikely(tp_dictoffset < 0)) { + PyErr_SetString( + PyExc_TypeError, + "'type' has an unexpected negative dictoffset. " + "Please report this as Cython bug"); + return -1; + } + return tp_dictoffset; +} +static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) { + static Py_ssize_t tp_dictoffset = 0; + if (unlikely(tp_dictoffset == 0)) { + tp_dictoffset = __Pyx_GetTypeDictOffset(); + if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) { + tp_dictoffset = 0; // try again next time? + return NULL; + } + } + return *(PyObject**)((char*)tp + tp_dictoffset); +} +#endif + +/* SetItemOnTypeDict */ +static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) { + int result; + PyObject *tp_dict; +#if CYTHON_COMPILING_IN_LIMITED_API + tp_dict = __Pyx_GetTypeDict(tp); + if (unlikely(!tp_dict)) return -1; +#else + tp_dict = tp->tp_dict; +#endif + result = PyDict_SetItem(tp_dict, k, v); + if (likely(!result)) { + PyType_Modified(tp); + if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) { + PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name, (PyObject *) tp, k, NULL); + if (!setNameResult) return -1; + Py_DECREF(setNameResult); + } + } + return result; +} + /* FixUpExtensionType */ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { -#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API +#if __PYX_LIMITED_VERSION_HEX > 0x030900B1 CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); + CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); #else const PyType_Slot *slot = spec->slots; + int changed = 0; +#if !CYTHON_COMPILING_IN_LIMITED_API while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { - int changed = 0; -#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) +#if !CYTHON_COMPILING_IN_CPYTHON const -#endif +#endif // !CYTHON_COMPILING_IN_CPYTHON) PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { -#if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); @@ -41336,11 +49116,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject #endif changed = 1; } -#endif -#else - if ((0)); -#endif -#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON +#endif // CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); @@ -41348,21 +49124,52 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; - if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { - Py_DECREF(descr); + int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr); + Py_DECREF(descr); + if (unlikely(set_item_result < 0)) { return -1; } - Py_DECREF(descr); changed = 1; } -#endif } memb++; } - if (changed) - PyType_Modified(type); } -#endif +#endif // !CYTHON_COMPILING_IN_LIMITED_API + slot = spec->slots; + while (slot && slot->slot && slot->slot != Py_tp_getset) + slot++; + if (slot && slot->slot == Py_tp_getset) { + PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc; + while (getset && getset->name) { + if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) { + PyObject *descr = PyDescr_NewGetSet(type, getset); + if (unlikely(!descr)) + return -1; + #if CYTHON_COMPILING_IN_LIMITED_API + PyObject *pyname = PyUnicode_FromString(getset->name); + if (unlikely(!pyname)) { + Py_DECREF(descr); + return -1; + } + int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr); + Py_DECREF(pyname); + #else + CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); + int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr); + #endif + Py_DECREF(descr); + if (unlikely(set_item_result < 0)) { + return -1; + } + changed = 1; + } + ++getset; + } + } + if (changed) + PyType_Modified(type); +#endif // PY_VERSION_HEX > 0x030900B1 return 0; } @@ -41648,6 +49455,24 @@ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *ke } /* FetchCommonType */ +#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); + if (result && metaclass) { + PyObject *old_tp = (PyObject*)Py_TYPE(result); + Py_INCREF((PyObject*)metaclass); +#if __PYX_LIMITED_VERSION_HEX >= 0x03090000 + Py_SET_TYPE(result, metaclass); +#else + result->ob_type = metaclass; +#endif + Py_DECREF(old_tp); + } + return result; +} +#else +#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b) +#endif static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t expected_basicsize) { @@ -41657,6 +49482,9 @@ static int __Pyx_VerifyCachedType(PyObject *cached_type, "Shared Cython type %.200s is not a type object", name); return -1; } + if (expected_basicsize == 0) { + return 0; // size is inherited, nothing useful to check + } #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); @@ -41676,7 +49504,7 @@ static int __Pyx_VerifyCachedType(PyObject *cached_type, } return 0; } -static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { +static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name; int get_item_ref_result; const char* object_name = strrchr(spec->name, '.'); @@ -41700,7 +49528,7 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec goto bad; } CYTHON_UNUSED_VAR(module); - cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); + cached_type = __Pyx_PyType_FromMetaclass(metaclass, 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); @@ -41729,6 +49557,42 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec goto done; } +/* CommonTypesMetaclass */ +PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) { + return PyUnicode_FromString(__PYX_ABI_MODULE_NAME); +} +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}, + {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 +}; +static int __pyx_CommonTypesMetaclass_init(PyObject *module) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); + PyObject *bases = PyTuple_Pack(1, &PyType_Type); + if (unlikely(!bases)) { + return -1; + } + mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases); + if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) { + return -1; + } + return 0; +} + /* PyMethodNew */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { @@ -42826,7 +50690,8 @@ static PyType_Spec __pyx_CyFunctionType_spec = { }; static int __pyx_CyFunction_init(PyObject *module) { __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); - mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); + mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec( + mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL); if (unlikely(mstate->__pyx_CyFunctionType == NULL)) { return -1; } @@ -45278,6 +53143,14 @@ static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethods type->tp_as_async = __Pyx_SlotTpAsAsync(static_amsend_methods); } #endif +static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg) { + CYTHON_UNUSED_VAR(arg); + __Pyx_TypeName self_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE((PyObject*)self)); + PyErr_Format(PyExc_TypeError, "cannot pickle '" __Pyx_FMT_TYPENAME "' object", + self_type_name); + __Pyx_DECREF_TypeName(self_type_name); + return NULL; +} /* Generator */ static PyMethodDef __pyx_Generator_methods[] = { @@ -45287,6 +53160,8 @@ static PyMethodDef __pyx_Generator_methods[] = { PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, + {"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0}, + {"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0}, {0, 0, 0, 0} }; static PyMemberDef __pyx_Generator_memberlist[] = { @@ -45339,7 +53214,8 @@ static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async; #endif static int __pyx_Generator_init(PyObject *module) { __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); - mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); + mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec( + mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_GeneratorType_spec, NULL); if (unlikely(!mstate->__pyx_GeneratorType)) { return -1; } diff --git a/constraint/domain.c b/constraint/domain.c index 37d3f94..4278eb8 100644 --- a/constraint/domain.c +++ b/constraint/domain.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.1.1 */ +/* Generated by Cython 3.1.2 */ /* BEGIN: Cython Metadata { @@ -29,8 +29,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x03080000 #error Cython requires Python 3.8+. #else -#define __PYX_ABI_VERSION "3_1_1" -#define CYTHON_HEX_VERSION 0x030101F0 +#define __PYX_ABI_VERSION "3_1_2" +#define CYTHON_HEX_VERSION 0x030102F0 #define CYTHON_FUTURE_DIVISION 1 /* CModulePreamble */ #include @@ -445,7 +445,7 @@ END: Cython Metadata */ #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON +# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED @@ -890,11 +890,19 @@ 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_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS +#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 + #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_GetItem(o, i) + #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) + #else + #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) #endif #else #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) @@ -1302,7 +1310,9 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #endif /* __GNUC__ */ /* PretendToInitialize */ #ifdef __cplusplus +#if __cplusplus > 201103L #include +#endif template static void __Pyx_pretend_to_initialize(T* ptr) { #if __cplusplus > 201103L @@ -1899,6 +1909,15 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); +/* LimitedApiGetTypeDict.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp); +#endif + +/* SetItemOnTypeDict.proto */ +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); @@ -1909,7 +1928,11 @@ static PyObject *__Pyx_FetchSharedCythonABIModule(void); static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type); /* FetchCommonType.proto */ -static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); +static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases); + +/* CommonTypesMetaclass.proto */ +static int __pyx_CommonTypesMetaclass_init(PyObject *module); +#define __Pyx_CommonTypesMetaclass_USED /* CallTypeTraverse.proto */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) @@ -2305,6 +2328,7 @@ 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__"; @@ -2384,8 +2408,11 @@ typedef struct { __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop; PyObject *__pyx_slice[1]; PyObject *__pyx_codeobj_tab[8]; - PyObject *__pyx_string_tab[50]; + PyObject *__pyx_string_tab[51]; /* #### Code section: module_state_contents ### */ +/* CommonTypesMetaclass.module_state_decls */ +PyTypeObject *__pyx_CommonTypesMetaclassType; + /* CachedMethodType.module_state_decls */ #if CYTHON_COMPILING_IN_LIMITED_API PyObject *__Pyx_CachedMethodType; @@ -2466,9 +2493,10 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_states __pyx_string_tab[47] -#define __pyx_n_u_test __pyx_string_tab[48] -#define __pyx_n_u_value __pyx_string_tab[49] +#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] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -2491,7 +2519,7 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { #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<50; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<51; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } return 0; } #endif @@ -2514,7 +2542,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void #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<50; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<51; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } return 0; } #endif @@ -4081,6 +4109,13 @@ __Pyx_RefNannySetupContext("PyInit_domain", 0); __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) + /*--- Initialize various global constants etc. ---*/ + 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 @@ -4097,10 +4132,6 @@ __Pyx_RefNannySetupContext("PyInit_domain", 0); if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ - /*--- Initialize various global constants etc. ---*/ - 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 (__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) } @@ -4424,6 +4455,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -6161,24 +6193,83 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, return NULL; } +/* LimitedApiGetTypeDict */ +#if CYTHON_COMPILING_IN_LIMITED_API +static Py_ssize_t __Pyx_GetTypeDictOffset(void) { + PyObject *tp_dictoffset_o; + Py_ssize_t tp_dictoffset; + tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__"); + if (unlikely(!tp_dictoffset_o)) return -1; + tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o); + Py_DECREF(tp_dictoffset_o); + if (unlikely(tp_dictoffset == 0)) { + PyErr_SetString( + PyExc_TypeError, + "'type' doesn't have a dictoffset"); + return -1; + } else if (unlikely(tp_dictoffset < 0)) { + PyErr_SetString( + PyExc_TypeError, + "'type' has an unexpected negative dictoffset. " + "Please report this as Cython bug"); + return -1; + } + return tp_dictoffset; +} +static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) { + static Py_ssize_t tp_dictoffset = 0; + if (unlikely(tp_dictoffset == 0)) { + tp_dictoffset = __Pyx_GetTypeDictOffset(); + if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) { + tp_dictoffset = 0; // try again next time? + return NULL; + } + } + return *(PyObject**)((char*)tp + tp_dictoffset); +} +#endif + +/* SetItemOnTypeDict */ +static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) { + int result; + PyObject *tp_dict; +#if CYTHON_COMPILING_IN_LIMITED_API + tp_dict = __Pyx_GetTypeDict(tp); + if (unlikely(!tp_dict)) return -1; +#else + tp_dict = tp->tp_dict; +#endif + result = PyDict_SetItem(tp_dict, k, v); + if (likely(!result)) { + PyType_Modified(tp); + if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) { + PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name, (PyObject *) tp, k, NULL); + if (!setNameResult) return -1; + Py_DECREF(setNameResult); + } + } + return result; +} + /* FixUpExtensionType */ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { -#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API +#if __PYX_LIMITED_VERSION_HEX > 0x030900B1 CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); + CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); #else const PyType_Slot *slot = spec->slots; + int changed = 0; +#if !CYTHON_COMPILING_IN_LIMITED_API while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { - int changed = 0; -#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) +#if !CYTHON_COMPILING_IN_CPYTHON const -#endif +#endif // !CYTHON_COMPILING_IN_CPYTHON) PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { -#if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); @@ -6202,11 +6293,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject #endif changed = 1; } -#endif -#else - if ((0)); -#endif -#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON +#endif // CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); @@ -6214,21 +6301,52 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; - if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { - Py_DECREF(descr); + int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr); + Py_DECREF(descr); + if (unlikely(set_item_result < 0)) { return -1; } - Py_DECREF(descr); changed = 1; } -#endif } memb++; } - if (changed) - PyType_Modified(type); } -#endif +#endif // !CYTHON_COMPILING_IN_LIMITED_API + slot = spec->slots; + while (slot && slot->slot && slot->slot != Py_tp_getset) + slot++; + if (slot && slot->slot == Py_tp_getset) { + PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc; + while (getset && getset->name) { + if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) { + PyObject *descr = PyDescr_NewGetSet(type, getset); + if (unlikely(!descr)) + return -1; + #if CYTHON_COMPILING_IN_LIMITED_API + PyObject *pyname = PyUnicode_FromString(getset->name); + if (unlikely(!pyname)) { + Py_DECREF(descr); + return -1; + } + int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr); + Py_DECREF(pyname); + #else + CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); + int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr); + #endif + Py_DECREF(descr); + if (unlikely(set_item_result < 0)) { + return -1; + } + changed = 1; + } + ++getset; + } + } + if (changed) + PyType_Modified(type); +#endif // PY_VERSION_HEX > 0x030900B1 return 0; } @@ -6255,6 +6373,24 @@ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *ke } /* FetchCommonType */ +#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); + if (result && metaclass) { + PyObject *old_tp = (PyObject*)Py_TYPE(result); + Py_INCREF((PyObject*)metaclass); +#if __PYX_LIMITED_VERSION_HEX >= 0x03090000 + Py_SET_TYPE(result, metaclass); +#else + result->ob_type = metaclass; +#endif + Py_DECREF(old_tp); + } + return result; +} +#else +#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b) +#endif static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t expected_basicsize) { @@ -6264,6 +6400,9 @@ static int __Pyx_VerifyCachedType(PyObject *cached_type, "Shared Cython type %.200s is not a type object", name); return -1; } + if (expected_basicsize == 0) { + return 0; // size is inherited, nothing useful to check + } #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); @@ -6283,7 +6422,7 @@ static int __Pyx_VerifyCachedType(PyObject *cached_type, } return 0; } -static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { +static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name; int get_item_ref_result; const char* object_name = strrchr(spec->name, '.'); @@ -6307,7 +6446,7 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec goto bad; } CYTHON_UNUSED_VAR(module); - cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); + cached_type = __Pyx_PyType_FromMetaclass(metaclass, 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); @@ -6336,6 +6475,42 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec goto done; } +/* CommonTypesMetaclass */ +PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) { + return PyUnicode_FromString(__PYX_ABI_MODULE_NAME); +} +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}, + {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 +}; +static int __pyx_CommonTypesMetaclass_init(PyObject *module) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); + PyObject *bases = PyTuple_Pack(1, &PyType_Type); + if (unlikely(!bases)) { + return -1; + } + mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases); + if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) { + return -1; + } + return 0; +} + /* CallTypeTraverse */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #else @@ -7452,7 +7627,8 @@ static PyType_Spec __pyx_CyFunctionType_spec = { }; static int __pyx_CyFunction_init(PyObject *module) { __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); - mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); + mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec( + mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL); if (unlikely(mstate->__pyx_CyFunctionType == NULL)) { return -1; } diff --git a/constraint/parser.c b/constraint/parser.c index 8b1c5fd..4b24b0e 100644 --- a/constraint/parser.c +++ b/constraint/parser.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.1.1 */ +/* Generated by Cython 3.1.2 */ /* BEGIN: Cython Metadata { @@ -29,8 +29,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x03080000 #error Cython requires Python 3.8+. #else -#define __PYX_ABI_VERSION "3_1_1" -#define CYTHON_HEX_VERSION 0x030101F0 +#define __PYX_ABI_VERSION "3_1_2" +#define CYTHON_HEX_VERSION 0x030102F0 #define CYTHON_FUTURE_DIVISION 1 /* CModulePreamble */ #include @@ -445,7 +445,7 @@ END: Cython Metadata */ #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON +# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED @@ -890,11 +890,19 @@ 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_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS +#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 + #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) #else - #define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i) + #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) #endif #else #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) @@ -1302,7 +1310,9 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #endif /* __GNUC__ */ /* PretendToInitialize */ #ifdef __cplusplus +#if __cplusplus > 201103L #include +#endif template static void __Pyx_pretend_to_initialize(T* ptr) { #if __cplusplus > 201103L @@ -1505,12 +1515,11 @@ 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_genexpr; -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint; +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_13_genexpr; -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr; -/* "constraint/parser.py":28 +/* "constraint/parser.py":30 * ) * * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< @@ -1521,30 +1530,28 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions { PyObject_HEAD PyObject *__pyx_v_params_used; PyObject *__pyx_v_regex_match_variable; + PyObject *__pyx_v_regex_match_variable_or_constant; PyObject *__pyx_v_tune_params; }; -/* "constraint/parser.py":76 +/* "constraint/parser.py":79 * return split_restrictions * * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint]]: # noqa: E501 + * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, VariableMinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint, VariableMaxProdConstraint]]: # noqa: E501 */ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint { PyObject_HEAD struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *__pyx_outer_scope; - PyObject *__pyx_v_left; PyObject *__pyx_v_operator; PyObject *__pyx_v_params; - PyObject *__pyx_v_right; - PyObject *__pyx_v_supported_operators; PyObject *__pyx_v_variable_supported_operators; }; -/* "constraint/parser.py":81 +/* "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): # <<<<<<<<<<<<<< @@ -1566,7 +1573,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr { }; -/* "constraint/parser.py":92 +/* "constraint/parser.py":95 * * # split the string on the comparison and remove leading and trailing whitespace * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< @@ -1583,27 +1590,29 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr { }; -/* "constraint/parser.py":96 - * # if we have an inverse operation, rewrite to the other side - * supported_operators = ["**", "*", "+", "-", "/"] - * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) # <<<<<<<<<<<<<< - * unique_operators_right = set(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":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] */ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_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_genexpr_arg_1; PyObject *__pyx_v_s; + PyObject *__pyx_t_0; + Py_ssize_t __pyx_t_1; }; -/* "constraint/parser.py":97 - * supported_operators = ["**", "*", "+", "-", "/"] - * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) - * unique_operators_right = set(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" - * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: +/* "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))) */ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr { PyObject_HEAD @@ -1613,31 +1622,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr { }; -/* "constraint/parser.py":135 - * - * # we have a potentially rewritten restriction, split again - * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< - * - * # find out which side is the constant number -*/ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr { - PyObject_HEAD - PyObject *__pyx_genexpr_arg_0; - PyObject *__pyx_genexpr_arg_1; - PyObject *__pyx_v_s; - PyObject *__pyx_t_0; - Py_ssize_t __pyx_t_1; -}; - - -/* "constraint/parser.py":156 - * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] +/* "constraint/parser.py":169 * # find all unique variable_supported_operators in the restriction, can have at most one - * unique_operators = set(s.strip() for s in list(left + 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 - * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_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; @@ -1645,14 +1637,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr { }; -/* "constraint/parser.py":158 - * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) +/* "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(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 # <<<<<<<<<<<<<< - * variables_on_left = len(right) == 1 - * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": + * 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] == "+": */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_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; @@ -1660,14 +1652,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr { }; -/* "constraint/parser.py":219 +/* "constraint/parser.py":240 * # 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_10_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; @@ -1675,14 +1667,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr { }; -/* "constraint/parser.py":226 +/* "constraint/parser.py":247 * 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_11_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; @@ -1690,43 +1682,43 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr { }; -/* "constraint/parser.py":249 +/* "constraint/parser.py":270 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint { +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_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":268 +/* "constraint/parser.py":289 * 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_13_genexpr { +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr { PyObject_HEAD - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint *__pyx_outer_scope; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_s; }; -/* "constraint/parser.py":278 +/* "constraint/parser.py":299 * * # 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] */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr { +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_r; @@ -2194,18 +2186,18 @@ 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)\ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (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)\ +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (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)\ +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) @@ -2351,6 +2343,15 @@ static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, in static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char); +/* LimitedApiGetTypeDict.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp); +#endif + +/* SetItemOnTypeDict.proto */ +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); @@ -2361,7 +2362,11 @@ static PyObject *__Pyx_FetchSharedCythonABIModule(void); static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type); /* FetchCommonType.proto */ -static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); +static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases); + +/* CommonTypesMetaclass.proto */ +static int __pyx_CommonTypesMetaclass_init(PyObject *module); +#define __Pyx_CommonTypesMetaclass_USED /* CallTypeTraverse.proto */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) @@ -2477,16 +2482,6 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, /* RaiseUnexpectedTypeError.proto */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); -/* IterNextPlain.proto */ -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 - -/* IterNext.proto */ -#define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL) -static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *); - /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); @@ -2643,6 +2638,12 @@ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject * static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif +/* IterNextPlain.proto */ +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 */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); @@ -2723,6 +2724,7 @@ static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *clos #if __PYX_HAS_PY_AM_SEND == 2 static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send); #endif +static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg); /* Generator.proto */ #define __Pyx_Generator_USED @@ -2804,7 +2806,6 @@ static PyObject *__pyx_builtin_compile; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "']]"; static const char __pyx_k_1[] = "\2401"; -static const char __pyx_k_A[] = "\250A"; static const char __pyx_k_Q[] = "\260Q"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_m[] = "m"; @@ -2825,9 +2826,9 @@ 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[] = "\2501"; -static const char __pyx_k_A_2[] = "\270A"; -static const char __pyx_k_Q_2[] = "\220Q"; +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[] = "/"; @@ -2844,7 +2845,8 @@ 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[] = "\270!"; +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"; @@ -2902,6 +2904,7 @@ 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"; @@ -2919,6 +2922,7 @@ 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"; @@ -2935,8 +2939,10 @@ static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_number_is_int[] = "number_is_int"; 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 "; @@ -2981,23 +2987,28 @@ 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_swapped_side_first_variable[] = "swapped_side_first_variable"; 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#\2408\2501\330\010$\240H\250A\340\010\013\2103\210a\320\017&\240b\250\002\250$\250c\260\021\3202J\310\"\310A\340\014\023\2201\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*\250\"\250G\2601\3204J\310(\320Ri\320ij\330\014\017\320\017+\2503\250a\340\020\027\220q\340\020.\320.I\310\026\310q\320PQ\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(E\300\\\320QX\320XY\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(E\300\\\320QX\320XY\360\006\000\r\023\220(\230%\230x\240q\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\330\014\030\230\001\230\021\230&\240\003\2404\240u\250D\260\001\260\025\260b\270\007\270s\300\"\300G\3101\340\014\"\240(\250!\340\014\017\210s\220!\320\023%\240S\250\002\320*<\320R\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_Ya_1_q_Q2_U_z_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\360z\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."; @@ -3010,6 +3021,7 @@ static const char __pyx_k_parse_restrictions_locals_replac[] = "parse_restrictio 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"; @@ -3023,13 +3035,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric 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(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* 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(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_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_26genexpr(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 */ @@ -3047,10 +3058,9 @@ 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_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_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_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 */ @@ -3100,10 +3110,9 @@ 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_genexpr; - PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint; + 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_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; @@ -3115,31 +3124,28 @@ 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_genexpr; - PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint; + 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_13_genexpr; - PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_14_genexpr; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; __Pyx_CachedCFunction __pyx_umethod_PyList_Type__index; __Pyx_CachedCFunction __pyx_umethod_PySet_Type__union; PyObject *__pyx_slice[4]; PyObject *__pyx_tuple[4]; - PyObject *__pyx_codeobj_tab[20]; - PyObject *__pyx_string_tab[195]; + PyObject *__pyx_codeobj_tab[19]; + PyObject *__pyx_string_tab[205]; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_neg_1; /* #### Code section: module_state_contents ### */ +/* CommonTypesMetaclass.module_state_decls */ +PyTypeObject *__pyx_CommonTypesMetaclassType; + /* CachedMethodType.module_state_decls */ #if CYTHON_COMPILING_IN_LIMITED_API PyObject *__Pyx_CachedMethodType; #endif -/* IterNextPlain.module_state_decls */ -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 -PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache; -#endif - #if CYTHON_USE_FREELISTS struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *__pyx_freelist_10constraint_6parser___pyx_scope_struct__parse_restrictions[8]; @@ -3197,27 +3203,27 @@ int __pyx_freecount_10constraint_6parser___pyx_scope_struct_10_genexpr; #endif #if CYTHON_USE_FREELISTS -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; +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; #endif #if CYTHON_USE_FREELISTS -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; +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; #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; +/* IterNextPlain.module_state_decls */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 +PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache; +#endif + /* #### Code section: module_state_end ### */ } __pyx_mstatetype; @@ -3270,174 +3276,184 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_VariableMaxSumConstraint __pyx_string_tab[27] -#define __pyx_n_u_VariableMinSumConstraint __pyx_string_tab[28] -#define __pyx_kp_u__10 __pyx_string_tab[29] -#define __pyx_kp_u__11 __pyx_string_tab[30] -#define __pyx_kp_u__12 __pyx_string_tab[31] -#define __pyx_kp_u__13 __pyx_string_tab[32] -#define __pyx_kp_u__14 __pyx_string_tab[33] -#define __pyx_kp_u__15 __pyx_string_tab[34] -#define __pyx_kp_u__16 __pyx_string_tab[35] -#define __pyx_kp_u__17 __pyx_string_tab[36] -#define __pyx_kp_u__18 __pyx_string_tab[37] -#define __pyx_kp_u__19 __pyx_string_tab[38] -#define __pyx_kp_u__2 __pyx_string_tab[39] -#define __pyx_kp_u__20 __pyx_string_tab[40] -#define __pyx_kp_u__21 __pyx_string_tab[41] -#define __pyx_kp_u__22 __pyx_string_tab[42] -#define __pyx_kp_u__23 __pyx_string_tab[43] -#define __pyx_kp_u__24 __pyx_string_tab[44] -#define __pyx_kp_u__3 __pyx_string_tab[45] -#define __pyx_kp_u__4 __pyx_string_tab[46] -#define __pyx_kp_u__5 __pyx_string_tab[47] -#define __pyx_kp_u__6 __pyx_string_tab[48] -#define __pyx_kp_u__7 __pyx_string_tab[49] -#define __pyx_kp_u__8 __pyx_string_tab[50] -#define __pyx_kp_u__9 __pyx_string_tab[51] -#define __pyx_kp_u_a_zA_Z__a_zA_Z__0_9 __pyx_string_tab[52] -#define __pyx_kp_u_add_note __pyx_string_tab[53] -#define __pyx_kp_u_and __pyx_string_tab[54] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[55] -#define __pyx_n_u_class_getitem __pyx_string_tab[56] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[57] -#define __pyx_n_u_close __pyx_string_tab[58] -#define __pyx_n_u_co_consts __pyx_string_tab[59] -#define __pyx_n_u_code_object __pyx_string_tab[60] -#define __pyx_n_u_comparator __pyx_string_tab[61] -#define __pyx_n_u_comparators __pyx_string_tab[62] -#define __pyx_n_u_comparators_found __pyx_string_tab[63] -#define __pyx_n_u_comparators_indices __pyx_string_tab[64] -#define __pyx_n_u_compile __pyx_string_tab[65] -#define __pyx_n_u_compile_to_constraints __pyx_string_tab[66] -#define __pyx_n_u_compiled_constraints __pyx_string_tab[67] -#define __pyx_n_u_constraint __pyx_string_tab[68] -#define __pyx_n_u_constraint_constraints __pyx_string_tab[69] -#define __pyx_n_u_constraint_parser __pyx_string_tab[70] -#define __pyx_kp_u_constraint_parser_py __pyx_string_tab[71] -#define __pyx_n_u_constraints __pyx_string_tab[72] -#define __pyx_kp_u_def_r __pyx_string_tab[73] -#define __pyx_n_u_dict __pyx_string_tab[74] -#define __pyx_kp_u_disable __pyx_string_tab[75] -#define __pyx_n_u_domains __pyx_string_tab[76] -#define __pyx_kp_u_enable __pyx_string_tab[77] -#define __pyx_n_u_end __pyx_string_tab[78] -#define __pyx_n_u_equalities_found __pyx_string_tab[79] -#define __pyx_n_u_eval __pyx_string_tab[80] -#define __pyx_n_u_exec __pyx_string_tab[81] -#define __pyx_n_u_finalized_constraint __pyx_string_tab[82] -#define __pyx_n_u_findall __pyx_string_tab[83] -#define __pyx_n_u_finditer __pyx_string_tab[84] -#define __pyx_n_u_fromkeys __pyx_string_tab[85] -#define __pyx_n_u_func __pyx_string_tab[86] -#define __pyx_n_u_func_2 __pyx_string_tab[87] -#define __pyx_kp_u_gc __pyx_string_tab[88] -#define __pyx_n_u_genexpr __pyx_string_tab[89] -#define __pyx_n_u_group __pyx_string_tab[90] -#define __pyx_n_u_i __pyx_string_tab[91] -#define __pyx_n_u_index __pyx_string_tab[92] -#define __pyx_n_u_inequalities_found __pyx_string_tab[93] -#define __pyx_n_u_initializing __pyx_string_tab[94] -#define __pyx_n_u_is_coroutine __pyx_string_tab[95] -#define __pyx_kp_u_is_neither_a_string_or_Constrai __pyx_string_tab[96] -#define __pyx_n_u_is_or_evals_to_number __pyx_string_tab[97] -#define __pyx_kp_u_isenabled __pyx_string_tab[98] -#define __pyx_n_u_key __pyx_string_tab[99] -#define __pyx_n_u_left __pyx_string_tab[100] -#define __pyx_n_u_left_num __pyx_string_tab[101] -#define __pyx_n_u_left_remainder __pyx_string_tab[102] -#define __pyx_n_u_left_swap __pyx_string_tab[103] -#define __pyx_kp_u_list_str __pyx_string_tab[104] -#define __pyx_kp_u_list_tuple_Constraint_list_str_U __pyx_string_tab[105] -#define __pyx_kp_u_list_tuple_Union_Constraint_str __pyx_string_tab[106] -#define __pyx_n_u_m __pyx_string_tab[107] -#define __pyx_n_u_main __pyx_string_tab[108] -#define __pyx_n_u_match_object __pyx_string_tab[109] -#define __pyx_n_u_module __pyx_string_tab[110] -#define __pyx_n_u_name __pyx_string_tab[111] -#define __pyx_n_u_next __pyx_string_tab[112] -#define __pyx_n_u_next_stop __pyx_string_tab[113] -#define __pyx_n_u_number __pyx_string_tab[114] -#define __pyx_n_u_number_is_int __pyx_string_tab[115] -#define __pyx_n_u_o __pyx_string_tab[116] -#define __pyx_n_u_operator __pyx_string_tab[117] -#define __pyx_n_u_operators __pyx_string_tab[118] -#define __pyx_n_u_operators_found __pyx_string_tab[119] -#define __pyx_kp_u_or __pyx_string_tab[120] -#define __pyx_n_u_p __pyx_string_tab[121] -#define __pyx_n_u_param __pyx_string_tab[122] -#define __pyx_n_u_params __pyx_string_tab[123] -#define __pyx_kp_u_params_params_index __pyx_string_tab[124] -#define __pyx_n_u_params_used __pyx_string_tab[125] -#define __pyx_n_u_params_used_list __pyx_string_tab[126] -#define __pyx_n_u_parse_restrictions __pyx_string_tab[127] -#define __pyx_n_u_parse_restrictions_locals_genexp __pyx_string_tab[128] -#define __pyx_n_u_parse_restrictions_locals_replac __pyx_string_tab[129] -#define __pyx_n_u_parse_restrictions_locals_replac_2 __pyx_string_tab[130] -#define __pyx_n_u_parse_restrictions_locals_to_equ __pyx_string_tab[131] -#define __pyx_n_u_parse_restrictions_locals_to_equ_2 __pyx_string_tab[132] -#define __pyx_n_u_parse_restrictions_locals_to_mul __pyx_string_tab[133] -#define __pyx_n_u_parse_restrictions_locals_to_num __pyx_string_tab[134] -#define __pyx_n_u_parse_restrictions_locals_to_num_2 __pyx_string_tab[135] -#define __pyx_n_u_parse_restrictions_locals_to_num_3 __pyx_string_tab[136] -#define __pyx_n_u_parse_restrictions_locals_to_num_4 __pyx_string_tab[137] -#define __pyx_n_u_parsed_restriction __pyx_string_tab[138] -#define __pyx_n_u_parsed_restrictions __pyx_string_tab[139] -#define __pyx_n_u_picklable __pyx_string_tab[140] -#define __pyx_n_u_pop __pyx_string_tab[141] -#define __pyx_n_u_prev_stop __pyx_string_tab[142] -#define __pyx_n_u_qualname __pyx_string_tab[143] -#define __pyx_n_u_r __pyx_string_tab[144] -#define __pyx_n_u_range __pyx_string_tab[145] -#define __pyx_n_u_re __pyx_string_tab[146] -#define __pyx_n_u_regex_match_variable __pyx_string_tab[147] -#define __pyx_n_u_replace __pyx_string_tab[148] -#define __pyx_n_u_replace_params __pyx_string_tab[149] -#define __pyx_n_u_replace_params_split __pyx_string_tab[150] -#define __pyx_n_u_res __pyx_string_tab[151] -#define __pyx_n_u_restriction __pyx_string_tab[152] -#define __pyx_n_u_restrictions __pyx_string_tab[153] -#define __pyx_n_u_restrictions_cleaned __pyx_string_tab[154] -#define __pyx_n_u_restrictions_cleaned_unique __pyx_string_tab[155] -#define __pyx_n_u_restrictions_unique_indices __pyx_string_tab[156] -#define __pyx_n_u_return __pyx_string_tab[157] -#define __pyx_kp_u_return_2 __pyx_string_tab[158] -#define __pyx_n_u_right __pyx_string_tab[159] -#define __pyx_n_u_right_num __pyx_string_tab[160] -#define __pyx_n_u_right_remainder __pyx_string_tab[161] -#define __pyx_n_u_right_swap __pyx_string_tab[162] -#define __pyx_n_u_s __pyx_string_tab[163] -#define __pyx_n_u_search __pyx_string_tab[164] -#define __pyx_n_u_send __pyx_string_tab[165] -#define __pyx_n_u_spec __pyx_string_tab[166] -#define __pyx_n_u_split __pyx_string_tab[167] -#define __pyx_n_u_split_restrictions __pyx_string_tab[168] -#define __pyx_n_u_splitted __pyx_string_tab[169] -#define __pyx_n_u_start __pyx_string_tab[170] -#define __pyx_n_u_str __pyx_string_tab[171] -#define __pyx_kp_u_string __pyx_string_tab[172] -#define __pyx_n_u_strip __pyx_string_tab[173] -#define __pyx_n_u_sub __pyx_string_tab[174] -#define __pyx_n_u_supported_operators __pyx_string_tab[175] -#define __pyx_n_u_swapped_side_first_variable __pyx_string_tab[176] -#define __pyx_n_u_temp_copy __pyx_string_tab[177] -#define __pyx_n_u_test __pyx_string_tab[178] -#define __pyx_n_u_throw __pyx_string_tab[179] -#define __pyx_n_u_to_equality_constraint __pyx_string_tab[180] -#define __pyx_n_u_to_multiple_restrictions __pyx_string_tab[181] -#define __pyx_n_u_to_numeric_constraint __pyx_string_tab[182] -#define __pyx_n_u_tune_params __pyx_string_tab[183] -#define __pyx_n_u_types __pyx_string_tab[184] -#define __pyx_n_u_typing __pyx_string_tab[185] -#define __pyx_n_u_union __pyx_string_tab[186] -#define __pyx_n_u_unique_operators __pyx_string_tab[187] -#define __pyx_n_u_unique_operators_left __pyx_string_tab[188] -#define __pyx_n_u_unique_operators_right __pyx_string_tab[189] -#define __pyx_n_u_v __pyx_string_tab[190] -#define __pyx_n_u_value __pyx_string_tab[191] -#define __pyx_n_u_variable_supported_operators __pyx_string_tab[192] -#define __pyx_n_u_variables __pyx_string_tab[193] -#define __pyx_n_u_variables_on_left __pyx_string_tab[194] +#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_number_is_int __pyx_string_tab[118] +#define __pyx_n_u_o __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] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3480,18 +3496,16 @@ 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_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_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_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<20; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<195; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[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); @@ -3537,18 +3551,16 @@ 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_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_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_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<20; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<195; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[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); @@ -3557,7 +3569,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void #endif /* #### Code section: module_code ### */ -/* "constraint/parser.py":28 +/* "constraint/parser.py":30 * ) * * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< @@ -3606,39 +3618,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, 28, __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: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 28, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 30, __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, 28, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 30, __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, 28, __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, 30, __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, 28, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("parse_restrictions", 1, 2, 2, i); __PYX_ERR(0, 30, __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, 28, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 30, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 28, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 30, __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, 28, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("parse_restrictions", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 30, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3649,8 +3661,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, 28, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tune_params), (&PyDict_Type), 0, "tune_params", 2))) __PYX_ERR(0, 28, __pyx_L1_error) + 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) __pyx_r = __pyx_pf_10constraint_6parser_parse_restrictions(__pyx_self, __pyx_v_restrictions, __pyx_v_tune_params); /* function exit code */ @@ -3670,8 +3682,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "constraint/parser.py":33 - * regex_match_variable = r"([a-zA-Z_$][a-zA-Z_$0-9]*)" +/* "constraint/parser.py":36 + * regex_match_variable_or_constant = r"([a-zA-Z_$0-9]*)" * * def replace_params(match_object): # <<<<<<<<<<<<<< * key = match_object.group(1) @@ -3717,32 +3729,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, 33, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 36, __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, 33, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 36, __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, 33, __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, 36, __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, 33, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("replace_params", 1, 1, 1, i); __PYX_ERR(0, 36, __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, 33, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 36, __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, 33, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("replace_params", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 36, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3781,7 +3793,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":34 + /* "constraint/parser.py":37 * * def replace_params(match_object): * key = match_object.group(1) # <<<<<<<<<<<<<< @@ -3795,40 +3807,40 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para 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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_key = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":35 + /* "constraint/parser.py":38 * 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, 35, __pyx_L1_error) } + 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 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 35, __pyx_L1_error) + __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, 35, __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) if (__pyx_t_4) { - /* "constraint/parser.py":36 + /* "constraint/parser.py":39 * 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, 36, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_param = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":37 + /* "constraint/parser.py":40 * if key in tune_params: * param = str(key) * return "params[params_index['" + param + "']]" # <<<<<<<<<<<<<< @@ -3836,16 +3848,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, 37, __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, 40, __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, 37, __pyx_L1_error) + __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_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":35 + /* "constraint/parser.py":38 * def replace_params(match_object): * key = match_object.group(1) * if key in tune_params: # <<<<<<<<<<<<<< @@ -3854,7 +3866,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para */ } - /* "constraint/parser.py":39 + /* "constraint/parser.py":42 * return "params[params_index['" + param + "']]" * else: * return key # <<<<<<<<<<<<<< @@ -3868,8 +3880,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para goto __pyx_L0; } - /* "constraint/parser.py":33 - * regex_match_variable = r"([a-zA-Z_$][a-zA-Z_$0-9]*)" + /* "constraint/parser.py":36 + * regex_match_variable_or_constant = r"([a-zA-Z_$0-9]*)" * * def replace_params(match_object): # <<<<<<<<<<<<<< * key = match_object.group(1) @@ -3890,7 +3902,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para return __pyx_r; } -/* "constraint/parser.py":41 +/* "constraint/parser.py":44 * return key * * def replace_params_split(match_object): # <<<<<<<<<<<<<< @@ -3937,32 +3949,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, 41, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 44, __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, 41, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 44, __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, 41, __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, 44, __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, 41, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("replace_params_split", 1, 1, 1, i); __PYX_ERR(0, 44, __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, 41, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 44, __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, 41, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("replace_params_split", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 44, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4002,7 +4014,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":43 + /* "constraint/parser.py":46 * def replace_params_split(match_object): * # careful: has side-effect of adding to set `params_used` * key = match_object.group(1) # <<<<<<<<<<<<<< @@ -4016,54 +4028,54 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par 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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_key = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":44 + /* "constraint/parser.py":47 * # 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, 44, __pyx_L1_error) } + 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 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 44, __pyx_L1_error) + __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, 44, __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) if (__pyx_t_4) { - /* "constraint/parser.py":45 + /* "constraint/parser.py":48 * 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, 45, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_param = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":46 + /* "constraint/parser.py":49 * 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, 46, __pyx_L1_error) } + 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 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); - __PYX_ERR(0, 46, __pyx_L1_error) + __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, 46, __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) - /* "constraint/parser.py":47 + /* "constraint/parser.py":50 * param = str(key) * params_used.add(param) * return param # <<<<<<<<<<<<<< @@ -4075,7 +4087,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par __pyx_r = __pyx_v_param; goto __pyx_L0; - /* "constraint/parser.py":44 + /* "constraint/parser.py":47 * # careful: has side-effect of adding to set `params_used` * key = match_object.group(1) * if key in tune_params: # <<<<<<<<<<<<<< @@ -4084,7 +4096,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par */ } - /* "constraint/parser.py":49 + /* "constraint/parser.py":52 * return param * else: * return key # <<<<<<<<<<<<<< @@ -4098,7 +4110,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par goto __pyx_L0; } - /* "constraint/parser.py":41 + /* "constraint/parser.py":44 * return key * * def replace_params_split(match_object): # <<<<<<<<<<<<<< @@ -4120,7 +4132,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par return __pyx_r; } -/* "constraint/parser.py":51 +/* "constraint/parser.py":54 * return key * * def to_multiple_restrictions(restrictions: list[str]) -> list[str]: # <<<<<<<<<<<<<< @@ -4168,32 +4180,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, 51, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 54, __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, 51, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 54, __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, 51, __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, 54, __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, 51, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_multiple_restrictions", 1, 1, 1, i); __PYX_ERR(0, 54, __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, 51, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 54, __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, 51, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("to_multiple_restrictions", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 54, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4204,7 +4216,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, 51, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restrictions), (&PyList_Type), 0, "restrictions", 2))) __PYX_ERR(0, 54, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple_restrictions(__pyx_self, __pyx_v_restrictions); /* function exit code */ @@ -4255,19 +4267,19 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple int __pyx_clineno = 0; __Pyx_RefNannySetupContext("to_multiple_restrictions", 0); - /* "constraint/parser.py":53 + /* "constraint/parser.py":56 * 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, 53, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_split_restrictions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":54 + /* "constraint/parser.py":57 * """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: # <<<<<<<<<<<<<< @@ -4280,45 +4292,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, 54, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 57, __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, 54, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":56 + /* "constraint/parser.py":59 * 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, 56, __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, 59, __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, 56, __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, 59, __pyx_L1_error) __pyx_t_4 = __pyx_t_5; __pyx_L6_bool_binop_done:; if (__pyx_t_4) { - /* "constraint/parser.py":57 + /* "constraint/parser.py":60 * # 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, 57, __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, 60, __pyx_L1_error) - /* "constraint/parser.py":58 + /* "constraint/parser.py":61 * if " and " in res or " or " in res: * split_restrictions.append(res) * continue # <<<<<<<<<<<<<< @@ -4327,7 +4339,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple */ goto __pyx_L3_continue; - /* "constraint/parser.py":56 + /* "constraint/parser.py":59 * for res in restrictions: * # if there are logic chains in the restriction, skip splitting further * if " and " in res or " or " in res: # <<<<<<<<<<<<<< @@ -4336,31 +4348,31 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple */ } - /* "constraint/parser.py":60 + /* "constraint/parser.py":63 * 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, 60, __pyx_L1_error) + __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __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, 60, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_mstate_global->__pyx_kp_u__2) != (0)) __PYX_ERR(0, 63, __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, 60, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_kp_u__3) != (0)) __PYX_ERR(0, 63, __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, 60, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_mstate_global->__pyx_kp_u__4) != (0)) __PYX_ERR(0, 63, __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, 60, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_mstate_global->__pyx_kp_u__5) != (0)) __PYX_ERR(0, 63, __pyx_L1_error); __Pyx_XDECREF_SET(__pyx_v_comparators, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "constraint/parser.py":61 + /* "constraint/parser.py":64 * # find the indices of splittable comparators * comparators = ["<=", ">=", ">", "<"] * comparators_indices = [(m.start(0), m.end(0)) for m in re.finditer("|".join(comparators), res)] # <<<<<<<<<<<<<< @@ -4368,15 +4380,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, 61, __pyx_L10_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __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, 61, __pyx_L10_error) + __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_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, 61, __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, 64, __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, 61, __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, 64, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS @@ -4396,7 +4408,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __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, 61, __pyx_L10_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 64, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); } if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { @@ -4404,9 +4416,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, 61, __pyx_L10_error) + __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_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, 61, __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, 64, __pyx_L10_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { @@ -4415,7 +4427,7 @@ 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, 61, __pyx_L10_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 64, __pyx_L10_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -4425,7 +4437,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple { 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, 61, __pyx_L10_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 64, __pyx_L10_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -4436,13 +4448,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L10_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 64, __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, 61, __pyx_L10_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 64, __pyx_L10_error) PyErr_Clear(); } break; @@ -4458,7 +4470,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple 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_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L10_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 64, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_8 = __pyx_7genexpr__pyx_v_m; @@ -4468,18 +4480,18 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 61, __pyx_L10_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 64, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); } - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 61, __pyx_L10_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 64, __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, 61, __pyx_L10_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 64, __pyx_L10_error); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 61, __pyx_L10_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 64, __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, 61, __pyx_L10_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 64, __pyx_L10_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -4493,27 +4505,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":62 + /* "constraint/parser.py":65 * 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, 62, __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, 65, __pyx_L1_error) __pyx_t_4 = (__pyx_t_12 <= 1); if (__pyx_t_4) { - /* "constraint/parser.py":64 + /* "constraint/parser.py":67 * 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, 64, __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, 67, __pyx_L1_error) - /* "constraint/parser.py":65 + /* "constraint/parser.py":68 * # this can't be split further * split_restrictions.append(res) * continue # <<<<<<<<<<<<<< @@ -4522,7 +4534,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple */ goto __pyx_L3_continue; - /* "constraint/parser.py":62 + /* "constraint/parser.py":65 * comparators = ["<=", ">=", ">", "<"] * comparators_indices = [(m.start(0), m.end(0)) for m in re.finditer("|".join(comparators), res)] * if len(comparators_indices) <= 1: # <<<<<<<<<<<<<< @@ -4531,7 +4543,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple */ } - /* "constraint/parser.py":67 + /* "constraint/parser.py":70 * continue * # split the restrictions from the previous to the next comparator * for index in range(len(comparators_indices)): # <<<<<<<<<<<<<< @@ -4541,8 +4553,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __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, 67, __pyx_L1_error) - __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 67, __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, 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_11 = 1; { @@ -4551,7 +4563,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __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, 67, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { @@ -4559,9 +4571,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_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 67, __pyx_L1_error) + __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, 67, __pyx_L1_error) + __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -4570,7 +4582,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple { 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, 67, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 70, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -4580,7 +4592,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple { 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, 67, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 70, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -4591,13 +4603,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) + 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, 67, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 70, __pyx_L1_error) PyErr_Clear(); } break; @@ -4607,7 +4619,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":68 + /* "constraint/parser.py":71 * # split the restrictions from the previous to the next comparator * for index in range(len(comparators_indices)): * temp_copy = res # <<<<<<<<<<<<<< @@ -4617,26 +4629,26 @@ 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":69 + /* "constraint/parser.py":72 * 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, 69, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 69, __pyx_L1_error) + __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; 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, 69, __pyx_L1_error) + __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, 69, __pyx_L1_error) + __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_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); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 69, __pyx_L1_error) + __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_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, 69, __pyx_L1_error) + __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_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_3 = __pyx_t_10; @@ -4648,34 +4660,34 @@ 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":71 + /* "constraint/parser.py":74 * 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, 71, __pyx_L1_error) - __pyx_t_10 = PyLong_FromSsize_t((__pyx_t_14 - 1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 71, __pyx_L1_error) + __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, 71, __pyx_L1_error) + __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, 71, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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, 71, __pyx_L1_error) + __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, 71, __pyx_L1_error) + __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_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); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 71, __pyx_L1_error) + __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_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_t_14 = PyObject_Length(__pyx_v_temp_copy); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 71, __pyx_L1_error) - __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 71, __pyx_L1_error) + __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; @@ -4683,14 +4695,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __Pyx_XDECREF_SET(__pyx_v_next_stop, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":73 + /* "constraint/parser.py":76 * 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, 73, __pyx_L1_error) + __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); @@ -4700,13 +4712,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __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, 73, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __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, 73, __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, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":67 + /* "constraint/parser.py":70 * continue * # split the restrictions from the previous to the next comparator * for index in range(len(comparators_indices)): # <<<<<<<<<<<<<< @@ -4716,7 +4728,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/parser.py":54 + /* "constraint/parser.py":57 * """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: # <<<<<<<<<<<<<< @@ -4727,7 +4739,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":74 + /* "constraint/parser.py":77 * ) * split_restrictions.append(temp_copy[prev_stop:next_stop].strip()) * return split_restrictions # <<<<<<<<<<<<<< @@ -4739,7 +4751,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __pyx_r = __pyx_v_split_restrictions; goto __pyx_L0; - /* "constraint/parser.py":51 + /* "constraint/parser.py":54 * return key * * def to_multiple_restrictions(restrictions: list[str]) -> list[str]: # <<<<<<<<<<<<<< @@ -4772,12 +4784,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple return __pyx_r; } -/* "constraint/parser.py":76 +/* "constraint/parser.py":79 * return split_restrictions * * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint]]: # noqa: E501 + * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, VariableMinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint, VariableMaxProdConstraint]]: # noqa: E501 */ /* Python wrapper */ @@ -4821,39 +4833,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, 76, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 79, __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, 76, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 79, __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, 76, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 79, __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, 76, __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, 79, __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, 76, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_numeric_constraint", 1, 2, 2, i); __PYX_ERR(0, 79, __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, 76, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 79, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 76, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 79, __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, 76, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("to_numeric_constraint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 79, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4864,8 +4876,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, 77, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 77, __pyx_L1_error) + 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) __pyx_r = __pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_constraint(__pyx_self, __pyx_v_restriction, __pyx_v_params); /* function exit code */ @@ -4885,7 +4897,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "constraint/parser.py":138 +/* "constraint/parser.py":148 * * # find out which side is the constant number * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< @@ -4932,32 +4944,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { 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, 138, __pyx_L3_error) + 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, 138, __pyx_L3_error) + 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, 138, __pyx_L3_error) + 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, 138, __pyx_L3_error) } + 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, 138, __pyx_L3_error) + 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, 138, __pyx_L3_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:; @@ -4968,7 +4980,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __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, 138, __pyx_L1_error) + 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 */ @@ -5009,7 +5021,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_or_evals_to_number", 0); - /* "constraint/parser.py":139 + /* "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: # <<<<<<<<<<<<<< @@ -5025,7 +5037,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "constraint/parser.py":141 + /* "constraint/parser.py":151 * try: * # check if it's a number or solvable to a number (e.g. '32*2') * number = eval(s) # <<<<<<<<<<<<<< @@ -5035,15 +5047,15 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __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, 141, __pyx_L3_error) + __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, 141, __pyx_L3_error) + __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, 141, __pyx_L3_error) + 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, 141, __pyx_L3_error) + 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; { @@ -5053,13 +5065,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __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, 141, __pyx_L3_error) + 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":142 + /* "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)) # <<<<<<<<<<<<<< @@ -5079,14 +5091,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_L9_bool_binop_done:; if (unlikely(!__pyx_t_10)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 142, __pyx_L3_error) + __PYX_ERR(0, 152, __pyx_L3_error) } } #else - if ((1)); else __PYX_ERR(0, 142, __pyx_L3_error) + if ((1)); else __PYX_ERR(0, 152, __pyx_L3_error) #endif - /* "constraint/parser.py":143 + /* "constraint/parser.py":153 * number = eval(s) * assert isinstance(number, (int, float)) * return number # <<<<<<<<<<<<<< @@ -5098,7 +5110,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_r = __pyx_v_number; goto __pyx_L7_try_return; - /* "constraint/parser.py":139 + /* "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: # <<<<<<<<<<<<<< @@ -5113,7 +5125,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/parser.py":144 + /* "constraint/parser.py":154 * assert isinstance(number, (int, float)) * return number * except Exception: # <<<<<<<<<<<<<< @@ -5124,7 +5136,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric if (__pyx_t_12) { __Pyx_ErrRestore(0,0,0); - /* "constraint/parser.py":146 + /* "constraint/parser.py":156 * except Exception: * # it's not a solvable subexpression, return None * return None # <<<<<<<<<<<<<< @@ -5137,7 +5149,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric } goto __pyx_L5_except_error; - /* "constraint/parser.py":139 + /* "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: # <<<<<<<<<<<<<< @@ -5164,7 +5176,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric goto __pyx_L0; } - /* "constraint/parser.py":138 + /* "constraint/parser.py":148 * * # find out which side is the constant number * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< @@ -5190,7 +5202,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric 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":81 +/* "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): # <<<<<<<<<<<<<< @@ -5210,7 +5222,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_3_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 81, __pyx_L1_error) + __PYX_ERR(0, 84, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5218,7 +5230,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_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, 81, __pyx_L1_error) + __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); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5256,16 +5268,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, 81, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 81, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 84, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 84, __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, 81, __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, 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, 81, __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)) { @@ -5273,7 +5285,7 @@ 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, 81, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 84, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5283,7 +5295,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 81, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 84, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5294,13 +5306,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __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, 81, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 84, __pyx_L1_error) PyErr_Clear(); } break; @@ -5371,7 +5383,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_2_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 81, __pyx_L1_error) + __PYX_ERR(0, 84, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5382,7 +5394,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, 81, __pyx_L1_error) + __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_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5421,40 +5433,40 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 81, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 81, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 84, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 84, __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, 81, __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_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __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_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 81, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 84, __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 subscriptable"); - __PYX_ERR(0, 81, __pyx_L1_error) + __PYX_ERR(0, 84, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_tune_params, __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_tune_params, __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7genexpr_genexpr(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_4 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7genexpr_genexpr(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { @@ -5496,7 +5508,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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 */ -/* "constraint/parser.py":92 +/* "constraint/parser.py":95 * * # split the string on the comparison and remove leading and trailing whitespace * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< @@ -5516,7 +5528,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_4_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 92, __pyx_L1_error) + __PYX_ERR(0, 95, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5527,7 +5539,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, 92, __pyx_L1_error) + __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_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5567,11 +5579,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __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, 92, __pyx_L1_error) + __PYX_ERR(0, 95, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 92, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 92, __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, 92, __pyx_L1_error) + 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_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -5580,13 +5592,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 92, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 95, __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, 92, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __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); @@ -5599,7 +5611,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_r = __pyx_t_1; @@ -5618,7 +5630,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_2); __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 92, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 95, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -5646,15 +5658,15 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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 */ -/* "constraint/parser.py":96 - * # if we have an inverse operation, rewrite to the other side - * supported_operators = ["**", "*", "+", "-", "/"] - * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) # <<<<<<<<<<<<<< - * unique_operators_right = set(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":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] */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { +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) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -5666,18 +5678,18 @@ 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_5_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 96, __pyx_L1_error) + __PYX_ERR(0, 140, __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_cur_scope->__pyx_genexpr_arg_1 = __pyx_genexpr_arg_1; + __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, 96, __pyx_L1_error) + __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_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5700,9 +5712,8 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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; + PyObject *__pyx_t_4 = NULL; + size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -5710,16 +5721,19 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L6_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 96, __pyx_L1_error) - __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 96, __pyx_L1_error) - __Pyx_GOTREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 96, __pyx_L1_error) } - __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) + 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, 140, __pyx_L1_error) + } + 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_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -5728,45 +5742,56 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 96, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 140, __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, 96, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __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_supported_operators)) { __Pyx_RaiseClosureNameError("supported_operators"); __PYX_ERR(0, 96, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_s, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_supported_operators, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 96, __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, 96, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } - if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 96, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __pyx_cur_scope->__pyx_v_s; + __Pyx_INCREF(__pyx_t_4); + __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_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); } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + __Pyx_XGIVEREF(__pyx_t_2); + __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_1 = __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_L6_resume_from_yield:; + __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; + __pyx_cur_scope->__pyx_t_0 = 0; + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 140, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_r); __pyx_r = 0; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -5783,12 +5808,12 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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 */ -/* "constraint/parser.py":97 - * supported_operators = ["**", "*", "+", "-", "/"] - * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) - * unique_operators_right = set(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" - * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: +/* "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))) */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { @@ -5803,7 +5828,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, 97, __pyx_L1_error) + __PYX_ERR(0, 168, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5814,7 +5839,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, 97, __pyx_L1_error) + __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_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5852,11 +5877,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 97, __pyx_L1_error) - __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 97, __pyx_L1_error) + 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, 97, __pyx_L1_error) } - __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + 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; @@ -5865,20 +5890,20 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 97, __pyx_L1_error) + 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, 97, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __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_supported_operators)) { __Pyx_RaiseClosureNameError("supported_operators"); __PYX_ERR(0, 97, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_s, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_supported_operators, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 97, __pyx_L1_error) + 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); @@ -5887,10 +5912,10 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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, 97, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 97, __pyx_L1_error) + 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; } } @@ -5920,15 +5945,15 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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 */ -/* "constraint/parser.py":135 - * - * # we have a potentially rewritten restriction, split again - * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< - * - * # find out which side is the constant number +/* "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 */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_14genexpr(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_14genexpr(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 @@ -5940,18 +5965,18 @@ 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_7_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 135, __pyx_L1_error) + __PYX_ERR(0, 169, __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_cur_scope->__pyx_genexpr_arg_1 = __pyx_genexpr_arg_1; - __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_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, 135, __pyx_L1_error) + __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_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5974,8 +5999,9 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - size_t __pyx_t_5; + 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; @@ -5983,19 +6009,16 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; - case 1: goto __pyx_L6_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, 135, __pyx_L1_error) - } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 135, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 135, __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, 135, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 169, __pyx_L1_error) } + __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -6004,56 +6027,45 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 135, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 169, __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, 135, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __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; - __pyx_t_4 = __pyx_cur_scope->__pyx_v_s; - __Pyx_INCREF(__pyx_t_4); - __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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_variable_supported_operators)) { __Pyx_RaiseClosureNameError("variable_supported_operators"); __PYX_ERR(0, 169, __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, 169, __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, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - __Pyx_XGIVEREF(__pyx_t_2); - __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; - __pyx_cur_scope->__pyx_t_1 = __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_L6_resume_from_yield:; - __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; - __pyx_cur_scope->__pyx_t_0 = 0; - __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 135, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_r); __pyx_r = 0; __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); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -6070,12 +6082,12 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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 */ -/* "constraint/parser.py":156 - * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] - * # find all unique variable_supported_operators in the restriction, can have at most one - * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) # <<<<<<<<<<<<<< +/* "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(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # 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] == "+": */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_17genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { @@ -6090,7 +6102,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, 156, __pyx_L1_error) + __PYX_ERR(0, 172, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6101,7 +6113,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, 156, __pyx_L1_error) + __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_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6122,11 +6134,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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; + 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_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -6139,155 +6153,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, 156, __pyx_L1_error) - __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 156, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PySequence_ListKeepNew(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __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, 156, __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, 156, __pyx_L1_error) + 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 (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_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, 156, __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, 156, __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, 156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } - if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 156, __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_22generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "constraint/parser.py":158 - * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) - * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None - * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 # <<<<<<<<<<<<<< - * variables_on_left = len(right) == 1 - * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": -*/ - -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; - 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, 158, __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_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, 158, __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_22generator7(__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; - PyObject *__pyx_t_5 = NULL; - size_t __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; - 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, 158, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 158, __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, 158, __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, 158, __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, 172, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6295,7 +6170,7 @@ 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, 158, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 172, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6305,7 +6180,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 158, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 172, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6316,13 +6191,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __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, 158, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 172, __pyx_L1_error) PyErr_Clear(); } break; @@ -6340,11 +6215,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __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, 158, __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, 158, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = (!__pyx_t_7); if (__pyx_t_8) { @@ -6384,9 +6259,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_22generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":219 +/* "constraint/parser.py":240 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< @@ -6394,19 +6269,19 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric * return None */ -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_20genexpr(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_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_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_10_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 219, __pyx_L1_error) + __PYX_ERR(0, 240, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6417,7 +6292,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, 219, __pyx_L1_error) + __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, 240, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6433,9 +6308,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_22generator7(__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_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; @@ -6455,16 +6330,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, 219, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 219, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 240, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 240, __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, 219, __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, 240, __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, 219, __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, 240, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6472,7 +6347,7 @@ 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, 219, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 240, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6482,7 +6357,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 219, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 240, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6493,13 +6368,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __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, 219, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 240, __pyx_L1_error) PyErr_Clear(); } break; @@ -6510,9 +6385,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, 219, __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, 219, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 219, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_operator)) { __Pyx_RaiseClosureNameError("operator"); __PYX_ERR(0, 240, __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, 240, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { @@ -6551,9 +6426,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_28generator9(__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_25generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":226 +/* "constraint/parser.py":247 * 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): # <<<<<<<<<<<<<< @@ -6561,19 +6436,19 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric * if operator == "**": */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_26genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr *__pyx_cur_scope; +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; 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_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); + __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_11_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, 226, __pyx_L1_error) + __PYX_ERR(0, 247, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6584,7 +6459,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_28generator9, ((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, 226, __pyx_L1_error) + __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, 247, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6600,9 +6475,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_28generator9(__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_25generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - 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); + 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; @@ -6624,16 +6499,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, 226, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 226, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 247, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 247, __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, 226, __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, 247, __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, 226, __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, 247, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6641,7 +6516,7 @@ 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, 226, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 247, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6651,7 +6526,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 226, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 247, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6662,13 +6537,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __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, 226, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 247, __pyx_L1_error) PyErr_Clear(); } break; @@ -6686,11 +6561,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __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, 226, __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, 226, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 247, __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, 247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = (!__pyx_t_7); if (__pyx_t_8) { @@ -6731,12 +6606,12 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return __pyx_r; } -/* "constraint/parser.py":76 +/* "constraint/parser.py":79 * return split_restrictions * * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint]]: # noqa: E501 + * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, VariableMinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint, VariableMaxProdConstraint]]: # noqa: E501 */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_constraint(PyObject *__pyx_self, PyObject *__pyx_v_restriction, PyObject *__pyx_v_params) { @@ -6744,11 +6619,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ PyObject *__pyx_v_comparators = NULL; PyObject *__pyx_v_comparators_found = NULL; 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; PyObject *__pyx_v_unique_operators_right = NULL; PyObject *__pyx_v_unique_operators = NULL; PyObject *__pyx_v_variables_on_left = NULL; - PyObject *__pyx_v_swapped_side_first_variable = NULL; + PyObject *__pyx_v_swapped_side_first_component = NULL; PyObject *__pyx_v_right_remainder = NULL; PyObject *__pyx_v_left_swap = NULL; PyObject *__pyx_v_left_remainder = NULL; @@ -6757,6 +6637,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ PyObject *__pyx_v_left_num = NULL; PyObject *__pyx_v_right_num = NULL; PyObject *__pyx_v_variables = NULL; + PyObject *__pyx_v_variable_operators_left = NULL; + PyObject *__pyx_v_variable_operators_right = NULL; + PyObject *__pyx_v_variable_unique_operators = NULL; PyObject *__pyx_v_number = NULL; int __pyx_v_number_is_int; PyObject *__pyx_v_operators = NULL; @@ -6764,14 +6647,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ 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_8genexpr7__pyx_v_s = NULL; 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_28generator9 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -6795,7 +6680,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, 76, __pyx_L1_error) + __PYX_ERR(0, 79, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6807,7 +6692,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_params); __Pyx_INCREF(__pyx_v_restriction); - /* "constraint/parser.py":81 + /* "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): # <<<<<<<<<<<<<< @@ -6816,7 +6701,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __pyx_t_2 = __pyx_cur_scope->__pyx_v_params; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 == 0); if (!__pyx_t_4) { @@ -6824,19 +6709,19 @@ 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, 81, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 81, __pyx_L1_error) + __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); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = (!__pyx_t_4); __pyx_t_1 = __pyx_t_6; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":82 + /* "constraint/parser.py":85 * # 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 # <<<<<<<<<<<<<< @@ -6847,7 +6732,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":81 + /* "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): # <<<<<<<<<<<<<< @@ -6856,34 +6741,34 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":84 + /* "constraint/parser.py":87 * return None * * comparators = ["<=", "==", ">=", ">", "<"] # <<<<<<<<<<<<<< * comparators_found = re.findall("|".join(comparators), restriction) * # check if there is exactly one comparator, if not, return None */ - __pyx_t_5 = PyList_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_5 = PyList_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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_5, 0, __pyx_mstate_global->__pyx_kp_u__2) != (0)) __PYX_ERR(0, 84, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_mstate_global->__pyx_kp_u__2) != (0)) __PYX_ERR(0, 87, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__7); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_mstate_global->__pyx_kp_u__7) != (0)) __PYX_ERR(0, 84, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_mstate_global->__pyx_kp_u__7) != (0)) __PYX_ERR(0, 87, __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_5, 2, __pyx_mstate_global->__pyx_kp_u__3) != (0)) __PYX_ERR(0, 84, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_mstate_global->__pyx_kp_u__3) != (0)) __PYX_ERR(0, 87, __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_5, 3, __pyx_mstate_global->__pyx_kp_u__4) != (0)) __PYX_ERR(0, 84, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 3, __pyx_mstate_global->__pyx_kp_u__4) != (0)) __PYX_ERR(0, 87, __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_5, 4, __pyx_mstate_global->__pyx_kp_u__5) != (0)) __PYX_ERR(0, 84, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 4, __pyx_mstate_global->__pyx_kp_u__5) != (0)) __PYX_ERR(0, 87, __pyx_L1_error); __pyx_v_comparators = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/parser.py":85 + /* "constraint/parser.py":88 * * comparators = ["<=", "==", ">=", ">", "<"] * comparators_found = re.findall("|".join(comparators), restriction) # <<<<<<<<<<<<<< @@ -6891,12 +6776,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if len(comparators_found) != 1: */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_comparators); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_7 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_comparators); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -6916,24 +6801,24 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 85, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_v_comparators_found = __pyx_t_5; __pyx_t_5 = 0; - /* "constraint/parser.py":87 + /* "constraint/parser.py":90 * comparators_found = re.findall("|".join(comparators), restriction) * # check if there is exactly one comparator, if not, return None * if len(comparators_found) != 1: # <<<<<<<<<<<<<< * return None * comparator = comparators_found[0] */ - __pyx_t_3 = PyObject_Length(__pyx_v_comparators_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_comparators_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 90, __pyx_L1_error) __pyx_t_1 = (__pyx_t_3 != 1); if (__pyx_t_1) { - /* "constraint/parser.py":88 + /* "constraint/parser.py":91 * # check if there is exactly one comparator, if not, return None * if len(comparators_found) != 1: * return None # <<<<<<<<<<<<<< @@ -6944,7 +6829,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":87 + /* "constraint/parser.py":90 * comparators_found = re.findall("|".join(comparators), restriction) * # check if there is exactly one comparator, if not, return None * if len(comparators_found) != 1: # <<<<<<<<<<<<<< @@ -6953,28 +6838,28 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":89 + /* "constraint/parser.py":92 * if len(comparators_found) != 1: * return None * comparator = comparators_found[0] # <<<<<<<<<<<<<< * * # 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); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error) + __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_GOTREF(__pyx_t_5); __pyx_v_comparator = __pyx_t_5; __pyx_t_5 = 0; - /* "constraint/parser.py":92 + /* "constraint/parser.py":95 * * # split the string on the comparison and remove leading and trailing whitespace * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< * * # 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, 92, __pyx_L1_error) + __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_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 92, __pyx_L1_error) + __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); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (1) { @@ -6983,7 +6868,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 92, __pyx_L1_error) + __PYX_ERR(0, 95, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); @@ -6991,187 +6876,278 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __Pyx_GIVEREF(__pyx_t_5); - __pyx_cur_scope->__pyx_v_left = __pyx_t_5; + __pyx_v_left = __pyx_t_5; __pyx_t_5 = 0; - __Pyx_GIVEREF(__pyx_t_7); - __pyx_cur_scope->__pyx_v_right = __pyx_t_7; + __pyx_v_right = __pyx_t_7; __pyx_t_7 = 0; - /* "constraint/parser.py":95 + /* "constraint/parser.py":98 * * # if we have an inverse operation, rewrite to the other side * supported_operators = ["**", "*", "+", "-", "/"] # <<<<<<<<<<<<<< - * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) - * unique_operators_right = set(s.strip() for s in list(right) if s in 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] */ - __pyx_t_8 = PyList_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 95, __pyx_L1_error) + __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, 95, __pyx_L1_error); + 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, 95, __pyx_L1_error); + 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, 95, __pyx_L1_error); + 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, 95, __pyx_L1_error); + 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, 95, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - __pyx_cur_scope->__pyx_v_supported_operators = ((PyObject*)__pyx_t_8); + 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_8 = 0; - /* "constraint/parser.py":96 + /* "constraint/parser.py":99 * # if we have an inverse operation, rewrite to the other side * supported_operators = ["**", "*", "+", "-", "/"] - * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) # <<<<<<<<<<<<<< - * unique_operators_right = set(s.strip() for s in list(right) if s in 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" */ - __pyx_t_8 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_left); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __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, 96, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_v_unique_operators_left = ((PyObject*)__pyx_t_7); - __pyx_t_7 = 0; + { /* 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":97 + /* "constraint/parser.py":100 * supported_operators = ["**", "*", "+", "-", "/"] - * unique_operators_left = set(s.strip() for s in list(left) if s in supported_operators) - * unique_operators_right = set(s.strip() for s in list(right) if s in 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" - * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: + * if len(operators_left) > 0 and len(operators_right) > 0: */ - __pyx_t_7 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_right); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_unique_operators_right = ((PyObject*)__pyx_t_8); + { /* 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_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); __pyx_t_8 = 0; - /* "constraint/parser.py":99 - * unique_operators_right = set(s.strip() for s in list(right) if s in supported_operators) + /* "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" - * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: # <<<<<<<<<<<<<< + * 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 */ - if (unlikely(__pyx_v_unique_operators_left == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 99, __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, 99, __pyx_L1_error) + __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_6 = (__pyx_t_3 > 0); if (__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L8_bool_binop_done; - } - if (unlikely(__pyx_v_unique_operators_right == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 99, __pyx_L1_error) + goto __pyx_L24_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, 99, __pyx_L1_error) + __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_6 = (__pyx_t_3 > 0); __pyx_t_1 = __pyx_t_6; - __pyx_L8_bool_binop_done:; + __pyx_L24_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":101 - * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: + /* "constraint/parser.py":104 + * 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 # <<<<<<<<<<<<<< - * unique_operators = unique_operators_left.union(unique_operators_right) - * if len(unique_operators) == 1: + * unique_operators_left = set(operators_left) + * unique_operators_right = set(operators_right) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":99 - * unique_operators_right = set(s.strip() for s in list(right) if s in supported_operators) + /* "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" - * if len(unique_operators_left) > 0 and len(unique_operators_right) > 0: # <<<<<<<<<<<<<< + * 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":102 + /* "constraint/parser.py":105 * # 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_GOTREF(__pyx_t_8); + __pyx_v_unique_operators_left = ((PyObject*)__pyx_t_8); + __pyx_t_8 = 0; + + /* "constraint/parser.py":106 + * 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_GOTREF(__pyx_t_8); + __pyx_v_unique_operators_right = ((PyObject*)__pyx_t_8); + __pyx_t_8 = 0; + + /* "constraint/parser.py":107 + * 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, 102, __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, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_unique_operators = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/parser.py":103 - * return None + /* "constraint/parser.py":108 + * 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_variable = re.search(regex_match_variable, left if variables_on_left else right) + * swapped_side_first_component = re.search(regex_match_variable_or_constant, left if variables_on_left else right) # noqa: E501 */ - __pyx_t_3 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 103, __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, 108, __pyx_L1_error) __pyx_t_1 = (__pyx_t_3 == 1); if (__pyx_t_1) { - /* "constraint/parser.py":104 + /* "constraint/parser.py":109 * 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_variable = re.search(regex_match_variable, left if variables_on_left else right) - * if swapped_side_first_variable is None: + * 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_v_unique_operators_left == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 104, __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, 104, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyBool_FromLong((__pyx_t_3 > 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 104, __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, 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_GOTREF(__pyx_t_8); __pyx_v_variables_on_left = __pyx_t_8; __pyx_t_8 = 0; - /* "constraint/parser.py":105 + /* "constraint/parser.py":110 * if len(unique_operators) == 1: * variables_on_left = len(unique_operators_left) > 0 - * swapped_side_first_variable = re.search(regex_match_variable, left if variables_on_left else right) # <<<<<<<<<<<<<< - * if swapped_side_first_variable is None: + * 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 */ __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 105, __pyx_L1_error) + __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_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, 105, __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, 110, __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)) { __Pyx_RaiseClosureNameError("regex_match_variable"); __PYX_ERR(0, 105, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 105, __pyx_L1_error) + 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) if (__pyx_t_1) { - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_left); - __pyx_t_5 = __pyx_cur_scope->__pyx_v_left; + __Pyx_INCREF(__pyx_v_left); + __pyx_t_5 = __pyx_v_left; } else { - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_right); - __pyx_t_5 = __pyx_cur_scope->__pyx_v_right; + __Pyx_INCREF(__pyx_v_right); + __pyx_t_5 = __pyx_v_right; } __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -7186,139 +7162,139 @@ 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, __pyx_t_5}; + 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_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, 105, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_v_swapped_side_first_variable = __pyx_t_8; + __pyx_v_swapped_side_first_component = __pyx_t_8; __pyx_t_8 = 0; - /* "constraint/parser.py":106 + /* "constraint/parser.py":111 * variables_on_left = len(unique_operators_left) > 0 - * swapped_side_first_variable = re.search(regex_match_variable, left if variables_on_left else right) - * if swapped_side_first_variable is None: # <<<<<<<<<<<<<< + * 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 */ - __pyx_t_1 = (__pyx_v_swapped_side_first_variable == Py_None); + __pyx_t_1 = (__pyx_v_swapped_side_first_component == Py_None); if (__pyx_t_1) { - /* "constraint/parser.py":108 - * if swapped_side_first_variable is None: + /* "constraint/parser.py":113 + * if swapped_side_first_component is None: * # if there is no variable on the left side, we can't handle this yet * return None # <<<<<<<<<<<<<< * else: - * swapped_side_first_variable = swapped_side_first_variable.group(0) + * swapped_side_first_component = swapped_side_first_component.group(0) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":106 + /* "constraint/parser.py":111 * variables_on_left = len(unique_operators_left) > 0 - * swapped_side_first_variable = re.search(regex_match_variable, left if variables_on_left else right) - * if swapped_side_first_variable is None: # <<<<<<<<<<<<<< + * 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 */ } - /* "constraint/parser.py":110 + /* "constraint/parser.py":115 * return None * else: - * swapped_side_first_variable = swapped_side_first_variable.group(0) # <<<<<<<<<<<<<< + * swapped_side_first_component = swapped_side_first_component.group(0) # <<<<<<<<<<<<<< * if "-" in unique_operators: * if not variables_on_left: */ /*else*/ { - __pyx_t_2 = __pyx_v_swapped_side_first_variable; + __pyx_t_2 = __pyx_v_swapped_side_first_component; __Pyx_INCREF(__pyx_t_2); __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_XDECREF(__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, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __Pyx_DECREF_SET(__pyx_v_swapped_side_first_variable, __pyx_t_8); + __Pyx_DECREF_SET(__pyx_v_swapped_side_first_component, __pyx_t_8); __pyx_t_8 = 0; } - /* "constraint/parser.py":111 + /* "constraint/parser.py":116 * else: - * swapped_side_first_variable = swapped_side_first_variable.group(0) + * swapped_side_first_component = swapped_side_first_component.group(0) * if "-" in unique_operators: # <<<<<<<<<<<<<< * 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, 111, __pyx_L1_error) + __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) if (__pyx_t_1) { - /* "constraint/parser.py":112 - * swapped_side_first_variable = swapped_side_first_variable.group(0) + /* "constraint/parser.py":117 + * swapped_side_first_component = swapped_side_first_component.group(0) * 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_variable):] + * 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, 112, __pyx_L1_error) + __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); if (__pyx_t_6) { - /* "constraint/parser.py":114 + /* "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_variable):] # <<<<<<<<<<<<<< + * right_remainder = right[len(swapped_side_first_component):] # <<<<<<<<<<<<<< * left_swap = right_remainder.replace("-", "+") - * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" + * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_component}" */ - __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 114, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_right, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_component); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_right, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_right_remainder = __pyx_t_8; __pyx_t_8 = 0; - /* "constraint/parser.py":115 + /* "constraint/parser.py":120 * # e.g. "G == B-M" becomes "G+M == B" - * right_remainder = right[len(swapped_side_first_variable):] + * right_remainder = right[len(swapped_side_first_component):] * left_swap = right_remainder.replace("-", "+") # <<<<<<<<<<<<<< - * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" + * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_component}" * else: */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_left_swap = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/parser.py":116 - * right_remainder = right[len(swapped_side_first_variable):] + /* "constraint/parser.py":121 + * right_remainder = right[len(swapped_side_first_component):] * left_swap = right_remainder.replace("-", "+") - * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" # <<<<<<<<<<<<<< + * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_component}" # <<<<<<<<<<<<<< * else: * # e.g. "B-M == G" becomes "B == G+M" */ - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_component, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_10[0] = __pyx_t_2; __pyx_t_10[1] = __pyx_t_8; __pyx_t_10[2] = __pyx_t_5; __pyx_t_10[3] = __pyx_t_7; __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7)); - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 116, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -7327,66 +7303,66 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF_SET(__pyx_v_restriction, ((PyObject*)__pyx_t_11)); __pyx_t_11 = 0; - /* "constraint/parser.py":112 - * swapped_side_first_variable = swapped_side_first_variable.group(0) + /* "constraint/parser.py":117 + * swapped_side_first_component = swapped_side_first_component.group(0) * 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_variable):] + * right_remainder = right[len(swapped_side_first_component):] */ - goto __pyx_L13; + goto __pyx_L29; } - /* "constraint/parser.py":119 + /* "constraint/parser.py":124 * else: * # e.g. "B-M == G" becomes "B == G+M" - * left_remainder = left[len(swapped_side_first_variable):] # <<<<<<<<<<<<<< + * left_remainder = left[len(swapped_side_first_component):] # <<<<<<<<<<<<<< * right_swap = left_remainder.replace("-", "+") - * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" + * restriction = f"{swapped_side_first_component}{comparator}{right}{right_swap}" */ /*else*/ { - __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 119, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_left, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_component); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_v_left, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_v_left_remainder = __pyx_t_11; __pyx_t_11 = 0; - /* "constraint/parser.py":120 + /* "constraint/parser.py":125 * # e.g. "B-M == G" becomes "B == G+M" - * left_remainder = left[len(swapped_side_first_variable):] + * left_remainder = left[len(swapped_side_first_component):] * right_swap = left_remainder.replace("-", "+") # <<<<<<<<<<<<<< - * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" + * restriction = f"{swapped_side_first_component}{comparator}{right}{right_swap}" * if "/" in unique_operators: */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_v_right_swap = __pyx_t_7; __pyx_t_7 = 0; - /* "constraint/parser.py":121 - * left_remainder = left[len(swapped_side_first_variable):] + /* "constraint/parser.py":126 + * left_remainder = left[len(swapped_side_first_component):] * right_swap = left_remainder.replace("-", "+") - * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" # <<<<<<<<<<<<<< + * restriction = f"{swapped_side_first_component}{comparator}{right}{right_swap}" # <<<<<<<<<<<<<< * if "/" in unique_operators: * if not variables_on_left: */ - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_component, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10[0] = __pyx_t_7; __pyx_t_10[1] = __pyx_t_11; __pyx_t_10[2] = __pyx_t_5; __pyx_t_10[3] = __pyx_t_8; __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8)); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __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; @@ -7395,87 +7371,87 @@ 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_L13:; + __pyx_L29:; - /* "constraint/parser.py":111 + /* "constraint/parser.py":116 * else: - * swapped_side_first_variable = swapped_side_first_variable.group(0) + * swapped_side_first_component = swapped_side_first_component.group(0) * if "-" in unique_operators: # <<<<<<<<<<<<<< * if not variables_on_left: * # e.g. "G == B-M" becomes "G+M == B" */ } - /* "constraint/parser.py":122 + /* "constraint/parser.py":127 * right_swap = left_remainder.replace("-", "+") - * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" + * 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" */ - __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, 122, __pyx_L1_error) + __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) if (__pyx_t_6) { - /* "constraint/parser.py":123 - * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" + /* "constraint/parser.py":128 + * 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_variable):] + * 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, 123, __pyx_L1_error) + __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); if (__pyx_t_1) { - /* "constraint/parser.py":125 + /* "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_variable):] # <<<<<<<<<<<<<< + * right_remainder = right[len(swapped_side_first_component):] # <<<<<<<<<<<<<< * left_swap = right_remainder.replace("/", "*") - * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" + * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_component}" */ - __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 125, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_right, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_component); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_right, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_right_remainder, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":126 + /* "constraint/parser.py":131 * # e.g. "G == B/M" becomes "G*M == B" - * right_remainder = right[len(swapped_side_first_variable):] + * right_remainder = right[len(swapped_side_first_component):] * left_swap = right_remainder.replace("/", "*") # <<<<<<<<<<<<<< - * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" + * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_component}" * else: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_left_swap, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/parser.py":127 - * right_remainder = right[len(swapped_side_first_variable):] + /* "constraint/parser.py":132 + * right_remainder = right[len(swapped_side_first_component):] * left_swap = right_remainder.replace("/", "*") - * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" # <<<<<<<<<<<<<< + * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_component}" # <<<<<<<<<<<<<< * else: * # e.g. "B/M == G" becomes "B == G*M" */ - __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_component, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10[0] = __pyx_t_8; __pyx_t_10[1] = __pyx_t_2; __pyx_t_10[2] = __pyx_t_5; __pyx_t_10[3] = __pyx_t_11; __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11)); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 132, __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; @@ -7484,66 +7460,66 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF_SET(__pyx_v_restriction, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; - /* "constraint/parser.py":123 - * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" + /* "constraint/parser.py":128 + * 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_variable):] + * right_remainder = right[len(swapped_side_first_component):] */ - goto __pyx_L15; + goto __pyx_L31; } - /* "constraint/parser.py":130 + /* "constraint/parser.py":135 * else: * # e.g. "B/M == G" becomes "B == G*M" - * left_remainder = left[len(swapped_side_first_variable):] # <<<<<<<<<<<<<< + * left_remainder = left[len(swapped_side_first_component):] # <<<<<<<<<<<<<< * right_swap = left_remainder.replace("/", "*") - * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" + * restriction = f"{swapped_side_first_component}{comparator}{right}{right_swap}" */ /*else*/ { - __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_variable); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 130, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_left, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_component); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_left, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_left_remainder, __pyx_t_7); __pyx_t_7 = 0; - /* "constraint/parser.py":131 + /* "constraint/parser.py":136 * # e.g. "B/M == G" becomes "B == G*M" - * left_remainder = left[len(swapped_side_first_variable):] + * left_remainder = left[len(swapped_side_first_component):] * right_swap = left_remainder.replace("/", "*") # <<<<<<<<<<<<<< - * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" + * restriction = f"{swapped_side_first_component}{comparator}{right}{right_swap}" * */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_right_swap, __pyx_t_11); __pyx_t_11 = 0; - /* "constraint/parser.py":132 - * left_remainder = left[len(swapped_side_first_variable):] + /* "constraint/parser.py":137 + * left_remainder = left[len(swapped_side_first_component):] * right_swap = left_remainder.replace("/", "*") - * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" # <<<<<<<<<<<<<< + * restriction = f"{swapped_side_first_component}{comparator}{right}{right_swap}" # <<<<<<<<<<<<<< * * # we have a potentially rewritten restriction, split again */ - __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_variable, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_component, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10[0] = __pyx_t_11; __pyx_t_10[1] = __pyx_t_7; __pyx_t_10[2] = __pyx_t_5; __pyx_t_10[3] = __pyx_t_2; __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2)); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 132, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -7552,27 +7528,27 @@ 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_L15:; + __pyx_L31:; - /* "constraint/parser.py":122 + /* "constraint/parser.py":127 * right_swap = left_remainder.replace("-", "+") - * restriction = f"{swapped_side_first_variable}{comparator}{right}{right_swap}" + * 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" */ } - /* "constraint/parser.py":135 + /* "constraint/parser.py":140 * * # we have a potentially rewritten restriction, split again * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< - * - * # find out which side is the constant number + * 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] */ - __pyx_t_8 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_14genexpr(NULL, __pyx_v_restriction, __pyx_v_comparator); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 135, __pyx_L1_error) + __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_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) + __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); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (1) { @@ -7581,7 +7557,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 135, __pyx_L1_error) + __PYX_ERR(0, 140, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); @@ -7589,82 +7565,220 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_left); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_left, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); + __Pyx_DECREF_SET(__pyx_v_left, __pyx_t_8); __pyx_t_8 = 0; - __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_right); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_right, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_right, __pyx_t_5); __pyx_t_5 = 0; - /* "constraint/parser.py":103 - * return None - * 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_variable = re.search(regex_match_variable, left if variables_on_left else right) + /* "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] + * unique_operators_left = set(operators_left) */ - } - - /* "constraint/parser.py":138 - * - * # find out which side is the constant number - * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< + { /* 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_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)); + __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] # <<<<<<<<<<<<<< + * 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_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)); + __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] + * unique_operators_left = set(operators_left) # <<<<<<<<<<<<<< + * unique_operators_right = set(operators_right) + * unique_operators = unique_operators_left.union(unique_operators_right) +*/ + __pyx_t_2 = PySet_New(__pyx_v_operators_left); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_unique_operators_left, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "constraint/parser.py":144 + * operators_right = [s.strip() for s in list(right) if s in supported_operators] + * unique_operators_left = set(operators_left) + * unique_operators_right = set(operators_right) # <<<<<<<<<<<<<< + * unique_operators = unique_operators_left.union(unique_operators_right) + * +*/ + __pyx_t_2 = PySet_New(__pyx_v_operators_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_unique_operators_right, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "constraint/parser.py":145 + * 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 +*/ + __pyx_t_2 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PySet_Type__union, __pyx_v_unique_operators_left, __pyx_v_unique_operators_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_unique_operators, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "constraint/parser.py":108 + * 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 +*/ + } + + /* "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') */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) + __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, 138, __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, 138, __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[10])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 138, __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, 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":149 + /* "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): */ - __pyx_t_5 = __pyx_cur_scope->__pyx_v_left; - __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, 149, __pyx_L1_error) - __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_is_or_evals_to_number(__pyx_v_is_or_evals_to_number, ((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_left_num = __pyx_t_2; - __pyx_t_2 = 0; + 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; - /* "constraint/parser.py":150 + /* "constraint/parser.py":160 * # 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 */ - __pyx_t_2 = __pyx_cur_scope->__pyx_v_right; - __Pyx_INCREF(__pyx_t_2); - if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 150, __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_t_2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error) + 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_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_right_num = __pyx_t_5; __pyx_t_5 = 0; - /* "constraint/parser.py":151 + /* "constraint/parser.py":161 * 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): # <<<<<<<<<<<<<< @@ -7673,243 +7787,242 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __pyx_t_6 = (__pyx_v_left_num == Py_None); if (!__pyx_t_6) { - goto __pyx_L18_next_or; + goto __pyx_L50_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_L17_bool_binop_done; + goto __pyx_L49_bool_binop_done; } - __pyx_L18_next_or:; + __pyx_L50_next_or:; __pyx_t_6 = (__pyx_v_left_num != Py_None); if (__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L17_bool_binop_done; + goto __pyx_L49_bool_binop_done; } __pyx_t_6 = (__pyx_v_right_num != Py_None); __pyx_t_1 = __pyx_t_6; - __pyx_L17_bool_binop_done:; + __pyx_L49_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":153 + /* "constraint/parser.py":163 * 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 = ['+', '*'] # <<<<<<<<<<<<<< - * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] - * # find all unique variable_supported_operators in the restriction, can have at most one + * # 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, 153, __pyx_L1_error) + __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, 153, __pyx_L1_error); + 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_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, 153, __pyx_L1_error); + 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; - /* "constraint/parser.py":154 - * # if both sides are parameters, try to use the VariableConstraints + /* "constraint/parser.py":165 * variable_supported_operators = ['+', '*'] - * variables = [s.strip() for s in list(left + right) if s not in 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 - * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) */ - { /* enter inner scope */ - __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 154, __pyx_L23_error) + __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_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_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) } + __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); + __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; + __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); - __pyx_t_2 = PyNumber_Add(__pyx_cur_scope->__pyx_v_left, __pyx_cur_scope->__pyx_v_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PySequence_ListKeepNew(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 154, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2); - __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_2); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 154, __pyx_L23_error) - #endif - if (__pyx_t_3 >= __pyx_temp) break; - } - __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); - ++__pyx_t_3; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 154, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_s, __pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_8genexpr7__pyx_v_s, __pyx_cur_scope->__pyx_v_variable_supported_operators, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 154, __pyx_L23_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_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, 154, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_8); - } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 154, __pyx_L23_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_s); __pyx_8genexpr7__pyx_v_s = 0; - goto __pyx_L28_exit_scope; - __pyx_L23_error:; - __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_s); __pyx_8genexpr7__pyx_v_s = 0; - goto __pyx_L1_error; - __pyx_L28_exit_scope:; - } /* exit inner scope */ + } __pyx_v_variables = __pyx_t_5; __pyx_t_5 = 0; - /* "constraint/parser.py":156 - * variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] + /* "constraint/parser.py":168 + * * # find all unique variable_supported_operators in the restriction, can have at most one - * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) # <<<<<<<<<<<<<< - * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None - * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 + * 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_5 = PyNumber_Add(__pyx_cur_scope->__pyx_v_left, __pyx_cur_scope->__pyx_v_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 156, __pyx_L1_error) + __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_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_17genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __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_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_v_variable_operators_left = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + + /* "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 +*/ + __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_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_unique_operators, ((PyObject*)__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; - /* "constraint/parser.py":158 - * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) + /* "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(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 # <<<<<<<<<<<<<< - * variables_on_left = len(right) == 1 - * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": + * 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 (unlikely(__pyx_v_unique_operators == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 158, __pyx_L1_error) + __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_3 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 158, __pyx_L1_error) + __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] == "+": +*/ + __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_L30_bool_binop_done; + goto __pyx_L54_bool_binop_done; } - __pyx_t_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_20genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_variables); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __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, 158, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 158, __pyx_L1_error) + __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_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_L30_bool_binop_done; + goto __pyx_L54_bool_binop_done; } - __pyx_t_2 = __pyx_cur_scope->__pyx_v_left; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 158, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = (__pyx_t_3 == 1); + __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) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L30_bool_binop_done; + goto __pyx_L54_bool_binop_done; } - __pyx_t_2 = __pyx_cur_scope->__pyx_v_right; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 158, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = (__pyx_t_3 == 1); + __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_6 = (__pyx_t_3 == 0); __pyx_t_1 = __pyx_t_6; - __pyx_L30_bool_binop_done:; + __pyx_L54_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":159 + /* "constraint/parser.py":173 * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None - * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 - * variables_on_left = len(right) == 1 # <<<<<<<<<<<<<< - * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": + * 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 == "==": */ - __pyx_t_2 = __pyx_cur_scope->__pyx_v_right; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_t_3 == 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_XDECREF_SET(__pyx_v_variables_on_left, __pyx_t_2); - __pyx_t_2 = 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, 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; - /* "constraint/parser.py":160 - * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 - * variables_on_left = len(right) == 1 - * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": # <<<<<<<<<<<<<< + /* "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 + * 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 */ - if (unlikely(__pyx_v_unique_operators == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 160, __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, 160, __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, 174, __pyx_L1_error) __pyx_t_6 = (__pyx_t_3 == 0); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L35_bool_binop_done; + goto __pyx_L59_bool_binop_done; } - __pyx_t_2 = PyObject_GetIter(__pyx_v_unique_operators); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 160, __pyx_L1_error) + __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_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __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, 160, __pyx_L1_error) + __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_1 = __pyx_t_6; - __pyx_L35_bool_binop_done:; + __pyx_L59_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":161 - * variables_on_left = len(right) == 1 - * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": + /* "constraint/parser.py":175 + * 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 == "<=": */ - __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, 161, __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, 175, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":162 - * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": + /* "constraint/parser.py":176 + * 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) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 176, __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, 162, __pyx_L1_error) + __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 162, __pyx_L1_error) + __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) __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, 162, __pyx_L1_error) + __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_GOTREF(__pyx_t_12); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -7930,18 +8043,18 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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, 162, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 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, 162, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 176, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 162, __pyx_L1_error) + __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, 162, __pyx_L1_error) + __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_9 = 1; #if CYTHON_UNPACK_METHODS @@ -7962,7 +8075,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_5 = __pyx_t_2; @@ -7972,26 +8085,26 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":161 - * variables_on_left = len(right) == 1 - * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": + /* "constraint/parser.py":175 + * 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 == "<=": */ } - /* "constraint/parser.py":163 + /* "constraint/parser.py":177 * 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 VariableMaxSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMinSumConstraint(variables[0], variables[1:]) # noqa: E501 */ - __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, 163, __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, 177, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":165 + /* "constraint/parser.py":179 * 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 # <<<<<<<<<<<<<< @@ -7999,14 +8112,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # "B+C >= A" (minsum) if variables_on_left else "A >= B+C" (maxsum) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 179, __pyx_L1_error) if (__pyx_t_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, 165, __pyx_L1_error) + __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 165, __pyx_L1_error) + __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_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, 165, __pyx_L1_error) + __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 @@ -8027,18 +8140,18 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 165, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 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, 165, __pyx_L1_error) + __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 165, __pyx_L1_error) + __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) __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, 165, __pyx_L1_error) + __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_GOTREF(__pyx_t_12); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -8059,7 +8172,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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, 165, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_5 = __pyx_t_2; @@ -8069,7 +8182,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":163 + /* "constraint/parser.py":177 * if comparator == "==": * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 * elif comparator == "<=": # <<<<<<<<<<<<<< @@ -8078,32 +8191,32 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":166 + /* "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 * 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 */ - __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, 166, __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, 180, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":168 + /* "constraint/parser.py":182 * 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 next(iter(unique_operators)) == "*": + * elif variable_unique_operators[0] == "*": * if comparator == "==": */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 182, __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, 168, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 182, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 168, __pyx_L1_error) + __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, 168, __pyx_L1_error) + __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_9 = 1; #if CYTHON_UNPACK_METHODS @@ -8124,18 +8237,18 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 0; } else { __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 168, __pyx_L1_error) + __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 168, __pyx_L1_error) + __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_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, 168, __pyx_L1_error) + __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 @@ -8156,7 +8269,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 168, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_5 = __pyx_t_2; @@ -8166,7 +8279,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":166 + /* "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 * elif comparator == ">=": # <<<<<<<<<<<<<< @@ -8175,58 +8288,55 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":160 - * if len(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 - * variables_on_left = len(right) == 1 - * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": # <<<<<<<<<<<<<< + /* "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 + * 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 */ - goto __pyx_L34; + goto __pyx_L58; } - /* "constraint/parser.py":169 + /* "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 - * elif next(iter(unique_operators)) == "*": # <<<<<<<<<<<<<< + * 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 */ - __pyx_t_5 = PyObject_GetIter(__pyx_v_unique_operators); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) + __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_2 = __Pyx_PyIter_Next(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __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_1 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "constraint/parser.py":170 + /* "constraint/parser.py":184 * return VariableMinSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxSumConstraint(variables[0], variables[1:]) # noqa: E501 - * elif next(iter(unique_operators)) == "*": + * 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 == "<=": */ - __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, 170, __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, 184, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":171 - * elif next(iter(unique_operators)) == "*": + /* "constraint/parser.py":185 + * 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 # <<<<<<<<<<<<<< - * - * # left_num and right_num can't be both None or both a constant + * elif comparator == "<=": + * # "B*C <= A" (maxprod) if variables_on_left else "A <= B*C" (minprod) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 185, __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, 171, __pyx_L1_error) + __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 171, __pyx_L1_error) + __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) __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, 171, __pyx_L1_error) + __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_GOTREF(__pyx_t_12); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -8242,23 +8352,23 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_11, __pyx_t_12}; - __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_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; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_2 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_5 = __pyx_t_2; + __pyx_t_2 = 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, 171, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 185, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 171, __pyx_L1_error) + __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, 171, __pyx_L1_error) + __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_9 = 1; #if CYTHON_UNPACK_METHODS @@ -8274,52 +8384,246 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ #endif { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_11, __pyx_t_8}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_2 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_5 = __pyx_t_2; + __pyx_t_2 = 0; } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 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 + * 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 == "<=": +*/ + } + + /* "constraint/parser.py":186 + * 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 VariableMaxProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMinProdConstraint(variables[0], variables[1:]) # noqa: E501 +*/ + __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":188 + * 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) +*/ + __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) + if (__pyx_t_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_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); + assert(__pyx_t_12); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __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)); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 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_t_5 = __pyx_t_2; + __pyx_t_2 = 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) + __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_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); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_7, __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; + __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_t_5 = __pyx_t_2; + __pyx_t_2 = 0; + } + __pyx_r = __pyx_t_5; + __pyx_t_5 = 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 + * 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 +*/ + } + + /* "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 + * 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 +*/ + __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) + if (__pyx_t_1) { + + /* "constraint/parser.py":191 + * 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 +*/ + __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) + 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) + __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_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); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_7); + __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; + __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); + } + __pyx_t_5 = __pyx_t_2; + __pyx_t_2 = 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) + __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); + assert(__pyx_t_12); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __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)); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 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_t_5 = __pyx_t_2; + __pyx_t_2 = 0; + } + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":170 - * return VariableMinSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxSumConstraint(variables[0], variables[1:]) # noqa: E501 - * elif next(iter(unique_operators)) == "*": - * if comparator == "==": # <<<<<<<<<<<<<< - * return VariableExactProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactProdConstraint(variables[0], variables[1:]) # noqa: E501 - * + /* "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 + * 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 */ } - /* "constraint/parser.py":169 + /* "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 - * elif next(iter(unique_operators)) == "*": # <<<<<<<<<<<<<< + * 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 */ } - __pyx_L34:; + __pyx_L58:; - /* "constraint/parser.py":158 - * unique_operators = set(s.strip() for s in list(left + right) if s in variable_supported_operators) + /* "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(unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(left) == 1 or len(right) == 1): # noqa: E501 # <<<<<<<<<<<<<< - * variables_on_left = len(right) == 1 - * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": + * 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":174 + /* "constraint/parser.py":194 * - * # left_num and right_num can't be both None or both a constant + * # left_num and right_num can't both be constants, or for other reasons we can't use a VariableConstraint * return None # <<<<<<<<<<<<<< * * # if one side is a number, the other side must be a variable or expression @@ -8328,7 +8632,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":151 + /* "constraint/parser.py":161 * 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): # <<<<<<<<<<<<<< @@ -8337,7 +8641,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":178 + /* "constraint/parser.py":198 * # 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) # <<<<<<<<<<<<<< @@ -8346,99 +8650,99 @@ 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_12 = __pyx_cur_scope->__pyx_v_right; - __Pyx_INCREF(__pyx_t_12); + __pyx_t_8 = __pyx_v_right; + __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_12, 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_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + 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); } - __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_left_num); __Pyx_GIVEREF(__pyx_v_left_num); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_left_num) != (0)) __PYX_ERR(0, 178, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 178, __pyx_L1_error); + 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); __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 2, Py_False) != (0)) __PYX_ERR(0, 178, __pyx_L1_error); - __pyx_t_5 = 0; - __pyx_t_2 = __pyx_t_12; - __pyx_t_12 = 0; + 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; + __pyx_t_8 = 0; } else { - __pyx_t_5 = __pyx_cur_scope->__pyx_v_left; - __Pyx_INCREF(__pyx_t_5); + __pyx_t_2 = __pyx_v_left; + __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; - __pyx_t_12 = __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_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + 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); } - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_right_num); __Pyx_GIVEREF(__pyx_v_right_num); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_right_num) != (0)) __PYX_ERR(0, 178, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_12); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_12) != (0)) __PYX_ERR(0, 178, __pyx_L1_error); + 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); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, Py_True) != (0)) __PYX_ERR(0, 178, __pyx_L1_error); - __pyx_t_12 = 0; - __pyx_t_2 = __pyx_t_5; - __pyx_t_5 = 0; + 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; + __pyx_t_2 = 0; } - if (likely(__pyx_t_2 != Py_None)) { - PyObject* sequence = __pyx_t_2; + if (likely(__pyx_t_5 != Py_None)) { + PyObject* sequence = __pyx_t_5; 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, 177, __pyx_L1_error) + __PYX_ERR(0, 197, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_5); - __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_12); - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_8); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 177, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 177, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 177, __pyx_L1_error) + __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_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); #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 197, __pyx_L1_error) } - /* "constraint/parser.py":177 + /* "constraint/parser.py":197 * * # 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_5; - __pyx_t_5 = 0; - __pyx_v_variables = __pyx_t_12; - __pyx_t_12 = 0; - __Pyx_XDECREF_SET(__pyx_v_variables_on_left, __pyx_t_8); + __pyx_v_number = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v_variables = __pyx_t_8; __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_variables_on_left, __pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/parser.py":182 - * + /* "constraint/parser.py":203 * # if the number is an integer, we can map '>' to '>=' and '<' to '<=' by changing the number (does not work with floating points!) # noqa: E501 + * # TODO instead use the smallest floating point difference in Python / ^-10 * number_is_int = isinstance(number, int) # <<<<<<<<<<<<<< * if number_is_int: * if comparator == "<": @@ -8446,8 +8750,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_1 = PyLong_Check(__pyx_v_number); __pyx_v_number_is_int = __pyx_t_1; - /* "constraint/parser.py":183 - * # if the number is an integer, we can map '>' to '>=' and '<' to '<=' by changing the number (does not work with floating points!) # noqa: E501 + /* "constraint/parser.py":204 + * # TODO instead use the smallest floating point difference in Python / ^-10 * number_is_int = isinstance(number, int) * if number_is_int: # <<<<<<<<<<<<<< * if comparator == "<": @@ -8455,49 +8759,49 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ if (__pyx_v_number_is_int) { - /* "constraint/parser.py":184 + /* "constraint/parser.py":205 * number_is_int = isinstance(number, int) * if number_is_int: * if comparator == "<": # <<<<<<<<<<<<<< * if variables_on_left: * # (x < 2) == (x <= 2-1) */ - __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, 184, __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, 205, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":185 + /* "constraint/parser.py":206 * if number_is_int: * if comparator == "<": * if variables_on_left: # <<<<<<<<<<<<<< * # (x < 2) == (x <= 2-1) * number -= 1 */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 206, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":187 + /* "constraint/parser.py":208 * if variables_on_left: * # (x < 2) == (x <= 2-1) * number -= 1 # <<<<<<<<<<<<<< * else: * # (2 < x) == (2+1 <= x) */ - __pyx_t_2 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_5); + __pyx_t_5 = 0; - /* "constraint/parser.py":185 + /* "constraint/parser.py":206 * if number_is_int: * if comparator == "<": * if variables_on_left: # <<<<<<<<<<<<<< * # (x < 2) == (x <= 2-1) * number -= 1 */ - goto __pyx_L41; + goto __pyx_L65; } - /* "constraint/parser.py":190 + /* "constraint/parser.py":211 * else: * # (2 < x) == (2+1 <= x) * number += 1 # <<<<<<<<<<<<<< @@ -8505,66 +8809,66 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if variables_on_left: */ /*else*/ { - __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_5); + __pyx_t_5 = 0; } - __pyx_L41:; + __pyx_L65:; - /* "constraint/parser.py":184 + /* "constraint/parser.py":205 * number_is_int = isinstance(number, int) * if number_is_int: * if comparator == "<": # <<<<<<<<<<<<<< * if variables_on_left: * # (x < 2) == (x <= 2-1) */ - goto __pyx_L40; + goto __pyx_L64; } - /* "constraint/parser.py":191 + /* "constraint/parser.py":212 * # (2 < x) == (2+1 <= x) * number += 1 * elif comparator == ">": # <<<<<<<<<<<<<< * if variables_on_left: * # (x > 2) == (x >= 2+1) */ - __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, 191, __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, 212, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":192 + /* "constraint/parser.py":213 * number += 1 * elif comparator == ">": * if variables_on_left: # <<<<<<<<<<<<<< * # (x > 2) == (x >= 2+1) * number += 1 */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 213, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":194 + /* "constraint/parser.py":215 * if variables_on_left: * # (x > 2) == (x >= 2+1) * number += 1 # <<<<<<<<<<<<<< * else: * # (2 > x) == (2-1 >= x) */ - __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_5); + __pyx_t_5 = 0; - /* "constraint/parser.py":192 + /* "constraint/parser.py":213 * number += 1 * elif comparator == ">": * if variables_on_left: # <<<<<<<<<<<<<< * # (x > 2) == (x >= 2+1) * number += 1 */ - goto __pyx_L42; + goto __pyx_L66; } - /* "constraint/parser.py":197 + /* "constraint/parser.py":218 * else: * # (2 > x) == (2-1 >= x) * number -= 1 # <<<<<<<<<<<<<< @@ -8572,14 +8876,14 @@ 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_2 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_5); + __pyx_t_5 = 0; } - __pyx_L42:; + __pyx_L66:; - /* "constraint/parser.py":191 + /* "constraint/parser.py":212 * # (2 < x) == (2+1 <= x) * number += 1 * elif comparator == ">": # <<<<<<<<<<<<<< @@ -8587,10 +8891,10 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # (x > 2) == (x >= 2+1) */ } - __pyx_L40:; + __pyx_L64:; - /* "constraint/parser.py":183 - * # if the number is an integer, we can map '>' to '>=' and '<' to '<=' by changing the number (does not work with floating points!) # noqa: E501 + /* "constraint/parser.py":204 + * # TODO instead use the smallest floating point difference in Python / ^-10 * number_is_int = isinstance(number, int) * if number_is_int: # <<<<<<<<<<<<<< * if comparator == "<": @@ -8598,100 +8902,100 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":200 + /* "constraint/parser.py":221 * * # 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_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __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_2, 0, __pyx_mstate_global->__pyx_kp_u__13) != (0)) __PYX_ERR(0, 200, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_mstate_global->__pyx_kp_u__13) != (0)) __PYX_ERR(0, 221, __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_2, 1, __pyx_mstate_global->__pyx_kp_u__14) != (0)) __PYX_ERR(0, 200, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_mstate_global->__pyx_kp_u__14) != (0)) __PYX_ERR(0, 221, __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_2, 2, __pyx_mstate_global->__pyx_kp_u__15) != (0)) __PYX_ERR(0, 200, __pyx_L1_error); - __pyx_v_operators = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_mstate_global->__pyx_kp_u__15) != (0)) __PYX_ERR(0, 221, __pyx_L1_error); + __pyx_v_operators = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; - /* "constraint/parser.py":201 + /* "constraint/parser.py":222 * # 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_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_operators); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 222, __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, 222, __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, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __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); + 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); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_12, __pyx_v_variables}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __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_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + 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; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_v_operators_found = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_operators_found = __pyx_t_5; + __pyx_t_5 = 0; - /* "constraint/parser.py":202 + /* "constraint/parser.py":223 * 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, 202, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_operators_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 223, __pyx_L1_error) __pyx_t_1 = (__pyx_t_3 == 0); if (__pyx_t_1) { - /* "constraint/parser.py":204 + /* "constraint/parser.py":225 * 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_2 = __pyx_cur_scope->__pyx_v_params; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __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, 225, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = (__pyx_t_3 != 1); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L45_bool_binop_done; + goto __pyx_L69_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, 204, __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, 225, __pyx_L1_error) __pyx_t_1 = __pyx_t_6; - __pyx_L45_bool_binop_done:; + __pyx_L69_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":206 + /* "constraint/parser.py":227 * if len(params) != 1 or variables not in params: * # there were more than one variable but no operator * return None # <<<<<<<<<<<<<< @@ -8702,7 +9006,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":204 + /* "constraint/parser.py":225 * if len(operators_found) == 0: * # no operators found, return only based on comparator * if len(params) != 1 or variables not in params: # <<<<<<<<<<<<<< @@ -8711,17 +9015,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":209 + /* "constraint/parser.py":230 * # 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 == "<" and number_is_int): */ - __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, 209, __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, 230, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":210 + /* "constraint/parser.py":231 * # if there are restrictions with a single variable, it will be used to prune the domain at the start * elif comparator == "==": * return ExactSumConstraint(number) # <<<<<<<<<<<<<< @@ -8729,34 +9033,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_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_12); - assert(__pyx_t_5); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_5); + 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); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_number}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __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_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + 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, 231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":209 + /* "constraint/parser.py":230 * # 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 == "==": # <<<<<<<<<<<<<< @@ -8765,30 +9069,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":211 + /* "constraint/parser.py":232 * elif comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): */ - __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, 211, __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, 232, __pyx_L1_error) if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L47_bool_binop_done; + goto __pyx_L71_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, 211, __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, 232, __pyx_L1_error) if (__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L47_bool_binop_done; + goto __pyx_L71_bool_binop_done; } __pyx_t_1 = __pyx_v_number_is_int; - __pyx_L47_bool_binop_done:; + __pyx_L71_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":212 + /* "constraint/parser.py":233 * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< @@ -8796,65 +9100,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, 212, __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) { - __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __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_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); + 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_8, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_number}; - __pyx_t_12 = __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_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + 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); } - __pyx_t_2 = __pyx_t_12; - __pyx_t_12 = 0; + __pyx_t_5 = __pyx_t_8; + __pyx_t_8 = 0; } else { - __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __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); + 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); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_5, __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_12 = __Pyx_PyObject_FastCall(__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_12)) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + 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); } - __pyx_t_2 = __pyx_t_12; - __pyx_t_12 = 0; + __pyx_t_5 = __pyx_t_8; + __pyx_t_8 = 0; } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":211 + /* "constraint/parser.py":232 * elif comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< @@ -8863,30 +9167,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":213 + /* "constraint/parser.py":234 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< * 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, 213, __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, 234, __pyx_L1_error) if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L50_bool_binop_done; + goto __pyx_L74_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, 213, __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, 234, __pyx_L1_error) if (__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L50_bool_binop_done; + goto __pyx_L74_bool_binop_done; } __pyx_t_1 = __pyx_v_number_is_int; - __pyx_L50_bool_binop_done:; + __pyx_L74_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":214 + /* "constraint/parser.py":235 * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) # <<<<<<<<<<<<<< @@ -8894,65 +9198,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, 214, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 235, __pyx_L1_error) if (__pyx_t_1) { - __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __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_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); + 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_8, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_number}; - __pyx_t_12 = __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_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + 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, 235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_2 = __pyx_t_12; - __pyx_t_12 = 0; + __pyx_t_5 = __pyx_t_8; + __pyx_t_8 = 0; } else { - __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __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); + 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); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_5, __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_12 = __Pyx_PyObject_FastCall(__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_12)) __PYX_ERR(0, 214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + 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, 235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_2 = __pyx_t_12; - __pyx_t_12 = 0; + __pyx_t_5 = __pyx_t_8; + __pyx_t_8 = 0; } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":213 + /* "constraint/parser.py":234 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< @@ -8961,36 +9265,36 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":215 + /* "constraint/parser.py":236 * elif comparator == ">=" or (comparator == ">" and number_is_int): * 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_12 = NULL; + __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_builtin_ValueError); - __pyx_t_5 = __pyx_builtin_ValueError; - __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 215, __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, 215, __pyx_L1_error) + __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, 236, __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, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_11}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + 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; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 236, __pyx_L1_error) - /* "constraint/parser.py":202 + /* "constraint/parser.py":223 * operators = [r"\*\*", r"\*", r"\+"] * operators_found = re.findall(str("|".join(operators)), variables) * if len(operators_found) == 0: # <<<<<<<<<<<<<< @@ -8999,37 +9303,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":218 + /* "constraint/parser.py":239 * * # 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_2 = __Pyx_GetItemInt(__pyx_v_operators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_cur_scope->__pyx_v_operator = __pyx_t_2; - __pyx_t_2 = 0; + __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, 239, __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; - /* "constraint/parser.py":219 + /* "constraint/parser.py":240 * # 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_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_23genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_operators_found); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __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, 219, __pyx_L1_error) + __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, 240, __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, 219, __pyx_L1_error) + __pyx_t_2 = __Pyx_Generator_GetInlinedResult(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __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, 240, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = (!__pyx_t_1); if (__pyx_t_6) { - /* "constraint/parser.py":221 + /* "constraint/parser.py":242 * 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 # <<<<<<<<<<<<<< @@ -9040,7 +9344,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":219 + /* "constraint/parser.py":240 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< @@ -9049,66 +9353,66 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":224 + /* "constraint/parser.py":245 * * # 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_2 = __pyx_v_variables; - __Pyx_INCREF(__pyx_t_2); + __pyx_t_5 = __pyx_v_variables; + __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_operator}; - __pyx_t_5 = __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_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + 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, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_v_splitted = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_splitted = __pyx_t_2; + __pyx_t_2 = 0; - /* "constraint/parser.py":226 + /* "constraint/parser.py":247 * 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, 226, __pyx_L1_error) - __pyx_t_5 = __pyx_cur_scope->__pyx_v_params; - __Pyx_INCREF(__pyx_t_5); - __pyx_t_13 = __Pyx_PyList_GET_SIZE(__pyx_t_5); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = PyObject_Length(__pyx_v_splitted); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 247, __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, 247, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = (__pyx_t_3 == __pyx_t_13); if (__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L55_bool_binop_done; + goto __pyx_L79_bool_binop_done; } - __pyx_t_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_26genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_splitted); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __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, 226, __pyx_L1_error) + __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, 247, __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, 226, __pyx_L1_error) + __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 247, __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, 247, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __pyx_t_1; - __pyx_L55_bool_binop_done:; + __pyx_L79_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":228 + /* "constraint/parser.py":249 * 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, 228, __pyx_L1_error) + __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, 249, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":230 + /* "constraint/parser.py":251 * if operator == "**": * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None # <<<<<<<<<<<<<< @@ -9119,7 +9423,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":228 + /* "constraint/parser.py":249 * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): * # map to a Constraint * if operator == "**": # <<<<<<<<<<<<<< @@ -9128,27 +9432,27 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":231 + /* "constraint/parser.py":252 * # 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, 231, __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, 252, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":232 + /* "constraint/parser.py":253 * return None * elif operator == "*": * if comparator == "==": # <<<<<<<<<<<<<< * return ExactProdConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): */ - __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, 232, __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, 253, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":233 + /* "constraint/parser.py":254 * elif operator == "*": * if comparator == "==": * return ExactProdConstraint(number) # <<<<<<<<<<<<<< @@ -9156,34 +9460,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_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11); - assert(__pyx_t_5); + __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_5); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + 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_2)) __PYX_ERR(0, 233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":232 + /* "constraint/parser.py":253 * return None * elif operator == "*": * if comparator == "==": # <<<<<<<<<<<<<< @@ -9192,30 +9496,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":234 + /* "constraint/parser.py":255 * if comparator == "==": * return ExactProdConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): */ - __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, 234, __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, 255, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L59_bool_binop_done; + goto __pyx_L83_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, 234, __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, 255, __pyx_L1_error) if (__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L59_bool_binop_done; + goto __pyx_L83_bool_binop_done; } __pyx_t_6 = __pyx_v_number_is_int; - __pyx_L59_bool_binop_done:; + __pyx_L83_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":235 + /* "constraint/parser.py":256 * return ExactProdConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) # <<<<<<<<<<<<<< @@ -9223,65 +9527,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, 235, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 256, __pyx_L1_error) if (__pyx_t_6) { - __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_12); - assert(__pyx_t_5); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_5); + 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); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_number}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_12, __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_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 235, __pyx_L1_error) + 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; + __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); } - __pyx_t_2 = __pyx_t_11; + __pyx_t_5 = __pyx_t_11; __pyx_t_11 = 0; } else { - __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5); - assert(__pyx_t_12); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_12); + 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_5, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_number}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__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; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 235, __pyx_L1_error) + 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_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_t_2 = __pyx_t_11; + __pyx_t_5 = __pyx_t_11; __pyx_t_11 = 0; } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":234 + /* "constraint/parser.py":255 * if comparator == "==": * return ExactProdConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< @@ -9290,30 +9594,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":236 + /* "constraint/parser.py":257 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< * 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, 236, __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, 257, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L62_bool_binop_done; + goto __pyx_L86_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, 236, __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, 257, __pyx_L1_error) if (__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L62_bool_binop_done; + goto __pyx_L86_bool_binop_done; } __pyx_t_6 = __pyx_v_number_is_int; - __pyx_L62_bool_binop_done:; + __pyx_L86_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":237 + /* "constraint/parser.py":258 * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) # <<<<<<<<<<<<<< @@ -9321,65 +9625,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, 237, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 258, __pyx_L1_error) if (__pyx_t_6) { - __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_12); - assert(__pyx_t_5); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_5); + 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); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_number}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_12, __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_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 237, __pyx_L1_error) + 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; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_2 = __pyx_t_11; + __pyx_t_5 = __pyx_t_11; __pyx_t_11 = 0; } else { - __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); 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_5))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5); - assert(__pyx_t_12); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_12); + 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_5, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_number}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__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; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 237, __pyx_L1_error) + 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_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, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_2 = __pyx_t_11; + __pyx_t_5 = __pyx_t_11; __pyx_t_11 = 0; } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":236 + /* "constraint/parser.py":257 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< @@ -9388,37 +9692,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":231 + /* "constraint/parser.py":252 * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None * elif operator == "*": # <<<<<<<<<<<<<< * if comparator == "==": * return ExactProdConstraint(number) */ - goto __pyx_L57; + goto __pyx_L81; } - /* "constraint/parser.py":238 + /* "constraint/parser.py":259 * elif comparator == ">=" or (comparator == ">" and number_is_int): * 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, 238, __pyx_L1_error) + __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, 259, __pyx_L1_error) if (likely(__pyx_t_6)) { - /* "constraint/parser.py":239 + /* "constraint/parser.py":260 * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": * if comparator == "==": # <<<<<<<<<<<<<< * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): */ - __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, 239, __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, 260, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":240 + /* "constraint/parser.py":261 * elif operator == "+": * if comparator == "==": * return ExactSumConstraint(number) # <<<<<<<<<<<<<< @@ -9427,33 +9731,33 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __Pyx_XDECREF(__pyx_r); __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); + 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_5); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __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_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":239 + /* "constraint/parser.py":260 * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": * if comparator == "==": # <<<<<<<<<<<<<< @@ -9462,30 +9766,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":241 + /* "constraint/parser.py":262 * if comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): */ - __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, 241, __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, 262, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L66_bool_binop_done; + goto __pyx_L90_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, 241, __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, 262, __pyx_L1_error) if (__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L66_bool_binop_done; + goto __pyx_L90_bool_binop_done; } __pyx_t_6 = __pyx_v_number_is_int; - __pyx_L66_bool_binop_done:; + __pyx_L90_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":242 + /* "constraint/parser.py":263 * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< @@ -9493,65 +9797,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, 242, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 263, __pyx_L1_error) if (__pyx_t_6) { __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12); + 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_12); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_12, __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_5 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_2 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_5 = __pyx_t_2; + __pyx_t_2 = 0; } else { - __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 242, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); - assert(__pyx_t_12); + __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_12); + __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[2] = {__pyx_t_12, __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_12); __pyx_t_12 = 0; + 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_2 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_5 = __pyx_t_2; + __pyx_t_2 = 0; } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":241 + /* "constraint/parser.py":262 * if comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< @@ -9560,30 +9864,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":243 + /* "constraint/parser.py":264 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< * 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, 243, __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, 264, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L69_bool_binop_done; + goto __pyx_L93_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, 243, __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, 264, __pyx_L1_error) if (__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L69_bool_binop_done; + goto __pyx_L93_bool_binop_done; } __pyx_t_6 = __pyx_v_number_is_int; - __pyx_L69_bool_binop_done:; + __pyx_L93_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":244 + /* "constraint/parser.py":265 * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) # <<<<<<<<<<<<<< @@ -9591,65 +9895,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, 244, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 265, __pyx_L1_error) if (__pyx_t_6) { __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12); + 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_12); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_12, __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_5 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_2 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_5 = __pyx_t_2; + __pyx_t_2 = 0; } else { - __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 244, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); - assert(__pyx_t_12); + __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_12); + __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[2] = {__pyx_t_12, __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_12); __pyx_t_12 = 0; + 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_2 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_5 = __pyx_t_2; + __pyx_t_2 = 0; } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":243 + /* "constraint/parser.py":264 * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< @@ -9658,17 +9962,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":238 + /* "constraint/parser.py":259 * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": # <<<<<<<<<<<<<< * if comparator == "==": * return ExactSumConstraint(number) */ - goto __pyx_L57; + goto __pyx_L81; } - /* "constraint/parser.py":246 + /* "constraint/parser.py":267 * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * else: * raise ValueError(f"Invalid operator {operator}") # <<<<<<<<<<<<<< @@ -9676,31 +9980,31 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * */ /*else*/ { - __pyx_t_5 = NULL; + __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_builtin_ValueError); __pyx_t_11 = __pyx_builtin_ValueError; - __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 246, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_operator, __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 246, __pyx_L1_error) + __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, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __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, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = 1; - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_8}; - __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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + { + 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_2)) __PYX_ERR(0, 246, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 246, __pyx_L1_error) + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 267, __pyx_L1_error) } - __pyx_L57:; + __pyx_L81:; - /* "constraint/parser.py":226 + /* "constraint/parser.py":247 * 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): # <<<<<<<<<<<<<< @@ -9709,7 +10013,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":247 + /* "constraint/parser.py":268 * else: * raise ValueError(f"Invalid operator {operator}") * return None # <<<<<<<<<<<<<< @@ -9720,12 +10024,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":76 + /* "constraint/parser.py":79 * return split_restrictions * * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint]]: # noqa: E501 + * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, VariableMinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint, VariableMaxProdConstraint]]: # noqa: E501 */ /* function exit code */ @@ -9742,11 +10046,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_XDECREF(__pyx_v_comparators); __Pyx_XDECREF(__pyx_v_comparators_found); __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); __Pyx_XDECREF(__pyx_v_unique_operators_right); __Pyx_XDECREF(__pyx_v_unique_operators); __Pyx_XDECREF(__pyx_v_variables_on_left); - __Pyx_XDECREF(__pyx_v_swapped_side_first_variable); + __Pyx_XDECREF(__pyx_v_swapped_side_first_component); __Pyx_XDECREF(__pyx_v_right_remainder); __Pyx_XDECREF(__pyx_v_left_swap); __Pyx_XDECREF(__pyx_v_left_remainder); @@ -9755,20 +10064,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_XDECREF(__pyx_v_left_num); __Pyx_XDECREF(__pyx_v_right_num); __Pyx_XDECREF(__pyx_v_variables); + __Pyx_XDECREF(__pyx_v_variable_operators_left); + __Pyx_XDECREF(__pyx_v_variable_operators_right); + __Pyx_XDECREF(__pyx_v_variable_unique_operators); __Pyx_XDECREF(__pyx_v_number); __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_8genexpr7__pyx_v_s); __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_28generator9); __Pyx_XDECREF(__pyx_v_restriction); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); @@ -9776,7 +10090,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ return __pyx_r; } -/* "constraint/parser.py":249 +/* "constraint/parser.py":270 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< @@ -9825,39 +10139,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, 249, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 270, __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, 249, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 270, __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, 249, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 270, __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, 249, __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, 270, __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, 249, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_equality_constraint", 1, 2, 2, i); __PYX_ERR(0, 270, __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, 249, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 270, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 249, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 270, __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, 249, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("to_equality_constraint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 270, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9868,8 +10182,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, 250, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 250, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restriction), (&PyUnicode_Type), 0, "restriction", 2))) __PYX_ERR(0, 271, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 271, __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 */ @@ -9888,9 +10202,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -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 */ +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 */ -/* "constraint/parser.py":268 +/* "constraint/parser.py":289 * 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): # <<<<<<<<<<<<<< @@ -9899,29 +10213,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_13_genexpr *__pyx_cur_scope; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_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_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); 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_12_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 268, __pyx_L1_error) + __PYX_ERR(0, 289, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint *) __pyx_self; + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_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_2generator10, ((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_to_equ, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 268, __pyx_L1_error) + __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, 289, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -9937,9 +10251,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_2generator10(__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_2generator9(__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_12_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -9960,21 +10274,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, 268, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 268, __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, 268, __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_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __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); @@ -9987,11 +10301,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit 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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __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, 268, __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, 268, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 289, __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, 289, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { @@ -10032,7 +10346,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit return __pyx_r; } -/* "constraint/parser.py":249 +/* "constraint/parser.py":270 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< @@ -10041,12 +10355,12 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit */ 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_12_to_equality_constraint *__pyx_cur_scope; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_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_2generator10 = 0; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator9 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -10063,11 +10377,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality 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_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); + __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); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 249, __pyx_L1_error) + __PYX_ERR(0, 270, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10078,7 +10392,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":254 + /* "constraint/parser.py":275 * """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): # <<<<<<<<<<<<<< @@ -10087,21 +10401,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, 254, __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, 275, __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, 254, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 275, __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, 254, __pyx_L1_error) + __PYX_ERR(0, 275, __pyx_L1_error) } - __pyx_t_3 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_3 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 275, __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":255 + /* "constraint/parser.py":276 * # check if all parameters are involved * if len(params) != len(tune_params): * return None # <<<<<<<<<<<<<< @@ -10112,7 +10426,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":254 + /* "constraint/parser.py":275 * """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): # <<<<<<<<<<<<<< @@ -10121,7 +10435,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":258 + /* "constraint/parser.py":279 * * # find whether (in)equalities appear in this restriction * equalities_found = re.findall("==", restriction) # <<<<<<<<<<<<<< @@ -10129,9 +10443,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, 258, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __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, 258, __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, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = 1; @@ -10151,13 +10465,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 258, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_equalities_found = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":259 + /* "constraint/parser.py":280 * # find whether (in)equalities appear in this restriction * equalities_found = re.findall("==", restriction) * inequalities_found = re.findall("!=", restriction) # <<<<<<<<<<<<<< @@ -10165,9 +10479,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, 259, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __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, 259, __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, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = 1; @@ -10187,37 +10501,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 259, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_inequalities_found = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":261 + /* "constraint/parser.py":282 * 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, 261, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 282, __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, 261, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_4))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __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, 261, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_inequalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 282, __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, 261, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBool_FromLong((!(!__pyx_t_4))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 282, __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, 261, __pyx_L1_error) + __pyx_t_7 = PyNumber_Xor(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 282, __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, 261, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 282, __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":262 + /* "constraint/parser.py":283 * # 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 # <<<<<<<<<<<<<< @@ -10228,7 +10542,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":261 + /* "constraint/parser.py":282 * 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)): # <<<<<<<<<<<<<< @@ -10237,22 +10551,22 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":263 + /* "constraint/parser.py":284 * 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, 263, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 284, __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); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 263, __pyx_L1_error) + __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, 284, __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); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 263, __pyx_L1_error) + __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, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __pyx_t_6; __pyx_t_6 = 0; @@ -10260,29 +10574,29 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __pyx_v_comparator = __pyx_t_7; __pyx_t_7 = 0; - /* "constraint/parser.py":266 + /* "constraint/parser.py":287 * * # 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, 266, __pyx_L1_error) + __pyx_t_7 = PyUnicode_Split(__pyx_v_restriction, __Pyx_NoneAsNull(__pyx_v_comparator), -1L); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_splitted = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/parser.py":268 + /* "constraint/parser.py":289 * 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, 268, __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, 289, __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, 268, __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, 289, __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) { @@ -10290,28 +10604,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, 268, __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, 289, __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, 268, __pyx_L1_error) + __pyx_t_6 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 289, __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, 268, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 289, __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":270 + /* "constraint/parser.py":291 * 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, 270, __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, 291, __pyx_L1_error) if (__pyx_t_9) { - /* "constraint/parser.py":271 + /* "constraint/parser.py":292 * # map to a Constraint * if comparator == "==": * return AllEqualConstraint() # <<<<<<<<<<<<<< @@ -10320,7 +10634,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, 271, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS @@ -10339,14 +10653,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 271, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/parser.py":270 + /* "constraint/parser.py":291 * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): * # map to a Constraint * if comparator == "==": # <<<<<<<<<<<<<< @@ -10355,17 +10669,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":272 + /* "constraint/parser.py":293 * 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, 272, __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, 293, __pyx_L1_error) if (__pyx_t_9) { - /* "constraint/parser.py":273 + /* "constraint/parser.py":294 * return AllEqualConstraint() * elif comparator == "!=": * return AllDifferentConstraint() # <<<<<<<<<<<<<< @@ -10374,7 +10688,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, 273, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS @@ -10393,14 +10707,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 273, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/parser.py":272 + /* "constraint/parser.py":293 * if comparator == "==": * return AllEqualConstraint() * elif comparator == "!=": # <<<<<<<<<<<<<< @@ -10409,7 +10723,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":274 + /* "constraint/parser.py":295 * elif comparator == "!=": * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") # <<<<<<<<<<<<<< @@ -10420,9 +10734,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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, 274, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 295, __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, 274, __pyx_L1_error) + __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, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = 1; @@ -10432,14 +10746,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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, 274, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/parser.py":268 + /* "constraint/parser.py":289 * 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): # <<<<<<<<<<<<<< @@ -10448,7 +10762,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":275 + /* "constraint/parser.py":296 * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") * return None # <<<<<<<<<<<<<< @@ -10459,7 +10773,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":249 + /* "constraint/parser.py":270 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< @@ -10481,15 +10795,15 @@ 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_2generator10); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator9); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":278 +/* "constraint/parser.py":299 * * # remove functionally duplicate restrictions (preserves order and whitespace) * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< @@ -10498,18 +10812,18 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator1 */ 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_14_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_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); + __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_14_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, 278, __pyx_L1_error) + __PYX_ERR(0, 299, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10517,7 +10831,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_12generator11, ((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_parse_restrictions_locals_genexp, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 278, __pyx_L1_error) + __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, 299, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -10533,9 +10847,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(CY return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - 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); + 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; @@ -10554,21 +10868,21 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator1 return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 278, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 278, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 299, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 299, __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, 278, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 299, __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, 278, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __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); @@ -10613,7 +10927,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator1 return __pyx_r; } -/* "constraint/parser.py":28 +/* "constraint/parser.py":30 * ) * * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< @@ -10636,10 +10950,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_12generator11 = 0; - PyObject *__pyx_9genexpr14__pyx_v_r = NULL; - PyObject *__pyx_9genexpr15__pyx_v_r = NULL; - PyObject *__pyx_9genexpr16__pyx_v_i = 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_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -10663,7 +10977,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, 28, __pyx_L1_error) + __PYX_ERR(0, 30, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10672,114 +10986,125 @@ 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":31 + /* "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 * # 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]*)" * - * def replace_params(match_object): */ __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_a_zA_Z__a_zA_Z__0_9); __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":33 + /* "constraint/parser.py":34 + * # 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]*)" # <<<<<<<<<<<<<< + * + * def replace_params(match_object): +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_a_zA_Z__0_9); + __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 + * 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[13])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __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, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_replace_params = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":41 + /* "constraint/parser.py":44 * 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[14])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __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, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_replace_params_split = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":51 + /* "constraint/parser.py":54 * 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, 51, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __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, 51, __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, 51, __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[15])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __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, 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) __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":76 + /* "constraint/parser.py":79 * return split_restrictions * * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint]]: # noqa: E501 + * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, VariableMinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint, VariableMaxProdConstraint]]: # noqa: E501 */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __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, 76, __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, 76, __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, 76, __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[16])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __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, 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) __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":249 + /* "constraint/parser.py":270 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __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, 249, __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, 249, __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, 249, __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[17])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __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, 270, __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, 270, __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, 270, __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, 270, __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":278 + /* "constraint/parser.py":299 * * # 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] */ - __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(NULL, __pyx_v_restrictions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __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, 299, __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, 278, __pyx_L1_error) + __pyx_t_1 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __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, 278, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "constraint/parser.py":280 + /* "constraint/parser.py":301 * if all(isinstance(r, str) for r in restrictions): * # clean the restriction strings to functional equivalence * restrictions_cleaned = [r.replace(' ', '') for r in restrictions] # <<<<<<<<<<<<<< @@ -10787,7 +11112,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * # 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, 280, __pyx_L6_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_v_restrictions; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; @@ -10795,36 +11120,36 @@ 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, 280, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 301, __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_4; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L6_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_r, __pyx_t_5); + __Pyx_XDECREF_SET(__pyx_9genexpr16__pyx_v_r, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr14__pyx_v_r, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L6_error) + __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, 301, __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, 280, __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, 301, __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, 280, __pyx_L6_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 301, __pyx_L6_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_r); __pyx_9genexpr14__pyx_v_r = 0; + __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_r); __pyx_9genexpr16__pyx_v_r = 0; goto __pyx_L10_exit_scope; __pyx_L6_error:; - __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_r); __pyx_9genexpr14__pyx_v_r = 0; + __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_r); __pyx_9genexpr16__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":281 + /* "constraint/parser.py":302 * # 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 # <<<<<<<<<<<<<< @@ -10838,16 +11163,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED 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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __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, 281, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __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":283 + /* "constraint/parser.py":304 * 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] # <<<<<<<<<<<<<< @@ -10855,7 +11180,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * */ { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L13_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __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; @@ -10863,33 +11188,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, 283, __pyx_L13_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 304, __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_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 283, __pyx_L13_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_r, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr17__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_9genexpr15__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 283, __pyx_L13_error) + __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, 304, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 283, __pyx_L13_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 304, __pyx_L13_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_r); __pyx_9genexpr15__pyx_v_r = 0; + __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_r); __pyx_9genexpr17__pyx_v_r = 0; goto __pyx_L17_exit_scope; __pyx_L13_error:; - __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_r); __pyx_9genexpr15__pyx_v_r = 0; + __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_r); __pyx_9genexpr17__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":284 + /* "constraint/parser.py":305 * # 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] # <<<<<<<<<<<<<< @@ -10897,7 +11222,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, 284, __pyx_L20_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __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; @@ -10905,33 +11230,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, 284, __pyx_L20_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 305, __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_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L20_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 305, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr16__pyx_v_i, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr18__pyx_v_i, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_restrictions, __pyx_9genexpr16__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L20_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_restrictions, __pyx_9genexpr18__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 305, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 284, __pyx_L20_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 305, __pyx_L20_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_i); __pyx_9genexpr16__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_i); __pyx_9genexpr18__pyx_v_i = 0; goto __pyx_L24_exit_scope; __pyx_L20_error:; - __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_i); __pyx_9genexpr16__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_i); __pyx_9genexpr18__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":278 + /* "constraint/parser.py":299 * * # remove functionally duplicate restrictions (preserves order and whitespace) * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< @@ -10940,32 +11265,32 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":287 + /* "constraint/parser.py":308 * * # 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, 287, __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, 308, __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, 287, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_restrictions, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "constraint/parser.py":289 + /* "constraint/parser.py":310 * 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, 289, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_parsed_restrictions = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":290 + /* "constraint/parser.py":311 * # split into functions that only take their relevant parameters * parsed_restrictions = list() * for res in restrictions: # <<<<<<<<<<<<<< @@ -10974,7 +11299,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, 290, __pyx_L1_error) + __PYX_ERR(0, 311, __pyx_L1_error) } __pyx_t_2 = __pyx_v_restrictions; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; @@ -10982,32 +11307,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, 290, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 311, __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_4; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":291 + /* "constraint/parser.py":312 * 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, 291, __pyx_L1_error) + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __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":292 + /* "constraint/parser.py":313 * for res in restrictions: * params_used: set[str] = set() * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() # <<<<<<<<<<<<<< @@ -11015,9 +11340,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, 292, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 313, __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, 292, __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, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_7 = 1; @@ -11037,7 +11362,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __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_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, 292, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __pyx_t_5; @@ -11048,25 +11373,25 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __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_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, 292, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __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":293 + /* "constraint/parser.py":314 * 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, 293, __pyx_L1_error) + __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_v_params_used); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __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":294 + /* "constraint/parser.py":315 * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() * params_used_list = list(params_used) * finalized_constraint = None # <<<<<<<<<<<<<< @@ -11076,25 +11401,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":295 + /* "constraint/parser.py":316 * 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, 295, __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, 316, __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, 295, __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, 316, __pyx_L1_error) __pyx_t_3 = __pyx_t_11; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - /* "constraint/parser.py":297 + /* "constraint/parser.py":318 * if " or " not in res and " and " not in res: * # if applicable, strip the outermost round brackets * while ( # <<<<<<<<<<<<<< @@ -11103,16 +11428,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ while (1) { - /* "constraint/parser.py":298 + /* "constraint/parser.py":319 * # 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); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error) + __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, 319, __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, 298, __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, 319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { } else { @@ -11120,16 +11445,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":299 + /* "constraint/parser.py":320 * 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); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error) + __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, 320, __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, 299, __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, 320, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { } else { @@ -11137,16 +11462,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":300 + /* "constraint/parser.py":321 * 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, 300, __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, 321, __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, 300, __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, 321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { } else { @@ -11154,48 +11479,48 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":301 + /* "constraint/parser.py":322 * 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, 301, __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, 322, __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, 301, __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, 322, __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":303 + /* "constraint/parser.py":324 * 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, 303, __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, 324, __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":305 + /* "constraint/parser.py":326 * 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, 305, __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, 305, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_parsed_restriction))||((__pyx_v_parsed_restriction) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_parsed_restriction))) __PYX_ERR(0, 326, __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, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":306 + /* "constraint/parser.py":327 * # 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: # <<<<<<<<<<<<<< @@ -11205,20 +11530,20 @@ 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":308 + /* "constraint/parser.py":329 * 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, 308, __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, 308, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_parsed_restriction))||((__pyx_v_parsed_restriction) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_parsed_restriction))) __PYX_ERR(0, 329, __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, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":306 + /* "constraint/parser.py":327 * # 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: # <<<<<<<<<<<<<< @@ -11227,7 +11552,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":295 + /* "constraint/parser.py":316 * params_used_list = list(params_used) * finalized_constraint = None * if " or " not in res and " and " not in res: # <<<<<<<<<<<<<< @@ -11236,7 +11561,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":309 + /* "constraint/parser.py":330 * # 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: # <<<<<<<<<<<<<< @@ -11246,16 +11571,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":311 + /* "constraint/parser.py":332 * 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, 311, __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, 332, __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, 311, __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, 332, __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; @@ -11263,14 +11588,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, 311, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __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":309 + /* "constraint/parser.py":330 * # 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: # <<<<<<<<<<<<<< @@ -11279,25 +11604,25 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":312 + /* "constraint/parser.py":333 * # 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, 312, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __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, 312, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_finalized_constraint) != (0)) __PYX_ERR(0, 333, __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, 312, __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, 312, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_params_used_list) != (0)) __PYX_ERR(0, 333, __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, 333, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/parser.py":290 + /* "constraint/parser.py":311 * # split into functions that only take their relevant parameters * parsed_restrictions = list() * for res in restrictions: # <<<<<<<<<<<<<< @@ -11307,7 +11632,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":314 + /* "constraint/parser.py":335 * parsed_restrictions.append((finalized_constraint, params_used_list)) * * return parsed_restrictions # <<<<<<<<<<<<<< @@ -11319,7 +11644,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __pyx_r = __pyx_v_parsed_restrictions; goto __pyx_L0; - /* "constraint/parser.py":28 + /* "constraint/parser.py":30 * ) * * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< @@ -11352,10 +11677,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_12generator11); - __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_r); - __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_r); - __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_i); + __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_v_restrictions); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); @@ -11363,7 +11688,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED return __pyx_r; } -/* "constraint/parser.py":316 +/* "constraint/parser.py":337 * return parsed_restrictions * * def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 # <<<<<<<<<<<<<< @@ -11413,41 +11738,41 @@ 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, 316, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 337, __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, 316, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 337, __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, 316, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 337, __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, 316, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 337, __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, 316, __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, 337, __pyx_L3_error) 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, 316, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("compile_to_constraints", 0, 2, 3, i); __PYX_ERR(0, 337, __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, 316, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 337, __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, 316, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 337, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 316, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 337, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -11459,7 +11784,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, 316, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compile_to_constraints", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 337, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11470,8 +11795,8 @@ 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, 316, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 316, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 337, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 337, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_2compile_to_constraints(__pyx_self, __pyx_v_constraints, __pyx_v_domains, __pyx_v_picklable); /* function exit code */ @@ -11520,7 +11845,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compile_to_constraints", 0); - /* "constraint/parser.py":327 + /* "constraint/parser.py":348 * 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 * parsed_restrictions = parse_restrictions(constraints, domains) # <<<<<<<<<<<<<< @@ -11528,7 +11853,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * 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, 327, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_parse_restrictions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -11547,25 +11872,25 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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_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, 327, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_parsed_restrictions = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":328 + /* "constraint/parser.py":349 * """ # noqa: E501 * parsed_restrictions = parse_restrictions(constraints, domains) * compiled_constraints: list[tuple[Constraint, list[str], Union[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, 328, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_compiled_constraints = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":329 + /* "constraint/parser.py":350 * parsed_restrictions = parse_restrictions(constraints, domains) * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: # <<<<<<<<<<<<<< @@ -11577,9 +11902,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, 329, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parsed_restrictions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __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, 329, __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, 350, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { @@ -11587,7 +11912,7 @@ 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, 329, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 350, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -11597,7 +11922,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN { 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, 329, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 350, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -11608,13 +11933,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __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, 329, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 350, __pyx_L1_error) PyErr_Clear(); } break; @@ -11627,7 +11952,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, 329, __pyx_L1_error) + __PYX_ERR(0, 350, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -11637,22 +11962,22 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __Pyx_INCREF(__pyx_t_7); } else { __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 329, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 350, __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, 329, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 350, __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, 329, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 350, __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); @@ -11660,7 +11985,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, 329, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 350, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -11668,7 +11993,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, 329, __pyx_L1_error) + __PYX_ERR(0, 350, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_restriction, __pyx_t_2); @@ -11676,7 +12001,7 @@ 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":330 + /* "constraint/parser.py":351 * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: * if isinstance(restriction, str): # <<<<<<<<<<<<<< @@ -11686,17 +12011,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":332 + /* "constraint/parser.py":353 * 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, 332, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_picklable); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 353, __pyx_L1_error) if (__pyx_t_10) { - /* "constraint/parser.py":333 + /* "constraint/parser.py":354 * # if it's a string, wrap it in a (compilable or compiled) function constraint * if picklable: * constraint = CompilableFunctionConstraint(restriction) # <<<<<<<<<<<<<< @@ -11704,7 +12029,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, 333, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -11723,13 +12048,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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_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, 333, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":332 + /* "constraint/parser.py":353 * if isinstance(restriction, str): * # if it's a string, wrap it in a (compilable or compiled) function constraint * if picklable: # <<<<<<<<<<<<<< @@ -11739,7 +12064,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L8; } - /* "constraint/parser.py":335 + /* "constraint/parser.py":356 * constraint = CompilableFunctionConstraint(restriction) * else: * code_object = compile(restriction, "", "exec") # <<<<<<<<<<<<<< @@ -11756,13 +12081,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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_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, 335, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __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":336 + /* "constraint/parser.py":357 * else: * code_object = compile(restriction, "", "exec") * func = FunctionType(code_object.co_consts[0], globals()) # <<<<<<<<<<<<<< @@ -11770,14 +12095,14 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * 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, 336, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __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, 336, __pyx_L1_error) + __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, 357, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 336, __pyx_L1_error) + __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, 357, __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, 336, __pyx_L1_error) + __pyx_t_8 = __Pyx_Globals(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -11798,13 +12123,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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, 336, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":337 + /* "constraint/parser.py":358 * code_object = compile(restriction, "", "exec") * func = FunctionType(code_object.co_consts[0], globals()) * constraint = FunctionConstraint(func) # <<<<<<<<<<<<<< @@ -11812,7 +12137,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * 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, 337, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -11831,7 +12156,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_3); @@ -11839,28 +12164,28 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN } __pyx_L8:; - /* "constraint/parser.py":338 + /* "constraint/parser.py":359 * 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, 338, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __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, 338, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 359, __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, 338, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_params_used) != (0)) __PYX_ERR(0, 359, __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, 338, __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, 338, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_restriction) != (0)) __PYX_ERR(0, 359, __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, 359, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":330 + /* "constraint/parser.py":351 * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: * if isinstance(restriction, str): # <<<<<<<<<<<<<< @@ -11870,41 +12195,41 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L7; } - /* "constraint/parser.py":339 + /* "constraint/parser.py":360 * 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, 339, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __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, 339, __pyx_L1_error) + __pyx_t_10 = PyObject_IsInstance(__pyx_v_restriction, __pyx_t_3); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(__pyx_t_10)) { - /* "constraint/parser.py":341 + /* "constraint/parser.py":362 * 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, 341, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __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, 341, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_restriction) != (0)) __PYX_ERR(0, 362, __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, 341, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_params_used) != (0)) __PYX_ERR(0, 362, __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, 341, __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, 341, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None) != (0)) __PYX_ERR(0, 362, __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, 362, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":339 + /* "constraint/parser.py":360 * constraint = FunctionConstraint(func) * compiled_constraints.append((constraint, params_used, restriction)) * elif isinstance(restriction, Constraint): # <<<<<<<<<<<<<< @@ -11914,7 +12239,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L7; } - /* "constraint/parser.py":343 + /* "constraint/parser.py":364 * compiled_constraints.append((restriction, params_used, None)) * else: * raise ValueError(f"Restriction {restriction} is neither a string or Constraint {type(restriction)}") # <<<<<<<<<<<<<< @@ -11925,16 +12250,16 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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, 343, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_restriction, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 364, __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, 343, __pyx_L1_error) + __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, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_Restriction; __pyx_t_13[1] = __pyx_t_11; __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, 343, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -11945,16 +12270,16 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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, 343, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __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, 343, __pyx_L1_error) + __PYX_ERR(0, 364, __pyx_L1_error) } __pyx_L7:; - /* "constraint/parser.py":329 + /* "constraint/parser.py":350 * parsed_restrictions = parse_restrictions(constraints, domains) * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: # <<<<<<<<<<<<<< @@ -11964,7 +12289,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":346 + /* "constraint/parser.py":367 * * # return the restrictions and used parameters * return compiled_constraints # <<<<<<<<<<<<<< @@ -11974,7 +12299,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __pyx_r = __pyx_v_compiled_constraints; goto __pyx_L0; - /* "constraint/parser.py":316 + /* "constraint/parser.py":337 * return parsed_restrictions * * def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 # <<<<<<<<<<<<<< @@ -12041,6 +12366,7 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct__parse_rest 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)))) { @@ -12214,11 +12540,8 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_1_to_numeri #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_left); Py_CLEAR(p->__pyx_v_operator); Py_CLEAR(p->__pyx_v_params); - Py_CLEAR(p->__pyx_v_right); - Py_CLEAR(p->__pyx_v_supported_operators); 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)))) { @@ -12247,21 +12570,12 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_1_to_numeri if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } - if (p->__pyx_v_left) { - e = (*v)(p->__pyx_v_left, a); if (e) return e; - } if (p->__pyx_v_operator) { e = (*v)(p->__pyx_v_operator, a); if (e) return e; } if (p->__pyx_v_params) { e = (*v)(p->__pyx_v_params, a); if (e) return e; } - if (p->__pyx_v_right) { - e = (*v)(p->__pyx_v_right, a); if (e) return e; - } - if (p->__pyx_v_supported_operators) { - e = (*v)(p->__pyx_v_supported_operators, a); if (e) return e; - } if (p->__pyx_v_variable_supported_operators) { e = (*v)(p->__pyx_v_variable_supported_operators, a); if (e) return e; } @@ -12274,21 +12588,12 @@ static int __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_1_to_numeric_c 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); - tmp = ((PyObject*)p->__pyx_v_left); - p->__pyx_v_left = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_operator); p->__pyx_v_operator = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_params); p->__pyx_v_params = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_right); - p->__pyx_v_right = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_supported_operators); - p->__pyx_v_supported_operators = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_variable_supported_operators); p->__pyx_v_variable_supported_operators = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); @@ -12914,9 +13219,10 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr(P } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_genexpr_arg_0); + Py_CLEAR(p->__pyx_genexpr_arg_1); 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)))) { __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); @@ -12941,15 +13247,15 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_genexpr(P 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_genexpr_arg_1) { + e = (*v)(p->__pyx_genexpr_arg_1, a); if (e) return e; } if (p->__pyx_v_s) { e = (*v)(p->__pyx_v_s, 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 @@ -13242,10 +13548,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_7_genexpr(P } #endif PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_genexpr_arg_1); 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_7_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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); @@ -13270,15 +13575,15 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_7_genexpr(P e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } - if (p->__pyx_genexpr_arg_1) { - e = (*v)(p->__pyx_genexpr_arg_1, 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; } - if (p->__pyx_t_0) { - e = (*v)(p->__pyx_t_0, a); if (e) return e; - } return 0; } #if CYTHON_USE_TYPE_SPECS @@ -13573,7 +13878,7 @@ 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_s); + Py_CLEAR(p->__pyx_v_o); #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)))) { __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); @@ -13604,8 +13909,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_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; } @@ -13630,171 +13935,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr "constraint.parser.""__pyx_scope_struct_9_genexpr", /*tp_name*/ 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*/ - 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_9_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_9_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 PY_VERSION_HEX >= 0x030800b1 && (!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_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)))) { - 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr)); - (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; -} - -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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_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_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)))) { - __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 - { - #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); - } - #endif - } -} - -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_10_genexpr(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_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_o) { - e = (*v)(p->__pyx_v_o, a); if (e) return e; - } - return 0; -} -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_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), - 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, -}; -#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*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_9_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -13816,7 +13957,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexp 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_10_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_9_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -13834,7 +13975,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_9_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -13867,16 +14008,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexp }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_11_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_11_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr)); + 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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -13889,11 +14030,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_11_genexpr 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -13903,8 +14044,8 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_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_11_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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); + 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)))) { + __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 { @@ -13919,9 +14060,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_genexpr( } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_11_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_10_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; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -13938,27 +14079,27 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_11_genexpr( 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}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_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_11_genexpr_spec = { - "constraint.parser.__pyx_scope_struct_11_genexpr", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_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|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_11_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr), /*tp_basicsize*/ + "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_11_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -13980,7 +14121,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexp 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_11_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_10_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -13998,7 +14139,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexp #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_11_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_10_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -14031,16 +14172,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexp }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_11_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_12_to_equality_constraint > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -14053,11 +14194,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_12_to_equa return 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; +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; #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_to_equality_constraint) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -14066,8 +14207,8 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_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_12_to_equality_constraint < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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); + 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); } else #endif { @@ -14082,9 +14223,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_to_equal } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint(PyObject *o, visitproc v, void *a) { int e; - 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; + 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; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -14098,9 +14239,9 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_12_to_equal return 0; } -static int __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint(PyObject *o) { +static int __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint(PyObject *o) { PyObject* tmp; - 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; + 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; 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); @@ -14110,28 +14251,28 @@ static int __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_12_to_equality return 0; } #if CYTHON_USE_TYPE_SPECS -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}, +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}, {0, 0}, }; -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), +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), 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_to_equality_constraint_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint = { PyVarObject_HEAD_INIT(0, 0) - "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*/ + "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*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -14153,8 +14294,8 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equ 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*/ 0, /*tp_doc*/ - __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*/ + __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*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -14171,7 +14312,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -14204,16 +14345,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equ }; #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_12_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -14226,11 +14367,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_13_genexpr 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_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; #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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -14240,8 +14381,8 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_13_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_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 (((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); } else #endif { @@ -14256,9 +14397,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_13_genexpr( } } -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_12_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_12_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -14275,27 +14416,27 @@ 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_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}, {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_12_genexpr_spec = { + "constraint.parser.__pyx_scope_struct_12_genexpr", + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_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, + __pyx_type_10constraint_6parser___pyx_scope_struct_12_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_12_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_12_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_13_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -14317,7 +14458,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexp 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_13_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_12_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -14335,7 +14476,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_12_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -14368,16 +14509,16 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexp }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_14_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_14_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -14390,11 +14531,11 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_14_genexpr return 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; +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_14_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_13_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -14403,8 +14544,8 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_14_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_14_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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); + 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); } else #endif { @@ -14419,9 +14560,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_14_genexpr( } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_14_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_14_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_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; @@ -14435,27 +14576,27 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_14_genexpr( return 0; } #if CYTHON_USE_TYPE_SPECS -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}, +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_14_genexpr_spec = { - "constraint.parser.__pyx_scope_struct_14_genexpr", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_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_14_genexpr_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_14_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_14_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_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_14_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_13_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -14477,7 +14618,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_14_genexp 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_14_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_13_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -14495,7 +14636,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_14_genexp #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_14_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*/ @@ -14582,15 +14723,15 @@ 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, 28, __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, 28, __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, 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) #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, 28, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions) < 0) __PYX_ERR(0, 30, __pyx_L1_error) #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)) { @@ -14598,15 +14739,15 @@ 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, 76, __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, 76, __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, 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) #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, 76, __pyx_L1_error) + 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) #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)) { @@ -14614,15 +14755,15 @@ 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, 81, __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, 81, __pyx_L1_error) + __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) #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, 81, __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_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)) { @@ -14630,15 +14771,15 @@ 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, 81, __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, 81, __pyx_L1_error) + __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) #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, 81, __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_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)) { @@ -14646,15 +14787,15 @@ 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, 92, __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, 92, __pyx_L1_error) + __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) #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, 92, __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_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)) { @@ -14662,15 +14803,15 @@ 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, 96, __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, 96, __pyx_L1_error) + __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) #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, 96, __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_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)) { @@ -14678,15 +14819,15 @@ 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, 97, __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, 97, __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, 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) #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, 97, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 168, __pyx_L1_error) #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)) { @@ -14694,15 +14835,15 @@ 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, 135, __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, 135, __pyx_L1_error) + __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) #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, 135, __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_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)) { @@ -14710,15 +14851,15 @@ 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, 156, __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, 156, __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, 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) #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, 156, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(0, 172, __pyx_L1_error) #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)) { @@ -14726,15 +14867,15 @@ 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, 158, __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, 158, __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, 240, __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, 240, __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, 158, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr) < 0) __PYX_ERR(0, 240, __pyx_L1_error) #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)) { @@ -14742,15 +14883,15 @@ 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, 219, __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, 219, __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, 247, __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, 247, __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, 219, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr) < 0) __PYX_ERR(0, 247, __pyx_L1_error) #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)) { @@ -14758,69 +14899,53 @@ 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_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, 226, __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, 226, __pyx_L1_error) + __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, 270, __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, 270, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint = &__pyx_type_10constraint_6parser___pyx_scope_struct_11_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_11_genexpr) < 0) __PYX_ERR(0, 226, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint) < 0) __PYX_ERR(0, 270, __pyx_L1_error) #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_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; + 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; } #endif #if CYTHON_USE_TYPE_SPECS - __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, 249, __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, 249, __pyx_L1_error) + __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, 289, __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, 289, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint = &__pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_12_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_12_to_equality_constraint) < 0) __PYX_ERR(0, 249, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(0, 289, __pyx_L1_error) #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_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; + 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; } #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, 268, __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, 268, __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, 299, __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, 299, __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, 268, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr) < 0) __PYX_ERR(0, 299, __pyx_L1_error) #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, 278, __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, 278, __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, 278, __pyx_L1_error) - #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:; @@ -15091,6 +15216,13 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); __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) + /*--- Initialize various global constants etc. ---*/ + 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 @@ -15107,10 +15239,6 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ - /*--- Initialize various global constants etc. ---*/ - 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 (__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) } @@ -15193,7 +15321,7 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); * AllEqualConstraint, * Constraint, */ - __pyx_t_2 = __Pyx_PyList_Pack(15, __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); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __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 @@ -15266,45 +15394,53 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); __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) __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) + __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) + __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) + __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) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":28 + /* "constraint/parser.py":30 * ) * * 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 */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) + __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, 28, __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, 28, __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, 28, __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[18])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) + 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_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, 28, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":316 + /* "constraint/parser.py":337 * return parsed_restrictions * * 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, 316, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __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, 316, __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, 316, __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, 316, __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[19])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error) + 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, 337, __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, 337, __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, 337, __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, 337, __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); __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, 316, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_compile_to_constraints, __pyx_t_3) < 0) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/parser.py":1 @@ -15353,11 +15489,11 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); typedef struct { const char *s; -#if 239 <= 65535 +#if 293 <= 65535 const unsigned short n; -#elif 239 / 2 < INT_MAX +#elif 293 / 2 < INT_MAX const unsigned int n; -#elif 239 / 2 < LONG_MAX +#elif 293 / 2 < LONG_MAX const unsigned long n; #else const Py_ssize_t n; @@ -15403,7 +15539,9 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -15428,6 +15566,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -15496,6 +15635,8 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -15524,6 +15665,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -15542,6 +15684,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -15552,7 +15695,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_variable, sizeof(__pyx_k_swapped_side_first_variable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_swapped_side_first_variable */ + {__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 */ @@ -15568,7 +15711,10 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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} @@ -15580,11 +15726,11 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, c 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, 67, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 215, __pyx_L1_error) - __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_eval); if (!__pyx_builtin_eval) __PYX_ERR(0, 141, __pyx_L1_error) - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 142, __pyx_L1_error) - __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_compile); if (!__pyx_builtin_compile) __PYX_ERR(0, 335, __pyx_L1_error) + __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, 236, __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, 356, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -15596,83 +15742,83 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "constraint/parser.py":115 + /* "constraint/parser.py":120 * # e.g. "G == B-M" becomes "G+M == B" - * right_remainder = right[len(swapped_side_first_variable):] + * right_remainder = right[len(swapped_side_first_component):] * left_swap = right_remainder.replace("-", "+") # <<<<<<<<<<<<<< - * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" + * 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, 115, __pyx_L1_error) + __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_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); - /* "constraint/parser.py":126 + /* "constraint/parser.py":131 * # e.g. "G == B/M" becomes "G*M == B" - * right_remainder = right[len(swapped_side_first_variable):] + * right_remainder = right[len(swapped_side_first_component):] * left_swap = right_remainder.replace("/", "*") # <<<<<<<<<<<<<< - * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_variable}" + * 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, 126, __pyx_L1_error) + __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_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); - /* "constraint/parser.py":162 - * if len(unique_operators) == 0 or next(iter(unique_operators)) == "+": + /* "constraint/parser.py":176 + * 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) */ - __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, 162, __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, 176, __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, 162, __pyx_L1_error) + __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) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[1]); - /* "constraint/parser.py":280 + /* "constraint/parser.py":301 * 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 * # 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, 280, __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, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); - /* "constraint/parser.py":301 + /* "constraint/parser.py":322 * 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, 301, __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, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[2]); - /* "constraint/parser.py":303 + /* "constraint/parser.py":324 * 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, 303, __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, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[3]); - /* "constraint/parser.py":316 + /* "constraint/parser.py":337 * return parsed_restrictions * * 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_mstate_global->__pyx_tuple[3] = PyTuple_Pack(1, ((PyObject*)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 316, __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, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_RefNannyFinishContext(); @@ -15708,7 +15854,7 @@ static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { unsigned int nlocals : 6; unsigned int flags : 10; unsigned int first_line : 9; - unsigned int line_table_length : 15; + unsigned int line_table_length : 16; } __Pyx_PyCode_New_function_description; /* NewCodeObj.proto */ static PyObject* __Pyx_PyCode_New( @@ -15725,104 +15871,99 @@ 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), 81, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 84, 2}; 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 81, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 84, 2}; 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 92, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 95, 2}; 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 96, 2}; - 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_1_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, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 97, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 140, 2}; 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_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) 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_k_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), 135, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 168, 2}; 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_q, 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_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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 156, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 169, 2}; 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__25, 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_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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 158, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 172, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; - __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_A_2, 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_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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 219, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 240, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_o}; - __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_Q_2, 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_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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 226, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 247, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; - __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_k__26, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) 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_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), 138, 45}; + 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[10] = __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[10])) 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_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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 268, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 289, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; - __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__26, 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_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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 278, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 299, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_r}; - __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_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_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; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 33, 50}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 36, 50}; 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, __pyx_k_A_l_4s_Cq_2V2Q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) 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_k_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), 41, 50}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 44, 50}; 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[14] = __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[14])) 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_k_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), 51, 251}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 54, 251}; 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[15] = __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[15])) 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_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; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 40, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 76, 1692}; - 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_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_variable, __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_number, __pyx_mstate->__pyx_n_u_number_is_int, __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_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_global->__pyx_codeobj_tab[16] = __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[16])) goto bad; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 47, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 79, 2064}; + 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_number_is_int, __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, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 249, 222}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 270, 222}; 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[17] = __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[17])) 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_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; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 27, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 28, 386}; - 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_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[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_parse_restrictions, __pyx_k_Ya_1_Q2_U_V_U_6_Q_q_t4uA_d_4y_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 28, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 30, 391}; + 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_z_U_6_Q_q_t4uA_d_4y, 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), 316, 177}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 337, 177}; 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[19] = __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[19])) 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_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; } Py_DECREF(tuple_dedup_map); return 0; @@ -18305,24 +18446,83 @@ static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, #endif } +/* LimitedApiGetTypeDict */ +#if CYTHON_COMPILING_IN_LIMITED_API +static Py_ssize_t __Pyx_GetTypeDictOffset(void) { + PyObject *tp_dictoffset_o; + Py_ssize_t tp_dictoffset; + tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__"); + if (unlikely(!tp_dictoffset_o)) return -1; + tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o); + Py_DECREF(tp_dictoffset_o); + if (unlikely(tp_dictoffset == 0)) { + PyErr_SetString( + PyExc_TypeError, + "'type' doesn't have a dictoffset"); + return -1; + } else if (unlikely(tp_dictoffset < 0)) { + PyErr_SetString( + PyExc_TypeError, + "'type' has an unexpected negative dictoffset. " + "Please report this as Cython bug"); + return -1; + } + return tp_dictoffset; +} +static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) { + static Py_ssize_t tp_dictoffset = 0; + if (unlikely(tp_dictoffset == 0)) { + tp_dictoffset = __Pyx_GetTypeDictOffset(); + if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) { + tp_dictoffset = 0; // try again next time? + return NULL; + } + } + return *(PyObject**)((char*)tp + tp_dictoffset); +} +#endif + +/* SetItemOnTypeDict */ +static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) { + int result; + PyObject *tp_dict; +#if CYTHON_COMPILING_IN_LIMITED_API + tp_dict = __Pyx_GetTypeDict(tp); + if (unlikely(!tp_dict)) return -1; +#else + tp_dict = tp->tp_dict; +#endif + result = PyDict_SetItem(tp_dict, k, v); + if (likely(!result)) { + PyType_Modified(tp); + if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) { + PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name, (PyObject *) tp, k, NULL); + if (!setNameResult) return -1; + Py_DECREF(setNameResult); + } + } + return result; +} + /* FixUpExtensionType */ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { -#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API +#if __PYX_LIMITED_VERSION_HEX > 0x030900B1 CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); + CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); #else const PyType_Slot *slot = spec->slots; + int changed = 0; +#if !CYTHON_COMPILING_IN_LIMITED_API while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { - int changed = 0; -#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) +#if !CYTHON_COMPILING_IN_CPYTHON const -#endif +#endif // !CYTHON_COMPILING_IN_CPYTHON) PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { -#if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); @@ -18346,11 +18546,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject #endif changed = 1; } -#endif -#else - if ((0)); -#endif -#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON +#endif // CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); @@ -18358,21 +18554,52 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; - if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { - Py_DECREF(descr); + int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr); + Py_DECREF(descr); + if (unlikely(set_item_result < 0)) { return -1; } - Py_DECREF(descr); changed = 1; } -#endif } memb++; } - if (changed) - PyType_Modified(type); } -#endif +#endif // !CYTHON_COMPILING_IN_LIMITED_API + slot = spec->slots; + while (slot && slot->slot && slot->slot != Py_tp_getset) + slot++; + if (slot && slot->slot == Py_tp_getset) { + PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc; + while (getset && getset->name) { + if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) { + PyObject *descr = PyDescr_NewGetSet(type, getset); + if (unlikely(!descr)) + return -1; + #if CYTHON_COMPILING_IN_LIMITED_API + PyObject *pyname = PyUnicode_FromString(getset->name); + if (unlikely(!pyname)) { + Py_DECREF(descr); + return -1; + } + int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr); + Py_DECREF(pyname); + #else + CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); + int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr); + #endif + Py_DECREF(descr); + if (unlikely(set_item_result < 0)) { + return -1; + } + changed = 1; + } + ++getset; + } + } + if (changed) + PyType_Modified(type); +#endif // PY_VERSION_HEX > 0x030900B1 return 0; } @@ -18399,6 +18626,24 @@ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *ke } /* FetchCommonType */ +#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); + if (result && metaclass) { + PyObject *old_tp = (PyObject*)Py_TYPE(result); + Py_INCREF((PyObject*)metaclass); +#if __PYX_LIMITED_VERSION_HEX >= 0x03090000 + Py_SET_TYPE(result, metaclass); +#else + result->ob_type = metaclass; +#endif + Py_DECREF(old_tp); + } + return result; +} +#else +#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b) +#endif static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t expected_basicsize) { @@ -18408,6 +18653,9 @@ static int __Pyx_VerifyCachedType(PyObject *cached_type, "Shared Cython type %.200s is not a type object", name); return -1; } + if (expected_basicsize == 0) { + return 0; // size is inherited, nothing useful to check + } #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); @@ -18427,7 +18675,7 @@ static int __Pyx_VerifyCachedType(PyObject *cached_type, } return 0; } -static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { +static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name; int get_item_ref_result; const char* object_name = strrchr(spec->name, '.'); @@ -18451,7 +18699,7 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec goto bad; } CYTHON_UNUSED_VAR(module); - cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); + cached_type = __Pyx_PyType_FromMetaclass(metaclass, 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); @@ -18480,6 +18728,42 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec goto done; } +/* CommonTypesMetaclass */ +PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) { + return PyUnicode_FromString(__PYX_ABI_MODULE_NAME); +} +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}, + {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 +}; +static int __pyx_CommonTypesMetaclass_init(PyObject *module) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); + PyObject *bases = PyTuple_Pack(1, &PyType_Type); + if (unlikely(!bases)) { + return -1; + } + mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases); + if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) { + return -1; + } + return 0; +} + /* CallTypeTraverse */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #else @@ -19596,7 +19880,8 @@ static PyType_Spec __pyx_CyFunctionType_spec = { }; static int __pyx_CyFunction_init(PyObject *module) { __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); - mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); + mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec( + mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL); if (unlikely(mstate->__pyx_CyFunctionType == NULL)) { return -1; } @@ -19649,93 +19934,6 @@ __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) return 0; } -/* IterNextPlain */ -#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)) - __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next); - return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache; -} -#endif -static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) { -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 - PyObject *result; - PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI(); - if (unlikely(!next)) return NULL; - result = PyObject_CallFunctionObjArgs(next, iterator, NULL); - return result; -#else - (void)__Pyx_GetBuiltinName; // only for early limited API - iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator); - assert(iternext); - return iternext(iterator); -#endif -} - -/* 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 - __Pyx_PyThreadState_assign - exc_type = __Pyx_PyErr_CurrentExceptionType(); - if (unlikely(exc_type)) { - if (!defval || unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) - return NULL; - __Pyx_PyErr_Clear(); - Py_INCREF(defval); - return defval; - } - if (defval) { - Py_INCREF(defval); - return defval; - } - __Pyx_PyErr_SetNone(PyExc_StopIteration); - return NULL; -} -static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) { - __Pyx_TypeName iterator_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(iterator)); - PyErr_Format(PyExc_TypeError, - __Pyx_FMT_TYPENAME " object is not an iterator", iterator_type_name); - __Pyx_DECREF_TypeName(iterator_type_name); -} -static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) { - PyObject* next; -#if !CYTHON_COMPILING_IN_LIMITED_API - iternextfunc iternext = __Pyx_PyObject_TryGetSlot(iterator, tp_iternext, iternextfunc); - if (likely(iternext)) { - next = iternext(iterator); - if (likely(next)) - return next; - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 - if (unlikely(iternext == &_PyObject_NextNotImplemented)) - return NULL; - #endif - } else if (CYTHON_USE_TYPE_SLOTS) { - __Pyx_PyIter_Next_ErrorNoIterator(iterator); - return NULL; - } else -#endif - if (unlikely(!PyIter_Check(iterator))) { - __Pyx_PyIter_Next_ErrorNoIterator(iterator); - return NULL; - } else { - next = defval ? PyIter_Next(iterator) : __Pyx_PyIter_Next_Plain(iterator); - if (likely(next)) - return next; - } - return __Pyx_PyIter_Next2Default(defval); -} -#endif - /* RaiseNoneIterError */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); @@ -21374,6 +21572,29 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, } #endif +/* IterNextPlain */ +#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)) + __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next); + return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache; +} +#endif +static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) { +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + PyObject *result; + PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI(); + if (unlikely(!next)) return NULL; + result = PyObject_CallFunctionObjArgs(next, iterator, NULL); + return result; +#else + (void)__Pyx_GetBuiltinName; // only for early limited API + iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator); + assert(iternext); + return iternext(iterator); +#endif +} + /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { @@ -22403,6 +22624,14 @@ static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethods type->tp_as_async = __Pyx_SlotTpAsAsync(static_amsend_methods); } #endif +static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg) { + CYTHON_UNUSED_VAR(arg); + __Pyx_TypeName self_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE((PyObject*)self)); + PyErr_Format(PyExc_TypeError, "cannot pickle '" __Pyx_FMT_TYPENAME "' object", + self_type_name); + __Pyx_DECREF_TypeName(self_type_name); + return NULL; +} /* Generator */ static PyMethodDef __pyx_Generator_methods[] = { @@ -22412,6 +22641,8 @@ static PyMethodDef __pyx_Generator_methods[] = { PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, + {"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0}, + {"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0}, {0, 0, 0, 0} }; static PyMemberDef __pyx_Generator_memberlist[] = { @@ -22464,7 +22695,8 @@ static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async; #endif static int __pyx_Generator_init(PyObject *module) { __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); - mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); + mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec( + mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_GeneratorType_spec, NULL); if (unlikely(!mstate->__pyx_GeneratorType)) { return -1; } diff --git a/constraint/problem.c b/constraint/problem.c index ad5e61a..8a0f9e3 100644 --- a/constraint/problem.c +++ b/constraint/problem.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.1.1 */ +/* Generated by Cython 3.1.2 */ /* BEGIN: Cython Metadata { @@ -29,8 +29,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x03080000 #error Cython requires Python 3.8+. #else -#define __PYX_ABI_VERSION "3_1_1" -#define CYTHON_HEX_VERSION 0x030101F0 +#define __PYX_ABI_VERSION "3_1_2" +#define CYTHON_HEX_VERSION 0x030102F0 #define CYTHON_FUTURE_DIVISION 1 /* CModulePreamble */ #include @@ -445,7 +445,7 @@ END: Cython Metadata */ #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON +# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED @@ -890,11 +890,19 @@ 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_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS +#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 + #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) #else - #define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i) + #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) #endif #else #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) @@ -1302,7 +1310,9 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #endif /* __GNUC__ */ /* PretendToInitialize */ #ifdef __cplusplus +#if __cplusplus > 201103L #include +#endif template static void __Pyx_pretend_to_initialize(T* ptr) { #if __cplusplus > 201103L @@ -2220,6 +2230,15 @@ 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 */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp); +#endif + +/* SetItemOnTypeDict.proto */ +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); @@ -2267,7 +2286,11 @@ static PyObject *__Pyx_FetchSharedCythonABIModule(void); static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type); /* FetchCommonType.proto */ -static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); +static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases); + +/* CommonTypesMetaclass.proto */ +static int __pyx_CommonTypesMetaclass_init(PyObject *module); +#define __Pyx_CommonTypesMetaclass_USED /* PyMethodNew.proto */ static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); @@ -2582,6 +2605,7 @@ static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *clos #if __PYX_HAS_PY_AM_SEND == 2 static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send); #endif +static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg); /* Generator.proto */ #define __Pyx_Generator_USED @@ -2732,6 +2756,7 @@ 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"; @@ -2928,7 +2953,7 @@ typedef struct { PyObject *__pyx_slice[1]; PyObject *__pyx_tuple[4]; PyObject *__pyx_codeobj_tab[17]; - PyObject *__pyx_string_tab[173]; + PyObject *__pyx_string_tab[174]; /* #### Code section: module_state_contents ### */ #if CYTHON_USE_FREELISTS @@ -2955,6 +2980,9 @@ int __pyx_freecount_10constraint_7problem___pyx_scope_struct_3_genexpr; struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *__pyx_freelist_10constraint_7problem___pyx_scope_struct_4_genexpr[8]; int __pyx_freecount_10constraint_7problem___pyx_scope_struct_4_genexpr; #endif +/* CommonTypesMetaclass.module_state_decls */ +PyTypeObject *__pyx_CommonTypesMetaclassType; + /* CachedMethodType.module_state_decls */ #if CYTHON_COMPILING_IN_LIMITED_API PyObject *__Pyx_CachedMethodType; @@ -3139,33 +3167,34 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_size_dict __pyx_string_tab[146] -#define __pyx_n_u_size_list __pyx_string_tab[147] -#define __pyx_n_u_solution __pyx_string_tab[148] -#define __pyx_n_u_solutions __pyx_string_tab[149] -#define __pyx_n_u_solutions_dict __pyx_string_tab[150] -#define __pyx_n_u_solutions_list __pyx_string_tab[151] -#define __pyx_n_u_solver __pyx_string_tab[152] -#define __pyx_n_u_solver_2 __pyx_string_tab[153] -#define __pyx_kp_u_solver_is_not_instance_of_Solve __pyx_string_tab[154] -#define __pyx_n_u_spec __pyx_string_tab[155] -#define __pyx_n_u_str_constraints __pyx_string_tab[156] -#define __pyx_n_u_sys __pyx_string_tab[157] -#define __pyx_n_u_test __pyx_string_tab[158] -#define __pyx_n_u_throw __pyx_string_tab[159] -#define __pyx_kp_u_tuple_list_tuple_dict_tuple_int __pyx_string_tab[160] -#define __pyx_n_u_typing __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_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] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3199,7 +3228,7 @@ 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<17; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<173; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<174; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } return 0; } #endif @@ -3233,7 +3262,7 @@ 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<17; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<173; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<174; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } return 0; } #endif @@ -9859,6 +9888,13 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); __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) + /*--- Initialize various global constants etc. ---*/ + 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 @@ -9875,10 +9911,6 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ - /*--- Initialize various global constants etc. ---*/ - 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 (__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) } @@ -10654,6 +10686,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -13352,24 +13385,83 @@ static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visi } #endif +/* LimitedApiGetTypeDict */ +#if CYTHON_COMPILING_IN_LIMITED_API +static Py_ssize_t __Pyx_GetTypeDictOffset(void) { + PyObject *tp_dictoffset_o; + Py_ssize_t tp_dictoffset; + tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__"); + if (unlikely(!tp_dictoffset_o)) return -1; + tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o); + Py_DECREF(tp_dictoffset_o); + if (unlikely(tp_dictoffset == 0)) { + PyErr_SetString( + PyExc_TypeError, + "'type' doesn't have a dictoffset"); + return -1; + } else if (unlikely(tp_dictoffset < 0)) { + PyErr_SetString( + PyExc_TypeError, + "'type' has an unexpected negative dictoffset. " + "Please report this as Cython bug"); + return -1; + } + return tp_dictoffset; +} +static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) { + static Py_ssize_t tp_dictoffset = 0; + if (unlikely(tp_dictoffset == 0)) { + tp_dictoffset = __Pyx_GetTypeDictOffset(); + if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) { + tp_dictoffset = 0; // try again next time? + return NULL; + } + } + return *(PyObject**)((char*)tp + tp_dictoffset); +} +#endif + +/* SetItemOnTypeDict */ +static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) { + int result; + PyObject *tp_dict; +#if CYTHON_COMPILING_IN_LIMITED_API + tp_dict = __Pyx_GetTypeDict(tp); + if (unlikely(!tp_dict)) return -1; +#else + tp_dict = tp->tp_dict; +#endif + result = PyDict_SetItem(tp_dict, k, v); + if (likely(!result)) { + PyType_Modified(tp); + if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) { + PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name, (PyObject *) tp, k, NULL); + if (!setNameResult) return -1; + Py_DECREF(setNameResult); + } + } + return result; +} + /* FixUpExtensionType */ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { -#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API +#if __PYX_LIMITED_VERSION_HEX > 0x030900B1 CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); + CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); #else const PyType_Slot *slot = spec->slots; + int changed = 0; +#if !CYTHON_COMPILING_IN_LIMITED_API while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { - int changed = 0; -#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) +#if !CYTHON_COMPILING_IN_CPYTHON const -#endif +#endif // !CYTHON_COMPILING_IN_CPYTHON) PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { -#if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); @@ -13393,11 +13485,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject #endif changed = 1; } -#endif -#else - if ((0)); -#endif -#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON +#endif // CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); @@ -13405,21 +13493,52 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; - if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { - Py_DECREF(descr); + int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr); + Py_DECREF(descr); + if (unlikely(set_item_result < 0)) { return -1; } - Py_DECREF(descr); changed = 1; } -#endif } memb++; } - if (changed) - PyType_Modified(type); } -#endif +#endif // !CYTHON_COMPILING_IN_LIMITED_API + slot = spec->slots; + while (slot && slot->slot && slot->slot != Py_tp_getset) + slot++; + if (slot && slot->slot == Py_tp_getset) { + PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc; + while (getset && getset->name) { + if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) { + PyObject *descr = PyDescr_NewGetSet(type, getset); + if (unlikely(!descr)) + return -1; + #if CYTHON_COMPILING_IN_LIMITED_API + PyObject *pyname = PyUnicode_FromString(getset->name); + if (unlikely(!pyname)) { + Py_DECREF(descr); + return -1; + } + int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr); + Py_DECREF(pyname); + #else + CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); + int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr); + #endif + Py_DECREF(descr); + if (unlikely(set_item_result < 0)) { + return -1; + } + changed = 1; + } + ++getset; + } + } + if (changed) + PyType_Modified(type); +#endif // PY_VERSION_HEX > 0x030900B1 return 0; } @@ -13901,6 +14020,24 @@ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *ke } /* FetchCommonType */ +#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); + if (result && metaclass) { + PyObject *old_tp = (PyObject*)Py_TYPE(result); + Py_INCREF((PyObject*)metaclass); +#if __PYX_LIMITED_VERSION_HEX >= 0x03090000 + Py_SET_TYPE(result, metaclass); +#else + result->ob_type = metaclass; +#endif + Py_DECREF(old_tp); + } + return result; +} +#else +#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b) +#endif static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t expected_basicsize) { @@ -13910,6 +14047,9 @@ static int __Pyx_VerifyCachedType(PyObject *cached_type, "Shared Cython type %.200s is not a type object", name); return -1; } + if (expected_basicsize == 0) { + return 0; // size is inherited, nothing useful to check + } #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); @@ -13929,7 +14069,7 @@ static int __Pyx_VerifyCachedType(PyObject *cached_type, } return 0; } -static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { +static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name; int get_item_ref_result; const char* object_name = strrchr(spec->name, '.'); @@ -13953,7 +14093,7 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec goto bad; } CYTHON_UNUSED_VAR(module); - cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); + cached_type = __Pyx_PyType_FromMetaclass(metaclass, 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); @@ -13982,6 +14122,42 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec goto done; } +/* CommonTypesMetaclass */ +PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) { + return PyUnicode_FromString(__PYX_ABI_MODULE_NAME); +} +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}, + {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 +}; +static int __pyx_CommonTypesMetaclass_init(PyObject *module) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); + PyObject *bases = PyTuple_Pack(1, &PyType_Type); + if (unlikely(!bases)) { + return -1; + } + mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases); + if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) { + return -1; + } + return 0; +} + /* PyMethodNew */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { @@ -15079,7 +15255,8 @@ static PyType_Spec __pyx_CyFunctionType_spec = { }; static int __pyx_CyFunction_init(PyObject *module) { __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); - mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); + mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec( + mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL); if (unlikely(mstate->__pyx_CyFunctionType == NULL)) { return -1; } @@ -17346,6 +17523,14 @@ static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethods type->tp_as_async = __Pyx_SlotTpAsAsync(static_amsend_methods); } #endif +static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg) { + CYTHON_UNUSED_VAR(arg); + __Pyx_TypeName self_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE((PyObject*)self)); + PyErr_Format(PyExc_TypeError, "cannot pickle '" __Pyx_FMT_TYPENAME "' object", + self_type_name); + __Pyx_DECREF_TypeName(self_type_name); + return NULL; +} /* Generator */ static PyMethodDef __pyx_Generator_methods[] = { @@ -17355,6 +17540,8 @@ static PyMethodDef __pyx_Generator_methods[] = { PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, + {"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0}, + {"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0}, {0, 0, 0, 0} }; static PyMemberDef __pyx_Generator_memberlist[] = { @@ -17407,7 +17594,8 @@ static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async; #endif static int __pyx_Generator_init(PyObject *module) { __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); - mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); + mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec( + mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_GeneratorType_spec, NULL); if (unlikely(!mstate->__pyx_GeneratorType)) { return -1; } diff --git a/constraint/solvers.c b/constraint/solvers.c index ad9ab52..140573f 100644 --- a/constraint/solvers.c +++ b/constraint/solvers.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.1.1 */ +/* Generated by Cython 3.1.2 */ /* BEGIN: Cython Metadata { @@ -29,8 +29,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x03080000 #error Cython requires Python 3.8+. #else -#define __PYX_ABI_VERSION "3_1_1" -#define CYTHON_HEX_VERSION 0x030101F0 +#define __PYX_ABI_VERSION "3_1_2" +#define CYTHON_HEX_VERSION 0x030102F0 #define CYTHON_FUTURE_DIVISION 1 /* CModulePreamble */ #include @@ -445,7 +445,7 @@ END: Cython Metadata */ #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON +# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED @@ -890,11 +890,19 @@ 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_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS +#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 + #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) #else - #define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i) + #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) #endif #else #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) @@ -1302,7 +1310,9 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #endif /* __GNUC__ */ /* PretendToInitialize */ #ifdef __cplusplus +#if __cplusplus > 201103L #include +#endif template static void __Pyx_pretend_to_initialize(T* ptr) { #if __cplusplus > 201103L @@ -2026,18 +2036,18 @@ 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)\ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (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)\ +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (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)\ +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) @@ -2161,6 +2171,15 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif +/* LimitedApiGetTypeDict.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp); +#endif + +/* SetItemOnTypeDict.proto */ +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); @@ -2168,7 +2187,11 @@ static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ -static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); +static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases); + +/* CommonTypesMetaclass.proto */ +static int __pyx_CommonTypesMetaclass_init(PyObject *module); +#define __Pyx_CommonTypesMetaclass_USED /* CallTypeTraverse.proto */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) @@ -2716,6 +2739,7 @@ static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *clos #if __PYX_HAS_PY_AM_SEND == 2 static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send); #endif +static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg); /* Generator.proto */ #define __Pyx_Generator_USED @@ -2896,6 +2920,7 @@ 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!"; @@ -3151,11 +3176,14 @@ typedef struct { PyObject *__pyx_slice[1]; PyObject *__pyx_tuple[4]; PyObject *__pyx_codeobj_tab[37]; - PyObject *__pyx_string_tab[218]; + PyObject *__pyx_string_tab[219]; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_1000; /* #### Code section: module_state_contents ### */ +/* CommonTypesMetaclass.module_state_decls */ +PyTypeObject *__pyx_CommonTypesMetaclassType; + /* CachedMethodType.module_state_decls */ #if CYTHON_COMPILING_IN_LIMITED_API PyObject *__Pyx_CachedMethodType; @@ -3416,37 +3444,38 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_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_spec __pyx_string_tab[195] -#define __pyx_n_u_steps __pyx_string_tab[196] -#define __pyx_n_u_steps_2 __pyx_string_tab[197] -#define __pyx_kp_u_string __pyx_string_tab[198] -#define __pyx_n_u_super __pyx_string_tab[199] -#define __pyx_n_u_test __pyx_string_tab[200] -#define __pyx_n_u_throw __pyx_string_tab[201] -#define __pyx_kp_u_tuple_bool_dict_Hashable_Domain __pyx_string_tab[202] -#define __pyx_n_u_types __pyx_string_tab[203] -#define __pyx_n_u_unassigned_vars __pyx_string_tab[204] -#define __pyx_n_u_v __pyx_string_tab[205] -#define __pyx_n_u_val __pyx_string_tab[206] -#define __pyx_n_u_vals __pyx_string_tab[207] -#define __pyx_n_u_value __pyx_string_tab[208] -#define __pyx_n_u_values __pyx_string_tab[209] -#define __pyx_n_u_var __pyx_string_tab[210] -#define __pyx_n_u_variable __pyx_string_tab[211] -#define __pyx_n_u_variable1 __pyx_string_tab[212] -#define __pyx_n_u_variable2 __pyx_string_tab[213] -#define __pyx_n_u_variables __pyx_string_tab[214] -#define __pyx_n_u_vars_involved __pyx_string_tab[215] -#define __pyx_n_u_vconstraints __pyx_string_tab[216] -#define __pyx_n_u_x __pyx_string_tab[217] +#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] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3484,7 +3513,7 @@ 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<218; ++i) { Py_CLEAR(clear_module_state->__pyx_string_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); @@ -3525,7 +3554,7 @@ 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<218; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_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); @@ -5937,9 +5966,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); 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); 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); 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); 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); @@ -6222,7 +6251,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); 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); 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; @@ -6235,7 +6264,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); 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); 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); @@ -11165,9 +11194,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); 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); 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); 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); 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); @@ -11833,9 +11862,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); 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); 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); 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); 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); @@ -12059,7 +12088,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); 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); 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 +12169,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); 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); 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; @@ -12997,7 +13026,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); 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); 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) { @@ -15593,7 +15622,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); 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); 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; @@ -16983,7 +17012,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6compile_to_function(CYTHON_UNUS __Pyx_GOTREF(__pyx_t_2); __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); 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); 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) @@ -17275,7 +17304,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); 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); 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; @@ -20647,6 +20676,13 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); __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) + /*--- Initialize various global constants etc. ---*/ + 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 @@ -20663,10 +20699,6 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ - /*--- Initialize various global constants etc. ---*/ - 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 (__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) } @@ -21829,6 +21861,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -24371,24 +24404,83 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( return 1; } +/* LimitedApiGetTypeDict */ +#if CYTHON_COMPILING_IN_LIMITED_API +static Py_ssize_t __Pyx_GetTypeDictOffset(void) { + PyObject *tp_dictoffset_o; + Py_ssize_t tp_dictoffset; + tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__"); + if (unlikely(!tp_dictoffset_o)) return -1; + tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o); + Py_DECREF(tp_dictoffset_o); + if (unlikely(tp_dictoffset == 0)) { + PyErr_SetString( + PyExc_TypeError, + "'type' doesn't have a dictoffset"); + return -1; + } else if (unlikely(tp_dictoffset < 0)) { + PyErr_SetString( + PyExc_TypeError, + "'type' has an unexpected negative dictoffset. " + "Please report this as Cython bug"); + return -1; + } + return tp_dictoffset; +} +static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) { + static Py_ssize_t tp_dictoffset = 0; + if (unlikely(tp_dictoffset == 0)) { + tp_dictoffset = __Pyx_GetTypeDictOffset(); + if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) { + tp_dictoffset = 0; // try again next time? + return NULL; + } + } + return *(PyObject**)((char*)tp + tp_dictoffset); +} +#endif + +/* SetItemOnTypeDict */ +static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) { + int result; + PyObject *tp_dict; +#if CYTHON_COMPILING_IN_LIMITED_API + tp_dict = __Pyx_GetTypeDict(tp); + if (unlikely(!tp_dict)) return -1; +#else + tp_dict = tp->tp_dict; +#endif + result = PyDict_SetItem(tp_dict, k, v); + if (likely(!result)) { + PyType_Modified(tp); + if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) { + PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name, (PyObject *) tp, k, NULL); + if (!setNameResult) return -1; + Py_DECREF(setNameResult); + } + } + return result; +} + /* FixUpExtensionType */ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { -#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API +#if __PYX_LIMITED_VERSION_HEX > 0x030900B1 CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); + CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); #else const PyType_Slot *slot = spec->slots; + int changed = 0; +#if !CYTHON_COMPILING_IN_LIMITED_API while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { - int changed = 0; -#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) +#if !CYTHON_COMPILING_IN_CPYTHON const -#endif +#endif // !CYTHON_COMPILING_IN_CPYTHON) PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { -#if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); @@ -24412,11 +24504,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject #endif changed = 1; } -#endif -#else - if ((0)); -#endif -#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON +#endif // CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); @@ -24424,21 +24512,52 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; - if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { - Py_DECREF(descr); + int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr); + Py_DECREF(descr); + if (unlikely(set_item_result < 0)) { return -1; } - Py_DECREF(descr); changed = 1; } -#endif } memb++; } - if (changed) - PyType_Modified(type); } -#endif +#endif // !CYTHON_COMPILING_IN_LIMITED_API + slot = spec->slots; + while (slot && slot->slot && slot->slot != Py_tp_getset) + slot++; + if (slot && slot->slot == Py_tp_getset) { + PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc; + while (getset && getset->name) { + if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) { + PyObject *descr = PyDescr_NewGetSet(type, getset); + if (unlikely(!descr)) + return -1; + #if CYTHON_COMPILING_IN_LIMITED_API + PyObject *pyname = PyUnicode_FromString(getset->name); + if (unlikely(!pyname)) { + Py_DECREF(descr); + return -1; + } + int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr); + Py_DECREF(pyname); + #else + CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); + int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr); + #endif + Py_DECREF(descr); + if (unlikely(set_item_result < 0)) { + return -1; + } + changed = 1; + } + ++getset; + } + } + if (changed) + PyType_Modified(type); +#endif // PY_VERSION_HEX > 0x030900B1 return 0; } @@ -24448,6 +24567,24 @@ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { } /* FetchCommonType */ +#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); + if (result && metaclass) { + PyObject *old_tp = (PyObject*)Py_TYPE(result); + Py_INCREF((PyObject*)metaclass); +#if __PYX_LIMITED_VERSION_HEX >= 0x03090000 + Py_SET_TYPE(result, metaclass); +#else + result->ob_type = metaclass; +#endif + Py_DECREF(old_tp); + } + return result; +} +#else +#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b) +#endif static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t expected_basicsize) { @@ -24457,6 +24594,9 @@ static int __Pyx_VerifyCachedType(PyObject *cached_type, "Shared Cython type %.200s is not a type object", name); return -1; } + if (expected_basicsize == 0) { + return 0; // size is inherited, nothing useful to check + } #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); @@ -24476,7 +24616,7 @@ static int __Pyx_VerifyCachedType(PyObject *cached_type, } return 0; } -static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { +static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name; int get_item_ref_result; const char* object_name = strrchr(spec->name, '.'); @@ -24500,7 +24640,7 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec goto bad; } CYTHON_UNUSED_VAR(module); - cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); + cached_type = __Pyx_PyType_FromMetaclass(metaclass, 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); @@ -24529,6 +24669,42 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec goto done; } +/* CommonTypesMetaclass */ +PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) { + return PyUnicode_FromString(__PYX_ABI_MODULE_NAME); +} +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}, + {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 +}; +static int __pyx_CommonTypesMetaclass_init(PyObject *module) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); + PyObject *bases = PyTuple_Pack(1, &PyType_Type); + if (unlikely(!bases)) { + return -1; + } + mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases); + if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) { + return -1; + } + return 0; +} + /* CallTypeTraverse */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #else @@ -25645,7 +25821,8 @@ static PyType_Spec __pyx_CyFunctionType_spec = { }; static int __pyx_CyFunction_init(PyObject *module) { __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); - mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); + mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec( + mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL); if (unlikely(mstate->__pyx_CyFunctionType == NULL)) { return -1; } @@ -29212,6 +29389,14 @@ static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethods type->tp_as_async = __Pyx_SlotTpAsAsync(static_amsend_methods); } #endif +static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg) { + CYTHON_UNUSED_VAR(arg); + __Pyx_TypeName self_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE((PyObject*)self)); + PyErr_Format(PyExc_TypeError, "cannot pickle '" __Pyx_FMT_TYPENAME "' object", + self_type_name); + __Pyx_DECREF_TypeName(self_type_name); + return NULL; +} /* Generator */ static PyMethodDef __pyx_Generator_methods[] = { @@ -29221,6 +29406,8 @@ static PyMethodDef __pyx_Generator_methods[] = { PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, + {"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0}, + {"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0}, {0, 0, 0, 0} }; static PyMemberDef __pyx_Generator_memberlist[] = { @@ -29273,7 +29460,8 @@ static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async; #endif static int __pyx_Generator_init(PyObject *module) { __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); - mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); + mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec( + mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_GeneratorType_spec, NULL); if (unlikely(!mstate->__pyx_GeneratorType)) { return -1; } From ce180cbcfd2a87b67b71809aa81a101770102589 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Mon, 16 Jun 2025 12:17:46 +0200 Subject: [PATCH 34/87] Rewriting of restrictions with less-than or greater-than operators now supports floats as well --- constraint/constraints.py | 6 +++++ constraint/parser.py | 47 +++++++++++++++++++-------------------- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/constraint/constraints.py b/constraint/constraints.py index e5383e0..c5038b9 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -853,6 +853,8 @@ def _get_product_bounds(self, domain_dict, exclude_var=None): if var == exclude_var: continue dom = domain_dict[var] + if not dom: + continue bounds.append((min(dom), max(dom))) all_bounds = [b for b in bounds] @@ -998,6 +1000,8 @@ def _get_product_bounds(self, domain_dict, exclude_var=None): if var == exclude_var: continue dom = domain_dict[var] + if not dom: + continue bounds.append((min(dom), max(dom))) if not bounds: @@ -1167,6 +1171,8 @@ def _get_product_bounds(self, domain_dict, exclude_var=None): if var == exclude_var: continue dom = domain_dict[var] + if not dom: + continue bounds.append((min(dom), max(dom))) if not bounds: diff --git a/constraint/parser.py b/constraint/parser.py index 6eff77e..af7b0a8 100644 --- a/constraint/parser.py +++ b/constraint/parser.py @@ -198,24 +198,22 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: (left_num, right.strip(), False) if left_num is not None else (right_num, left.strip(), True) ) - # if the number is an integer, we can map '>' to '>=' and '<' to '<=' by changing the number (does not work with floating points!) # noqa: E501 - # TODO instead use the smallest floating point difference in Python / ^-10 - number_is_int = isinstance(number, int) - if number_is_int: - if comparator == "<": - if variables_on_left: - # (x < 2) == (x <= 2-1) - number -= 1 - else: - # (2 < x) == (2+1 <= x) - number += 1 - elif comparator == ">": - if variables_on_left: - # (x > 2) == (x >= 2+1) - number += 1 - else: - # (2 > x) == (2-1 >= x) - number -= 1 + # 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) + number -= offset + else: + # (2 < x) == (2+offset <= x) + number += offset + elif comparator == ">": + if variables_on_left: + # (x > 2) == (x >= 2+offset) + number += offset + else: + # (2 > x) == (2-offset >= x) + number -= offset # check if an operator is applied on the variables, if not return operators = [r"\*\*", r"\*", r"\+"] @@ -229,9 +227,9 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # 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 == "<" and number_is_int): + elif comparator == "<=" or comparator == "<": return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - elif comparator == ">=" or (comparator == ">" and number_is_int): + elif comparator == ">=" or comparator == ">": return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) raise ValueError(f"Invalid comparator {comparator}") @@ -252,16 +250,17 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: elif operator == "*": if comparator == "==": return ExactProdConstraint(number) - elif comparator == "<=" or (comparator == "<" and number_is_int): + elif comparator == "<=" or comparator == "<": return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) - elif comparator == ">=" or (comparator == ">" and number_is_int): + elif comparator == ">=" or comparator == ">": return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) elif operator == "+": if comparator == "==": return ExactSumConstraint(number) - elif comparator == "<=" or (comparator == "<" and number_is_int): + elif comparator == "<=" or comparator == "<": + # raise ValueError(restriction, comparator) return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - elif comparator == ">=" or (comparator == ">" and number_is_int): + elif comparator == ">=" or comparator == ">": return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) else: raise ValueError(f"Invalid operator {operator}") From 22cecabfef731688a60a6349377a06b3543161bc Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Mon, 16 Jun 2025 12:18:16 +0200 Subject: [PATCH 35/87] Recythonized after major changes --- constraint/constraints.c | 5265 +++++++++++++++++++------------------- constraint/parser.c | 1369 +++++----- 2 files changed, 3342 insertions(+), 3292 deletions(-) diff --git a/constraint/constraints.c b/constraint/constraints.c index 8859c2f..b48b741 100644 --- a/constraint/constraints.c +++ b/constraint/constraints.c @@ -1724,7 +1724,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr { }; -/* "constraint/constraints.py":888 +/* "constraint/constraints.py":890 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -1738,7 +1738,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ { }; -/* "constraint/constraints.py":911 +/* "constraint/constraints.py":913 * 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 +1755,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr { }; -/* "constraint/constraints.py":912 +/* "constraint/constraints.py":914 * 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,7 +1772,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr { }; -/* "constraint/constraints.py":926 +/* "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): # <<<<<<<<<<<<<< @@ -1787,7 +1787,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr { }; -/* "constraint/constraints.py":1030 +/* "constraint/constraints.py":1034 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -1800,7 +1800,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__ { }; -/* "constraint/constraints.py":1066 +/* "constraint/constraints.py":1070 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p < target_value for p in prods): # <<<<<<<<<<<<<< @@ -1815,7 +1815,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr { }; -/* "constraint/constraints.py":1100 +/* "constraint/constraints.py":1104 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -1829,7 +1829,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr { }; -/* "constraint/constraints.py":1199 +/* "constraint/constraints.py":1205 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -1842,7 +1842,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ { }; -/* "constraint/constraints.py":1235 +/* "constraint/constraints.py":1241 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p > target_value for p in prods): # <<<<<<<<<<<<<< @@ -3214,7 +3214,6 @@ static const char __pyx_k_77JJeef_QfKy_Q_6a_A_L_gQ_waq_J[] = "\320\004$\320$7\32 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_q_G4q_t3a_Qa_3avS_4q_3a_Qb_E_D[] = "\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\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_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!"; @@ -3235,7 +3234,8 @@ static const char __pyx_k_VariableMaxSumConstraint___init[] = "VariableMaxSumCon 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_3avS_Qb_E_4q_3a_Qb[] = "\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\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_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"; @@ -22540,11 +22540,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; + int __pyx_t_6; PyObject *__pyx_t_7 = NULL; - size_t __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; + PyObject *__pyx_t_8 = NULL; + size_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; @@ -22646,7 +22646,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * if var == exclude_var: * continue # <<<<<<<<<<<<<< * dom = domain_dict[var] - * bounds.append((min(dom), max(dom))) + * if not dom: */ goto __pyx_L3_continue; @@ -22663,8 +22663,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * if var == exclude_var: * continue * dom = domain_dict[var] # <<<<<<<<<<<<<< - * bounds.append((min(dom), max(dom))) - * + * 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_GOTREF(__pyx_t_1); @@ -22674,44 +22674,73 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai /* "constraint/constraints.py":856 * 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_6 = (!__pyx_t_5); + if (__pyx_t_6) { + + /* "constraint/constraints.py":857 + * dom = domain_dict[var] + * if not dom: + * continue # <<<<<<<<<<<<<< + * bounds.append((min(dom), max(dom))) + * +*/ + goto __pyx_L3_continue; + + /* "constraint/constraints.py":856 + * continue + * dom = domain_dict[var] + * if not dom: # <<<<<<<<<<<<<< + * continue + * bounds.append((min(dom), max(dom))) +*/ + } + + /* "constraint/constraints.py":858 + * if not dom: + * continue * bounds.append((min(dom), max(dom))) # <<<<<<<<<<<<<< * * all_bounds = [b for b in bounds] */ - __pyx_t_6 = NULL; + __pyx_t_7 = NULL; __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_7 = __pyx_builtin_min; - __pyx_t_8 = 1; + __pyx_t_8 = __pyx_builtin_min; + __pyx_t_9 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_dom}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __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_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error) + 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_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) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_6 = NULL; + __pyx_t_7 = NULL; __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_9 = __pyx_builtin_max; - __pyx_t_8 = 1; + __pyx_t_10 = __pyx_builtin_max; + __pyx_t_9 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_dom}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __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_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 856, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + 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); } - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 856, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 858, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 856, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 856, __pyx_L1_error); + 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); __pyx_t_1 = 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, 856, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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; /* "constraint/constraints.py":852 * """Return min and max product of domains of product_vars (excluding `exclude_var` if given).""" @@ -22724,7 +22753,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":858 + /* "constraint/constraints.py":860 * bounds.append((min(dom), max(dom))) * * all_bounds = [b for b in bounds] # <<<<<<<<<<<<<< @@ -22732,50 +22761,50 @@ 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, 858, __pyx_L9_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 860, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __pyx_v_bounds; __Pyx_INCREF(__pyx_t_9); + __pyx_t_10 = __pyx_v_bounds; __Pyx_INCREF(__pyx_t_10); __pyx_t_3 = 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, 858, __pyx_L9_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 860, __pyx_L10_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_3); + __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_3); ++__pyx_t_3; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 858, __pyx_L9_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_b, __pyx_t_7); - __pyx_t_7 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_8genexpr9__pyx_v_b))) __PYX_ERR(0, 858, __pyx_L9_error) + 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) } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_b); __pyx_8genexpr9__pyx_v_b = 0; - goto __pyx_L13_exit_scope; - __pyx_L9_error:; + goto __pyx_L14_exit_scope; + __pyx_L10_error:; __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_b); __pyx_8genexpr9__pyx_v_b = 0; goto __pyx_L1_error; - __pyx_L13_exit_scope:; + __pyx_L14_exit_scope:; } /* exit inner scope */ __pyx_v_all_bounds = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":859 + /* "constraint/constraints.py":861 * * all_bounds = [b for b in bounds] * if not all_bounds: # <<<<<<<<<<<<<< * return 1, 1 * */ - __pyx_t_5 = (__Pyx_PyList_GET_SIZE(__pyx_v_all_bounds) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_5 < 0))) __PYX_ERR(0, 859, __pyx_L1_error) - __pyx_t_11 = (!__pyx_t_5); - if (__pyx_t_11) { + __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) + __pyx_t_5 = (!__pyx_t_6); + if (__pyx_t_5) { - /* "constraint/constraints.py":860 + /* "constraint/constraints.py":862 * all_bounds = [b for b in bounds] * if not all_bounds: * return 1, 1 # <<<<<<<<<<<<<< @@ -22787,7 +22816,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = __pyx_mstate_global->__pyx_tuple[0]; goto __pyx_L0; - /* "constraint/constraints.py":859 + /* "constraint/constraints.py":861 * * all_bounds = [b for b in bounds] * if not all_bounds: # <<<<<<<<<<<<<< @@ -22796,7 +22825,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":863 + /* "constraint/constraints.py":865 * * # 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])] # <<<<<<<<<<<<<< @@ -22804,34 +22833,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, 863, __pyx_L17_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 865, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 863, __pyx_L17_error) - __Pyx_GOTREF(__pyx_t_9); + __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); { /* enter inner scope */ - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 863, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_7); + __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_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, 863, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 865, __pyx_L23_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); ++__pyx_t_3; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 863, __pyx_L22_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_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; 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, 863, __pyx_L22_error) + __PYX_ERR(0, 865, __pyx_L23_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -22841,138 +22870,138 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_INCREF(__pyx_t_13); } else { __pyx_t_12 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 863, __pyx_L22_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 865, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 863, __pyx_L22_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 865, __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, 863, __pyx_L22_error) + __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 865, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 863, __pyx_L22_error) + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 865, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_13); #endif - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { Py_ssize_t index = -1; - __pyx_t_14 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 863, __pyx_L22_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 865, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_L25_unpacking_failed; + 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_L25_unpacking_failed; + 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, 863, __pyx_L22_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 865, __pyx_L23_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - goto __pyx_L26_unpacking_done; - __pyx_L25_unpacking_failed:; + goto __pyx_L27_unpacking_done; + __pyx_L26_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, 863, __pyx_L22_error) - __pyx_L26_unpacking_done:; + __PYX_ERR(0, 865, __pyx_L23_error) + __pyx_L27_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_lo, __pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_hi, __pyx_t_13); __pyx_t_13 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 863, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_6); + __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_6, 0, __pyx_9genexpr11__pyx_v_lo) != (0)) __PYX_ERR(0, 863, __pyx_L22_error); + 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_6, 1, __pyx_9genexpr11__pyx_v_hi) != (0)) __PYX_ERR(0, 863, __pyx_L22_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 863, __pyx_L22_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + 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_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; - goto __pyx_L28_exit_scope; - __pyx_L22_error:; + 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; - goto __pyx_L17_error; - __pyx_L28_exit_scope:; + goto __pyx_L18_error; + __pyx_L29_exit_scope:; } /* exit inner scope */ - __pyx_t_1 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 863, __pyx_L17_error) + __pyx_t_1 = PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_1); - __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, 863, __pyx_L17_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __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_1); __pyx_t_1 = 0; - if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { - __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); + 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_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 863, __pyx_L17_error) + __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_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, 863, __pyx_L17_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, 865, __pyx_L18_error) } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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, 863, __pyx_L17_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 865, __pyx_L18_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); ++__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, 863, __pyx_L17_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 865, __pyx_L18_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3)); + __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3)); #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 863, __pyx_L17_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 865, __pyx_L18_error) } else { - __pyx_t_7 = __pyx_t_4(__pyx_t_1); - if (unlikely(!__pyx_t_7)) { + __pyx_t_8 = __pyx_t_4(__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, 863, __pyx_L17_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 865, __pyx_L18_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_7); - __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_b, __pyx_t_7); - __pyx_t_7 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr10__pyx_v_b))) __PYX_ERR(0, 863, __pyx_L17_error) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_b); __pyx_9genexpr10__pyx_v_b = 0; - goto __pyx_L30_exit_scope; - __pyx_L17_error:; + goto __pyx_L31_exit_scope; + __pyx_L18_error:; __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_b); __pyx_9genexpr10__pyx_v_b = 0; goto __pyx_L1_error; - __pyx_L30_exit_scope:; + __pyx_L31_exit_scope:; } /* exit inner scope */ __pyx_v_candidates = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":864 + /* "constraint/constraints.py":866 * # 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] # <<<<<<<<<<<<<< @@ -22980,7 +23009,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, 864, __pyx_L33_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_v_candidates; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; @@ -22988,41 +23017,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, 864, __pyx_L33_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 866, __pyx_L34_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); ++__pyx_t_3; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 864, __pyx_L33_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_p, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_9 = __pyx_v_self; - __Pyx_INCREF(__pyx_t_9); + 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); __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_9, __pyx_9genexpr12__pyx_v_p}; - __pyx_t_7 = __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_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 864, __pyx_L33_error) - __Pyx_GOTREF(__pyx_t_7); + 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); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 864, __pyx_L33_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + 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; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_p); __pyx_9genexpr12__pyx_v_p = 0; - goto __pyx_L37_exit_scope; - __pyx_L33_error:; + goto __pyx_L38_exit_scope; + __pyx_L34_error:; __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_p); __pyx_9genexpr12__pyx_v_p = 0; goto __pyx_L1_error; - __pyx_L37_exit_scope:; + __pyx_L38_exit_scope:; } /* exit inner scope */ __pyx_v_products = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":865 + /* "constraint/constraints.py":867 * 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) # <<<<<<<<<<<<<< @@ -23032,38 +23061,38 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF(__pyx_r); __pyx_t_1 = NULL; __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_7 = __pyx_builtin_min; - __pyx_t_8 = 1; + __pyx_t_8 = __pyx_builtin_min; + __pyx_t_9 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_products}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 865, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_1 = NULL; __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_9 = __pyx_builtin_max; - __pyx_t_8 = 1; + __pyx_t_10 = __pyx_builtin_max; + __pyx_t_9 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_products}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 865, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __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); } - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 865, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 867, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 865, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 865, __pyx_L1_error); + 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); __pyx_t_2 = 0; - __pyx_t_7 = 0; - __pyx_r = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_t_8 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; goto __pyx_L0; /* "constraint/constraints.py":849 @@ -23078,9 +23107,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); @@ -23103,7 +23132,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":867 +/* "constraint/constraints.py":869 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -23151,39 +23180,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, 867, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 869, __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, 867, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 869, __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, 867, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 869, __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, 867, __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, 869, __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, 867, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, i); __PYX_ERR(0, 869, __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, 867, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 869, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 867, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 869, __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, 867, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 869, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -23218,7 +23247,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_safe_product", 0); - /* "constraint/constraints.py":868 + /* "constraint/constraints.py":870 * * def _safe_product(self, values): * prod = 1 # <<<<<<<<<<<<<< @@ -23228,7 +23257,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":869 + /* "constraint/constraints.py":871 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -23240,9 +23269,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, 869, __pyx_L1_error) + __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_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, 869, __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, 871, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -23250,7 +23279,7 @@ 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, 869, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 871, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -23260,7 +23289,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 869, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 871, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -23271,13 +23300,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 869, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 871, __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, 869, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 871, __pyx_L1_error) PyErr_Clear(); } break; @@ -23287,19 +23316,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":870 + /* "constraint/constraints.py":872 * 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, 870, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":869 + /* "constraint/constraints.py":871 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -23309,7 +23338,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":871 + /* "constraint/constraints.py":873 * for v in values: * prod *= v * return prod # <<<<<<<<<<<<<< @@ -23321,7 +23350,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = __pyx_v_prod; goto __pyx_L0; - /* "constraint/constraints.py":867 + /* "constraint/constraints.py":869 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -23343,7 +23372,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":873 +/* "constraint/constraints.py":875 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -23394,50 +23423,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, 873, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 875, __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, 873, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 875, __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, 873, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 875, __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, 873, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 875, __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, 873, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 875, __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, 873, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 875, __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, 873, __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, 875, __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, 873, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 875, __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, 873, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 875, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 873, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 875, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 873, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 875, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 873, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 875, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 873, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 875, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -23447,7 +23476,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, 873, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 875, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -23458,9 +23487,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, 873, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 873, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 873, __pyx_L1_error) + 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) __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 */ @@ -23513,7 +23542,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":874 + /* "constraint/constraints.py":876 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -23521,9 +23550,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, 874, __pyx_L1_error) + __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_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, 874, __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, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -23543,27 +23572,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_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, 874, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":876 + /* "constraint/constraints.py":878 * 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, 876, __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, 878, __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, 876, __pyx_L1_error) + __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_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":877 + /* "constraint/constraints.py":879 * * target_domain = domains[self.target_var] * target_min = min(target_domain) # <<<<<<<<<<<<<< @@ -23579,13 +23608,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_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, 877, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_target_min = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/constraints.py":878 + /* "constraint/constraints.py":880 * target_domain = domains[self.target_var] * target_min = min(target_domain) * target_max = max(target_domain) # <<<<<<<<<<<<<< @@ -23601,29 +23630,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 878, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_target_max = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/constraints.py":879 + /* "constraint/constraints.py":881 * 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, 879, __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, 881, __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, 879, __pyx_L1_error) + __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_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, 879, __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, 881, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -23632,7 +23661,7 @@ 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, 879, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 881, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -23642,7 +23671,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 879, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 881, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -23653,13 +23682,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 881, __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, 879, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 881, __pyx_L1_error) PyErr_Clear(); } break; @@ -23669,7 +23698,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":880 + /* "constraint/constraints.py":882 * target_max = max(target_domain) * for var in self.product_vars: * other_min, other_max = self._get_product_bounds(domains, exclude_var=var) # <<<<<<<<<<<<<< @@ -23681,13 +23710,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, 880, __pyx_L1_error) + __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __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, 880, __pyx_L1_error) + 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); __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, 880, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { @@ -23696,7 +23725,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, 880, __pyx_L1_error) + __PYX_ERR(0, 882, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -23706,22 +23735,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __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, 880, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __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, 880, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 882, __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); @@ -23729,7 +23758,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, 880, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 882, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -23737,7 +23766,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, 880, __pyx_L1_error) + __PYX_ERR(0, 882, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_other_min, __pyx_t_3); @@ -23745,35 +23774,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":881 + /* "constraint/constraints.py":883 * 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, 881, __pyx_L1_error) + __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_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":882 + /* "constraint/constraints.py":884 * 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, 882, __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, 884, __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, 882, __pyx_L1_error) + __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_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, 882, __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, 884, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -23782,7 +23811,7 @@ 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, 882, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 884, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -23792,7 +23821,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 882, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 884, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -23803,13 +23832,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_10; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 882, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 884, __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, 882, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 884, __pyx_L1_error) PyErr_Clear(); } break; @@ -23819,29 +23848,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":883 + /* "constraint/constraints.py":885 * 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, 883, __pyx_L1_error) + __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_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Multiply(__pyx_v_value, __pyx_v_other_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 883, __pyx_L1_error) + __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_GOTREF(__pyx_t_3); - __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 885, __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, 883, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 885, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 883, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 885, __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":884 + /* "constraint/constraints.py":886 * for value in domain[:]: * candidates = [value * other_min, value * other_max] * minval, maxval = min(candidates), max(candidates) # <<<<<<<<<<<<<< @@ -23857,7 +23886,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_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, 884, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_3 = NULL; @@ -23869,7 +23898,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 884, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_minval, __pyx_t_8); @@ -23877,29 +23906,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_maxval, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":885 + /* "constraint/constraints.py":887 * 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, 885, __pyx_L1_error) - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 885, __pyx_L1_error) + __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) { } else { __pyx_t_13 = __pyx_t_14; 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, 885, __pyx_L1_error) - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 885, __pyx_L1_error) + __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_L10_bool_binop_done:; if (__pyx_t_13) { - /* "constraint/constraints.py":886 + /* "constraint/constraints.py":888 * minval, maxval = min(candidates), max(candidates) * if maxval < target_min or minval > target_max: * domain.remove(value) # <<<<<<<<<<<<<< @@ -23913,12 +23942,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 886, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":885 + /* "constraint/constraints.py":887 * candidates = [value * other_min, value * other_max] * minval, maxval = min(candidates), max(candidates) * if maxval < target_min or minval > target_max: # <<<<<<<<<<<<<< @@ -23927,7 +23956,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":882 + /* "constraint/constraints.py":884 * other_min, other_max = self._get_product_bounds(domains, exclude_var=var) * domain = domains[var] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -23937,7 +23966,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":879 + /* "constraint/constraints.py":881 * target_min = min(target_domain) * target_max = max(target_domain) * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -23947,7 +23976,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":873 + /* "constraint/constraints.py":875 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -23984,7 +24013,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":888 +/* "constraint/constraints.py":890 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -24035,53 +24064,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, 888, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 890, __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, 888, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 890, __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, 888, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 890, __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, 888, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 890, __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, 888, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 890, __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, 888, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 890, __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, 888, __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, 890, __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, 888, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 890, __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, 888, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 890, __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, 888, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 890, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 888, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 890, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 888, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 890, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 888, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 890, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -24095,7 +24124,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, 888, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 890, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -24106,8 +24135,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, 888, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 888, __pyx_L1_error) + 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) __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 */ @@ -24128,7 +24157,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":911 +/* "constraint/constraints.py":913 * 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) # <<<<<<<<<<<<<< @@ -24148,7 +24177,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, 911, __pyx_L1_error) + __PYX_ERR(0, 913, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -24159,7 +24188,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, 911, __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, 913, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -24197,29 +24226,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, 911, __pyx_L1_error) + __PYX_ERR(0, 913, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 911, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 913, __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, 911, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 913, __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, 911, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 913, __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, 911, __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, 911, __pyx_L1_error) + 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) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -24237,7 +24266,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, 911, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 913, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -24264,7 +24293,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":912 +/* "constraint/constraints.py":914 * 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) # <<<<<<<<<<<<<< @@ -24284,7 +24313,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, 912, __pyx_L1_error) + __PYX_ERR(0, 914, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -24295,7 +24324,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, 912, __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, 914, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -24333,29 +24362,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, 912, __pyx_L1_error) + __PYX_ERR(0, 914, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 912, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 914, __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, 912, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 914, __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, 912, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 914, __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, 912, __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, 912, __pyx_L1_error) + 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) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -24373,7 +24402,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, 912, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 914, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -24400,7 +24429,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai } 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":926 +/* "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): # <<<<<<<<<<<<<< @@ -24420,7 +24449,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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, 926, __pyx_L1_error) + __PYX_ERR(0, 928, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -24431,7 +24460,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___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, 926, __pyx_L1_error) + __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; @@ -24468,29 +24497,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 926, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 926, __pyx_L1_error) } + 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, 926, __pyx_L1_error) + 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, 926, __pyx_L1_error) + 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, 926, __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, 926, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 926, __pyx_L1_error) + 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) { @@ -24530,7 +24559,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":888 +/* "constraint/constraints.py":890 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -24592,25 +24621,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, 888, __pyx_L1_error) + __PYX_ERR(0, 890, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/constraints.py":889 + /* "constraint/constraints.py":891 * * 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, 889, __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, 891, __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, 889, __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, 891, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":890 + /* "constraint/constraints.py":892 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: * return True # <<<<<<<<<<<<<< @@ -24622,7 +24651,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":889 + /* "constraint/constraints.py":891 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -24631,23 +24660,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":892 + /* "constraint/constraints.py":894 * 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, 892, __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, 894, __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, 892, __pyx_L1_error) + __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_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":893 + /* "constraint/constraints.py":895 * * target_value = assignments[self.target_var] * assigned_product = 1 # <<<<<<<<<<<<<< @@ -24658,35 +24687,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":894 + /* "constraint/constraints.py":896 * 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, 894, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_unassigned_vars = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":896 + /* "constraint/constraints.py":898 * 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, 896, __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, 898, __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, 896, __pyx_L1_error) + __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_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, 896, __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, 898, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -24695,7 +24724,7 @@ 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, 896, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 898, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -24705,7 +24734,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 896, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 898, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -24716,13 +24745,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 898, __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, 896, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 898, __pyx_L1_error) PyErr_Clear(); } break; @@ -24732,26 +24761,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":897 + /* "constraint/constraints.py":899 * * 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, 897, __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, 899, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":898 + /* "constraint/constraints.py":900 * 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, 898, __pyx_L1_error) + __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_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, 898, __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, 900, __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); @@ -24759,7 +24788,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":897 + /* "constraint/constraints.py":899 * * for var in self.product_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -24769,7 +24798,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai goto __pyx_L6; } - /* "constraint/constraints.py":900 + /* "constraint/constraints.py":902 * assigned_product *= assignments[var] * else: * unassigned_vars.append(var) # <<<<<<<<<<<<<< @@ -24777,11 +24806,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, 900, __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, 902, __pyx_L1_error) } __pyx_L6:; - /* "constraint/constraints.py":896 + /* "constraint/constraints.py":898 * unassigned_vars = [] * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -24791,7 +24820,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":902 + /* "constraint/constraints.py":904 * unassigned_vars.append(var) * * if isinstance(assigned_product, float): # <<<<<<<<<<<<<< @@ -24804,7 +24833,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":903 + /* "constraint/constraints.py":905 * * if isinstance(assigned_product, float): * assigned_product = round(assigned_product, 10) # <<<<<<<<<<<<<< @@ -24820,7 +24849,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_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, 903, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_assigned_product); @@ -24828,7 +24857,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":902 + /* "constraint/constraints.py":904 * unassigned_vars.append(var) * * if isinstance(assigned_product, float): # <<<<<<<<<<<<<< @@ -24837,7 +24866,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":905 + /* "constraint/constraints.py":907 * assigned_product = round(assigned_product, 10) * * if not unassigned_vars: # <<<<<<<<<<<<<< @@ -24845,11 +24874,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * */ __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, 905, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 907, __pyx_L1_error) __pyx_t_9 = (!__pyx_t_2); if (__pyx_t_9) { - /* "constraint/constraints.py":906 + /* "constraint/constraints.py":908 * * if not unassigned_vars: * return assigned_product == target_value # <<<<<<<<<<<<<< @@ -24857,12 +24886,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, 906, __pyx_L1_error) + __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_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":905 + /* "constraint/constraints.py":907 * assigned_product = round(assigned_product, 10) * * if not unassigned_vars: # <<<<<<<<<<<<<< @@ -24871,7 +24900,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":909 + /* "constraint/constraints.py":911 * * # Partial assignment check feasibility * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned_vars] # <<<<<<<<<<<<<< @@ -24879,7 +24908,7 @@ 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, 909, __pyx_L12_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_v_unassigned_vars; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; @@ -24887,20 +24916,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 909, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 911, __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_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 909, __pyx_L12_error) + 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; __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, 909, __pyx_L12_error) + __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_8 = 1; { @@ -24909,13 +24938,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 909, __pyx_L12_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 911, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_6); } __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, 909, __pyx_L12_error) + __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_8 = 1; { @@ -24924,18 +24953,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 909, __pyx_L12_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 911, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 909, __pyx_L12_error) + __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, 909, __pyx_L12_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 911, __pyx_L12_error); __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 909, __pyx_L12_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 911, __pyx_L12_error); __pyx_t_6 = 0; __pyx_t_11 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 909, __pyx_L12_error) + 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; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -24949,7 +24978,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_v_domain_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":910 + /* "constraint/constraints.py":912 * # 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])] # <<<<<<<<<<<<<< @@ -24957,12 +24986,12 @@ 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, 910, __pyx_L19_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 912, __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, 910, __pyx_L19_error) + __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); { /* enter inner scope */ - __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 910, __pyx_L24_error) + __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_11 = __pyx_v_domain_bounds; __Pyx_INCREF(__pyx_t_11); __pyx_t_4 = 0; @@ -24970,13 +24999,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 910, __pyx_L24_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 912, __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_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 910, __pyx_L24_error) + 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; @@ -24984,7 +25013,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, 910, __pyx_L24_error) + __PYX_ERR(0, 912, __pyx_L24_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -24994,22 +25023,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_INCREF(__pyx_t_12); } else { __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 910, __pyx_L24_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 912, __pyx_L24_error) __Pyx_XGOTREF(__pyx_t_13); __pyx_t_12 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 910, __pyx_L24_error) + 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, 910, __pyx_L24_error) + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 912, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 910, __pyx_L24_error) + __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; } else { Py_ssize_t index = -1; - __pyx_t_14 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 910, __pyx_L24_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 912, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); @@ -25017,7 +25046,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 910, __pyx_L24_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 912, __pyx_L24_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L28_unpacking_done; @@ -25025,22 +25054,22 @@ 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, 910, __pyx_L24_error) + __PYX_ERR(0, 912, __pyx_L24_error) __pyx_L28_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_lo, __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, 910, __pyx_L24_error) + __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, 910, __pyx_L24_error); + 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, 910, __pyx_L24_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 910, __pyx_L24_error) + 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_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -25053,10 +25082,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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, 910, __pyx_L19_error) + __pyx_t_11 = PySequence_Tuple(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 912, __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, 910, __pyx_L19_error) + __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_11); __pyx_t_11 = 0; @@ -25065,9 +25094,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 910, __pyx_L19_error) + __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_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, 910, __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, 912, __pyx_L19_error) } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; for (;;) { @@ -25076,7 +25105,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 910, __pyx_L19_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 912, __pyx_L19_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -25086,7 +25115,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 910, __pyx_L19_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 912, __pyx_L19_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -25097,13 +25126,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 910, __pyx_L19_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 912, __pyx_L19_error) } else { __pyx_t_10 = __pyx_t_5(__pyx_t_11); 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, 910, __pyx_L19_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 912, __pyx_L19_error) PyErr_Clear(); } break; @@ -25119,10 +25148,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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, 910, __pyx_L19_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 912, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_10); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 910, __pyx_L19_error) + 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; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -25136,7 +25165,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_v_candidates = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":911 + /* "constraint/constraints.py":913 * 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) # <<<<<<<<<<<<<< @@ -25146,7 +25175,7 @@ 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, 911, __pyx_L1_error) + __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_8 = 1; { @@ -25155,13 +25184,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 911, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_possible_min = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":912 + /* "constraint/constraints.py":914 * 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) # <<<<<<<<<<<<<< @@ -25171,7 +25200,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 912, __pyx_L1_error) + __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_GOTREF(__pyx_t_11); __pyx_t_8 = 1; { @@ -25180,35 +25209,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 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, 912, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_possible_max = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":914 + /* "constraint/constraints.py":916 * 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, 914, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + __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_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, 914, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + __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_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":915 + /* "constraint/constraints.py":917 * * if target_value < possible_min or target_value > possible_max: * return False # <<<<<<<<<<<<<< @@ -25220,7 +25249,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":914 + /* "constraint/constraints.py":916 * possible_max = max(assigned_product * c for c in candidates) * * if target_value < possible_min or target_value > possible_max: # <<<<<<<<<<<<<< @@ -25229,17 +25258,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":917 + /* "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, 917, __pyx_L1_error) + __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":918 + /* "constraint/constraints.py":920 * * if forwardcheck: * for var in unassigned_vars: # <<<<<<<<<<<<<< @@ -25252,18 +25281,18 @@ 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, 918, __pyx_L1_error) + 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, 918, __pyx_L1_error) + 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":919 + /* "constraint/constraints.py":921 * if forwardcheck: * for var in unassigned_vars: * others = [v for v in unassigned_vars if v != var] # <<<<<<<<<<<<<< @@ -25271,7 +25300,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * 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, 919, __pyx_L41_error) + __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; @@ -25279,21 +25308,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 919, __pyx_L41_error) + 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, 919, __pyx_L41_error) + 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, 919, __pyx_L41_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 919, __pyx_L41_error) + __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, 919, __pyx_L41_error) + 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; @@ -25307,7 +25336,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_others, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "constraint/constraints.py":920 + /* "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)] # <<<<<<<<<<<<<< @@ -25315,7 +25344,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * */ { /* enter inner scope */ - __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 920, __pyx_L51_error) + __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; @@ -25323,20 +25352,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 920, __pyx_L51_error) + 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, 920, __pyx_L51_error) + 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, 920, __pyx_L51_error) + __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; { @@ -25345,13 +25374,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 920, __pyx_L51_error) + 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, 920, __pyx_L51_error) + __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; { @@ -25360,18 +25389,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 920, __pyx_L51_error) + 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, 920, __pyx_L51_error) + __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, 920, __pyx_L51_error); + 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, 920, __pyx_L51_error); + 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, 920, __pyx_L51_error) + 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; @@ -25382,7 +25411,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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, 920, __pyx_L1_error) + __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 { @@ -25391,11 +25420,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 920, __pyx_L1_error) + __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, 920, __pyx_L1_error); + 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; @@ -25403,7 +25432,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_others_bounds, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "constraint/constraints.py":921 + /* "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])] # <<<<<<<<<<<<<< @@ -25411,16 +25440,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * domain = domains[var] */ { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 921, __pyx_L58_error) + __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, 921, __pyx_L58_error) + __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, 921, __pyx_L63_error) + __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, 921, __pyx_L63_error) + __PYX_ERR(0, 923, __pyx_L63_error) } __pyx_t_12 = __pyx_v_others_bounds; __Pyx_INCREF(__pyx_t_12); __pyx_t_16 = 0; @@ -25428,13 +25457,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 921, __pyx_L63_error) + 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, 921, __pyx_L63_error) + 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; @@ -25442,7 +25471,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, 921, __pyx_L63_error) + __PYX_ERR(0, 923, __pyx_L63_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -25452,22 +25481,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_INCREF(__pyx_t_17); } else { __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 921, __pyx_L63_error) + 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, 921, __pyx_L63_error) + 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, 921, __pyx_L63_error) + __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, 921, __pyx_L63_error) + __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, 921, __pyx_L63_error) + __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); @@ -25475,7 +25504,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 921, __pyx_L63_error) + 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; @@ -25483,22 +25512,22 @@ 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, 921, __pyx_L63_error) + __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, 921, __pyx_L63_error) + __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, 921, __pyx_L63_error); + 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, 921, __pyx_L63_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_13))) __PYX_ERR(0, 921, __pyx_L63_error) + 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; @@ -25511,10 +25540,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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, 921, __pyx_L58_error) + __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, 921, __pyx_L58_error) + __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; @@ -25523,9 +25552,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 921, __pyx_L58_error) + __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, 921, __pyx_L58_error) + __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 (;;) { @@ -25534,7 +25563,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 921, __pyx_L58_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 923, __pyx_L58_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -25544,7 +25573,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 921, __pyx_L58_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 923, __pyx_L58_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -25555,13 +25584,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 921, __pyx_L58_error) + 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, 921, __pyx_L58_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 923, __pyx_L58_error) PyErr_Clear(); } break; @@ -25577,10 +25606,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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, 921, __pyx_L58_error) + 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, 921, __pyx_L58_error) + 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; @@ -25594,35 +25623,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_other_products, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "constraint/constraints.py":923 + /* "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, 923, __pyx_L1_error) + __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":924 + /* "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, 924, __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, 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, 924, __pyx_L1_error) + __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, 924, __pyx_L1_error) + __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 (;;) { @@ -25631,7 +25660,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 924, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 926, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -25641,7 +25670,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 924, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 926, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -25652,13 +25681,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error) + 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, 924, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 926, __pyx_L1_error) PyErr_Clear(); } break; @@ -25668,7 +25697,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":925 + /* "constraint/constraints.py":927 * domain = domains[var] * for value in domain[:]: * candidates = [assigned_product * value * p for p in other_products] # <<<<<<<<<<<<<< @@ -25676,7 +25705,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * domain.hideValue(value) */ { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 925, __pyx_L76_error) + __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; @@ -25684,22 +25713,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 925, __pyx_L76_error) + 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, 925, __pyx_L76_error) + 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, 925, __pyx_L76_error) + __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, 925, __pyx_L76_error) + __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, 925, __pyx_L76_error) + 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; @@ -25713,23 +25742,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_DECREF_SET(__pyx_v_candidates, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "constraint/constraints.py":926 + /* "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, 926, __pyx_L1_error) + __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, 926, __pyx_L1_error) + __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, 926, __pyx_L1_error) + __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":927 + /* "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) # <<<<<<<<<<<<<< @@ -25743,12 +25772,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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, 927, __pyx_L1_error) + 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":926 + /* "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): # <<<<<<<<<<<<<< @@ -25757,7 +25786,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":924 + /* "constraint/constraints.py":926 * * domain = domains[var] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -25767,18 +25796,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "constraint/constraints.py":928 + /* "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, 928, __pyx_L1_error) + __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":929 + /* "constraint/constraints.py":931 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -25791,7 +25820,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":928 + /* "constraint/constraints.py":930 * if all(c != target_value for c in candidates): * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -25800,7 +25829,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":918 + /* "constraint/constraints.py":920 * * if forwardcheck: * for var in unassigned_vars: # <<<<<<<<<<<<<< @@ -25810,7 +25839,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":917 + /* "constraint/constraints.py":919 * return False * * if forwardcheck: # <<<<<<<<<<<<<< @@ -25819,7 +25848,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":931 + /* "constraint/constraints.py":933 * return False * * return True # <<<<<<<<<<<<<< @@ -25831,7 +25860,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":888 + /* "constraint/constraints.py":890 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -25883,7 +25912,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":945 +/* "constraint/constraints.py":947 * """ * * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -25932,39 +25961,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, 945, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 947, __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, 945, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 947, __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, 945, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 947, __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, 945, __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, 947, __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, 945, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 947, __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, 945, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 947, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 945, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 947, __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, 945, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 947, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -25993,16 +26022,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":951 + /* "constraint/constraints.py":953 * 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, 951, __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, 953, __pyx_L1_error) - /* "constraint/constraints.py":945 + /* "constraint/constraints.py":947 * """ * * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -26022,7 +26051,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ return __pyx_r; } -/* "constraint/constraints.py":953 +/* "constraint/constraints.py":955 * self._minprod = minprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -26073,50 +26102,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, 953, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 955, __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, 953, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 955, __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, 953, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 955, __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, 953, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 955, __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, 953, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 955, __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, 953, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 955, __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, 953, __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, 955, __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, 953, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 955, __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, 953, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 955, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 953, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 955, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 953, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 955, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 953, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 955, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 953, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 955, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -26126,7 +26155,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, 953, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 955, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26137,9 +26166,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, 953, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 953, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 953, __pyx_L1_error) + 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) __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 */ @@ -26182,7 +26211,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":954 + /* "constraint/constraints.py":956 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -26190,9 +26219,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, 954, __pyx_L1_error) + __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_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, 954, __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, 956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -26212,24 +26241,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro __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_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, 954, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":957 + /* "constraint/constraints.py":959 * * # 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, 957, __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, 959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_minprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":958 + /* "constraint/constraints.py":960 * # prune the associated variables of values > minprod * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< @@ -26241,9 +26270,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, 958, __pyx_L1_error) + __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_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, 958, __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, 960, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -26251,7 +26280,7 @@ 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, 958, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 960, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -26261,7 +26290,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro { 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, 958, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 960, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -26272,13 +26301,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 958, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 960, __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, 958, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 960, __pyx_L1_error) PyErr_Clear(); } break; @@ -26288,35 +26317,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":959 + /* "constraint/constraints.py":961 * 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, 959, __pyx_L1_error) + __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_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":960 + /* "constraint/constraints.py":962 * 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, 960, __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, 962, __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, 960, __pyx_L1_error) + __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_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, 960, __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, 962, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -26325,7 +26354,7 @@ 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, 960, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 962, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -26335,7 +26364,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro { 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, 960, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 962, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -26346,13 +26375,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 960, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 962, __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, 960, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 962, __pyx_L1_error) PyErr_Clear(); } break; @@ -26362,27 +26391,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":961 + /* "constraint/constraints.py":963 * 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, 961, __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, 963, __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, 961, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 961, __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, 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_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":962 + /* "constraint/constraints.py":964 * for value in domain[:]: * if value == 0 and minprod > 0: * domain.remove(value) # <<<<<<<<<<<<<< @@ -26396,12 +26425,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro 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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 962, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":961 + /* "constraint/constraints.py":963 * domain = domains[variable] * for value in domain[:]: * if value == 0 and minprod > 0: # <<<<<<<<<<<<<< @@ -26410,7 +26439,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro */ } - /* "constraint/constraints.py":960 + /* "constraint/constraints.py":962 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -26420,7 +26449,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":958 + /* "constraint/constraints.py":960 * # prune the associated variables of values > minprod * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< @@ -26430,7 +26459,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":953 + /* "constraint/constraints.py":955 * self._minprod = minprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -26458,7 +26487,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro return __pyx_r; } -/* "constraint/constraints.py":964 +/* "constraint/constraints.py":966 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -26509,53 +26538,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, 964, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 966, __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, 964, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 966, __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, 964, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 966, __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, 964, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 966, __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, 964, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 966, __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, 964, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 966, __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, 964, __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, 966, __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, 964, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 966, __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, 964, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 966, __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, 964, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 966, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 964, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 966, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 964, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 966, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 964, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 966, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -26569,7 +26598,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, 964, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 966, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26580,8 +26609,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, 964, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 964, __pyx_L1_error) + 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) __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 */ @@ -26619,7 +26648,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":966 + /* "constraint/constraints.py":968 * 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: # <<<<<<<<<<<<<< @@ -26631,9 +26660,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, 966, __pyx_L1_error) + __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_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, 966, __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, 968, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -26641,7 +26670,7 @@ 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, 966, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 968, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -26651,7 +26680,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call { 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, 966, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 968, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -26662,13 +26691,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 966, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 968, __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, 966, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 968, __pyx_L1_error) PyErr_Clear(); } break; @@ -26678,17 +26707,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":967 + /* "constraint/constraints.py":969 * # 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, 967, __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, 969, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":968 + /* "constraint/constraints.py":970 * for variable in variables: * if variable not in assignments: * return True # <<<<<<<<<<<<<< @@ -26701,7 +26730,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":967 + /* "constraint/constraints.py":969 * # check if each variable is in the assignments * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -26710,7 +26739,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call */ } - /* "constraint/constraints.py":966 + /* "constraint/constraints.py":968 * 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: # <<<<<<<<<<<<<< @@ -26720,19 +26749,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":971 + /* "constraint/constraints.py":973 * * # 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, 971, __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, 973, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_minprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":972 + /* "constraint/constraints.py":974 * # with each variable assigned, sum the values * minprod = self._minprod * prod = 1 # <<<<<<<<<<<<<< @@ -26742,7 +26771,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":973 + /* "constraint/constraints.py":975 * minprod = self._minprod * prod = 1 * for variable in variables: # <<<<<<<<<<<<<< @@ -26754,9 +26783,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, 973, __pyx_L1_error) + __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_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, 973, __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, 975, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -26764,7 +26793,7 @@ 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, 973, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 975, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -26774,7 +26803,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call { 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, 973, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 975, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -26785,13 +26814,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 973, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 975, __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, 973, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 975, __pyx_L1_error) PyErr_Clear(); } break; @@ -26801,22 +26830,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":974 + /* "constraint/constraints.py":976 * 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, 974, __pyx_L1_error) + __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_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 974, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 976, __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":973 + /* "constraint/constraints.py":975 * minprod = self._minprod * prod = 1 * for variable in variables: # <<<<<<<<<<<<<< @@ -26826,7 +26855,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":975 + /* "constraint/constraints.py":977 * for variable in variables: * prod *= assignments[variable] * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -26836,7 +26865,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":976 + /* "constraint/constraints.py":978 * prod *= assignments[variable] * if isinstance(prod, float): * prod = round(prod, 10) # <<<<<<<<<<<<<< @@ -26852,13 +26881,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call __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_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, 976, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":975 + /* "constraint/constraints.py":977 * for variable in variables: * prod *= assignments[variable] * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -26867,7 +26896,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call */ } - /* "constraint/constraints.py":977 + /* "constraint/constraints.py":979 * if isinstance(prod, float): * prod = round(prod, 10) * return prod >= minprod # <<<<<<<<<<<<<< @@ -26875,12 +26904,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, 977, __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, 979, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":964 + /* "constraint/constraints.py":966 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -26904,7 +26933,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call return __pyx_r; } -/* "constraint/constraints.py":991 +/* "constraint/constraints.py":993 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -26953,38 +26982,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, 991, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 993, __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, 991, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 993, __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, 991, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 993, __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, 991, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 993, __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, 991, __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, 993, __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, 991, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(0, 993, __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, 991, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 993, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 991, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 993, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 991, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 993, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_target_var = ((PyObject*)values[1]); @@ -26992,7 +27021,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, 991, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 993, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27003,7 +27032,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, 991, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 993, __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 */ @@ -27031,25 +27060,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":992 + /* "constraint/constraints.py":994 * * 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, 992, __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, 994, __pyx_L1_error) - /* "constraint/constraints.py":993 + /* "constraint/constraints.py":995 * 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, 993, __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, 995, __pyx_L1_error) - /* "constraint/constraints.py":991 + /* "constraint/constraints.py":993 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -27069,7 +27098,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":995 +/* "constraint/constraints.py":997 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -27118,41 +27147,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, 995, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 997, __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, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 997, __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, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 997, __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, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 997, __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, 995, __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, 997, __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, 995, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, i); __PYX_ERR(0, 997, __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, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 997, __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, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 997, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 997, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -27164,7 +27193,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, 995, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 997, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27202,11 +27231,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; + int __pyx_t_6; PyObject *__pyx_t_7 = NULL; - size_t __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; + PyObject *__pyx_t_8 = NULL; + size_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; @@ -27217,35 +27246,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_product_bounds", 0); - /* "constraint/constraints.py":996 + /* "constraint/constraints.py":998 * * 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, 996, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":997 + /* "constraint/constraints.py":999 * 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, 997, __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, 999, __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, 997, __pyx_L1_error) + __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_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, 997, __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, 999, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -27254,7 +27283,7 @@ 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, 997, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 999, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -27264,7 +27293,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 997, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 999, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -27275,13 +27304,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 997, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __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, 997, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 999, __pyx_L1_error) PyErr_Clear(); } break; @@ -27291,28 +27320,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":998 + /* "constraint/constraints.py":1000 * 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, 998, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 998, __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, 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":999 + /* "constraint/constraints.py":1001 * for var in self.product_vars: * if var == exclude_var: * continue # <<<<<<<<<<<<<< * dom = domain_dict[var] - * bounds.append((min(dom), max(dom))) + * if not dom: */ goto __pyx_L3_continue; - /* "constraint/constraints.py":998 + /* "constraint/constraints.py":1000 * bounds = [] * for var in self.product_vars: * if var == exclude_var: # <<<<<<<<<<<<<< @@ -27321,61 +27350,90 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1000 + /* "constraint/constraints.py":1002 * if var == exclude_var: * continue * dom = domain_dict[var] # <<<<<<<<<<<<<< - * bounds.append((min(dom), max(dom))) - * + * 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, 1000, __pyx_L1_error) + __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_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1001 + /* "constraint/constraints.py":1003 * 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_6 = (!__pyx_t_5); + if (__pyx_t_6) { + + /* "constraint/constraints.py":1004 + * dom = domain_dict[var] + * if not dom: + * continue # <<<<<<<<<<<<<< + * bounds.append((min(dom), max(dom))) + * +*/ + goto __pyx_L3_continue; + + /* "constraint/constraints.py":1003 + * continue + * dom = domain_dict[var] + * if not dom: # <<<<<<<<<<<<<< + * continue + * bounds.append((min(dom), max(dom))) +*/ + } + + /* "constraint/constraints.py":1005 + * if not dom: + * continue * bounds.append((min(dom), max(dom))) # <<<<<<<<<<<<<< * * if not bounds: */ - __pyx_t_6 = NULL; + __pyx_t_7 = NULL; __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_7 = __pyx_builtin_min; - __pyx_t_8 = 1; + __pyx_t_8 = __pyx_builtin_min; + __pyx_t_9 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_dom}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __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_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error) + 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_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) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_6 = NULL; + __pyx_t_7 = NULL; __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_9 = __pyx_builtin_max; - __pyx_t_8 = 1; + __pyx_t_10 = __pyx_builtin_max; + __pyx_t_9 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_dom}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __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_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + 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); } - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1005, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1001, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 1001, __pyx_L1_error); + 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); __pyx_t_1 = 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, 1001, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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; - /* "constraint/constraints.py":997 + /* "constraint/constraints.py":999 * def _get_product_bounds(self, domain_dict, exclude_var=None): * bounds = [] * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -27386,19 +27444,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1003 + /* "constraint/constraints.py":1007 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< * return 1, 1 * */ - __pyx_t_5 = (__Pyx_PyList_GET_SIZE(__pyx_v_bounds) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_5 < 0))) __PYX_ERR(0, 1003, __pyx_L1_error) - __pyx_t_11 = (!__pyx_t_5); - if (__pyx_t_11) { + __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) + __pyx_t_5 = (!__pyx_t_6); + if (__pyx_t_5) { - /* "constraint/constraints.py":1004 + /* "constraint/constraints.py":1008 * * if not bounds: * return 1, 1 # <<<<<<<<<<<<<< @@ -27410,7 +27468,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = __pyx_mstate_global->__pyx_tuple[0]; goto __pyx_L0; - /* "constraint/constraints.py":1003 + /* "constraint/constraints.py":1007 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< @@ -27419,7 +27477,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1007 + /* "constraint/constraints.py":1011 * * # Try all corner combinations * candidates = [p for p in product(*[(lo, hi) for lo, hi in bounds])] # <<<<<<<<<<<<<< @@ -27427,34 +27485,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, 1007, __pyx_L10_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1007, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_9); + __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); { /* enter inner scope */ - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1007, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_7); + __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_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, 1007, __pyx_L15_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1011, __pyx_L16_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); ++__pyx_t_3; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1007, __pyx_L15_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_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; 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, 1007, __pyx_L15_error) + __PYX_ERR(0, 1011, __pyx_L16_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -27464,138 +27522,138 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_INCREF(__pyx_t_13); } else { __pyx_t_12 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1007, __pyx_L15_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1011, __pyx_L16_error) __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1007, __pyx_L15_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1011, __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, 1007, __pyx_L15_error) + __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1011, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1007, __pyx_L15_error) + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1011, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_13); #endif - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { Py_ssize_t index = -1; - __pyx_t_14 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1007, __pyx_L15_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1011, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_L18_unpacking_failed; + 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_L18_unpacking_failed; + 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, 1007, __pyx_L15_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 1011, __pyx_L16_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - goto __pyx_L19_unpacking_done; - __pyx_L18_unpacking_failed:; + goto __pyx_L20_unpacking_done; + __pyx_L19_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, 1007, __pyx_L15_error) - __pyx_L19_unpacking_done:; + __PYX_ERR(0, 1011, __pyx_L16_error) + __pyx_L20_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_9genexpr25__pyx_v_lo, __pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_9genexpr25__pyx_v_hi, __pyx_t_13); __pyx_t_13 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1007, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_6); + __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_6, 0, __pyx_9genexpr25__pyx_v_lo) != (0)) __PYX_ERR(0, 1007, __pyx_L15_error); + 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_6, 1, __pyx_9genexpr25__pyx_v_hi) != (0)) __PYX_ERR(0, 1007, __pyx_L15_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1007, __pyx_L15_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + 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_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; - goto __pyx_L21_exit_scope; - __pyx_L15_error:; + 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; - goto __pyx_L10_error; - __pyx_L21_exit_scope:; + goto __pyx_L11_error; + __pyx_L22_exit_scope:; } /* exit inner scope */ - __pyx_t_1 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1007, __pyx_L10_error) + __pyx_t_1 = PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); - __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, 1007, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __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_1); __pyx_t_1 = 0; - if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { - __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); + 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_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1007, __pyx_L10_error) + __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_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, 1007, __pyx_L10_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, 1011, __pyx_L11_error) } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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, 1007, __pyx_L10_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1011, __pyx_L11_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); ++__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, 1007, __pyx_L10_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1011, __pyx_L11_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3)); + __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3)); #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1007, __pyx_L10_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1011, __pyx_L11_error) } else { - __pyx_t_7 = __pyx_t_4(__pyx_t_1); - if (unlikely(!__pyx_t_7)) { + __pyx_t_8 = __pyx_t_4(__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, 1007, __pyx_L10_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1011, __pyx_L11_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_7); - __Pyx_XDECREF_SET(__pyx_9genexpr24__pyx_v_p, __pyx_t_7); - __pyx_t_7 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr24__pyx_v_p))) __PYX_ERR(0, 1007, __pyx_L10_error) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_p); __pyx_9genexpr24__pyx_v_p = 0; - goto __pyx_L23_exit_scope; - __pyx_L10_error:; + goto __pyx_L24_exit_scope; + __pyx_L11_error:; __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_p); __pyx_9genexpr24__pyx_v_p = 0; goto __pyx_L1_error; - __pyx_L23_exit_scope:; + __pyx_L24_exit_scope:; } /* exit inner scope */ __pyx_v_candidates = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1008 + /* "constraint/constraints.py":1012 * # 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] # <<<<<<<<<<<<<< @@ -27603,7 +27661,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, 1008, __pyx_L26_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1012, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_v_candidates; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; @@ -27611,41 +27669,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, 1008, __pyx_L26_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1012, __pyx_L27_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); ++__pyx_t_3; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1008, __pyx_L26_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_XDECREF_SET(__pyx_9genexpr26__pyx_v_p, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_9 = __pyx_v_self; - __Pyx_INCREF(__pyx_t_9); + 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); __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_9, __pyx_9genexpr26__pyx_v_p}; - __pyx_t_7 = __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_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1008, __pyx_L26_error) - __Pyx_GOTREF(__pyx_t_7); + 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); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1008, __pyx_L26_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + 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; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_p); __pyx_9genexpr26__pyx_v_p = 0; - goto __pyx_L30_exit_scope; - __pyx_L26_error:; + goto __pyx_L31_exit_scope; + __pyx_L27_error:; __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_p); __pyx_9genexpr26__pyx_v_p = 0; goto __pyx_L1_error; - __pyx_L30_exit_scope:; + __pyx_L31_exit_scope:; } /* exit inner scope */ __pyx_v_products = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1009 + /* "constraint/constraints.py":1013 * 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) # <<<<<<<<<<<<<< @@ -27655,41 +27713,41 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF(__pyx_r); __pyx_t_1 = NULL; __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_7 = __pyx_builtin_min; - __pyx_t_8 = 1; + __pyx_t_8 = __pyx_builtin_min; + __pyx_t_9 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_products}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_1 = NULL; __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_9 = __pyx_builtin_max; - __pyx_t_8 = 1; + __pyx_t_10 = __pyx_builtin_max; + __pyx_t_9 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_products}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1009, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __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); } - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1009, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1009, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 1009, __pyx_L1_error); + 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); __pyx_t_2 = 0; - __pyx_t_7 = 0; - __pyx_r = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_t_8 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; goto __pyx_L0; - /* "constraint/constraints.py":995 + /* "constraint/constraints.py":997 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -27701,9 +27759,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); @@ -27724,7 +27782,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1011 +/* "constraint/constraints.py":1015 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -27772,39 +27830,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, 1011, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1015, __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, 1011, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1015, __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, 1011, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1015, __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, 1011, __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, 1015, __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, 1011, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, i); __PYX_ERR(0, 1015, __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, 1011, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1015, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1011, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1015, __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, 1011, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1015, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27839,7 +27897,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_safe_product", 0); - /* "constraint/constraints.py":1012 + /* "constraint/constraints.py":1016 * * def _safe_product(self, values): * prod = 1 # <<<<<<<<<<<<<< @@ -27849,7 +27907,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":1013 + /* "constraint/constraints.py":1017 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -27861,9 +27919,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, 1013, __pyx_L1_error) + __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_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, 1013, __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, 1017, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -27871,7 +27929,7 @@ 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, 1013, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1017, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -27881,7 +27939,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1013, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1017, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -27892,13 +27950,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1013, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1017, __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, 1013, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1017, __pyx_L1_error) PyErr_Clear(); } break; @@ -27908,19 +27966,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1014 + /* "constraint/constraints.py":1018 * 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, 1014, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1013 + /* "constraint/constraints.py":1017 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -27930,7 +27988,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1015 + /* "constraint/constraints.py":1019 * for v in values: * prod *= v * return prod # <<<<<<<<<<<<<< @@ -27942,7 +28000,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = __pyx_v_prod; goto __pyx_L0; - /* "constraint/constraints.py":1011 + /* "constraint/constraints.py":1015 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -27964,7 +28022,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1017 +/* "constraint/constraints.py":1021 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -28015,50 +28073,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, 1017, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1021, __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, 1017, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1021, __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, 1017, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1021, __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, 1017, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1021, __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, 1017, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1021, __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, 1017, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1021, __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, 1017, __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, 1021, __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, 1017, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1021, __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, 1017, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1021, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1017, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1021, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1017, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1021, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1017, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1021, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1017, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1021, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -28068,7 +28126,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, 1017, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1021, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -28079,9 +28137,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, 1017, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1017, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1017, __pyx_L1_error) + 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) __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 */ @@ -28129,7 +28187,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1018 + /* "constraint/constraints.py":1022 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -28137,9 +28195,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, 1018, __pyx_L1_error) + __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_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, 1018, __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, 1022, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -28159,27 +28217,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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_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, 1018, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1022, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1019 + /* "constraint/constraints.py":1023 * 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, 1019, __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, 1023, __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, 1019, __pyx_L1_error) + __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_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":1020 + /* "constraint/constraints.py":1024 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * target_dom = domains[self.target_var] * t_min = min(target_dom) # <<<<<<<<<<<<<< @@ -28195,29 +28253,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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_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, 1020, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_t_min = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/constraints.py":1022 + /* "constraint/constraints.py":1026 * 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, 1022, __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, 1026, __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_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, 1022, __pyx_L1_error) + __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, 1022, __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, 1026, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -28226,7 +28284,7 @@ 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, 1022, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1026, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -28236,7 +28294,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1022, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1026, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -28247,13 +28305,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1022, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1026, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_7(__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, 1022, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1026, __pyx_L1_error) PyErr_Clear(); } break; @@ -28263,7 +28321,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1023 + /* "constraint/constraints.py":1027 * * for var in self.product_vars: * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) # <<<<<<<<<<<<<< @@ -28275,13 +28333,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1023, __pyx_L1_error) + __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1027, __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, 1023, __pyx_L1_error) + 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; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1023, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { @@ -28290,7 +28348,7 @@ 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, 1023, __pyx_L1_error) + __PYX_ERR(0, 1027, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -28300,22 +28358,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1023, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1023, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1023, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1023, __pyx_L1_error) + __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); #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, 1023, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1027, __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); @@ -28323,7 +28381,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1023, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 1027, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -28331,7 +28389,7 @@ 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, 1023, __pyx_L1_error) + __PYX_ERR(0, 1027, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_min_others, __pyx_t_3); @@ -28339,35 +28397,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_max_others, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1024 + /* "constraint/constraints.py":1028 * 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, 1024, __pyx_L1_error) + __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_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1025 + /* "constraint/constraints.py":1029 * 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, 1025, __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, 1029, __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_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, 1025, __pyx_L1_error) + __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, 1025, __pyx_L1_error) + __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -28376,7 +28434,7 @@ 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, 1025, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1029, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -28386,7 +28444,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1025, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1029, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -28397,13 +28455,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_10; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1025, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1029, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_11(__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, 1025, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1029, __pyx_L1_error) PyErr_Clear(); } break; @@ -28413,29 +28471,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1026 + /* "constraint/constraints.py":1030 * 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, 1026, __pyx_L1_error) + __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_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Multiply(__pyx_v_val, __pyx_v_max_others); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1026, __pyx_L1_error) + __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_GOTREF(__pyx_t_3); - __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1026, __pyx_L1_error) + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1030, __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, 1026, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 1030, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1026, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1030, __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":1027 + /* "constraint/constraints.py":1031 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if max(possible_prods) < t_min: # <<<<<<<<<<<<<< @@ -28451,16 +28509,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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_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, 1027, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1031, __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, 1027, __pyx_L1_error) + __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_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, 1027, __pyx_L1_error) + __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; if (__pyx_t_12) { - /* "constraint/constraints.py":1028 + /* "constraint/constraints.py":1032 * possible_prods = [val * min_others, val * max_others] * if max(possible_prods) < t_min: * dom.remove(val) # <<<<<<<<<<<<<< @@ -28474,12 +28532,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1028, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1027 + /* "constraint/constraints.py":1031 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if max(possible_prods) < t_min: # <<<<<<<<<<<<<< @@ -28488,7 +28546,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1025 + /* "constraint/constraints.py":1029 * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) * dom = domains[var] * for val in dom[:]: # <<<<<<<<<<<<<< @@ -28498,7 +28556,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1022 + /* "constraint/constraints.py":1026 * t_min = min(target_dom) * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -28508,7 +28566,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1017 + /* "constraint/constraints.py":1021 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -28541,7 +28599,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1030 +/* "constraint/constraints.py":1034 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -28592,53 +28650,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, 1030, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1034, __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, 1030, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1034, __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, 1030, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1034, __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, 1030, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1034, __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, 1030, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1034, __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, 1030, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1034, __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, 1030, __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, 1034, __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, 1030, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1034, __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, 1030, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1034, __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, 1030, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1034, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1030, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1034, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1030, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1034, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1030, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1034, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -28652,7 +28710,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, 1030, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1034, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -28663,8 +28721,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, 1030, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1030, __pyx_L1_error) + 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) __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 */ @@ -28685,7 +28743,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint_8__call___2generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":1066 +/* "constraint/constraints.py":1070 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p < target_value for p in prods): # <<<<<<<<<<<<<< @@ -28705,7 +28763,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1066, __pyx_L1_error) + __PYX_ERR(0, 1070, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -28716,7 +28774,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1066, __pyx_L1_error) + __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_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -28753,29 +28811,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1066, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1066, __pyx_L1_error) } + 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) } __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, 1066, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1070, __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, 1066, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1070, __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, 1066, __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, 1066, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = (!__pyx_t_4); if (__pyx_t_5) { @@ -28815,7 +28873,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1030 +/* "constraint/constraints.py":1034 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -28877,25 +28935,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__ *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1030, __pyx_L1_error) + __PYX_ERR(0, 1034, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/constraints.py":1031 + /* "constraint/constraints.py":1035 * * 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, 1031, __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, 1035, __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, 1031, __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, 1035, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":1032 + /* "constraint/constraints.py":1036 * 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 # <<<<<<<<<<<<<< @@ -28907,7 +28965,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1031 + /* "constraint/constraints.py":1035 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -28916,23 +28974,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1034 + /* "constraint/constraints.py":1038 * 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, 1034, __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, 1038, __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, 1034, __pyx_L1_error) + __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_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":1035 + /* "constraint/constraints.py":1039 * * target_value = assignments[self.target_var] * assigned_prod = 1 # <<<<<<<<<<<<<< @@ -28942,35 +29000,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":1036 + /* "constraint/constraints.py":1040 * 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, 1036, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_unassigned = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1038 + /* "constraint/constraints.py":1042 * 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, 1038, __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, 1042, __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, 1038, __pyx_L1_error) + __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_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, 1038, __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, 1042, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -28979,7 +29037,7 @@ 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, 1038, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1042, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -28989,7 +29047,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1038, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1042, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -29000,13 +29058,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1038, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1042, __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, 1038, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1042, __pyx_L1_error) PyErr_Clear(); } break; @@ -29016,32 +29074,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1039 + /* "constraint/constraints.py":1043 * * 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, 1039, __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, 1043, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":1040 + /* "constraint/constraints.py":1044 * 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, 1040, __pyx_L1_error) + __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_GOTREF(__pyx_t_3); - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_assigned_prod, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1040, __pyx_L1_error) + __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_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":1039 + /* "constraint/constraints.py":1043 * * for var in self.product_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -29051,7 +29109,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint goto __pyx_L6; } - /* "constraint/constraints.py":1042 + /* "constraint/constraints.py":1046 * assigned_prod *= assignments[var] * else: * unassigned.append(var) # <<<<<<<<<<<<<< @@ -29059,11 +29117,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, 1042, __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, 1046, __pyx_L1_error) } __pyx_L6:; - /* "constraint/constraints.py":1038 + /* "constraint/constraints.py":1042 * unassigned = [] * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -29073,7 +29131,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1044 + /* "constraint/constraints.py":1048 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< @@ -29081,11 +29139,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * */ __pyx_t_2 = (__Pyx_PyList_GET_SIZE(__pyx_v_unassigned) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 1044, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 1048, __pyx_L1_error) __pyx_t_8 = (!__pyx_t_2); if (__pyx_t_8) { - /* "constraint/constraints.py":1045 + /* "constraint/constraints.py":1049 * * if not unassigned: * return assigned_prod >= target_value # <<<<<<<<<<<<<< @@ -29093,12 +29151,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, 1045, __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, 1049, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1044 + /* "constraint/constraints.py":1048 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< @@ -29107,7 +29165,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1048 + /* "constraint/constraints.py":1052 * * # Estimate min possible value of full product * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned] # <<<<<<<<<<<<<< @@ -29115,7 +29173,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, 1048, __pyx_L11_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1052, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0; @@ -29123,20 +29181,20 @@ 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, 1048, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1052, __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_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1048, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1052, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_9genexpr27__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, 1048, __pyx_L11_error) + __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; { @@ -29145,13 +29203,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1048, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1052, __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, 1048, __pyx_L11_error) + __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; { @@ -29160,18 +29218,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1048, __pyx_L11_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1052, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); } - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1048, __pyx_L11_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1052, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1048, __pyx_L11_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1052, __pyx_L11_error); __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1048, __pyx_L11_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1052, __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, 1048, __pyx_L11_error) + 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; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -29185,7 +29243,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_v_domain_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1049 + /* "constraint/constraints.py":1053 * # 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])] # <<<<<<<<<<<<<< @@ -29193,12 +29251,12 @@ 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, 1049, __pyx_L18_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1053, __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, 1049, __pyx_L18_error) + __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_GOTREF(__pyx_t_6); { /* enter inner scope */ - __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1049, __pyx_L23_error) + __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_10 = __pyx_v_domain_bounds; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; @@ -29206,13 +29264,13 @@ 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, 1049, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1053, __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_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1049, __pyx_L23_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1053, __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; @@ -29220,7 +29278,7 @@ 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, 1049, __pyx_L23_error) + __PYX_ERR(0, 1053, __pyx_L23_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -29230,22 +29288,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_INCREF(__pyx_t_11); } else { __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1049, __pyx_L23_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1053, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_13); __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1049, __pyx_L23_error) + 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, 1049, __pyx_L23_error) + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1053, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1049, __pyx_L23_error) + __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, 1049, __pyx_L23_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1053, __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); @@ -29253,7 +29311,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1049, __pyx_L23_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 1053, __pyx_L23_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L27_unpacking_done; @@ -29261,22 +29319,22 @@ 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, 1049, __pyx_L23_error) + __PYX_ERR(0, 1053, __pyx_L23_error) __pyx_L27_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_9genexpr29__pyx_v_lo, __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, 1049, __pyx_L23_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1053, __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, 1049, __pyx_L23_error); + 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, 1049, __pyx_L23_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1049, __pyx_L23_error) + 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -29289,10 +29347,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint 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, 1049, __pyx_L18_error) + __pyx_t_10 = PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1053, __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, 1049, __pyx_L18_error) + __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_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -29301,9 +29359,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1049, __pyx_L18_error) + __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_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, 1049, __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, 1053, __pyx_L18_error) } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; for (;;) { @@ -29312,7 +29370,7 @@ 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, 1049, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1053, __pyx_L18_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -29322,7 +29380,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1049, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1053, __pyx_L18_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -29333,13 +29391,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1049, __pyx_L18_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1053, __pyx_L18_error) } else { __pyx_t_9 = __pyx_t_5(__pyx_t_10); 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, 1049, __pyx_L18_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1053, __pyx_L18_error) PyErr_Clear(); } break; @@ -29355,10 +29413,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint 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)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1049, __pyx_L18_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1053, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_9); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1049, __pyx_L18_error) + 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; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -29372,7 +29430,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_v_candidates = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1050 + /* "constraint/constraints.py":1054 * 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] # <<<<<<<<<<<<<< @@ -29380,7 +29438,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, 1050, __pyx_L34_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __pyx_v_candidates; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; @@ -29388,19 +29446,19 @@ 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, 1050, __pyx_L34_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1054, __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_4; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1050, __pyx_L34_error) + 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, 1050, __pyx_L34_error) + __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, 1050, __pyx_L34_error) + 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; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -29414,7 +29472,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_v_possible_prods = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1051 + /* "constraint/constraints.py":1055 * 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: # <<<<<<<<<<<<<< @@ -29430,16 +29488,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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_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, 1051, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __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, 1051, __pyx_L1_error) + __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_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, 1051, __pyx_L1_error) + __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; if (__pyx_t_8) { - /* "constraint/constraints.py":1052 + /* "constraint/constraints.py":1056 * possible_prods = [assigned_prod * c for c in candidates] * if max(possible_prods) < target_value: * return False # <<<<<<<<<<<<<< @@ -29451,7 +29509,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1051 + /* "constraint/constraints.py":1055 * 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: # <<<<<<<<<<<<<< @@ -29460,17 +29518,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1054 + /* "constraint/constraints.py":1058 * 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, 1054, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1058, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1055 + /* "constraint/constraints.py":1059 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< @@ -29483,18 +29541,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1055, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1059, __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_4; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1056 + /* "constraint/constraints.py":1060 * if forwardcheck: * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] # <<<<<<<<<<<<<< @@ -29502,7 +29560,7 @@ 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, 1056, __pyx_L45_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1060, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_10); __pyx_t_16 = 0; @@ -29510,21 +29568,21 @@ 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, 1056, __pyx_L45_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1060, __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_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1056, __pyx_L45_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1060, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_9genexpr31__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, 1056, __pyx_L45_error) - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1056, __pyx_L45_error) + __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_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, 1056, __pyx_L45_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr31__pyx_v_v))) __PYX_ERR(0, 1060, __pyx_L45_error) } } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -29538,7 +29596,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_other_unassigned, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1057 + /* "constraint/constraints.py":1061 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< @@ -29546,10 +29604,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * 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, 1057, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_8 < 0))) __PYX_ERR(0, 1061, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1058 + /* "constraint/constraints.py":1062 * 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] # <<<<<<<<<<<<<< @@ -29557,7 +29615,7 @@ 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, 1058, __pyx_L54_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1062, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __pyx_v_other_unassigned; __Pyx_INCREF(__pyx_t_10); __pyx_t_16 = 0; @@ -29565,20 +29623,20 @@ 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, 1058, __pyx_L54_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1062, __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_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1058, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1062, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_9genexpr32__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, 1058, __pyx_L54_error) + __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_GOTREF(__pyx_t_13); __pyx_t_12 = 1; { @@ -29587,13 +29645,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1058, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1062, __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, 1058, __pyx_L54_error) + __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; { @@ -29602,18 +29660,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1058, __pyx_L54_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1062, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1058, __pyx_L54_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1062, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1058, __pyx_L54_error); + 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, 1058, __pyx_L54_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 1062, __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, 1058, __pyx_L54_error) + 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_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -29627,7 +29685,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_bounds, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1059 + /* "constraint/constraints.py":1063 * 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])] # <<<<<<<<<<<<<< @@ -29635,12 +29693,12 @@ 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, 1059, __pyx_L61_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1063, __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, 1059, __pyx_L61_error) + __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); { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1059, __pyx_L66_error) + __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_16 = 0; @@ -29648,13 +29706,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1059, __pyx_L66_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1063, __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_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1059, __pyx_L66_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1063, __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; @@ -29662,7 +29720,7 @@ 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, 1059, __pyx_L66_error) + __PYX_ERR(0, 1063, __pyx_L66_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -29672,22 +29730,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_INCREF(__pyx_t_13); } else { __pyx_t_14 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1059, __pyx_L66_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1063, __pyx_L66_error) __Pyx_XGOTREF(__pyx_t_14); __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1059, __pyx_L66_error) + 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, 1059, __pyx_L66_error) + __pyx_t_14 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1063, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1059, __pyx_L66_error) + __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, 1059, __pyx_L66_error) + __pyx_t_17 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1063, __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); @@ -29695,7 +29753,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1059, __pyx_L66_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_17), 2) < 0) __PYX_ERR(0, 1063, __pyx_L66_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; goto __pyx_L70_unpacking_done; @@ -29703,22 +29761,22 @@ 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, 1059, __pyx_L66_error) + __PYX_ERR(0, 1063, __pyx_L66_error) __pyx_L70_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_9genexpr34__pyx_v_lo, __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, 1059, __pyx_L66_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1063, __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, 1059, __pyx_L66_error); + 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, 1059, __pyx_L66_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1059, __pyx_L66_error) + 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_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -29731,10 +29789,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint 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, 1059, __pyx_L61_error) + __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, 1059, __pyx_L61_error) + __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; @@ -29743,9 +29801,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1059, __pyx_L61_error) + __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, 1059, __pyx_L61_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, 1063, __pyx_L61_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -29754,7 +29812,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1059, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1063, __pyx_L61_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -29764,7 +29822,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1059, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1063, __pyx_L61_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -29775,13 +29833,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1059, __pyx_L61_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L61_error) } else { __pyx_t_3 = __pyx_t_5(__pyx_t_11); 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, 1059, __pyx_L61_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1063, __pyx_L61_error) PyErr_Clear(); } break; @@ -29797,10 +29855,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint 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, 1059, __pyx_L61_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_3); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1059, __pyx_L61_error) + 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; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -29814,7 +29872,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_other_products, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1057 + /* "constraint/constraints.py":1061 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< @@ -29824,7 +29882,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint goto __pyx_L51; } - /* "constraint/constraints.py":1061 + /* "constraint/constraints.py":1065 * other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in bounds])] * else: * other_products = [1] # <<<<<<<<<<<<<< @@ -29832,45 +29890,45 @@ 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, 1061, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1065, __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, 1061, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 1065, __pyx_L1_error); __Pyx_XDECREF_SET(__pyx_v_other_products, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; } __pyx_L51:; - /* "constraint/constraints.py":1063 + /* "constraint/constraints.py":1067 * 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, 1063, __pyx_L1_error) + __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_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1064 + /* "constraint/constraints.py":1068 * * 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, 1064, __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, 1068, __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_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, 1064, __pyx_L1_error) + __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, 1064, __pyx_L1_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, 1068, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -29879,7 +29937,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1064, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1068, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -29889,7 +29947,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1064, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1068, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -29900,13 +29958,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1064, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_5(__pyx_t_11); 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, 1064, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1068, __pyx_L1_error) PyErr_Clear(); } break; @@ -29916,7 +29974,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1065 + /* "constraint/constraints.py":1069 * domain = domains[var] * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] # <<<<<<<<<<<<<< @@ -29924,7 +29982,7 @@ 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, 1065, __pyx_L79_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1069, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_v_other_products; __Pyx_INCREF(__pyx_t_3); __pyx_t_18 = 0; @@ -29932,22 +29990,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1065, __pyx_L79_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1069, __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_18; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1065, __pyx_L79_error) + 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, 1065, __pyx_L79_error) + __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, 1065, __pyx_L79_error) + __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) __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, 1065, __pyx_L79_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1069, __pyx_L79_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -29961,23 +30019,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_prods, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1066 + /* "constraint/constraints.py":1070 * 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, 1066, __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, 1070, __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, 1066, __pyx_L1_error) + __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_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, 1066, __pyx_L1_error) + __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; if (__pyx_t_8) { - /* "constraint/constraints.py":1067 + /* "constraint/constraints.py":1071 * prods = [assigned_prod * val * o for o in other_products] * if all(p < target_value for p in prods): * domain.hideValue(val) # <<<<<<<<<<<<<< @@ -29991,12 +30049,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint 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_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1067, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1066 + /* "constraint/constraints.py":1070 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p < target_value for p in prods): # <<<<<<<<<<<<<< @@ -30005,7 +30063,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1064 + /* "constraint/constraints.py":1068 * * domain = domains[var] * for val in domain[:]: # <<<<<<<<<<<<<< @@ -30015,18 +30073,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "constraint/constraints.py":1068 + /* "constraint/constraints.py":1072 * 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, 1068, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1072, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_8); if (__pyx_t_2) { - /* "constraint/constraints.py":1069 + /* "constraint/constraints.py":1073 * domain.hideValue(val) * if not domain: * return False # <<<<<<<<<<<<<< @@ -30039,7 +30097,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1068 + /* "constraint/constraints.py":1072 * if all(p < target_value for p in prods): * domain.hideValue(val) * if not domain: # <<<<<<<<<<<<<< @@ -30048,7 +30106,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1055 + /* "constraint/constraints.py":1059 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< @@ -30058,7 +30116,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":1054 + /* "constraint/constraints.py":1058 * return False * * if forwardcheck: # <<<<<<<<<<<<<< @@ -30067,7 +30125,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1071 + /* "constraint/constraints.py":1075 * return False * * return True # <<<<<<<<<<<<<< @@ -30079,7 +30137,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1030 + /* "constraint/constraints.py":1034 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -30131,7 +30189,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1085 +/* "constraint/constraints.py":1089 * """ * * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -30180,39 +30238,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, 1085, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1089, __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, 1085, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1089, __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, 1085, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1089, __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, 1085, __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, 1089, __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, 1085, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1089, __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, 1085, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1089, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1085, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1089, __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, 1085, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1089, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -30241,16 +30299,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1091 + /* "constraint/constraints.py":1095 * maxprod: Value to be considered as the maximum product * """ * self._maxprod = maxprod # <<<<<<<<<<<<<< * * 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, 1091, __pyx_L1_error) + 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) - /* "constraint/constraints.py":1085 + /* "constraint/constraints.py":1089 * """ * * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -30270,7 +30328,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ return __pyx_r; } -/* "constraint/constraints.py":1093 +/* "constraint/constraints.py":1097 * self._maxprod = maxprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -30321,50 +30379,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, 1093, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1097, __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, 1093, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1097, __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, 1093, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1097, __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, 1093, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1097, __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, 1093, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1097, __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, 1093, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1097, __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, 1093, __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, 1097, __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, 1093, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1097, __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, 1093, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1097, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1093, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1097, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1093, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1097, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1093, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1097, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1093, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1097, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -30374,7 +30432,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, 1093, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1097, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -30385,9 +30443,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, 1093, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1093, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1093, __pyx_L1_error) + 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) __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 */ @@ -30408,7 +30466,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":1100 +/* "constraint/constraints.py":1104 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -30428,7 +30486,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_10prePr 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, 1100, __pyx_L1_error) + __PYX_ERR(0, 1104, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -30436,7 +30494,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, 1100, __pyx_L1_error) + __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_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -30473,16 +30531,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1100, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1100, __pyx_L1_error) } + 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 (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, 1100, __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, 1104, __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, 1100, __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, 1104, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -30490,7 +30548,7 @@ 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, 1100, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1104, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -30500,7 +30558,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr { 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, 1100, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1104, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -30511,13 +30569,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1100, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1104, __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, 1100, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1104, __pyx_L1_error) PyErr_Clear(); } break; @@ -30528,8 +30586,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, 1100, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1100, __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, 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_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_XDECREF(__pyx_r); @@ -30568,7 +30626,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr return __pyx_r; } -/* "constraint/constraints.py":1093 +/* "constraint/constraints.py":1097 * self._maxprod = maxprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -30605,7 +30663,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1094 + /* "constraint/constraints.py":1098 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -30613,9 +30671,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, 1094, __pyx_L1_error) + __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_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, 1094, __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, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -30635,24 +30693,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __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_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, 1094, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1097 + /* "constraint/constraints.py":1101 * * # 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, 1097, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1101, __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, 1097, __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, 1101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1098 + /* "constraint/constraints.py":1102 * # check if there are any values less than 1 in the associated variables * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None # <<<<<<<<<<<<<< @@ -30662,7 +30720,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_INCREF(Py_None); __pyx_v_variable_with_lt1 = Py_None; - /* "constraint/constraints.py":1099 + /* "constraint/constraints.py":1103 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -30674,9 +30732,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, 1099, __pyx_L1_error) + __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_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, 1099, __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, 1103, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -30684,7 +30742,7 @@ 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, 1099, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1103, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -30694,7 +30752,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 1099, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1103, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -30705,13 +30763,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1099, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1103, __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, 1099, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1103, __pyx_L1_error) PyErr_Clear(); } break; @@ -30721,37 +30779,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":1100 + /* "constraint/constraints.py":1104 * 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, 1100, __pyx_L1_error) + __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_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, 1100, __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, 1104, __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, 1100, __pyx_L1_error) + __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1104, __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":1101 + /* "constraint/constraints.py":1105 * 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, 1101, __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, 1105, __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, 1101, __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, 1105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1099 + /* "constraint/constraints.py":1103 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -30761,7 +30819,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1102 + /* "constraint/constraints.py":1106 * 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): # <<<<<<<<<<<<<< @@ -30771,7 +30829,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __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, 1102, __pyx_L1_error) + __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_5 = 1; { @@ -30780,7 +30838,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __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, 1102, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -30788,9 +30846,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, 1102, __pyx_L1_error) + __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_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, 1102, __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, 1106, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -30799,7 +30857,7 @@ 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, 1102, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1106, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -30809,7 +30867,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 1102, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1106, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -30820,13 +30878,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1106, __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, 1102, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1106, __pyx_L1_error) PyErr_Clear(); } break; @@ -30839,7 +30897,7 @@ 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, 1102, __pyx_L1_error) + __PYX_ERR(0, 1106, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -30849,22 +30907,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1102, __pyx_L1_error) + 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, 1102, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1106, __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, 1102, __pyx_L1_error) + __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, 1102, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1106, __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, 1102, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1106, __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); @@ -30872,7 +30930,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __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; __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1102, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1106, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_unpacking_done; @@ -30880,7 +30938,7 @@ 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, 1102, __pyx_L1_error) + __PYX_ERR(0, 1106, __pyx_L1_error) __pyx_L9_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); @@ -30888,7 +30946,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1103 + /* "constraint/constraints.py":1107 * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: # <<<<<<<<<<<<<< @@ -30898,7 +30956,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":1104 + /* "constraint/constraints.py":1108 * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< @@ -30908,7 +30966,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":1106 + /* "constraint/constraints.py":1110 * if variable_with_lt1 is not None: * # if more than one associated variables contain less than 1, we can't prune * return # <<<<<<<<<<<<<< @@ -30920,7 +30978,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1104 + /* "constraint/constraints.py":1108 * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< @@ -30929,7 +30987,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":1107 + /* "constraint/constraints.py":1111 * # if more than one associated variables contain less than 1, we can't prune * return * variable_with_lt1 = variable # <<<<<<<<<<<<<< @@ -30939,7 +30997,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":1103 + /* "constraint/constraints.py":1107 * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: # <<<<<<<<<<<<<< @@ -30948,7 +31006,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":1102 + /* "constraint/constraints.py":1106 * 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): # <<<<<<<<<<<<<< @@ -30958,19 +31016,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1110 + /* "constraint/constraints.py":1114 * * # 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, 1110, __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, 1114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_maxprod = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/constraints.py":1111 + /* "constraint/constraints.py":1115 * # prune the associated variables of values > maxprod * maxprod = self._maxprod * for variable in variables: # <<<<<<<<<<<<<< @@ -30982,9 +31040,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, 1111, __pyx_L1_error) + __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_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, 1111, __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, 1115, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -30992,7 +31050,7 @@ 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, 1111, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1115, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -31002,7 +31060,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 1111, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1115, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -31013,13 +31071,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1111, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1115, __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, 1111, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1115, __pyx_L1_error) PyErr_Clear(); } break; @@ -31029,7 +31087,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":1112 + /* "constraint/constraints.py":1116 * maxprod = self._maxprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -31042,14 +31100,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, 1112, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1112, __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, 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_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":1113 + /* "constraint/constraints.py":1117 * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: * continue # <<<<<<<<<<<<<< @@ -31058,7 +31116,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ goto __pyx_L13_continue; - /* "constraint/constraints.py":1112 + /* "constraint/constraints.py":1116 * maxprod = self._maxprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -31067,35 +31125,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":1114 + /* "constraint/constraints.py":1118 * 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, 1114, __pyx_L1_error) + __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_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1115 + /* "constraint/constraints.py":1119 * 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, 1115, __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, 1119, __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_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, 1115, __pyx_L1_error) + __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, 1115, __pyx_L1_error) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -31104,7 +31162,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 1115, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1119, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -31114,7 +31172,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 1115, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1119, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -31125,13 +31183,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_13; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1115, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1119, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_14(__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, 1115, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1119, __pyx_L1_error) PyErr_Clear(); } break; @@ -31141,19 +31199,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1116 + /* "constraint/constraints.py":1120 * 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, 1116, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1116, __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, 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { - /* "constraint/constraints.py":1117 + /* "constraint/constraints.py":1121 * for value in domain[:]: * if value > maxprod: * domain.remove(value) # <<<<<<<<<<<<<< @@ -31167,12 +31225,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro 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, 1117, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1116 + /* "constraint/constraints.py":1120 * domain = domains[variable] * for value in domain[:]: * if value > maxprod: # <<<<<<<<<<<<<< @@ -31182,27 +31240,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro goto __pyx_L20; } - /* "constraint/constraints.py":1118 + /* "constraint/constraints.py":1122 * 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, 1118, __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, 1122, __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, 1118, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1118, __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, 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_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":1119 + /* "constraint/constraints.py":1123 * domain.remove(value) * elif value == 0 and maxprod < 0: * domain.remove(value) # <<<<<<<<<<<<<< @@ -31216,12 +31274,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro 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, 1119, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1118 + /* "constraint/constraints.py":1122 * if value > maxprod: * domain.remove(value) * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< @@ -31231,7 +31289,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __pyx_L20:; - /* "constraint/constraints.py":1115 + /* "constraint/constraints.py":1119 * continue * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -31241,7 +31299,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1111 + /* "constraint/constraints.py":1115 * # prune the associated variables of values > maxprod * maxprod = self._maxprod * for variable in variables: # <<<<<<<<<<<<<< @@ -31252,7 +31310,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1093 + /* "constraint/constraints.py":1097 * self._maxprod = maxprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -31284,7 +31342,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro return __pyx_r; } -/* "constraint/constraints.py":1121 +/* "constraint/constraints.py":1125 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -31335,53 +31393,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, 1121, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1125, __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, 1121, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1125, __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, 1121, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1125, __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, 1121, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1125, __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, 1121, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1125, __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, 1121, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1125, __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, 1121, __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, 1125, __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, 1121, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1125, __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, 1121, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1125, __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, 1121, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1125, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1121, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1125, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1121, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1125, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1121, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1125, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -31395,7 +31453,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, 1121, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1125, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -31406,8 +31464,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, 1121, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1121, __pyx_L1_error) + 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) __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 */ @@ -31457,19 +31515,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1122 + /* "constraint/constraints.py":1126 * * 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, 1122, __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, 1126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_maxprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1123 + /* "constraint/constraints.py":1127 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * maxprod = self._maxprod * prod = 1 # <<<<<<<<<<<<<< @@ -31479,7 +31537,7 @@ 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":1124 + /* "constraint/constraints.py":1128 * maxprod = self._maxprod * prod = 1 * missing = False # <<<<<<<<<<<<<< @@ -31488,19 +31546,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ __pyx_v_missing = 0; - /* "constraint/constraints.py":1125 + /* "constraint/constraints.py":1129 * prod = 1 * missing = False * missing_lt1 = [] # <<<<<<<<<<<<<< * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if variable in assignments: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_missing_lt1 = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1126 + /* "constraint/constraints.py":1130 * missing = False * missing_lt1 = [] * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< @@ -31510,7 +31568,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __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, 1126, __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, 1130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; { @@ -31519,7 +31577,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __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, 1126, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -31527,9 +31585,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1126, __pyx_L1_error) + __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, 1126, __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, 1130, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -31538,7 +31596,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 1126, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1130, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -31548,7 +31606,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 1126, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1130, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -31559,13 +31617,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1126, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1130, __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, 1126, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1130, __pyx_L1_error) PyErr_Clear(); } break; @@ -31578,7 +31636,7 @@ 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, 1126, __pyx_L1_error) + __PYX_ERR(0, 1130, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -31588,22 +31646,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1126, __pyx_L1_error) + 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, 1126, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1130, __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, 1126, __pyx_L1_error) + __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, 1126, __pyx_L1_error) + __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); #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, 1126, __pyx_L1_error) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); @@ -31611,7 +31669,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __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, 1126, __pyx_L1_error) + 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; @@ -31619,7 +31677,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1126, __pyx_L1_error) + __PYX_ERR(0, 1130, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); @@ -31627,32 +31685,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1127 + /* "constraint/constraints.py":1131 * missing_lt1 = [] * 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, 1127, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":1128 + /* "constraint/constraints.py":1132 * 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, 1128, __pyx_L1_error) + __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_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1128, __pyx_L1_error) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1127 + /* "constraint/constraints.py":1131 * missing_lt1 = [] * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if variable in assignments: # <<<<<<<<<<<<<< @@ -31662,7 +31720,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call goto __pyx_L7; } - /* "constraint/constraints.py":1130 + /* "constraint/constraints.py":1134 * prod *= assignments[variable] * else: * missing = True # <<<<<<<<<<<<<< @@ -31672,26 +31730,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call /*else*/ { __pyx_v_missing = 1; - /* "constraint/constraints.py":1131 + /* "constraint/constraints.py":1135 * 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, 1131, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":1132 + /* "constraint/constraints.py":1136 * 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, 1132, __pyx_L1_error) + __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) - /* "constraint/constraints.py":1131 + /* "constraint/constraints.py":1135 * else: * missing = True * if contains_lt1: # <<<<<<<<<<<<<< @@ -31702,7 +31760,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } __pyx_L7:; - /* "constraint/constraints.py":1126 + /* "constraint/constraints.py":1130 * missing = False * missing_lt1 = [] * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< @@ -31712,7 +31770,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1133 + /* "constraint/constraints.py":1137 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -31722,7 +31780,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_t_10 = PyFloat_Check(__pyx_v_prod); if (__pyx_t_10) { - /* "constraint/constraints.py":1134 + /* "constraint/constraints.py":1138 * missing_lt1.append(variable) * if isinstance(prod, float): * prod = round(prod, 10) # <<<<<<<<<<<<<< @@ -31738,13 +31796,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __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, 1134, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1133 + /* "constraint/constraints.py":1137 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -31753,7 +31811,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1135 + /* "constraint/constraints.py":1139 * if isinstance(prod, float): * prod = round(prod, 10) * if (not missing or len(missing_lt1) == 0) and prod > maxprod: # <<<<<<<<<<<<<< @@ -31765,7 +31823,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } else { goto __pyx_L13_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, 1135, __pyx_L1_error) + __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) { } else { @@ -31773,14 +31831,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call goto __pyx_L12_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, 1135, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1135, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":1136 + /* "constraint/constraints.py":1140 * prod = round(prod, 10) * if (not missing or len(missing_lt1) == 0) and prod > maxprod: * return False # <<<<<<<<<<<<<< @@ -31792,7 +31850,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1135 + /* "constraint/constraints.py":1139 * if isinstance(prod, float): * prod = round(prod, 10) * if (not missing or len(missing_lt1) == 0) and prod > maxprod: # <<<<<<<<<<<<<< @@ -31801,17 +31859,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1137 + /* "constraint/constraints.py":1141 * 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, 1137, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":1138 + /* "constraint/constraints.py":1142 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -31823,9 +31881,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1138, __pyx_L1_error) + __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, 1138, __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, 1142, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -31833,7 +31891,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 1138, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1142, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -31843,7 +31901,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 1138, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1142, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -31854,13 +31912,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1138, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1142, __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, 1138, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1142, __pyx_L1_error) PyErr_Clear(); } break; @@ -31870,60 +31928,60 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1139 + /* "constraint/constraints.py":1143 * 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, 1139, __pyx_L1_error) + __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) { } else { __pyx_t_10 = __pyx_t_12; goto __pyx_L19_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, 1139, __pyx_L1_error) + __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) { } else { __pyx_t_10 = __pyx_t_12; goto __pyx_L19_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, 1139, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":1140 + /* "constraint/constraints.py":1144 * 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, 1140, __pyx_L1_error) + __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; - /* "constraint/constraints.py":1141 + /* "constraint/constraints.py":1145 * 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, 1141, __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, 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_14 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1141, __pyx_L1_error) + __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, 1141, __pyx_L1_error) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -31932,7 +31990,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 1141, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1145, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -31942,7 +32000,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 1141, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1145, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -31953,13 +32011,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call #endif ++__pyx_t_13; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1145, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_14(__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, 1141, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1145, __pyx_L1_error) PyErr_Clear(); } break; @@ -31969,22 +32027,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1142 + /* "constraint/constraints.py":1146 * 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, 1142, __pyx_L1_error) + __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, 1142, __pyx_L1_error) + __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, 1142, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":1143 + /* "constraint/constraints.py":1147 * for value in domain[:]: * if prod * value > maxprod: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -31998,12 +32056,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call 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, 1143, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1142 + /* "constraint/constraints.py":1146 * domain = domains[variable] * for value in domain[:]: * if prod * value > maxprod: # <<<<<<<<<<<<<< @@ -32012,7 +32070,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1141 + /* "constraint/constraints.py":1145 * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -32022,18 +32080,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1144 + /* "constraint/constraints.py":1148 * 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, 1144, __pyx_L1_error) + __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) { - /* "constraint/constraints.py":1145 + /* "constraint/constraints.py":1149 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -32046,7 +32104,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1144 + /* "constraint/constraints.py":1148 * if prod * value > maxprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -32055,7 +32113,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1139 + /* "constraint/constraints.py":1143 * if forwardcheck: * for variable in variables: * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): # <<<<<<<<<<<<<< @@ -32064,7 +32122,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1138 + /* "constraint/constraints.py":1142 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -32074,7 +32132,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1137 + /* "constraint/constraints.py":1141 * if (not missing or len(missing_lt1) == 0) and prod > maxprod: * return False * if forwardcheck: # <<<<<<<<<<<<<< @@ -32083,7 +32141,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1146 + /* "constraint/constraints.py":1150 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -32095,7 +32153,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1121 + /* "constraint/constraints.py":1125 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -32125,7 +32183,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call return __pyx_r; } -/* "constraint/constraints.py":1160 +/* "constraint/constraints.py":1164 * """ # noqa: E501 * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -32174,38 +32232,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, 1160, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1164, __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, 1160, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1164, __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, 1160, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1164, __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, 1160, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1164, __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, 1160, __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, 1164, __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, 1160, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(0, 1164, __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, 1160, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1164, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1160, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1164, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1160, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1164, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_target_var = ((PyObject*)values[1]); @@ -32213,7 +32271,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, 1160, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1164, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -32224,7 +32282,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, 1160, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 1164, __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 */ @@ -32252,25 +32310,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1161 + /* "constraint/constraints.py":1165 * * 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, 1161, __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, 1165, __pyx_L1_error) - /* "constraint/constraints.py":1162 + /* "constraint/constraints.py":1166 * 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, 1162, __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, 1166, __pyx_L1_error) - /* "constraint/constraints.py":1160 + /* "constraint/constraints.py":1164 * """ # noqa: E501 * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -32290,7 +32348,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1164 +/* "constraint/constraints.py":1168 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -32339,41 +32397,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, 1164, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1168, __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, 1168, __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, 1168, __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, 1168, __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, 1164, __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, 1168, __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, 1164, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, i); __PYX_ERR(0, 1168, __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, 1164, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1168, __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, 1168, __pyx_L3_error) 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, 1168, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -32385,7 +32443,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, 1164, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1168, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -32423,11 +32481,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; + int __pyx_t_6; PyObject *__pyx_t_7 = NULL; - size_t __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; + PyObject *__pyx_t_8 = NULL; + size_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; @@ -32438,35 +32496,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_product_bounds", 0); - /* "constraint/constraints.py":1165 + /* "constraint/constraints.py":1169 * * 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, 1165, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1166 + /* "constraint/constraints.py":1170 * 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, 1166, __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, 1170, __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, 1166, __pyx_L1_error) + __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_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, 1166, __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, 1170, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -32475,7 +32533,7 @@ 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, 1166, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1170, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -32485,7 +32543,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1166, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1170, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -32496,13 +32554,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1166, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __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, 1166, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1170, __pyx_L1_error) PyErr_Clear(); } break; @@ -32512,28 +32570,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1167 + /* "constraint/constraints.py":1171 * 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, 1167, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1167, __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, 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1168 + /* "constraint/constraints.py":1172 * for var in self.product_vars: * if var == exclude_var: * continue # <<<<<<<<<<<<<< * dom = domain_dict[var] - * bounds.append((min(dom), max(dom))) + * if not dom: */ goto __pyx_L3_continue; - /* "constraint/constraints.py":1167 + /* "constraint/constraints.py":1171 * bounds = [] * for var in self.product_vars: * if var == exclude_var: # <<<<<<<<<<<<<< @@ -32542,61 +32600,90 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1169 + /* "constraint/constraints.py":1173 * if var == exclude_var: * continue * dom = domain_dict[var] # <<<<<<<<<<<<<< - * bounds.append((min(dom), max(dom))) - * + * 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, 1169, __pyx_L1_error) + __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_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1170 + /* "constraint/constraints.py":1174 + * 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_6 = (!__pyx_t_5); + if (__pyx_t_6) { + + /* "constraint/constraints.py":1175 * dom = domain_dict[var] + * if not dom: + * continue # <<<<<<<<<<<<<< + * bounds.append((min(dom), max(dom))) + * +*/ + goto __pyx_L3_continue; + + /* "constraint/constraints.py":1174 + * continue + * dom = domain_dict[var] + * if not dom: # <<<<<<<<<<<<<< + * continue + * bounds.append((min(dom), max(dom))) +*/ + } + + /* "constraint/constraints.py":1176 + * if not dom: + * continue * bounds.append((min(dom), max(dom))) # <<<<<<<<<<<<<< * * if not bounds: */ - __pyx_t_6 = NULL; + __pyx_t_7 = NULL; __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_7 = __pyx_builtin_min; - __pyx_t_8 = 1; + __pyx_t_8 = __pyx_builtin_min; + __pyx_t_9 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_dom}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __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_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __pyx_L1_error) + 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_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) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_6 = NULL; + __pyx_t_7 = NULL; __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_9 = __pyx_builtin_max; - __pyx_t_8 = 1; + __pyx_t_10 = __pyx_builtin_max; + __pyx_t_9 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_dom}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __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_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + 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); } - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1170, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 1170, __pyx_L1_error); + 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); __pyx_t_1 = 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, 1170, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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; - /* "constraint/constraints.py":1166 + /* "constraint/constraints.py":1170 * def _get_product_bounds(self, domain_dict, exclude_var=None): * bounds = [] * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -32607,19 +32694,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1172 + /* "constraint/constraints.py":1178 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< * return 1, 1 * */ - __pyx_t_5 = (__Pyx_PyList_GET_SIZE(__pyx_v_bounds) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_5 < 0))) __PYX_ERR(0, 1172, __pyx_L1_error) - __pyx_t_11 = (!__pyx_t_5); - if (__pyx_t_11) { + __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) + __pyx_t_5 = (!__pyx_t_6); + if (__pyx_t_5) { - /* "constraint/constraints.py":1173 + /* "constraint/constraints.py":1179 * * if not bounds: * return 1, 1 # <<<<<<<<<<<<<< @@ -32631,7 +32718,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = __pyx_mstate_global->__pyx_tuple[0]; goto __pyx_L0; - /* "constraint/constraints.py":1172 + /* "constraint/constraints.py":1178 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< @@ -32640,7 +32727,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1176 + /* "constraint/constraints.py":1182 * * # Try all corner combinations * candidates = [p for p in product(*[(lo, hi) for lo, hi in bounds])] # <<<<<<<<<<<<<< @@ -32648,34 +32735,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, 1176, __pyx_L10_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1182, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1176, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_9); + __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); { /* enter inner scope */ - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1176, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_7); + __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_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, 1176, __pyx_L15_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1182, __pyx_L16_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); ++__pyx_t_3; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1176, __pyx_L15_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_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; 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, 1176, __pyx_L15_error) + __PYX_ERR(0, 1182, __pyx_L16_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -32685,138 +32772,138 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_INCREF(__pyx_t_13); } else { __pyx_t_12 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1176, __pyx_L15_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1182, __pyx_L16_error) __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1176, __pyx_L15_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1182, __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, 1176, __pyx_L15_error) + __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1182, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1176, __pyx_L15_error) + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1182, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_13); #endif - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { Py_ssize_t index = -1; - __pyx_t_14 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1176, __pyx_L15_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1182, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_L18_unpacking_failed; + 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_L18_unpacking_failed; + 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, 1176, __pyx_L15_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 1182, __pyx_L16_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - goto __pyx_L19_unpacking_done; - __pyx_L18_unpacking_failed:; + goto __pyx_L20_unpacking_done; + __pyx_L19_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, 1176, __pyx_L15_error) - __pyx_L19_unpacking_done:; + __PYX_ERR(0, 1182, __pyx_L16_error) + __pyx_L20_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_9genexpr39__pyx_v_lo, __pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_9genexpr39__pyx_v_hi, __pyx_t_13); __pyx_t_13 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1176, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_6); + __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_6, 0, __pyx_9genexpr39__pyx_v_lo) != (0)) __PYX_ERR(0, 1176, __pyx_L15_error); + 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_6, 1, __pyx_9genexpr39__pyx_v_hi) != (0)) __PYX_ERR(0, 1176, __pyx_L15_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1176, __pyx_L15_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + 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_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; - goto __pyx_L21_exit_scope; - __pyx_L15_error:; + 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; - goto __pyx_L10_error; - __pyx_L21_exit_scope:; + goto __pyx_L11_error; + __pyx_L22_exit_scope:; } /* exit inner scope */ - __pyx_t_1 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1176, __pyx_L10_error) + __pyx_t_1 = PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); - __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, 1176, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __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_1); __pyx_t_1 = 0; - if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { - __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); + 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_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1176, __pyx_L10_error) + __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_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, 1176, __pyx_L10_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, 1182, __pyx_L11_error) } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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, 1176, __pyx_L10_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1182, __pyx_L11_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); ++__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, 1176, __pyx_L10_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1182, __pyx_L11_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3)); + __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3)); #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1176, __pyx_L10_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L11_error) } else { - __pyx_t_7 = __pyx_t_4(__pyx_t_1); - if (unlikely(!__pyx_t_7)) { + __pyx_t_8 = __pyx_t_4(__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, 1176, __pyx_L10_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1182, __pyx_L11_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_7); - __Pyx_XDECREF_SET(__pyx_9genexpr38__pyx_v_p, __pyx_t_7); - __pyx_t_7 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr38__pyx_v_p))) __PYX_ERR(0, 1176, __pyx_L10_error) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_p); __pyx_9genexpr38__pyx_v_p = 0; - goto __pyx_L23_exit_scope; - __pyx_L10_error:; + goto __pyx_L24_exit_scope; + __pyx_L11_error:; __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_p); __pyx_9genexpr38__pyx_v_p = 0; goto __pyx_L1_error; - __pyx_L23_exit_scope:; + __pyx_L24_exit_scope:; } /* exit inner scope */ __pyx_v_candidates = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1177 + /* "constraint/constraints.py":1183 * # 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] # <<<<<<<<<<<<<< @@ -32824,7 +32911,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, 1177, __pyx_L26_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1183, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_v_candidates; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; @@ -32832,41 +32919,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, 1177, __pyx_L26_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1183, __pyx_L27_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); ++__pyx_t_3; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1177, __pyx_L26_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_XDECREF_SET(__pyx_9genexpr40__pyx_v_p, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_9 = __pyx_v_self; - __Pyx_INCREF(__pyx_t_9); + 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); __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_9, __pyx_9genexpr40__pyx_v_p}; - __pyx_t_7 = __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_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1177, __pyx_L26_error) - __Pyx_GOTREF(__pyx_t_7); + 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); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1177, __pyx_L26_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + 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; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_p); __pyx_9genexpr40__pyx_v_p = 0; - goto __pyx_L30_exit_scope; - __pyx_L26_error:; + goto __pyx_L31_exit_scope; + __pyx_L27_error:; __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_p); __pyx_9genexpr40__pyx_v_p = 0; goto __pyx_L1_error; - __pyx_L30_exit_scope:; + __pyx_L31_exit_scope:; } /* exit inner scope */ __pyx_v_products = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1178 + /* "constraint/constraints.py":1184 * 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) # <<<<<<<<<<<<<< @@ -32876,41 +32963,41 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF(__pyx_r); __pyx_t_1 = NULL; __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_7 = __pyx_builtin_min; - __pyx_t_8 = 1; + __pyx_t_8 = __pyx_builtin_min; + __pyx_t_9 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_products}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1178, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_1 = NULL; __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_9 = __pyx_builtin_max; - __pyx_t_8 = 1; + __pyx_t_10 = __pyx_builtin_max; + __pyx_t_9 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_products}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __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); } - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1178, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 1178, __pyx_L1_error); + 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); __pyx_t_2 = 0; - __pyx_t_7 = 0; - __pyx_r = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_t_8 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1164 + /* "constraint/constraints.py":1168 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -32922,9 +33009,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); @@ -32945,7 +33032,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1180 +/* "constraint/constraints.py":1186 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -32993,39 +33080,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, 1180, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1186, __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, 1180, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1186, __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, 1180, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1186, __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, 1180, __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, 1186, __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, 1180, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, i); __PYX_ERR(0, 1186, __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, 1180, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1186, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1180, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1186, __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, 1180, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1186, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -33060,7 +33147,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_safe_product", 0); - /* "constraint/constraints.py":1181 + /* "constraint/constraints.py":1187 * * def _safe_product(self, values): * prod = 1 # <<<<<<<<<<<<<< @@ -33070,7 +33157,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":1182 + /* "constraint/constraints.py":1188 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -33082,9 +33169,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, 1182, __pyx_L1_error) + __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_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, 1182, __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, 1188, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -33092,7 +33179,7 @@ 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, 1182, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -33102,7 +33189,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -33113,13 +33200,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1182, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1188, __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, 1182, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1188, __pyx_L1_error) PyErr_Clear(); } break; @@ -33129,19 +33216,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1183 + /* "constraint/constraints.py":1189 * 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, 1183, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1182 + /* "constraint/constraints.py":1188 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -33151,7 +33238,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1184 + /* "constraint/constraints.py":1190 * for v in values: * prod *= v * return prod # <<<<<<<<<<<<<< @@ -33163,7 +33250,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = __pyx_v_prod; goto __pyx_L0; - /* "constraint/constraints.py":1180 + /* "constraint/constraints.py":1186 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -33185,7 +33272,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1186 +/* "constraint/constraints.py":1192 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -33236,50 +33323,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, 1186, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1192, __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, 1186, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1192, __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, 1186, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1192, __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, 1186, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1192, __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, 1186, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1192, __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, 1192, __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, 1186, __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, 1192, __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, 1186, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1192, __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, 1186, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1192, __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, 1192, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1186, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1192, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1186, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1192, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1186, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1192, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -33289,7 +33376,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, 1186, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1192, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -33300,9 +33387,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, 1186, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1186, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1186, __pyx_L1_error) + 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) __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 */ @@ -33350,7 +33437,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1187 + /* "constraint/constraints.py":1193 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -33358,9 +33445,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, 1187, __pyx_L1_error) + __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_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, 1187, __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, 1193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -33380,27 +33467,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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_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, 1187, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1188 + /* "constraint/constraints.py":1194 * 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, 1188, __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, 1194, __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, 1188, __pyx_L1_error) + __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_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":1189 + /* "constraint/constraints.py":1195 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * target_dom = domains[self.target_var] * t_max = max(target_dom) # <<<<<<<<<<<<<< @@ -33416,29 +33503,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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_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, 1189, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_t_max = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/constraints.py":1191 + /* "constraint/constraints.py":1197 * 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, 1191, __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, 1197, __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_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, 1191, __pyx_L1_error) + __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, 1191, __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, 1197, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -33447,7 +33534,7 @@ 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, 1191, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1197, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -33457,7 +33544,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1191, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1197, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -33468,13 +33555,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1191, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1197, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_7(__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, 1191, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1197, __pyx_L1_error) PyErr_Clear(); } break; @@ -33484,7 +33571,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1192 + /* "constraint/constraints.py":1198 * * for var in self.product_vars: * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) # <<<<<<<<<<<<<< @@ -33496,13 +33583,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1192, __pyx_L1_error) + __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1198, __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, 1192, __pyx_L1_error) + 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; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1192, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { @@ -33511,7 +33598,7 @@ 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, 1192, __pyx_L1_error) + __PYX_ERR(0, 1198, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -33521,22 +33608,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1192, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1198, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1198, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1192, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error) + __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); #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, 1192, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1198, __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); @@ -33544,7 +33631,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1192, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 1198, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -33552,7 +33639,7 @@ 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, 1192, __pyx_L1_error) + __PYX_ERR(0, 1198, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_min_others, __pyx_t_3); @@ -33560,35 +33647,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_max_others, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1193 + /* "constraint/constraints.py":1199 * 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, 1193, __pyx_L1_error) + __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_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1194 + /* "constraint/constraints.py":1200 * 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, 1194, __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, 1200, __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_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, 1194, __pyx_L1_error) + __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, 1194, __pyx_L1_error) + __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -33597,7 +33684,7 @@ 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, 1194, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1200, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -33607,7 +33694,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1194, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1200, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -33618,13 +33705,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_10; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1194, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1200, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_11(__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, 1194, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1200, __pyx_L1_error) PyErr_Clear(); } break; @@ -33634,29 +33721,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1195 + /* "constraint/constraints.py":1201 * 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, 1195, __pyx_L1_error) + __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_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Multiply(__pyx_v_val, __pyx_v_max_others); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1195, __pyx_L1_error) + __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_GOTREF(__pyx_t_3); - __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1195, __pyx_L1_error) + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1201, __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, 1195, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 1201, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1195, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1201, __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":1196 + /* "constraint/constraints.py":1202 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if min(possible_prods) > t_max: # <<<<<<<<<<<<<< @@ -33672,16 +33759,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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_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, 1196, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1202, __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, 1196, __pyx_L1_error) + __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_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, 1196, __pyx_L1_error) + __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; if (__pyx_t_12) { - /* "constraint/constraints.py":1197 + /* "constraint/constraints.py":1203 * possible_prods = [val * min_others, val * max_others] * if min(possible_prods) > t_max: * dom.remove(val) # <<<<<<<<<<<<<< @@ -33695,12 +33782,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1197, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1196 + /* "constraint/constraints.py":1202 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if min(possible_prods) > t_max: # <<<<<<<<<<<<<< @@ -33709,7 +33796,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1194 + /* "constraint/constraints.py":1200 * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) * dom = domains[var] * for val in dom[:]: # <<<<<<<<<<<<<< @@ -33719,7 +33806,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1191 + /* "constraint/constraints.py":1197 * t_max = max(target_dom) * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -33729,7 +33816,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1186 + /* "constraint/constraints.py":1192 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -33762,7 +33849,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1199 +/* "constraint/constraints.py":1205 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -33813,53 +33900,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, 1199, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1205, __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, 1199, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1205, __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, 1199, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1205, __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, 1199, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1205, __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, 1199, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1205, __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, 1199, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1205, __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, 1199, __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, 1205, __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, 1199, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1205, __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, 1199, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1205, __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, 1199, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1205, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1199, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1205, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1199, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1205, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1199, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1205, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -33873,7 +33960,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, 1199, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1205, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -33884,8 +33971,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, 1199, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1199, __pyx_L1_error) + 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) __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 */ @@ -33906,7 +33993,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":1235 +/* "constraint/constraints.py":1241 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p > target_value for p in prods): # <<<<<<<<<<<<<< @@ -33926,7 +34013,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, 1235, __pyx_L1_error) + __PYX_ERR(0, 1241, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -33937,7 +34024,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, 1235, __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, 1241, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -33974,29 +34061,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1235, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1235, __pyx_L1_error) } + 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) } __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, 1235, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1241, __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, 1235, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1241, __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, 1235, __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, 1235, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1235, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = (!__pyx_t_4); if (__pyx_t_5) { @@ -34036,7 +34123,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1199 +/* "constraint/constraints.py":1205 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -34098,25 +34185,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, 1199, __pyx_L1_error) + __PYX_ERR(0, 1205, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/constraints.py":1200 + /* "constraint/constraints.py":1206 * * 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, 1200, __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, 1206, __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, 1200, __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, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":1201 + /* "constraint/constraints.py":1207 * 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 # <<<<<<<<<<<<<< @@ -34128,7 +34215,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1200 + /* "constraint/constraints.py":1206 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -34137,23 +34224,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1203 + /* "constraint/constraints.py":1209 * 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, 1203, __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, 1209, __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, 1203, __pyx_L1_error) + __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_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":1204 + /* "constraint/constraints.py":1210 * * target_value = assignments[self.target_var] * assigned_prod = 1 # <<<<<<<<<<<<<< @@ -34163,35 +34250,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":1205 + /* "constraint/constraints.py":1211 * 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, 1205, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_unassigned = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1207 + /* "constraint/constraints.py":1213 * 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, 1207, __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, 1213, __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, 1207, __pyx_L1_error) + __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_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, 1207, __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, 1213, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -34200,7 +34287,7 @@ 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, 1207, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1213, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -34210,7 +34297,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1207, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1213, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -34221,13 +34308,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1207, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1213, __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, 1207, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1213, __pyx_L1_error) PyErr_Clear(); } break; @@ -34237,32 +34324,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1208 + /* "constraint/constraints.py":1214 * * 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, 1208, __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, 1214, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":1209 + /* "constraint/constraints.py":1215 * 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, 1209, __pyx_L1_error) + __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_GOTREF(__pyx_t_3); - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_assigned_prod, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1209, __pyx_L1_error) + __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_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":1208 + /* "constraint/constraints.py":1214 * * for var in self.product_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -34272,7 +34359,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint goto __pyx_L6; } - /* "constraint/constraints.py":1211 + /* "constraint/constraints.py":1217 * assigned_prod *= assignments[var] * else: * unassigned.append(var) # <<<<<<<<<<<<<< @@ -34280,11 +34367,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, 1211, __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, 1217, __pyx_L1_error) } __pyx_L6:; - /* "constraint/constraints.py":1207 + /* "constraint/constraints.py":1213 * unassigned = [] * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -34294,7 +34381,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1213 + /* "constraint/constraints.py":1219 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< @@ -34302,11 +34389,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * */ __pyx_t_2 = (__Pyx_PyList_GET_SIZE(__pyx_v_unassigned) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 1213, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 1219, __pyx_L1_error) __pyx_t_8 = (!__pyx_t_2); if (__pyx_t_8) { - /* "constraint/constraints.py":1214 + /* "constraint/constraints.py":1220 * * if not unassigned: * return assigned_prod <= target_value # <<<<<<<<<<<<<< @@ -34314,12 +34401,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, 1214, __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, 1220, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1213 + /* "constraint/constraints.py":1219 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< @@ -34328,7 +34415,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1217 + /* "constraint/constraints.py":1223 * * # Estimate max possible value of full product * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned] # <<<<<<<<<<<<<< @@ -34336,7 +34423,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, 1217, __pyx_L11_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0; @@ -34344,20 +34431,20 @@ 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, 1217, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1223, __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_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1217, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1223, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_9genexpr41__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, 1217, __pyx_L11_error) + __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; { @@ -34366,13 +34453,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1217, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1223, __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, 1217, __pyx_L11_error) + __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; { @@ -34381,18 +34468,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1217, __pyx_L11_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1223, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); } - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1217, __pyx_L11_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1223, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1217, __pyx_L11_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1223, __pyx_L11_error); __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1217, __pyx_L11_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1223, __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, 1217, __pyx_L11_error) + 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; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -34406,7 +34493,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_v_domain_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1218 + /* "constraint/constraints.py":1224 * # 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])] # <<<<<<<<<<<<<< @@ -34414,12 +34501,12 @@ 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, 1218, __pyx_L18_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __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, 1218, __pyx_L18_error) + __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_GOTREF(__pyx_t_6); { /* enter inner scope */ - __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1218, __pyx_L23_error) + __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_10 = __pyx_v_domain_bounds; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; @@ -34427,13 +34514,13 @@ 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, 1218, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1224, __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_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1218, __pyx_L23_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1224, __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; @@ -34441,7 +34528,7 @@ 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, 1218, __pyx_L23_error) + __PYX_ERR(0, 1224, __pyx_L23_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -34451,22 +34538,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_INCREF(__pyx_t_11); } else { __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1218, __pyx_L23_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1224, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_13); __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1218, __pyx_L23_error) + 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, 1218, __pyx_L23_error) + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1224, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1218, __pyx_L23_error) + __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, 1218, __pyx_L23_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1224, __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); @@ -34474,7 +34561,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1218, __pyx_L23_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 1224, __pyx_L23_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L27_unpacking_done; @@ -34482,22 +34569,22 @@ 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, 1218, __pyx_L23_error) + __PYX_ERR(0, 1224, __pyx_L23_error) __pyx_L27_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_9genexpr43__pyx_v_lo, __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, 1218, __pyx_L23_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1224, __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, 1218, __pyx_L23_error); + 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, 1218, __pyx_L23_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1218, __pyx_L23_error) + 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -34510,10 +34597,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint 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, 1218, __pyx_L18_error) + __pyx_t_10 = PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1224, __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, 1218, __pyx_L18_error) + __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_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -34522,9 +34609,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1218, __pyx_L18_error) + __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_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, 1218, __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, 1224, __pyx_L18_error) } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; for (;;) { @@ -34533,7 +34620,7 @@ 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, 1218, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1224, __pyx_L18_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -34543,7 +34630,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1218, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1224, __pyx_L18_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -34554,13 +34641,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1218, __pyx_L18_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1224, __pyx_L18_error) } else { __pyx_t_9 = __pyx_t_5(__pyx_t_10); 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, 1218, __pyx_L18_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1224, __pyx_L18_error) PyErr_Clear(); } break; @@ -34576,10 +34663,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint 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)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1218, __pyx_L18_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1224, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_9); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1218, __pyx_L18_error) + 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; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -34593,7 +34680,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_v_candidates = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1219 + /* "constraint/constraints.py":1225 * 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] # <<<<<<<<<<<<<< @@ -34601,7 +34688,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, 1219, __pyx_L34_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1225, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __pyx_v_candidates; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; @@ -34609,19 +34696,19 @@ 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, 1219, __pyx_L34_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1225, __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_4; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1219, __pyx_L34_error) + 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, 1219, __pyx_L34_error) + __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, 1219, __pyx_L34_error) + 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; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -34635,7 +34722,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_v_possible_prods = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1220 + /* "constraint/constraints.py":1226 * 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: # <<<<<<<<<<<<<< @@ -34651,16 +34738,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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_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, 1220, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __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, 1220, __pyx_L1_error) + __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_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, 1220, __pyx_L1_error) + __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; if (__pyx_t_8) { - /* "constraint/constraints.py":1221 + /* "constraint/constraints.py":1227 * possible_prods = [assigned_prod * c for c in candidates] * if min(possible_prods) > target_value: * return False # <<<<<<<<<<<<<< @@ -34672,7 +34759,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1220 + /* "constraint/constraints.py":1226 * 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: # <<<<<<<<<<<<<< @@ -34681,17 +34768,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1223 + /* "constraint/constraints.py":1229 * 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, 1223, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1229, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1224 + /* "constraint/constraints.py":1230 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< @@ -34704,18 +34791,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1224, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1230, __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_4; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1225 + /* "constraint/constraints.py":1231 * if forwardcheck: * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] # <<<<<<<<<<<<<< @@ -34723,7 +34810,7 @@ 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, 1225, __pyx_L45_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1231, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_10); __pyx_t_16 = 0; @@ -34731,21 +34818,21 @@ 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_L45_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1231, __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_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1225, __pyx_L45_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1231, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_9genexpr45__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, 1225, __pyx_L45_error) - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1225, __pyx_L45_error) + __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_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, 1225, __pyx_L45_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr45__pyx_v_v))) __PYX_ERR(0, 1231, __pyx_L45_error) } } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -34759,7 +34846,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_other_unassigned, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1226 + /* "constraint/constraints.py":1232 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< @@ -34767,10 +34854,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * 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, 1226, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_8 < 0))) __PYX_ERR(0, 1232, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1227 + /* "constraint/constraints.py":1233 * 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] # <<<<<<<<<<<<<< @@ -34778,7 +34865,7 @@ 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, 1227, __pyx_L54_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1233, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __pyx_v_other_unassigned; __Pyx_INCREF(__pyx_t_10); __pyx_t_16 = 0; @@ -34786,20 +34873,20 @@ 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, 1227, __pyx_L54_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1233, __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_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1233, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_9genexpr46__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, 1227, __pyx_L54_error) + __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_GOTREF(__pyx_t_13); __pyx_t_12 = 1; { @@ -34808,13 +34895,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1227, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1233, __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, 1227, __pyx_L54_error) + __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; { @@ -34823,18 +34910,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1227, __pyx_L54_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1233, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1227, __pyx_L54_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1233, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1227, __pyx_L54_error); + 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, 1227, __pyx_L54_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 1233, __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, 1227, __pyx_L54_error) + 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_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -34848,7 +34935,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_bounds, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1228 + /* "constraint/constraints.py":1234 * 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])] # <<<<<<<<<<<<<< @@ -34856,12 +34943,12 @@ 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, 1228, __pyx_L61_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __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, 1228, __pyx_L61_error) + __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); { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1228, __pyx_L66_error) + __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_16 = 0; @@ -34869,13 +34956,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1228, __pyx_L66_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1234, __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_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1228, __pyx_L66_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1234, __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; @@ -34883,7 +34970,7 @@ 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, 1228, __pyx_L66_error) + __PYX_ERR(0, 1234, __pyx_L66_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -34893,22 +34980,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_INCREF(__pyx_t_13); } else { __pyx_t_14 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1228, __pyx_L66_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1234, __pyx_L66_error) __Pyx_XGOTREF(__pyx_t_14); __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1228, __pyx_L66_error) + 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, 1228, __pyx_L66_error) + __pyx_t_14 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1234, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1228, __pyx_L66_error) + __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, 1228, __pyx_L66_error) + __pyx_t_17 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1234, __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); @@ -34916,7 +35003,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1228, __pyx_L66_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_17), 2) < 0) __PYX_ERR(0, 1234, __pyx_L66_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; goto __pyx_L70_unpacking_done; @@ -34924,22 +35011,22 @@ 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, 1228, __pyx_L66_error) + __PYX_ERR(0, 1234, __pyx_L66_error) __pyx_L70_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_9genexpr48__pyx_v_lo, __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, 1228, __pyx_L66_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1234, __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, 1228, __pyx_L66_error); + 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, 1228, __pyx_L66_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1228, __pyx_L66_error) + 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_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -34952,10 +35039,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint 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, 1228, __pyx_L61_error) + __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, 1228, __pyx_L61_error) + __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; @@ -34964,9 +35051,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1228, __pyx_L61_error) + __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, 1228, __pyx_L61_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, 1234, __pyx_L61_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -34975,7 +35062,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1228, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1234, __pyx_L61_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -34985,7 +35072,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1228, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1234, __pyx_L61_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -34996,13 +35083,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1228, __pyx_L61_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1234, __pyx_L61_error) } else { __pyx_t_3 = __pyx_t_5(__pyx_t_11); 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, 1228, __pyx_L61_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1234, __pyx_L61_error) PyErr_Clear(); } break; @@ -35018,10 +35105,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint 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, 1228, __pyx_L61_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1234, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_3); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1228, __pyx_L61_error) + 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; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -35035,7 +35122,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_other_products, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1226 + /* "constraint/constraints.py":1232 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< @@ -35045,7 +35132,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint goto __pyx_L51; } - /* "constraint/constraints.py":1230 + /* "constraint/constraints.py":1236 * other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in bounds])] * else: * other_products = [1] # <<<<<<<<<<<<<< @@ -35053,45 +35140,45 @@ 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, 1230, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1236, __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, 1230, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 1236, __pyx_L1_error); __Pyx_XDECREF_SET(__pyx_v_other_products, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; } __pyx_L51:; - /* "constraint/constraints.py":1232 + /* "constraint/constraints.py":1238 * 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, 1232, __pyx_L1_error) + __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_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1233 + /* "constraint/constraints.py":1239 * * 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, 1233, __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, 1239, __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_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, 1233, __pyx_L1_error) + __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, 1233, __pyx_L1_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, 1239, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -35100,7 +35187,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1233, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1239, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -35110,7 +35197,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1233, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1239, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -35121,13 +35208,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1233, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1239, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_5(__pyx_t_11); 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, 1233, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1239, __pyx_L1_error) PyErr_Clear(); } break; @@ -35137,7 +35224,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1234 + /* "constraint/constraints.py":1240 * domain = domains[var] * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] # <<<<<<<<<<<<<< @@ -35145,7 +35232,7 @@ 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, 1234, __pyx_L79_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_v_other_products; __Pyx_INCREF(__pyx_t_3); __pyx_t_18 = 0; @@ -35153,22 +35240,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1234, __pyx_L79_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1240, __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_18; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1234, __pyx_L79_error) + 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, 1234, __pyx_L79_error) + __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, 1234, __pyx_L79_error) + __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) __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, 1234, __pyx_L79_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1240, __pyx_L79_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -35182,23 +35269,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_prods, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1235 + /* "constraint/constraints.py":1241 * 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, 1235, __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, 1241, __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, 1235, __pyx_L1_error) + __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_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, 1235, __pyx_L1_error) + __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; if (__pyx_t_8) { - /* "constraint/constraints.py":1236 + /* "constraint/constraints.py":1242 * prods = [assigned_prod * val * o for o in other_products] * if all(p > target_value for p in prods): * domain.hideValue(val) # <<<<<<<<<<<<<< @@ -35212,12 +35299,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint 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_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1236, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1235 + /* "constraint/constraints.py":1241 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p > target_value for p in prods): # <<<<<<<<<<<<<< @@ -35226,7 +35313,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1233 + /* "constraint/constraints.py":1239 * * domain = domains[var] * for val in domain[:]: # <<<<<<<<<<<<<< @@ -35236,18 +35323,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "constraint/constraints.py":1237 + /* "constraint/constraints.py":1243 * 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, 1237, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1243, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_8); if (__pyx_t_2) { - /* "constraint/constraints.py":1238 + /* "constraint/constraints.py":1244 * domain.hideValue(val) * if not domain: * return False # <<<<<<<<<<<<<< @@ -35260,7 +35347,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1237 + /* "constraint/constraints.py":1243 * if all(p > target_value for p in prods): * domain.hideValue(val) * if not domain: # <<<<<<<<<<<<<< @@ -35269,7 +35356,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1224 + /* "constraint/constraints.py":1230 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< @@ -35279,7 +35366,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":1223 + /* "constraint/constraints.py":1229 * return False * * if forwardcheck: # <<<<<<<<<<<<<< @@ -35288,7 +35375,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1240 + /* "constraint/constraints.py":1246 * return False * * return True # <<<<<<<<<<<<<< @@ -35300,7 +35387,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1199 + /* "constraint/constraints.py":1205 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -35352,7 +35439,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1254 +/* "constraint/constraints.py":1260 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -35401,39 +35488,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, 1254, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1260, __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, 1254, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1260, __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, 1254, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1260, __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, 1254, __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, 1260, __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, 1254, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1260, __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, 1254, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1260, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1254, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1260, __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, 1254, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1260, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -35462,16 +35549,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1260 + /* "constraint/constraints.py":1266 * 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, 1260, __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, 1266, __pyx_L1_error) - /* "constraint/constraints.py":1254 + /* "constraint/constraints.py":1260 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -35491,7 +35578,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( return __pyx_r; } -/* "constraint/constraints.py":1262 +/* "constraint/constraints.py":1268 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -35542,53 +35629,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, 1262, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1268, __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, 1262, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1268, __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, 1262, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1268, __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, 1262, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1268, __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, 1262, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1268, __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, 1262, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1268, __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, 1262, __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, 1268, __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, 1262, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1268, __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, 1262, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1268, __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, 1262, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1268, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1262, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1268, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1262, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1268, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1262, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1268, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -35602,7 +35689,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, 1262, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1268, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -35635,7 +35722,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1264 + /* "constraint/constraints.py":1270 * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 * # preProcess() will remove it. * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< @@ -35651,14 +35738,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ __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, 1264, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1270, __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, 1264, __pyx_L1_error) + __PYX_ERR(0, 1270, __pyx_L1_error) - /* "constraint/constraints.py":1262 + /* "constraint/constraints.py":1268 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -35678,7 +35765,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ return __pyx_r; } -/* "constraint/constraints.py":1266 +/* "constraint/constraints.py":1272 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -35729,50 +35816,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, 1266, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1272, __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, 1266, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1272, __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, 1266, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1272, __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, 1266, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1272, __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, 1266, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1272, __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, 1266, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1272, __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, 1266, __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, 1272, __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, 1266, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1272, __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, 1266, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1272, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1266, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1272, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1266, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1272, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1266, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1272, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1266, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1272, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -35782,7 +35869,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, 1266, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1272, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -35793,9 +35880,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, 1266, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1266, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1266, __pyx_L1_error) + 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) __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 */ @@ -35838,19 +35925,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1267 + /* "constraint/constraints.py":1273 * * 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, 1267, __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, 1273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1268 + /* "constraint/constraints.py":1274 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -35862,9 +35949,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, 1268, __pyx_L1_error) + __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_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, 1268, __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, 1274, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -35872,7 +35959,7 @@ 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, 1268, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1274, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -35882,7 +35969,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce { 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, 1268, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1274, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -35893,13 +35980,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1268, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1274, __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, 1268, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1274, __pyx_L1_error) PyErr_Clear(); } break; @@ -35909,35 +35996,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":1269 + /* "constraint/constraints.py":1275 * 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, 1269, __pyx_L1_error) + __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_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1270 + /* "constraint/constraints.py":1276 * 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, 1270, __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, 1276, __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, 1270, __pyx_L1_error) + __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_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, 1270, __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, 1276, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -35946,7 +36033,7 @@ 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, 1270, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1276, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -35956,7 +36043,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce { 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, 1270, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1276, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -35967,13 +36054,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1270, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1276, __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, 1270, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1276, __pyx_L1_error) PyErr_Clear(); } break; @@ -35983,17 +36070,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":1271 + /* "constraint/constraints.py":1277 * 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, 1271, __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, 1277, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1272 + /* "constraint/constraints.py":1278 * for value in domain[:]: * if value not in set: * domain.remove(value) # <<<<<<<<<<<<<< @@ -36007,12 +36094,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce 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_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1272, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1271 + /* "constraint/constraints.py":1277 * domain = domains[variable] * for value in domain[:]: * if value not in set: # <<<<<<<<<<<<<< @@ -36021,7 +36108,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce */ } - /* "constraint/constraints.py":1270 + /* "constraint/constraints.py":1276 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -36031,25 +36118,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1273 + /* "constraint/constraints.py":1279 * 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, 1273, __pyx_L1_error) + __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_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, 1273, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1279, __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, 1273, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1279, __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, 1273, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1279, __pyx_L1_error); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11}; @@ -36057,12 +36144,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce __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, 1273, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1268 + /* "constraint/constraints.py":1274 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -36072,27 +36159,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1274 + /* "constraint/constraints.py":1280 * 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, 1274, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1280, __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, 1274, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1280, __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, 1274, __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, 1274, __pyx_L1_error) + 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) __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":1266 + /* "constraint/constraints.py":1272 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -36121,7 +36208,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce return __pyx_r; } -/* "constraint/constraints.py":1288 +/* "constraint/constraints.py":1294 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -36170,39 +36257,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, 1288, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1294, __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, 1288, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1294, __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, 1288, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1294, __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, 1288, __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, 1294, __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, 1288, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1294, __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, 1288, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1294, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1288, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1294, __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, 1288, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1294, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -36231,16 +36318,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1294 + /* "constraint/constraints.py":1300 * 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, 1294, __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, 1300, __pyx_L1_error) - /* "constraint/constraints.py":1288 + /* "constraint/constraints.py":1294 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -36260,7 +36347,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init return __pyx_r; } -/* "constraint/constraints.py":1296 +/* "constraint/constraints.py":1302 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -36311,53 +36398,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, 1296, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1302, __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, 1296, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1302, __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, 1296, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1302, __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, 1296, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1302, __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, 1296, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1302, __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, 1296, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1302, __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, 1296, __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, 1302, __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, 1296, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1302, __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, 1296, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1302, __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, 1296, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1302, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1296, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1302, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1296, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1302, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1296, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1302, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -36371,7 +36458,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, 1296, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1302, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -36404,7 +36491,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1298 + /* "constraint/constraints.py":1304 * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 * # preProcess() will remove it. * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< @@ -36420,14 +36507,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal __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, 1298, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1304, __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, 1298, __pyx_L1_error) + __PYX_ERR(0, 1304, __pyx_L1_error) - /* "constraint/constraints.py":1296 + /* "constraint/constraints.py":1302 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -36447,7 +36534,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal return __pyx_r; } -/* "constraint/constraints.py":1300 +/* "constraint/constraints.py":1306 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -36498,50 +36585,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, 1300, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1306, __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, 1300, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1306, __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, 1300, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1306, __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, 1300, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1306, __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, 1300, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1306, __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, 1300, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1306, __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, 1300, __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, 1306, __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, 1300, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1306, __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, 1300, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1306, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1300, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1306, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1300, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1306, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1300, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1306, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1300, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1306, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -36551,7 +36638,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, 1300, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1306, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -36562,9 +36649,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, 1300, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1300, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1300, __pyx_L1_error) + 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) __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 */ @@ -36607,19 +36694,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1301 + /* "constraint/constraints.py":1307 * * 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, 1301, __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, 1307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1302 + /* "constraint/constraints.py":1308 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -36631,9 +36718,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, 1302, __pyx_L1_error) + __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_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, 1302, __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, 1308, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -36641,7 +36728,7 @@ 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, 1302, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1308, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -36651,7 +36738,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr { 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, 1302, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1308, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -36662,13 +36749,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1302, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1308, __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, 1302, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1308, __pyx_L1_error) PyErr_Clear(); } break; @@ -36678,35 +36765,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":1303 + /* "constraint/constraints.py":1309 * 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, 1303, __pyx_L1_error) + __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_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1304 + /* "constraint/constraints.py":1310 * 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, 1304, __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, 1310, __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, 1304, __pyx_L1_error) + __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_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, 1304, __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, 1310, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -36715,7 +36802,7 @@ 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, 1304, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1310, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -36725,7 +36812,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr { 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, 1304, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1310, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -36736,13 +36823,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1304, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1310, __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, 1304, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1310, __pyx_L1_error) PyErr_Clear(); } break; @@ -36752,17 +36839,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":1305 + /* "constraint/constraints.py":1311 * 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, 1305, __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, 1311, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1306 + /* "constraint/constraints.py":1312 * for value in domain[:]: * if value in set: * domain.remove(value) # <<<<<<<<<<<<<< @@ -36776,12 +36863,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr 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_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1306, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1305 + /* "constraint/constraints.py":1311 * domain = domains[variable] * for value in domain[:]: * if value in set: # <<<<<<<<<<<<<< @@ -36790,7 +36877,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr */ } - /* "constraint/constraints.py":1304 + /* "constraint/constraints.py":1310 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -36800,25 +36887,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1307 + /* "constraint/constraints.py":1313 * 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, 1307, __pyx_L1_error) + __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_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, 1307, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1313, __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, 1307, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1313, __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, 1307, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1313, __pyx_L1_error); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11}; @@ -36826,12 +36913,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr __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, 1307, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1302 + /* "constraint/constraints.py":1308 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -36841,27 +36928,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1308 + /* "constraint/constraints.py":1314 * 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, 1308, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1314, __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, 1308, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1314, __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, 1308, __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, 1308, __pyx_L1_error) + 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) __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":1300 + /* "constraint/constraints.py":1306 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -36890,7 +36977,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr return __pyx_r; } -/* "constraint/constraints.py":1322 +/* "constraint/constraints.py":1328 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -36941,50 +37028,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, 1322, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1328, __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, 1322, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1328, __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, 1322, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1328, __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, 1322, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1328, __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, 1322, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1328, __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, 1322, __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, 1328, __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, 1322, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, i); __PYX_ERR(0, 1328, __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, 1322, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1328, __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, 1322, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1328, __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, 1322, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1328, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1322, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1328, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -36998,7 +37085,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, 1322, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1328, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -37027,34 +37114,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1332 + /* "constraint/constraints.py":1338 * 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, 1332, __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, 1338, __pyx_L1_error) - /* "constraint/constraints.py":1333 + /* "constraint/constraints.py":1339 * """ * 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, 1333, __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, 1339, __pyx_L1_error) - /* "constraint/constraints.py":1334 + /* "constraint/constraints.py":1340 * 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, 1334, __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, 1340, __pyx_L1_error) - /* "constraint/constraints.py":1322 + /* "constraint/constraints.py":1328 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -37074,7 +37161,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini return __pyx_r; } -/* "constraint/constraints.py":1336 +/* "constraint/constraints.py":1342 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -37125,53 +37212,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, 1336, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1342, __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, 1336, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1342, __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, 1336, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1342, __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, 1336, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1342, __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, 1336, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1342, __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, 1336, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1342, __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, 1336, __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, 1342, __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, 1336, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1342, __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, 1336, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1342, __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, 1336, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1342, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1336, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1342, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1336, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1342, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1336, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1342, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -37185,7 +37272,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, 1336, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1342, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -37196,8 +37283,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, 1336, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1336, __pyx_L1_error) + 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) __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 */ @@ -37242,19 +37329,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1337 + /* "constraint/constraints.py":1343 * * 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, 1337, __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, 1343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1338 + /* "constraint/constraints.py":1344 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * set = self._set * missing = 0 # <<<<<<<<<<<<<< @@ -37264,7 +37351,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":1339 + /* "constraint/constraints.py":1345 * set = self._set * missing = 0 * found = 0 # <<<<<<<<<<<<<< @@ -37274,7 +37361,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":1340 + /* "constraint/constraints.py":1346 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -37286,9 +37373,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, 1340, __pyx_L1_error) + __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_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, 1340, __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, 1346, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -37296,7 +37383,7 @@ 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, 1340, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1346, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -37306,7 +37393,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { 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, 1340, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1346, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -37317,13 +37404,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1340, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1346, __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, 1340, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1346, __pyx_L1_error) PyErr_Clear(); } break; @@ -37333,36 +37420,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":1341 + /* "constraint/constraints.py":1347 * 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, 1341, __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, 1347, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1342 + /* "constraint/constraints.py":1348 * 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, 1342, __pyx_L1_error) + __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_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, 1342, __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, 1348, __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, 1342, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1348, __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, 1342, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_found, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1348, __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":1341 + /* "constraint/constraints.py":1347 * found = 0 * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -37372,7 +37459,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L5; } - /* "constraint/constraints.py":1344 + /* "constraint/constraints.py":1350 * found += assignments[variable] in set * else: * missing += 1 # <<<<<<<<<<<<<< @@ -37380,14 +37467,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, 1344, __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, 1350, __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":1340 + /* "constraint/constraints.py":1346 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -37397,53 +37484,53 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1345 + /* "constraint/constraints.py":1351 * 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, 1345, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_missing); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1351, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1346 + /* "constraint/constraints.py":1352 * 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, 1346, __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, 1352, __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, 1346, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1352, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1347 + /* "constraint/constraints.py":1353 * 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, 1347, __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, 1353, __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, 1347, __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, 1353, __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, 1347, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1353, __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, 1347, __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, 1353, __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, 1347, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1353, __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":1348 + /* "constraint/constraints.py":1354 * if self._exact: * if not (found <= self._n <= missing + found): * return False # <<<<<<<<<<<<<< @@ -37455,7 +37542,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1347 + /* "constraint/constraints.py":1353 * if missing: * if self._exact: * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< @@ -37464,7 +37551,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1346 + /* "constraint/constraints.py":1352 * missing += 1 * if missing: * if self._exact: # <<<<<<<<<<<<<< @@ -37474,7 +37561,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L8; } - /* "constraint/constraints.py":1350 + /* "constraint/constraints.py":1356 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -37482,18 +37569,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, 1350, __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, 1356, __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, 1350, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1356, __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, 1350, __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, 1356, __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, 1350, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":1351 + /* "constraint/constraints.py":1357 * else: * if self._n > missing + found: * return False # <<<<<<<<<<<<<< @@ -37505,7 +37592,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1350 + /* "constraint/constraints.py":1356 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -37516,33 +37603,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __pyx_L8:; - /* "constraint/constraints.py":1352 + /* "constraint/constraints.py":1358 * 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, 1352, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1358, __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, 1352, __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, 1358, __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, 1352, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __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, 1352, __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, 1358, __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, 1352, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1358, __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":1355 + /* "constraint/constraints.py":1361 * # All unassigned variables must be assigned to * # values in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -37554,9 +37641,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, 1355, __pyx_L1_error) + __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_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, 1355, __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, 1361, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -37564,7 +37651,7 @@ 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, 1355, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1361, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -37574,7 +37661,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { 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, 1355, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1361, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -37585,13 +37672,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1355, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1361, __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, 1355, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1361, __pyx_L1_error) PyErr_Clear(); } break; @@ -37601,45 +37688,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":1356 + /* "constraint/constraints.py":1362 * # 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, 1356, __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, 1362, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1357 + /* "constraint/constraints.py":1363 * 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, 1357, __pyx_L1_error) + __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_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1358 + /* "constraint/constraints.py":1364 * 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, 1358, __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, 1364, __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, 1358, __pyx_L1_error) + __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_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, 1358, __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, 1364, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -37648,7 +37735,7 @@ 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, 1358, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1364, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -37658,7 +37745,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { 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, 1358, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1364, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -37669,13 +37756,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __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, 1358, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1364, __pyx_L1_error) PyErr_Clear(); } break; @@ -37685,17 +37772,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":1359 + /* "constraint/constraints.py":1365 * 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, 1359, __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, 1365, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1360 + /* "constraint/constraints.py":1366 * for value in domain[:]: * if value not in set: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -37709,12 +37796,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca 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_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1359 + /* "constraint/constraints.py":1365 * domain = domains[variable] * for value in domain[:]: * if value not in set: # <<<<<<<<<<<<<< @@ -37723,7 +37810,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1358 + /* "constraint/constraints.py":1364 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -37733,18 +37820,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1361 + /* "constraint/constraints.py":1367 * 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, 1361, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1367, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_7); if (__pyx_t_5) { - /* "constraint/constraints.py":1362 + /* "constraint/constraints.py":1368 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -37757,7 +37844,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":1361 + /* "constraint/constraints.py":1367 * if value not in set: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -37766,7 +37853,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1356 + /* "constraint/constraints.py":1362 * # values in the set. * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -37775,7 +37862,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1355 + /* "constraint/constraints.py":1361 * # All unassigned variables must be assigned to * # values in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -37785,7 +37872,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1352 + /* "constraint/constraints.py":1358 * if self._n > missing + found: * return False * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< @@ -37794,7 +37881,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1345 + /* "constraint/constraints.py":1351 * else: * missing += 1 * if missing: # <<<<<<<<<<<<<< @@ -37804,7 +37891,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L7; } - /* "constraint/constraints.py":1364 + /* "constraint/constraints.py":1370 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -37812,28 +37899,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, 1364, __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, 1370, __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, 1364, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1370, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1365 + /* "constraint/constraints.py":1371 * 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, 1365, __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, 1371, __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, 1365, __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, 1371, __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, 1365, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1371, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1366 + /* "constraint/constraints.py":1372 * if self._exact: * if found != self._n: * return False # <<<<<<<<<<<<<< @@ -37845,7 +37932,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1365 + /* "constraint/constraints.py":1371 * else: * if self._exact: * if found != self._n: # <<<<<<<<<<<<<< @@ -37854,7 +37941,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1364 + /* "constraint/constraints.py":1370 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -37864,7 +37951,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L23; } - /* "constraint/constraints.py":1368 + /* "constraint/constraints.py":1374 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -37872,15 +37959,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, 1368, __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, 1374, __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, 1368, __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, 1374, __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, 1368, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1374, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1369 + /* "constraint/constraints.py":1375 * else: * if found < self._n: * return False # <<<<<<<<<<<<<< @@ -37892,7 +37979,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1368 + /* "constraint/constraints.py":1374 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -37905,7 +37992,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __pyx_L7:; - /* "constraint/constraints.py":1370 + /* "constraint/constraints.py":1376 * if found < self._n: * return False * return True # <<<<<<<<<<<<<< @@ -37917,7 +38004,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1336 + /* "constraint/constraints.py":1342 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -37945,7 +38032,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca return __pyx_r; } -/* "constraint/constraints.py":1384 +/* "constraint/constraints.py":1390 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -37996,50 +38083,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, 1384, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1390, __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, 1384, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1390, __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, 1384, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1390, __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, 1384, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1390, __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, 1384, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1390, __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, 1384, __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, 1390, __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, 1384, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, i); __PYX_ERR(0, 1390, __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, 1384, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1390, __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, 1384, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1390, __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, 1384, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1390, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1384, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1390, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -38053,7 +38140,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, 1384, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1390, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -38082,34 +38169,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1394 + /* "constraint/constraints.py":1400 * 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, 1394, __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, 1400, __pyx_L1_error) - /* "constraint/constraints.py":1395 + /* "constraint/constraints.py":1401 * """ * 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, 1395, __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, 1401, __pyx_L1_error) - /* "constraint/constraints.py":1396 + /* "constraint/constraints.py":1402 * 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, 1396, __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, 1402, __pyx_L1_error) - /* "constraint/constraints.py":1384 + /* "constraint/constraints.py":1390 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -38129,7 +38216,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ return __pyx_r; } -/* "constraint/constraints.py":1398 +/* "constraint/constraints.py":1404 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -38180,53 +38267,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, 1398, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1404, __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, 1398, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1404, __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, 1398, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1404, __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, 1398, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1404, __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, 1398, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1404, __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, 1398, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1404, __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, 1398, __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, 1404, __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, 1398, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1404, __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, 1398, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1404, __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, 1398, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1404, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1398, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1404, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1398, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1404, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1398, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1404, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -38240,7 +38327,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, 1398, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1404, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -38251,8 +38338,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, 1398, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1398, __pyx_L1_error) + 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) __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 */ @@ -38297,19 +38384,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1399 + /* "constraint/constraints.py":1405 * * 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, 1399, __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, 1405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1400 + /* "constraint/constraints.py":1406 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * set = self._set * missing = 0 # <<<<<<<<<<<<<< @@ -38319,7 +38406,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":1401 + /* "constraint/constraints.py":1407 * set = self._set * missing = 0 * found = 0 # <<<<<<<<<<<<<< @@ -38329,7 +38416,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":1402 + /* "constraint/constraints.py":1408 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -38341,9 +38428,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, 1402, __pyx_L1_error) + __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_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, 1402, __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, 1408, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -38351,7 +38438,7 @@ 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, 1402, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1408, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -38361,7 +38448,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_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, 1402, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1408, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -38372,13 +38459,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1402, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1408, __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, 1402, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1408, __pyx_L1_error) PyErr_Clear(); } break; @@ -38388,36 +38475,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":1403 + /* "constraint/constraints.py":1409 * 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, 1403, __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, 1409, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1404 + /* "constraint/constraints.py":1410 * 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, 1404, __pyx_L1_error) + __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_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, 1404, __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, 1410, __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, 1404, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1410, __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, 1404, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_found, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1410, __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":1403 + /* "constraint/constraints.py":1409 * found = 0 * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -38427,7 +38514,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L5; } - /* "constraint/constraints.py":1406 + /* "constraint/constraints.py":1412 * found += assignments[variable] not in set * else: * missing += 1 # <<<<<<<<<<<<<< @@ -38435,14 +38522,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, 1406, __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, 1412, __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":1402 + /* "constraint/constraints.py":1408 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -38452,53 +38539,53 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1407 + /* "constraint/constraints.py":1413 * 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, 1407, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_missing); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1413, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1408 + /* "constraint/constraints.py":1414 * 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, 1408, __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, 1414, __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, 1408, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1414, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1409 + /* "constraint/constraints.py":1415 * 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, 1409, __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, 1415, __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, 1409, __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, 1415, __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, 1409, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1415, __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, 1409, __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, 1415, __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, 1409, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1415, __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":1410 + /* "constraint/constraints.py":1416 * if self._exact: * if not (found <= self._n <= missing + found): * return False # <<<<<<<<<<<<<< @@ -38510,7 +38597,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1409 + /* "constraint/constraints.py":1415 * if missing: * if self._exact: * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< @@ -38519,7 +38606,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1408 + /* "constraint/constraints.py":1414 * missing += 1 * if missing: * if self._exact: # <<<<<<<<<<<<<< @@ -38529,7 +38616,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L8; } - /* "constraint/constraints.py":1412 + /* "constraint/constraints.py":1418 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -38537,18 +38624,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, 1412, __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, 1418, __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, 1412, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1418, __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, 1412, __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, 1418, __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, 1412, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1418, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":1413 + /* "constraint/constraints.py":1419 * else: * if self._n > missing + found: * return False # <<<<<<<<<<<<<< @@ -38560,7 +38647,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1412 + /* "constraint/constraints.py":1418 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -38571,33 +38658,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __pyx_L8:; - /* "constraint/constraints.py":1414 + /* "constraint/constraints.py":1420 * 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, 1414, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1420, __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, 1414, __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, 1420, __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, 1414, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1420, __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, 1414, __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, 1420, __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, 1414, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1420, __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":1417 + /* "constraint/constraints.py":1423 * # All unassigned variables must be assigned to * # values not in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -38609,9 +38696,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, 1417, __pyx_L1_error) + __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_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, 1417, __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, 1423, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -38619,7 +38706,7 @@ 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, 1417, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1423, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -38629,7 +38716,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ { 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, 1417, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1423, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -38640,13 +38727,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1417, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1423, __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, 1417, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1423, __pyx_L1_error) PyErr_Clear(); } break; @@ -38656,45 +38743,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":1418 + /* "constraint/constraints.py":1424 * # 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, 1418, __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, 1424, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1419 + /* "constraint/constraints.py":1425 * 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, 1419, __pyx_L1_error) + __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_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1420 + /* "constraint/constraints.py":1426 * 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, 1420, __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, 1426, __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, 1420, __pyx_L1_error) + __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_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, 1420, __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, 1426, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -38703,7 +38790,7 @@ 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, 1420, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1426, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -38713,7 +38800,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ { 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, 1420, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1426, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -38724,13 +38811,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1420, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1426, __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, 1420, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1426, __pyx_L1_error) PyErr_Clear(); } break; @@ -38740,17 +38827,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":1421 + /* "constraint/constraints.py":1427 * 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, 1421, __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, 1427, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1422 + /* "constraint/constraints.py":1428 * for value in domain[:]: * if value in set: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -38764,12 +38851,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ 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_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1422, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1421 + /* "constraint/constraints.py":1427 * domain = domains[variable] * for value in domain[:]: * if value in set: # <<<<<<<<<<<<<< @@ -38778,7 +38865,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1420 + /* "constraint/constraints.py":1426 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -38788,18 +38875,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1423 + /* "constraint/constraints.py":1429 * 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, 1423, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1429, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_7); if (__pyx_t_5) { - /* "constraint/constraints.py":1424 + /* "constraint/constraints.py":1430 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -38812,7 +38899,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1423 + /* "constraint/constraints.py":1429 * if value in set: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -38821,7 +38908,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1418 + /* "constraint/constraints.py":1424 * # values not in the set. * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -38830,7 +38917,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1417 + /* "constraint/constraints.py":1423 * # All unassigned variables must be assigned to * # values not in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -38840,7 +38927,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1414 + /* "constraint/constraints.py":1420 * if self._n > missing + found: * return False * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< @@ -38849,7 +38936,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1407 + /* "constraint/constraints.py":1413 * else: * missing += 1 * if missing: # <<<<<<<<<<<<<< @@ -38859,7 +38946,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L7; } - /* "constraint/constraints.py":1426 + /* "constraint/constraints.py":1432 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -38867,28 +38954,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, 1426, __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, 1432, __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, 1426, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1432, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1427 + /* "constraint/constraints.py":1433 * 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, 1427, __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, 1433, __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, 1427, __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, 1433, __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, 1427, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1433, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1428 + /* "constraint/constraints.py":1434 * if self._exact: * if found != self._n: * return False # <<<<<<<<<<<<<< @@ -38900,7 +38987,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1427 + /* "constraint/constraints.py":1433 * else: * if self._exact: * if found != self._n: # <<<<<<<<<<<<<< @@ -38909,7 +38996,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1426 + /* "constraint/constraints.py":1432 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -38919,7 +39006,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L23; } - /* "constraint/constraints.py":1430 + /* "constraint/constraints.py":1436 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -38927,15 +39014,15 @@ 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, 1430, __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, 1436, __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, 1430, __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, 1436, __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, 1430, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1431 + /* "constraint/constraints.py":1437 * else: * if found < self._n: * return False # <<<<<<<<<<<<<< @@ -38946,7 +39033,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1430 + /* "constraint/constraints.py":1436 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -38959,7 +39046,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __pyx_L7:; - /* "constraint/constraints.py":1432 + /* "constraint/constraints.py":1438 * if found < self._n: * return False * return True # <<<<<<<<<<<<<< @@ -38969,7 +39056,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1398 + /* "constraint/constraints.py":1404 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -42893,15 +42980,15 @@ 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, 888, __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, 888, __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, 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) #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, 888, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__) < 0) __PYX_ERR(0, 890, __pyx_L1_error) #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)) { @@ -42909,15 +42996,15 @@ 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, 911, __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, 911, __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, 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) #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, 911, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr) < 0) __PYX_ERR(0, 913, __pyx_L1_error) #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)) { @@ -42925,15 +43012,15 @@ 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, 912, __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, 912, __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, 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) #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, 912, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr) < 0) __PYX_ERR(0, 914, __pyx_L1_error) #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)) { @@ -42941,15 +43028,15 @@ 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, 926, __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, 926, __pyx_L1_error) + __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) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_15_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_15_genexpr) < 0) __PYX_ERR(0, 926, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15_genexpr) < 0) __PYX_ERR(0, 928, __pyx_L1_error) #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)) { @@ -42957,15 +43044,15 @@ 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_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, 1030, __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, 1030, __pyx_L1_error) + __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) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16___call__ = &__pyx_type_10constraint_11constraints___pyx_scope_struct_16___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_16___call__) < 0) __PYX_ERR(0, 1030, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16___call__) < 0) __PYX_ERR(0, 1034, __pyx_L1_error) #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)) { @@ -42973,15 +43060,15 @@ 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_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, 1066, __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, 1066, __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, 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) #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, 1066, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr) < 0) __PYX_ERR(0, 1070, __pyx_L1_error) #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)) { @@ -42989,15 +43076,15 @@ 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, 1100, __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, 1100, __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, 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) #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, 1100, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr) < 0) __PYX_ERR(0, 1104, __pyx_L1_error) #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)) { @@ -43005,15 +43092,15 @@ 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, 1199, __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, 1199, __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, 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) #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, 1199, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__) < 0) __PYX_ERR(0, 1205, __pyx_L1_error) #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)) { @@ -43021,15 +43108,15 @@ 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, 1235, __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, 1235, __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, 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) #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, 1235, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr) < 0) __PYX_ERR(0, 1241, __pyx_L1_error) #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)) { @@ -44551,56 +44638,56 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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":867 + /* "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, 867, __pyx_L1_error) + __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, 867, __pyx_L1_error) + 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; - /* "constraint/constraints.py":873 + /* "constraint/constraints.py":875 * return prod * * 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, 873, __pyx_L1_error) + __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, 873, __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, 873, __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, 873, __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, 873, __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, 873, __pyx_L1_error) + 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_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, 873, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":888 + /* "constraint/constraints.py":890 * 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_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 890, __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, 888, __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, 888, __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, 888, __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, 888, __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, 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); __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, 888, __pyx_L1_error) + 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; /* "constraint/constraints.py":828 @@ -44618,741 +44705,741 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":934 + /* "constraint/constraints.py":936 * * * 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, 934, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); - __pyx_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 934, __pyx_L1_error) + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 936, __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, 934, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 936, __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, 934, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 936, __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, 934, __pyx_L1_error) + __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); if (__pyx_t_2 != __pyx_t_6) { - if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 934, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 936, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":945 + /* "constraint/constraints.py":947 * """ * * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MinProdConstraint. * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 945, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 947, __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, 945, __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, 945, __pyx_L1_error) + 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) __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_init, __pyx_t_4) < 0) __PYX_ERR(0, 945, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 947, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":953 + /* "constraint/constraints.py":955 * 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_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 953, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 955, __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, 953, __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, 953, __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, 953, __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, 953, __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, 953, __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, 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) __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_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 953, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":964 + /* "constraint/constraints.py":966 * 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_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 964, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 966, __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, 964, __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, 964, __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, 964, __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, 964, __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, 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) __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_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, 964, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 966, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":934 + /* "constraint/constraints.py":936 * * * class MinProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product up to at least 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, 934, __pyx_L1_error) + __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_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, 934, __pyx_L1_error) + 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) __Pyx_DECREF(__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; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":980 + /* "constraint/constraints.py":982 * * * 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, 980, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 980, __pyx_L1_error) + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 982, __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, 980, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __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, 980, __pyx_L1_error) + __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, 980, __pyx_L1_error) + __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_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, 980, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 982, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":991 + /* "constraint/constraints.py":993 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< * self.target_var = target_var * self.product_vars = product_vars */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 991, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 993, __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, 991, __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, 991, __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, 991, __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, 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) __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_init, __pyx_t_6) < 0) __PYX_ERR(0, 991, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 993, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":995 + /* "constraint/constraints.py":997 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< * 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, 995, __pyx_L1_error) + __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_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, 995, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1011 + /* "constraint/constraints.py":1015 * 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, 1011, __pyx_L1_error) + __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_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, 1011, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1017 + /* "constraint/constraints.py":1021 * 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, 1017, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1021, __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, 1017, __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, 1017, __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, 1017, __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, 1017, __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, 1017, __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, 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) __Pyx_GOTREF(__pyx_t_5); __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, 1017, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 1021, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1030 + /* "constraint/constraints.py":1034 * 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, 1030, __pyx_L1_error) + __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, 1030, __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, 1030, __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, 1030, __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, 1030, __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, 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, 1030, __pyx_L1_error) + 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; - /* "constraint/constraints.py":980 + /* "constraint/constraints.py":982 * * * 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, 980, __pyx_L1_error) + __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, 980, __pyx_L1_error) + 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_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":1074 + /* "constraint/constraints.py":1078 * * * 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, 1074, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1074, __pyx_L1_error) + __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_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, 1074, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1078, __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, 1074, __pyx_L1_error) + __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, 1074, __pyx_L1_error) + __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, 1074, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 1078, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1085 + /* "constraint/constraints.py":1089 * """ * * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MaxProdConstraint. * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1085, __pyx_L1_error) + __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, 1085, __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, 1085, __pyx_L1_error) + 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, 1085, __pyx_L1_error) + 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; - /* "constraint/constraints.py":1093 + /* "constraint/constraints.py":1097 * self._maxprod = maxprod * * 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, 1093, __pyx_L1_error) + __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, 1093, __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, 1093, __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, 1093, __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, 1093, __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, 1093, __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, 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, 1093, __pyx_L1_error) + 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; - /* "constraint/constraints.py":1121 + /* "constraint/constraints.py":1125 * 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, 1121, __pyx_L1_error) + __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, 1121, __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, 1121, __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, 1121, __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, 1121, __pyx_L1_error) + 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, 1121, __pyx_L1_error) + 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; - /* "constraint/constraints.py":1074 + /* "constraint/constraints.py":1078 * * * 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, 1074, __pyx_L1_error) + __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, 1074, __pyx_L1_error) + 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_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1149 + /* "constraint/constraints.py":1153 * * * 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, 1149, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1149, __pyx_L1_error) + __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_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, 1149, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1153, __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, 1149, __pyx_L1_error) + __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, 1149, __pyx_L1_error) + __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, 1149, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 1153, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1160 + /* "constraint/constraints.py":1164 * """ # 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, 1160, __pyx_L1_error) + __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, 1160, __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, 1160, __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, 1160, __pyx_L1_error) + 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, 1160, __pyx_L1_error) + 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; - /* "constraint/constraints.py":1164 + /* "constraint/constraints.py":1168 * 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, 1164, __pyx_L1_error) + __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, 1164, __pyx_L1_error) + 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; - /* "constraint/constraints.py":1180 + /* "constraint/constraints.py":1186 * 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, 1180, __pyx_L1_error) + __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, 1180, __pyx_L1_error) + 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; - /* "constraint/constraints.py":1186 + /* "constraint/constraints.py":1192 * 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, 1186, __pyx_L1_error) + __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, 1186, __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, 1186, __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, 1186, __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, 1186, __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, 1186, __pyx_L1_error) + 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, 1186, __pyx_L1_error) + 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; - /* "constraint/constraints.py":1199 + /* "constraint/constraints.py":1205 * 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, 1199, __pyx_L1_error) + __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, 1199, __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, 1199, __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, 1199, __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, 1199, __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, 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, 1199, __pyx_L1_error) + 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; - /* "constraint/constraints.py":1149 + /* "constraint/constraints.py":1153 * * * 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, 1149, __pyx_L1_error) + __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, 1149, __pyx_L1_error) + 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_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1243 + /* "constraint/constraints.py":1249 * * * 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, 1243, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); - __pyx_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1243, __pyx_L1_error) + __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_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, 1243, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1249, __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, 1243, __pyx_L1_error) + __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, 1243, __pyx_L1_error) + __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, 1243, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 1249, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1254 + /* "constraint/constraints.py":1260 * """ * * 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, 1254, __pyx_L1_error) + __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, 1254, __pyx_L1_error) + 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; - /* "constraint/constraints.py":1262 + /* "constraint/constraints.py":1268 * 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, 1262, __pyx_L1_error) + __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, 1262, __pyx_L1_error) + 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; - /* "constraint/constraints.py":1266 + /* "constraint/constraints.py":1272 * 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, 1266, __pyx_L1_error) + __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, 1266, __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, 1266, __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, 1266, __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, 1266, __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, 1266, __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, 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, 1266, __pyx_L1_error) + 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; - /* "constraint/constraints.py":1243 + /* "constraint/constraints.py":1249 * * * 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, 1243, __pyx_L1_error) + __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, 1243, __pyx_L1_error) + 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1277 + /* "constraint/constraints.py":1283 * * * 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, 1277, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1277, __pyx_L1_error) + __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_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, 1277, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1283, __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, 1277, __pyx_L1_error) + __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, 1277, __pyx_L1_error) + __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, 1277, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 1283, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1288 + /* "constraint/constraints.py":1294 * """ * * 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, 1288, __pyx_L1_error) + __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, 1288, __pyx_L1_error) + 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; - /* "constraint/constraints.py":1296 + /* "constraint/constraints.py":1302 * 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, 1296, __pyx_L1_error) + __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, 1296, __pyx_L1_error) + 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; - /* "constraint/constraints.py":1300 + /* "constraint/constraints.py":1306 * 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, 1300, __pyx_L1_error) + __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, 1300, __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, 1300, __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, 1300, __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, 1300, __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, 1300, __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, 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, 1300, __pyx_L1_error) + 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; - /* "constraint/constraints.py":1277 + /* "constraint/constraints.py":1283 * * * 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, 1277, __pyx_L1_error) + __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, 1277, __pyx_L1_error) + 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_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":1311 + /* "constraint/constraints.py":1317 * * * 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, 1311, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1311, __pyx_L1_error) + __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_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, 1311, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1317, __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, 1311, __pyx_L1_error) + __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, 1311, __pyx_L1_error) + __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, 1311, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 1317, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1322 + /* "constraint/constraints.py":1328 * """ * * 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, 1322, __pyx_L1_error) + __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, 1322, __pyx_L1_error) + 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; - /* "constraint/constraints.py":1336 + /* "constraint/constraints.py":1342 * 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, 1336, __pyx_L1_error) + __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, 1336, __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, 1336, __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, 1336, __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, 1336, __pyx_L1_error) + 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, 1336, __pyx_L1_error) + 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; - /* "constraint/constraints.py":1311 + /* "constraint/constraints.py":1317 * * * 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, 1311, __pyx_L1_error) + __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, 1311, __pyx_L1_error) + 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_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1373 + /* "constraint/constraints.py":1379 * * * 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, 1373, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1373, __pyx_L1_error) + __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_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, 1373, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __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, 1373, __pyx_L1_error) + __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, 1373, __pyx_L1_error) + __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, 1373, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 1379, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1384 + /* "constraint/constraints.py":1390 * """ * * 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, 1384, __pyx_L1_error) + __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, 1384, __pyx_L1_error) + 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; - /* "constraint/constraints.py":1398 + /* "constraint/constraints.py":1404 * 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, 1398, __pyx_L1_error) + __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, 1398, __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, 1398, __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, 1398, __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, 1398, __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, 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, 1398, __pyx_L1_error) + 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; - /* "constraint/constraints.py":1373 + /* "constraint/constraints.py":1379 * * * 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, 1373, __pyx_L1_error) + __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, 1373, __pyx_L1_error) + 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_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -45735,7 +45822,7 @@ static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { __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, 1264, __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) return 0; __pyx_L1_error:; return -1; @@ -45758,14 +45845,14 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); - /* "constraint/constraints.py":860 + /* "constraint/constraints.py":862 * 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, 860, __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, 862, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); @@ -45802,14 +45889,14 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); - /* "constraint/constraints.py":1322 + /* "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, 1322, __pyx_L1_error) + __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]); __Pyx_RefNannyFinishContext(); @@ -45907,32 +45994,32 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { __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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 911, 2}; + 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), 912, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 914, 2}; 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 926, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 928, 2}; 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1066, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1070, 2}; 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1100, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1104, 2}; 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1235, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1241, 2}; 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; } @@ -46087,152 +46174,152 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { __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; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 849, 151}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 849, 161}; 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_3avS_Qb_E_4q_3a_Qb, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad; + __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; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 867, 24}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 869, 24}; 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; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 873, 167}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 875, 167}; 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; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 32, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 888, 427}; + 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 = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 945, 14}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 947, 14}; 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; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 953, 92}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 955, 92}; 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; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 964, 95}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 966, 95}; 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; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 991, 23}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 993, 23}; 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; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 995, 138}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 997, 148}; 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_3avS_4q_3a_Qb_E_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[53])) 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_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; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1011, 24}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1015, 24}; 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; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1017, 138}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1021, 138}; 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; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 31, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1030, 395}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 31, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1034, 395}; 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; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1085, 14}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1089, 14}; 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; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1093, 216}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1097, 216}; 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; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1121, 248}; + 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 = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1160, 23}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1164, 23}; 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; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1164, 138}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1168, 148}; 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_3avS_4q_3a_Qb_E_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[61])) goto bad; + __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; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1180, 24}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1186, 24}; 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; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1186, 138}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1192, 138}; 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; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 31, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1199, 395}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 31, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1205, 395}; 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; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1254, 11}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1260, 11}; 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; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1262, 14}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1268, 14}; 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; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1266, 91}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1272, 91}; 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; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1288, 11}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1294, 11}; 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; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1296, 14}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1302, 14}; 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; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1300, 91}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1306, 91}; 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; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1322, 30}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1328, 30}; 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; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1336, 249}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1342, 249}; 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; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1384, 30}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1390, 30}; 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; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1398, 249}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1404, 249}; 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; } diff --git a/constraint/parser.c b/constraint/parser.c index 4b24b0e..b2e2d74 100644 --- a/constraint/parser.c +++ b/constraint/parser.c @@ -1652,7 +1652,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr { }; -/* "constraint/parser.py":240 +/* "constraint/parser.py":238 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< @@ -1667,7 +1667,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr { }; -/* "constraint/parser.py":247 +/* "constraint/parser.py":245 * 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): # <<<<<<<<<<<<<< @@ -1682,7 +1682,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr { }; -/* "constraint/parser.py":270 +/* "constraint/parser.py":269 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< @@ -1696,7 +1696,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constrai }; -/* "constraint/parser.py":289 +/* "constraint/parser.py":288 * 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): # <<<<<<<<<<<<<< @@ -1711,7 +1711,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr { }; -/* "constraint/parser.py":299 +/* "constraint/parser.py":298 * * # remove functionally duplicate restrictions (preserves order and whitespace) * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< @@ -2884,6 +2884,7 @@ 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"; @@ -2936,7 +2937,6 @@ 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_number_is_int[] = "number_is_int"; 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"; @@ -3003,12 +3003,12 @@ static const char __pyx_k_restrictions_unique_indices[] = "restrictions_unique_i 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\n\000\t\031\230\n\240!\2408\2501\330\010\013\2101\330\014\017\210{\230#\230Q\330\020\023\2201\340\024\036\230a\360\006\000\025\037\230a\330\021\034\230C\230q\330\020\023\2201\340\024\036\230a\360\006\000\025\037\230a\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\240D\250\013\2603\260d\270$\270a\330\020\027\320\027'\240q\250\013\3203J\320JZ\320Z[\320[\\\330\021\034\230C\230u\240D\250\013\2603\260d\270$\270a\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\004\250K\260s\270$\270d\300!\330\024\033\320\033,\250A\250[\3208O\320O`\320`a\320ab\330\025 \240\003\2405\250\004\250K\260s\270$\270d\300!\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\004\250K\260s\270$\270d\300!\330\024\033\320\033+\2501\250K\3207N\320N^\320^_\320_`\330\025 \240\003\2405\250\004\250K\260s\270$\270d\300!\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_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_z_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\360z\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_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."; @@ -3367,8 +3367,8 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_number_is_int __pyx_string_tab[118] -#define __pyx_n_u_o __pyx_string_tab[119] +#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] @@ -6261,7 +6261,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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 */ -/* "constraint/parser.py":240 +/* "constraint/parser.py":238 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< @@ -6281,7 +6281,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_9_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 240, __pyx_L1_error) + __PYX_ERR(0, 238, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6292,7 +6292,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, 240, __pyx_L1_error) + __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_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6330,16 +6330,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, 240, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 240, __pyx_L1_error) } + 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 (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, 240, __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, 238, __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, 240, __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, 238, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6347,7 +6347,7 @@ 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, 240, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 238, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6357,7 +6357,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 240, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 238, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6368,13 +6368,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __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, 240, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 238, __pyx_L1_error) PyErr_Clear(); } break; @@ -6385,9 +6385,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, 240, __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, 240, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 240, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { @@ -6428,7 +6428,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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 */ -/* "constraint/parser.py":247 +/* "constraint/parser.py":245 * 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): # <<<<<<<<<<<<<< @@ -6448,7 +6448,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_10_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 247, __pyx_L1_error) + __PYX_ERR(0, 245, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6459,7 +6459,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, 247, __pyx_L1_error) + __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_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6499,16 +6499,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, 247, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 247, __pyx_L1_error) } + 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 (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, 247, __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, 245, __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, 247, __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, 245, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6516,7 +6516,7 @@ 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, 247, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 245, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6526,7 +6526,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 247, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 245, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6537,13 +6537,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __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, 247, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 245, __pyx_L1_error) PyErr_Clear(); } break; @@ -6561,11 +6561,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __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, 247, __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, 247, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = (!__pyx_t_7); if (__pyx_t_8) { @@ -6641,7 +6641,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ PyObject *__pyx_v_variable_operators_right = NULL; PyObject *__pyx_v_variable_unique_operators = NULL; PyObject *__pyx_v_number = NULL; - int __pyx_v_number_is_int; + double __pyx_v_offset; PyObject *__pyx_v_operators = NULL; PyObject *__pyx_v_operators_found = NULL; PyObject *__pyx_v_splitted = NULL; @@ -8740,190 +8740,183 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_XDECREF_SET(__pyx_v_variables_on_left, __pyx_t_7); __pyx_t_7 = 0; + /* "constraint/parser.py":202 + * + * # we can map '>' to '>=' and '<' to '<=' by adding a tiny offset to the number + * offset = 1e-12 # <<<<<<<<<<<<<< + * if comparator == "<": + * if variables_on_left: +*/ + __pyx_v_offset = 1e-12; + /* "constraint/parser.py":203 - * # if the number is an integer, we can map '>' to '>=' and '<' to '<=' by changing the number (does not work with floating points!) # noqa: E501 - * # TODO instead use the smallest floating point difference in Python / ^-10 - * number_is_int = isinstance(number, int) # <<<<<<<<<<<<<< - * if number_is_int: - * if comparator == "<": -*/ - __pyx_t_1 = PyLong_Check(__pyx_v_number); - __pyx_v_number_is_int = __pyx_t_1; - - /* "constraint/parser.py":204 - * # TODO instead use the smallest floating point difference in Python / ^-10 - * number_is_int = isinstance(number, int) - * if number_is_int: # <<<<<<<<<<<<<< - * if comparator == "<": - * if variables_on_left: -*/ - if (__pyx_v_number_is_int) { - - /* "constraint/parser.py":205 - * number_is_int = isinstance(number, int) - * if number_is_int: - * if comparator == "<": # <<<<<<<<<<<<<< - * if variables_on_left: - * # (x < 2) == (x <= 2-1) -*/ - __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, 205, __pyx_L1_error) + * # 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) + if (__pyx_t_1) { + + /* "constraint/parser.py":204 + * 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) if (__pyx_t_1) { /* "constraint/parser.py":206 - * if number_is_int: - * if comparator == "<": - * if variables_on_left: # <<<<<<<<<<<<<< - * # (x < 2) == (x <= 2-1) - * number -= 1 + * if variables_on_left: + * # (x < 2) == (x <= 2-offset) + * number -= offset # <<<<<<<<<<<<<< + * else: + * # (2 < x) == (2+offset <= x) */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 206, __pyx_L1_error) - if (__pyx_t_1) { + __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_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; - /* "constraint/parser.py":208 - * if variables_on_left: - * # (x < 2) == (x <= 2-1) - * number -= 1 # <<<<<<<<<<<<<< - * else: - * # (2 < x) == (2+1 <= x) + /* "constraint/parser.py":204 + * offset = 1e-12 + * if comparator == "<": + * if variables_on_left: # <<<<<<<<<<<<<< + * # (x < 2) == (x <= 2-offset) + * number -= offset */ - __pyx_t_5 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 208, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_5); - __pyx_t_5 = 0; + goto __pyx_L64; + } - /* "constraint/parser.py":206 - * if number_is_int: - * if comparator == "<": - * if variables_on_left: # <<<<<<<<<<<<<< - * # (x < 2) == (x <= 2-1) - * number -= 1 + /* "constraint/parser.py":209 + * else: + * # (2 < x) == (2+offset <= x) + * number += offset # <<<<<<<<<<<<<< + * elif comparator == ">": + * if variables_on_left: */ - goto __pyx_L65; - } + /*else*/ { + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 209, __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_L64:; - /* "constraint/parser.py":211 - * else: - * # (2 < x) == (2+1 <= x) - * number += 1 # <<<<<<<<<<<<<< - * elif comparator == ">": - * if variables_on_left: + /* "constraint/parser.py":203 + * # 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) */ - /*else*/ { - __pyx_t_5 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_5); - __pyx_t_5 = 0; - } - __pyx_L65:; + goto __pyx_L63; + } - /* "constraint/parser.py":205 - * number_is_int = isinstance(number, int) - * if number_is_int: - * if comparator == "<": # <<<<<<<<<<<<<< - * if variables_on_left: - * # (x < 2) == (x <= 2-1) + /* "constraint/parser.py":210 + * # (2 < x) == (2+offset <= x) + * number += offset + * elif comparator == ">": # <<<<<<<<<<<<<< + * if variables_on_left: + * # (x > 2) == (x >= 2+offset) */ - goto __pyx_L64; - } + __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) + if (__pyx_t_1) { - /* "constraint/parser.py":212 - * # (2 < x) == (2+1 <= x) - * number += 1 - * elif comparator == ">": # <<<<<<<<<<<<<< - * if variables_on_left: - * # (x > 2) == (x >= 2+1) + /* "constraint/parser.py":211 + * number += offset + * elif comparator == ">": + * if variables_on_left: # <<<<<<<<<<<<<< + * # (x > 2) == (x >= 2+offset) + * number += 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, 212, __pyx_L1_error) + __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":213 - * number += 1 - * elif comparator == ">": - * if variables_on_left: # <<<<<<<<<<<<<< - * # (x > 2) == (x >= 2+1) - * number += 1 -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 213, __pyx_L1_error) - if (__pyx_t_1) { - - /* "constraint/parser.py":215 - * if variables_on_left: - * # (x > 2) == (x >= 2+1) - * number += 1 # <<<<<<<<<<<<<< - * else: - * # (2 > x) == (2-1 >= x) + * if variables_on_left: + * # (x > 2) == (x >= 2+offset) + * number += offset # <<<<<<<<<<<<<< + * else: + * # (2 > x) == (2-offset >= x) */ - __pyx_t_5 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_5); - __pyx_t_5 = 0; + __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_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; - /* "constraint/parser.py":213 - * number += 1 - * elif comparator == ">": - * if variables_on_left: # <<<<<<<<<<<<<< - * # (x > 2) == (x >= 2+1) - * number += 1 + /* "constraint/parser.py":211 + * number += offset + * elif comparator == ">": + * if variables_on_left: # <<<<<<<<<<<<<< + * # (x > 2) == (x >= 2+offset) + * number += offset */ - goto __pyx_L66; - } + goto __pyx_L65; + } - /* "constraint/parser.py":218 - * else: - * # (2 > x) == (2-1 >= x) - * number -= 1 # <<<<<<<<<<<<<< + /* "constraint/parser.py":216 + * else: + * # (2 > x) == (2-offset >= x) + * number -= offset # <<<<<<<<<<<<<< * * # check if an operator is applied on the variables, if not return */ - /*else*/ { - __pyx_t_5 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_5); - __pyx_t_5 = 0; - } - __pyx_L66:; - - /* "constraint/parser.py":212 - * # (2 < x) == (2+1 <= x) - * number += 1 - * elif comparator == ">": # <<<<<<<<<<<<<< - * if variables_on_left: - * # (x > 2) == (x >= 2+1) -*/ + /*else*/ { + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 216, __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_L64:; + __pyx_L65:; - /* "constraint/parser.py":204 - * # TODO instead use the smallest floating point difference in Python / ^-10 - * number_is_int = isinstance(number, int) - * if number_is_int: # <<<<<<<<<<<<<< - * if comparator == "<": - * if variables_on_left: + /* "constraint/parser.py":210 + * # (2 < x) == (2+offset <= x) + * number += offset + * elif comparator == ">": # <<<<<<<<<<<<<< + * if variables_on_left: + * # (x > 2) == (x >= 2+offset) */ } + __pyx_L63:; - /* "constraint/parser.py":221 + /* "constraint/parser.py":219 * * # 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, 221, __pyx_L1_error) + __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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, 221, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_mstate_global->__pyx_kp_u__13) != (0)) __PYX_ERR(0, 219, __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, 221, __pyx_L1_error); + 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, 221, __pyx_L1_error); + 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; - /* "constraint/parser.py":222 + /* "constraint/parser.py":220 * # check if an operator is applied on the variables, if not return * operators = [r"\*\*", r"\*", r"\+"] * operators_found = re.findall(str("|".join(operators)), variables) # <<<<<<<<<<<<<< @@ -8931,12 +8924,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # 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, 222, __pyx_L1_error) + __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, 222, __pyx_L1_error) + __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_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, 222, __pyx_L1_error) + __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_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -8956,24 +8949,24 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 222, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_v_operators_found = __pyx_t_5; __pyx_t_5 = 0; - /* "constraint/parser.py":223 + /* "constraint/parser.py":221 * 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, 223, __pyx_L1_error) + __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_1 = (__pyx_t_3 == 0); if (__pyx_t_1) { - /* "constraint/parser.py":225 + /* "constraint/parser.py":223 * if len(operators_found) == 0: * # no operators found, return only based on comparator * if len(params) != 1 or variables not in params: # <<<<<<<<<<<<<< @@ -8982,20 +8975,20 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __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, 225, __pyx_L1_error) + __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_6 = (__pyx_t_3 != 1); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L69_bool_binop_done; + goto __pyx_L68_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, 225, __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, 223, __pyx_L1_error) __pyx_t_1 = __pyx_t_6; - __pyx_L69_bool_binop_done:; + __pyx_L68_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":227 + /* "constraint/parser.py":225 * if len(params) != 1 or variables not in params: * # there were more than one variable but no operator * return None # <<<<<<<<<<<<<< @@ -9006,7 +8999,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":225 + /* "constraint/parser.py":223 * if len(operators_found) == 0: * # no operators found, return only based on comparator * if len(params) != 1 or variables not in params: # <<<<<<<<<<<<<< @@ -9015,26 +9008,26 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":230 + /* "constraint/parser.py":228 * # 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 == "<" and number_is_int): + * 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, 230, __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, 228, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":231 + /* "constraint/parser.py":229 * # 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 == "<" and number_is_int): + * elif comparator == "<=" or comparator == "<": * 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, 231, __pyx_L1_error) + __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_9 = 1; #if CYTHON_UNPACK_METHODS @@ -9053,57 +9046,52 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 231, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":230 + /* "constraint/parser.py":228 * # 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 == "<" and number_is_int): + * elif comparator == "<=" or comparator == "<": */ } - /* "constraint/parser.py":232 + /* "constraint/parser.py":230 * elif comparator == "==": * return ExactSumConstraint(number) - * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< + * elif comparator == "<=" or comparator == "<": # <<<<<<<<<<<<<< * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): + * 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, 232, __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, 230, __pyx_L1_error) if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L71_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, 232, __pyx_L1_error) - if (__pyx_t_6) { - } else { - __pyx_t_1 = __pyx_t_6; - goto __pyx_L71_bool_binop_done; + goto __pyx_L70_bool_binop_done; } - __pyx_t_1 = __pyx_v_number_is_int; - __pyx_L71_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_1 = __pyx_t_6; + __pyx_L70_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":233 + /* "constraint/parser.py":231 * return ExactSumConstraint(number) - * elif comparator == "<=" or (comparator == "<" and number_is_int): + * elif comparator == "<=" or comparator == "<": * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< - * elif comparator == ">=" or (comparator == ">" and number_is_int): + * elif comparator == ">=" or comparator == ">": * 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, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 231, __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, 233, __pyx_L1_error) + __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_9 = 1; #if CYTHON_UNPACK_METHODS @@ -9122,14 +9110,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_5 = __pyx_t_8; __pyx_t_8 = 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, 233, __pyx_L1_error) + __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_9 = 1; #if CYTHON_UNPACK_METHODS @@ -9148,7 +9136,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_5 = __pyx_t_8; @@ -9158,50 +9146,45 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":232 + /* "constraint/parser.py":230 * elif comparator == "==": * return ExactSumConstraint(number) - * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< + * elif comparator == "<=" or comparator == "<": # <<<<<<<<<<<<<< * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): + * elif comparator == ">=" or comparator == ">": */ } - /* "constraint/parser.py":234 - * elif comparator == "<=" or (comparator == "<" and number_is_int): + /* "constraint/parser.py":232 + * elif comparator == "<=" or comparator == "<": * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< + * 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, 234, __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, 232, __pyx_L1_error) if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L74_bool_binop_done; + goto __pyx_L72_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, 234, __pyx_L1_error) - if (__pyx_t_6) { - } else { - __pyx_t_1 = __pyx_t_6; - goto __pyx_L74_bool_binop_done; - } - __pyx_t_1 = __pyx_v_number_is_int; - __pyx_L74_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_1 = __pyx_t_6; + __pyx_L72_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":235 + /* "constraint/parser.py":233 * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): + * elif comparator == ">=" or comparator == ">": * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) # <<<<<<<<<<<<<< * raise ValueError(f"Invalid comparator {comparator}") * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 235, __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) { __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) + __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_9 = 1; #if CYTHON_UNPACK_METHODS @@ -9220,14 +9203,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 235, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_5 = __pyx_t_8; __pyx_t_8 = 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, 235, __pyx_L1_error) + __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_9 = 1; #if CYTHON_UNPACK_METHODS @@ -9246,7 +9229,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 235, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_5 = __pyx_t_8; @@ -9256,17 +9239,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":234 - * elif comparator == "<=" or (comparator == "<" and number_is_int): + /* "constraint/parser.py":232 + * elif comparator == "<=" or comparator == "<": * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< + * elif comparator == ">=" or comparator == ">": # <<<<<<<<<<<<<< * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * raise ValueError(f"Invalid comparator {comparator}") */ } - /* "constraint/parser.py":236 - * elif comparator == ">=" or (comparator == ">" and number_is_int): + /* "constraint/parser.py":234 + * elif comparator == ">=" or comparator == ">": * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * raise ValueError(f"Invalid comparator {comparator}") # <<<<<<<<<<<<<< * @@ -9275,9 +9258,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 236, __pyx_L1_error) + __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, 236, __pyx_L1_error) + __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_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = 1; @@ -9287,14 +9270,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 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, 236, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 236, __pyx_L1_error) + __PYX_ERR(0, 234, __pyx_L1_error) - /* "constraint/parser.py":223 + /* "constraint/parser.py":221 * operators = [r"\*\*", r"\*", r"\+"] * operators_found = re.findall(str("|".join(operators)), variables) * if len(operators_found) == 0: # <<<<<<<<<<<<<< @@ -9303,37 +9286,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":239 + /* "constraint/parser.py":237 * * # 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, 239, __pyx_L1_error) + __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; - /* "constraint/parser.py":240 + /* "constraint/parser.py":238 * # 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, 240, __pyx_L1_error) + __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, 240, __pyx_L1_error) + __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, 240, __pyx_L1_error) + __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_6 = (!__pyx_t_1); if (__pyx_t_6) { - /* "constraint/parser.py":242 + /* "constraint/parser.py":240 * 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 # <<<<<<<<<<<<<< @@ -9344,7 +9327,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":240 + /* "constraint/parser.py":238 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< @@ -9353,7 +9336,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":245 + /* "constraint/parser.py":243 * * # split the string on the comparison * splitted = variables.split(operator) # <<<<<<<<<<<<<< @@ -9367,52 +9350,52 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ 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, 245, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_splitted = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/parser.py":247 + /* "constraint/parser.py":245 * 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, 247, __pyx_L1_error) + __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, 247, __pyx_L1_error) + __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_1 = (__pyx_t_3 == __pyx_t_13); if (__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L79_bool_binop_done; + goto __pyx_L76_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, 247, __pyx_L1_error) + __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, 247, __pyx_L1_error) + __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, 247, __pyx_L1_error) + __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_6 = __pyx_t_1; - __pyx_L79_bool_binop_done:; + __pyx_L76_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":249 + /* "constraint/parser.py":247 * 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, 249, __pyx_L1_error) + __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) if (__pyx_t_6) { - /* "constraint/parser.py":251 + /* "constraint/parser.py":249 * if operator == "**": * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None # <<<<<<<<<<<<<< @@ -9423,7 +9406,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":249 + /* "constraint/parser.py":247 * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): * # map to a Constraint * if operator == "**": # <<<<<<<<<<<<<< @@ -9432,36 +9415,36 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":252 + /* "constraint/parser.py":250 * # 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, 252, __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, 250, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":253 + /* "constraint/parser.py":251 * return None * elif operator == "*": * if comparator == "==": # <<<<<<<<<<<<<< * return ExactProdConstraint(number) - * elif comparator == "<=" or (comparator == "<" and number_is_int): + * 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, 253, __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, 251, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":254 + /* "constraint/parser.py":252 * elif operator == "*": * if comparator == "==": * return ExactProdConstraint(number) # <<<<<<<<<<<<<< - * elif comparator == "<=" or (comparator == "<" and number_is_int): + * elif comparator == "<=" or comparator == "<": * 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, 254, __pyx_L1_error) + __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_9 = 1; #if CYTHON_UNPACK_METHODS @@ -9480,57 +9463,52 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 254, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":253 + /* "constraint/parser.py":251 * return None * elif operator == "*": * if comparator == "==": # <<<<<<<<<<<<<< * return ExactProdConstraint(number) - * elif comparator == "<=" or (comparator == "<" and number_is_int): + * elif comparator == "<=" or comparator == "<": */ } - /* "constraint/parser.py":255 + /* "constraint/parser.py":253 * if comparator == "==": * return ExactProdConstraint(number) - * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< + * elif comparator == "<=" or comparator == "<": # <<<<<<<<<<<<<< * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): + * 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, 255, __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, 253, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L83_bool_binop_done; + goto __pyx_L80_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, 255, __pyx_L1_error) - if (__pyx_t_1) { - } else { - __pyx_t_6 = __pyx_t_1; - goto __pyx_L83_bool_binop_done; - } - __pyx_t_6 = __pyx_v_number_is_int; - __pyx_L83_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_6 = __pyx_t_1; + __pyx_L80_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":256 + /* "constraint/parser.py":254 * return ExactProdConstraint(number) - * elif comparator == "<=" or (comparator == "<" and number_is_int): + * elif comparator == "<=" or comparator == "<": * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) # <<<<<<<<<<<<<< - * elif comparator == ">=" or (comparator == ">" and number_is_int): + * elif comparator == ">=" or comparator == ">": * 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, 256, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 254, __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, 256, __pyx_L1_error) + __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_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -9549,14 +9527,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 256, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } __pyx_t_5 = __pyx_t_11; __pyx_t_11 = 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, 256, __pyx_L1_error) + __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_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -9575,7 +9553,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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_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) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } __pyx_t_5 = __pyx_t_11; @@ -9585,50 +9563,45 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":255 + /* "constraint/parser.py":253 * if comparator == "==": * return ExactProdConstraint(number) - * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< + * elif comparator == "<=" or comparator == "<": # <<<<<<<<<<<<<< * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): + * elif comparator == ">=" or comparator == ">": */ } - /* "constraint/parser.py":257 - * elif comparator == "<=" or (comparator == "<" and number_is_int): + /* "constraint/parser.py":255 + * elif comparator == "<=" or comparator == "<": * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< + * 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, 257, __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, 255, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L86_bool_binop_done; + goto __pyx_L82_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, 257, __pyx_L1_error) - if (__pyx_t_1) { - } else { - __pyx_t_6 = __pyx_t_1; - goto __pyx_L86_bool_binop_done; - } - __pyx_t_6 = __pyx_v_number_is_int; - __pyx_L86_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_6 = __pyx_t_1; + __pyx_L82_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":258 + /* "constraint/parser.py":256 * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): + * elif comparator == ">=" or comparator == ">": * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) # <<<<<<<<<<<<<< * elif operator == "+": * 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, 258, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 256, __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, 258, __pyx_L1_error) + __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_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -9647,14 +9620,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 258, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } __pyx_t_5 = __pyx_t_11; __pyx_t_11 = 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, 258, __pyx_L1_error) + __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_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -9673,7 +9646,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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_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, 258, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } __pyx_t_5 = __pyx_t_11; @@ -9683,55 +9656,55 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":257 - * elif comparator == "<=" or (comparator == "<" and number_is_int): + /* "constraint/parser.py":255 + * elif comparator == "<=" or comparator == "<": * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< + * elif comparator == ">=" or comparator == ">": # <<<<<<<<<<<<<< * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": */ } - /* "constraint/parser.py":252 + /* "constraint/parser.py":250 * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None * elif operator == "*": # <<<<<<<<<<<<<< * if comparator == "==": * return ExactProdConstraint(number) */ - goto __pyx_L81; + goto __pyx_L78; } - /* "constraint/parser.py":259 - * elif comparator == ">=" or (comparator == ">" and number_is_int): + /* "constraint/parser.py":257 + * 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, 259, __pyx_L1_error) + __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) if (likely(__pyx_t_6)) { - /* "constraint/parser.py":260 + /* "constraint/parser.py":258 * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": * if comparator == "==": # <<<<<<<<<<<<<< * return ExactSumConstraint(number) - * elif comparator == "<=" or (comparator == "<" and number_is_int): + * 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, 260, __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, 258, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":261 + /* "constraint/parser.py":259 * elif operator == "+": * if comparator == "==": * return ExactSumConstraint(number) # <<<<<<<<<<<<<< - * elif comparator == "<=" or (comparator == "<" and number_is_int): - * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) + * elif comparator == "<=" or comparator == "<": + * # 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, 261, __pyx_L1_error) + __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_9 = 1; #if CYTHON_UNPACK_METHODS @@ -9750,57 +9723,52 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 261, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":260 + /* "constraint/parser.py":258 * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": * if comparator == "==": # <<<<<<<<<<<<<< * return ExactSumConstraint(number) - * elif comparator == "<=" or (comparator == "<" and number_is_int): + * elif comparator == "<=" or comparator == "<": */ } - /* "constraint/parser.py":262 + /* "constraint/parser.py":260 * if comparator == "==": * return ExactSumConstraint(number) - * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< + * elif comparator == "<=" or comparator == "<": # <<<<<<<<<<<<<< + * # raise ValueError(restriction, comparator) * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): */ - __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, 262, __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, 260, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L90_bool_binop_done; + goto __pyx_L85_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, 262, __pyx_L1_error) - if (__pyx_t_1) { - } else { - __pyx_t_6 = __pyx_t_1; - goto __pyx_L90_bool_binop_done; - } - __pyx_t_6 = __pyx_v_number_is_int; - __pyx_L90_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_6 = __pyx_t_1; + __pyx_L85_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":263 - * return ExactSumConstraint(number) - * elif comparator == "<=" or (comparator == "<" and number_is_int): + /* "constraint/parser.py":262 + * elif comparator == "<=" or comparator == "<": + * # raise ValueError(restriction, comparator) * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< - * elif comparator == ">=" or (comparator == ">" and number_is_int): + * elif comparator == ">=" or comparator == ">": * 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, 263, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 262, __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, 263, __pyx_L1_error) + __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 @@ -9819,14 +9787,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 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, 263, __pyx_L1_error) + __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 @@ -9845,7 +9813,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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_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, 263, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_5 = __pyx_t_2; @@ -9855,50 +9823,45 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":262 + /* "constraint/parser.py":260 * if comparator == "==": * return ExactSumConstraint(number) - * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< + * elif comparator == "<=" or comparator == "<": # <<<<<<<<<<<<<< + * # raise ValueError(restriction, comparator) * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): */ } - /* "constraint/parser.py":264 - * elif comparator == "<=" or (comparator == "<" and number_is_int): + /* "constraint/parser.py":263 + * # raise ValueError(restriction, comparator) * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< + * 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, 264, __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, 263, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L93_bool_binop_done; + goto __pyx_L87_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, 264, __pyx_L1_error) - if (__pyx_t_1) { - } else { - __pyx_t_6 = __pyx_t_1; - goto __pyx_L93_bool_binop_done; - } - __pyx_t_6 = __pyx_v_number_is_int; - __pyx_L93_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_6 = __pyx_t_1; + __pyx_L87_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":265 + /* "constraint/parser.py":264 * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): + * elif comparator == ">=" or comparator == ">": * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) # <<<<<<<<<<<<<< * else: * 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, 265, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 264, __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, 265, __pyx_L1_error) + __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_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -9917,14 +9880,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 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, 265, __pyx_L1_error) + __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_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -9943,7 +9906,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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_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, 265, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_5 = __pyx_t_2; @@ -9953,26 +9916,26 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/parser.py":264 - * elif comparator == "<=" or (comparator == "<" and number_is_int): + /* "constraint/parser.py":263 + * # raise ValueError(restriction, comparator) * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< + * elif comparator == ">=" or comparator == ">": # <<<<<<<<<<<<<< * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * else: */ } - /* "constraint/parser.py":259 - * elif comparator == ">=" or (comparator == ">" and number_is_int): + /* "constraint/parser.py":257 + * elif comparator == ">=" or comparator == ">": * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": # <<<<<<<<<<<<<< * if comparator == "==": * return ExactSumConstraint(number) */ - goto __pyx_L81; + goto __pyx_L78; } - /* "constraint/parser.py":267 + /* "constraint/parser.py":266 * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * else: * raise ValueError(f"Invalid operator {operator}") # <<<<<<<<<<<<<< @@ -9983,9 +9946,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 267, __pyx_L1_error) + __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_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, 267, __pyx_L1_error) + __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_t_9 = 1; @@ -9995,16 +9958,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 267, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 267, __pyx_L1_error) + __PYX_ERR(0, 266, __pyx_L1_error) } - __pyx_L81:; + __pyx_L78:; - /* "constraint/parser.py":247 + /* "constraint/parser.py":245 * 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): # <<<<<<<<<<<<<< @@ -10013,7 +9976,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":268 + /* "constraint/parser.py":267 * else: * raise ValueError(f"Invalid operator {operator}") * return None # <<<<<<<<<<<<<< @@ -10090,7 +10053,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ return __pyx_r; } -/* "constraint/parser.py":270 +/* "constraint/parser.py":269 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< @@ -10139,39 +10102,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, 270, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 269, __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, 270, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 269, __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, 270, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 269, __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, 270, __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, 269, __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, 270, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_equality_constraint", 1, 2, 2, i); __PYX_ERR(0, 269, __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, 270, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 269, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 270, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 269, __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, 270, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("to_equality_constraint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 269, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10182,8 +10145,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, 271, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 271, __pyx_L1_error) + 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) __pyx_r = __pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality_constraint(__pyx_self, __pyx_v_restriction, __pyx_v_params); /* function exit code */ @@ -10204,7 +10167,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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 */ -/* "constraint/parser.py":289 +/* "constraint/parser.py":288 * 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): # <<<<<<<<<<<<<< @@ -10224,7 +10187,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_22to_equalit if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 289, __pyx_L1_error) + __PYX_ERR(0, 288, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10235,7 +10198,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_22to_equalit __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, 289, __pyx_L1_error) + __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_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -10274,21 +10237,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, 289, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 289, __pyx_L1_error) } + 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) } __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, 289, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 288, __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, 289, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __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); @@ -10301,11 +10264,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit 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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __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, 289, __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, 289, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { @@ -10346,7 +10309,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit return __pyx_r; } -/* "constraint/parser.py":270 +/* "constraint/parser.py":269 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< @@ -10381,7 +10344,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 270, __pyx_L1_error) + __PYX_ERR(0, 269, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10392,7 +10355,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":275 + /* "constraint/parser.py":274 * """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): # <<<<<<<<<<<<<< @@ -10401,21 +10364,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, 275, __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, 274, __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, 275, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 274, __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, 275, __pyx_L1_error) + __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, 275, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (__pyx_t_2 != __pyx_t_3); if (__pyx_t_4) { - /* "constraint/parser.py":276 + /* "constraint/parser.py":275 * # check if all parameters are involved * if len(params) != len(tune_params): * return None # <<<<<<<<<<<<<< @@ -10426,7 +10389,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":275 + /* "constraint/parser.py":274 * """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): # <<<<<<<<<<<<<< @@ -10435,7 +10398,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":279 + /* "constraint/parser.py":278 * * # find whether (in)equalities appear in this restriction * equalities_found = re.findall("==", restriction) # <<<<<<<<<<<<<< @@ -10443,9 +10406,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, 279, __pyx_L1_error) + __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_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, 279, __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, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = 1; @@ -10465,13 +10428,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 279, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_equalities_found = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":280 + /* "constraint/parser.py":279 * # find whether (in)equalities appear in this restriction * equalities_found = re.findall("==", restriction) * inequalities_found = re.findall("!=", restriction) # <<<<<<<<<<<<<< @@ -10479,9 +10442,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, 280, __pyx_L1_error) + __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_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, 280, __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, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = 1; @@ -10501,37 +10464,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 280, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_inequalities_found = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":282 + /* "constraint/parser.py":281 * 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, 282, __pyx_L1_error) + __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_4 = (__pyx_t_3 > 0); - __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_4))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_4))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __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, 282, __pyx_L1_error) + __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_4 = (__pyx_t_3 > 0); - __pyx_t_6 = __Pyx_PyBool_FromLong((!(!__pyx_t_4))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBool_FromLong((!(!__pyx_t_4))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 281, __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, 282, __pyx_L1_error) + __pyx_t_7 = PyNumber_Xor(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __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, 282, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 281, __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":283 + /* "constraint/parser.py":282 * # 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 # <<<<<<<<<<<<<< @@ -10542,7 +10505,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":282 + /* "constraint/parser.py":281 * 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)): # <<<<<<<<<<<<<< @@ -10551,22 +10514,22 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":284 + /* "constraint/parser.py":283 * 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, 284, __pyx_L1_error) + __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_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, 284, __pyx_L1_error) + __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_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, 284, __pyx_L1_error) + __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_GOTREF(__pyx_t_6); __pyx_t_7 = __pyx_t_6; __pyx_t_6 = 0; @@ -10574,29 +10537,29 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __pyx_v_comparator = __pyx_t_7; __pyx_t_7 = 0; - /* "constraint/parser.py":287 + /* "constraint/parser.py":286 * * # 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, 287, __pyx_L1_error) + __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_GOTREF(__pyx_t_7); __pyx_v_splitted = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/parser.py":289 + /* "constraint/parser.py":288 * 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, 289, __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, 288, __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, 289, __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, 288, __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) { @@ -10604,28 +10567,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, 289, __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, 288, __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, 289, __pyx_L1_error) + __pyx_t_6 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __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, 289, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 288, __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":291 + /* "constraint/parser.py":290 * 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, 291, __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, 290, __pyx_L1_error) if (__pyx_t_9) { - /* "constraint/parser.py":292 + /* "constraint/parser.py":291 * # map to a Constraint * if comparator == "==": * return AllEqualConstraint() # <<<<<<<<<<<<<< @@ -10634,7 +10597,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, 292, __pyx_L1_error) + __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_GOTREF(__pyx_t_1); __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS @@ -10653,14 +10616,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 292, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/parser.py":291 + /* "constraint/parser.py":290 * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): * # map to a Constraint * if comparator == "==": # <<<<<<<<<<<<<< @@ -10669,17 +10632,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":293 + /* "constraint/parser.py":292 * 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, 293, __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, 292, __pyx_L1_error) if (__pyx_t_9) { - /* "constraint/parser.py":294 + /* "constraint/parser.py":293 * return AllEqualConstraint() * elif comparator == "!=": * return AllDifferentConstraint() # <<<<<<<<<<<<<< @@ -10688,7 +10651,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, 294, __pyx_L1_error) + __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_GOTREF(__pyx_t_7); __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS @@ -10707,14 +10670,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 294, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/parser.py":293 + /* "constraint/parser.py":292 * if comparator == "==": * return AllEqualConstraint() * elif comparator == "!=": # <<<<<<<<<<<<<< @@ -10723,7 +10686,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":295 + /* "constraint/parser.py":294 * elif comparator == "!=": * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") # <<<<<<<<<<<<<< @@ -10734,9 +10697,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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, 295, __pyx_L1_error) + __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_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, 295, __pyx_L1_error) + __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_t_8 = 1; @@ -10746,14 +10709,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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, 295, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/parser.py":289 + /* "constraint/parser.py":288 * 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): # <<<<<<<<<<<<<< @@ -10762,7 +10725,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":296 + /* "constraint/parser.py":295 * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") * return None # <<<<<<<<<<<<<< @@ -10773,7 +10736,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":270 + /* "constraint/parser.py":269 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< @@ -10803,7 +10766,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality } static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":299 +/* "constraint/parser.py":298 * * # remove functionally duplicate restrictions (preserves order and whitespace) * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< @@ -10823,7 +10786,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(CY if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 299, __pyx_L1_error) + __PYX_ERR(0, 298, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10831,7 +10794,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, 299, __pyx_L1_error) + __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_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -10868,21 +10831,21 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator1 return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 299, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 299, __pyx_L1_error) } + 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) } __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, 299, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 298, __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, 299, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __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); @@ -11069,42 +11032,42 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __pyx_v_to_numeric_constraint = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":270 + /* "constraint/parser.py":269 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __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, 270, __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, 270, __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, 270, __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, 270, __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, 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) __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":299 + /* "constraint/parser.py":298 * * # 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] */ - __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(NULL, __pyx_v_restrictions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __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, 298, __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, 299, __pyx_L1_error) + __pyx_t_1 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __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, 299, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "constraint/parser.py":301 + /* "constraint/parser.py":300 * if all(isinstance(r, str) for r in restrictions): * # clean the restriction strings to functional equivalence * restrictions_cleaned = [r.replace(' ', '') for r in restrictions] # <<<<<<<<<<<<<< @@ -11112,7 +11075,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * # 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, 301, __pyx_L6_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_v_restrictions; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; @@ -11120,22 +11083,22 @@ 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, 301, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 300, __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_4; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L6_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_9genexpr16__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, 301, __pyx_L6_error) + __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_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, 301, __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, 300, __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, 301, __pyx_L6_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 300, __pyx_L6_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11149,7 +11112,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __pyx_v_restrictions_cleaned = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":302 + /* "constraint/parser.py":301 * # 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 # <<<<<<<<<<<<<< @@ -11163,16 +11126,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED 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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __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, 302, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __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":304 + /* "constraint/parser.py":303 * 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] # <<<<<<<<<<<<<< @@ -11180,7 +11143,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * */ { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L13_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __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; @@ -11188,19 +11151,19 @@ 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_L13_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 303, __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_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L13_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_9genexpr17__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, 304, __pyx_L13_error) + __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_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 304, __pyx_L13_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 303, __pyx_L13_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11214,7 +11177,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __pyx_v_restrictions_unique_indices = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":305 + /* "constraint/parser.py":304 * # 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] # <<<<<<<<<<<<<< @@ -11222,7 +11185,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, 305, __pyx_L20_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __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; @@ -11230,19 +11193,19 @@ 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, 305, __pyx_L20_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 304, __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_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 305, __pyx_L20_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_9genexpr18__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, 305, __pyx_L20_error) + __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_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 305, __pyx_L20_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 304, __pyx_L20_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11256,7 +11219,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __Pyx_DECREF_SET(__pyx_v_restrictions, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "constraint/parser.py":299 + /* "constraint/parser.py":298 * * # remove functionally duplicate restrictions (preserves order and whitespace) * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< @@ -11265,32 +11228,32 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":308 + /* "constraint/parser.py":307 * * # 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, 308, __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, 307, __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, 308, __pyx_L1_error) + 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) __Pyx_DECREF_SET(__pyx_v_restrictions, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "constraint/parser.py":310 + /* "constraint/parser.py":309 * 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, 310, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_parsed_restrictions = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":311 + /* "constraint/parser.py":310 * # split into functions that only take their relevant parameters * parsed_restrictions = list() * for res in restrictions: # <<<<<<<<<<<<<< @@ -11299,7 +11262,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, 311, __pyx_L1_error) + __PYX_ERR(0, 310, __pyx_L1_error) } __pyx_t_2 = __pyx_v_restrictions; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; @@ -11307,32 +11270,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, 311, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 310, __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_4; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":312 + /* "constraint/parser.py":311 * 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, 312, __pyx_L1_error) + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __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":313 + /* "constraint/parser.py":312 * for res in restrictions: * params_used: set[str] = set() * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() # <<<<<<<<<<<<<< @@ -11340,9 +11303,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, 313, __pyx_L1_error) + __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_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, 313, __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, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_7 = 1; @@ -11362,7 +11325,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __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_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, 313, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __pyx_t_5; @@ -11373,25 +11336,25 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __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_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, 313, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __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":314 + /* "constraint/parser.py":313 * 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, 314, __pyx_L1_error) + __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_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_params_used_list, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/parser.py":315 + /* "constraint/parser.py":314 * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() * params_used_list = list(params_used) * finalized_constraint = None # <<<<<<<<<<<<<< @@ -11401,25 +11364,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":316 + /* "constraint/parser.py":315 * 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, 316, __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, 315, __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, 316, __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, 315, __pyx_L1_error) __pyx_t_3 = __pyx_t_11; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - /* "constraint/parser.py":318 + /* "constraint/parser.py":317 * if " or " not in res and " and " not in res: * # if applicable, strip the outermost round brackets * while ( # <<<<<<<<<<<<<< @@ -11428,16 +11391,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ while (1) { - /* "constraint/parser.py":319 + /* "constraint/parser.py":318 * # 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, 319, __pyx_L1_error) + __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_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, 319, __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, 318, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { } else { @@ -11445,16 +11408,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":320 + /* "constraint/parser.py":319 * 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, 320, __pyx_L1_error) + __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_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, 320, __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, 319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { } else { @@ -11462,16 +11425,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":321 + /* "constraint/parser.py":320 * 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, 321, __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, 320, __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, 321, __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, 320, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { } else { @@ -11479,48 +11442,48 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":322 + /* "constraint/parser.py":321 * 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, 322, __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, 321, __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, 322, __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, 321, __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":324 + /* "constraint/parser.py":323 * 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, 324, __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, 323, __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":326 + /* "constraint/parser.py":325 * 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, 326, __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, 326, __pyx_L1_error) + 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; - /* "constraint/parser.py":327 + /* "constraint/parser.py":326 * # 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: # <<<<<<<<<<<<<< @@ -11530,20 +11493,20 @@ 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":329 + /* "constraint/parser.py":328 * 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, 329, __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, 329, __pyx_L1_error) + 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_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":327 + /* "constraint/parser.py":326 * # 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: # <<<<<<<<<<<<<< @@ -11552,7 +11515,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":316 + /* "constraint/parser.py":315 * params_used_list = list(params_used) * finalized_constraint = None * if " or " not in res and " and " not in res: # <<<<<<<<<<<<<< @@ -11561,7 +11524,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":330 + /* "constraint/parser.py":329 * # 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: # <<<<<<<<<<<<<< @@ -11571,16 +11534,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":332 + /* "constraint/parser.py":331 * 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, 332, __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, 331, __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, 332, __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, 331, __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; @@ -11588,14 +11551,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, 332, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __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":330 + /* "constraint/parser.py":329 * # 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: # <<<<<<<<<<<<<< @@ -11604,25 +11567,25 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":333 + /* "constraint/parser.py":332 * # 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, 333, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __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, 333, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_finalized_constraint) != (0)) __PYX_ERR(0, 332, __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, 333, __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, 333, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/parser.py":311 + /* "constraint/parser.py":310 * # split into functions that only take their relevant parameters * parsed_restrictions = list() * for res in restrictions: # <<<<<<<<<<<<<< @@ -11632,7 +11595,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":335 + /* "constraint/parser.py":334 * parsed_restrictions.append((finalized_constraint, params_used_list)) * * return parsed_restrictions # <<<<<<<<<<<<<< @@ -11688,7 +11651,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED return __pyx_r; } -/* "constraint/parser.py":337 +/* "constraint/parser.py":336 * return parsed_restrictions * * def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 # <<<<<<<<<<<<<< @@ -11738,41 +11701,41 @@ 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, 337, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 336, __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, 337, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 336, __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, 337, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 336, __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, 337, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 336, __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, 337, __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, 336, __pyx_L3_error) 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, 337, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("compile_to_constraints", 0, 2, 3, i); __PYX_ERR(0, 336, __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, 337, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 336, __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, 337, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 336, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 337, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 336, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -11784,7 +11747,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, 337, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compile_to_constraints", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 336, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11795,8 +11758,8 @@ 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, 337, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 337, __pyx_L1_error) + 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) __pyx_r = __pyx_pf_10constraint_6parser_2compile_to_constraints(__pyx_self, __pyx_v_constraints, __pyx_v_domains, __pyx_v_picklable); /* function exit code */ @@ -11845,7 +11808,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compile_to_constraints", 0); - /* "constraint/parser.py":348 + /* "constraint/parser.py":347 * 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 * parsed_restrictions = parse_restrictions(constraints, domains) # <<<<<<<<<<<<<< @@ -11853,7 +11816,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * 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, 348, __pyx_L1_error) + __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_GOTREF(__pyx_t_3); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -11872,25 +11835,25 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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_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, 348, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_parsed_restrictions = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":349 + /* "constraint/parser.py":348 * """ # noqa: E501 * parsed_restrictions = parse_restrictions(constraints, domains) * compiled_constraints: list[tuple[Constraint, list[str], Union[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, 349, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_compiled_constraints = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":350 + /* "constraint/parser.py":349 * parsed_restrictions = parse_restrictions(constraints, domains) * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: # <<<<<<<<<<<<<< @@ -11902,9 +11865,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, 350, __pyx_L1_error) + __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_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, 350, __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, 349, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { @@ -11912,7 +11875,7 @@ 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, 350, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 349, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -11922,7 +11885,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN { 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, 350, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 349, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -11933,13 +11896,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 349, __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, 350, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 349, __pyx_L1_error) PyErr_Clear(); } break; @@ -11952,7 +11915,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, 350, __pyx_L1_error) + __PYX_ERR(0, 349, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -11962,22 +11925,22 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __Pyx_INCREF(__pyx_t_7); } else { __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 350, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 349, __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, 350, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 349, __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, 350, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 349, __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); @@ -11985,7 +11948,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, 350, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 349, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -11993,7 +11956,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, 350, __pyx_L1_error) + __PYX_ERR(0, 349, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_restriction, __pyx_t_2); @@ -12001,7 +11964,7 @@ 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":351 + /* "constraint/parser.py":350 * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: * if isinstance(restriction, str): # <<<<<<<<<<<<<< @@ -12011,17 +11974,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":353 + /* "constraint/parser.py":352 * 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, 353, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_picklable); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 352, __pyx_L1_error) if (__pyx_t_10) { - /* "constraint/parser.py":354 + /* "constraint/parser.py":353 * # if it's a string, wrap it in a (compilable or compiled) function constraint * if picklable: * constraint = CompilableFunctionConstraint(restriction) # <<<<<<<<<<<<<< @@ -12029,7 +11992,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, 354, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -12048,13 +12011,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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_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, 354, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":353 + /* "constraint/parser.py":352 * if isinstance(restriction, str): * # if it's a string, wrap it in a (compilable or compiled) function constraint * if picklable: # <<<<<<<<<<<<<< @@ -12064,7 +12027,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L8; } - /* "constraint/parser.py":356 + /* "constraint/parser.py":355 * constraint = CompilableFunctionConstraint(restriction) * else: * code_object = compile(restriction, "", "exec") # <<<<<<<<<<<<<< @@ -12081,13 +12044,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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_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, 356, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __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":357 + /* "constraint/parser.py":356 * else: * code_object = compile(restriction, "", "exec") * func = FunctionType(code_object.co_consts[0], globals()) # <<<<<<<<<<<<<< @@ -12095,14 +12058,14 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * 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, 357, __pyx_L1_error) + __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, 357, __pyx_L1_error) + __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_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, 357, __pyx_L1_error) + __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_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, 357, __pyx_L1_error) + __pyx_t_8 = __Pyx_Globals(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -12123,13 +12086,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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, 357, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":358 + /* "constraint/parser.py":357 * code_object = compile(restriction, "", "exec") * func = FunctionType(code_object.co_consts[0], globals()) * constraint = FunctionConstraint(func) # <<<<<<<<<<<<<< @@ -12137,7 +12100,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * 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, 358, __pyx_L1_error) + __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_GOTREF(__pyx_t_8); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -12156,7 +12119,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_3); @@ -12164,28 +12127,28 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN } __pyx_L8:; - /* "constraint/parser.py":359 + /* "constraint/parser.py":358 * 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, 359, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __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, 359, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 358, __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, 359, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_params_used) != (0)) __PYX_ERR(0, 358, __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, 359, __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, 359, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":351 + /* "constraint/parser.py":350 * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: * if isinstance(restriction, str): # <<<<<<<<<<<<<< @@ -12195,41 +12158,41 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L7; } - /* "constraint/parser.py":360 + /* "constraint/parser.py":359 * 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, 360, __pyx_L1_error) + __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_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, 360, __pyx_L1_error) + __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(__pyx_t_10)) { - /* "constraint/parser.py":362 + /* "constraint/parser.py":361 * 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, 362, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __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, 362, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_restriction) != (0)) __PYX_ERR(0, 361, __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, 362, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_params_used) != (0)) __PYX_ERR(0, 361, __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, 362, __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, 362, __pyx_L1_error) + 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) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":360 + /* "constraint/parser.py":359 * constraint = FunctionConstraint(func) * compiled_constraints.append((constraint, params_used, restriction)) * elif isinstance(restriction, Constraint): # <<<<<<<<<<<<<< @@ -12239,7 +12202,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L7; } - /* "constraint/parser.py":364 + /* "constraint/parser.py":363 * compiled_constraints.append((restriction, params_used, None)) * else: * raise ValueError(f"Restriction {restriction} is neither a string or Constraint {type(restriction)}") # <<<<<<<<<<<<<< @@ -12250,16 +12213,16 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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, 364, __pyx_L1_error) + __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, 364, __pyx_L1_error) + __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_GOTREF(__pyx_t_7); __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_Restriction; __pyx_t_13[1] = __pyx_t_11; __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, 364, __pyx_L1_error) + 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_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -12270,16 +12233,16 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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, 364, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __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, 364, __pyx_L1_error) + __PYX_ERR(0, 363, __pyx_L1_error) } __pyx_L7:; - /* "constraint/parser.py":350 + /* "constraint/parser.py":349 * parsed_restrictions = parse_restrictions(constraints, domains) * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: # <<<<<<<<<<<<<< @@ -12289,7 +12252,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":367 + /* "constraint/parser.py":366 * * # return the restrictions and used parameters * return compiled_constraints # <<<<<<<<<<<<<< @@ -12299,7 +12262,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __pyx_r = __pyx_v_compiled_constraints; goto __pyx_L0; - /* "constraint/parser.py":337 + /* "constraint/parser.py":336 * return parsed_restrictions * * def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 # <<<<<<<<<<<<<< @@ -14867,15 +14830,15 @@ 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, 240, __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, 240, __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, 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) #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, 240, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr) < 0) __PYX_ERR(0, 238, __pyx_L1_error) #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)) { @@ -14883,15 +14846,15 @@ 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, 247, __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, 247, __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, 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) #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, 247, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr) < 0) __PYX_ERR(0, 245, __pyx_L1_error) #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)) { @@ -14899,15 +14862,15 @@ 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, 270, __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, 270, __pyx_L1_error) + __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) #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; #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, 270, __pyx_L1_error) + 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) #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)) { @@ -14915,15 +14878,15 @@ 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_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, 289, __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, 289, __pyx_L1_error) + __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) #else __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_12_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_12_genexpr) < 0) __PYX_ERR(0, 289, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(0, 288, __pyx_L1_error) #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)) { @@ -14931,15 +14894,15 @@ 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_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, 299, __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, 299, __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, 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) #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, 299, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr) < 0) __PYX_ERR(0, 298, __pyx_L1_error) #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)) { @@ -15423,24 +15386,24 @@ __Pyx_RefNannySetupContext("PyInit_parser", 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) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":337 + /* "constraint/parser.py":336 * return parsed_restrictions * * 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, 337, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __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, 337, __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, 337, __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, 337, __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, 337, __pyx_L1_error) + 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); __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, 337, __pyx_L1_error) + 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 @@ -15630,8 +15593,8 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_number_is_int, sizeof(__pyx_k_number_is_int), 0, 1, 1}, /* PyObject cname: __pyx_n_u_number_is_int */ {__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 */ @@ -15727,10 +15690,10 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, c 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, 236, __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, 356, __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) return 0; __pyx_L1_error:; return -1; @@ -15778,47 +15741,47 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[1]); - /* "constraint/parser.py":301 + /* "constraint/parser.py":300 * 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 * # 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, 301, __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, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); - /* "constraint/parser.py":322 + /* "constraint/parser.py":321 * 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, 322, __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, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[2]); - /* "constraint/parser.py":324 + /* "constraint/parser.py":323 * 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, 324, __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, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[3]); - /* "constraint/parser.py":337 + /* "constraint/parser.py":336 * return parsed_restrictions * * 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_mstate_global->__pyx_tuple[3] = PyTuple_Pack(1, ((PyObject*)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 337, __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, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_RefNannyFinishContext(); @@ -15906,12 +15869,12 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { __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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 240, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 238, 2}; 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 247, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 245, 2}; 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; } @@ -15921,12 +15884,12 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { __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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 289, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 288, 2}; 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 299, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 298, 2}; 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; } @@ -15946,22 +15909,22 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { __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; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 47, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 79, 2064}; - 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_number_is_int, __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}; + 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, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 270, 222}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 269, 222}; 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; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 28, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 30, 391}; 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_z_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_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; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 337, 177}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 336, 177}; 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; } From b5e2508eb00af7a52fa47f575f85782f0a56d9ac Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Mon, 16 Jun 2025 12:18:58 +0200 Subject: [PATCH 36/87] Extension and improvements of tests for parser and solvers --- tests/test_parser.py | 59 +++++++++++++++++++++++++++++++------------ tests/test_solvers.py | 9 ++++--- 2 files changed, 49 insertions(+), 19 deletions(-) diff --git a/tests/test_parser.py b/tests/test_parser.py index de2c3aa..8a67aa1 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -1,5 +1,20 @@ from constraint import ( - compile_to_constraints, parse_restrictions, Constraint, FunctionConstraint, CompilableFunctionConstraint, ExactProdConstraint, MinProdConstraint, MaxProdConstraint, ExactSumConstraint, VariableExactSumConstraint, VariableExactProdConstraint, VariableMinProdConstraint, VariableMaxProdConstraint, MaxSumConstraint) + compile_to_constraints, + parse_restrictions, + Constraint, + FunctionConstraint, + CompilableFunctionConstraint, + ExactSumConstraint, + MinSumConstraint, + MaxSumConstraint, + ExactProdConstraint, + MinProdConstraint, + MaxProdConstraint, + VariableExactSumConstraint, + VariableExactProdConstraint, + VariableMinProdConstraint, + VariableMaxProdConstraint, +) from collections.abc import Iterable def test_parse_restrictions(): @@ -30,26 +45,30 @@ def test_parse_restrictions(): parsed_constraint, params_constraint = parse_restrictions(["x*y<30"], rw_domains)[0] assert all(param in rw_domains for param in params_constraint) assert isinstance(parsed_constraint, MaxProdConstraint) - assert parsed_constraint._maxprod == 29 + assert 29 < parsed_constraint._maxprod < 30 parsed_constraint, params_constraint = parse_restrictions(["30= x", - "100 == x-y", - "x / y == 100", - "x / y == x", - "x / y <= x", - "x / y >= x", + "x != 320", # FunctionConstraint + "y == 0 or x % 32 != 0",# FunctionConstraint + "50 <= x * y < 100", # becomes splitted MinProdConstraint and MaxProdConstraint + "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 ] expected_constraint_types = [ FunctionConstraint, @@ -57,7 +76,11 @@ def test_compile_to_constraints(): MinProdConstraint, MaxProdConstraint, ExactSumConstraint, + # ExactSumConstraint, + VariableExactSumConstraint, 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" @@ -67,7 +90,7 @@ def test_compile_to_constraints(): ] compiled = compile_to_constraints(constraints, domains, picklable=False) - assert len(compiled) == len(expected_constraint_types) + # assert len(compiled) == len(expected_constraint_types) for r, vals, r_str in compiled: print(r, vals, r_str) assert isinstance(r, Constraint) @@ -86,7 +109,11 @@ def test_compile_to_constraints(): 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, diff --git a/tests/test_solvers.py b/tests/test_solvers.py index af1228b..adc4c31 100644 --- a/tests/test_solvers.py +++ b/tests/test_solvers.py @@ -139,18 +139,21 @@ def test_solvers_consistency(): solvers = [None, MinConflictsSolver(), OptimizedBacktrackingSolver(), BacktrackingSolver(), RecursiveBacktrackingSolver()] base_solution = None # variables = ['A','B','E','F','G','H','M'] - variables = ['B','E','G'] + variables = ['B','E','M'] def create_problem(solver): print(f"Creating problem with solver: {solver}") problem = Problem(solver) - values = range(10, 200) + values = range(10, 100) problem.addVariables(variables.copy(), values) # problem.addConstraint("H == 10*A-491") - problem.addConstraint("B == E+G") + problem.addConstraint("B == E+M") # problem.addConstraint("G == B-M") + # problem.addConstraint("B-M == G") # problem.addConstraint("H == F*F") # problem.addConstraint("M == 351-2*E") + problem.addConstraint("M*E >= B") + # problem.addConstraint("M >= B/E") return problem for solver in solvers: From 5b11f1d388489c2811809bef10e08d2f290b634b Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Mon, 16 Jun 2025 12:19:35 +0200 Subject: [PATCH 37/87] Updated changelog to reflect changes in upcoming release --- CHANGELOG.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41d9fb7..da78025 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,11 @@ All notable changes to this code base will be documented in this file, for every - Released: TBD - Issues / Enhancements: - - Python-Constraint now has an entirely new type of built-in constraints, allowing comparisons with variables on both sides to be evaluated much more efficiently. - - Tests have been extended to reflect changes. + - Python Constraint now has an entirely new type of built-in constraints, allowing comparisons with variables on both sides to be evaluated much more efficiently. + - Constraint rewriting has been extended to include minus and division operators. + - Rewriting of restrictions with less-than or greater-than operators now supports floats as well. + - Tests have been extended and amended to reflect changes introduced. + - TODO documentation has been extended and amended to reflect changes introduced. - Various minor bugs have been resolved. ### Version 2.2.0 From 879550ea5c5f28566dfb2277fb2fd373afcfeef1 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Mon, 16 Jun 2025 12:22:17 +0200 Subject: [PATCH 38/87] Updated poetry lockfile --- poetry.lock | 588 ++++++++++++++++++++++++++-------------------------- 1 file changed, 298 insertions(+), 290 deletions(-) diff --git a/poetry.lock b/poetry.lock index c9492e5..a00b25b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. [[package]] name = "alabaster" @@ -64,116 +64,116 @@ dev = ["backports.zoneinfo ; python_version < \"3.9\"", "freezegun (>=1.0,<2.0)" [[package]] name = "certifi" -version = "2025.1.31" +version = "2025.6.15" description = "Python package for providing Mozilla's CA Bundle." optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" groups = ["docs"] files = [ - {file = "certifi-2025.1.31-py3-none-any.whl", hash = "sha256:ca78db4565a652026a4db2bcdf68f2fb589ea80d0be70e03929ed730746b84fe"}, - {file = "certifi-2025.1.31.tar.gz", hash = "sha256:3d5da6925056f6f18f119200434a4780a94263f10d1c21d032a6f6b2baa20651"}, + {file = "certifi-2025.6.15-py3-none-any.whl", hash = "sha256:2e0c7ce7cb5d8f8634ca55d2ba7e6ec2689a2fd6537d8dec1296a477a4910057"}, + {file = "certifi-2025.6.15.tar.gz", hash = "sha256:d747aa5a8b9bbbb1bb8c22bb13e22bd1f18e9796defa16bab421f7f7a317323b"}, ] [[package]] name = "charset-normalizer" -version = "3.4.1" +version = "3.4.2" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." optional = false python-versions = ">=3.7" groups = ["docs"] files = [ - {file = "charset_normalizer-3.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:91b36a978b5ae0ee86c394f5a54d6ef44db1de0815eb43de826d41d21e4af3de"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7461baadb4dc00fd9e0acbe254e3d7d2112e7f92ced2adc96e54ef6501c5f176"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e218488cd232553829be0664c2292d3af2eeeb94b32bea483cf79ac6a694e037"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80ed5e856eb7f30115aaf94e4a08114ccc8813e6ed1b5efa74f9f82e8509858f"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b010a7a4fd316c3c484d482922d13044979e78d1861f0e0650423144c616a46a"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4532bff1b8421fd0a320463030c7520f56a79c9024a4e88f01c537316019005a"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d973f03c0cb71c5ed99037b870f2be986c3c05e63622c017ea9816881d2dd247"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:3a3bd0dcd373514dcec91c411ddb9632c0d7d92aed7093b8c3bbb6d69ca74408"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:d9c3cdf5390dcd29aa8056d13e8e99526cda0305acc038b96b30352aff5ff2bb"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:2bdfe3ac2e1bbe5b59a1a63721eb3b95fc9b6817ae4a46debbb4e11f6232428d"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:eab677309cdb30d047996b36d34caeda1dc91149e4fdca0b1a039b3f79d9a807"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-win32.whl", hash = "sha256:c0429126cf75e16c4f0ad00ee0eae4242dc652290f940152ca8c75c3a4b6ee8f"}, - {file = "charset_normalizer-3.4.1-cp310-cp310-win_amd64.whl", hash = "sha256:9f0b8b1c6d84c8034a44893aba5e767bf9c7a211e313a9605d9c617d7083829f"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:8bfa33f4f2672964266e940dd22a195989ba31669bd84629f05fab3ef4e2d125"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:28bf57629c75e810b6ae989f03c0828d64d6b26a5e205535585f96093e405ed1"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f08ff5e948271dc7e18a35641d2f11a4cd8dfd5634f55228b691e62b37125eb3"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:234ac59ea147c59ee4da87a0c0f098e9c8d169f4dc2a159ef720f1a61bbe27cd"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd4ec41f914fa74ad1b8304bbc634b3de73d2a0889bd32076342a573e0779e00"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eea6ee1db730b3483adf394ea72f808b6e18cf3cb6454b4d86e04fa8c4327a12"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c96836c97b1238e9c9e3fe90844c947d5afbf4f4c92762679acfe19927d81d77"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4d86f7aff21ee58f26dcf5ae81a9addbd914115cdebcbb2217e4f0ed8982e146"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:09b5e6733cbd160dcc09589227187e242a30a49ca5cefa5a7edd3f9d19ed53fd"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:5777ee0881f9499ed0f71cc82cf873d9a0ca8af166dfa0af8ec4e675b7df48e6"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:237bdbe6159cff53b4f24f397d43c6336c6b0b42affbe857970cefbb620911c8"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-win32.whl", hash = "sha256:8417cb1f36cc0bc7eaba8ccb0e04d55f0ee52df06df3ad55259b9a323555fc8b"}, - {file = "charset_normalizer-3.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:d7f50a1f8c450f3925cb367d011448c39239bb3eb4117c36a6d354794de4ce76"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:73d94b58ec7fecbc7366247d3b0b10a21681004153238750bb67bd9012414545"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dad3e487649f498dd991eeb901125411559b22e8d7ab25d3aeb1af367df5efd7"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c30197aa96e8eed02200a83fba2657b4c3acd0f0aa4bdc9f6c1af8e8962e0757"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2369eea1ee4a7610a860d88f268eb39b95cb588acd7235e02fd5a5601773d4fa"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc2722592d8998c870fa4e290c2eec2c1569b87fe58618e67d38b4665dfa680d"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffc9202a29ab3920fa812879e95a9e78b2465fd10be7fcbd042899695d75e616"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:804a4d582ba6e5b747c625bf1255e6b1507465494a40a2130978bda7b932c90b"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:0f55e69f030f7163dffe9fd0752b32f070566451afe180f99dbeeb81f511ad8d"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c4c3e6da02df6fa1410a7680bd3f63d4f710232d3139089536310d027950696a"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:5df196eb874dae23dcfb968c83d4f8fdccb333330fe1fc278ac5ceeb101003a9"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e358e64305fe12299a08e08978f51fc21fac060dcfcddd95453eabe5b93ed0e1"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-win32.whl", hash = "sha256:9b23ca7ef998bc739bf6ffc077c2116917eabcc901f88da1b9856b210ef63f35"}, - {file = "charset_normalizer-3.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:6ff8a4a60c227ad87030d76e99cd1698345d4491638dfa6673027c48b3cd395f"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:aabfa34badd18f1da5ec1bc2715cadc8dca465868a4e73a0173466b688f29dda"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22e14b5d70560b8dd51ec22863f370d1e595ac3d024cb8ad7d308b4cd95f8313"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8436c508b408b82d87dc5f62496973a1805cd46727c34440b0d29d8a2f50a6c9"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2d074908e1aecee37a7635990b2c6d504cd4766c7bc9fc86d63f9c09af3fa11b"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:955f8851919303c92343d2f66165294848d57e9bba6cf6e3625485a70a038d11"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:44ecbf16649486d4aebafeaa7ec4c9fed8b88101f4dd612dcaf65d5e815f837f"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0924e81d3d5e70f8126529951dac65c1010cdf117bb75eb02dd12339b57749dd"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:2967f74ad52c3b98de4c3b32e1a44e32975e008a9cd2a8cc8966d6a5218c5cb2"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:c75cb2a3e389853835e84a2d8fb2b81a10645b503eca9bcb98df6b5a43eb8886"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:09b26ae6b1abf0d27570633b2b078a2a20419c99d66fb2823173d73f188ce601"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:fa88b843d6e211393a37219e6a1c1df99d35e8fd90446f1118f4216e307e48cd"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-win32.whl", hash = "sha256:eb8178fe3dba6450a3e024e95ac49ed3400e506fd4e9e5c32d30adda88cbd407"}, - {file = "charset_normalizer-3.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:b1ac5992a838106edb89654e0aebfc24f5848ae2547d22c2c3f66454daa11971"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f30bf9fd9be89ecb2360c7d94a711f00c09b976258846efe40db3d05828e8089"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:97f68b8d6831127e4787ad15e6757232e14e12060bec17091b85eb1486b91d8d"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7974a0b5ecd505609e3b19742b60cee7aa2aa2fb3151bc917e6e2646d7667dcf"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fc54db6c8593ef7d4b2a331b58653356cf04f67c960f584edb7c3d8c97e8f39e"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:311f30128d7d333eebd7896965bfcfbd0065f1716ec92bd5638d7748eb6f936a"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:7d053096f67cd1241601111b698f5cad775f97ab25d81567d3f59219b5f1adbd"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:807f52c1f798eef6cf26beb819eeb8819b1622ddfeef9d0977a8502d4db6d534"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:dccbe65bd2f7f7ec22c4ff99ed56faa1e9f785482b9bbd7c717e26fd723a1d1e"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_s390x.whl", hash = "sha256:2fb9bd477fdea8684f78791a6de97a953c51831ee2981f8e4f583ff3b9d9687e"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:01732659ba9b5b873fc117534143e4feefecf3b2078b0a6a2e925271bb6f4cfa"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-win32.whl", hash = "sha256:7a4f97a081603d2050bfaffdefa5b02a9ec823f8348a572e39032caa8404a487"}, - {file = "charset_normalizer-3.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:7b1bef6280950ee6c177b326508f86cad7ad4dff12454483b51d8b7d673a2c5d"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:ecddf25bee22fe4fe3737a399d0d177d72bc22be6913acfab364b40bce1ba83c"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c60ca7339acd497a55b0ea5d506b2a2612afb2826560416f6894e8b5770d4a9"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b7b2d86dd06bfc2ade3312a83a5c364c7ec2e3498f8734282c6c3d4b07b346b8"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dd78cfcda14a1ef52584dbb008f7ac81c1328c0f58184bf9a84c49c605002da6"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e27f48bcd0957c6d4cb9d6fa6b61d192d0b13d5ef563e5f2ae35feafc0d179c"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:01ad647cdd609225c5350561d084b42ddf732f4eeefe6e678765636791e78b9a"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:619a609aa74ae43d90ed2e89bdd784765de0a25ca761b93e196d938b8fd1dbbd"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:89149166622f4db9b4b6a449256291dc87a99ee53151c74cbd82a53c8c2f6ccd"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:7709f51f5f7c853f0fb938bcd3bc59cdfdc5203635ffd18bf354f6967ea0f824"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:345b0426edd4e18138d6528aed636de7a9ed169b4aaf9d61a8c19e39d26838ca"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:0907f11d019260cdc3f94fbdb23ff9125f6b5d1039b76003b5b0ac9d6a6c9d5b"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-win32.whl", hash = "sha256:ea0d8d539afa5eb2728aa1932a988a9a7af94f18582ffae4bc10b3fbdad0626e"}, - {file = "charset_normalizer-3.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:329ce159e82018d646c7ac45b01a430369d526569ec08516081727a20e9e4af4"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:b97e690a2118911e39b4042088092771b4ae3fc3aa86518f84b8cf6888dbdb41"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:78baa6d91634dfb69ec52a463534bc0df05dbd546209b79a3880a34487f4b84f"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1a2bc9f351a75ef49d664206d51f8e5ede9da246602dc2d2726837620ea034b2"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:75832c08354f595c760a804588b9357d34ec00ba1c940c15e31e96d902093770"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0af291f4fe114be0280cdd29d533696a77b5b49cfde5467176ecab32353395c4"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0167ddc8ab6508fe81860a57dd472b2ef4060e8d378f0cc555707126830f2537"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2a75d49014d118e4198bcee5ee0a6f25856b29b12dbf7cd012791f8a6cc5c496"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:363e2f92b0f0174b2f8238240a1a30142e3db7b957a5dd5689b0e75fb717cc78"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:ab36c8eb7e454e34e60eb55ca5d241a5d18b2c6244f6827a30e451c42410b5f7"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:4c0907b1928a36d5a998d72d64d8eaa7244989f7aaaf947500d3a800c83a3fd6"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:04432ad9479fa40ec0f387795ddad4437a2b50417c69fa275e212933519ff294"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-win32.whl", hash = "sha256:3bed14e9c89dcb10e8f3a29f9ccac4955aebe93c71ae803af79265c9ca5644c5"}, - {file = "charset_normalizer-3.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:49402233c892a461407c512a19435d1ce275543138294f7ef013f0b63d5d3765"}, - {file = "charset_normalizer-3.4.1-py3-none-any.whl", hash = "sha256:d98b1668f06378c6dbefec3b92299716b931cd4e6061f3c875a71ced1780ab85"}, - {file = "charset_normalizer-3.4.1.tar.gz", hash = "sha256:44251f18cd68a75b56585dd00dae26183e102cd5e0f9f1466e6df5da2ed64ea3"}, + {file = "charset_normalizer-3.4.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7c48ed483eb946e6c04ccbe02c6b4d1d48e51944b6db70f697e089c193404941"}, + {file = "charset_normalizer-3.4.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b2d318c11350e10662026ad0eb71bb51c7812fc8590825304ae0bdd4ac283acd"}, + {file = "charset_normalizer-3.4.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9cbfacf36cb0ec2897ce0ebc5d08ca44213af24265bd56eca54bee7923c48fd6"}, + {file = "charset_normalizer-3.4.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:18dd2e350387c87dabe711b86f83c9c78af772c748904d372ade190b5c7c9d4d"}, + {file = "charset_normalizer-3.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8075c35cd58273fee266c58c0c9b670947c19df5fb98e7b66710e04ad4e9ff86"}, + {file = "charset_normalizer-3.4.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5bf4545e3b962767e5c06fe1738f951f77d27967cb2caa64c28be7c4563e162c"}, + {file = "charset_normalizer-3.4.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:7a6ab32f7210554a96cd9e33abe3ddd86732beeafc7a28e9955cdf22ffadbab0"}, + {file = "charset_normalizer-3.4.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:b33de11b92e9f75a2b545d6e9b6f37e398d86c3e9e9653c4864eb7e89c5773ef"}, + {file = "charset_normalizer-3.4.2-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:8755483f3c00d6c9a77f490c17e6ab0c8729e39e6390328e42521ef175380ae6"}, + {file = "charset_normalizer-3.4.2-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:68a328e5f55ec37c57f19ebb1fdc56a248db2e3e9ad769919a58672958e8f366"}, + {file = "charset_normalizer-3.4.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:21b2899062867b0e1fde9b724f8aecb1af14f2778d69aacd1a5a1853a597a5db"}, + {file = "charset_normalizer-3.4.2-cp310-cp310-win32.whl", hash = "sha256:e8082b26888e2f8b36a042a58307d5b917ef2b1cacab921ad3323ef91901c71a"}, + {file = "charset_normalizer-3.4.2-cp310-cp310-win_amd64.whl", hash = "sha256:f69a27e45c43520f5487f27627059b64aaf160415589230992cec34c5e18a509"}, + {file = "charset_normalizer-3.4.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:be1e352acbe3c78727a16a455126d9ff83ea2dfdcbc83148d2982305a04714c2"}, + {file = "charset_normalizer-3.4.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aa88ca0b1932e93f2d961bf3addbb2db902198dca337d88c89e1559e066e7645"}, + {file = "charset_normalizer-3.4.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d524ba3f1581b35c03cb42beebab4a13e6cdad7b36246bd22541fa585a56cccd"}, + {file = "charset_normalizer-3.4.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28a1005facc94196e1fb3e82a3d442a9d9110b8434fc1ded7a24a2983c9888d8"}, + {file = "charset_normalizer-3.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fdb20a30fe1175ecabed17cbf7812f7b804b8a315a25f24678bcdf120a90077f"}, + {file = "charset_normalizer-3.4.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0f5d9ed7f254402c9e7d35d2f5972c9bbea9040e99cd2861bd77dc68263277c7"}, + {file = "charset_normalizer-3.4.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:efd387a49825780ff861998cd959767800d54f8308936b21025326de4b5a42b9"}, + {file = "charset_normalizer-3.4.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:f0aa37f3c979cf2546b73e8222bbfa3dc07a641585340179d768068e3455e544"}, + {file = "charset_normalizer-3.4.2-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:e70e990b2137b29dc5564715de1e12701815dacc1d056308e2b17e9095372a82"}, + {file = "charset_normalizer-3.4.2-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:0c8c57f84ccfc871a48a47321cfa49ae1df56cd1d965a09abe84066f6853b9c0"}, + {file = "charset_normalizer-3.4.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:6b66f92b17849b85cad91259efc341dce9c1af48e2173bf38a85c6329f1033e5"}, + {file = "charset_normalizer-3.4.2-cp311-cp311-win32.whl", hash = "sha256:daac4765328a919a805fa5e2720f3e94767abd632ae410a9062dff5412bae65a"}, + {file = "charset_normalizer-3.4.2-cp311-cp311-win_amd64.whl", hash = "sha256:e53efc7c7cee4c1e70661e2e112ca46a575f90ed9ae3fef200f2a25e954f4b28"}, + {file = "charset_normalizer-3.4.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0c29de6a1a95f24b9a1aa7aefd27d2487263f00dfd55a77719b530788f75cff7"}, + {file = "charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cddf7bd982eaa998934a91f69d182aec997c6c468898efe6679af88283b498d3"}, + {file = "charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fcbe676a55d7445b22c10967bceaaf0ee69407fbe0ece4d032b6eb8d4565982a"}, + {file = "charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d41c4d287cfc69060fa91cae9683eacffad989f1a10811995fa309df656ec214"}, + {file = "charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4e594135de17ab3866138f496755f302b72157d115086d100c3f19370839dd3a"}, + {file = "charset_normalizer-3.4.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cf713fe9a71ef6fd5adf7a79670135081cd4431c2943864757f0fa3a65b1fafd"}, + {file = "charset_normalizer-3.4.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a370b3e078e418187da8c3674eddb9d983ec09445c99a3a263c2011993522981"}, + {file = "charset_normalizer-3.4.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:a955b438e62efdf7e0b7b52a64dc5c3396e2634baa62471768a64bc2adb73d5c"}, + {file = "charset_normalizer-3.4.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:7222ffd5e4de8e57e03ce2cef95a4c43c98fcb72ad86909abdfc2c17d227fc1b"}, + {file = "charset_normalizer-3.4.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:bee093bf902e1d8fc0ac143c88902c3dfc8941f7ea1d6a8dd2bcb786d33db03d"}, + {file = "charset_normalizer-3.4.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:dedb8adb91d11846ee08bec4c8236c8549ac721c245678282dcb06b221aab59f"}, + {file = "charset_normalizer-3.4.2-cp312-cp312-win32.whl", hash = "sha256:db4c7bf0e07fc3b7d89ac2a5880a6a8062056801b83ff56d8464b70f65482b6c"}, + {file = "charset_normalizer-3.4.2-cp312-cp312-win_amd64.whl", hash = "sha256:5a9979887252a82fefd3d3ed2a8e3b937a7a809f65dcb1e068b090e165bbe99e"}, + {file = "charset_normalizer-3.4.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:926ca93accd5d36ccdabd803392ddc3e03e6d4cd1cf17deff3b989ab8e9dbcf0"}, + {file = "charset_normalizer-3.4.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eba9904b0f38a143592d9fc0e19e2df0fa2e41c3c3745554761c5f6447eedabf"}, + {file = "charset_normalizer-3.4.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3fddb7e2c84ac87ac3a947cb4e66d143ca5863ef48e4a5ecb83bd48619e4634e"}, + {file = "charset_normalizer-3.4.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:98f862da73774290f251b9df8d11161b6cf25b599a66baf087c1ffe340e9bfd1"}, + {file = "charset_normalizer-3.4.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c9379d65defcab82d07b2a9dfbfc2e95bc8fe0ebb1b176a3190230a3ef0e07c"}, + {file = "charset_normalizer-3.4.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e635b87f01ebc977342e2697d05b56632f5f879a4f15955dfe8cef2448b51691"}, + {file = "charset_normalizer-3.4.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:1c95a1e2902a8b722868587c0e1184ad5c55631de5afc0eb96bc4b0d738092c0"}, + {file = "charset_normalizer-3.4.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:ef8de666d6179b009dce7bcb2ad4c4a779f113f12caf8dc77f0162c29d20490b"}, + {file = "charset_normalizer-3.4.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:32fc0341d72e0f73f80acb0a2c94216bd704f4f0bce10aedea38f30502b271ff"}, + {file = "charset_normalizer-3.4.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:289200a18fa698949d2b39c671c2cc7a24d44096784e76614899a7ccf2574b7b"}, + {file = "charset_normalizer-3.4.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4a476b06fbcf359ad25d34a057b7219281286ae2477cc5ff5e3f70a246971148"}, + {file = "charset_normalizer-3.4.2-cp313-cp313-win32.whl", hash = "sha256:aaeeb6a479c7667fbe1099af9617c83aaca22182d6cf8c53966491a0f1b7ffb7"}, + {file = "charset_normalizer-3.4.2-cp313-cp313-win_amd64.whl", hash = "sha256:aa6af9e7d59f9c12b33ae4e9450619cf2488e2bbe9b44030905877f0b2324980"}, + {file = "charset_normalizer-3.4.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1cad5f45b3146325bb38d6855642f6fd609c3f7cad4dbaf75549bf3b904d3184"}, + {file = "charset_normalizer-3.4.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b2680962a4848b3c4f155dc2ee64505a9c57186d0d56b43123b17ca3de18f0fa"}, + {file = "charset_normalizer-3.4.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:36b31da18b8890a76ec181c3cf44326bf2c48e36d393ca1b72b3f484113ea344"}, + {file = "charset_normalizer-3.4.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f4074c5a429281bf056ddd4c5d3b740ebca4d43ffffe2ef4bf4d2d05114299da"}, + {file = "charset_normalizer-3.4.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c9e36a97bee9b86ef9a1cf7bb96747eb7a15c2f22bdb5b516434b00f2a599f02"}, + {file = "charset_normalizer-3.4.2-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:1b1bde144d98e446b056ef98e59c256e9294f6b74d7af6846bf5ffdafd687a7d"}, + {file = "charset_normalizer-3.4.2-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:915f3849a011c1f593ab99092f3cecfcb4d65d8feb4a64cf1bf2d22074dc0ec4"}, + {file = "charset_normalizer-3.4.2-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:fb707f3e15060adf5b7ada797624a6c6e0138e2a26baa089df64c68ee98e040f"}, + {file = "charset_normalizer-3.4.2-cp37-cp37m-musllinux_1_2_s390x.whl", hash = "sha256:25a23ea5c7edc53e0f29bae2c44fcb5a1aa10591aae107f2a2b2583a9c5cbc64"}, + {file = "charset_normalizer-3.4.2-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:770cab594ecf99ae64c236bc9ee3439c3f46be49796e265ce0cc8bc17b10294f"}, + {file = "charset_normalizer-3.4.2-cp37-cp37m-win32.whl", hash = "sha256:6a0289e4589e8bdfef02a80478f1dfcb14f0ab696b5a00e1f4b8a14a307a3c58"}, + {file = "charset_normalizer-3.4.2-cp37-cp37m-win_amd64.whl", hash = "sha256:6fc1f5b51fa4cecaa18f2bd7a003f3dd039dd615cd69a2afd6d3b19aed6775f2"}, + {file = "charset_normalizer-3.4.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:76af085e67e56c8816c3ccf256ebd136def2ed9654525348cfa744b6802b69eb"}, + {file = "charset_normalizer-3.4.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e45ba65510e2647721e35323d6ef54c7974959f6081b58d4ef5d87c60c84919a"}, + {file = "charset_normalizer-3.4.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:046595208aae0120559a67693ecc65dd75d46f7bf687f159127046628178dc45"}, + {file = "charset_normalizer-3.4.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:75d10d37a47afee94919c4fab4c22b9bc2a8bf7d4f46f87363bcf0573f3ff4f5"}, + {file = "charset_normalizer-3.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6333b3aa5a12c26b2a4d4e7335a28f1475e0e5e17d69d55141ee3cab736f66d1"}, + {file = "charset_normalizer-3.4.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e8323a9b031aa0393768b87f04b4164a40037fb2a3c11ac06a03ffecd3618027"}, + {file = "charset_normalizer-3.4.2-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:24498ba8ed6c2e0b56d4acbf83f2d989720a93b41d712ebd4f4979660db4417b"}, + {file = "charset_normalizer-3.4.2-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:844da2b5728b5ce0e32d863af26f32b5ce61bc4273a9c720a9f3aa9df73b1455"}, + {file = "charset_normalizer-3.4.2-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:65c981bdbd3f57670af8b59777cbfae75364b483fa8a9f420f08094531d54a01"}, + {file = "charset_normalizer-3.4.2-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:3c21d4fca343c805a52c0c78edc01e3477f6dd1ad7c47653241cf2a206d4fc58"}, + {file = "charset_normalizer-3.4.2-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:dc7039885fa1baf9be153a0626e337aa7ec8bf96b0128605fb0d77788ddc1681"}, + {file = "charset_normalizer-3.4.2-cp38-cp38-win32.whl", hash = "sha256:8272b73e1c5603666618805fe821edba66892e2870058c94c53147602eab29c7"}, + {file = "charset_normalizer-3.4.2-cp38-cp38-win_amd64.whl", hash = "sha256:70f7172939fdf8790425ba31915bfbe8335030f05b9913d7ae00a87d4395620a"}, + {file = "charset_normalizer-3.4.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:005fa3432484527f9732ebd315da8da8001593e2cf46a3d817669f062c3d9ed4"}, + {file = "charset_normalizer-3.4.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e92fca20c46e9f5e1bb485887d074918b13543b1c2a1185e69bb8d17ab6236a7"}, + {file = "charset_normalizer-3.4.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:50bf98d5e563b83cc29471fa114366e6806bc06bc7a25fd59641e41445327836"}, + {file = "charset_normalizer-3.4.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:721c76e84fe669be19c5791da68232ca2e05ba5185575086e384352e2c309597"}, + {file = "charset_normalizer-3.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:82d8fd25b7f4675d0c47cf95b594d4e7b158aca33b76aa63d07186e13c0e0ab7"}, + {file = "charset_normalizer-3.4.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b3daeac64d5b371dea99714f08ffc2c208522ec6b06fbc7866a450dd446f5c0f"}, + {file = "charset_normalizer-3.4.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:dccab8d5fa1ef9bfba0590ecf4d46df048d18ffe3eec01eeb73a42e0d9e7a8ba"}, + {file = "charset_normalizer-3.4.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:aaf27faa992bfee0264dc1f03f4c75e9fcdda66a519db6b957a3f826e285cf12"}, + {file = "charset_normalizer-3.4.2-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:eb30abc20df9ab0814b5a2524f23d75dcf83cde762c161917a2b4b7b55b1e518"}, + {file = "charset_normalizer-3.4.2-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:c72fbbe68c6f32f251bdc08b8611c7b3060612236e960ef848e0a517ddbe76c5"}, + {file = "charset_normalizer-3.4.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:982bb1e8b4ffda883b3d0a521e23abcd6fd17418f6d2c4118d257a10199c0ce3"}, + {file = "charset_normalizer-3.4.2-cp39-cp39-win32.whl", hash = "sha256:43e0933a0eff183ee85833f341ec567c0980dae57c464d8a508e1b2ceb336471"}, + {file = "charset_normalizer-3.4.2-cp39-cp39-win_amd64.whl", hash = "sha256:d11b54acf878eef558599658b0ffca78138c8c3655cf4f3a4a673c437e67732e"}, + {file = "charset_normalizer-3.4.2-py3-none-any.whl", hash = "sha256:7f56930ab0abd1c45cd15be65cc741c28b1c9a34876ce8c17a2fa107810c0af0"}, + {file = "charset_normalizer-3.4.2.tar.gz", hash = "sha256:5baececa9ecba31eff645232d59845c07aa030f0c81ee70184a90d35099a0e63"}, ] [[package]] @@ -209,75 +209,79 @@ development = ["black", "flake8", "mypy", "pytest", "types-colorama"] [[package]] name = "coverage" -version = "7.8.0" +version = "7.9.1" description = "Code coverage measurement for Python" optional = false python-versions = ">=3.9" groups = ["test"] files = [ - {file = "coverage-7.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2931f66991175369859b5fd58529cd4b73582461877ecfd859b6549869287ffe"}, - {file = "coverage-7.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:52a523153c568d2c0ef8826f6cc23031dc86cffb8c6aeab92c4ff776e7951b28"}, - {file = "coverage-7.8.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c8a5c139aae4c35cbd7cadca1df02ea8cf28a911534fc1b0456acb0b14234f3"}, - {file = "coverage-7.8.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5a26c0c795c3e0b63ec7da6efded5f0bc856d7c0b24b2ac84b4d1d7bc578d676"}, - {file = "coverage-7.8.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:821f7bcbaa84318287115d54becb1915eece6918136c6f91045bb84e2f88739d"}, - {file = "coverage-7.8.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:a321c61477ff8ee705b8a5fed370b5710c56b3a52d17b983d9215861e37b642a"}, - {file = "coverage-7.8.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:ed2144b8a78f9d94d9515963ed273d620e07846acd5d4b0a642d4849e8d91a0c"}, - {file = "coverage-7.8.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:042e7841a26498fff7a37d6fda770d17519982f5b7d8bf5278d140b67b61095f"}, - {file = "coverage-7.8.0-cp310-cp310-win32.whl", hash = "sha256:f9983d01d7705b2d1f7a95e10bbe4091fabc03a46881a256c2787637b087003f"}, - {file = "coverage-7.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:5a570cd9bd20b85d1a0d7b009aaf6c110b52b5755c17be6962f8ccd65d1dbd23"}, - {file = "coverage-7.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e7ac22a0bb2c7c49f441f7a6d46c9c80d96e56f5a8bc6972529ed43c8b694e27"}, - {file = "coverage-7.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:bf13d564d310c156d1c8e53877baf2993fb3073b2fc9f69790ca6a732eb4bfea"}, - {file = "coverage-7.8.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5761c70c017c1b0d21b0815a920ffb94a670c8d5d409d9b38857874c21f70d7"}, - {file = "coverage-7.8.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e5ff52d790c7e1628241ffbcaeb33e07d14b007b6eb00a19320c7b8a7024c040"}, - {file = "coverage-7.8.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d39fc4817fd67b3915256af5dda75fd4ee10621a3d484524487e33416c6f3543"}, - {file = "coverage-7.8.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:b44674870709017e4b4036e3d0d6c17f06a0e6d4436422e0ad29b882c40697d2"}, - {file = "coverage-7.8.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8f99eb72bf27cbb167b636eb1726f590c00e1ad375002230607a844d9e9a2318"}, - {file = "coverage-7.8.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:b571bf5341ba8c6bc02e0baeaf3b061ab993bf372d982ae509807e7f112554e9"}, - {file = "coverage-7.8.0-cp311-cp311-win32.whl", hash = "sha256:e75a2ad7b647fd8046d58c3132d7eaf31b12d8a53c0e4b21fa9c4d23d6ee6d3c"}, - {file = "coverage-7.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:3043ba1c88b2139126fc72cb48574b90e2e0546d4c78b5299317f61b7f718b78"}, - {file = "coverage-7.8.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:bbb5cc845a0292e0c520656d19d7ce40e18d0e19b22cb3e0409135a575bf79fc"}, - {file = "coverage-7.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4dfd9a93db9e78666d178d4f08a5408aa3f2474ad4d0e0378ed5f2ef71640cb6"}, - {file = "coverage-7.8.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f017a61399f13aa6d1039f75cd467be388d157cd81f1a119b9d9a68ba6f2830d"}, - {file = "coverage-7.8.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0915742f4c82208ebf47a2b154a5334155ed9ef9fe6190674b8a46c2fb89cb05"}, - {file = "coverage-7.8.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a40fcf208e021eb14b0fac6bdb045c0e0cab53105f93ba0d03fd934c956143a"}, - {file = "coverage-7.8.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a1f406a8e0995d654b2ad87c62caf6befa767885301f3b8f6f73e6f3c31ec3a6"}, - {file = "coverage-7.8.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:77af0f6447a582fdc7de5e06fa3757a3ef87769fbb0fdbdeba78c23049140a47"}, - {file = "coverage-7.8.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:f2d32f95922927186c6dbc8bc60df0d186b6edb828d299ab10898ef3f40052fe"}, - {file = "coverage-7.8.0-cp312-cp312-win32.whl", hash = "sha256:769773614e676f9d8e8a0980dd7740f09a6ea386d0f383db6821df07d0f08545"}, - {file = "coverage-7.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:e5d2b9be5b0693cf21eb4ce0ec8d211efb43966f6657807f6859aab3814f946b"}, - {file = "coverage-7.8.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5ac46d0c2dd5820ce93943a501ac5f6548ea81594777ca585bf002aa8854cacd"}, - {file = "coverage-7.8.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:771eb7587a0563ca5bb6f622b9ed7f9d07bd08900f7589b4febff05f469bea00"}, - {file = "coverage-7.8.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42421e04069fb2cbcbca5a696c4050b84a43b05392679d4068acbe65449b5c64"}, - {file = "coverage-7.8.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:554fec1199d93ab30adaa751db68acec2b41c5602ac944bb19187cb9a41a8067"}, - {file = "coverage-7.8.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5aaeb00761f985007b38cf463b1d160a14a22c34eb3f6a39d9ad6fc27cb73008"}, - {file = "coverage-7.8.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:581a40c7b94921fffd6457ffe532259813fc68eb2bdda60fa8cc343414ce3733"}, - {file = "coverage-7.8.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:f319bae0321bc838e205bf9e5bc28f0a3165f30c203b610f17ab5552cff90323"}, - {file = "coverage-7.8.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:04bfec25a8ef1c5f41f5e7e5c842f6b615599ca8ba8391ec33a9290d9d2db3a3"}, - {file = "coverage-7.8.0-cp313-cp313-win32.whl", hash = "sha256:dd19608788b50eed889e13a5d71d832edc34fc9dfce606f66e8f9f917eef910d"}, - {file = "coverage-7.8.0-cp313-cp313-win_amd64.whl", hash = "sha256:a9abbccd778d98e9c7e85038e35e91e67f5b520776781d9a1e2ee9d400869487"}, - {file = "coverage-7.8.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:18c5ae6d061ad5b3e7eef4363fb27a0576012a7447af48be6c75b88494c6cf25"}, - {file = "coverage-7.8.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:95aa6ae391a22bbbce1b77ddac846c98c5473de0372ba5c463480043a07bff42"}, - {file = "coverage-7.8.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e013b07ba1c748dacc2a80e69a46286ff145935f260eb8c72df7185bf048f502"}, - {file = "coverage-7.8.0-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d766a4f0e5aa1ba056ec3496243150698dc0481902e2b8559314368717be82b1"}, - {file = "coverage-7.8.0-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad80e6b4a0c3cb6f10f29ae4c60e991f424e6b14219d46f1e7d442b938ee68a4"}, - {file = "coverage-7.8.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:b87eb6fc9e1bb8f98892a2458781348fa37e6925f35bb6ceb9d4afd54ba36c73"}, - {file = "coverage-7.8.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:d1ba00ae33be84066cfbe7361d4e04dec78445b2b88bdb734d0d1cbab916025a"}, - {file = "coverage-7.8.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:f3c38e4e5ccbdc9198aecc766cedbb134b2d89bf64533973678dfcf07effd883"}, - {file = "coverage-7.8.0-cp313-cp313t-win32.whl", hash = "sha256:379fe315e206b14e21db5240f89dc0774bdd3e25c3c58c2c733c99eca96f1ada"}, - {file = "coverage-7.8.0-cp313-cp313t-win_amd64.whl", hash = "sha256:2e4b6b87bb0c846a9315e3ab4be2d52fac905100565f4b92f02c445c8799e257"}, - {file = "coverage-7.8.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:fa260de59dfb143af06dcf30c2be0b200bed2a73737a8a59248fcb9fa601ef0f"}, - {file = "coverage-7.8.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:96121edfa4c2dfdda409877ea8608dd01de816a4dc4a0523356067b305e4e17a"}, - {file = "coverage-7.8.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b8af63b9afa1031c0ef05b217faa598f3069148eeee6bb24b79da9012423b82"}, - {file = "coverage-7.8.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:89b1f4af0d4afe495cd4787a68e00f30f1d15939f550e869de90a86efa7e0814"}, - {file = "coverage-7.8.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94ec0be97723ae72d63d3aa41961a0b9a6f5a53ff599813c324548d18e3b9e8c"}, - {file = "coverage-7.8.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:8a1d96e780bdb2d0cbb297325711701f7c0b6f89199a57f2049e90064c29f6bd"}, - {file = "coverage-7.8.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:f1d8a2a57b47142b10374902777e798784abf400a004b14f1b0b9eaf1e528ba4"}, - {file = "coverage-7.8.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:cf60dd2696b457b710dd40bf17ad269d5f5457b96442f7f85722bdb16fa6c899"}, - {file = "coverage-7.8.0-cp39-cp39-win32.whl", hash = "sha256:be945402e03de47ba1872cd5236395e0f4ad635526185a930735f66710e1bd3f"}, - {file = "coverage-7.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:90e7fbc6216ecaffa5a880cdc9c77b7418c1dcb166166b78dbc630d07f278cc3"}, - {file = "coverage-7.8.0-pp39.pp310.pp311-none-any.whl", hash = "sha256:b8194fb8e50d556d5849753de991d390c5a1edeeba50f68e3a9253fbd8bf8ccd"}, - {file = "coverage-7.8.0-py3-none-any.whl", hash = "sha256:dbf364b4c5e7bae9250528167dfe40219b62e2d573c854d74be213e1e52069f7"}, - {file = "coverage-7.8.0.tar.gz", hash = "sha256:7a3d62b3b03b4b6fd41a085f3574874cf946cb4604d2b4d3e8dca8cd570ca501"}, + {file = "coverage-7.9.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:cc94d7c5e8423920787c33d811c0be67b7be83c705f001f7180c7b186dcf10ca"}, + {file = "coverage-7.9.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:16aa0830d0c08a2c40c264cef801db8bc4fc0e1892782e45bcacbd5889270509"}, + {file = "coverage-7.9.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cf95981b126f23db63e9dbe4cf65bd71f9a6305696fa5e2262693bc4e2183f5b"}, + {file = "coverage-7.9.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f05031cf21699785cd47cb7485f67df619e7bcdae38e0fde40d23d3d0210d3c3"}, + {file = "coverage-7.9.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bb4fbcab8764dc072cb651a4bcda4d11fb5658a1d8d68842a862a6610bd8cfa3"}, + {file = "coverage-7.9.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:0f16649a7330ec307942ed27d06ee7e7a38417144620bb3d6e9a18ded8a2d3e5"}, + {file = "coverage-7.9.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:cea0a27a89e6432705fffc178064503508e3c0184b4f061700e771a09de58187"}, + {file = "coverage-7.9.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e980b53a959fa53b6f05343afbd1e6f44a23ed6c23c4b4c56c6662bbb40c82ce"}, + {file = "coverage-7.9.1-cp310-cp310-win32.whl", hash = "sha256:70760b4c5560be6ca70d11f8988ee6542b003f982b32f83d5ac0b72476607b70"}, + {file = "coverage-7.9.1-cp310-cp310-win_amd64.whl", hash = "sha256:a66e8f628b71f78c0e0342003d53b53101ba4e00ea8dabb799d9dba0abbbcebe"}, + {file = "coverage-7.9.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:95c765060e65c692da2d2f51a9499c5e9f5cf5453aeaf1420e3fc847cc060582"}, + {file = "coverage-7.9.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ba383dc6afd5ec5b7a0d0c23d38895db0e15bcba7fb0fa8901f245267ac30d86"}, + {file = "coverage-7.9.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:37ae0383f13cbdcf1e5e7014489b0d71cc0106458878ccde52e8a12ced4298ed"}, + {file = "coverage-7.9.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:69aa417a030bf11ec46149636314c24c8d60fadb12fc0ee8f10fda0d918c879d"}, + {file = "coverage-7.9.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0a4be2a28656afe279b34d4f91c3e26eccf2f85500d4a4ff0b1f8b54bf807338"}, + {file = "coverage-7.9.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:382e7ddd5289f140259b610e5f5c58f713d025cb2f66d0eb17e68d0a94278875"}, + {file = "coverage-7.9.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e5532482344186c543c37bfad0ee6069e8ae4fc38d073b8bc836fc8f03c9e250"}, + {file = "coverage-7.9.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:a39d18b3f50cc121d0ce3838d32d58bd1d15dab89c910358ebefc3665712256c"}, + {file = "coverage-7.9.1-cp311-cp311-win32.whl", hash = "sha256:dd24bd8d77c98557880def750782df77ab2b6885a18483dc8588792247174b32"}, + {file = "coverage-7.9.1-cp311-cp311-win_amd64.whl", hash = "sha256:6b55ad10a35a21b8015eabddc9ba31eb590f54adc9cd39bcf09ff5349fd52125"}, + {file = "coverage-7.9.1-cp311-cp311-win_arm64.whl", hash = "sha256:6ad935f0016be24c0e97fc8c40c465f9c4b85cbbe6eac48934c0dc4d2568321e"}, + {file = "coverage-7.9.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:a8de12b4b87c20de895f10567639c0797b621b22897b0af3ce4b4e204a743626"}, + {file = "coverage-7.9.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5add197315a054e92cee1b5f686a2bcba60c4c3e66ee3de77ace6c867bdee7cb"}, + {file = "coverage-7.9.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:600a1d4106fe66f41e5d0136dfbc68fe7200a5cbe85610ddf094f8f22e1b0300"}, + {file = "coverage-7.9.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2a876e4c3e5a2a1715a6608906aa5a2e0475b9c0f68343c2ada98110512ab1d8"}, + {file = "coverage-7.9.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:81f34346dd63010453922c8e628a52ea2d2ccd73cb2487f7700ac531b247c8a5"}, + {file = "coverage-7.9.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:888f8eee13f2377ce86d44f338968eedec3291876b0b8a7289247ba52cb984cd"}, + {file = "coverage-7.9.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:9969ef1e69b8c8e1e70d591f91bbc37fc9a3621e447525d1602801a24ceda898"}, + {file = "coverage-7.9.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:60c458224331ee3f1a5b472773e4a085cc27a86a0b48205409d364272d67140d"}, + {file = "coverage-7.9.1-cp312-cp312-win32.whl", hash = "sha256:5f646a99a8c2b3ff4c6a6e081f78fad0dde275cd59f8f49dc4eab2e394332e74"}, + {file = "coverage-7.9.1-cp312-cp312-win_amd64.whl", hash = "sha256:30f445f85c353090b83e552dcbbdad3ec84c7967e108c3ae54556ca69955563e"}, + {file = "coverage-7.9.1-cp312-cp312-win_arm64.whl", hash = "sha256:af41da5dca398d3474129c58cb2b106a5d93bbb196be0d307ac82311ca234342"}, + {file = "coverage-7.9.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:31324f18d5969feef7344a932c32428a2d1a3e50b15a6404e97cba1cc9b2c631"}, + {file = "coverage-7.9.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0c804506d624e8a20fb3108764c52e0eef664e29d21692afa375e0dd98dc384f"}, + {file = "coverage-7.9.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ef64c27bc40189f36fcc50c3fb8f16ccda73b6a0b80d9bd6e6ce4cffcd810bbd"}, + {file = "coverage-7.9.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d4fe2348cc6ec372e25adec0219ee2334a68d2f5222e0cba9c0d613394e12d86"}, + {file = "coverage-7.9.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:34ed2186fe52fcc24d4561041979a0dec69adae7bce2ae8d1c49eace13e55c43"}, + {file = "coverage-7.9.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:25308bd3d00d5eedd5ae7d4357161f4df743e3c0240fa773ee1b0f75e6c7c0f1"}, + {file = "coverage-7.9.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:73e9439310f65d55a5a1e0564b48e34f5369bee943d72c88378f2d576f5a5751"}, + {file = "coverage-7.9.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:37ab6be0859141b53aa89412a82454b482c81cf750de4f29223d52268a86de67"}, + {file = "coverage-7.9.1-cp313-cp313-win32.whl", hash = "sha256:64bdd969456e2d02a8b08aa047a92d269c7ac1f47e0c977675d550c9a0863643"}, + {file = "coverage-7.9.1-cp313-cp313-win_amd64.whl", hash = "sha256:be9e3f68ca9edb897c2184ad0eee815c635565dbe7a0e7e814dc1f7cbab92c0a"}, + {file = "coverage-7.9.1-cp313-cp313-win_arm64.whl", hash = "sha256:1c503289ffef1d5105d91bbb4d62cbe4b14bec4d13ca225f9c73cde9bb46207d"}, + {file = "coverage-7.9.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:0b3496922cb5f4215bf5caaef4cf12364a26b0be82e9ed6d050f3352cf2d7ef0"}, + {file = "coverage-7.9.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:9565c3ab1c93310569ec0d86b017f128f027cab0b622b7af288696d7ed43a16d"}, + {file = "coverage-7.9.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2241ad5dbf79ae1d9c08fe52b36d03ca122fb9ac6bca0f34439e99f8327ac89f"}, + {file = "coverage-7.9.1-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3bb5838701ca68b10ebc0937dbd0eb81974bac54447c55cd58dea5bca8451029"}, + {file = "coverage-7.9.1-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b30a25f814591a8c0c5372c11ac8967f669b97444c47fd794926e175c4047ece"}, + {file = "coverage-7.9.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:2d04b16a6062516df97969f1ae7efd0de9c31eb6ebdceaa0d213b21c0ca1a683"}, + {file = "coverage-7.9.1-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:7931b9e249edefb07cd6ae10c702788546341d5fe44db5b6108a25da4dca513f"}, + {file = "coverage-7.9.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:52e92b01041151bf607ee858e5a56c62d4b70f4dac85b8c8cb7fb8a351ab2c10"}, + {file = "coverage-7.9.1-cp313-cp313t-win32.whl", hash = "sha256:684e2110ed84fd1ca5f40e89aa44adf1729dc85444004111aa01866507adf363"}, + {file = "coverage-7.9.1-cp313-cp313t-win_amd64.whl", hash = "sha256:437c576979e4db840539674e68c84b3cda82bc824dd138d56bead1435f1cb5d7"}, + {file = "coverage-7.9.1-cp313-cp313t-win_arm64.whl", hash = "sha256:18a0912944d70aaf5f399e350445738a1a20b50fbea788f640751c2ed9208b6c"}, + {file = "coverage-7.9.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6f424507f57878e424d9a95dc4ead3fbdd72fd201e404e861e465f28ea469951"}, + {file = "coverage-7.9.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:535fde4001b2783ac80865d90e7cc7798b6b126f4cd8a8c54acfe76804e54e58"}, + {file = "coverage-7.9.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:02532fd3290bb8fa6bec876520842428e2a6ed6c27014eca81b031c2d30e3f71"}, + {file = "coverage-7.9.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:56f5eb308b17bca3bbff810f55ee26d51926d9f89ba92707ee41d3c061257e55"}, + {file = "coverage-7.9.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bfa447506c1a52271f1b0de3f42ea0fa14676052549095e378d5bff1c505ff7b"}, + {file = "coverage-7.9.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:9ca8e220006966b4a7b68e8984a6aee645a0384b0769e829ba60281fe61ec4f7"}, + {file = "coverage-7.9.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:49f1d0788ba5b7ba65933f3a18864117c6506619f5ca80326b478f72acf3f385"}, + {file = "coverage-7.9.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:68cd53aec6f45b8e4724c0950ce86eacb775c6be01ce6e3669fe4f3a21e768ed"}, + {file = "coverage-7.9.1-cp39-cp39-win32.whl", hash = "sha256:95335095b6c7b1cc14c3f3f17d5452ce677e8490d101698562b2ffcacc304c8d"}, + {file = "coverage-7.9.1-cp39-cp39-win_amd64.whl", hash = "sha256:e1b5191d1648acc439b24721caab2fd0c86679d8549ed2c84d5a7ec1bedcc244"}, + {file = "coverage-7.9.1-pp39.pp310.pp311-none-any.whl", hash = "sha256:db0f04118d1db74db6c9e1cb1898532c7dcc220f1d2718f058601f7c3f499514"}, + {file = "coverage-7.9.1-py3-none-any.whl", hash = "sha256:66b974b145aa189516b6bf2d8423e888b742517d37872f6ee4c5be0073bd9a3c"}, + {file = "coverage-7.9.1.tar.gz", hash = "sha256:6cf43c78c4282708a28e466316935ec7489a9c487518a77fa68f716c67909cec"}, ] [package.dependencies] @@ -288,88 +292,86 @@ toml = ["tomli ; python_full_version <= \"3.11.0a6\""] [[package]] name = "cython" -version = "3.0.12" +version = "3.1.2" description = "The Cython compiler for writing C extensions in the Python language." optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" +python-versions = ">=3.8" groups = ["dev"] files = [ - {file = "Cython-3.0.12-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ba67eee9413b66dd9fbacd33f0bc2e028a2a120991d77b5fd4b19d0b1e4039b9"}, - {file = "Cython-3.0.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bee2717e5b5f7d966d0c6e27d2efe3698c357aa4d61bb3201997c7a4f9fe485a"}, - {file = "Cython-3.0.12-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7cffc3464f641c8d0dda942c7c53015291beea11ec4d32421bed2f13b386b819"}, - {file = "Cython-3.0.12-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d3a8f81980ffbd74e52f9186d8f1654e347d0c44bfea6b5997028977f481a179"}, - {file = "Cython-3.0.12-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:8d32856716c369d01f2385ad9177cdd1a11079ac89ea0932dc4882de1aa19174"}, - {file = "Cython-3.0.12-cp310-cp310-win32.whl", hash = "sha256:712c3f31adec140dc60d064a7f84741f50e2c25a8edd7ae746d5eb4d3ef7072a"}, - {file = "Cython-3.0.12-cp310-cp310-win_amd64.whl", hash = "sha256:d6945694c5b9170cfbd5f2c0d00ef7487a2de7aba83713a64ee4ebce7fad9e05"}, - {file = "Cython-3.0.12-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:feb86122a823937cc06e4c029d80ff69f082ebb0b959ab52a5af6cdd271c5dc3"}, - {file = "Cython-3.0.12-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dfdbea486e702c328338314adb8e80f5f9741f06a0ae83aaec7463bc166d12e8"}, - {file = "Cython-3.0.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:563de1728c8e48869d2380a1b76bbc1b1b1d01aba948480d68c1d05e52d20c92"}, - {file = "Cython-3.0.12-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:398d4576c1e1f6316282aa0b4a55139254fbed965cba7813e6d9900d3092b128"}, - {file = "Cython-3.0.12-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1e5eadef80143026944ea8f9904715a008f5108d1d644a89f63094cc37351e73"}, - {file = "Cython-3.0.12-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:5a93cbda00a5451175b97dea5a9440a3fcee9e54b4cba7a7dbcba9a764b22aec"}, - {file = "Cython-3.0.12-cp311-cp311-win32.whl", hash = "sha256:3109e1d44425a2639e9a677b66cd7711721a5b606b65867cb2d8ef7a97e2237b"}, - {file = "Cython-3.0.12-cp311-cp311-win_amd64.whl", hash = "sha256:d4b70fc339adba1e2111b074ee6119fe9fd6072c957d8597bce9a0dd1c3c6784"}, - {file = "Cython-3.0.12-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:fe030d4a00afb2844f5f70896b7f2a1a0d7da09bf3aa3d884cbe5f73fff5d310"}, - {file = "Cython-3.0.12-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a7fec4f052b8fe173fe70eae75091389955b9a23d5cec3d576d21c5913b49d47"}, - {file = "Cython-3.0.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0faa5e39e5c8cdf6f9c3b1c3f24972826e45911e7f5b99cf99453fca5432f45e"}, - {file = "Cython-3.0.12-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2d53de996ed340e9ab0fc85a88aaa8932f2591a2746e1ab1c06e262bd4ec4be7"}, - {file = "Cython-3.0.12-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:ea3a0e19ab77266c738aa110684a753a04da4e709472cadeff487133354d6ab8"}, - {file = "Cython-3.0.12-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c151082884be468f2f405645858a857298ac7f7592729e5b54788b5c572717ba"}, - {file = "Cython-3.0.12-cp312-cp312-win32.whl", hash = "sha256:3083465749911ac3b2ce001b6bf17f404ac9dd35d8b08469d19dc7e717f5877a"}, - {file = "Cython-3.0.12-cp312-cp312-win_amd64.whl", hash = "sha256:c0b91c7ebace030dd558ea28730de8c580680b50768e5af66db2904a3716c3e3"}, - {file = "Cython-3.0.12-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:4ee6f1ea1bead8e6cbc4e64571505b5d8dbdb3b58e679d31f3a84160cebf1a1a"}, - {file = "Cython-3.0.12-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:57aefa6d3341109e46ec1a13e3a763aaa2cbeb14e82af2485b318194be1d9170"}, - {file = "Cython-3.0.12-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:879ae9023958d63c0675015369384642d0afb9c9d1f3473df9186c42f7a9d265"}, - {file = "Cython-3.0.12-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:36fcd584dae547de6f095500a380f4a0cce72b7a7e409e9ff03cb9beed6ac7a1"}, - {file = "Cython-3.0.12-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:62b79dcc0de49efe9e84b9d0e2ae0a6fc9b14691a65565da727aa2e2e63c6a28"}, - {file = "Cython-3.0.12-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4aa255781b093a8401109d8f2104bbb2e52de7639d5896aefafddc85c30e0894"}, - {file = "Cython-3.0.12-cp313-cp313-win32.whl", hash = "sha256:77d48f2d4bab9fe1236eb753d18f03e8b2619af5b6f05d51df0532a92dfb38ab"}, - {file = "Cython-3.0.12-cp313-cp313-win_amd64.whl", hash = "sha256:86c304b20bd57c727c7357e90d5ba1a2b6f1c45492de2373814d7745ef2e63b4"}, - {file = "Cython-3.0.12-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:ff5c0b6a65b08117d0534941d404833d516dac422eee88c6b4fd55feb409a5ed"}, - {file = "Cython-3.0.12-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:680f1d6ed4436ae94805db264d6155ed076d2835d84f20dcb31a7a3ad7f8668c"}, - {file = "Cython-3.0.12-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ebc24609613fa06d0d896309f7164ba168f7e8d71c1e490ed2a08d23351c3f41"}, - {file = "Cython-3.0.12-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c1879c073e2b34924ce9b7ca64c212705dcc416af4337c45f371242b2e5f6d32"}, - {file = "Cython-3.0.12-cp36-cp36m-musllinux_1_2_aarch64.whl", hash = "sha256:bfb75123dd4ff767baa37d7036da0de2dfb6781ff256eef69b11b88b9a0691d1"}, - {file = "Cython-3.0.12-cp36-cp36m-musllinux_1_2_x86_64.whl", hash = "sha256:f39640f8df0400cde6882e23c734f15bb8196de0a008ae5dc6c8d1ec5957d7c8"}, - {file = "Cython-3.0.12-cp36-cp36m-win32.whl", hash = "sha256:8c9efe9a0895abee3cadfdad4130b30f7b5e57f6e6a51ef2a44f9fc66a913880"}, - {file = "Cython-3.0.12-cp36-cp36m-win_amd64.whl", hash = "sha256:63d840f2975e44d74512f8f34f1f7cb8121c9428e26a3f6116ff273deb5e60a2"}, - {file = "Cython-3.0.12-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:75c5acd40b97cff16fadcf6901a91586cbca5dcdba81f738efaf1f4c6bc8dccb"}, - {file = "Cython-3.0.12-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e62564457851db1c40399bd95a5346b9bb99e17a819bf583b362f418d8f3457a"}, - {file = "Cython-3.0.12-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ccd1228cc203b1f1b8a3d403f5a20ad1c40e5879b3fbf5851ce09d948982f2c"}, - {file = "Cython-3.0.12-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:25529ee948f44d9a165ff960c49d4903267c20b5edf2df79b45924802e4cca6e"}, - {file = "Cython-3.0.12-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:90cf599372c5a22120609f7d3a963f17814799335d56dd0dcf8fe615980a8ae1"}, - {file = "Cython-3.0.12-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:9f8c48748a9c94ea5d59c26ab49ad0fad514d36f894985879cf3c3ca0e600bf4"}, - {file = "Cython-3.0.12-cp37-cp37m-win32.whl", hash = "sha256:3e4fa855d98bc7bd6a2049e0c7dc0dcf595e2e7f571a26e808f3efd84d2db374"}, - {file = "Cython-3.0.12-cp37-cp37m-win_amd64.whl", hash = "sha256:120681093772bf3600caddb296a65b352a0d3556e962b9b147efcfb8e8c9801b"}, - {file = "Cython-3.0.12-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:731d719423e041242c9303c80cae4327467299b90ffe62d4cc407e11e9ea3160"}, - {file = "Cython-3.0.12-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c3238a29f37999e27494d120983eca90d14896b2887a0bd858a381204549137a"}, - {file = "Cython-3.0.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b588c0a089a9f4dd316d2f9275230bad4a7271e5af04e1dc41d2707c816be44b"}, - {file = "Cython-3.0.12-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8ab9f5198af74eb16502cc143cdde9ca1cbbf66ea2912e67440dd18a36e3b5fa"}, - {file = "Cython-3.0.12-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:8ee841c0e114efa1e849c281ac9b8df8aa189af10b4a103b1c5fd71cbb799679"}, - {file = "Cython-3.0.12-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:43c48b5789398b228ea97499f5b864843ba9b1ab837562a9227c6f58d16ede8b"}, - {file = "Cython-3.0.12-cp38-cp38-win32.whl", hash = "sha256:5e5f17c48a4f41557fbcc7ee660ccfebe4536a34c557f553b6893c1b3c83df2d"}, - {file = "Cython-3.0.12-cp38-cp38-win_amd64.whl", hash = "sha256:309c081057930bb79dc9ea3061a1af5086c679c968206e9c9c2ec90ab7cb471a"}, - {file = "Cython-3.0.12-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:54115fcc126840926ff3b53cfd2152eae17b3522ae7f74888f8a41413bd32f25"}, - {file = "Cython-3.0.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:629db614b9c364596d7c975fa3fb3978e8c5349524353dbe11429896a783fc1e"}, - {file = "Cython-3.0.12-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:af081838b0f9e12a83ec4c3809a00a64c817f489f7c512b0e3ecaf5f90a2a816"}, - {file = "Cython-3.0.12-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:34ce459808f7d8d5d4007bc5486fe50532529096b43957af6cbffcb4d9cc5c8d"}, - {file = "Cython-3.0.12-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:d6c6cd6a75c8393e6805d17f7126b96a894f310a1a9ea91c47d141fb9341bfa8"}, - {file = "Cython-3.0.12-cp39-cp39-win32.whl", hash = "sha256:a4032e48d4734d2df68235d21920c715c451ac9de15fa14c71b378e8986b83be"}, - {file = "Cython-3.0.12-cp39-cp39-win_amd64.whl", hash = "sha256:dcdc3e5d4ce0e7a4af6903ed580833015641e968d18d528d8371e2435a34132c"}, - {file = "Cython-3.0.12-py2.py3-none-any.whl", hash = "sha256:0038c9bae46c459669390e53a1ec115f8096b2e4647ae007ff1bf4e6dee92806"}, - {file = "cython-3.0.12.tar.gz", hash = "sha256:b988bb297ce76c671e28c97d017b95411010f7c77fa6623dd0bb47eed1aee1bc"}, + {file = "cython-3.1.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0f2add8b23cb19da3f546a688cd8f9e0bfc2776715ebf5e283bc3113b03ff008"}, + {file = "cython-3.1.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0d6248a2ae155ca4c42d7fa6a9a05154d62e695d7736bc17e1b85da6dcc361df"}, + {file = "cython-3.1.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:262bf49d9da64e2a34c86cbf8de4aa37daffb0f602396f116cca1ed47dc4b9f2"}, + {file = "cython-3.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ae53ae93c699d5f113953a9869df2fc269d8e173f9aa0616c6d8d6e12b4e9827"}, + {file = "cython-3.1.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b417c5d046ce676ee595ec7955ed47a68ad6f419cbf8c2a8708e55a3b38dfa35"}, + {file = "cython-3.1.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:af127da4b956e0e906e552fad838dc3fb6b6384164070ceebb0d90982a8ae25a"}, + {file = "cython-3.1.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:9be3d4954b46fd0f2dceac011d470f658eaf819132db52fbd1cf226ee60348db"}, + {file = "cython-3.1.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:63da49672c4bb022b4de9d37bab6c29953dbf5a31a2f40dffd0cf0915dcd7a17"}, + {file = "cython-3.1.2-cp310-cp310-win32.whl", hash = "sha256:2d8291dbbc1cb86b8d60c86fe9cbf99ec72de28cb157cbe869c95df4d32efa96"}, + {file = "cython-3.1.2-cp310-cp310-win_amd64.whl", hash = "sha256:e1f30a1339e03c80968a371ef76bf27a6648c5646cccd14a97e731b6957db97a"}, + {file = "cython-3.1.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5548573e0912d7dc80579827493315384c462e2f15797b91a8ed177686d31eb9"}, + {file = "cython-3.1.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4bf3ea5bc50d80762c490f42846820a868a6406fdb5878ae9e4cc2f11b50228a"}, + {file = "cython-3.1.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:20ce53951d06ab2bca39f153d9c5add1d631c2a44d58bf67288c9d631be9724e"}, + {file = "cython-3.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e05a36224e3002d48c7c1c695b3771343bd16bc57eab60d6c5d5e08f3cbbafd8"}, + {file = "cython-3.1.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dbc0fc0777c7ab82297c01c61a1161093a22a41714f62e8c35188a309bd5db8e"}, + {file = "cython-3.1.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:18161ef3dd0e90a944daa2be468dd27696712a5f792d6289e97d2a31298ad688"}, + {file = "cython-3.1.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:ca45020950cd52d82189d6dfb6225737586be6fe7b0b9d3fadd7daca62eff531"}, + {file = "cython-3.1.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:aaae97d6d07610224be2b73a93e9e3dd85c09aedfd8e47054e3ef5a863387dae"}, + {file = "cython-3.1.2-cp311-cp311-win32.whl", hash = "sha256:3d439d9b19e7e70f6ff745602906d282a853dd5219d8e7abbf355de680c9d120"}, + {file = "cython-3.1.2-cp311-cp311-win_amd64.whl", hash = "sha256:8efa44ee2f1876e40eb5e45f6513a19758077c56bf140623ccab43d31f873b61"}, + {file = "cython-3.1.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:9c2c4b6f9a941c857b40168b3f3c81d514e509d985c2dcd12e1a4fea9734192e"}, + {file = "cython-3.1.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:bdbc115bbe1b8c1dcbcd1b03748ea87fa967eb8dfc3a1a9bb243d4a382efcff4"}, + {file = "cython-3.1.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c05111f89db1ca98edc0675cfaa62be47b3ff519a29876eb095532a9f9e052b8"}, + {file = "cython-3.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f6e7188df8709be32cfdfadc7c3782e361c929df9132f95e1bbc90a340dca3c7"}, + {file = "cython-3.1.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1c0ecc71e60a051732c2607b8eb8f2a03a5dac09b28e52b8af323c329db9987b"}, + {file = "cython-3.1.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:f27143cf88835c8bcc9bf3304953f23f377d1d991e8942982fe7be344c7cfce3"}, + {file = "cython-3.1.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:d8c43566701133f53bf13485839d8f3f309095fe0d3b9d0cd5873073394d2edc"}, + {file = "cython-3.1.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a3bb893e85f027a929c1764bb14db4c31cbdf8a96f59a78f608f2ba7cfbbce95"}, + {file = "cython-3.1.2-cp312-cp312-win32.whl", hash = "sha256:12c5902f105e43ca9af7874cdf87a23627f98c15d5a4f6d38bc9d334845145c0"}, + {file = "cython-3.1.2-cp312-cp312-win_amd64.whl", hash = "sha256:06789eb7bd2e55b38b9dd349e9309f794aee0fed99c26ea5c9562d463877763f"}, + {file = "cython-3.1.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:cc22e5f18af436c894b90c257130346930fdc860d7f42b924548c591672beeef"}, + {file = "cython-3.1.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:42c7bffb0fe9898996c7eef9eb74ce3654553c7a3a3f3da66e5a49f801904ce0"}, + {file = "cython-3.1.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:88dc7fd54bfae78c366c6106a759f389000ea4dfe8ed9568af9d2f612825a164"}, + {file = "cython-3.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80d0ce057672ca50728153757d022842d5dcec536b50c79615a22dda2a874ea0"}, + {file = "cython-3.1.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eda6a43f1b78eae0d841698916eef661d15f8bc8439c266a964ea4c504f05612"}, + {file = "cython-3.1.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:b4c516d103e87c2e9c1ab85227e4d91c7484c1ba29e25f8afbf67bae93fee164"}, + {file = "cython-3.1.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:7542f1d18ab2cd22debc72974ec9e53437a20623d47d6001466e430538d7df54"}, + {file = "cython-3.1.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:63335513c06dcec4ecdaa8598f36c969032149ffd92a461f641ee363dc83c7ad"}, + {file = "cython-3.1.2-cp313-cp313-win32.whl", hash = "sha256:b377d542299332bfeb61ec09c57821b10f1597304394ba76544f4d07780a16df"}, + {file = "cython-3.1.2-cp313-cp313-win_amd64.whl", hash = "sha256:8ab1319c77f15b0ae04b3fb03588df3afdec4cf79e90eeea5c961e0ebd8fdf72"}, + {file = "cython-3.1.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:dbc1f225cb9f9be7a025589463507e10bb2d76a3258f8d308e0e2d0b966c556e"}, + {file = "cython-3.1.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:c1661c1701c96e1866f839e238570c96a97535a81da76a26f45f99ede18b3897"}, + {file = "cython-3.1.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:955bc6032d89ce380458266e65dcf5ae0ed1e7c03a7a4457e3e4773e90ba7373"}, + {file = "cython-3.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0b58e859889dd0fc6c3a990445b930f692948b28328bb4f3ed84b51028b7e183"}, + {file = "cython-3.1.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:992a6504aa3eed50dd1fc3d1fa998928b08c1188130bd526e177b6d7f3383ec4"}, + {file = "cython-3.1.2-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:f3d03077938b02ec47a56aa156da7bfc2379193738397d4e88086db5b0a374e0"}, + {file = "cython-3.1.2-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:b7e1d3c383a5f4ca5319248b9cb1b16a04fb36e153d651e558897171b7dbabb9"}, + {file = "cython-3.1.2-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:58d4d45e40cadf4f602d96b7016cf24ccfe4d954c61fa30b79813db8ccb7818f"}, + {file = "cython-3.1.2-cp38-cp38-win32.whl", hash = "sha256:919ff38a93f7c21829a519693b336979feb41a0f7ca35969402d7e211706100e"}, + {file = "cython-3.1.2-cp38-cp38-win_amd64.whl", hash = "sha256:aca994519645ba8fb5e99c0f9d4be28d61435775552aaf893a158c583cd218a5"}, + {file = "cython-3.1.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:fe7f1ee4c13f8a773bd6c66b3d25879f40596faeab49f97d28c39b16ace5fff9"}, + {file = "cython-3.1.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c9ec7d2baea122d94790624f743ff5b78f4e777bf969384be65b69d92fa4bc3f"}, + {file = "cython-3.1.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df57827185874f29240b02402e615547ab995d90182a852c6ec4f91bbae355a4"}, + {file = "cython-3.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b1a69b9b4fe0a48a8271027c0703c71ab1993c4caca01791c0fd2e2bd9031aa"}, + {file = "cython-3.1.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:970cc1558519f0f108c3e2f4b3480de4945228d9292612d5b2bb687e36c646b8"}, + {file = "cython-3.1.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:604c39cd6d152498a940aeae28b6fd44481a255a3fdf1b0051c30f3873c88b7f"}, + {file = "cython-3.1.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:855f2ae06438c7405997cf0df42d5b508ec3248272bb39df4a7a4a82a5f7c8cb"}, + {file = "cython-3.1.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:9e3016ca7a86728bfcbdd52449521e859a977451f296a7ae4967cefa2ec498f7"}, + {file = "cython-3.1.2-cp39-cp39-win32.whl", hash = "sha256:4896fc2b0f90820ea6fcf79a07e30822f84630a404d4e075784124262f6d0adf"}, + {file = "cython-3.1.2-cp39-cp39-win_amd64.whl", hash = "sha256:a965b81eb4f5a5f3f6760b162cb4de3907c71a9ba25d74de1ad7a0e4856f0412"}, + {file = "cython-3.1.2-py3-none-any.whl", hash = "sha256:d23fd7ffd7457205f08571a42b108a3cf993e83a59fe4d72b42e6fc592cf2639"}, + {file = "cython-3.1.2.tar.gz", hash = "sha256:6bbf7a953fa6762dfecdec015e3b054ba51c0121a45ad851fa130f63f5331381"}, ] [[package]] name = "dependency-groups" -version = "1.3.0" +version = "1.3.1" description = "A tool for resolving PEP 735 Dependency Group data" optional = false python-versions = ">=3.8" groups = ["test"] files = [ - {file = "dependency_groups-1.3.0-py3-none-any.whl", hash = "sha256:1abf34d712deda5581e80d507512664d52b35d1c2d7caf16c85e58ca508547e0"}, - {file = "dependency_groups-1.3.0.tar.gz", hash = "sha256:5b9751d5d98fbd6dfd038a560a69c8382e41afcbf7ffdbcc28a2a3f85498830f"}, + {file = "dependency_groups-1.3.1-py3-none-any.whl", hash = "sha256:51aeaa0dfad72430fcfb7bcdbefbd75f3792e5919563077f30bc0d73f4493030"}, + {file = "dependency_groups-1.3.1.tar.gz", hash = "sha256:78078301090517fd938c19f64a53ce98c32834dfe0dee6b88004a569a6adfefd"}, ] [package.dependencies] @@ -441,17 +443,20 @@ dates = ["pytz (>=2019.1)"] [[package]] name = "exceptiongroup" -version = "1.2.2" +version = "1.3.0" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" groups = ["test"] markers = "python_version < \"3.11\"" files = [ - {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, - {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, + {file = "exceptiongroup-1.3.0-py3-none-any.whl", hash = "sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10"}, + {file = "exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88"}, ] +[package.dependencies] +typing-extensions = {version = ">=4.6.0", markers = "python_version < \"3.13\""} + [package.extras] test = ["pytest (>=6)"] @@ -501,15 +506,15 @@ files = [ [[package]] name = "importlib-metadata" -version = "8.6.1" +version = "8.7.0" description = "Read metadata from Python packages" optional = false python-versions = ">=3.9" groups = ["docs"] markers = "python_version == \"3.9\"" files = [ - {file = "importlib_metadata-8.6.1-py3-none-any.whl", hash = "sha256:02a89390c1e15fdfdc0d7c6b25cb3e62650d0494005c97d6f148bf5b9787525e"}, - {file = "importlib_metadata-8.6.1.tar.gz", hash = "sha256:310b41d755445d74569f993ccfc22838295d9fe005425094fad953d7f15c8580"}, + {file = "importlib_metadata-8.7.0-py3-none-any.whl", hash = "sha256:e5dd1551894c77868a30651cef00984d50e1002d06942a7101d34870c5f02afd"}, + {file = "importlib_metadata-8.7.0.tar.gz", hash = "sha256:d13b81ad223b890aa16c5471f2ac3056cf76c5f10f82d6f9292f0b415f389000"}, ] [package.dependencies] @@ -643,14 +648,14 @@ icu = ["PyICU (>=1.0.0)"] [[package]] name = "nox" -version = "2025.2.9" +version = "2025.5.1" description = "Flexible test automation." optional = false python-versions = ">=3.8" groups = ["test"] files = [ - {file = "nox-2025.2.9-py3-none-any.whl", hash = "sha256:7d1e92d1918c6980d70aee9cf1c1d19d16faa71c4afe338fffd39e8a460e2067"}, - {file = "nox-2025.2.9.tar.gz", hash = "sha256:d50cd4ca568bd7621c2e6cbbc4845b3b7f7697f25d5fb0190ce8f4600be79768"}, + {file = "nox-2025.5.1-py3-none-any.whl", hash = "sha256:56abd55cf37ff523c254fcec4d152ed51e5fe80e2ab8317221d8b828ac970a31"}, + {file = "nox-2025.5.1.tar.gz", hash = "sha256:2a571dfa7a58acc726521ac3cd8184455ebcdcbf26401c7b737b5bc6701427b2"}, ] [package.dependencies] @@ -668,14 +673,14 @@ uv = ["uv (>=0.1.6)"] [[package]] name = "packaging" -version = "24.2" +version = "25.0" description = "Core utilities for Python packages" optional = false python-versions = ">=3.8" groups = ["docs", "test"] files = [ - {file = "packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"}, - {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"}, + {file = "packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484"}, + {file = "packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f"}, ] [[package]] @@ -696,14 +701,14 @@ test = ["pytest", "pytest-console-scripts", "pytest-cov"] [[package]] name = "platformdirs" -version = "4.3.7" +version = "4.3.8" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.9" groups = ["test"] files = [ - {file = "platformdirs-4.3.7-py3-none-any.whl", hash = "sha256:a03875334331946f13c549dbd8f4bac7a13a50a895a0eb1e8c6a8ace80d40a94"}, - {file = "platformdirs-4.3.7.tar.gz", hash = "sha256:eb437d586b6a0986388f0d6f74aa0cde27b48d0e3d66843640bfb6bdcdb6e351"}, + {file = "platformdirs-4.3.8-py3-none-any.whl", hash = "sha256:ff7059bb7eb1179e2685604f4aaf157cfd9535242bd23742eadc3c13542139b4"}, + {file = "platformdirs-4.3.8.tar.gz", hash = "sha256:3d512d96e16bcb959a814c9f348431070822a6496326a4be0911c40b5a74c2bc"}, ] [package.extras] @@ -713,19 +718,19 @@ type = ["mypy (>=1.14.1)"] [[package]] name = "pluggy" -version = "1.5.0" +version = "1.6.0" description = "plugin and hook calling mechanisms for python" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" groups = ["test"] files = [ - {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, - {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, + {file = "pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746"}, + {file = "pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3"}, ] [package.extras] dev = ["pre-commit", "tox"] -testing = ["pytest", "pytest-benchmark"] +testing = ["coverage", "pytest", "pytest-benchmark"] [[package]] name = "py-cpuinfo" @@ -745,7 +750,7 @@ version = "2.19.1" description = "Pygments is a syntax highlighting package written in Python." optional = false python-versions = ">=3.8" -groups = ["docs"] +groups = ["docs", "test"] files = [ {file = "pygments-2.19.1-py3-none-any.whl", hash = "sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c"}, {file = "pygments-2.19.1.tar.gz", hash = "sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f"}, @@ -756,26 +761,27 @@ windows-terminal = ["colorama (>=0.4.6)"] [[package]] name = "pytest" -version = "8.3.5" +version = "8.4.0" description = "pytest: simple powerful testing with Python" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" groups = ["test"] files = [ - {file = "pytest-8.3.5-py3-none-any.whl", hash = "sha256:c69214aa47deac29fad6c2a4f590b9c4a9fdb16a403176fe154b79c0b4d4d820"}, - {file = "pytest-8.3.5.tar.gz", hash = "sha256:f4efe70cc14e511565ac476b57c279e12a855b11f48f212af1080ef2263d3845"}, + {file = "pytest-8.4.0-py3-none-any.whl", hash = "sha256:f40f825768ad76c0977cbacdf1fd37c6f7a468e460ea6a0636078f8972d4517e"}, + {file = "pytest-8.4.0.tar.gz", hash = "sha256:14d920b48472ea0dbf68e45b96cd1ffda4705f33307dcc86c676c1b5104838a6"}, ] [package.dependencies] -colorama = {version = "*", markers = "sys_platform == \"win32\""} -exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} -iniconfig = "*" -packaging = "*" +colorama = {version = ">=0.4", markers = "sys_platform == \"win32\""} +exceptiongroup = {version = ">=1", markers = "python_version < \"3.11\""} +iniconfig = ">=1" +packaging = ">=20" pluggy = ">=1.5,<2" +pygments = ">=2.7.2" tomli = {version = ">=1", markers = "python_version < \"3.11\""} [package.extras] -dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] +dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "requests", "setuptools", "xmlschema"] [[package]] name = "pytest-benchmark" @@ -800,38 +806,39 @@ histogram = ["pygal", "pygaljs", "setuptools"] [[package]] name = "pytest-cov" -version = "6.1.1" +version = "6.2.1" description = "Pytest plugin for measuring coverage." optional = false python-versions = ">=3.9" groups = ["test"] files = [ - {file = "pytest_cov-6.1.1-py3-none-any.whl", hash = "sha256:bddf29ed2d0ab6f4df17b4c55b0a657287db8684af9c42ea546b21b1041b3dde"}, - {file = "pytest_cov-6.1.1.tar.gz", hash = "sha256:46935f7aaefba760e716c2ebfbe1c216240b9592966e7da99ea8292d4d3e2a0a"}, + {file = "pytest_cov-6.2.1-py3-none-any.whl", hash = "sha256:f5bc4c23f42f1cdd23c70b1dab1bbaef4fc505ba950d53e0081d0730dd7e86d5"}, + {file = "pytest_cov-6.2.1.tar.gz", hash = "sha256:25cc6cc0a5358204b8108ecedc51a9b57b34cc6b8c967cc2c01a4e00d8a67da2"}, ] [package.dependencies] coverage = {version = ">=7.5", extras = ["toml"]} -pytest = ">=4.6" +pluggy = ">=1.2" +pytest = ">=6.2.5" [package.extras] testing = ["fields", "hunter", "process-tests", "pytest-xdist", "virtualenv"] [[package]] name = "requests" -version = "2.32.3" +version = "2.32.4" description = "Python HTTP for Humans." optional = false python-versions = ">=3.8" groups = ["docs"] files = [ - {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, - {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, + {file = "requests-2.32.4-py3-none-any.whl", hash = "sha256:27babd3cda2a6d50b30443204ee89830707d396671944c998b5975b031ac2b2c"}, + {file = "requests-2.32.4.tar.gz", hash = "sha256:27d0316682c8a29834d3264820024b62a36942083d52caf2f14c0591336d3422"}, ] [package.dependencies] certifi = ">=2017.4.17" -charset-normalizer = ">=2,<4" +charset_normalizer = ">=2,<4" idna = ">=2.5,<4" urllib3 = ">=1.21.1,<3" @@ -869,14 +876,14 @@ files = [ [[package]] name = "snowballstemmer" -version = "2.2.0" -description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." +version = "3.0.1" +description = "This package provides 32 stemmers for 30 languages generated from Snowball algorithms." optional = false -python-versions = "*" +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*" groups = ["docs"] files = [ - {file = "snowballstemmer-2.2.0-py2.py3-none-any.whl", hash = "sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a"}, - {file = "snowballstemmer-2.2.0.tar.gz", hash = "sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1"}, + {file = "snowballstemmer-3.0.1-py3-none-any.whl", hash = "sha256:6cd7b3897da8d6c9ffb968a6781fa6532dce9c3618a4b127d920dab764a19064"}, + {file = "snowballstemmer-3.0.1.tar.gz", hash = "sha256:6d5eeeec8e9f84d4d56b847692bacf79bc2c8e90c7f80ca4444ff8b6f2e52895"}, ] [[package]] @@ -1131,26 +1138,27 @@ files = [ [[package]] name = "typing-extensions" -version = "4.13.1" -description = "Backported and Experimental Type Hints for Python 3.8+" +version = "4.14.0" +description = "Backported and Experimental Type Hints for Python 3.9+" optional = false -python-versions = ">=3.8" -groups = ["docs"] +python-versions = ">=3.9" +groups = ["docs", "test"] files = [ - {file = "typing_extensions-4.13.1-py3-none-any.whl", hash = "sha256:4b6cf02909eb5495cfbc3f6e8fd49217e6cc7944e145cdda8caa3734777f9e69"}, - {file = "typing_extensions-4.13.1.tar.gz", hash = "sha256:98795af00fb9640edec5b8e31fc647597b4691f099ad75f469a2616be1a76dff"}, + {file = "typing_extensions-4.14.0-py3-none-any.whl", hash = "sha256:a1514509136dd0b477638fc68d6a91497af5076466ad0fa6c338e44e359944af"}, + {file = "typing_extensions-4.14.0.tar.gz", hash = "sha256:8676b788e32f02ab42d9e7c61324048ae4c6d844a399eebace3d4979d75ceef4"}, ] +markers = {test = "python_version < \"3.11\""} [[package]] name = "urllib3" -version = "2.3.0" +version = "2.4.0" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.9" groups = ["docs"] files = [ - {file = "urllib3-2.3.0-py3-none-any.whl", hash = "sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df"}, - {file = "urllib3-2.3.0.tar.gz", hash = "sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d"}, + {file = "urllib3-2.4.0-py3-none-any.whl", hash = "sha256:4e16665048960a0900c702d4a66415956a584919c03361cac9f1df5c5dd7e813"}, + {file = "urllib3-2.4.0.tar.gz", hash = "sha256:414bc6535b787febd7567804cc015fee39daab8ad86268f1310a9250697de466"}, ] [package.extras] @@ -1161,14 +1169,14 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "virtualenv" -version = "20.30.0" +version = "20.31.2" description = "Virtual Python Environment builder" optional = false python-versions = ">=3.8" groups = ["test"] files = [ - {file = "virtualenv-20.30.0-py3-none-any.whl", hash = "sha256:e34302959180fca3af42d1800df014b35019490b119eba981af27f2fa486e5d6"}, - {file = "virtualenv-20.30.0.tar.gz", hash = "sha256:800863162bcaa5450a6e4d721049730e7f2dae07720e0902b0e4040bd6f9ada8"}, + {file = "virtualenv-20.31.2-py3-none-any.whl", hash = "sha256:36efd0d9650ee985f0cad72065001e66d49a6f24eb44d98980f630686243cf11"}, + {file = "virtualenv-20.31.2.tar.gz", hash = "sha256:e10c0a9d02835e592521be48b332b6caee6887f332c111aa79a09b9e79efc2af"}, ] [package.dependencies] @@ -1182,15 +1190,15 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess [[package]] name = "zipp" -version = "3.21.0" +version = "3.23.0" description = "Backport of pathlib-compatible object wrapper for zip files" optional = false python-versions = ">=3.9" groups = ["docs"] markers = "python_version == \"3.9\"" files = [ - {file = "zipp-3.21.0-py3-none-any.whl", hash = "sha256:ac1bbe05fd2991f160ebce24ffbac5f6d11d83dc90891255885223d42b3cd931"}, - {file = "zipp-3.21.0.tar.gz", hash = "sha256:2c9958f6430a2040341a52eb608ed6dd93ef4392e02ffe219417c1b28b5dd1f4"}, + {file = "zipp-3.23.0-py3-none-any.whl", hash = "sha256:071652d6115ed432f5ce1d34c336c0adfd6a884660d1e9712a256d3d3bd4b14e"}, + {file = "zipp-3.23.0.tar.gz", hash = "sha256:a07157588a12518c9d4034df3fbbee09c814741a33ff63c05fa29d26a2404166"}, ] [package.extras] @@ -1198,7 +1206,7 @@ check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \" cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] enabler = ["pytest-enabler (>=2.2)"] -test = ["big-O", "importlib-resources ; python_version < \"3.9\"", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-ignore-flaky"] +test = ["big-O", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more_itertools", "pytest (>=6,!=8.1.*)", "pytest-ignore-flaky"] type = ["pytest-mypy"] [metadata] From b8a6e671c0c821ab0cbacbfa5116f1afe0da9a69 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Mon, 16 Jun 2025 12:23:44 +0200 Subject: [PATCH 39/87] Removed poetry.lock file from repository --- .gitignore | 1 + poetry.lock | 1215 --------------------------------------------------- 2 files changed, 1 insertion(+), 1215 deletions(-) delete mode 100644 poetry.lock diff --git a/.gitignore b/.gitignore index 01fce1b..f2f7e91 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ var/ *.egg-info/ .installed.cfg *.egg +poetry.lock # PyInstaller # Usually these files are written by a python script from a template diff --git a/poetry.lock b/poetry.lock deleted file mode 100644 index a00b25b..0000000 --- a/poetry.lock +++ /dev/null @@ -1,1215 +0,0 @@ -# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. - -[[package]] -name = "alabaster" -version = "0.7.16" -description = "A light, configurable Sphinx theme" -optional = false -python-versions = ">=3.9" -groups = ["docs"] -files = [ - {file = "alabaster-0.7.16-py3-none-any.whl", hash = "sha256:b46733c07dce03ae4e150330b975c75737fa60f0a7c591b6c8bf4928a28e2c92"}, - {file = "alabaster-0.7.16.tar.gz", hash = "sha256:75a8b99c28a5dad50dd7f8ccdd447a121ddb3892da9e53d1ca5cca3106d58d65"}, -] - -[[package]] -name = "argcomplete" -version = "3.6.2" -description = "Bash tab completion for argparse" -optional = false -python-versions = ">=3.8" -groups = ["test"] -files = [ - {file = "argcomplete-3.6.2-py3-none-any.whl", hash = "sha256:65b3133a29ad53fb42c48cf5114752c7ab66c1c38544fdf6460f450c09b42591"}, - {file = "argcomplete-3.6.2.tar.gz", hash = "sha256:d0519b1bc867f5f4f4713c41ad0aba73a4a5f007449716b16f385f2166dc6adf"}, -] - -[package.extras] -test = ["coverage", "mypy", "pexpect", "ruff", "wheel"] - -[[package]] -name = "attrs" -version = "25.3.0" -description = "Classes Without Boilerplate" -optional = false -python-versions = ">=3.8" -groups = ["test"] -files = [ - {file = "attrs-25.3.0-py3-none-any.whl", hash = "sha256:427318ce031701fea540783410126f03899a97ffc6f61596ad581ac2e40e3bc3"}, - {file = "attrs-25.3.0.tar.gz", hash = "sha256:75d7cefc7fb576747b2c81b4442d4d4a1ce0900973527c011d1030fd3bf4af1b"}, -] - -[package.extras] -benchmark = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-xdist[psutil]"] -cov = ["cloudpickle ; platform_python_implementation == \"CPython\"", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-xdist[psutil]"] -dev = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pre-commit-uv", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-xdist[psutil]"] -docs = ["cogapp", "furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier"] -tests = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-xdist[psutil]"] -tests-mypy = ["mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\""] - -[[package]] -name = "babel" -version = "2.17.0" -description = "Internationalization utilities" -optional = false -python-versions = ">=3.8" -groups = ["docs"] -files = [ - {file = "babel-2.17.0-py3-none-any.whl", hash = "sha256:4d0b53093fdfb4b21c92b5213dba5a1b23885afa8383709427046b21c366e5f2"}, - {file = "babel-2.17.0.tar.gz", hash = "sha256:0c54cffb19f690cdcc52a3b50bcbf71e07a808d1c80d549f2459b9d2cf0afb9d"}, -] - -[package.extras] -dev = ["backports.zoneinfo ; python_version < \"3.9\"", "freezegun (>=1.0,<2.0)", "jinja2 (>=3.0)", "pytest (>=6.0)", "pytest-cov", "pytz", "setuptools", "tzdata ; sys_platform == \"win32\""] - -[[package]] -name = "certifi" -version = "2025.6.15" -description = "Python package for providing Mozilla's CA Bundle." -optional = false -python-versions = ">=3.7" -groups = ["docs"] -files = [ - {file = "certifi-2025.6.15-py3-none-any.whl", hash = "sha256:2e0c7ce7cb5d8f8634ca55d2ba7e6ec2689a2fd6537d8dec1296a477a4910057"}, - {file = "certifi-2025.6.15.tar.gz", hash = "sha256:d747aa5a8b9bbbb1bb8c22bb13e22bd1f18e9796defa16bab421f7f7a317323b"}, -] - -[[package]] -name = "charset-normalizer" -version = "3.4.2" -description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -optional = false -python-versions = ">=3.7" -groups = ["docs"] -files = [ - {file = "charset_normalizer-3.4.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7c48ed483eb946e6c04ccbe02c6b4d1d48e51944b6db70f697e089c193404941"}, - {file = "charset_normalizer-3.4.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b2d318c11350e10662026ad0eb71bb51c7812fc8590825304ae0bdd4ac283acd"}, - {file = "charset_normalizer-3.4.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9cbfacf36cb0ec2897ce0ebc5d08ca44213af24265bd56eca54bee7923c48fd6"}, - {file = "charset_normalizer-3.4.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:18dd2e350387c87dabe711b86f83c9c78af772c748904d372ade190b5c7c9d4d"}, - {file = "charset_normalizer-3.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8075c35cd58273fee266c58c0c9b670947c19df5fb98e7b66710e04ad4e9ff86"}, - {file = "charset_normalizer-3.4.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5bf4545e3b962767e5c06fe1738f951f77d27967cb2caa64c28be7c4563e162c"}, - {file = "charset_normalizer-3.4.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:7a6ab32f7210554a96cd9e33abe3ddd86732beeafc7a28e9955cdf22ffadbab0"}, - {file = "charset_normalizer-3.4.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:b33de11b92e9f75a2b545d6e9b6f37e398d86c3e9e9653c4864eb7e89c5773ef"}, - {file = "charset_normalizer-3.4.2-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:8755483f3c00d6c9a77f490c17e6ab0c8729e39e6390328e42521ef175380ae6"}, - {file = "charset_normalizer-3.4.2-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:68a328e5f55ec37c57f19ebb1fdc56a248db2e3e9ad769919a58672958e8f366"}, - {file = "charset_normalizer-3.4.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:21b2899062867b0e1fde9b724f8aecb1af14f2778d69aacd1a5a1853a597a5db"}, - {file = "charset_normalizer-3.4.2-cp310-cp310-win32.whl", hash = "sha256:e8082b26888e2f8b36a042a58307d5b917ef2b1cacab921ad3323ef91901c71a"}, - {file = "charset_normalizer-3.4.2-cp310-cp310-win_amd64.whl", hash = "sha256:f69a27e45c43520f5487f27627059b64aaf160415589230992cec34c5e18a509"}, - {file = "charset_normalizer-3.4.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:be1e352acbe3c78727a16a455126d9ff83ea2dfdcbc83148d2982305a04714c2"}, - {file = "charset_normalizer-3.4.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aa88ca0b1932e93f2d961bf3addbb2db902198dca337d88c89e1559e066e7645"}, - {file = "charset_normalizer-3.4.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d524ba3f1581b35c03cb42beebab4a13e6cdad7b36246bd22541fa585a56cccd"}, - {file = "charset_normalizer-3.4.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28a1005facc94196e1fb3e82a3d442a9d9110b8434fc1ded7a24a2983c9888d8"}, - {file = "charset_normalizer-3.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fdb20a30fe1175ecabed17cbf7812f7b804b8a315a25f24678bcdf120a90077f"}, - {file = "charset_normalizer-3.4.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0f5d9ed7f254402c9e7d35d2f5972c9bbea9040e99cd2861bd77dc68263277c7"}, - {file = "charset_normalizer-3.4.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:efd387a49825780ff861998cd959767800d54f8308936b21025326de4b5a42b9"}, - {file = "charset_normalizer-3.4.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:f0aa37f3c979cf2546b73e8222bbfa3dc07a641585340179d768068e3455e544"}, - {file = "charset_normalizer-3.4.2-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:e70e990b2137b29dc5564715de1e12701815dacc1d056308e2b17e9095372a82"}, - {file = "charset_normalizer-3.4.2-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:0c8c57f84ccfc871a48a47321cfa49ae1df56cd1d965a09abe84066f6853b9c0"}, - {file = "charset_normalizer-3.4.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:6b66f92b17849b85cad91259efc341dce9c1af48e2173bf38a85c6329f1033e5"}, - {file = "charset_normalizer-3.4.2-cp311-cp311-win32.whl", hash = "sha256:daac4765328a919a805fa5e2720f3e94767abd632ae410a9062dff5412bae65a"}, - {file = "charset_normalizer-3.4.2-cp311-cp311-win_amd64.whl", hash = "sha256:e53efc7c7cee4c1e70661e2e112ca46a575f90ed9ae3fef200f2a25e954f4b28"}, - {file = "charset_normalizer-3.4.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0c29de6a1a95f24b9a1aa7aefd27d2487263f00dfd55a77719b530788f75cff7"}, - {file = "charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cddf7bd982eaa998934a91f69d182aec997c6c468898efe6679af88283b498d3"}, - {file = "charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fcbe676a55d7445b22c10967bceaaf0ee69407fbe0ece4d032b6eb8d4565982a"}, - {file = "charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d41c4d287cfc69060fa91cae9683eacffad989f1a10811995fa309df656ec214"}, - {file = "charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4e594135de17ab3866138f496755f302b72157d115086d100c3f19370839dd3a"}, - {file = "charset_normalizer-3.4.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cf713fe9a71ef6fd5adf7a79670135081cd4431c2943864757f0fa3a65b1fafd"}, - {file = "charset_normalizer-3.4.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a370b3e078e418187da8c3674eddb9d983ec09445c99a3a263c2011993522981"}, - {file = "charset_normalizer-3.4.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:a955b438e62efdf7e0b7b52a64dc5c3396e2634baa62471768a64bc2adb73d5c"}, - {file = "charset_normalizer-3.4.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:7222ffd5e4de8e57e03ce2cef95a4c43c98fcb72ad86909abdfc2c17d227fc1b"}, - {file = "charset_normalizer-3.4.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:bee093bf902e1d8fc0ac143c88902c3dfc8941f7ea1d6a8dd2bcb786d33db03d"}, - {file = "charset_normalizer-3.4.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:dedb8adb91d11846ee08bec4c8236c8549ac721c245678282dcb06b221aab59f"}, - {file = "charset_normalizer-3.4.2-cp312-cp312-win32.whl", hash = "sha256:db4c7bf0e07fc3b7d89ac2a5880a6a8062056801b83ff56d8464b70f65482b6c"}, - {file = "charset_normalizer-3.4.2-cp312-cp312-win_amd64.whl", hash = "sha256:5a9979887252a82fefd3d3ed2a8e3b937a7a809f65dcb1e068b090e165bbe99e"}, - {file = "charset_normalizer-3.4.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:926ca93accd5d36ccdabd803392ddc3e03e6d4cd1cf17deff3b989ab8e9dbcf0"}, - {file = "charset_normalizer-3.4.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eba9904b0f38a143592d9fc0e19e2df0fa2e41c3c3745554761c5f6447eedabf"}, - {file = "charset_normalizer-3.4.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3fddb7e2c84ac87ac3a947cb4e66d143ca5863ef48e4a5ecb83bd48619e4634e"}, - {file = "charset_normalizer-3.4.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:98f862da73774290f251b9df8d11161b6cf25b599a66baf087c1ffe340e9bfd1"}, - {file = "charset_normalizer-3.4.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c9379d65defcab82d07b2a9dfbfc2e95bc8fe0ebb1b176a3190230a3ef0e07c"}, - {file = "charset_normalizer-3.4.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e635b87f01ebc977342e2697d05b56632f5f879a4f15955dfe8cef2448b51691"}, - {file = "charset_normalizer-3.4.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:1c95a1e2902a8b722868587c0e1184ad5c55631de5afc0eb96bc4b0d738092c0"}, - {file = "charset_normalizer-3.4.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:ef8de666d6179b009dce7bcb2ad4c4a779f113f12caf8dc77f0162c29d20490b"}, - {file = "charset_normalizer-3.4.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:32fc0341d72e0f73f80acb0a2c94216bd704f4f0bce10aedea38f30502b271ff"}, - {file = "charset_normalizer-3.4.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:289200a18fa698949d2b39c671c2cc7a24d44096784e76614899a7ccf2574b7b"}, - {file = "charset_normalizer-3.4.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4a476b06fbcf359ad25d34a057b7219281286ae2477cc5ff5e3f70a246971148"}, - {file = "charset_normalizer-3.4.2-cp313-cp313-win32.whl", hash = "sha256:aaeeb6a479c7667fbe1099af9617c83aaca22182d6cf8c53966491a0f1b7ffb7"}, - {file = "charset_normalizer-3.4.2-cp313-cp313-win_amd64.whl", hash = "sha256:aa6af9e7d59f9c12b33ae4e9450619cf2488e2bbe9b44030905877f0b2324980"}, - {file = "charset_normalizer-3.4.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1cad5f45b3146325bb38d6855642f6fd609c3f7cad4dbaf75549bf3b904d3184"}, - {file = "charset_normalizer-3.4.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b2680962a4848b3c4f155dc2ee64505a9c57186d0d56b43123b17ca3de18f0fa"}, - {file = "charset_normalizer-3.4.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:36b31da18b8890a76ec181c3cf44326bf2c48e36d393ca1b72b3f484113ea344"}, - {file = "charset_normalizer-3.4.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f4074c5a429281bf056ddd4c5d3b740ebca4d43ffffe2ef4bf4d2d05114299da"}, - {file = "charset_normalizer-3.4.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c9e36a97bee9b86ef9a1cf7bb96747eb7a15c2f22bdb5b516434b00f2a599f02"}, - {file = "charset_normalizer-3.4.2-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:1b1bde144d98e446b056ef98e59c256e9294f6b74d7af6846bf5ffdafd687a7d"}, - {file = "charset_normalizer-3.4.2-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:915f3849a011c1f593ab99092f3cecfcb4d65d8feb4a64cf1bf2d22074dc0ec4"}, - {file = "charset_normalizer-3.4.2-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:fb707f3e15060adf5b7ada797624a6c6e0138e2a26baa089df64c68ee98e040f"}, - {file = "charset_normalizer-3.4.2-cp37-cp37m-musllinux_1_2_s390x.whl", hash = "sha256:25a23ea5c7edc53e0f29bae2c44fcb5a1aa10591aae107f2a2b2583a9c5cbc64"}, - {file = "charset_normalizer-3.4.2-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:770cab594ecf99ae64c236bc9ee3439c3f46be49796e265ce0cc8bc17b10294f"}, - {file = "charset_normalizer-3.4.2-cp37-cp37m-win32.whl", hash = "sha256:6a0289e4589e8bdfef02a80478f1dfcb14f0ab696b5a00e1f4b8a14a307a3c58"}, - {file = "charset_normalizer-3.4.2-cp37-cp37m-win_amd64.whl", hash = "sha256:6fc1f5b51fa4cecaa18f2bd7a003f3dd039dd615cd69a2afd6d3b19aed6775f2"}, - {file = "charset_normalizer-3.4.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:76af085e67e56c8816c3ccf256ebd136def2ed9654525348cfa744b6802b69eb"}, - {file = "charset_normalizer-3.4.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e45ba65510e2647721e35323d6ef54c7974959f6081b58d4ef5d87c60c84919a"}, - {file = "charset_normalizer-3.4.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:046595208aae0120559a67693ecc65dd75d46f7bf687f159127046628178dc45"}, - {file = "charset_normalizer-3.4.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:75d10d37a47afee94919c4fab4c22b9bc2a8bf7d4f46f87363bcf0573f3ff4f5"}, - {file = "charset_normalizer-3.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6333b3aa5a12c26b2a4d4e7335a28f1475e0e5e17d69d55141ee3cab736f66d1"}, - {file = "charset_normalizer-3.4.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e8323a9b031aa0393768b87f04b4164a40037fb2a3c11ac06a03ffecd3618027"}, - {file = "charset_normalizer-3.4.2-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:24498ba8ed6c2e0b56d4acbf83f2d989720a93b41d712ebd4f4979660db4417b"}, - {file = "charset_normalizer-3.4.2-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:844da2b5728b5ce0e32d863af26f32b5ce61bc4273a9c720a9f3aa9df73b1455"}, - {file = "charset_normalizer-3.4.2-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:65c981bdbd3f57670af8b59777cbfae75364b483fa8a9f420f08094531d54a01"}, - {file = "charset_normalizer-3.4.2-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:3c21d4fca343c805a52c0c78edc01e3477f6dd1ad7c47653241cf2a206d4fc58"}, - {file = "charset_normalizer-3.4.2-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:dc7039885fa1baf9be153a0626e337aa7ec8bf96b0128605fb0d77788ddc1681"}, - {file = "charset_normalizer-3.4.2-cp38-cp38-win32.whl", hash = "sha256:8272b73e1c5603666618805fe821edba66892e2870058c94c53147602eab29c7"}, - {file = "charset_normalizer-3.4.2-cp38-cp38-win_amd64.whl", hash = "sha256:70f7172939fdf8790425ba31915bfbe8335030f05b9913d7ae00a87d4395620a"}, - {file = "charset_normalizer-3.4.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:005fa3432484527f9732ebd315da8da8001593e2cf46a3d817669f062c3d9ed4"}, - {file = "charset_normalizer-3.4.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e92fca20c46e9f5e1bb485887d074918b13543b1c2a1185e69bb8d17ab6236a7"}, - {file = "charset_normalizer-3.4.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:50bf98d5e563b83cc29471fa114366e6806bc06bc7a25fd59641e41445327836"}, - {file = "charset_normalizer-3.4.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:721c76e84fe669be19c5791da68232ca2e05ba5185575086e384352e2c309597"}, - {file = "charset_normalizer-3.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:82d8fd25b7f4675d0c47cf95b594d4e7b158aca33b76aa63d07186e13c0e0ab7"}, - {file = "charset_normalizer-3.4.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b3daeac64d5b371dea99714f08ffc2c208522ec6b06fbc7866a450dd446f5c0f"}, - {file = "charset_normalizer-3.4.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:dccab8d5fa1ef9bfba0590ecf4d46df048d18ffe3eec01eeb73a42e0d9e7a8ba"}, - {file = "charset_normalizer-3.4.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:aaf27faa992bfee0264dc1f03f4c75e9fcdda66a519db6b957a3f826e285cf12"}, - {file = "charset_normalizer-3.4.2-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:eb30abc20df9ab0814b5a2524f23d75dcf83cde762c161917a2b4b7b55b1e518"}, - {file = "charset_normalizer-3.4.2-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:c72fbbe68c6f32f251bdc08b8611c7b3060612236e960ef848e0a517ddbe76c5"}, - {file = "charset_normalizer-3.4.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:982bb1e8b4ffda883b3d0a521e23abcd6fd17418f6d2c4118d257a10199c0ce3"}, - {file = "charset_normalizer-3.4.2-cp39-cp39-win32.whl", hash = "sha256:43e0933a0eff183ee85833f341ec567c0980dae57c464d8a508e1b2ceb336471"}, - {file = "charset_normalizer-3.4.2-cp39-cp39-win_amd64.whl", hash = "sha256:d11b54acf878eef558599658b0ffca78138c8c3655cf4f3a4a673c437e67732e"}, - {file = "charset_normalizer-3.4.2-py3-none-any.whl", hash = "sha256:7f56930ab0abd1c45cd15be65cc741c28b1c9a34876ce8c17a2fa107810c0af0"}, - {file = "charset_normalizer-3.4.2.tar.gz", hash = "sha256:5baececa9ecba31eff645232d59845c07aa030f0c81ee70184a90d35099a0e63"}, -] - -[[package]] -name = "colorama" -version = "0.4.6" -description = "Cross-platform colored terminal text." -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" -groups = ["docs", "test"] -markers = "sys_platform == \"win32\"" -files = [ - {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, - {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, -] - -[[package]] -name = "colorlog" -version = "6.9.0" -description = "Add colours to the output of Python's logging module." -optional = false -python-versions = ">=3.6" -groups = ["test"] -files = [ - {file = "colorlog-6.9.0-py3-none-any.whl", hash = "sha256:5906e71acd67cb07a71e779c47c4bcb45fb8c2993eebe9e5adcd6a6f1b283eff"}, - {file = "colorlog-6.9.0.tar.gz", hash = "sha256:bfba54a1b93b94f54e1f4fe48395725a3d92fd2a4af702f6bd70946bdc0c6ac2"}, -] - -[package.dependencies] -colorama = {version = "*", markers = "sys_platform == \"win32\""} - -[package.extras] -development = ["black", "flake8", "mypy", "pytest", "types-colorama"] - -[[package]] -name = "coverage" -version = "7.9.1" -description = "Code coverage measurement for Python" -optional = false -python-versions = ">=3.9" -groups = ["test"] -files = [ - {file = "coverage-7.9.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:cc94d7c5e8423920787c33d811c0be67b7be83c705f001f7180c7b186dcf10ca"}, - {file = "coverage-7.9.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:16aa0830d0c08a2c40c264cef801db8bc4fc0e1892782e45bcacbd5889270509"}, - {file = "coverage-7.9.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cf95981b126f23db63e9dbe4cf65bd71f9a6305696fa5e2262693bc4e2183f5b"}, - {file = "coverage-7.9.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f05031cf21699785cd47cb7485f67df619e7bcdae38e0fde40d23d3d0210d3c3"}, - {file = "coverage-7.9.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bb4fbcab8764dc072cb651a4bcda4d11fb5658a1d8d68842a862a6610bd8cfa3"}, - {file = "coverage-7.9.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:0f16649a7330ec307942ed27d06ee7e7a38417144620bb3d6e9a18ded8a2d3e5"}, - {file = "coverage-7.9.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:cea0a27a89e6432705fffc178064503508e3c0184b4f061700e771a09de58187"}, - {file = "coverage-7.9.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e980b53a959fa53b6f05343afbd1e6f44a23ed6c23c4b4c56c6662bbb40c82ce"}, - {file = "coverage-7.9.1-cp310-cp310-win32.whl", hash = "sha256:70760b4c5560be6ca70d11f8988ee6542b003f982b32f83d5ac0b72476607b70"}, - {file = "coverage-7.9.1-cp310-cp310-win_amd64.whl", hash = "sha256:a66e8f628b71f78c0e0342003d53b53101ba4e00ea8dabb799d9dba0abbbcebe"}, - {file = "coverage-7.9.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:95c765060e65c692da2d2f51a9499c5e9f5cf5453aeaf1420e3fc847cc060582"}, - {file = "coverage-7.9.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ba383dc6afd5ec5b7a0d0c23d38895db0e15bcba7fb0fa8901f245267ac30d86"}, - {file = "coverage-7.9.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:37ae0383f13cbdcf1e5e7014489b0d71cc0106458878ccde52e8a12ced4298ed"}, - {file = "coverage-7.9.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:69aa417a030bf11ec46149636314c24c8d60fadb12fc0ee8f10fda0d918c879d"}, - {file = "coverage-7.9.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0a4be2a28656afe279b34d4f91c3e26eccf2f85500d4a4ff0b1f8b54bf807338"}, - {file = "coverage-7.9.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:382e7ddd5289f140259b610e5f5c58f713d025cb2f66d0eb17e68d0a94278875"}, - {file = "coverage-7.9.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e5532482344186c543c37bfad0ee6069e8ae4fc38d073b8bc836fc8f03c9e250"}, - {file = "coverage-7.9.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:a39d18b3f50cc121d0ce3838d32d58bd1d15dab89c910358ebefc3665712256c"}, - {file = "coverage-7.9.1-cp311-cp311-win32.whl", hash = "sha256:dd24bd8d77c98557880def750782df77ab2b6885a18483dc8588792247174b32"}, - {file = "coverage-7.9.1-cp311-cp311-win_amd64.whl", hash = "sha256:6b55ad10a35a21b8015eabddc9ba31eb590f54adc9cd39bcf09ff5349fd52125"}, - {file = "coverage-7.9.1-cp311-cp311-win_arm64.whl", hash = "sha256:6ad935f0016be24c0e97fc8c40c465f9c4b85cbbe6eac48934c0dc4d2568321e"}, - {file = "coverage-7.9.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:a8de12b4b87c20de895f10567639c0797b621b22897b0af3ce4b4e204a743626"}, - {file = "coverage-7.9.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5add197315a054e92cee1b5f686a2bcba60c4c3e66ee3de77ace6c867bdee7cb"}, - {file = "coverage-7.9.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:600a1d4106fe66f41e5d0136dfbc68fe7200a5cbe85610ddf094f8f22e1b0300"}, - {file = "coverage-7.9.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2a876e4c3e5a2a1715a6608906aa5a2e0475b9c0f68343c2ada98110512ab1d8"}, - {file = "coverage-7.9.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:81f34346dd63010453922c8e628a52ea2d2ccd73cb2487f7700ac531b247c8a5"}, - {file = "coverage-7.9.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:888f8eee13f2377ce86d44f338968eedec3291876b0b8a7289247ba52cb984cd"}, - {file = "coverage-7.9.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:9969ef1e69b8c8e1e70d591f91bbc37fc9a3621e447525d1602801a24ceda898"}, - {file = "coverage-7.9.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:60c458224331ee3f1a5b472773e4a085cc27a86a0b48205409d364272d67140d"}, - {file = "coverage-7.9.1-cp312-cp312-win32.whl", hash = "sha256:5f646a99a8c2b3ff4c6a6e081f78fad0dde275cd59f8f49dc4eab2e394332e74"}, - {file = "coverage-7.9.1-cp312-cp312-win_amd64.whl", hash = "sha256:30f445f85c353090b83e552dcbbdad3ec84c7967e108c3ae54556ca69955563e"}, - {file = "coverage-7.9.1-cp312-cp312-win_arm64.whl", hash = "sha256:af41da5dca398d3474129c58cb2b106a5d93bbb196be0d307ac82311ca234342"}, - {file = "coverage-7.9.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:31324f18d5969feef7344a932c32428a2d1a3e50b15a6404e97cba1cc9b2c631"}, - {file = "coverage-7.9.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0c804506d624e8a20fb3108764c52e0eef664e29d21692afa375e0dd98dc384f"}, - {file = "coverage-7.9.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ef64c27bc40189f36fcc50c3fb8f16ccda73b6a0b80d9bd6e6ce4cffcd810bbd"}, - {file = "coverage-7.9.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d4fe2348cc6ec372e25adec0219ee2334a68d2f5222e0cba9c0d613394e12d86"}, - {file = "coverage-7.9.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:34ed2186fe52fcc24d4561041979a0dec69adae7bce2ae8d1c49eace13e55c43"}, - {file = "coverage-7.9.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:25308bd3d00d5eedd5ae7d4357161f4df743e3c0240fa773ee1b0f75e6c7c0f1"}, - {file = "coverage-7.9.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:73e9439310f65d55a5a1e0564b48e34f5369bee943d72c88378f2d576f5a5751"}, - {file = "coverage-7.9.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:37ab6be0859141b53aa89412a82454b482c81cf750de4f29223d52268a86de67"}, - {file = "coverage-7.9.1-cp313-cp313-win32.whl", hash = "sha256:64bdd969456e2d02a8b08aa047a92d269c7ac1f47e0c977675d550c9a0863643"}, - {file = "coverage-7.9.1-cp313-cp313-win_amd64.whl", hash = "sha256:be9e3f68ca9edb897c2184ad0eee815c635565dbe7a0e7e814dc1f7cbab92c0a"}, - {file = "coverage-7.9.1-cp313-cp313-win_arm64.whl", hash = "sha256:1c503289ffef1d5105d91bbb4d62cbe4b14bec4d13ca225f9c73cde9bb46207d"}, - {file = "coverage-7.9.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:0b3496922cb5f4215bf5caaef4cf12364a26b0be82e9ed6d050f3352cf2d7ef0"}, - {file = "coverage-7.9.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:9565c3ab1c93310569ec0d86b017f128f027cab0b622b7af288696d7ed43a16d"}, - {file = "coverage-7.9.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2241ad5dbf79ae1d9c08fe52b36d03ca122fb9ac6bca0f34439e99f8327ac89f"}, - {file = "coverage-7.9.1-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3bb5838701ca68b10ebc0937dbd0eb81974bac54447c55cd58dea5bca8451029"}, - {file = "coverage-7.9.1-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b30a25f814591a8c0c5372c11ac8967f669b97444c47fd794926e175c4047ece"}, - {file = "coverage-7.9.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:2d04b16a6062516df97969f1ae7efd0de9c31eb6ebdceaa0d213b21c0ca1a683"}, - {file = "coverage-7.9.1-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:7931b9e249edefb07cd6ae10c702788546341d5fe44db5b6108a25da4dca513f"}, - {file = "coverage-7.9.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:52e92b01041151bf607ee858e5a56c62d4b70f4dac85b8c8cb7fb8a351ab2c10"}, - {file = "coverage-7.9.1-cp313-cp313t-win32.whl", hash = "sha256:684e2110ed84fd1ca5f40e89aa44adf1729dc85444004111aa01866507adf363"}, - {file = "coverage-7.9.1-cp313-cp313t-win_amd64.whl", hash = "sha256:437c576979e4db840539674e68c84b3cda82bc824dd138d56bead1435f1cb5d7"}, - {file = "coverage-7.9.1-cp313-cp313t-win_arm64.whl", hash = "sha256:18a0912944d70aaf5f399e350445738a1a20b50fbea788f640751c2ed9208b6c"}, - {file = "coverage-7.9.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6f424507f57878e424d9a95dc4ead3fbdd72fd201e404e861e465f28ea469951"}, - {file = "coverage-7.9.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:535fde4001b2783ac80865d90e7cc7798b6b126f4cd8a8c54acfe76804e54e58"}, - {file = "coverage-7.9.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:02532fd3290bb8fa6bec876520842428e2a6ed6c27014eca81b031c2d30e3f71"}, - {file = "coverage-7.9.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:56f5eb308b17bca3bbff810f55ee26d51926d9f89ba92707ee41d3c061257e55"}, - {file = "coverage-7.9.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bfa447506c1a52271f1b0de3f42ea0fa14676052549095e378d5bff1c505ff7b"}, - {file = "coverage-7.9.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:9ca8e220006966b4a7b68e8984a6aee645a0384b0769e829ba60281fe61ec4f7"}, - {file = "coverage-7.9.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:49f1d0788ba5b7ba65933f3a18864117c6506619f5ca80326b478f72acf3f385"}, - {file = "coverage-7.9.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:68cd53aec6f45b8e4724c0950ce86eacb775c6be01ce6e3669fe4f3a21e768ed"}, - {file = "coverage-7.9.1-cp39-cp39-win32.whl", hash = "sha256:95335095b6c7b1cc14c3f3f17d5452ce677e8490d101698562b2ffcacc304c8d"}, - {file = "coverage-7.9.1-cp39-cp39-win_amd64.whl", hash = "sha256:e1b5191d1648acc439b24721caab2fd0c86679d8549ed2c84d5a7ec1bedcc244"}, - {file = "coverage-7.9.1-pp39.pp310.pp311-none-any.whl", hash = "sha256:db0f04118d1db74db6c9e1cb1898532c7dcc220f1d2718f058601f7c3f499514"}, - {file = "coverage-7.9.1-py3-none-any.whl", hash = "sha256:66b974b145aa189516b6bf2d8423e888b742517d37872f6ee4c5be0073bd9a3c"}, - {file = "coverage-7.9.1.tar.gz", hash = "sha256:6cf43c78c4282708a28e466316935ec7489a9c487518a77fa68f716c67909cec"}, -] - -[package.dependencies] -tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.11.0a6\" and extra == \"toml\""} - -[package.extras] -toml = ["tomli ; python_full_version <= \"3.11.0a6\""] - -[[package]] -name = "cython" -version = "3.1.2" -description = "The Cython compiler for writing C extensions in the Python language." -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "cython-3.1.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0f2add8b23cb19da3f546a688cd8f9e0bfc2776715ebf5e283bc3113b03ff008"}, - {file = "cython-3.1.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0d6248a2ae155ca4c42d7fa6a9a05154d62e695d7736bc17e1b85da6dcc361df"}, - {file = "cython-3.1.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:262bf49d9da64e2a34c86cbf8de4aa37daffb0f602396f116cca1ed47dc4b9f2"}, - {file = "cython-3.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ae53ae93c699d5f113953a9869df2fc269d8e173f9aa0616c6d8d6e12b4e9827"}, - {file = "cython-3.1.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b417c5d046ce676ee595ec7955ed47a68ad6f419cbf8c2a8708e55a3b38dfa35"}, - {file = "cython-3.1.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:af127da4b956e0e906e552fad838dc3fb6b6384164070ceebb0d90982a8ae25a"}, - {file = "cython-3.1.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:9be3d4954b46fd0f2dceac011d470f658eaf819132db52fbd1cf226ee60348db"}, - {file = "cython-3.1.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:63da49672c4bb022b4de9d37bab6c29953dbf5a31a2f40dffd0cf0915dcd7a17"}, - {file = "cython-3.1.2-cp310-cp310-win32.whl", hash = "sha256:2d8291dbbc1cb86b8d60c86fe9cbf99ec72de28cb157cbe869c95df4d32efa96"}, - {file = "cython-3.1.2-cp310-cp310-win_amd64.whl", hash = "sha256:e1f30a1339e03c80968a371ef76bf27a6648c5646cccd14a97e731b6957db97a"}, - {file = "cython-3.1.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5548573e0912d7dc80579827493315384c462e2f15797b91a8ed177686d31eb9"}, - {file = "cython-3.1.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4bf3ea5bc50d80762c490f42846820a868a6406fdb5878ae9e4cc2f11b50228a"}, - {file = "cython-3.1.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:20ce53951d06ab2bca39f153d9c5add1d631c2a44d58bf67288c9d631be9724e"}, - {file = "cython-3.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e05a36224e3002d48c7c1c695b3771343bd16bc57eab60d6c5d5e08f3cbbafd8"}, - {file = "cython-3.1.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dbc0fc0777c7ab82297c01c61a1161093a22a41714f62e8c35188a309bd5db8e"}, - {file = "cython-3.1.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:18161ef3dd0e90a944daa2be468dd27696712a5f792d6289e97d2a31298ad688"}, - {file = "cython-3.1.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:ca45020950cd52d82189d6dfb6225737586be6fe7b0b9d3fadd7daca62eff531"}, - {file = "cython-3.1.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:aaae97d6d07610224be2b73a93e9e3dd85c09aedfd8e47054e3ef5a863387dae"}, - {file = "cython-3.1.2-cp311-cp311-win32.whl", hash = "sha256:3d439d9b19e7e70f6ff745602906d282a853dd5219d8e7abbf355de680c9d120"}, - {file = "cython-3.1.2-cp311-cp311-win_amd64.whl", hash = "sha256:8efa44ee2f1876e40eb5e45f6513a19758077c56bf140623ccab43d31f873b61"}, - {file = "cython-3.1.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:9c2c4b6f9a941c857b40168b3f3c81d514e509d985c2dcd12e1a4fea9734192e"}, - {file = "cython-3.1.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:bdbc115bbe1b8c1dcbcd1b03748ea87fa967eb8dfc3a1a9bb243d4a382efcff4"}, - {file = "cython-3.1.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c05111f89db1ca98edc0675cfaa62be47b3ff519a29876eb095532a9f9e052b8"}, - {file = "cython-3.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f6e7188df8709be32cfdfadc7c3782e361c929df9132f95e1bbc90a340dca3c7"}, - {file = "cython-3.1.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1c0ecc71e60a051732c2607b8eb8f2a03a5dac09b28e52b8af323c329db9987b"}, - {file = "cython-3.1.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:f27143cf88835c8bcc9bf3304953f23f377d1d991e8942982fe7be344c7cfce3"}, - {file = "cython-3.1.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:d8c43566701133f53bf13485839d8f3f309095fe0d3b9d0cd5873073394d2edc"}, - {file = "cython-3.1.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a3bb893e85f027a929c1764bb14db4c31cbdf8a96f59a78f608f2ba7cfbbce95"}, - {file = "cython-3.1.2-cp312-cp312-win32.whl", hash = "sha256:12c5902f105e43ca9af7874cdf87a23627f98c15d5a4f6d38bc9d334845145c0"}, - {file = "cython-3.1.2-cp312-cp312-win_amd64.whl", hash = "sha256:06789eb7bd2e55b38b9dd349e9309f794aee0fed99c26ea5c9562d463877763f"}, - {file = "cython-3.1.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:cc22e5f18af436c894b90c257130346930fdc860d7f42b924548c591672beeef"}, - {file = "cython-3.1.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:42c7bffb0fe9898996c7eef9eb74ce3654553c7a3a3f3da66e5a49f801904ce0"}, - {file = "cython-3.1.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:88dc7fd54bfae78c366c6106a759f389000ea4dfe8ed9568af9d2f612825a164"}, - {file = "cython-3.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80d0ce057672ca50728153757d022842d5dcec536b50c79615a22dda2a874ea0"}, - {file = "cython-3.1.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eda6a43f1b78eae0d841698916eef661d15f8bc8439c266a964ea4c504f05612"}, - {file = "cython-3.1.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:b4c516d103e87c2e9c1ab85227e4d91c7484c1ba29e25f8afbf67bae93fee164"}, - {file = "cython-3.1.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:7542f1d18ab2cd22debc72974ec9e53437a20623d47d6001466e430538d7df54"}, - {file = "cython-3.1.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:63335513c06dcec4ecdaa8598f36c969032149ffd92a461f641ee363dc83c7ad"}, - {file = "cython-3.1.2-cp313-cp313-win32.whl", hash = "sha256:b377d542299332bfeb61ec09c57821b10f1597304394ba76544f4d07780a16df"}, - {file = "cython-3.1.2-cp313-cp313-win_amd64.whl", hash = "sha256:8ab1319c77f15b0ae04b3fb03588df3afdec4cf79e90eeea5c961e0ebd8fdf72"}, - {file = "cython-3.1.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:dbc1f225cb9f9be7a025589463507e10bb2d76a3258f8d308e0e2d0b966c556e"}, - {file = "cython-3.1.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:c1661c1701c96e1866f839e238570c96a97535a81da76a26f45f99ede18b3897"}, - {file = "cython-3.1.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:955bc6032d89ce380458266e65dcf5ae0ed1e7c03a7a4457e3e4773e90ba7373"}, - {file = "cython-3.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0b58e859889dd0fc6c3a990445b930f692948b28328bb4f3ed84b51028b7e183"}, - {file = "cython-3.1.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:992a6504aa3eed50dd1fc3d1fa998928b08c1188130bd526e177b6d7f3383ec4"}, - {file = "cython-3.1.2-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:f3d03077938b02ec47a56aa156da7bfc2379193738397d4e88086db5b0a374e0"}, - {file = "cython-3.1.2-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:b7e1d3c383a5f4ca5319248b9cb1b16a04fb36e153d651e558897171b7dbabb9"}, - {file = "cython-3.1.2-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:58d4d45e40cadf4f602d96b7016cf24ccfe4d954c61fa30b79813db8ccb7818f"}, - {file = "cython-3.1.2-cp38-cp38-win32.whl", hash = "sha256:919ff38a93f7c21829a519693b336979feb41a0f7ca35969402d7e211706100e"}, - {file = "cython-3.1.2-cp38-cp38-win_amd64.whl", hash = "sha256:aca994519645ba8fb5e99c0f9d4be28d61435775552aaf893a158c583cd218a5"}, - {file = "cython-3.1.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:fe7f1ee4c13f8a773bd6c66b3d25879f40596faeab49f97d28c39b16ace5fff9"}, - {file = "cython-3.1.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c9ec7d2baea122d94790624f743ff5b78f4e777bf969384be65b69d92fa4bc3f"}, - {file = "cython-3.1.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df57827185874f29240b02402e615547ab995d90182a852c6ec4f91bbae355a4"}, - {file = "cython-3.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b1a69b9b4fe0a48a8271027c0703c71ab1993c4caca01791c0fd2e2bd9031aa"}, - {file = "cython-3.1.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:970cc1558519f0f108c3e2f4b3480de4945228d9292612d5b2bb687e36c646b8"}, - {file = "cython-3.1.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:604c39cd6d152498a940aeae28b6fd44481a255a3fdf1b0051c30f3873c88b7f"}, - {file = "cython-3.1.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:855f2ae06438c7405997cf0df42d5b508ec3248272bb39df4a7a4a82a5f7c8cb"}, - {file = "cython-3.1.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:9e3016ca7a86728bfcbdd52449521e859a977451f296a7ae4967cefa2ec498f7"}, - {file = "cython-3.1.2-cp39-cp39-win32.whl", hash = "sha256:4896fc2b0f90820ea6fcf79a07e30822f84630a404d4e075784124262f6d0adf"}, - {file = "cython-3.1.2-cp39-cp39-win_amd64.whl", hash = "sha256:a965b81eb4f5a5f3f6760b162cb4de3907c71a9ba25d74de1ad7a0e4856f0412"}, - {file = "cython-3.1.2-py3-none-any.whl", hash = "sha256:d23fd7ffd7457205f08571a42b108a3cf993e83a59fe4d72b42e6fc592cf2639"}, - {file = "cython-3.1.2.tar.gz", hash = "sha256:6bbf7a953fa6762dfecdec015e3b054ba51c0121a45ad851fa130f63f5331381"}, -] - -[[package]] -name = "dependency-groups" -version = "1.3.1" -description = "A tool for resolving PEP 735 Dependency Group data" -optional = false -python-versions = ">=3.8" -groups = ["test"] -files = [ - {file = "dependency_groups-1.3.1-py3-none-any.whl", hash = "sha256:51aeaa0dfad72430fcfb7bcdbefbd75f3792e5919563077f30bc0d73f4493030"}, - {file = "dependency_groups-1.3.1.tar.gz", hash = "sha256:78078301090517fd938c19f64a53ce98c32834dfe0dee6b88004a569a6adfefd"}, -] - -[package.dependencies] -packaging = "*" -tomli = {version = "*", markers = "python_version < \"3.11\""} - -[package.extras] -cli = ["tomli ; python_version < \"3.11\""] - -[[package]] -name = "distlib" -version = "0.3.9" -description = "Distribution utilities" -optional = false -python-versions = "*" -groups = ["test"] -files = [ - {file = "distlib-0.3.9-py2.py3-none-any.whl", hash = "sha256:47f8c22fd27c27e25a65601af709b38e4f0a45ea4fc2e710f65755fa8caaaf87"}, - {file = "distlib-0.3.9.tar.gz", hash = "sha256:a60f20dea646b8a33f3e7772f74dc0b2d0772d2837ee1342a00645c81edf9403"}, -] - -[[package]] -name = "docutils" -version = "0.21.2" -description = "Docutils -- Python Documentation Utilities" -optional = false -python-versions = ">=3.9" -groups = ["docs"] -files = [ - {file = "docutils-0.21.2-py3-none-any.whl", hash = "sha256:dafca5b9e384f0e419294eb4d2ff9fa826435bf15f15b7bd45723e8ad76811b2"}, - {file = "docutils-0.21.2.tar.gz", hash = "sha256:3a6b18732edf182daa3cd12775bbb338cf5691468f91eeeb109deff6ebfa986f"}, -] - -[[package]] -name = "dom-toml" -version = "2.0.1" -description = "Dom's tools for Tom's Obvious, Minimal Language." -optional = false -python-versions = ">=3.6.1" -groups = ["docs"] -files = [ - {file = "dom_toml-2.0.1-py3-none-any.whl", hash = "sha256:6681a793c94a5d1fb7b59690009cc3b1dfb1bcaae108fb8054c712a8f128efc7"}, - {file = "dom_toml-2.0.1.tar.gz", hash = "sha256:31c5874595c777f41cc191c34c66dbea215c8289a7b148b425fb7a10c3f4fbc8"}, -] - -[package.dependencies] -domdf-python-tools = ">=2.8.0" -tomli = ">=1.2.3" - -[[package]] -name = "domdf-python-tools" -version = "3.10.0" -description = "Helpful functions for Python 🐍 🛠️" -optional = false -python-versions = ">=3.6" -groups = ["docs"] -files = [ - {file = "domdf_python_tools-3.10.0-py3-none-any.whl", hash = "sha256:5e71c1be71bbcc1f881d690c8984b60e64298ec256903b3147f068bc33090c36"}, - {file = "domdf_python_tools-3.10.0.tar.gz", hash = "sha256:2ae308d2f4f1e9145f5f4ba57f840fbfd1c2983ee26e4824347789649d3ae298"}, -] - -[package.dependencies] -natsort = ">=7.0.1" -typing-extensions = ">=3.7.4.1" - -[package.extras] -all = ["pytz (>=2019.1)"] -dates = ["pytz (>=2019.1)"] - -[[package]] -name = "exceptiongroup" -version = "1.3.0" -description = "Backport of PEP 654 (exception groups)" -optional = false -python-versions = ">=3.7" -groups = ["test"] -markers = "python_version < \"3.11\"" -files = [ - {file = "exceptiongroup-1.3.0-py3-none-any.whl", hash = "sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10"}, - {file = "exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88"}, -] - -[package.dependencies] -typing-extensions = {version = ">=4.6.0", markers = "python_version < \"3.13\""} - -[package.extras] -test = ["pytest (>=6)"] - -[[package]] -name = "filelock" -version = "3.18.0" -description = "A platform independent file lock." -optional = false -python-versions = ">=3.9" -groups = ["test"] -files = [ - {file = "filelock-3.18.0-py3-none-any.whl", hash = "sha256:c401f4f8377c4464e6db25fff06205fd89bdd83b65eb0488ed1b160f780e21de"}, - {file = "filelock-3.18.0.tar.gz", hash = "sha256:adbc88eabb99d2fec8c9c1b229b171f18afa655400173ddc653d5d01501fb9f2"}, -] - -[package.extras] -docs = ["furo (>=2024.8.6)", "sphinx (>=8.1.3)", "sphinx-autodoc-typehints (>=3)"] -testing = ["covdefaults (>=2.3)", "coverage (>=7.6.10)", "diff-cover (>=9.2.1)", "pytest (>=8.3.4)", "pytest-asyncio (>=0.25.2)", "pytest-cov (>=6)", "pytest-mock (>=3.14)", "pytest-timeout (>=2.3.1)", "virtualenv (>=20.28.1)"] -typing = ["typing-extensions (>=4.12.2) ; python_version < \"3.11\""] - -[[package]] -name = "idna" -version = "3.10" -description = "Internationalized Domain Names in Applications (IDNA)" -optional = false -python-versions = ">=3.6" -groups = ["docs"] -files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, -] - -[package.extras] -all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] - -[[package]] -name = "imagesize" -version = "1.4.1" -description = "Getting image size from png/jpeg/jpeg2000/gif file" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -groups = ["docs"] -files = [ - {file = "imagesize-1.4.1-py2.py3-none-any.whl", hash = "sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b"}, - {file = "imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a"}, -] - -[[package]] -name = "importlib-metadata" -version = "8.7.0" -description = "Read metadata from Python packages" -optional = false -python-versions = ">=3.9" -groups = ["docs"] -markers = "python_version == \"3.9\"" -files = [ - {file = "importlib_metadata-8.7.0-py3-none-any.whl", hash = "sha256:e5dd1551894c77868a30651cef00984d50e1002d06942a7101d34870c5f02afd"}, - {file = "importlib_metadata-8.7.0.tar.gz", hash = "sha256:d13b81ad223b890aa16c5471f2ac3056cf76c5f10f82d6f9292f0b415f389000"}, -] - -[package.dependencies] -zipp = ">=3.20" - -[package.extras] -check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\""] -cover = ["pytest-cov"] -doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -enabler = ["pytest-enabler (>=2.2)"] -perf = ["ipython"] -test = ["flufl.flake8", "importlib_resources (>=1.3) ; python_version < \"3.9\"", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-perf (>=0.9.2)"] -type = ["pytest-mypy"] - -[[package]] -name = "iniconfig" -version = "2.1.0" -description = "brain-dead simple config-ini parsing" -optional = false -python-versions = ">=3.8" -groups = ["test"] -files = [ - {file = "iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760"}, - {file = "iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7"}, -] - -[[package]] -name = "jinja2" -version = "3.1.6" -description = "A very fast and expressive template engine." -optional = false -python-versions = ">=3.7" -groups = ["docs"] -files = [ - {file = "jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67"}, - {file = "jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d"}, -] - -[package.dependencies] -MarkupSafe = ">=2.0" - -[package.extras] -i18n = ["Babel (>=2.7)"] - -[[package]] -name = "markupsafe" -version = "3.0.2" -description = "Safely add untrusted strings to HTML/XML markup." -optional = false -python-versions = ">=3.9" -groups = ["docs"] -files = [ - {file = "MarkupSafe-3.0.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7e94c425039cde14257288fd61dcfb01963e658efbc0ff54f5306b06054700f8"}, - {file = "MarkupSafe-3.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9e2d922824181480953426608b81967de705c3cef4d1af983af849d7bd619158"}, - {file = "MarkupSafe-3.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:38a9ef736c01fccdd6600705b09dc574584b89bea478200c5fbf112a6b0d5579"}, - {file = "MarkupSafe-3.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bbcb445fa71794da8f178f0f6d66789a28d7319071af7a496d4d507ed566270d"}, - {file = "MarkupSafe-3.0.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:57cb5a3cf367aeb1d316576250f65edec5bb3be939e9247ae594b4bcbc317dfb"}, - {file = "MarkupSafe-3.0.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:3809ede931876f5b2ec92eef964286840ed3540dadf803dd570c3b7e13141a3b"}, - {file = "MarkupSafe-3.0.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e07c3764494e3776c602c1e78e298937c3315ccc9043ead7e685b7f2b8d47b3c"}, - {file = "MarkupSafe-3.0.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:b424c77b206d63d500bcb69fa55ed8d0e6a3774056bdc4839fc9298a7edca171"}, - {file = "MarkupSafe-3.0.2-cp310-cp310-win32.whl", hash = "sha256:fcabf5ff6eea076f859677f5f0b6b5c1a51e70a376b0579e0eadef8db48c6b50"}, - {file = "MarkupSafe-3.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:6af100e168aa82a50e186c82875a5893c5597a0c1ccdb0d8b40240b1f28b969a"}, - {file = "MarkupSafe-3.0.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9025b4018f3a1314059769c7bf15441064b2207cb3f065e6ea1e7359cb46db9d"}, - {file = "MarkupSafe-3.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:93335ca3812df2f366e80509ae119189886b0f3c2b81325d39efdb84a1e2ae93"}, - {file = "MarkupSafe-3.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2cb8438c3cbb25e220c2ab33bb226559e7afb3baec11c4f218ffa7308603c832"}, - {file = "MarkupSafe-3.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a123e330ef0853c6e822384873bef7507557d8e4a082961e1defa947aa59ba84"}, - {file = "MarkupSafe-3.0.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1e084f686b92e5b83186b07e8a17fc09e38fff551f3602b249881fec658d3eca"}, - {file = "MarkupSafe-3.0.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d8213e09c917a951de9d09ecee036d5c7d36cb6cb7dbaece4c71a60d79fb9798"}, - {file = "MarkupSafe-3.0.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:5b02fb34468b6aaa40dfc198d813a641e3a63b98c2b05a16b9f80b7ec314185e"}, - {file = "MarkupSafe-3.0.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:0bff5e0ae4ef2e1ae4fdf2dfd5b76c75e5c2fa4132d05fc1b0dabcd20c7e28c4"}, - {file = "MarkupSafe-3.0.2-cp311-cp311-win32.whl", hash = "sha256:6c89876f41da747c8d3677a2b540fb32ef5715f97b66eeb0c6b66f5e3ef6f59d"}, - {file = "MarkupSafe-3.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:70a87b411535ccad5ef2f1df5136506a10775d267e197e4cf531ced10537bd6b"}, - {file = "MarkupSafe-3.0.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:9778bd8ab0a994ebf6f84c2b949e65736d5575320a17ae8984a77fab08db94cf"}, - {file = "MarkupSafe-3.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:846ade7b71e3536c4e56b386c2a47adf5741d2d8b94ec9dc3e92e5e1ee1e2225"}, - {file = "MarkupSafe-3.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1c99d261bd2d5f6b59325c92c73df481e05e57f19837bdca8413b9eac4bd8028"}, - {file = "MarkupSafe-3.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e17c96c14e19278594aa4841ec148115f9c7615a47382ecb6b82bd8fea3ab0c8"}, - {file = "MarkupSafe-3.0.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:88416bd1e65dcea10bc7569faacb2c20ce071dd1f87539ca2ab364bf6231393c"}, - {file = "MarkupSafe-3.0.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2181e67807fc2fa785d0592dc2d6206c019b9502410671cc905d132a92866557"}, - {file = "MarkupSafe-3.0.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:52305740fe773d09cffb16f8ed0427942901f00adedac82ec8b67752f58a1b22"}, - {file = "MarkupSafe-3.0.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:ad10d3ded218f1039f11a75f8091880239651b52e9bb592ca27de44eed242a48"}, - {file = "MarkupSafe-3.0.2-cp312-cp312-win32.whl", hash = "sha256:0f4ca02bea9a23221c0182836703cbf8930c5e9454bacce27e767509fa286a30"}, - {file = "MarkupSafe-3.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:8e06879fc22a25ca47312fbe7c8264eb0b662f6db27cb2d3bbbc74b1df4b9b87"}, - {file = "MarkupSafe-3.0.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ba9527cdd4c926ed0760bc301f6728ef34d841f405abf9d4f959c478421e4efd"}, - {file = "MarkupSafe-3.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f8b3d067f2e40fe93e1ccdd6b2e1d16c43140e76f02fb1319a05cf2b79d99430"}, - {file = "MarkupSafe-3.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:569511d3b58c8791ab4c2e1285575265991e6d8f8700c7be0e88f86cb0672094"}, - {file = "MarkupSafe-3.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15ab75ef81add55874e7ab7055e9c397312385bd9ced94920f2802310c930396"}, - {file = "MarkupSafe-3.0.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f3818cb119498c0678015754eba762e0d61e5b52d34c8b13d770f0719f7b1d79"}, - {file = "MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:cdb82a876c47801bb54a690c5ae105a46b392ac6099881cdfb9f6e95e4014c6a"}, - {file = "MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:cabc348d87e913db6ab4aa100f01b08f481097838bdddf7c7a84b7575b7309ca"}, - {file = "MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:444dcda765c8a838eaae23112db52f1efaf750daddb2d9ca300bcae1039adc5c"}, - {file = "MarkupSafe-3.0.2-cp313-cp313-win32.whl", hash = "sha256:bcf3e58998965654fdaff38e58584d8937aa3096ab5354d493c77d1fdd66d7a1"}, - {file = "MarkupSafe-3.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:e6a2a455bd412959b57a172ce6328d2dd1f01cb2135efda2e4576e8a23fa3b0f"}, - {file = "MarkupSafe-3.0.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:b5a6b3ada725cea8a5e634536b1b01c30bcdcd7f9c6fff4151548d5bf6b3a36c"}, - {file = "MarkupSafe-3.0.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:a904af0a6162c73e3edcb969eeeb53a63ceeb5d8cf642fade7d39e7963a22ddb"}, - {file = "MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4aa4e5faecf353ed117801a068ebab7b7e09ffb6e1d5e412dc852e0da018126c"}, - {file = "MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0ef13eaeee5b615fb07c9a7dadb38eac06a0608b41570d8ade51c56539e509d"}, - {file = "MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d16a81a06776313e817c951135cf7340a3e91e8c1ff2fac444cfd75fffa04afe"}, - {file = "MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:6381026f158fdb7c72a168278597a5e3a5222e83ea18f543112b2662a9b699c5"}, - {file = "MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:3d79d162e7be8f996986c064d1c7c817f6df3a77fe3d6859f6f9e7be4b8c213a"}, - {file = "MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:131a3c7689c85f5ad20f9f6fb1b866f402c445b220c19fe4308c0b147ccd2ad9"}, - {file = "MarkupSafe-3.0.2-cp313-cp313t-win32.whl", hash = "sha256:ba8062ed2cf21c07a9e295d5b8a2a5ce678b913b45fdf68c32d95d6c1291e0b6"}, - {file = "MarkupSafe-3.0.2-cp313-cp313t-win_amd64.whl", hash = "sha256:e444a31f8db13eb18ada366ab3cf45fd4b31e4db1236a4448f68778c1d1a5a2f"}, - {file = "MarkupSafe-3.0.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:eaa0a10b7f72326f1372a713e73c3f739b524b3af41feb43e4921cb529f5929a"}, - {file = "MarkupSafe-3.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:48032821bbdf20f5799ff537c7ac3d1fba0ba032cfc06194faffa8cda8b560ff"}, - {file = "MarkupSafe-3.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1a9d3f5f0901fdec14d8d2f66ef7d035f2157240a433441719ac9a3fba440b13"}, - {file = "MarkupSafe-3.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:88b49a3b9ff31e19998750c38e030fc7bb937398b1f78cfa599aaef92d693144"}, - {file = "MarkupSafe-3.0.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cfad01eed2c2e0c01fd0ecd2ef42c492f7f93902e39a42fc9ee1692961443a29"}, - {file = "MarkupSafe-3.0.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:1225beacc926f536dc82e45f8a4d68502949dc67eea90eab715dea3a21c1b5f0"}, - {file = "MarkupSafe-3.0.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:3169b1eefae027567d1ce6ee7cae382c57fe26e82775f460f0b2778beaad66c0"}, - {file = "MarkupSafe-3.0.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:eb7972a85c54febfb25b5c4b4f3af4dcc731994c7da0d8a0b4a6eb0640e1d178"}, - {file = "MarkupSafe-3.0.2-cp39-cp39-win32.whl", hash = "sha256:8c4e8c3ce11e1f92f6536ff07154f9d49677ebaaafc32db9db4620bc11ed480f"}, - {file = "MarkupSafe-3.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:6e296a513ca3d94054c2c881cc913116e90fd030ad1c656b3869762b754f5f8a"}, - {file = "markupsafe-3.0.2.tar.gz", hash = "sha256:ee55d3edf80167e48ea11a923c7386f4669df67d7994554387f84e7d8b0a2bf0"}, -] - -[[package]] -name = "natsort" -version = "8.4.0" -description = "Simple yet flexible natural sorting in Python." -optional = false -python-versions = ">=3.7" -groups = ["docs"] -files = [ - {file = "natsort-8.4.0-py3-none-any.whl", hash = "sha256:4732914fb471f56b5cce04d7bae6f164a592c7712e1c85f9ef585e197299521c"}, - {file = "natsort-8.4.0.tar.gz", hash = "sha256:45312c4a0e5507593da193dedd04abb1469253b601ecaf63445ad80f0a1ea581"}, -] - -[package.extras] -fast = ["fastnumbers (>=2.0.0)"] -icu = ["PyICU (>=1.0.0)"] - -[[package]] -name = "nox" -version = "2025.5.1" -description = "Flexible test automation." -optional = false -python-versions = ">=3.8" -groups = ["test"] -files = [ - {file = "nox-2025.5.1-py3-none-any.whl", hash = "sha256:56abd55cf37ff523c254fcec4d152ed51e5fe80e2ab8317221d8b828ac970a31"}, - {file = "nox-2025.5.1.tar.gz", hash = "sha256:2a571dfa7a58acc726521ac3cd8184455ebcdcbf26401c7b737b5bc6701427b2"}, -] - -[package.dependencies] -argcomplete = ">=1.9.4,<4" -attrs = ">=23.1" -colorlog = ">=2.6.1,<7" -dependency-groups = ">=1.1" -packaging = ">=20.9" -tomli = {version = ">=1", markers = "python_version < \"3.11\""} -virtualenv = ">=20.14.1" - -[package.extras] -tox-to-nox = ["importlib-resources ; python_version < \"3.9\"", "jinja2", "tox (>=4)"] -uv = ["uv (>=0.1.6)"] - -[[package]] -name = "packaging" -version = "25.0" -description = "Core utilities for Python packages" -optional = false -python-versions = ">=3.8" -groups = ["docs", "test"] -files = [ - {file = "packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484"}, - {file = "packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f"}, -] - -[[package]] -name = "pep440" -version = "0.1.2" -description = "A simple package with utils to check whether versions number match PEP 440." -optional = false -python-versions = ">=3.7" -groups = ["test"] -files = [ - {file = "pep440-0.1.2-py3-none-any.whl", hash = "sha256:36d6ad73f2b5d07769294cafe183500ac89d848c922a3d3f521b968481880d51"}, - {file = "pep440-0.1.2.tar.gz", hash = "sha256:58b37246cc2b13fee1ca2a3c092cb3704d21ecf621a5bdbb168e44e697f6d04d"}, -] - -[package.extras] -lint = ["check-manifest", "mypy"] -test = ["pytest", "pytest-console-scripts", "pytest-cov"] - -[[package]] -name = "platformdirs" -version = "4.3.8" -description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." -optional = false -python-versions = ">=3.9" -groups = ["test"] -files = [ - {file = "platformdirs-4.3.8-py3-none-any.whl", hash = "sha256:ff7059bb7eb1179e2685604f4aaf157cfd9535242bd23742eadc3c13542139b4"}, - {file = "platformdirs-4.3.8.tar.gz", hash = "sha256:3d512d96e16bcb959a814c9f348431070822a6496326a4be0911c40b5a74c2bc"}, -] - -[package.extras] -docs = ["furo (>=2024.8.6)", "proselint (>=0.14)", "sphinx (>=8.1.3)", "sphinx-autodoc-typehints (>=3)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=8.3.4)", "pytest-cov (>=6)", "pytest-mock (>=3.14)"] -type = ["mypy (>=1.14.1)"] - -[[package]] -name = "pluggy" -version = "1.6.0" -description = "plugin and hook calling mechanisms for python" -optional = false -python-versions = ">=3.9" -groups = ["test"] -files = [ - {file = "pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746"}, - {file = "pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3"}, -] - -[package.extras] -dev = ["pre-commit", "tox"] -testing = ["coverage", "pytest", "pytest-benchmark"] - -[[package]] -name = "py-cpuinfo" -version = "9.0.0" -description = "Get CPU info with pure Python" -optional = false -python-versions = "*" -groups = ["test"] -files = [ - {file = "py-cpuinfo-9.0.0.tar.gz", hash = "sha256:3cdbbf3fac90dc6f118bfd64384f309edeadd902d7c8fb17f02ffa1fc3f49690"}, - {file = "py_cpuinfo-9.0.0-py3-none-any.whl", hash = "sha256:859625bc251f64e21f077d099d4162689c762b5d6a4c3c97553d56241c9674d5"}, -] - -[[package]] -name = "pygments" -version = "2.19.1" -description = "Pygments is a syntax highlighting package written in Python." -optional = false -python-versions = ">=3.8" -groups = ["docs", "test"] -files = [ - {file = "pygments-2.19.1-py3-none-any.whl", hash = "sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c"}, - {file = "pygments-2.19.1.tar.gz", hash = "sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f"}, -] - -[package.extras] -windows-terminal = ["colorama (>=0.4.6)"] - -[[package]] -name = "pytest" -version = "8.4.0" -description = "pytest: simple powerful testing with Python" -optional = false -python-versions = ">=3.9" -groups = ["test"] -files = [ - {file = "pytest-8.4.0-py3-none-any.whl", hash = "sha256:f40f825768ad76c0977cbacdf1fd37c6f7a468e460ea6a0636078f8972d4517e"}, - {file = "pytest-8.4.0.tar.gz", hash = "sha256:14d920b48472ea0dbf68e45b96cd1ffda4705f33307dcc86c676c1b5104838a6"}, -] - -[package.dependencies] -colorama = {version = ">=0.4", markers = "sys_platform == \"win32\""} -exceptiongroup = {version = ">=1", markers = "python_version < \"3.11\""} -iniconfig = ">=1" -packaging = ">=20" -pluggy = ">=1.5,<2" -pygments = ">=2.7.2" -tomli = {version = ">=1", markers = "python_version < \"3.11\""} - -[package.extras] -dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "requests", "setuptools", "xmlschema"] - -[[package]] -name = "pytest-benchmark" -version = "5.1.0" -description = "A ``pytest`` fixture for benchmarking code. It will group the tests into rounds that are calibrated to the chosen timer." -optional = false -python-versions = ">=3.9" -groups = ["test"] -files = [ - {file = "pytest-benchmark-5.1.0.tar.gz", hash = "sha256:9ea661cdc292e8231f7cd4c10b0319e56a2118e2c09d9f50e1b3d150d2aca105"}, - {file = "pytest_benchmark-5.1.0-py3-none-any.whl", hash = "sha256:922de2dfa3033c227c96da942d1878191afa135a29485fb942e85dff1c592c89"}, -] - -[package.dependencies] -py-cpuinfo = "*" -pytest = ">=8.1" - -[package.extras] -aspect = ["aspectlib"] -elasticsearch = ["elasticsearch"] -histogram = ["pygal", "pygaljs", "setuptools"] - -[[package]] -name = "pytest-cov" -version = "6.2.1" -description = "Pytest plugin for measuring coverage." -optional = false -python-versions = ">=3.9" -groups = ["test"] -files = [ - {file = "pytest_cov-6.2.1-py3-none-any.whl", hash = "sha256:f5bc4c23f42f1cdd23c70b1dab1bbaef4fc505ba950d53e0081d0730dd7e86d5"}, - {file = "pytest_cov-6.2.1.tar.gz", hash = "sha256:25cc6cc0a5358204b8108ecedc51a9b57b34cc6b8c967cc2c01a4e00d8a67da2"}, -] - -[package.dependencies] -coverage = {version = ">=7.5", extras = ["toml"]} -pluggy = ">=1.2" -pytest = ">=6.2.5" - -[package.extras] -testing = ["fields", "hunter", "process-tests", "pytest-xdist", "virtualenv"] - -[[package]] -name = "requests" -version = "2.32.4" -description = "Python HTTP for Humans." -optional = false -python-versions = ">=3.8" -groups = ["docs"] -files = [ - {file = "requests-2.32.4-py3-none-any.whl", hash = "sha256:27babd3cda2a6d50b30443204ee89830707d396671944c998b5975b031ac2b2c"}, - {file = "requests-2.32.4.tar.gz", hash = "sha256:27d0316682c8a29834d3264820024b62a36942083d52caf2f14c0591336d3422"}, -] - -[package.dependencies] -certifi = ">=2017.4.17" -charset_normalizer = ">=2,<4" -idna = ">=2.5,<4" -urllib3 = ">=1.21.1,<3" - -[package.extras] -socks = ["PySocks (>=1.5.6,!=1.5.7)"] -use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] - -[[package]] -name = "ruff" -version = "0.9.10" -description = "An extremely fast Python linter and code formatter, written in Rust." -optional = false -python-versions = ">=3.7" -groups = ["test"] -files = [ - {file = "ruff-0.9.10-py3-none-linux_armv6l.whl", hash = "sha256:eb4d25532cfd9fe461acc83498361ec2e2252795b4f40b17e80692814329e42d"}, - {file = "ruff-0.9.10-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:188a6638dab1aa9bb6228a7302387b2c9954e455fb25d6b4470cb0641d16759d"}, - {file = "ruff-0.9.10-py3-none-macosx_11_0_arm64.whl", hash = "sha256:5284dcac6b9dbc2fcb71fdfc26a217b2ca4ede6ccd57476f52a587451ebe450d"}, - {file = "ruff-0.9.10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:47678f39fa2a3da62724851107f438c8229a3470f533894b5568a39b40029c0c"}, - {file = "ruff-0.9.10-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:99713a6e2766b7a17147b309e8c915b32b07a25c9efd12ada79f217c9c778b3e"}, - {file = "ruff-0.9.10-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:524ee184d92f7c7304aa568e2db20f50c32d1d0caa235d8ddf10497566ea1a12"}, - {file = "ruff-0.9.10-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:df92aeac30af821f9acf819fc01b4afc3dfb829d2782884f8739fb52a8119a16"}, - {file = "ruff-0.9.10-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:de42e4edc296f520bb84954eb992a07a0ec5a02fecb834498415908469854a52"}, - {file = "ruff-0.9.10-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d257f95b65806104b6b1ffca0ea53f4ef98454036df65b1eda3693534813ecd1"}, - {file = "ruff-0.9.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b60dec7201c0b10d6d11be00e8f2dbb6f40ef1828ee75ed739923799513db24c"}, - {file = "ruff-0.9.10-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:d838b60007da7a39c046fcdd317293d10b845001f38bcb55ba766c3875b01e43"}, - {file = "ruff-0.9.10-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:ccaf903108b899beb8e09a63ffae5869057ab649c1e9231c05ae354ebc62066c"}, - {file = "ruff-0.9.10-py3-none-musllinux_1_2_i686.whl", hash = "sha256:f9567d135265d46e59d62dc60c0bfad10e9a6822e231f5b24032dba5a55be6b5"}, - {file = "ruff-0.9.10-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:5f202f0d93738c28a89f8ed9eaba01b7be339e5d8d642c994347eaa81c6d75b8"}, - {file = "ruff-0.9.10-py3-none-win32.whl", hash = "sha256:bfb834e87c916521ce46b1788fbb8484966e5113c02df216680102e9eb960029"}, - {file = "ruff-0.9.10-py3-none-win_amd64.whl", hash = "sha256:f2160eeef3031bf4b17df74e307d4c5fb689a6f3a26a2de3f7ef4044e3c484f1"}, - {file = "ruff-0.9.10-py3-none-win_arm64.whl", hash = "sha256:5fd804c0327a5e5ea26615550e706942f348b197d5475ff34c19733aee4b2e69"}, - {file = "ruff-0.9.10.tar.gz", hash = "sha256:9bacb735d7bada9cfb0f2c227d3658fc443d90a727b47f206fb33f52f3c0eac7"}, -] - -[[package]] -name = "snowballstemmer" -version = "3.0.1" -description = "This package provides 32 stemmers for 30 languages generated from Snowball algorithms." -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*" -groups = ["docs"] -files = [ - {file = "snowballstemmer-3.0.1-py3-none-any.whl", hash = "sha256:6cd7b3897da8d6c9ffb968a6781fa6532dce9c3618a4b127d920dab764a19064"}, - {file = "snowballstemmer-3.0.1.tar.gz", hash = "sha256:6d5eeeec8e9f84d4d56b847692bacf79bc2c8e90c7f80ca4444ff8b6f2e52895"}, -] - -[[package]] -name = "sphinx" -version = "7.4.7" -description = "Python documentation generator" -optional = false -python-versions = ">=3.9" -groups = ["docs"] -files = [ - {file = "sphinx-7.4.7-py3-none-any.whl", hash = "sha256:c2419e2135d11f1951cd994d6eb18a1835bd8fdd8429f9ca375dc1f3281bd239"}, - {file = "sphinx-7.4.7.tar.gz", hash = "sha256:242f92a7ea7e6c5b406fdc2615413890ba9f699114a9c09192d7dfead2ee9cfe"}, -] - -[package.dependencies] -alabaster = ">=0.7.14,<0.8.0" -babel = ">=2.13" -colorama = {version = ">=0.4.6", markers = "sys_platform == \"win32\""} -docutils = ">=0.20,<0.22" -imagesize = ">=1.3" -importlib-metadata = {version = ">=6.0", markers = "python_version < \"3.10\""} -Jinja2 = ">=3.1" -packaging = ">=23.0" -Pygments = ">=2.17" -requests = ">=2.30.0" -snowballstemmer = ">=2.2" -sphinxcontrib-applehelp = "*" -sphinxcontrib-devhelp = "*" -sphinxcontrib-htmlhelp = ">=2.0.0" -sphinxcontrib-jsmath = "*" -sphinxcontrib-qthelp = "*" -sphinxcontrib-serializinghtml = ">=1.1.9" -tomli = {version = ">=2", markers = "python_version < \"3.11\""} - -[package.extras] -docs = ["sphinxcontrib-websupport"] -lint = ["flake8 (>=6.0)", "importlib-metadata (>=6.0)", "mypy (==1.10.1)", "pytest (>=6.0)", "ruff (==0.5.2)", "sphinx-lint (>=0.9)", "tomli (>=2)", "types-docutils (==0.21.0.20240711)", "types-requests (>=2.30.0)"] -test = ["cython (>=3.0)", "defusedxml (>=0.7.1)", "pytest (>=8.0)", "setuptools (>=70.0)", "typing_extensions (>=4.9)"] - -[[package]] -name = "sphinx-autodoc-typehints" -version = "2.3.0" -description = "Type hints (PEP 484) support for the Sphinx autodoc extension" -optional = false -python-versions = ">=3.9" -groups = ["docs"] -files = [ - {file = "sphinx_autodoc_typehints-2.3.0-py3-none-any.whl", hash = "sha256:3098e2c6d0ba99eacd013eb06861acc9b51c6e595be86ab05c08ee5506ac0c67"}, - {file = "sphinx_autodoc_typehints-2.3.0.tar.gz", hash = "sha256:535c78ed2d6a1bad393ba9f3dfa2602cf424e2631ee207263e07874c38fde084"}, -] - -[package.dependencies] -sphinx = ">=7.3.5" - -[package.extras] -docs = ["furo (>=2024.1.29)"] -numpy = ["nptyping (>=2.5)"] -testing = ["covdefaults (>=2.3)", "coverage (>=7.4.4)", "defusedxml (>=0.7.1)", "diff-cover (>=9)", "pytest (>=8.1.1)", "pytest-cov (>=5)", "sphobjinv (>=2.3.1)", "typing-extensions (>=4.11)"] - -[[package]] -name = "sphinx-pyproject" -version = "0.3.0" -description = "Move some of your Sphinx configuration into pyproject.toml" -optional = false -python-versions = ">=3.6" -groups = ["docs"] -files = [ - {file = "sphinx_pyproject-0.3.0-py3-none-any.whl", hash = "sha256:3aca968919f5ecd390f96874c3f64a43c9c7fcfdc2fd4191a781ad9228501b52"}, - {file = "sphinx_pyproject-0.3.0.tar.gz", hash = "sha256:efc4ee9d96f579c4e4ed1ac273868c64565e88c8e37fe6ec2dc59fbcd57684ab"}, -] - -[package.dependencies] -dom-toml = ">=0.3.0" -domdf-python-tools = ">=2.7.0" - -[[package]] -name = "sphinx-rtd-theme" -version = "3.0.2" -description = "Read the Docs theme for Sphinx" -optional = false -python-versions = ">=3.8" -groups = ["docs"] -files = [ - {file = "sphinx_rtd_theme-3.0.2-py2.py3-none-any.whl", hash = "sha256:422ccc750c3a3a311de4ae327e82affdaf59eb695ba4936538552f3b00f4ee13"}, - {file = "sphinx_rtd_theme-3.0.2.tar.gz", hash = "sha256:b7457bc25dda723b20b086a670b9953c859eab60a2a03ee8eb2bb23e176e5f85"}, -] - -[package.dependencies] -docutils = ">0.18,<0.22" -sphinx = ">=6,<9" -sphinxcontrib-jquery = ">=4,<5" - -[package.extras] -dev = ["bump2version", "transifex-client", "twine", "wheel"] - -[[package]] -name = "sphinxcontrib-applehelp" -version = "2.0.0" -description = "sphinxcontrib-applehelp is a Sphinx extension which outputs Apple help books" -optional = false -python-versions = ">=3.9" -groups = ["docs"] -files = [ - {file = "sphinxcontrib_applehelp-2.0.0-py3-none-any.whl", hash = "sha256:4cd3f0ec4ac5dd9c17ec65e9ab272c9b867ea77425228e68ecf08d6b28ddbdb5"}, - {file = "sphinxcontrib_applehelp-2.0.0.tar.gz", hash = "sha256:2f29ef331735ce958efa4734873f084941970894c6090408b079c61b2e1c06d1"}, -] - -[package.extras] -lint = ["mypy", "ruff (==0.5.5)", "types-docutils"] -standalone = ["Sphinx (>=5)"] -test = ["pytest"] - -[[package]] -name = "sphinxcontrib-devhelp" -version = "2.0.0" -description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp documents" -optional = false -python-versions = ">=3.9" -groups = ["docs"] -files = [ - {file = "sphinxcontrib_devhelp-2.0.0-py3-none-any.whl", hash = "sha256:aefb8b83854e4b0998877524d1029fd3e6879210422ee3780459e28a1f03a8a2"}, - {file = "sphinxcontrib_devhelp-2.0.0.tar.gz", hash = "sha256:411f5d96d445d1d73bb5d52133377b4248ec79db5c793ce7dbe59e074b4dd1ad"}, -] - -[package.extras] -lint = ["mypy", "ruff (==0.5.5)", "types-docutils"] -standalone = ["Sphinx (>=5)"] -test = ["pytest"] - -[[package]] -name = "sphinxcontrib-htmlhelp" -version = "2.1.0" -description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" -optional = false -python-versions = ">=3.9" -groups = ["docs"] -files = [ - {file = "sphinxcontrib_htmlhelp-2.1.0-py3-none-any.whl", hash = "sha256:166759820b47002d22914d64a075ce08f4c46818e17cfc9470a9786b759b19f8"}, - {file = "sphinxcontrib_htmlhelp-2.1.0.tar.gz", hash = "sha256:c9e2916ace8aad64cc13a0d233ee22317f2b9025b9cf3295249fa985cc7082e9"}, -] - -[package.extras] -lint = ["mypy", "ruff (==0.5.5)", "types-docutils"] -standalone = ["Sphinx (>=5)"] -test = ["html5lib", "pytest"] - -[[package]] -name = "sphinxcontrib-jquery" -version = "4.1" -description = "Extension to include jQuery on newer Sphinx releases" -optional = false -python-versions = ">=2.7" -groups = ["docs"] -files = [ - {file = "sphinxcontrib-jquery-4.1.tar.gz", hash = "sha256:1620739f04e36a2c779f1a131a2dfd49b2fd07351bf1968ced074365933abc7a"}, - {file = "sphinxcontrib_jquery-4.1-py2.py3-none-any.whl", hash = "sha256:f936030d7d0147dd026a4f2b5a57343d233f1fc7b363f68b3d4f1cb0993878ae"}, -] - -[package.dependencies] -Sphinx = ">=1.8" - -[[package]] -name = "sphinxcontrib-jsmath" -version = "1.0.1" -description = "A sphinx extension which renders display math in HTML via JavaScript" -optional = false -python-versions = ">=3.5" -groups = ["docs"] -files = [ - {file = "sphinxcontrib-jsmath-1.0.1.tar.gz", hash = "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8"}, - {file = "sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl", hash = "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178"}, -] - -[package.extras] -test = ["flake8", "mypy", "pytest"] - -[[package]] -name = "sphinxcontrib-qthelp" -version = "2.0.0" -description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp documents" -optional = false -python-versions = ">=3.9" -groups = ["docs"] -files = [ - {file = "sphinxcontrib_qthelp-2.0.0-py3-none-any.whl", hash = "sha256:b18a828cdba941ccd6ee8445dbe72ffa3ef8cbe7505d8cd1fa0d42d3f2d5f3eb"}, - {file = "sphinxcontrib_qthelp-2.0.0.tar.gz", hash = "sha256:4fe7d0ac8fc171045be623aba3e2a8f613f8682731f9153bb2e40ece16b9bbab"}, -] - -[package.extras] -lint = ["mypy", "ruff (==0.5.5)", "types-docutils"] -standalone = ["Sphinx (>=5)"] -test = ["defusedxml (>=0.7.1)", "pytest"] - -[[package]] -name = "sphinxcontrib-serializinghtml" -version = "2.0.0" -description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)" -optional = false -python-versions = ">=3.9" -groups = ["docs"] -files = [ - {file = "sphinxcontrib_serializinghtml-2.0.0-py3-none-any.whl", hash = "sha256:6e2cb0eef194e10c27ec0023bfeb25badbbb5868244cf5bc5bdc04e4464bf331"}, - {file = "sphinxcontrib_serializinghtml-2.0.0.tar.gz", hash = "sha256:e9d912827f872c029017a53f0ef2180b327c3f7fd23c87229f7a8e8b70031d4d"}, -] - -[package.extras] -lint = ["mypy", "ruff (==0.5.5)", "types-docutils"] -standalone = ["Sphinx (>=5)"] -test = ["pytest"] - -[[package]] -name = "tomli" -version = "2.2.1" -description = "A lil' TOML parser" -optional = false -python-versions = ">=3.8" -groups = ["docs", "test"] -files = [ - {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, - {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, - {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a"}, - {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee"}, - {file = "tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e"}, - {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4"}, - {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106"}, - {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8"}, - {file = "tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff"}, - {file = "tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b"}, - {file = "tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea"}, - {file = "tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8"}, - {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192"}, - {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222"}, - {file = "tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77"}, - {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6"}, - {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd"}, - {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e"}, - {file = "tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98"}, - {file = "tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4"}, - {file = "tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7"}, - {file = "tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c"}, - {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13"}, - {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281"}, - {file = "tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272"}, - {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140"}, - {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2"}, - {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744"}, - {file = "tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec"}, - {file = "tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69"}, - {file = "tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc"}, - {file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"}, -] - -[[package]] -name = "typing-extensions" -version = "4.14.0" -description = "Backported and Experimental Type Hints for Python 3.9+" -optional = false -python-versions = ">=3.9" -groups = ["docs", "test"] -files = [ - {file = "typing_extensions-4.14.0-py3-none-any.whl", hash = "sha256:a1514509136dd0b477638fc68d6a91497af5076466ad0fa6c338e44e359944af"}, - {file = "typing_extensions-4.14.0.tar.gz", hash = "sha256:8676b788e32f02ab42d9e7c61324048ae4c6d844a399eebace3d4979d75ceef4"}, -] -markers = {test = "python_version < \"3.11\""} - -[[package]] -name = "urllib3" -version = "2.4.0" -description = "HTTP library with thread-safe connection pooling, file post, and more." -optional = false -python-versions = ">=3.9" -groups = ["docs"] -files = [ - {file = "urllib3-2.4.0-py3-none-any.whl", hash = "sha256:4e16665048960a0900c702d4a66415956a584919c03361cac9f1df5c5dd7e813"}, - {file = "urllib3-2.4.0.tar.gz", hash = "sha256:414bc6535b787febd7567804cc015fee39daab8ad86268f1310a9250697de466"}, -] - -[package.extras] -brotli = ["brotli (>=1.0.9) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=0.8.0) ; platform_python_implementation != \"CPython\""] -h2 = ["h2 (>=4,<5)"] -socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] -zstd = ["zstandard (>=0.18.0)"] - -[[package]] -name = "virtualenv" -version = "20.31.2" -description = "Virtual Python Environment builder" -optional = false -python-versions = ">=3.8" -groups = ["test"] -files = [ - {file = "virtualenv-20.31.2-py3-none-any.whl", hash = "sha256:36efd0d9650ee985f0cad72065001e66d49a6f24eb44d98980f630686243cf11"}, - {file = "virtualenv-20.31.2.tar.gz", hash = "sha256:e10c0a9d02835e592521be48b332b6caee6887f332c111aa79a09b9e79efc2af"}, -] - -[package.dependencies] -distlib = ">=0.3.7,<1" -filelock = ">=3.12.2,<4" -platformdirs = ">=3.9.1,<5" - -[package.extras] -docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2,!=7.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] -test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8) ; platform_python_implementation == \"PyPy\" or platform_python_implementation == \"GraalVM\" or platform_python_implementation == \"CPython\" and sys_platform == \"win32\" and python_version >= \"3.13\"", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10) ; platform_python_implementation == \"CPython\""] - -[[package]] -name = "zipp" -version = "3.23.0" -description = "Backport of pathlib-compatible object wrapper for zip files" -optional = false -python-versions = ">=3.9" -groups = ["docs"] -markers = "python_version == \"3.9\"" -files = [ - {file = "zipp-3.23.0-py3-none-any.whl", hash = "sha256:071652d6115ed432f5ce1d34c336c0adfd6a884660d1e9712a256d3d3bd4b14e"}, - {file = "zipp-3.23.0.tar.gz", hash = "sha256:a07157588a12518c9d4034df3fbbee09c814741a33ff63c05fa29d26a2404166"}, -] - -[package.extras] -check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\""] -cover = ["pytest-cov"] -doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -enabler = ["pytest-enabler (>=2.2)"] -test = ["big-O", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more_itertools", "pytest (>=6,!=8.1.*)", "pytest-ignore-flaky"] -type = ["pytest-mypy"] - -[metadata] -lock-version = "2.1" -python-versions = ">= 3.9" -content-hash = "38fbbe57866b8c63e3de60d3edef54a30fe5fe3e5274d4423caeb0afe9cda15c" From 43a87d4d1eb062ce54d747a54ed864b4f5dadcb9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 14:39:20 +0000 Subject: [PATCH 40/87] Bump requests from 2.32.3 to 2.32.4 in /docs Bumps [requests](https://github.com/psf/requests) from 2.32.3 to 2.32.4. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.32.3...v2.32.4) --- updated-dependencies: - dependency-name: requests dependency-version: 2.32.4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index c317153..4f61eb8 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -14,7 +14,7 @@ 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.3 ; 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" From 7a574a7a09537f5928a66688cedb1d0a51243376 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Tue, 17 Jun 2025 14:50:03 +0200 Subject: [PATCH 41/87] Improvements to parser tests --- tests/test_parser.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/test_parser.py b/tests/test_parser.py index 8a67aa1..2d4117a 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -56,9 +56,8 @@ def test_compile_to_constraints(): constraints = [ "x != 320", # FunctionConstraint "y == 0 or x % 32 != 0",# FunctionConstraint - "50 <= x * y < 100", # becomes splitted MinProdConstraint and MaxProdConstraint "x == 100", # ExactSumConstraint - # "100 == x + y" # ExactSumConstraint # TODO why is this parsed to a FunctionConstraint? + "100 == x + y", # ExactSumConstraint # TODO why is this parsed to a FunctionConstraint? "x == 100+y", # VariableExactSumConstraint "x == x+y", # VariableExactSumConstraint "51 <= x+y", # MinSumConstraint @@ -69,14 +68,13 @@ def test_compile_to_constraints(): "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, - MinProdConstraint, - MaxProdConstraint, ExactSumConstraint, - # ExactSumConstraint, + ExactSumConstraint, VariableExactSumConstraint, VariableExactSumConstraint, MinSumConstraint, @@ -87,12 +85,13 @@ def test_compile_to_constraints(): VariableExactProdConstraint, VariableMinProdConstraint, VariableMaxProdConstraint, + MinProdConstraint, + MaxProdConstraint, ] compiled = compile_to_constraints(constraints, domains, picklable=False) # assert len(compiled) == len(expected_constraint_types) for r, vals, r_str in compiled: - print(r, vals, r_str) assert isinstance(r, Constraint) assert isinstance(vals, Iterable) and all(isinstance(v, str) for v in vals) if isinstance(r, (FunctionConstraint, CompilableFunctionConstraint)): @@ -103,7 +102,7 @@ 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]}" + 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) From db3bce6d1c509f2c79c4dfc8d9d178d1c67ff07f Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Tue, 17 Jun 2025 14:59:04 +0200 Subject: [PATCH 42/87] Documentation has been extended and amended to reflect changes introduced. --- CHANGELOG.md | 4 ++-- README.rst | 32 ++++++++++++++++++++------------ docs/intro.rst | 11 +++++++++-- 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da78025..7dcaf88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,13 @@ All notable changes to this code base will be documented in this file, for every ### Version 2.3.0 -- Released: TBD +- Released: 2025-06-17 - Issues / Enhancements: - Python Constraint now has an entirely new type of built-in constraints, allowing comparisons with variables on both sides to be evaluated much more efficiently. - Constraint rewriting has been extended to include minus and division operators. - Rewriting of restrictions with less-than or greater-than operators now supports floats as well. - Tests have been extended and amended to reflect changes introduced. - - TODO documentation has been extended and amended to reflect changes introduced. + - Documentation has been extended and amended to reflect changes introduced. - Various minor bugs have been resolved. ### Version 2.2.0 diff --git a/README.rst b/README.rst index fb2cfbd..17e75e1 100644 --- a/README.rst +++ b/README.rst @@ -15,6 +15,7 @@ python-constraint | 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. | 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. .. contents:: @@ -125,18 +126,25 @@ The following solvers are available: Predefined constraint types currently available: -- :python:`FunctionConstraint` -- :python:`AllDifferentConstraint` -- :python:`AllEqualConstraint` -- :python:`MaxSumConstraint` -- :python:`ExactSumConstraint` -- :python:`MinSumConstraint` -- :python:`MaxProdConstraint` -- :python:`MinProdConstraint` -- :python:`InSetConstraint` -- :python:`NotInSetConstraint` -- :python:`SomeInSetConstraint` -- :python:`SomeNotInSetConstraint` +- :any:`FunctionConstraint` +- :any:`AllDifferentConstraint` +- :any:`AllEqualConstraint` +- :any:`ExactSumConstraint` +- :any:`MinSumConstraint` +- :any:`MaxSumConstraint` +- :any:`MinProdConstraint` +- :any:`ExactProdConstraint` +- :any:`MaxProdConstraint` +- :any:`VariableExactSumConstraint` +- :any:`VariableMinSumConstraint` +- :any:`VariableMaxSumConstraint` +- :any:`VariableMinProdConstraint` +- :any:`VariableExactProdConstraint` +- :any:`VariableMaxProdConstraint` +- :any:`InSetConstraint` +- :any:`NotInSetConstraint` +- :any:`SomeInSetConstraint` +- :any:`SomeNotInSetConstraint` API documentation ----------------- diff --git a/docs/intro.rst b/docs/intro.rst index 38b747b..f4eb316 100644 --- a/docs/intro.rst +++ b/docs/intro.rst @@ -110,11 +110,18 @@ Predefined constraint types currently available: - :any:`FunctionConstraint` - :any:`AllDifferentConstraint` - :any:`AllEqualConstraint` -- :any:`MaxSumConstraint` - :any:`ExactSumConstraint` - :any:`MinSumConstraint` -- :any:`MaxProdConstraint` +- :any:`MaxSumConstraint` - :any:`MinProdConstraint` +- :any:`ExactProdConstraint` +- :any:`MaxProdConstraint` +- :any:`VariableExactSumConstraint` +- :any:`VariableMinSumConstraint` +- :any:`VariableMaxSumConstraint` +- :any:`VariableMinProdConstraint` +- :any:`VariableExactProdConstraint` +- :any:`VariableMaxProdConstraint` - :any:`InSetConstraint` - :any:`NotInSetConstraint` - :any:`SomeInSetConstraint` From 5bd80d536371a6471d7590af626a5256cd14b646 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Tue, 17 Jun 2025 15:31:13 +0200 Subject: [PATCH 43/87] Updated documentation to include references to the new constraint types and parallel solver --- README.rst | 10 +++++----- docs/intro.rst | 9 +++++---- docs/reference.rst | 38 +++++++++++++++++++++++++++++++++++--- 3 files changed, 45 insertions(+), 12 deletions(-) diff --git a/README.rst b/README.rst index 17e75e1..6a52061 100644 --- a/README.rst +++ b/README.rst @@ -115,11 +115,11 @@ Features The following solvers are available: -- Backtracking solver -- Optimized backtracking solver -- Recursive backtracking solver -- Minimum conflicts solver -- Parallel solver +- :any:`BacktrackingSolver` +- :any:`OptimizedBacktrackingSolver` +- :any:`RecursiveBacktrackingSolver` +- :any:`MinConflictsSolver` +- :any:`ParallelSolver` .. role:: python(code) :language: python diff --git a/docs/intro.rst b/docs/intro.rst index f4eb316..9d84d90 100644 --- a/docs/intro.rst +++ b/docs/intro.rst @@ -96,10 +96,11 @@ Features The following solvers are available: -- Backtracking solver -- Optimized backtracking solver -- Recursive backtracking solver -- Minimum conflicts solver +- :any:`BacktrackingSolver` +- :any:`OptimizedBacktrackingSolver` +- :any:`RecursiveBacktrackingSolver` +- :any:`MinConflictsSolver` +- :any:`ParallelSolver` .. role:: python(code) diff --git a/docs/reference.rst b/docs/reference.rst index 5985220..f3a20bf 100644 --- a/docs/reference.rst +++ b/docs/reference.rst @@ -37,6 +37,10 @@ Solvers :members: :member-order: bysource +.. autoclass:: constraint.ParallelSolver + :members: + :member-order: bysource + Constraints ~~~~~~~~~~~ @@ -57,15 +61,23 @@ Constraints :members: :member-order: bysource +.. autoclass:: constraint.ExactSumConstraint + :members: + :member-order: bysource + +.. autoclass:: constraint.MinSumConstraint + :members: + :member-order: bysource + .. autoclass:: constraint.MaxSumConstraint :members: :member-order: bysource -.. autoclass:: constraint.ExactSumConstraint +.. autoclass:: constraint.ExactProdConstraint :members: :member-order: bysource -.. autoclass:: constraint.MinSumConstraint +.. autoclass:: constraint.MinProdConstraint :members: :member-order: bysource @@ -73,7 +85,27 @@ Constraints :members: :member-order: bysource -.. autoclass:: constraint.MinProdConstraint +.. autoclass:: constraint.VariableExactSumConstraint + :members: + :member-order: bysource + +.. autoclass:: constraint.VariableMinSumConstraint + :members: + :member-order: bysource + +.. autoclass:: constraint.VariableMaxSumConstraint + :members: + :member-order: bysource + +.. autoclass:: constraint.VariableExactProdConstraint + :members: + :member-order: bysource + +.. autoclass:: constraint.VariableMinProdConstraint + :members: + :member-order: bysource + +.. autoclass:: constraint.VariableMaxProdConstraint :members: :member-order: bysource From a30c6136ff4cdbc65820d0207d9df1315f281358 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Tue, 17 Jun 2025 15:52:25 +0200 Subject: [PATCH 44/87] Updated README --- README.rst | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/README.rst b/README.rst index 6a52061..e0b8031 100644 --- a/README.rst +++ b/README.rst @@ -115,36 +115,36 @@ Features The following solvers are available: -- :any:`BacktrackingSolver` -- :any:`OptimizedBacktrackingSolver` -- :any:`RecursiveBacktrackingSolver` -- :any:`MinConflictsSolver` -- :any:`ParallelSolver` +- :code:`OptimizedBacktrackingSolver` (default) +- :code:`BacktrackingSolver` +- :code:`RecursiveBacktrackingSolver` +- :code:`MinConflictsSolver` +- :code:`ParallelSolver` .. role:: python(code) :language: python -Predefined constraint types currently available: - -- :any:`FunctionConstraint` -- :any:`AllDifferentConstraint` -- :any:`AllEqualConstraint` -- :any:`ExactSumConstraint` -- :any:`MinSumConstraint` -- :any:`MaxSumConstraint` -- :any:`MinProdConstraint` -- :any:`ExactProdConstraint` -- :any:`MaxProdConstraint` -- :any:`VariableExactSumConstraint` -- :any:`VariableMinSumConstraint` -- :any:`VariableMaxSumConstraint` -- :any:`VariableMinProdConstraint` -- :any:`VariableExactProdConstraint` -- :any:`VariableMaxProdConstraint` -- :any:`InSetConstraint` -- :any:`NotInSetConstraint` -- :any:`SomeInSetConstraint` -- :any:`SomeNotInSetConstraint` +Predefined constraint types currently available (use the parsing for automatic conversion to these types): + +- :code:`FunctionConstraint` +- :code:`AllDifferentConstraint` +- :code:`AllEqualConstraint` +- :code:`ExactSumConstraint` +- :code:`MinSumConstraint` +- :code:`MaxSumConstraint` +- :code:`MinProdConstraint` +- :code:`ExactProdConstraint` +- :code:`MaxProdConstraint` +- :code:`VariableExactSumConstraint` +- :code:`VariableMinSumConstraint` +- :code:`VariableMaxSumConstraint` +- :code:`VariableMinProdConstraint` +- :code:`VariableExactProdConstraint` +- :code:`VariableMaxProdConstraint` +- :code:`InSetConstraint` +- :code:`NotInSetConstraint` +- :code:`SomeInSetConstraint` +- :code:`SomeNotInSetConstraint` API documentation ----------------- From 2180cbd99a2a91561feea1432e4405413368b614 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Tue, 17 Jun 2025 16:39:56 +0200 Subject: [PATCH 45/87] Minor fix to ensure variables less than one are tracked where required --- constraint/constraints.c | 9082 +++++++++++++++++++++---------------- constraint/constraints.py | 10 + pyproject.toml | 2 +- 3 files changed, 5064 insertions(+), 4030 deletions(-) diff --git a/constraint/constraints.c b/constraint/constraints.c index b48b741..b06da78 100644 --- a/constraint/constraints.c +++ b/constraint/constraints.c @@ -1517,15 +1517,17 @@ 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_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_12_genexpr; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__; 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_17_genexpr; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__; 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_19_genexpr; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr; /* "constraint/constraints.py":64 * vconstraints[variable].remove((self, variables)) @@ -1710,7 +1712,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr { }; -/* "constraint/constraints.py":780 +/* "constraint/constraints.py":781 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -1724,30 +1726,44 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr { }; -/* "constraint/constraints.py":890 +/* "constraint/constraints.py":810 + * 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_12_genexpr { + PyObject_HEAD + PyObject *__pyx_genexpr_arg_0; + PyObject *__pyx_v_value; +}; + + +/* "constraint/constraints.py":895 * 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 */ -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ { PyObject_HEAD PyObject *__pyx_v_assigned_product; PyObject *__pyx_v_target_value; }; -/* "constraint/constraints.py":913 +/* "constraint/constraints.py":918 * 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) # <<<<<<<<<<<<<< * possible_max = max(assigned_product * c for c in candidates) * */ -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr { PyObject_HEAD - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *__pyx_outer_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_c; PyObject *__pyx_t_0; @@ -1755,16 +1771,16 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr { }; -/* "constraint/constraints.py":914 +/* "constraint/constraints.py":919 * 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: */ -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr { +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; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_c; PyObject *__pyx_t_0; @@ -1772,86 +1788,100 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr { }; -/* "constraint/constraints.py":928 +/* "constraint/constraints.py":933 * 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 { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr { PyObject_HEAD - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *__pyx_outer_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_c; }; -/* "constraint/constraints.py":1034 +/* "constraint/constraints.py":1039 * 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_17___call__ { PyObject_HEAD PyObject *__pyx_v_target_value; }; -/* "constraint/constraints.py":1070 +/* "constraint/constraints.py":1075 * 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_18_genexpr { PyObject_HEAD - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__ *__pyx_outer_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__ *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_p; }; -/* "constraint/constraints.py":1104 +/* "constraint/constraints.py":1110 * 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_18_genexpr { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_value; }; -/* "constraint/constraints.py":1205 +/* "constraint/constraints.py":1139 + * 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_20_genexpr { + PyObject_HEAD + PyObject *__pyx_genexpr_arg_0; + PyObject *__pyx_v_value; +}; + + +/* "constraint/constraints.py":1215 * 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_19___call__ { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__ { PyObject_HEAD PyObject *__pyx_v_target_value; }; -/* "constraint/constraints.py":1241 +/* "constraint/constraints.py":1251 * 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_20_genexpr { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr { PyObject_HEAD - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *__pyx_outer_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__ *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_p; }; @@ -2960,7 +2990,6 @@ static PyObject *__pyx_builtin_RuntimeError; 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"; @@ -2977,7 +3006,8 @@ 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_Q_2[] = "\270Q"; +static const char __pyx_k_Q_3[] = "\230Q"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_dom[] = "dom"; static const char __pyx_k_get[] = "get"; @@ -2992,6 +3022,8 @@ 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_L_6a[] = "\320\004 \240\001\360\014\000\t\r\210L\230\001\330\010\014\320\0146\260a"; +static const char __pyx_k_N_6a[] = "\320\004\"\240!\360\014\000\t\r\210N\230!\330\010\014\320\0146\260a"; static const char __pyx_k_bool[] = "bool"; static const char __pyx_k_call[] = "__call__"; static const char __pyx_k_dict[] = "dict"; @@ -3205,10 +3237,10 @@ static const char __pyx_k_NotInSetConstraint_preProcess[] = "NotInSetConstraint. 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_D_q_a_3at_Cs_1_A_7_Q_J_c[] = "\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"; 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_a_q_a_3at_Cs_1_A_7_Q_J_c[] = "\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"; 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"; @@ -3248,7 +3280,9 @@ static const char __pyx_k_Constraint_enforcing_that_the_pr[] = "Constraint enfor 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___call___loc[] = "ExactProdConstraint.__call__..genexpr"; static const char __pyx_k_ExactProdConstraint_preProcess_l[] = "ExactProdConstraint.preProcess..genexpr"; +static const char __pyx_k_MaxProdConstraint___call___local[] = "MaxProdConstraint.__call__..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."; @@ -3340,6 +3374,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 */ @@ -3361,6 +3396,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 */ @@ -3391,15 +3427,17 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_8_ge 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_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_12_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_13___call__(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_17_genexpr(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___call__(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_19_genexpr(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___call__(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 */ @@ -3451,15 +3489,17 @@ typedef struct { PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_9_preProcess; 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_12_genexpr; + PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_13___call__; 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_17_genexpr; + PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_16_genexpr; + PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_17___call__; 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_19_genexpr; PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_20_genexpr; + PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_21___call__; + 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; @@ -3473,22 +3513,24 @@ typedef struct { PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_preProcess; 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_12_genexpr; + PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13___call__; 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_17_genexpr; + PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr; + PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17___call__; 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_19_genexpr; PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr; + PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21___call__; + PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_22_genexpr; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; __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_codeobj_tab[77]; + PyObject *__pyx_string_tab[290]; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_10; @@ -3555,13 +3597,13 @@ int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_11_genexpr; #endif #if CYTHON_USE_FREELISTS -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_12___call__[8]; -int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_12___call__; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_12_genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_12_genexpr; #endif #if CYTHON_USE_FREELISTS -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_13_genexpr[8]; -int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_13_genexpr; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_13___call__[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_13___call__; #endif #if CYTHON_USE_FREELISTS @@ -3575,13 +3617,13 @@ int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_15_genexpr; #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 -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_17_genexpr[8]; -int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_17_genexpr; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__ *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_17___call__[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_17___call__; #endif #if CYTHON_USE_FREELISTS @@ -3590,14 +3632,24 @@ int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_18_genexpr; #endif #if CYTHON_USE_FREELISTS -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_19___call__[8]; -int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_19___call__; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_19_genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_19_genexpr; #endif #if CYTHON_USE_FREELISTS 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___call__ *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_21___call__[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_21___call__; +#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; @@ -3677,256 +3729,258 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_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] -#define __pyx_n_u_hi __pyx_string_tab[184] -#define __pyx_n_u_hideValue __pyx_string_tab[185] -#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_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_maxprod __pyx_string_tab[197] -#define __pyx_n_u_maxprod_2 __pyx_string_tab[198] -#define __pyx_n_u_maxsum __pyx_string_tab[199] -#define __pyx_n_u_maxsum_2 __pyx_string_tab[200] -#define __pyx_n_u_maxval __pyx_string_tab[201] -#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_ExactProdConstraint___call___loc __pyx_string_tab[38] +#define __pyx_n_u_ExactProdConstraint___init __pyx_string_tab[39] +#define __pyx_n_u_ExactProdConstraint_preProcess __pyx_string_tab[40] +#define __pyx_n_u_ExactProdConstraint_preProcess_l __pyx_string_tab[41] +#define __pyx_n_u_ExactSumConstraint __pyx_string_tab[42] +#define __pyx_n_u_ExactSumConstraint___call __pyx_string_tab[43] +#define __pyx_n_u_ExactSumConstraint___init __pyx_string_tab[44] +#define __pyx_n_u_ExactSumConstraint_preProcess __pyx_string_tab[45] +#define __pyx_n_u_FunctionConstraint __pyx_string_tab[46] +#define __pyx_n_u_FunctionConstraint___call __pyx_string_tab[47] +#define __pyx_n_u_FunctionConstraint___init __pyx_string_tab[48] +#define __pyx_n_u_InSetConstraint __pyx_string_tab[49] +#define __pyx_n_u_InSetConstraint___call __pyx_string_tab[50] +#define __pyx_n_u_InSetConstraint___init __pyx_string_tab[51] +#define __pyx_n_u_InSetConstraint_preProcess __pyx_string_tab[52] +#define __pyx_kp_u_Last_multiplier_must_be_1_as_it __pyx_string_tab[53] +#define __pyx_n_u_MaxProdConstraint __pyx_string_tab[54] +#define __pyx_n_u_MaxProdConstraint___call __pyx_string_tab[55] +#define __pyx_n_u_MaxProdConstraint___call___local __pyx_string_tab[56] +#define __pyx_n_u_MaxProdConstraint___init __pyx_string_tab[57] +#define __pyx_n_u_MaxProdConstraint_preProcess __pyx_string_tab[58] +#define __pyx_n_u_MaxProdConstraint_preProcess_loc __pyx_string_tab[59] +#define __pyx_n_u_MaxSumConstraint __pyx_string_tab[60] +#define __pyx_n_u_MaxSumConstraint___call __pyx_string_tab[61] +#define __pyx_n_u_MaxSumConstraint___init __pyx_string_tab[62] +#define __pyx_n_u_MaxSumConstraint_preProcess __pyx_string_tab[63] +#define __pyx_n_u_MaxSumConstraint_preProcess_loca __pyx_string_tab[64] +#define __pyx_n_u_MinProdConstraint __pyx_string_tab[65] +#define __pyx_n_u_MinProdConstraint___call __pyx_string_tab[66] +#define __pyx_n_u_MinProdConstraint___init __pyx_string_tab[67] +#define __pyx_n_u_MinProdConstraint_preProcess __pyx_string_tab[68] +#define __pyx_n_u_MinSumConstraint __pyx_string_tab[69] +#define __pyx_n_u_MinSumConstraint___call __pyx_string_tab[70] +#define __pyx_n_u_MinSumConstraint___init __pyx_string_tab[71] +#define __pyx_kp_u_Multipliers_must_be_numbers __pyx_string_tab[72] +#define __pyx_kp_u_Multipliers_must_match_sum_varia __pyx_string_tab[73] +#define __pyx_n_u_NotImplementedError __pyx_string_tab[74] +#define __pyx_n_u_NotInSetConstraint __pyx_string_tab[75] +#define __pyx_n_u_NotInSetConstraint___call __pyx_string_tab[76] +#define __pyx_n_u_NotInSetConstraint___init __pyx_string_tab[77] +#define __pyx_n_u_NotInSetConstraint_preProcess __pyx_string_tab[78] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[79] +#define __pyx_n_u_Optional __pyx_string_tab[80] +#define __pyx_kp_u_Optional_Sequence __pyx_string_tab[81] +#define __pyx_n_u_RuntimeError __pyx_string_tab[82] +#define __pyx_n_u_Sequence __pyx_string_tab[83] +#define __pyx_kp_u_Sequence_str __pyx_string_tab[84] +#define __pyx_n_u_SomeInSetConstraint __pyx_string_tab[85] +#define __pyx_n_u_SomeInSetConstraint___call __pyx_string_tab[86] +#define __pyx_n_u_SomeInSetConstraint___init __pyx_string_tab[87] +#define __pyx_n_u_SomeNotInSetConstraint __pyx_string_tab[88] +#define __pyx_n_u_SomeNotInSetConstraint___call __pyx_string_tab[89] +#define __pyx_n_u_SomeNotInSetConstraint___init __pyx_string_tab[90] +#define __pyx_n_u_Unassigned __pyx_string_tab[91] +#define __pyx_n_u_Union __pyx_string_tab[92] +#define __pyx_kp_u_Union_int_float __pyx_string_tab[93] +#define __pyx_n_u_VariableExactProdConstraint __pyx_string_tab[94] +#define __pyx_n_u_VariableExactProdConstraint___ca __pyx_string_tab[95] +#define __pyx_n_u_VariableExactProdConstraint___ca_2 __pyx_string_tab[96] +#define __pyx_n_u_VariableExactProdConstraint___in __pyx_string_tab[97] +#define __pyx_n_u_VariableExactProdConstraint__get __pyx_string_tab[98] +#define __pyx_n_u_VariableExactProdConstraint__saf __pyx_string_tab[99] +#define __pyx_n_u_VariableExactProdConstraint_preP __pyx_string_tab[100] +#define __pyx_n_u_VariableExactSumConstraint __pyx_string_tab[101] +#define __pyx_n_u_VariableExactSumConstraint___cal __pyx_string_tab[102] +#define __pyx_n_u_VariableExactSumConstraint___ini __pyx_string_tab[103] +#define __pyx_n_u_VariableExactSumConstraint___ini_2 __pyx_string_tab[104] +#define __pyx_n_u_VariableExactSumConstraint_prePr __pyx_string_tab[105] +#define __pyx_n_u_VariableExactSumConstraint_prePr_2 __pyx_string_tab[106] +#define __pyx_n_u_VariableMaxProdConstraint __pyx_string_tab[107] +#define __pyx_n_u_VariableMaxProdConstraint___call __pyx_string_tab[108] +#define __pyx_n_u_VariableMaxProdConstraint___call_2 __pyx_string_tab[109] +#define __pyx_n_u_VariableMaxProdConstraint___init __pyx_string_tab[110] +#define __pyx_n_u_VariableMaxProdConstraint__get_p __pyx_string_tab[111] +#define __pyx_n_u_VariableMaxProdConstraint__safe __pyx_string_tab[112] +#define __pyx_n_u_VariableMaxProdConstraint_prePro __pyx_string_tab[113] +#define __pyx_n_u_VariableMaxSumConstraint __pyx_string_tab[114] +#define __pyx_n_u_VariableMaxSumConstraint___call __pyx_string_tab[115] +#define __pyx_n_u_VariableMaxSumConstraint___init __pyx_string_tab[116] +#define __pyx_n_u_VariableMaxSumConstraint___init_2 __pyx_string_tab[117] +#define __pyx_n_u_VariableMaxSumConstraint_preProc __pyx_string_tab[118] +#define __pyx_n_u_VariableMaxSumConstraint_preProc_2 __pyx_string_tab[119] +#define __pyx_n_u_VariableMinProdConstraint __pyx_string_tab[120] +#define __pyx_n_u_VariableMinProdConstraint___call __pyx_string_tab[121] +#define __pyx_n_u_VariableMinProdConstraint___call_2 __pyx_string_tab[122] +#define __pyx_n_u_VariableMinProdConstraint___init __pyx_string_tab[123] +#define __pyx_n_u_VariableMinProdConstraint__get_p __pyx_string_tab[124] +#define __pyx_n_u_VariableMinProdConstraint__safe __pyx_string_tab[125] +#define __pyx_n_u_VariableMinProdConstraint_prePro __pyx_string_tab[126] +#define __pyx_n_u_VariableMinSumConstraint __pyx_string_tab[127] +#define __pyx_n_u_VariableMinSumConstraint___call __pyx_string_tab[128] +#define __pyx_n_u_VariableMinSumConstraint___init __pyx_string_tab[129] +#define __pyx_n_u_VariableMinSumConstraint___init_2 __pyx_string_tab[130] +#define __pyx_n_u_VariableMinSumConstraint_preProc __pyx_string_tab[131] +#define __pyx_n_u_VariableMinSumConstraint_preProc_2 __pyx_string_tab[132] +#define __pyx_kp_u_Wrapper_function_for_picklable_s __pyx_string_tab[133] +#define __pyx_kp_u__2 __pyx_string_tab[134] +#define __pyx_kp_u_add_note __pyx_string_tab[135] +#define __pyx_n_u_all_bounds __pyx_string_tab[136] +#define __pyx_n_u_append __pyx_string_tab[137] +#define __pyx_n_u_assigned __pyx_string_tab[138] +#define __pyx_n_u_assigned_2 __pyx_string_tab[139] +#define __pyx_n_u_assigned_prod __pyx_string_tab[140] +#define __pyx_n_u_assigned_product __pyx_string_tab[141] +#define __pyx_n_u_assignments __pyx_string_tab[142] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[143] +#define __pyx_n_u_b __pyx_string_tab[144] +#define __pyx_n_u_bool __pyx_string_tab[145] +#define __pyx_n_u_bounds __pyx_string_tab[146] +#define __pyx_n_u_c __pyx_string_tab[147] +#define __pyx_n_u_call __pyx_string_tab[148] +#define __pyx_n_u_candidates __pyx_string_tab[149] +#define __pyx_n_u_class_getitem __pyx_string_tab[150] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[151] +#define __pyx_n_u_close __pyx_string_tab[152] +#define __pyx_n_u_collections_abc __pyx_string_tab[153] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[154] +#define __pyx_kp_u_constraint_constraints_py __pyx_string_tab[155] +#define __pyx_n_u_constraint_domain __pyx_string_tab[156] +#define __pyx_n_u_constraints __pyx_string_tab[157] +#define __pyx_n_u_contains_lt1 __pyx_string_tab[158] +#define __pyx_n_u_contains_negative __pyx_string_tab[159] +#define __pyx_n_u_dict __pyx_string_tab[160] +#define __pyx_kp_u_disable __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_kp_u_enable __pyx_string_tab[168] +#define __pyx_n_u_exact __pyx_string_tab[169] +#define __pyx_n_u_exact_2 __pyx_string_tab[170] +#define __pyx_n_u_exactprod __pyx_string_tab[171] +#define __pyx_n_u_exactprod_2 __pyx_string_tab[172] +#define __pyx_n_u_exactsum __pyx_string_tab[173] +#define __pyx_n_u_exactsum_2 __pyx_string_tab[174] +#define __pyx_n_u_exclude_var __pyx_string_tab[175] +#define __pyx_n_u_forwardCheck __pyx_string_tab[176] +#define __pyx_n_u_forwardcheck __pyx_string_tab[177] +#define __pyx_n_u_found __pyx_string_tab[178] +#define __pyx_n_u_func __pyx_string_tab[179] +#define __pyx_n_u_func_2 __pyx_string_tab[180] +#define __pyx_n_u_func_3 __pyx_string_tab[181] +#define __pyx_kp_u_gc __pyx_string_tab[182] +#define __pyx_n_u_genexpr __pyx_string_tab[183] +#define __pyx_n_u_get __pyx_string_tab[184] +#define __pyx_n_u_get_product_bounds __pyx_string_tab[185] +#define __pyx_n_u_hi __pyx_string_tab[186] +#define __pyx_n_u_hideValue __pyx_string_tab[187] +#define __pyx_n_u_index __pyx_string_tab[188] +#define __pyx_n_u_init __pyx_string_tab[189] +#define __pyx_n_u_is_coroutine __pyx_string_tab[190] +#define __pyx_kp_u_isenabled __pyx_string_tab[191] +#define __pyx_n_u_itertools __pyx_string_tab[192] +#define __pyx_kp_u_list_tuple __pyx_string_tab[193] +#define __pyx_n_u_lo __pyx_string_tab[194] +#define __pyx_n_u_m __pyx_string_tab[195] +#define __pyx_n_u_main __pyx_string_tab[196] +#define __pyx_n_u_max __pyx_string_tab[197] +#define __pyx_n_u_max_others __pyx_string_tab[198] +#define __pyx_n_u_maxprod __pyx_string_tab[199] +#define __pyx_n_u_maxprod_2 __pyx_string_tab[200] +#define __pyx_n_u_maxsum __pyx_string_tab[201] +#define __pyx_n_u_maxsum_2 __pyx_string_tab[202] +#define __pyx_n_u_maxval __pyx_string_tab[203] +#define __pyx_n_u_metaclass __pyx_string_tab[204] +#define __pyx_n_u_min __pyx_string_tab[205] +#define __pyx_n_u_min_others __pyx_string_tab[206] +#define __pyx_n_u_minprod __pyx_string_tab[207] +#define __pyx_n_u_minprod_2 __pyx_string_tab[208] +#define __pyx_n_u_minsum __pyx_string_tab[209] +#define __pyx_n_u_minsum_2 __pyx_string_tab[210] +#define __pyx_n_u_minval __pyx_string_tab[211] +#define __pyx_n_u_missing __pyx_string_tab[212] +#define __pyx_n_u_missing_lt1 __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_others __pyx_string_tab[228] +#define __pyx_n_u_others_bounds __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_singlevalue __pyx_string_tab[255] +#define __pyx_n_u_str __pyx_string_tab[256] +#define __pyx_n_u_sum __pyx_string_tab[257] +#define __pyx_n_u_sum_value __pyx_string_tab[258] +#define __pyx_n_u_sum_vars __pyx_string_tab[259] +#define __pyx_n_u_t_max __pyx_string_tab[260] +#define __pyx_n_u_t_min __pyx_string_tab[261] +#define __pyx_n_u_target_dom __pyx_string_tab[262] +#define __pyx_n_u_target_domain __pyx_string_tab[263] +#define __pyx_n_u_target_max __pyx_string_tab[264] +#define __pyx_n_u_target_min __pyx_string_tab[265] +#define __pyx_n_u_target_value __pyx_string_tab[266] +#define __pyx_n_u_target_var __pyx_string_tab[267] +#define __pyx_n_u_temp_sum __pyx_string_tab[268] +#define __pyx_n_u_test __pyx_string_tab[269] +#define __pyx_n_u_throw __pyx_string_tab[270] +#define __pyx_n_u_typing __pyx_string_tab[271] +#define __pyx_n_u_unassigned __pyx_string_tab[272] +#define __pyx_n_u_unassigned_2 __pyx_string_tab[273] +#define __pyx_n_u_unassigned_vars __pyx_string_tab[274] +#define __pyx_n_u_unassignedvariable __pyx_string_tab[275] +#define __pyx_n_u_v __pyx_string_tab[276] +#define __pyx_n_u_val __pyx_string_tab[277] +#define __pyx_n_u_value __pyx_string_tab[278] +#define __pyx_n_u_values __pyx_string_tab[279] +#define __pyx_n_u_var __pyx_string_tab[280] +#define __pyx_n_u_variable __pyx_string_tab[281] +#define __pyx_n_u_variable_contains_lt1 __pyx_string_tab[282] +#define __pyx_n_u_variable_contains_negative __pyx_string_tab[283] +#define __pyx_n_u_variable_with_lt1 __pyx_string_tab[284] +#define __pyx_n_u_variable_with_negative __pyx_string_tab[285] +#define __pyx_n_u_variables __pyx_string_tab[286] +#define __pyx_n_u_vconstraints __pyx_string_tab[287] +#define __pyx_n_u_x __pyx_string_tab[288] +#define __pyx_n_u_zip __pyx_string_tab[289] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3973,28 +4027,32 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { 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); Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__); - Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_12___call__); - Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr); - 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_12_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13___call__); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_13___call__); 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_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_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___call__); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_17___call__); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_18_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__); - 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_19_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_19_genexpr); 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___call__); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_21___call__); + 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]); } + for (int i=0; i<77; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<290; ++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); @@ -4044,28 +4102,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_10_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__); - Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_12___call__); - Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr); - 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_12_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13___call__); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_13___call__); 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_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_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___call__); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_17___call__); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_18_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__); - 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_19_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_19_genexpr); 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___call__); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_21___call__); + 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]); } + for (int i=0; i<77; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<290; ++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); @@ -20343,6 +20405,7 @@ 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; @@ -20352,11 +20415,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint___ini * 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 */ 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) + /* "constraint/constraints.py":772 + * """ + * self._exactprod = exactprod + * self._variable_contains_lt1: list[bool] = list() # <<<<<<<<<<<<<< + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 +*/ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __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, 772, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* "constraint/constraints.py":765 * """ * @@ -20369,6 +20444,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 +20453,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint___ini return __pyx_r; } -/* "constraint/constraints.py":773 - * self._exactprod = exactprod +/* "constraint/constraints.py":774 + * 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 +20504,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, 774, __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, 774, __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, 774, __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, 774, __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, 774, __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, 774, __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, 774, __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, 774, __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, 774, __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, 774, __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, 774, __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, 774, __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, 774, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -20481,7 +20557,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, 774, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20492,9 +20568,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, 774, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 774, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 774, __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 */ @@ -20515,7 +20591,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10preProcess_2generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":780 +/* "constraint/constraints.py":781 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -20535,7 +20611,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_10pre 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, 780, __pyx_L1_error) + __PYX_ERR(0, 781, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -20543,7 +20619,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_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, 781, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -20580,16 +20656,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, 781, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 781, __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, 781, __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, 781, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -20597,7 +20673,7 @@ 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, 781, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -20607,7 +20683,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre { 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, 781, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -20618,13 +20694,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, 781, __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, 781, __pyx_L1_error) PyErr_Clear(); } break; @@ -20635,8 +20711,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, 781, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_XDECREF(__pyx_r); @@ -20675,8 +20751,8 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre return __pyx_r; } -/* "constraint/constraints.py":773 - * self._exactprod = exactprod +/* "constraint/constraints.py":774 + * 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) @@ -20712,7 +20788,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":774 + /* "constraint/constraints.py":775 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -20720,9 +20796,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, 775, __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, 775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -20742,24 +20818,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __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_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, 775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":777 + /* "constraint/constraints.py":778 * * # 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, 778, __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, 778, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":778 + /* "constraint/constraints.py":779 * # 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 +20845,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":780 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -20781,9 +20857,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, 780, __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, 780, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -20791,7 +20867,7 @@ 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, 780, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -20801,7 +20877,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { 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, 780, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -20812,13 +20888,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, 780, __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, 780, __pyx_L1_error) PyErr_Clear(); } break; @@ -20828,37 +20904,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":781 * 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, 781, __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, 781, __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, 781, __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":782 * 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, 782, __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, 782, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":779 + /* "constraint/constraints.py":780 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -20868,7 +20944,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":783 * 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): # <<<<<<<<<<<<<< @@ -20878,7 +20954,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __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_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, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; { @@ -20887,7 +20963,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __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, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -20895,9 +20971,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, 783, __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, 783, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -20906,7 +20982,7 @@ 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, 783, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -20916,7 +20992,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { 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, 783, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -20927,13 +21003,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, 783, __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, 783, __pyx_L1_error) PyErr_Clear(); } break; @@ -20946,7 +21022,7 @@ 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, 783, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -20956,22 +21032,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 783, __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) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 783, __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, 782, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 783, __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, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 783, __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, 782, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 783, __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); @@ -20979,7 +21055,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __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; __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 782, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 783, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_unpacking_done; @@ -20987,7 +21063,7 @@ 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, 783, __pyx_L1_error) __pyx_L9_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); @@ -20995,7 +21071,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":783 + /* "constraint/constraints.py":784 * 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 +21081,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":785 * 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 +21091,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":787 * if variable_with_lt1 is not None: * # if more than one associated variables contain less than 1, we can't prune * return # <<<<<<<<<<<<<< @@ -21027,7 +21103,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":785 * 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 +21112,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ } - /* "constraint/constraints.py":787 + /* "constraint/constraints.py":788 * # if more than one associated variables contain less than 1, we can't prune * return * variable_with_lt1 = variable # <<<<<<<<<<<<<< @@ -21046,7 +21122,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":784 * 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 +21131,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ } - /* "constraint/constraints.py":782 + /* "constraint/constraints.py":783 * 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 +21141,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":791 * * # 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, 791, __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":792 * # prune the associated variables of values > exactprod * exactprod = self._exactprod * for variable in variables: # <<<<<<<<<<<<<< @@ -21089,9 +21165,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, 792, __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, 792, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -21099,7 +21175,7 @@ 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, 792, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -21109,7 +21185,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { 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, 792, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -21120,13 +21196,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, 792, __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, 792, __pyx_L1_error) PyErr_Clear(); } break; @@ -21136,7 +21212,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":793 * exactprod = self._exactprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -21149,14 +21225,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, 793, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 793, __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":794 * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: * continue # <<<<<<<<<<<<<< @@ -21165,7 +21241,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ goto __pyx_L13_continue; - /* "constraint/constraints.py":792 + /* "constraint/constraints.py":793 * exactprod = self._exactprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -21174,35 +21250,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ } - /* "constraint/constraints.py":794 + /* "constraint/constraints.py":795 * 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, 795, __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":796 * 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, 796, __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_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_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 796, __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_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 796, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -21211,7 +21287,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { 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, 795, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 796, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -21221,7 +21297,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { 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, 795, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 796, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -21232,13 +21308,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif ++__pyx_t_13; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 795, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 796, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_14(__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, 795, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 796, __pyx_L1_error) PyErr_Clear(); } break; @@ -21248,19 +21324,19 @@ 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":797 * 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, 797, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { - /* "constraint/constraints.py":797 + /* "constraint/constraints.py":798 * for value in domain[:]: * if value > exactprod: * domain.remove(value) # <<<<<<<<<<<<<< @@ -21274,12 +21350,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP 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) + 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":796 + /* "constraint/constraints.py":797 * domain = domains[variable] * for value in domain[:]: * if value > exactprod: # <<<<<<<<<<<<<< @@ -21289,25 +21365,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP goto __pyx_L20; } - /* "constraint/constraints.py":798 + /* "constraint/constraints.py":799 * 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, 799, __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, 799, __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":800 * domain.remove(value) * elif value == 0 and exactprod != 0: * domain.remove(value) # <<<<<<<<<<<<<< @@ -21321,12 +21397,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP 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) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":798 + /* "constraint/constraints.py":799 * if value > exactprod: * domain.remove(value) * elif value == 0 and exactprod != 0: # <<<<<<<<<<<<<< @@ -21336,7 +21412,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __pyx_L20:; - /* "constraint/constraints.py":795 + /* "constraint/constraints.py":796 * continue * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -21346,7 +21422,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":791 + /* "constraint/constraints.py":792 * # prune the associated variables of values > exactprod * exactprod = self._exactprod * for variable in variables: # <<<<<<<<<<<<<< @@ -21357,8 +21433,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":774 + * 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) @@ -21389,7 +21465,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP return __pyx_r; } -/* "constraint/constraints.py":801 +/* "constraint/constraints.py":802 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -21440,53 +21516,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, 801, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 802, __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, 802, __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, 802, __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, 802, __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, 802, __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, 802, __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, 802, __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, 802, __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, 801, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 802, __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, 802, __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) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 802, __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) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 802, __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) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 802, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -21500,7 +21576,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, 801, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 802, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -21511,8 +21587,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, 801, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 801, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 802, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 802, __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 */ @@ -21531,6 +21607,175 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__call___2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "constraint/constraints.py":810 + * 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_12_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_12_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 810, __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___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_ExactProdConstraint___call___loc, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 810, __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___2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_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, 810, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 810, __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, 810, __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, 810, __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, 810, __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, 810, __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, 810, __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, 810, __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, 810, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 810, __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":802 + * 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; @@ -21541,40 +21786,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___2generator9 = 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":803 * * 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, 803, __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":804 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * exactprod = self._exactprod * prod = 1 # <<<<<<<<<<<<<< @@ -21584,93 +21830,207 @@ 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":805 * 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":806 * 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, 806, __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":808 * 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, 808, __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, 808, __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, 808, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_2 != __pyx_t_3); + if (__pyx_t_4) { + + /* "constraint/constraints.py":809 + * # 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, 809, __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, 809, __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, 809, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + ++__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, 809, __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, 809, __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, 809, __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":810 + * 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, 810, __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, 810, __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, 810, __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, 810, __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, 810, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "constraint/constraints.py":809 + * # 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":808 + * 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":811 + * 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_t_7 = 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_6 = __pyx_builtin_zip; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 811, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __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_8}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __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_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __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, 811, __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, 811, __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, 811, __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_GetItemRef(__pyx_t_6, __pyx_t_3); + ++__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, 811, __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, 811, __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, 811, __pyx_L1_error) PyErr_Clear(); } break; @@ -21683,91 +22043,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, 811, __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_8 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_8); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_7); } 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_8 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 811, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 811, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); } #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_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 811, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 811, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); #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, 811, __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_8 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L9_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + index = 1; __pyx_t_7 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_7)) goto __pyx_L9_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 811, __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, 811, __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_8); + __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/constraints.py":807 - * missing_lt1 = [] + /* "constraint/constraints.py":812 + * 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, 812, __pyx_L1_error) + if (__pyx_t_4) { - /* "constraint/constraints.py":808 + /* "constraint/constraints.py":813 * 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, 813, __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_7 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __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_7); + __pyx_t_7 = 0; - /* "constraint/constraints.py":807 - * missing_lt1 = [] + /* "constraint/constraints.py":812 + * 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":815 * prod *= assignments[variable] * else: * missing = True # <<<<<<<<<<<<<< @@ -21777,26 +22137,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca /*else*/ { __pyx_v_missing = 1; - /* "constraint/constraints.py":811 + /* "constraint/constraints.py":816 * 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, 816, __pyx_L1_error) + if (__pyx_t_4) { - /* "constraint/constraints.py":812 + /* "constraint/constraints.py":817 * 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, 817, __pyx_L1_error) - /* "constraint/constraints.py":811 + /* "constraint/constraints.py":816 * else: * missing = True * if contains_lt1: # <<<<<<<<<<<<<< @@ -21805,51 +22165,51 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } } - __pyx_L7:; + __pyx_L11:; - /* "constraint/constraints.py":806 - * missing = False - * missing_lt1 = [] + /* "constraint/constraints.py":811 + * 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":818 * 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":819 * 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_t_7 = NULL; __Pyx_INCREF(__pyx_builtin_round); __pyx_t_1 = __pyx_builtin_round; - __pyx_t_5 = 1; + __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; + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_prod, __pyx_mstate_global->__pyx_int_10}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __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_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 814, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 819, __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":818 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -21858,42 +22218,42 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":815 + /* "constraint/constraints.py":820 * 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, 820, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 820, __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, 820, __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, 820, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 820, __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":821 * prod = round(prod, 10) * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): * return False # <<<<<<<<<<<<<< @@ -21905,7 +22265,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":815 + /* "constraint/constraints.py":820 * if isinstance(prod, float): * prod = round(prod, 10) * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): # <<<<<<<<<<<<<< @@ -21914,17 +22274,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":817 + /* "constraint/constraints.py":822 * 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, 822, __pyx_L1_error) + if (__pyx_t_4) { - /* "constraint/constraints.py":818 + /* "constraint/constraints.py":823 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -21932,48 +22292,48 @@ 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, 823, __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, 823, __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, 823, __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_GetItemRef(__pyx_t_6, __pyx_t_3); + ++__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, 823, __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, 818, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 823, __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, 818, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 823, __pyx_L1_error) PyErr_Clear(); } break; @@ -21983,96 +22343,96 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":819 + /* "constraint/constraints.py":824 * 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, 824, __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, 824, __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, 824, __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":825 * 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_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":821 + /* "constraint/constraints.py":826 * 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_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, 826, __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_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); + __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_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 826, __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(PyList_CheckExact(__pyx_t_7))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + 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, 821, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 826, __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_1 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_2); + ++__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_7); #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, 826, __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_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_2)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_7, __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_1)) __PYX_ERR(0, 826, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_14(__pyx_t_2); + __pyx_t_1 = __pyx_t_14(__pyx_t_7); 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, 821, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 826, __pyx_L1_error) PyErr_Clear(); } break; @@ -22082,22 +22442,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":822 + /* "constraint/constraints.py":827 * 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_t_1 = PyNumber_Multiply(__pyx_v_prod, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __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_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_v_exactprod, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 827, __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_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 827, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_4) { - /* "constraint/constraints.py":823 + /* "constraint/constraints.py":828 * for value in domain[:]: * if prod * value > exactprod: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -22106,17 +22466,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ __pyx_t_1 = __pyx_v_domain; __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = 0; + __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_t_8 = __Pyx_PyObject_FastCallMethod(__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_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 828, __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":822 + /* "constraint/constraints.py":827 * domain = domains[variable] * for value in domain[:]: * if prod * value > exactprod: # <<<<<<<<<<<<<< @@ -22125,7 +22485,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":821 + /* "constraint/constraints.py":826 * 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 +22493,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_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":824 + /* "constraint/constraints.py":829 * 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, 829, __pyx_L1_error) + __pyx_t_13 = (!__pyx_t_4); + if (__pyx_t_13) { - /* "constraint/constraints.py":825 + /* "constraint/constraints.py":830 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -22156,10 +22516,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":829 * if prod * value > exactprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -22168,7 +22528,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":819 + /* "constraint/constraints.py":824 * if forwardcheck: * for variable in variables: * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): # <<<<<<<<<<<<<< @@ -22177,7 +22537,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":818 + /* "constraint/constraints.py":823 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -22185,9 +22545,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":822 * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): * return False * if forwardcheck: # <<<<<<<<<<<<<< @@ -22196,7 +22556,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":826 + /* "constraint/constraints.py":831 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -22208,7 +22568,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":801 + /* "constraint/constraints.py":802 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -22219,10 +22579,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 +22593,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___2generator9); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":839 +/* "constraint/constraints.py":844 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # <<<<<<<<<<<<<< @@ -22288,38 +22649,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, 844, __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, 844, __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, 844, __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, 844, __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, 844, __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, 844, __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, 844, __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, 844, __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, 844, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_target_var = ((PyObject*)values[1]); @@ -22327,7 +22688,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, 844, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -22338,7 +22699,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, 844, __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 +22727,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":846 + /* "constraint/constraints.py":851 * 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, 851, __pyx_L1_error) - /* "constraint/constraints.py":847 + /* "constraint/constraints.py":852 * """ * 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, 852, __pyx_L1_error) - /* "constraint/constraints.py":839 + /* "constraint/constraints.py":844 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # <<<<<<<<<<<<<< @@ -22404,7 +22765,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":849 +/* "constraint/constraints.py":854 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -22454,41 +22815,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, 854, __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, 854, __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, 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, 849, __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, "_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, 854, __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, 854, __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, 854, __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, 854, __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, 854, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -22500,7 +22861,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, 854, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -22528,11 +22889,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_9genexpr11__pyx_v_b = NULL; + PyObject *__pyx_9genexpr12__pyx_v_lo = NULL; + PyObject *__pyx_9genexpr12__pyx_v_hi = NULL; + PyObject *__pyx_9genexpr13__pyx_v_p = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -22555,35 +22916,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":856 * 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, 856, __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":857 * """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, 857, __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, 857, __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, 857, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -22592,7 +22953,7 @@ 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, 857, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -22602,7 +22963,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 857, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -22613,13 +22974,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, 857, __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, 857, __pyx_L1_error) PyErr_Clear(); } break; @@ -22629,19 +22990,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":858 * 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, 858, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":854 + /* "constraint/constraints.py":859 * for var in self.product_vars: * if var == exclude_var: * continue # <<<<<<<<<<<<<< @@ -22650,7 +23011,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ goto __pyx_L3_continue; - /* "constraint/constraints.py":853 + /* "constraint/constraints.py":858 * bounds = [] * for var in self.product_vars: * if var == exclude_var: # <<<<<<<<<<<<<< @@ -22659,30 +23020,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":855 + /* "constraint/constraints.py":860 * 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, 860, __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":861 * 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, 861, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { - /* "constraint/constraints.py":857 + /* "constraint/constraints.py":862 * dom = domain_dict[var] * if not dom: * continue # <<<<<<<<<<<<<< @@ -22691,7 +23052,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ goto __pyx_L3_continue; - /* "constraint/constraints.py":856 + /* "constraint/constraints.py":861 * continue * dom = domain_dict[var] * if not dom: # <<<<<<<<<<<<<< @@ -22700,7 +23061,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":858 + /* "constraint/constraints.py":863 * if not dom: * continue * bounds.append((min(dom), max(dom))) # <<<<<<<<<<<<<< @@ -22716,7 +23077,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_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, 863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_7 = NULL; @@ -22728,21 +23089,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __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); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 863, __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_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 863, __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_t_11 = __Pyx_PyList_Append(__pyx_v_bounds, __pyx_t_10); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 863, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "constraint/constraints.py":852 + /* "constraint/constraints.py":857 * """Return min and max product of domains of product_vars (excluding `exclude_var` if given).""" * bounds = [] * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -22753,7 +23114,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":860 + /* "constraint/constraints.py":865 * bounds.append((min(dom), max(dom))) * * all_bounds = [b for b in bounds] # <<<<<<<<<<<<<< @@ -22761,7 +23122,7 @@ 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, 865, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = __pyx_v_bounds; __Pyx_INCREF(__pyx_t_10); __pyx_t_3 = 0; @@ -22769,30 +23130,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 860, __pyx_L10_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 865, __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_3; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 860, __pyx_L10_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 865, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_b, __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_8genexpr9__pyx_v_b))) __PYX_ERR(0, 860, __pyx_L10_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr10__pyx_v_b))) __PYX_ERR(0, 865, __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_XDECREF(__pyx_9genexpr10__pyx_v_b); __pyx_9genexpr10__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_9genexpr10__pyx_v_b); __pyx_9genexpr10__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":866 * * all_bounds = [b for b in bounds] * if not all_bounds: # <<<<<<<<<<<<<< @@ -22800,11 +23161,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * */ __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) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_6 < 0))) __PYX_ERR(0, 866, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_6); if (__pyx_t_5) { - /* "constraint/constraints.py":862 + /* "constraint/constraints.py":867 * all_bounds = [b for b in bounds] * if not all_bounds: * return 1, 1 # <<<<<<<<<<<<<< @@ -22816,7 +23177,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":866 * * all_bounds = [b for b in bounds] * if not all_bounds: # <<<<<<<<<<<<<< @@ -22825,7 +23186,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":865 + /* "constraint/constraints.py":870 * * # 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,12 +23194,12 @@ 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, 870, __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_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 870, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_10); { /* enter inner scope */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 865, __pyx_L23_error) + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 870, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __pyx_v_all_bounds; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; @@ -22846,13 +23207,13 @@ 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, 865, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 870, __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_3; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 865, __pyx_L23_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 870, __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; @@ -22860,7 +23221,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, 865, __pyx_L23_error) + __PYX_ERR(0, 870, __pyx_L23_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -22870,22 +23231,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 870, __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) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 870, __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, 870, __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, 870, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_13); #endif __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 870, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); @@ -22893,7 +23254,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 870, __pyx_L23_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L27_unpacking_done; @@ -22901,38 +23262,38 @@ 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, 870, __pyx_L23_error) __pyx_L27_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_lo, __pyx_t_12); + __Pyx_XDECREF_SET(__pyx_9genexpr12__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_9genexpr12__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_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 870, __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_INCREF(__pyx_9genexpr12__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr12__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_9genexpr12__pyx_v_lo) != (0)) __PYX_ERR(0, 870, __pyx_L23_error); + __Pyx_INCREF(__pyx_9genexpr12__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr12__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_9genexpr12__pyx_v_hi) != (0)) __PYX_ERR(0, 870, __pyx_L23_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 870, __pyx_L23_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_9genexpr12__pyx_v_hi); __pyx_9genexpr12__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_lo); __pyx_9genexpr12__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_9genexpr12__pyx_v_hi); __pyx_9genexpr12__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_lo); __pyx_9genexpr12__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_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __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_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 870, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -22941,9 +23302,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __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, 870, __pyx_L18_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -22952,7 +23313,7 @@ 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, 865, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 870, __pyx_L18_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -22962,7 +23323,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 870, __pyx_L18_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -22973,35 +23334,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 865, __pyx_L18_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 870, __pyx_L18_error) } else { __pyx_t_8 = __pyx_t_4(__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, 865, __pyx_L18_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 870, __pyx_L18_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_b, __pyx_t_8); + __Pyx_XDECREF_SET(__pyx_9genexpr11__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) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr11__pyx_v_b))) __PYX_ERR(0, 870, __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_9genexpr11__pyx_v_b); __pyx_9genexpr11__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_9genexpr11__pyx_v_b); __pyx_9genexpr11__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":871 * # 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 +23370,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, 871, __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 +23378,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, 871, __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_3; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 866, __pyx_L34_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 871, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_p, __pyx_t_8); + __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_p, __pyx_t_8); __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}; + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr13__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) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 871, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_8); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 866, __pyx_L34_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 871, __pyx_L34_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_9genexpr13__pyx_v_p); __pyx_9genexpr13__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_9genexpr13__pyx_v_p); __pyx_9genexpr13__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":872 * 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) # <<<<<<<<<<<<<< @@ -23068,7 +23429,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_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, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_1 = NULL; @@ -23080,22 +23441,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 867, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __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); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 872, __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_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 872, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_8 = 0; __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; - /* "constraint/constraints.py":849 + /* "constraint/constraints.py":854 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -23122,17 +23483,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_9genexpr11__pyx_v_b); + __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_lo); + __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_hi); + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_p); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":869 +/* "constraint/constraints.py":874 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -23180,39 +23541,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, 874, __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, 874, __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, 874, __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, 874, __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, 874, __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, 874, __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, 874, __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, 874, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -23247,7 +23608,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_safe_product", 0); - /* "constraint/constraints.py":870 + /* "constraint/constraints.py":875 * * def _safe_product(self, values): * prod = 1 # <<<<<<<<<<<<<< @@ -23257,7 +23618,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":876 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -23269,9 +23630,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, 876, __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, 876, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -23279,7 +23640,7 @@ 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, 876, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -23289,7 +23650,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 876, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -23300,13 +23661,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, 876, __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, 876, __pyx_L1_error) PyErr_Clear(); } break; @@ -23316,19 +23677,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":877 * 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, 877, __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":876 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -23338,7 +23699,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":873 + /* "constraint/constraints.py":878 * for v in values: * prod *= v * return prod # <<<<<<<<<<<<<< @@ -23350,7 +23711,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = __pyx_v_prod; goto __pyx_L0; - /* "constraint/constraints.py":869 + /* "constraint/constraints.py":874 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -23372,7 +23733,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":875 +/* "constraint/constraints.py":880 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -23423,50 +23784,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, 880, __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, 880, __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, 880, __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, 880, __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, 880, __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, 880, __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, 880, __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, 880, __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, 880, __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, 880, __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, 880, __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, 880, __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, 880, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -23476,7 +23837,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, 880, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -23487,9 +23848,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, 880, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 880, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 880, __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 */ @@ -23542,7 +23903,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":876 + /* "constraint/constraints.py":881 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -23550,9 +23911,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, 881, __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, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -23572,27 +23933,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_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, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":878 + /* "constraint/constraints.py":883 * 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, 883, __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, 883, __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":884 * * target_domain = domains[self.target_var] * target_min = min(target_domain) # <<<<<<<<<<<<<< @@ -23608,13 +23969,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_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, 884, __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":885 * target_domain = domains[self.target_var] * target_min = min(target_domain) * target_max = max(target_domain) # <<<<<<<<<<<<<< @@ -23630,29 +23991,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 885, __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":886 * 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, 886, __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, 886, __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, 886, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -23661,7 +24022,7 @@ 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, 886, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -23671,7 +24032,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 886, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -23682,13 +24043,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, 886, __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, 886, __pyx_L1_error) PyErr_Clear(); } break; @@ -23698,7 +24059,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":887 * 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 +24071,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, 887, __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) + 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, 887, __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_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, 887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { @@ -23725,7 +24086,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, 887, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -23735,22 +24096,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 887, __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) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 887, __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, 887, __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, 887, __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, 887, __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 +24119,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, 887, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -23766,7 +24127,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, 887, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_other_min, __pyx_t_3); @@ -23774,35 +24135,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":888 * 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, 888, __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":889 * 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, 889, __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, 889, __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, 889, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -23811,7 +24172,7 @@ 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, 889, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -23821,7 +24182,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 889, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -23832,13 +24193,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, 889, __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, 889, __pyx_L1_error) PyErr_Clear(); } break; @@ -23848,29 +24209,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":890 * 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, 890, __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, 890, __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, 890, __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, 890, __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, 890, __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":891 * for value in domain[:]: * candidates = [value * other_min, value * other_max] * minval, maxval = min(candidates), max(candidates) # <<<<<<<<<<<<<< @@ -23886,7 +24247,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_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, 891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_3 = NULL; @@ -23898,7 +24259,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_minval, __pyx_t_8); @@ -23906,29 +24267,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_maxval, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":887 + /* "constraint/constraints.py":892 * 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_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, 892, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_14) { } else { __pyx_t_13 = __pyx_t_14; 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_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, 892, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_13 = __pyx_t_14; __pyx_L10_bool_binop_done:; if (__pyx_t_13) { - /* "constraint/constraints.py":888 + /* "constraint/constraints.py":893 * minval, maxval = min(candidates), max(candidates) * if maxval < target_min or minval > target_max: * domain.remove(value) # <<<<<<<<<<<<<< @@ -23942,12 +24303,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":887 + /* "constraint/constraints.py":892 * candidates = [value * other_min, value * other_max] * minval, maxval = min(candidates), max(candidates) * if maxval < target_min or minval > target_max: # <<<<<<<<<<<<<< @@ -23956,7 +24317,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":884 + /* "constraint/constraints.py":889 * other_min, other_max = self._get_product_bounds(domains, exclude_var=var) * domain = domains[var] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -23966,7 +24327,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":881 + /* "constraint/constraints.py":886 * target_min = min(target_domain) * target_max = max(target_domain) * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -23976,7 +24337,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":875 + /* "constraint/constraints.py":880 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -24013,7 +24374,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":890 +/* "constraint/constraints.py":895 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -24064,53 +24425,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, 895, __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, 895, __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, 895, __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, 895, __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, 895, __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, 895, __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, 895, __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, 895, __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, 895, __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, 895, __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, 895, __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, 895, __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, 895, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -24124,7 +24485,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, 895, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -24135,8 +24496,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, 895, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 895, __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 */ @@ -24155,9 +24516,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___2generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":913 +/* "constraint/constraints.py":918 * 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) # <<<<<<<<<<<<<< @@ -24166,29 +24527,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai */ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_8__call___genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *__pyx_cur_scope; + struct __pyx_obj_10constraint_11constraints___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_11constraints___pyx_scope_struct_13_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_13_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_14_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 913, __pyx_L1_error) + __PYX_ERR(0, 918, __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_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___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___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___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_VariableExactProdConstraint___ca, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 918, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -24204,9 +24565,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___2generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -24226,29 +24587,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, 918, __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, 918, __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, 918, __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, 913, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 918, __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, 918, __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, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -24266,7 +24627,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, 918, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -24291,9 +24652,9 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___5generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___5generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":914 +/* "constraint/constraints.py":919 * 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) # <<<<<<<<<<<<<< @@ -24302,29 +24663,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai */ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_8__call___3genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *__pyx_cur_scope; + 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_14_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_14_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __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_14_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 914, __pyx_L1_error) + __PYX_ERR(0, 919, __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_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___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___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___5generator11, ((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, 919, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -24340,9 +24701,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___5generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___5generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *)__pyx_generator->closure); + 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; @@ -24362,29 +24723,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, 919, __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, 919, __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, 919, __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, 914, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 919, __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, 919, __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, 919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -24402,7 +24763,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, 919, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -24427,9 +24788,9 @@ 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 */ +static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___8generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":928 +/* "constraint/constraints.py":933 * for value in domain[:]: * candidates = [assigned_product * value * p for p in other_products] * if all(c != target_value for c in candidates): # <<<<<<<<<<<<<< @@ -24438,29 +24799,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai */ 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; + 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_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); + __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_15_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, 928, __pyx_L1_error) + __PYX_ERR(0, 933, __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_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___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_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___8generator12, ((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_VariableExactProdConstraint___ca, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 933, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -24476,9 +24837,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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 */ +static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___8generator12(__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); + 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; @@ -24497,29 +24858,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai 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) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 933, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 933, __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) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 933, __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) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 933, __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) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_target_value)) { __Pyx_RaiseClosureNameError("target_value"); __PYX_ERR(0, 933, __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, 933, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 933, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = (!__pyx_t_4); if (__pyx_t_5) { @@ -24559,7 +24920,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":890 +/* "constraint/constraints.py":895 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -24568,7 +24929,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai */ 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) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *__pyx_cur_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *__pyx_cur_scope; PyObject *__pyx_v_unassigned_vars = NULL; PyObject *__pyx_v_var = NULL; PyObject *__pyx_v_domain_bounds = NULL; @@ -24580,19 +24941,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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_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_9genexpr14__pyx_v_v = NULL; + PyObject *__pyx_9genexpr15__pyx_v_p = NULL; + PyObject *__pyx_9genexpr16__pyx_v_lo = NULL; + PyObject *__pyx_9genexpr16__pyx_v_hi = NULL; + PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___2generator10 = 0; + PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___5generator11 = 0; 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_9genexpr20__pyx_v_v = NULL; + PyObject *__pyx_9genexpr21__pyx_v_p = NULL; + PyObject *__pyx_9genexpr22__pyx_v_lo = NULL; + PyObject *__pyx_9genexpr22__pyx_v_hi = NULL; + PyObject *__pyx_9genexpr23__pyx_v_p = NULL; + PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___8generator12 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -24617,29 +24978,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12___call__(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_13___call__(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13___call__, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 890, __pyx_L1_error) + __PYX_ERR(0, 895, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/constraints.py":891 + /* "constraint/constraints.py":896 * * 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, 896, __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, 896, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":892 + /* "constraint/constraints.py":897 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: * return True # <<<<<<<<<<<<<< @@ -24651,7 +25012,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":891 + /* "constraint/constraints.py":896 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -24660,23 +25021,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":894 + /* "constraint/constraints.py":899 * 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, 899, __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, 899, __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":895 + /* "constraint/constraints.py":900 * * target_value = assignments[self.target_var] * assigned_product = 1 # <<<<<<<<<<<<<< @@ -24687,35 +25048,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":901 * 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, 901, __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":903 * 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, 903, __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, 903, __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, 903, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -24724,7 +25085,7 @@ 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, 903, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -24734,7 +25095,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 903, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -24745,13 +25106,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, 903, __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, 903, __pyx_L1_error) PyErr_Clear(); } break; @@ -24761,26 +25122,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":904 * * 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, 904, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":900 + /* "constraint/constraints.py":905 * 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, 905, __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, 905, __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 +25149,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":899 + /* "constraint/constraints.py":904 * * for var in self.product_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -24798,7 +25159,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai goto __pyx_L6; } - /* "constraint/constraints.py":902 + /* "constraint/constraints.py":907 * assigned_product *= assignments[var] * else: * unassigned_vars.append(var) # <<<<<<<<<<<<<< @@ -24806,11 +25167,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, 907, __pyx_L1_error) } __pyx_L6:; - /* "constraint/constraints.py":898 + /* "constraint/constraints.py":903 * unassigned_vars = [] * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -24820,7 +25181,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":904 + /* "constraint/constraints.py":909 * unassigned_vars.append(var) * * if isinstance(assigned_product, float): # <<<<<<<<<<<<<< @@ -24833,7 +25194,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":910 * * if isinstance(assigned_product, float): * assigned_product = round(assigned_product, 10) # <<<<<<<<<<<<<< @@ -24849,7 +25210,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_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, 910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_assigned_product); @@ -24857,7 +25218,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":904 + /* "constraint/constraints.py":909 * unassigned_vars.append(var) * * if isinstance(assigned_product, float): # <<<<<<<<<<<<<< @@ -24866,7 +25227,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":907 + /* "constraint/constraints.py":912 * assigned_product = round(assigned_product, 10) * * if not unassigned_vars: # <<<<<<<<<<<<<< @@ -24874,11 +25235,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * */ __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) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) __pyx_t_9 = (!__pyx_t_2); if (__pyx_t_9) { - /* "constraint/constraints.py":908 + /* "constraint/constraints.py":913 * * if not unassigned_vars: * return assigned_product == target_value # <<<<<<<<<<<<<< @@ -24886,12 +25247,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_cur_scope->__pyx_v_target_value, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":907 + /* "constraint/constraints.py":912 * assigned_product = round(assigned_product, 10) * * if not unassigned_vars: # <<<<<<<<<<<<<< @@ -24900,7 +25261,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":911 + /* "constraint/constraints.py":916 * * # Partial assignment check feasibility * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned_vars] # <<<<<<<<<<<<<< @@ -24908,7 +25269,7 @@ 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, 916, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_v_unassigned_vars; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; @@ -24916,20 +25277,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 911, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 916, __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_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 911, __pyx_L12_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 916, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_v, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_v, __pyx_t_6); __pyx_t_6 = 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_t_12 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr14__pyx_v_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 916, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_8 = 1; { @@ -24938,13 +25299,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 916, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_6); } __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_t_13 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr14__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 916, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_8 = 1; { @@ -24953,32 +25314,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 916, __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_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 916, __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); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 916, __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); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 916, __pyx_L12_error); __pyx_t_6 = 0; __pyx_t_11 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 911, __pyx_L12_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 916, __pyx_L12_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_v); __pyx_9genexpr13__pyx_v_v = 0; + __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_v); __pyx_9genexpr14__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_9genexpr14__pyx_v_v); __pyx_9genexpr14__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":917 * # 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,12 +25347,12 @@ 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, 917, __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_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 917, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); { /* enter inner scope */ - __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 912, __pyx_L24_error) + __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 917, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __pyx_v_domain_bounds; __Pyx_INCREF(__pyx_t_11); __pyx_t_4 = 0; @@ -24999,13 +25360,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 917, __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_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 912, __pyx_L24_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 917, __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; @@ -25013,7 +25374,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, 912, __pyx_L24_error) + __PYX_ERR(0, 917, __pyx_L24_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -25023,22 +25384,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 917, __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) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 917, __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_13 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 917, __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_t_12 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 917, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_12); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 917, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); @@ -25046,7 +25407,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 917, __pyx_L24_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L28_unpacking_done; @@ -25054,38 +25415,38 @@ 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, 917, __pyx_L24_error) __pyx_L28_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_lo, __pyx_t_13); + __Pyx_XDECREF_SET(__pyx_9genexpr16__pyx_v_lo, __pyx_t_13); __pyx_t_13 = 0; - __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_hi, __pyx_t_12); + __Pyx_XDECREF_SET(__pyx_9genexpr16__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_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 917, __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_INCREF(__pyx_9genexpr16__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr16__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_9genexpr16__pyx_v_lo) != (0)) __PYX_ERR(0, 917, __pyx_L24_error); + __Pyx_INCREF(__pyx_9genexpr16__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr16__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_9genexpr16__pyx_v_hi) != (0)) __PYX_ERR(0, 917, __pyx_L24_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 917, __pyx_L24_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_9genexpr16__pyx_v_hi); __pyx_9genexpr16__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_lo); __pyx_9genexpr16__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_9genexpr16__pyx_v_hi); __pyx_9genexpr16__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_lo); __pyx_9genexpr16__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_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 917, __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_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 917, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -25094,9 +25455,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 917, __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, 917, __pyx_L19_error) } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; for (;;) { @@ -25105,7 +25466,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 917, __pyx_L19_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -25115,7 +25476,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 917, __pyx_L19_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -25126,46 +25487,46 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 912, __pyx_L19_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 917, __pyx_L19_error) } else { __pyx_t_10 = __pyx_t_5(__pyx_t_11); 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, 912, __pyx_L19_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 917, __pyx_L19_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_10); - __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_p, __pyx_t_10); + __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_p, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_3 = __pyx_v_self; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_9genexpr14__pyx_v_p}; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_9genexpr15__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) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 917, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_10); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 912, __pyx_L19_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 917, __pyx_L19_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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_9genexpr15__pyx_v_p); __pyx_9genexpr15__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_9genexpr15__pyx_v_p); __pyx_9genexpr15__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":918 * 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) # <<<<<<<<<<<<<< @@ -25175,7 +25536,7 @@ 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_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, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = 1; { @@ -25184,13 +25545,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 918, __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":919 * 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) # <<<<<<<<<<<<<< @@ -25200,7 +25561,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_11 = __pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_8__call___3genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_candidates); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_8 = 1; { @@ -25209,35 +25570,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 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, 919, __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":921 * 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_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, 921, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 921, __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_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, 921, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 921, __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":922 * * if target_value < possible_min or target_value > possible_max: * return False # <<<<<<<<<<<<<< @@ -25249,7 +25610,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":916 + /* "constraint/constraints.py":921 * possible_max = max(assigned_product * c for c in candidates) * * if target_value < possible_min or target_value > possible_max: # <<<<<<<<<<<<<< @@ -25258,17 +25619,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":919 + /* "constraint/constraints.py":924 * 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) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 924, __pyx_L1_error) if (__pyx_t_9) { - /* "constraint/constraints.py":920 + /* "constraint/constraints.py":925 * * if forwardcheck: * for var in unassigned_vars: # <<<<<<<<<<<<<< @@ -25281,18 +25642,18 @@ 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, 920, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 925, __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) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 925, __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 + /* "constraint/constraints.py":926 * if forwardcheck: * for var in unassigned_vars: * others = [v for v in unassigned_vars if v != var] # <<<<<<<<<<<<<< @@ -25300,7 +25661,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * 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_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 926, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = __pyx_v_unassigned_vars; __Pyx_INCREF(__pyx_t_11); __pyx_t_16 = 0; @@ -25308,35 +25669,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 926, __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) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 926, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_XDECREF_SET(__pyx_9genexpr18__pyx_v_v, __pyx_t_10); + __Pyx_XDECREF_SET(__pyx_9genexpr19__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_t_10 = PyObject_RichCompare(__pyx_9genexpr19__pyx_v_v, __pyx_v_var, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 926, __pyx_L41_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 926, __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) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_9genexpr19__pyx_v_v))) __PYX_ERR(0, 926, __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; + __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_v); __pyx_9genexpr19__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; + __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_v); __pyx_9genexpr19__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 + /* "constraint/constraints.py":927 * 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)] # <<<<<<<<<<<<<< @@ -25344,7 +25705,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * */ { /* enter inner scope */ - __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 922, __pyx_L51_error) + __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 927, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = __pyx_v_others; __Pyx_INCREF(__pyx_t_10); __pyx_t_16 = 0; @@ -25352,20 +25713,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 927, __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) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 927, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr19__pyx_v_v, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr20__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_t_14 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr20__pyx_v_v); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 927, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_8 = 1; { @@ -25374,13 +25735,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 927, __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_t_17 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr20__pyx_v_v); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 927, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_8 = 1; { @@ -25389,29 +25750,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 927, __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_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 927, __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); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 927, __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); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_13) != (0)) __PYX_ERR(0, 927, __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) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_11, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 927, __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; + __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_v); __pyx_9genexpr20__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; + __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_v); __pyx_9genexpr20__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) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 927, __pyx_L1_error) if (!__pyx_t_9) { __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else { @@ -25420,11 +25781,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_t_11 = PyList_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 927, __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); + if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 0, __pyx_mstate_global->__pyx_tuple[0]) != (0)) __PYX_ERR(0, 927, __pyx_L1_error); __Pyx_INCREF(__pyx_t_11); __pyx_t_3 = __pyx_t_11; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -25432,7 +25793,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_others_bounds, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "constraint/constraints.py":923 + /* "constraint/constraints.py":928 * 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])] # <<<<<<<<<<<<<< @@ -25440,16 +25801,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * 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_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 928, __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_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 928, __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_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 928, __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_ERR(0, 928, __pyx_L63_error) } __pyx_t_12 = __pyx_v_others_bounds; __Pyx_INCREF(__pyx_t_12); __pyx_t_16 = 0; @@ -25457,13 +25818,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 928, __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) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 928, __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; @@ -25471,7 +25832,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, 923, __pyx_L63_error) + __PYX_ERR(0, 928, __pyx_L63_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -25481,22 +25842,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 928, __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) + if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 928, __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_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 928, __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_t_17 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 928, __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_t_14 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 928, __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); @@ -25504,7 +25865,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 928, __pyx_L63_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L67_unpacking_done; @@ -25512,38 +25873,38 @@ 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, 923, __pyx_L63_error) + __PYX_ERR(0, 928, __pyx_L63_error) __pyx_L67_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr21__pyx_v_lo, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr22__pyx_v_lo, __pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF_SET(__pyx_9genexpr21__pyx_v_hi, __pyx_t_17); + __Pyx_XDECREF_SET(__pyx_9genexpr22__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_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 928, __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_INCREF(__pyx_9genexpr22__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr22__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_9genexpr22__pyx_v_lo) != (0)) __PYX_ERR(0, 928, __pyx_L63_error); + __Pyx_INCREF(__pyx_9genexpr22__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr22__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_9genexpr22__pyx_v_hi) != (0)) __PYX_ERR(0, 928, __pyx_L63_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_13))) __PYX_ERR(0, 928, __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; + __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_hi); __pyx_9genexpr22__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_lo); __pyx_9genexpr22__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; + __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_hi); __pyx_9genexpr22__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_lo); __pyx_9genexpr22__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_t_12 = PySequence_Tuple(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 928, __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_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 928, __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; @@ -25552,9 +25913,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_t_16 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 928, __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_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 928, __pyx_L58_error) } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; for (;;) { @@ -25563,7 +25924,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 928, __pyx_L58_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -25573,7 +25934,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 928, __pyx_L58_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -25584,74 +25945,74 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 923, __pyx_L58_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 928, __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) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 928, __pyx_L58_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_10); - __Pyx_XDECREF_SET(__pyx_9genexpr20__pyx_v_p, __pyx_t_10); + __Pyx_XDECREF_SET(__pyx_9genexpr21__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}; + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_9genexpr21__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) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 928, __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) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 928, __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; + __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_p); __pyx_9genexpr21__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; + __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_p); __pyx_9genexpr21__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 + /* "constraint/constraints.py":930 * 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_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 930, __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 + /* "constraint/constraints.py":931 * * 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_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, 931, __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_t_16 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 931, __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_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 931, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -25660,7 +26021,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 931, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -25670,7 +26031,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 931, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -25681,13 +26042,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 926, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 931, __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) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 931, __pyx_L1_error) PyErr_Clear(); } break; @@ -25697,7 +26058,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":927 + /* "constraint/constraints.py":932 * domain = domains[var] * for value in domain[:]: * candidates = [assigned_product * value * p for p in other_products] # <<<<<<<<<<<<<< @@ -25705,7 +26066,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * 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_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 932, __pyx_L76_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __pyx_v_other_products; __Pyx_INCREF(__pyx_t_10); __pyx_t_18 = 0; @@ -25713,52 +26074,52 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 932, __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) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 932, __pyx_L76_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_XDECREF_SET(__pyx_9genexpr22__pyx_v_p, __pyx_t_11); + __Pyx_XDECREF_SET(__pyx_9genexpr23__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_t_11 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_assigned_product, __pyx_v_value); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 932, __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_t_13 = PyNumber_Multiply(__pyx_t_11, __pyx_9genexpr23__pyx_v_p); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 932, __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) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_13))) __PYX_ERR(0, 932, __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; + __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_p); __pyx_9genexpr23__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; + __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_p); __pyx_9genexpr23__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 + /* "constraint/constraints.py":933 * 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_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, 933, __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_t_10 = __Pyx_Generator_GetInlinedResult(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 933, __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_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 933, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_9) { - /* "constraint/constraints.py":929 + /* "constraint/constraints.py":934 * candidates = [assigned_product * value * p for p in other_products] * if all(c != target_value for c in candidates): * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -25772,12 +26133,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "constraint/constraints.py":928 + /* "constraint/constraints.py":933 * for value in domain[:]: * candidates = [assigned_product * value * p for p in other_products] * if all(c != target_value for c in candidates): # <<<<<<<<<<<<<< @@ -25786,7 +26147,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":926 + /* "constraint/constraints.py":931 * * domain = domains[var] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -25796,18 +26157,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "constraint/constraints.py":930 + /* "constraint/constraints.py":935 * 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_9 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 935, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_9); if (__pyx_t_2) { - /* "constraint/constraints.py":931 + /* "constraint/constraints.py":936 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -25820,7 +26181,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":930 + /* "constraint/constraints.py":935 * if all(c != target_value for c in candidates): * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -25829,7 +26190,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":920 + /* "constraint/constraints.py":925 * * if forwardcheck: * for var in unassigned_vars: # <<<<<<<<<<<<<< @@ -25839,7 +26200,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":919 + /* "constraint/constraints.py":924 * return False * * if forwardcheck: # <<<<<<<<<<<<<< @@ -25848,7 +26209,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":933 + /* "constraint/constraints.py":938 * return False * * return True # <<<<<<<<<<<<<< @@ -25860,7 +26221,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":890 + /* "constraint/constraints.py":895 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -25893,26 +26254,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_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_9genexpr14__pyx_v_v); + __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_p); + __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_lo); + __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_hi); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___2generator10); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___5generator11); __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_XDECREF(__pyx_9genexpr20__pyx_v_v); + __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_p); + __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_lo); + __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_hi); + __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_p); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___8generator12); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":947 +/* "constraint/constraints.py":952 * """ * * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -25961,39 +26322,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, 952, __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, 952, __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, 952, __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, 952, __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, 952, __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, 952, __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, 952, __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, 952, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26022,16 +26383,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":953 + /* "constraint/constraints.py":958 * 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, 958, __pyx_L1_error) - /* "constraint/constraints.py":947 + /* "constraint/constraints.py":952 * """ * * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -26051,7 +26412,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ return __pyx_r; } -/* "constraint/constraints.py":955 +/* "constraint/constraints.py":960 * self._minprod = minprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -26102,50 +26463,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, 960, __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, 960, __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, 960, __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, 960, __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, 960, __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, 960, __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, 960, __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, 960, __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, 960, __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, 960, __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, 960, __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, 960, __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, 960, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -26155,7 +26516,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, 960, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26166,9 +26527,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, 960, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 960, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 960, __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 +26572,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":956 + /* "constraint/constraints.py":961 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -26219,9 +26580,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, 961, __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, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -26241,24 +26602,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro __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_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, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":959 + /* "constraint/constraints.py":964 * * # 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, 964, __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":965 * # prune the associated variables of values > minprod * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< @@ -26270,9 +26631,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, 965, __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, 965, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -26280,7 +26641,7 @@ 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, 965, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -26290,7 +26651,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro { 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, 965, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -26301,13 +26662,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, 965, __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, 965, __pyx_L1_error) PyErr_Clear(); } break; @@ -26317,35 +26678,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":966 * 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, 966, __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":967 * 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, 967, __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, 967, __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, 967, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -26354,7 +26715,7 @@ 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, 967, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -26364,7 +26725,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro { 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, 967, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -26375,13 +26736,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, 967, __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, 967, __pyx_L1_error) PyErr_Clear(); } break; @@ -26391,27 +26752,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":968 * 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, 968, __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, 968, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 968, __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":969 * for value in domain[:]: * if value == 0 and minprod > 0: * domain.remove(value) # <<<<<<<<<<<<<< @@ -26425,12 +26786,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro 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_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, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":963 + /* "constraint/constraints.py":968 * domain = domains[variable] * for value in domain[:]: * if value == 0 and minprod > 0: # <<<<<<<<<<<<<< @@ -26439,7 +26800,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro */ } - /* "constraint/constraints.py":962 + /* "constraint/constraints.py":967 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -26449,7 +26810,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":965 * # prune the associated variables of values > minprod * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< @@ -26459,7 +26820,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":960 * self._minprod = minprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -26487,7 +26848,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro return __pyx_r; } -/* "constraint/constraints.py":966 +/* "constraint/constraints.py":971 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -26538,53 +26899,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, 971, __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, 971, __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, 971, __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, 971, __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, 971, __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, 971, __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, 971, __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, 971, __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, 971, __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, 971, __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, 971, __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, 971, __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, 971, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -26598,7 +26959,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, 971, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26609,8 +26970,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, 971, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 971, __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 +27009,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":973 * 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 +27021,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, 973, __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, 973, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -26670,7 +27031,7 @@ 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, 973, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -26680,7 +27041,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call { 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, 973, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -26691,13 +27052,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, 973, __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, 973, __pyx_L1_error) PyErr_Clear(); } break; @@ -26707,17 +27068,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":974 * # 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, 974, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":970 + /* "constraint/constraints.py":975 * for variable in variables: * if variable not in assignments: * return True # <<<<<<<<<<<<<< @@ -26730,7 +27091,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":974 * # check if each variable is in the assignments * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -26739,7 +27100,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call */ } - /* "constraint/constraints.py":968 + /* "constraint/constraints.py":973 * 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 +27110,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":978 * * # 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, 978, __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":979 * # with each variable assigned, sum the values * minprod = self._minprod * prod = 1 # <<<<<<<<<<<<<< @@ -26771,7 +27132,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":980 * minprod = self._minprod * prod = 1 * for variable in variables: # <<<<<<<<<<<<<< @@ -26783,9 +27144,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, 980, __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, 980, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -26793,7 +27154,7 @@ 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, 980, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -26803,7 +27164,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call { 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, 980, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -26814,13 +27175,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, 980, __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, 980, __pyx_L1_error) PyErr_Clear(); } break; @@ -26830,22 +27191,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":981 * 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, 981, __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, 981, __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":980 * minprod = self._minprod * prod = 1 * for variable in variables: # <<<<<<<<<<<<<< @@ -26855,7 +27216,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":982 * for variable in variables: * prod *= assignments[variable] * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -26865,7 +27226,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":983 * prod *= assignments[variable] * if isinstance(prod, float): * prod = round(prod, 10) # <<<<<<<<<<<<<< @@ -26881,13 +27242,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call __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_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, 983, __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":982 * for variable in variables: * prod *= assignments[variable] * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -26896,7 +27257,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call */ } - /* "constraint/constraints.py":979 + /* "constraint/constraints.py":984 * if isinstance(prod, float): * prod = round(prod, 10) * return prod >= minprod # <<<<<<<<<<<<<< @@ -26904,12 +27265,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, 984, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":966 + /* "constraint/constraints.py":971 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -26933,7 +27294,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call return __pyx_r; } -/* "constraint/constraints.py":993 +/* "constraint/constraints.py":998 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -26982,38 +27343,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, 998, __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, 998, __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, 998, __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, 998, __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, 998, __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, 998, __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, 998, __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, 998, __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, 998, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_target_var = ((PyObject*)values[1]); @@ -27021,7 +27382,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, 998, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27032,7 +27393,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, 998, __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 +27421,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":994 + /* "constraint/constraints.py":999 * * 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, 999, __pyx_L1_error) - /* "constraint/constraints.py":995 + /* "constraint/constraints.py":1000 * 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, 1000, __pyx_L1_error) - /* "constraint/constraints.py":993 + /* "constraint/constraints.py":998 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -27098,7 +27459,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":997 +/* "constraint/constraints.py":1002 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -27147,41 +27508,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, 1002, __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, 1002, __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, 1002, __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, 1002, __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, 1002, __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, 1002, __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, 1002, __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, 1002, __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, 1002, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -27193,7 +27554,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, 1002, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27220,10 +27581,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_9genexpr25__pyx_v_p = NULL; + PyObject *__pyx_9genexpr26__pyx_v_lo = NULL; + PyObject *__pyx_9genexpr26__pyx_v_hi = NULL; + PyObject *__pyx_9genexpr27__pyx_v_p = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -27246,35 +27607,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":1003 * * 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, 1003, __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":1004 * 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, 1004, __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, 1004, __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, 1004, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -27283,7 +27644,7 @@ 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, 1004, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -27293,7 +27654,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1004, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -27304,13 +27665,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, 1004, __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, 1004, __pyx_L1_error) PyErr_Clear(); } break; @@ -27320,19 +27681,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":1005 * 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, 1005, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1001 + /* "constraint/constraints.py":1006 * for var in self.product_vars: * if var == exclude_var: * continue # <<<<<<<<<<<<<< @@ -27341,7 +27702,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ goto __pyx_L3_continue; - /* "constraint/constraints.py":1000 + /* "constraint/constraints.py":1005 * bounds = [] * for var in self.product_vars: * if var == exclude_var: # <<<<<<<<<<<<<< @@ -27350,30 +27711,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1002 + /* "constraint/constraints.py":1007 * 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, 1007, __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":1008 * 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, 1008, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { - /* "constraint/constraints.py":1004 + /* "constraint/constraints.py":1009 * dom = domain_dict[var] * if not dom: * continue # <<<<<<<<<<<<<< @@ -27382,7 +27743,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ goto __pyx_L3_continue; - /* "constraint/constraints.py":1003 + /* "constraint/constraints.py":1008 * continue * dom = domain_dict[var] * if not dom: # <<<<<<<<<<<<<< @@ -27391,7 +27752,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1005 + /* "constraint/constraints.py":1010 * if not dom: * continue * bounds.append((min(dom), max(dom))) # <<<<<<<<<<<<<< @@ -27407,7 +27768,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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_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, 1010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_7 = NULL; @@ -27419,21 +27780,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1005, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __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); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1010, __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_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 1010, __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_t_11 = __Pyx_PyList_Append(__pyx_v_bounds, __pyx_t_10); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1010, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "constraint/constraints.py":999 + /* "constraint/constraints.py":1004 * def _get_product_bounds(self, domain_dict, exclude_var=None): * bounds = [] * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -27444,7 +27805,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1007 + /* "constraint/constraints.py":1012 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< @@ -27452,11 +27813,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * */ __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) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_6 < 0))) __PYX_ERR(0, 1012, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_6); if (__pyx_t_5) { - /* "constraint/constraints.py":1008 + /* "constraint/constraints.py":1013 * * if not bounds: * return 1, 1 # <<<<<<<<<<<<<< @@ -27468,7 +27829,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":1012 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< @@ -27477,7 +27838,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1011 + /* "constraint/constraints.py":1016 * * # Try all corner combinations * candidates = [p for p in product(*[(lo, hi) for lo, hi in bounds])] # <<<<<<<<<<<<<< @@ -27485,12 +27846,12 @@ 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, 1016, __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_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1016, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); { /* enter inner scope */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1011, __pyx_L16_error) + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1016, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __pyx_v_bounds; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; @@ -27498,13 +27859,13 @@ 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, 1011, __pyx_L16_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1016, __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_3; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1011, __pyx_L16_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1016, __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; @@ -27512,7 +27873,7 @@ 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, 1011, __pyx_L16_error) + __PYX_ERR(0, 1016, __pyx_L16_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -27522,22 +27883,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1016, __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) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1016, __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, 1016, __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, 1016, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_13); #endif __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1016, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); @@ -27545,7 +27906,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1016, __pyx_L16_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L20_unpacking_done; @@ -27553,38 +27914,38 @@ 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, 1016, __pyx_L16_error) __pyx_L20_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr25__pyx_v_lo, __pyx_t_12); + __Pyx_XDECREF_SET(__pyx_9genexpr26__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_9genexpr26__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_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1016, __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_INCREF(__pyx_9genexpr26__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr26__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_9genexpr26__pyx_v_lo) != (0)) __PYX_ERR(0, 1016, __pyx_L16_error); + __Pyx_INCREF(__pyx_9genexpr26__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr26__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_9genexpr26__pyx_v_hi) != (0)) __PYX_ERR(0, 1016, __pyx_L16_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1016, __pyx_L16_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_9genexpr26__pyx_v_hi); __pyx_9genexpr26__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_lo); __pyx_9genexpr26__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_9genexpr26__pyx_v_hi); __pyx_9genexpr26__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_lo); __pyx_9genexpr26__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_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __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_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1016, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -27593,9 +27954,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __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, 1016, __pyx_L11_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -27604,7 +27965,7 @@ 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, 1011, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1016, __pyx_L11_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -27614,7 +27975,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1016, __pyx_L11_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -27625,35 +27986,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1011, __pyx_L11_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1016, __pyx_L11_error) } else { __pyx_t_8 = __pyx_t_4(__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, 1011, __pyx_L11_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1016, __pyx_L11_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr24__pyx_v_p, __pyx_t_8); + __Pyx_XDECREF_SET(__pyx_9genexpr25__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) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr25__pyx_v_p))) __PYX_ERR(0, 1016, __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_9genexpr25__pyx_v_p); __pyx_9genexpr25__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_9genexpr25__pyx_v_p); __pyx_9genexpr25__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":1017 * # 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 +28022,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, 1017, __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 +28030,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, 1017, __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_3; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1012, __pyx_L27_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1017, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr26__pyx_v_p, __pyx_t_8); + __Pyx_XDECREF_SET(__pyx_9genexpr27__pyx_v_p, __pyx_t_8); __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}; + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr27__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) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1017, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_8); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 1012, __pyx_L27_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 1017, __pyx_L27_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_9genexpr27__pyx_v_p); __pyx_9genexpr27__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_9genexpr27__pyx_v_p); __pyx_9genexpr27__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":1018 * 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) # <<<<<<<<<<<<<< @@ -27720,7 +28081,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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_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, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_1 = NULL; @@ -27732,22 +28093,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1013, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __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); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1018, __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_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 1018, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_8 = 0; __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; - /* "constraint/constraints.py":997 + /* "constraint/constraints.py":1002 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -27773,16 +28134,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_9genexpr25__pyx_v_p); + __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_lo); + __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_hi); + __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_p); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":1015 +/* "constraint/constraints.py":1020 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -27830,39 +28191,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, 1020, __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, 1020, __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, 1020, __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, 1020, __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, 1020, __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, 1020, __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, 1020, __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, 1020, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27897,7 +28258,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_safe_product", 0); - /* "constraint/constraints.py":1016 + /* "constraint/constraints.py":1021 * * def _safe_product(self, values): * prod = 1 # <<<<<<<<<<<<<< @@ -27907,7 +28268,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":1022 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -27919,9 +28280,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, 1022, __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, 1022, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -27929,7 +28290,7 @@ 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, 1022, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -27939,7 +28300,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1022, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -27950,13 +28311,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, 1022, __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, 1022, __pyx_L1_error) PyErr_Clear(); } break; @@ -27966,19 +28327,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":1023 * 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, 1023, __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":1022 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -27988,7 +28349,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1019 + /* "constraint/constraints.py":1024 * for v in values: * prod *= v * return prod # <<<<<<<<<<<<<< @@ -28000,7 +28361,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = __pyx_v_prod; goto __pyx_L0; - /* "constraint/constraints.py":1015 + /* "constraint/constraints.py":1020 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -28022,7 +28383,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1021 +/* "constraint/constraints.py":1026 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -28073,50 +28434,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, 1026, __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, 1026, __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, 1026, __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, 1026, __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, 1026, __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, 1026, __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, 1026, __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, 1026, __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, 1026, __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, 1026, __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, 1026, __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, 1026, __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, 1026, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -28126,7 +28487,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, 1026, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -28137,9 +28498,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, 1026, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1026, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1026, __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 +28548,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1022 + /* "constraint/constraints.py":1027 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -28195,9 +28556,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, 1027, __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, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -28217,27 +28578,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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_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, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1023 + /* "constraint/constraints.py":1028 * 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, 1028, __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, 1028, __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":1029 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * target_dom = domains[self.target_var] * t_min = min(target_dom) # <<<<<<<<<<<<<< @@ -28253,29 +28614,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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_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, 1029, __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":1031 * 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, 1031, __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_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_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1031, __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_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1031, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -28284,7 +28645,7 @@ 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, 1026, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1031, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -28294,7 +28655,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1026, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1031, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -28305,13 +28666,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1026, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1031, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_7(__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, 1026, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1031, __pyx_L1_error) PyErr_Clear(); } break; @@ -28321,7 +28682,7 @@ 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":1032 * * for var in self.product_vars: * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) # <<<<<<<<<<<<<< @@ -28333,13 +28694,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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) + __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1032, __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) + 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, 1032, __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; __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, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { @@ -28348,7 +28709,7 @@ 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, 1032, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -28358,22 +28719,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1027, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1032, __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) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); } #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, 1032, __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_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #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, 1032, __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); @@ -28381,7 +28742,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 1032, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -28389,7 +28750,7 @@ 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, 1032, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_min_others, __pyx_t_3); @@ -28397,35 +28758,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_max_others, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1028 + /* "constraint/constraints.py":1033 * 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, 1033, __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":1034 * 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, 1034, __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_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_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1034, __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_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1034, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -28434,7 +28795,7 @@ 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, 1029, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1034, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -28444,7 +28805,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1029, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1034, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -28455,13 +28816,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_10; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1029, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1034, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_11(__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, 1029, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1034, __pyx_L1_error) PyErr_Clear(); } break; @@ -28471,29 +28832,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":1035 * 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, 1035, __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, 1035, __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, 1035, __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, 1035, __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, 1035, __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":1036 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if max(possible_prods) < t_min: # <<<<<<<<<<<<<< @@ -28509,16 +28870,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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_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, 1036, __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_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, 1036, __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_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1036, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_12) { - /* "constraint/constraints.py":1032 + /* "constraint/constraints.py":1037 * possible_prods = [val * min_others, val * max_others] * if max(possible_prods) < t_min: * dom.remove(val) # <<<<<<<<<<<<<< @@ -28532,12 +28893,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1032, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1031 + /* "constraint/constraints.py":1036 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if max(possible_prods) < t_min: # <<<<<<<<<<<<<< @@ -28546,7 +28907,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1029 + /* "constraint/constraints.py":1034 * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) * dom = domains[var] * for val in dom[:]: # <<<<<<<<<<<<<< @@ -28556,7 +28917,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1026 + /* "constraint/constraints.py":1031 * t_min = min(target_dom) * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -28566,7 +28927,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1021 + /* "constraint/constraints.py":1026 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -28599,7 +28960,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1034 +/* "constraint/constraints.py":1039 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -28650,53 +29011,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, 1039, __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, 1039, __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, 1039, __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, 1039, __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, 1039, __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, 1039, __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, 1039, __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, 1039, __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, 1039, __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, 1039, __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, 1039, __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, 1039, __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, 1039, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -28710,7 +29071,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, 1039, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -28721,8 +29082,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, 1039, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1039, __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 +29102,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___2generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":1070 +/* "constraint/constraints.py":1075 * 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 +29113,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_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_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_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_17_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1070, __pyx_L1_error) + __PYX_ERR(0, 1075, __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_17___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___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_VariableMinProdConstraint___call, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 1075, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -28790,9 +29151,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___2generator13(__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_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; @@ -28811,29 +29172,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, 1075, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1075, __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, 1075, __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, 1070, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1075, __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, 1075, __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, 1075, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1075, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = (!__pyx_t_4); if (__pyx_t_5) { @@ -28873,7 +29234,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1034 +/* "constraint/constraints.py":1039 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -28882,7 +29243,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_17___call__ *__pyx_cur_scope; PyObject *__pyx_v_assigned_prod = NULL; PyObject *__pyx_v_unassigned = NULL; PyObject *__pyx_v_var = NULL; @@ -28895,18 +29256,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_9genexpr28__pyx_v_v = NULL; + PyObject *__pyx_9genexpr29__pyx_v_p = NULL; + PyObject *__pyx_9genexpr30__pyx_v_lo = NULL; + PyObject *__pyx_9genexpr30__pyx_v_hi = NULL; + PyObject *__pyx_9genexpr31__pyx_v_c = 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_9genexpr33__pyx_v_v = NULL; + PyObject *__pyx_9genexpr34__pyx_v_p = NULL; + PyObject *__pyx_9genexpr35__pyx_v_lo = NULL; + PyObject *__pyx_9genexpr35__pyx_v_hi = NULL; + PyObject *__pyx_9genexpr36__pyx_v_o = NULL; + PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint_8__call___2generator13 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -28931,29 +29292,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_17___call__ *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_17___call__(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17___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_17___call__ *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1034, __pyx_L1_error) + __PYX_ERR(0, 1039, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/constraints.py":1035 + /* "constraint/constraints.py":1040 * * 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, 1040, __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, 1040, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":1036 + /* "constraint/constraints.py":1041 * 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 +29326,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1035 + /* "constraint/constraints.py":1040 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -28974,23 +29335,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1038 + /* "constraint/constraints.py":1043 * 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, 1043, __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, 1043, __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":1044 * * target_value = assignments[self.target_var] * assigned_prod = 1 # <<<<<<<<<<<<<< @@ -29000,35 +29361,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":1045 * 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, 1045, __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":1047 * 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, 1047, __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, 1047, __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, 1047, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -29037,7 +29398,7 @@ 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, 1047, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -29047,7 +29408,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1047, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -29058,13 +29419,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, 1047, __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, 1047, __pyx_L1_error) PyErr_Clear(); } break; @@ -29074,32 +29435,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":1048 * * 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, 1048, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":1044 + /* "constraint/constraints.py":1049 * 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, 1049, __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, 1049, __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":1048 * * for var in self.product_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -29109,7 +29470,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint goto __pyx_L6; } - /* "constraint/constraints.py":1046 + /* "constraint/constraints.py":1051 * assigned_prod *= assignments[var] * else: * unassigned.append(var) # <<<<<<<<<<<<<< @@ -29117,11 +29478,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, 1051, __pyx_L1_error) } __pyx_L6:; - /* "constraint/constraints.py":1042 + /* "constraint/constraints.py":1047 * unassigned = [] * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -29131,7 +29492,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1048 + /* "constraint/constraints.py":1053 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< @@ -29139,11 +29500,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * */ __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) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 1053, __pyx_L1_error) __pyx_t_8 = (!__pyx_t_2); if (__pyx_t_8) { - /* "constraint/constraints.py":1049 + /* "constraint/constraints.py":1054 * * if not unassigned: * return assigned_prod >= target_value # <<<<<<<<<<<<<< @@ -29151,12 +29512,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, 1054, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1048 + /* "constraint/constraints.py":1053 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< @@ -29165,7 +29526,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1052 + /* "constraint/constraints.py":1057 * * # Estimate min possible value of full product * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned] # <<<<<<<<<<<<<< @@ -29173,7 +29534,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, 1057, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0; @@ -29181,20 +29542,20 @@ 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, 1057, __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_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1052, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1057, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_9genexpr27__pyx_v_v, __pyx_t_3); + __Pyx_XDECREF_SET(__pyx_9genexpr28__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_t_11 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr28__pyx_v_v); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1057, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = 1; { @@ -29203,13 +29564,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1057, __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_t_13 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr28__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1057, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_12 = 1; { @@ -29218,32 +29579,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1057, __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_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1057, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_9); __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_9, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1057, __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_9, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1057, __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) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1057, __pyx_L11_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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_9genexpr28__pyx_v_v); __pyx_9genexpr28__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_9genexpr28__pyx_v_v); __pyx_9genexpr28__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":1058 * # 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,12 +29612,12 @@ 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, 1058, __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, 1058, __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_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1058, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __pyx_v_domain_bounds; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; @@ -29264,13 +29625,13 @@ 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, 1053, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1058, __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_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1053, __pyx_L23_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1058, __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,7 +29639,7 @@ 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, 1058, __pyx_L23_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -29288,22 +29649,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1058, __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) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1058, __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_13 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1058, __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_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1058, __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, 1058, __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); @@ -29311,7 +29672,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1058, __pyx_L23_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L27_unpacking_done; @@ -29319,38 +29680,38 @@ 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, 1058, __pyx_L23_error) __pyx_L27_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr29__pyx_v_lo, __pyx_t_13); + __Pyx_XDECREF_SET(__pyx_9genexpr30__pyx_v_lo, __pyx_t_13); __pyx_t_13 = 0; - __Pyx_XDECREF_SET(__pyx_9genexpr29__pyx_v_hi, __pyx_t_11); + __Pyx_XDECREF_SET(__pyx_9genexpr30__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, 1058, __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_9genexpr30__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr30__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_9genexpr30__pyx_v_lo) != (0)) __PYX_ERR(0, 1058, __pyx_L23_error); + __Pyx_INCREF(__pyx_9genexpr30__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr30__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_9genexpr30__pyx_v_hi) != (0)) __PYX_ERR(0, 1058, __pyx_L23_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1058, __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_9genexpr30__pyx_v_hi); __pyx_9genexpr30__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_lo); __pyx_9genexpr30__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_9genexpr30__pyx_v_hi); __pyx_9genexpr30__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_lo); __pyx_9genexpr30__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_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1058, __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_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1058, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -29359,9 +29720,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1058, __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, 1058, __pyx_L18_error) } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; for (;;) { @@ -29370,7 +29731,7 @@ 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, 1053, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1058, __pyx_L18_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -29380,7 +29741,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1058, __pyx_L18_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -29391,46 +29752,46 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1053, __pyx_L18_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1058, __pyx_L18_error) } else { __pyx_t_9 = __pyx_t_5(__pyx_t_10); 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, 1053, __pyx_L18_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1058, __pyx_L18_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_9genexpr28__pyx_v_p, __pyx_t_9); + __Pyx_XDECREF_SET(__pyx_9genexpr29__pyx_v_p, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_6 = __pyx_v_self; __Pyx_INCREF(__pyx_t_6); __pyx_t_12 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_9genexpr28__pyx_v_p}; + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_9genexpr29__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)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1053, __pyx_L18_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1058, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_9); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1053, __pyx_L18_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1058, __pyx_L18_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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_9genexpr29__pyx_v_p); __pyx_9genexpr29__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_9genexpr29__pyx_v_p); __pyx_9genexpr29__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":1059 * 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 +29799,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, 1059, __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 +29807,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, 1059, __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_4; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1054, __pyx_L34_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1059, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_9genexpr30__pyx_v_c, __pyx_t_9); + __Pyx_XDECREF_SET(__pyx_9genexpr31__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_t_9 = PyNumber_Multiply(__pyx_v_assigned_prod, __pyx_9genexpr31__pyx_v_c); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1059, __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) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1059, __pyx_L34_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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_9genexpr31__pyx_v_c); __pyx_9genexpr31__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_9genexpr31__pyx_v_c); __pyx_9genexpr31__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":1060 * 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: # <<<<<<<<<<<<<< @@ -29488,16 +29849,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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_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, 1060, __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_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, 1060, __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_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1060, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_8) { - /* "constraint/constraints.py":1056 + /* "constraint/constraints.py":1061 * possible_prods = [assigned_prod * c for c in candidates] * if max(possible_prods) < target_value: * return False # <<<<<<<<<<<<<< @@ -29509,7 +29870,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1055 + /* "constraint/constraints.py":1060 * 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,17 +29879,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1058 + /* "constraint/constraints.py":1063 * 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, 1063, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1059 + /* "constraint/constraints.py":1064 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< @@ -29541,18 +29902,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1059, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1064, __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_4; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1059, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1064, __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":1065 * if forwardcheck: * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] # <<<<<<<<<<<<<< @@ -29560,7 +29921,7 @@ 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, 1065, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_10); __pyx_t_16 = 0; @@ -29568,35 +29929,35 @@ 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, 1060, __pyx_L45_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1065, __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_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1060, __pyx_L45_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1065, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr31__pyx_v_v, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr32__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_9genexpr32__pyx_v_v, __pyx_v_var, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1065, __pyx_L45_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1065, __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_9genexpr32__pyx_v_v))) __PYX_ERR(0, 1065, __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_XDECREF(__pyx_9genexpr32__pyx_v_v); __pyx_9genexpr32__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_9genexpr32__pyx_v_v); __pyx_9genexpr32__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":1066 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< @@ -29604,10 +29965,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * 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) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_8 < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1062 + /* "constraint/constraints.py":1067 * 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,7 +29976,7 @@ 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, 1067, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __pyx_v_other_unassigned; __Pyx_INCREF(__pyx_t_10); __pyx_t_16 = 0; @@ -29623,20 +29984,20 @@ 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, 1062, __pyx_L54_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1067, __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_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1062, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1067, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr32__pyx_v_v, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr33__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_9genexpr33__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1067, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_12 = 1; { @@ -29645,13 +30006,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1067, __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_t_14 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr33__pyx_v_v); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1067, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_12 = 1; { @@ -29660,32 +30021,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1067, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1062, __pyx_L54_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1067, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_3); __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); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1067, __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_3, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 1067, __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) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1067, __pyx_L54_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_v); __pyx_9genexpr32__pyx_v_v = 0; + __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_v); __pyx_9genexpr33__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_9genexpr33__pyx_v_v); __pyx_9genexpr33__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":1068 * 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,12 +30054,12 @@ 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, 1068, __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_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1068, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_10); { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L66_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = __pyx_v_bounds; __Pyx_INCREF(__pyx_t_11); __pyx_t_16 = 0; @@ -29706,13 +30067,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1063, __pyx_L66_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1068, __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_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1063, __pyx_L66_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1068, __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,7 +30081,7 @@ 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, 1068, __pyx_L66_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -29730,22 +30091,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1068, __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) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1068, __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_14 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1068, __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_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1068, __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, 1068, __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); @@ -29753,7 +30114,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1068, __pyx_L66_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; goto __pyx_L70_unpacking_done; @@ -29761,38 +30122,38 @@ 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, 1068, __pyx_L66_error) __pyx_L70_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr34__pyx_v_lo, __pyx_t_14); + __Pyx_XDECREF_SET(__pyx_9genexpr35__pyx_v_lo, __pyx_t_14); __pyx_t_14 = 0; - __Pyx_XDECREF_SET(__pyx_9genexpr34__pyx_v_hi, __pyx_t_13); + __Pyx_XDECREF_SET(__pyx_9genexpr35__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, 1068, __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_9genexpr35__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr35__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_9genexpr35__pyx_v_lo) != (0)) __PYX_ERR(0, 1068, __pyx_L66_error); + __Pyx_INCREF(__pyx_9genexpr35__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr35__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_9genexpr35__pyx_v_hi) != (0)) __PYX_ERR(0, 1068, __pyx_L66_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1068, __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_XDECREF(__pyx_9genexpr35__pyx_v_hi); __pyx_9genexpr35__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_lo); __pyx_9genexpr35__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_9genexpr35__pyx_v_hi); __pyx_9genexpr35__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_lo); __pyx_9genexpr35__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_t_11 = PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1068, __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_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __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; @@ -29801,9 +30162,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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_t_16 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1068, __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_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L61_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -29812,7 +30173,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1063, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1068, __pyx_L61_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -29822,7 +30183,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1063, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1068, __pyx_L61_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -29833,46 +30194,46 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L61_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L61_error) } else { __pyx_t_3 = __pyx_t_5(__pyx_t_11); 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, 1063, __pyx_L61_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1068, __pyx_L61_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_9genexpr33__pyx_v_p, __pyx_t_3); + __Pyx_XDECREF_SET(__pyx_9genexpr34__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; { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr33__pyx_v_p}; + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr34__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) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_3); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1063, __pyx_L61_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1068, __pyx_L61_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_p); __pyx_9genexpr33__pyx_v_p = 0; + __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_p); __pyx_9genexpr34__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_9genexpr34__pyx_v_p); __pyx_9genexpr34__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":1066 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< @@ -29882,7 +30243,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint goto __pyx_L51; } - /* "constraint/constraints.py":1065 + /* "constraint/constraints.py":1070 * other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in bounds])] * else: * other_products = [1] # <<<<<<<<<<<<<< @@ -29890,45 +30251,45 @@ 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, 1070, __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, 1070, __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":1072 * 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, 1072, __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":1073 * * 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, 1073, __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_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_t_16 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1073, __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_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1073, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -29937,7 +30298,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1068, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1073, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -29947,7 +30308,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1068, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1073, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -29958,13 +30319,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1073, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_5(__pyx_t_11); 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, 1073, __pyx_L1_error) PyErr_Clear(); } break; @@ -29974,7 +30335,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":1074 * domain = domains[var] * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] # <<<<<<<<<<<<<< @@ -29982,7 +30343,7 @@ 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, 1074, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_v_other_products; __Pyx_INCREF(__pyx_t_3); __pyx_t_18 = 0; @@ -29990,52 +30351,52 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1069, __pyx_L79_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1074, __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_18; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1069, __pyx_L79_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1074, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_XDECREF_SET(__pyx_9genexpr35__pyx_v_o, __pyx_t_10); + __Pyx_XDECREF_SET(__pyx_9genexpr36__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_t_10 = PyNumber_Multiply(__pyx_v_assigned_prod, __pyx_v_val); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1074, __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) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_10, __pyx_9genexpr36__pyx_v_o); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1074, __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) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1074, __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_XDECREF(__pyx_9genexpr36__pyx_v_o); __pyx_9genexpr36__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_9genexpr36__pyx_v_o); __pyx_9genexpr36__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":1075 * 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, 1075, __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_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1075, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { - /* "constraint/constraints.py":1071 + /* "constraint/constraints.py":1076 * prods = [assigned_prod * val * o for o in other_products] * if all(p < target_value for p in prods): * domain.hideValue(val) # <<<<<<<<<<<<<< @@ -30049,12 +30410,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint 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_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1070 + /* "constraint/constraints.py":1075 * 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 +30424,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1068 + /* "constraint/constraints.py":1073 * * domain = domains[var] * for val in domain[:]: # <<<<<<<<<<<<<< @@ -30073,18 +30434,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "constraint/constraints.py":1072 + /* "constraint/constraints.py":1077 * 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, 1077, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_8); if (__pyx_t_2) { - /* "constraint/constraints.py":1073 + /* "constraint/constraints.py":1078 * domain.hideValue(val) * if not domain: * return False # <<<<<<<<<<<<<< @@ -30097,7 +30458,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1072 + /* "constraint/constraints.py":1077 * if all(p < target_value for p in prods): * domain.hideValue(val) * if not domain: # <<<<<<<<<<<<<< @@ -30106,7 +30467,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1059 + /* "constraint/constraints.py":1064 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< @@ -30116,7 +30477,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":1058 + /* "constraint/constraints.py":1063 * return False * * if forwardcheck: # <<<<<<<<<<<<<< @@ -30125,7 +30486,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1075 + /* "constraint/constraints.py":1080 * return False * * return True # <<<<<<<<<<<<<< @@ -30137,7 +30498,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1034 + /* "constraint/constraints.py":1039 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -30171,25 +30532,25 @@ 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_9genexpr28__pyx_v_v); + __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_p); + __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_lo); + __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_hi); + __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_c); __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_9genexpr33__pyx_v_v); + __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_p); + __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_lo); + __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_hi); + __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_o); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint_8__call___2generator13); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":1089 +/* "constraint/constraints.py":1094 * """ * * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -30238,39 +30599,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, 1094, __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, 1094, __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, 1094, __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, 1094, __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, 1094, __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, 1094, __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, 1094, __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, 1094, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -30294,21 +30655,34 @@ 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":1100 * 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, 1100, __pyx_L1_error) + + /* "constraint/constraints.py":1101 + * """ + * 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, 1101, __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) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1089 + /* "constraint/constraints.py":1094 * """ * * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -30320,6 +30694,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 +30703,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ return __pyx_r; } -/* "constraint/constraints.py":1097 - * self._maxprod = maxprod +/* "constraint/constraints.py":1103 + * 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 +30754,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, 1103, __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, 1103, __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, 1103, __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, 1103, __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, 1103, __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, 1103, __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, 1103, __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, 1103, __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, 1103, __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, 1103, __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, 1103, __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, 1103, __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, 1103, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -30432,7 +30807,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, 1103, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -30443,9 +30818,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, 1103, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1103, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1103, __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 +30839,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_2generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":1104 +/* "constraint/constraints.py":1110 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -30475,18 +30850,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_19_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_19_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_19_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19_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_19_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1104, __pyx_L1_error) + __PYX_ERR(0, 1110, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -30494,7 +30869,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_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_MaxProdConstraint_preProcess_loc, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 1110, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -30510,9 +30885,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_2generator14(__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_19_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -30531,16 +30906,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, 1110, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1110, __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, 1110, __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, 1110, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -30548,7 +30923,7 @@ 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, 1110, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -30558,7 +30933,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr { 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, 1110, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -30569,13 +30944,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, 1110, __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, 1110, __pyx_L1_error) PyErr_Clear(); } break; @@ -30586,8 +30961,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, 1110, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_XDECREF(__pyx_r); @@ -30626,8 +31001,8 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr return __pyx_r; } -/* "constraint/constraints.py":1097 - * self._maxprod = maxprod +/* "constraint/constraints.py":1103 + * 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 +31016,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_2generator14 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -30663,7 +31038,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1098 + /* "constraint/constraints.py":1104 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -30671,9 +31046,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, 1104, __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, 1104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -30693,24 +31068,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __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_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, 1104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1101 + /* "constraint/constraints.py":1107 * * # 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, 1107, __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, 1107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1102 + /* "constraint/constraints.py":1108 * # 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 +31095,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":1109 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -30732,9 +31107,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, 1109, __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, 1109, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -30742,7 +31117,7 @@ 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, 1109, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -30752,7 +31127,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 1109, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -30763,13 +31138,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, 1109, __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, 1109, __pyx_L1_error) PyErr_Clear(); } break; @@ -30779,37 +31154,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":1110 * 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, 1110, __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, 1110, __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, 1110, __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":1111 * 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, 1111, __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, 1111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1103 + /* "constraint/constraints.py":1109 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -30819,7 +31194,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":1112 * 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): # <<<<<<<<<<<<<< @@ -30829,7 +31204,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __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_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, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; { @@ -30838,7 +31213,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __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, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -30846,9 +31221,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, 1112, __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, 1112, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -30857,7 +31232,7 @@ 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, 1112, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -30867,7 +31242,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 1112, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -30878,13 +31253,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, 1112, __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, 1112, __pyx_L1_error) PyErr_Clear(); } break; @@ -30897,7 +31272,7 @@ 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, 1112, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -30907,22 +31282,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1106, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __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) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1112, __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, 1106, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __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, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1112, __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, 1106, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1112, __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); @@ -30930,7 +31305,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __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; __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1106, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1112, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_unpacking_done; @@ -30938,7 +31313,7 @@ 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, 1112, __pyx_L1_error) __pyx_L9_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); @@ -30946,7 +31321,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1107 + /* "constraint/constraints.py":1113 * 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 +31331,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":1114 * 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 +31341,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":1116 * if variable_with_lt1 is not None: * # if more than one associated variables contain less than 1, we can't prune * return # <<<<<<<<<<<<<< @@ -30978,7 +31353,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":1114 * 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 +31362,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":1111 + /* "constraint/constraints.py":1117 * # if more than one associated variables contain less than 1, we can't prune * return * variable_with_lt1 = variable # <<<<<<<<<<<<<< @@ -30997,7 +31372,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":1113 * 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 +31381,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":1106 + /* "constraint/constraints.py":1112 * 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 +31391,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":1120 * * # 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, 1120, __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":1121 * # prune the associated variables of values > maxprod * maxprod = self._maxprod * for variable in variables: # <<<<<<<<<<<<<< @@ -31040,9 +31415,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, 1121, __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, 1121, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -31050,7 +31425,7 @@ 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, 1121, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -31060,7 +31435,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 1121, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -31071,13 +31446,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, 1121, __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, 1121, __pyx_L1_error) PyErr_Clear(); } break; @@ -31087,7 +31462,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":1122 * maxprod = self._maxprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -31100,14 +31475,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, 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_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":1123 * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: * continue # <<<<<<<<<<<<<< @@ -31116,7 +31491,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ goto __pyx_L13_continue; - /* "constraint/constraints.py":1116 + /* "constraint/constraints.py":1122 * maxprod = self._maxprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -31125,35 +31500,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":1118 + /* "constraint/constraints.py":1124 * 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, 1124, __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":1125 * 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, 1125, __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_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_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1125, __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_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1125, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -31162,7 +31537,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 1119, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1125, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -31172,7 +31547,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 1119, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1125, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -31183,13 +31558,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_13; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1119, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1125, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_14(__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, 1119, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1125, __pyx_L1_error) PyErr_Clear(); } break; @@ -31199,19 +31574,19 @@ 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":1126 * 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, 1126, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { - /* "constraint/constraints.py":1121 + /* "constraint/constraints.py":1127 * for value in domain[:]: * if value > maxprod: * domain.remove(value) # <<<<<<<<<<<<<< @@ -31225,12 +31600,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro 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) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1120 + /* "constraint/constraints.py":1126 * domain = domains[variable] * for value in domain[:]: * if value > maxprod: # <<<<<<<<<<<<<< @@ -31240,27 +31615,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro goto __pyx_L20; } - /* "constraint/constraints.py":1122 + /* "constraint/constraints.py":1128 * 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, 1128, __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, 1128, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1128, __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":1129 * domain.remove(value) * elif value == 0 and maxprod < 0: * domain.remove(value) # <<<<<<<<<<<<<< @@ -31274,12 +31649,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro 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) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1122 + /* "constraint/constraints.py":1128 * if value > maxprod: * domain.remove(value) * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< @@ -31289,7 +31664,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __pyx_L20:; - /* "constraint/constraints.py":1119 + /* "constraint/constraints.py":1125 * continue * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -31299,7 +31674,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1115 + /* "constraint/constraints.py":1121 * # prune the associated variables of values > maxprod * maxprod = self._maxprod * for variable in variables: # <<<<<<<<<<<<<< @@ -31310,8 +31685,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":1103 + * 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 +31711,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_2generator14); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":1125 +/* "constraint/constraints.py":1131 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -31393,53 +31768,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, 1131, __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, 1131, __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, 1131, __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, 1131, __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, 1131, __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, 1131, __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, 1131, __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, 1131, __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, 1131, __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, 1131, __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, 1131, __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, 1131, __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, 1131, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -31453,7 +31828,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, 1131, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -31464,8 +31839,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, 1131, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1131, __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 +31859,175 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call___2generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "constraint/constraints.py":1139 + * 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_20_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_20_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_20_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + 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, 1139, __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___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_MaxProdConstraint___call___local, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 1139, __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___2generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_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, 1139, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1139, __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, 1139, __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, 1139, __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, 1139, __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, 1139, __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, 1139, __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, 1139, __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, 1139, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1139, __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":1131 + * 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 +32038,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___2generator15 = 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":1132 * * 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, 1132, __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":1133 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * maxprod = self._maxprod * prod = 1 # <<<<<<<<<<<<<< @@ -31537,93 +32082,207 @@ 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":1134 * 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":1135 * 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, 1135, __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":1137 + * 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, 1137, __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, 1137, __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, 1137, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_2 != __pyx_t_3); + if (__pyx_t_4) { + + /* "constraint/constraints.py":1138 + * # 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, 1138, __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, 1138, __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, 1138, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + ++__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, 1138, __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, 1138, __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, 1138, __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":1139 + * 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, 1139, __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, 1139, __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, 1139, __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, 1139, __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, 1139, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "constraint/constraints.py":1138 + * # 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":1137 * 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":1140 + * 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_t_7 = 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_6 = __pyx_builtin_zip; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __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_8}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __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_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __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, 1140, __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, 1140, __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, 1140, __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_GetItemRef(__pyx_t_6, __pyx_t_3); + ++__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, 1140, __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, 1140, __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, 1140, __pyx_L1_error) PyErr_Clear(); } break; @@ -31636,91 +32295,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, 1140, __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_8 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_8); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_7); } 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_8 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1140, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1140, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); } #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_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); #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, 1140, __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_8 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L9_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + index = 1; __pyx_t_7 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_7)) goto __pyx_L9_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1140, __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, 1140, __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_8); + __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/constraints.py":1131 - * missing_lt1 = [] + /* "constraint/constraints.py":1141 + * 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, 1141, __pyx_L1_error) + if (__pyx_t_4) { - /* "constraint/constraints.py":1132 + /* "constraint/constraints.py":1142 * 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, 1142, __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_7 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __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_7); + __pyx_t_7 = 0; - /* "constraint/constraints.py":1131 - * missing_lt1 = [] + /* "constraint/constraints.py":1141 + * 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":1144 * prod *= assignments[variable] * else: * missing = True # <<<<<<<<<<<<<< @@ -31730,26 +32389,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call /*else*/ { __pyx_v_missing = 1; - /* "constraint/constraints.py":1135 + /* "constraint/constraints.py":1145 * 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, 1145, __pyx_L1_error) + if (__pyx_t_4) { - /* "constraint/constraints.py":1136 + /* "constraint/constraints.py":1146 * 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, 1146, __pyx_L1_error) - /* "constraint/constraints.py":1135 + /* "constraint/constraints.py":1145 * else: * missing = True * if contains_lt1: # <<<<<<<<<<<<<< @@ -31758,51 +32417,51 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } } - __pyx_L7:; + __pyx_L11:; - /* "constraint/constraints.py":1130 - * missing = False - * missing_lt1 = [] + /* "constraint/constraints.py":1140 + * 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":1147 * 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":1148 * 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_t_7 = NULL; __Pyx_INCREF(__pyx_builtin_round); __pyx_t_1 = __pyx_builtin_round; - __pyx_t_5 = 1; + __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; + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_prod, __pyx_mstate_global->__pyx_int_10}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __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_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1138, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1148, __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":1147 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -31811,34 +32470,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1139 + /* "constraint/constraints.py":1149 * 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, 1149, __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, 1149, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1149, __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":1150 * prod = round(prod, 10) * if (not missing or len(missing_lt1) == 0) and prod > maxprod: * return False # <<<<<<<<<<<<<< @@ -31850,7 +32509,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1139 + /* "constraint/constraints.py":1149 * if isinstance(prod, float): * prod = round(prod, 10) * if (not missing or len(missing_lt1) == 0) and prod > maxprod: # <<<<<<<<<<<<<< @@ -31859,17 +32518,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1141 + /* "constraint/constraints.py":1151 * 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, 1151, __pyx_L1_error) + if (__pyx_t_4) { - /* "constraint/constraints.py":1142 + /* "constraint/constraints.py":1152 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -31877,48 +32536,48 @@ 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, 1152, __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, 1152, __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, 1152, __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_GetItemRef(__pyx_t_6, __pyx_t_3); + ++__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, 1152, __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, 1142, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1152, __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, 1142, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1152, __pyx_L1_error) PyErr_Clear(); } break; @@ -31928,96 +32587,96 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1143 + /* "constraint/constraints.py":1153 * 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, 1153, __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, 1153, __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, 1153, __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":1154 * 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_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1145 + /* "constraint/constraints.py":1155 * 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_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, 1155, __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_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); + __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_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1155, __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(PyList_CheckExact(__pyx_t_7))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + 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, 1145, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1155, __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_1 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_2); + ++__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_7); #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, 1155, __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_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_2)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_7, __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_1)) __PYX_ERR(0, 1155, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_14(__pyx_t_2); + __pyx_t_1 = __pyx_t_14(__pyx_t_7); 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, 1145, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1155, __pyx_L1_error) PyErr_Clear(); } break; @@ -32027,22 +32686,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1146 + /* "constraint/constraints.py":1156 * 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_t_1 = PyNumber_Multiply(__pyx_v_prod, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1156, __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_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_v_maxprod, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1156, __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_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1156, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_4) { - /* "constraint/constraints.py":1147 + /* "constraint/constraints.py":1157 * for value in domain[:]: * if prod * value > maxprod: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -32051,17 +32710,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ __pyx_t_1 = __pyx_v_domain; __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = 0; + __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_t_8 = __Pyx_PyObject_FastCallMethod(__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_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1157, __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":1146 + /* "constraint/constraints.py":1156 * domain = domains[variable] * for value in domain[:]: * if prod * value > maxprod: # <<<<<<<<<<<<<< @@ -32070,7 +32729,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1145 + /* "constraint/constraints.py":1155 * 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 +32737,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_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1148 + /* "constraint/constraints.py":1158 * 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, 1158, __pyx_L1_error) + __pyx_t_13 = (!__pyx_t_4); + if (__pyx_t_13) { - /* "constraint/constraints.py":1149 + /* "constraint/constraints.py":1159 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -32101,10 +32760,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":1158 * if prod * value > maxprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -32113,7 +32772,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1143 + /* "constraint/constraints.py":1153 * if forwardcheck: * for variable in variables: * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): # <<<<<<<<<<<<<< @@ -32122,7 +32781,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1142 + /* "constraint/constraints.py":1152 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -32130,9 +32789,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":1151 * if (not missing or len(missing_lt1) == 0) and prod > maxprod: * return False * if forwardcheck: # <<<<<<<<<<<<<< @@ -32141,7 +32800,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1150 + /* "constraint/constraints.py":1160 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -32153,7 +32812,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1125 + /* "constraint/constraints.py":1131 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -32164,10 +32823,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 +32837,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___2generator15); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":1164 +/* "constraint/constraints.py":1174 * """ # noqa: E501 * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -32232,38 +32892,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, 1174, __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, 1174, __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, 1174, __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, 1174, __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, 1174, __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, 1174, __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, 1174, __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, 1174, __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, 1174, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_target_var = ((PyObject*)values[1]); @@ -32271,7 +32931,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, 1174, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -32282,7 +32942,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, 1174, __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 +32970,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1165 + /* "constraint/constraints.py":1175 * * 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, 1175, __pyx_L1_error) - /* "constraint/constraints.py":1166 + /* "constraint/constraints.py":1176 * 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, 1176, __pyx_L1_error) - /* "constraint/constraints.py":1164 + /* "constraint/constraints.py":1174 * """ # noqa: E501 * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -32348,7 +33008,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1168 +/* "constraint/constraints.py":1178 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -32397,41 +33057,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, 1178, __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, 1178, __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, 1178, __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, 1178, __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, 1178, __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, 1178, __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, 1178, __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, 1178, __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, 1178, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -32443,7 +33103,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, 1178, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -32470,10 +33130,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_9genexpr41__pyx_v_lo = NULL; + PyObject *__pyx_9genexpr41__pyx_v_hi = NULL; + PyObject *__pyx_9genexpr42__pyx_v_p = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -32496,35 +33156,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":1179 * * 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, 1179, __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":1180 * 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, 1180, __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, 1180, __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, 1180, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -32533,7 +33193,7 @@ 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, 1180, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -32543,7 +33203,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1180, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -32554,13 +33214,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, 1180, __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, 1180, __pyx_L1_error) PyErr_Clear(); } break; @@ -32570,19 +33230,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":1181 * 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, 1181, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1172 + /* "constraint/constraints.py":1182 * for var in self.product_vars: * if var == exclude_var: * continue # <<<<<<<<<<<<<< @@ -32591,7 +33251,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ goto __pyx_L3_continue; - /* "constraint/constraints.py":1171 + /* "constraint/constraints.py":1181 * bounds = [] * for var in self.product_vars: * if var == exclude_var: # <<<<<<<<<<<<<< @@ -32600,30 +33260,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1173 + /* "constraint/constraints.py":1183 * 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, 1183, __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":1184 * 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, 1184, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { - /* "constraint/constraints.py":1175 + /* "constraint/constraints.py":1185 * dom = domain_dict[var] * if not dom: * continue # <<<<<<<<<<<<<< @@ -32632,7 +33292,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ goto __pyx_L3_continue; - /* "constraint/constraints.py":1174 + /* "constraint/constraints.py":1184 * continue * dom = domain_dict[var] * if not dom: # <<<<<<<<<<<<<< @@ -32641,7 +33301,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1176 + /* "constraint/constraints.py":1186 * if not dom: * continue * bounds.append((min(dom), max(dom))) # <<<<<<<<<<<<<< @@ -32657,7 +33317,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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_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, 1186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_7 = NULL; @@ -32669,21 +33329,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1176, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __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); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1186, __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_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 1186, __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_t_11 = __Pyx_PyList_Append(__pyx_v_bounds, __pyx_t_10); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "constraint/constraints.py":1170 + /* "constraint/constraints.py":1180 * def _get_product_bounds(self, domain_dict, exclude_var=None): * bounds = [] * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -32694,7 +33354,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1178 + /* "constraint/constraints.py":1188 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< @@ -32702,11 +33362,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * */ __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) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_6 < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_6); if (__pyx_t_5) { - /* "constraint/constraints.py":1179 + /* "constraint/constraints.py":1189 * * if not bounds: * return 1, 1 # <<<<<<<<<<<<<< @@ -32718,7 +33378,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":1188 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< @@ -32727,7 +33387,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1182 + /* "constraint/constraints.py":1192 * * # Try all corner combinations * candidates = [p for p in product(*[(lo, hi) for lo, hi in bounds])] # <<<<<<<<<<<<<< @@ -32735,12 +33395,12 @@ 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, 1192, __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_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1192, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); { /* enter inner scope */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L16_error) + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1192, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __pyx_v_bounds; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; @@ -32748,13 +33408,13 @@ 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, 1182, __pyx_L16_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1192, __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_3; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1182, __pyx_L16_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1192, __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; @@ -32762,7 +33422,7 @@ 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, 1182, __pyx_L16_error) + __PYX_ERR(0, 1192, __pyx_L16_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -32772,22 +33432,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1192, __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) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1192, __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, 1192, __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, 1192, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_13); #endif __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1192, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); @@ -32795,7 +33455,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1192, __pyx_L16_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L20_unpacking_done; @@ -32803,38 +33463,38 @@ 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, 1192, __pyx_L16_error) __pyx_L20_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr39__pyx_v_lo, __pyx_t_12); + __Pyx_XDECREF_SET(__pyx_9genexpr41__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_9genexpr41__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_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1192, __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_INCREF(__pyx_9genexpr41__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr41__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_9genexpr41__pyx_v_lo) != (0)) __PYX_ERR(0, 1192, __pyx_L16_error); + __Pyx_INCREF(__pyx_9genexpr41__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr41__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_9genexpr41__pyx_v_hi) != (0)) __PYX_ERR(0, 1192, __pyx_L16_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1192, __pyx_L16_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_9genexpr41__pyx_v_hi); __pyx_9genexpr41__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_lo); __pyx_9genexpr41__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_9genexpr41__pyx_v_hi); __pyx_9genexpr41__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_lo); __pyx_9genexpr41__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_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __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_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1192, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -32843,9 +33503,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __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, 1192, __pyx_L11_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -32854,7 +33514,7 @@ 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, 1182, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1192, __pyx_L11_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -32864,7 +33524,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1192, __pyx_L11_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -32875,35 +33535,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L11_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1192, __pyx_L11_error) } else { __pyx_t_8 = __pyx_t_4(__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, 1182, __pyx_L11_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1192, __pyx_L11_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr38__pyx_v_p, __pyx_t_8); + __Pyx_XDECREF_SET(__pyx_9genexpr40__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) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr40__pyx_v_p))) __PYX_ERR(0, 1192, __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_9genexpr40__pyx_v_p); __pyx_9genexpr40__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_9genexpr40__pyx_v_p); __pyx_9genexpr40__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":1193 * # 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 +33571,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, 1193, __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 +33579,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, 1193, __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_3; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1183, __pyx_L27_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1193, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr40__pyx_v_p, __pyx_t_8); + __Pyx_XDECREF_SET(__pyx_9genexpr42__pyx_v_p, __pyx_t_8); __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}; + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr42__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) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1193, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_8); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 1183, __pyx_L27_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 1193, __pyx_L27_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_9genexpr42__pyx_v_p); __pyx_9genexpr42__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_9genexpr42__pyx_v_p); __pyx_9genexpr42__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":1194 * 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) # <<<<<<<<<<<<<< @@ -32970,7 +33630,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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_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, 1194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_1 = NULL; @@ -32982,22 +33642,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1184, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __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); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1194, __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_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 1194, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_8 = 0; __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1168 + /* "constraint/constraints.py":1178 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -33023,16 +33683,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_9genexpr41__pyx_v_lo); + __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_hi); + __Pyx_XDECREF(__pyx_9genexpr42__pyx_v_p); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":1186 +/* "constraint/constraints.py":1196 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -33080,39 +33740,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, 1196, __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, 1196, __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, 1196, __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, 1196, __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, 1196, __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, 1196, __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, 1196, __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, 1196, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -33147,7 +33807,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_safe_product", 0); - /* "constraint/constraints.py":1187 + /* "constraint/constraints.py":1197 * * def _safe_product(self, values): * prod = 1 # <<<<<<<<<<<<<< @@ -33157,7 +33817,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":1198 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -33169,9 +33829,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, 1198, __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, 1198, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -33179,7 +33839,7 @@ 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, 1198, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -33189,7 +33849,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1198, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -33200,13 +33860,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, 1198, __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, 1198, __pyx_L1_error) PyErr_Clear(); } break; @@ -33216,19 +33876,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":1199 * 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, 1199, __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":1198 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -33238,7 +33898,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1190 + /* "constraint/constraints.py":1200 * for v in values: * prod *= v * return prod # <<<<<<<<<<<<<< @@ -33250,7 +33910,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = __pyx_v_prod; goto __pyx_L0; - /* "constraint/constraints.py":1186 + /* "constraint/constraints.py":1196 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -33272,7 +33932,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1192 +/* "constraint/constraints.py":1202 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -33323,50 +33983,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, 1202, __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, 1202, __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, 1202, __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, 1202, __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, 1202, __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, 1202, __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, 1202, __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, 1202, __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, 1202, __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, 1202, __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, 1202, __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, 1202, __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, 1202, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -33376,7 +34036,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, 1202, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -33387,9 +34047,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, 1202, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1202, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1202, __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 +34097,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1193 + /* "constraint/constraints.py":1203 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -33445,9 +34105,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, 1203, __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, 1203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -33467,27 +34127,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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_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, 1203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1194 + /* "constraint/constraints.py":1204 * 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, 1204, __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, 1204, __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":1205 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * target_dom = domains[self.target_var] * t_max = max(target_dom) # <<<<<<<<<<<<<< @@ -33503,29 +34163,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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_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, 1205, __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":1207 * 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, 1207, __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_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_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1207, __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_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1207, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -33534,7 +34194,7 @@ 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, 1197, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1207, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -33544,7 +34204,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1197, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1207, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -33555,13 +34215,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1197, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1207, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_7(__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, 1197, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1207, __pyx_L1_error) PyErr_Clear(); } break; @@ -33571,7 +34231,7 @@ 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":1208 * * for var in self.product_vars: * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) # <<<<<<<<<<<<<< @@ -33583,13 +34243,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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) + __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1208, __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) + 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, 1208, __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; __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, 1208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { @@ -33598,7 +34258,7 @@ 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, 1208, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -33608,22 +34268,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1198, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1208, __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) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1208, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); } #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, 1208, __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_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #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, 1208, __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); @@ -33631,7 +34291,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 1208, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -33639,7 +34299,7 @@ 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, 1208, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_min_others, __pyx_t_3); @@ -33647,35 +34307,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_max_others, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1199 + /* "constraint/constraints.py":1209 * 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, 1209, __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":1210 * 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, 1210, __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_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_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __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_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1210, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -33684,7 +34344,7 @@ 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, 1200, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1210, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -33694,7 +34354,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1200, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1210, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -33705,13 +34365,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_10; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1200, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1210, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_11(__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, 1200, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1210, __pyx_L1_error) PyErr_Clear(); } break; @@ -33721,29 +34381,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":1211 * 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, 1211, __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, 1211, __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, 1211, __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, 1211, __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, 1211, __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":1212 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if min(possible_prods) > t_max: # <<<<<<<<<<<<<< @@ -33759,16 +34419,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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_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, 1212, __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_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, 1212, __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_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_12) { - /* "constraint/constraints.py":1203 + /* "constraint/constraints.py":1213 * possible_prods = [val * min_others, val * max_others] * if min(possible_prods) > t_max: * dom.remove(val) # <<<<<<<<<<<<<< @@ -33782,12 +34442,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1203, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1202 + /* "constraint/constraints.py":1212 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if min(possible_prods) > t_max: # <<<<<<<<<<<<<< @@ -33796,7 +34456,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1200 + /* "constraint/constraints.py":1210 * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) * dom = domains[var] * for val in dom[:]: # <<<<<<<<<<<<<< @@ -33806,7 +34466,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1197 + /* "constraint/constraints.py":1207 * t_max = max(target_dom) * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -33816,7 +34476,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1192 + /* "constraint/constraints.py":1202 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -33849,7 +34509,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1205 +/* "constraint/constraints.py":1215 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -33900,53 +34560,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, 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, 1205, __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, 1205, __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, 1205, __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, 1205, __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, 1205, __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, "__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, 1215, __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, 1215, __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, 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, 1205, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __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, 1205, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __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, 1205, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1215, __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, 1215, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -33960,7 +34620,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, 1215, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -33971,8 +34631,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, 1215, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1215, __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 */ @@ -33991,9 +34651,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint_8__call___2generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint_8__call___2generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":1241 +/* "constraint/constraints.py":1251 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p > target_value for p in prods): # <<<<<<<<<<<<<< @@ -34002,29 +34662,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint */ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint_8__call___genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *__pyx_cur_scope; + 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_20_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_20_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __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_20_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1241, __pyx_L1_error) + __PYX_ERR(0, 1251, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *) __pyx_self; + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___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_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___2generator16, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16]), (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, 1251, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -34040,9 +34700,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint_8__call___2generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint_8__call___2generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *)__pyx_generator->closure); + 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; @@ -34061,29 +34721,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, 1251, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1251, __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, 1251, __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, 1241, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1251, __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, 1251, __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, 1251, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = (!__pyx_t_4); if (__pyx_t_5) { @@ -34123,7 +34783,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1205 +/* "constraint/constraints.py":1215 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -34132,7 +34792,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint */ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint_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_19___call__ *__pyx_cur_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__ *__pyx_cur_scope; PyObject *__pyx_v_assigned_prod = NULL; PyObject *__pyx_v_unassigned = NULL; PyObject *__pyx_v_var = NULL; @@ -34145,18 +34805,18 @@ 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_gb_10constraint_11constraints_25VariableMaxProdConstraint_8__call___2generator14 = 0; + PyObject *__pyx_9genexpr43__pyx_v_v = NULL; + PyObject *__pyx_9genexpr44__pyx_v_p = NULL; + PyObject *__pyx_9genexpr45__pyx_v_lo = NULL; + PyObject *__pyx_9genexpr45__pyx_v_hi = NULL; + PyObject *__pyx_9genexpr46__pyx_v_c = NULL; + PyObject *__pyx_9genexpr47__pyx_v_v = NULL; + PyObject *__pyx_9genexpr48__pyx_v_v = NULL; + PyObject *__pyx_9genexpr49__pyx_v_p = NULL; + PyObject *__pyx_9genexpr50__pyx_v_lo = NULL; + PyObject *__pyx_9genexpr50__pyx_v_hi = NULL; + PyObject *__pyx_9genexpr51__pyx_v_o = NULL; + PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint_8__call___2generator16 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -34181,29 +34841,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_19___call__(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__ *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_21___call__(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21___call__, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__ *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1205, __pyx_L1_error) + __PYX_ERR(0, 1215, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/constraints.py":1206 + /* "constraint/constraints.py":1216 * * 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, 1216, __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, 1216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":1207 + /* "constraint/constraints.py":1217 * 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 +34875,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1206 + /* "constraint/constraints.py":1216 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -34224,23 +34884,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1209 + /* "constraint/constraints.py":1219 * 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, 1219, __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, 1219, __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":1220 * * target_value = assignments[self.target_var] * assigned_prod = 1 # <<<<<<<<<<<<<< @@ -34250,35 +34910,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":1221 * 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, 1221, __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":1223 * 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, 1223, __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, 1223, __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, 1223, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -34287,7 +34947,7 @@ 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, 1223, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -34297,7 +34957,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1223, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -34308,13 +34968,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, 1223, __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, 1223, __pyx_L1_error) PyErr_Clear(); } break; @@ -34324,32 +34984,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":1224 * * 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, 1224, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":1215 + /* "constraint/constraints.py":1225 * 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, 1225, __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, 1225, __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":1224 * * for var in self.product_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -34359,7 +35019,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint goto __pyx_L6; } - /* "constraint/constraints.py":1217 + /* "constraint/constraints.py":1227 * assigned_prod *= assignments[var] * else: * unassigned.append(var) # <<<<<<<<<<<<<< @@ -34367,11 +35027,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, 1227, __pyx_L1_error) } __pyx_L6:; - /* "constraint/constraints.py":1213 + /* "constraint/constraints.py":1223 * unassigned = [] * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -34381,7 +35041,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1219 + /* "constraint/constraints.py":1229 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< @@ -34389,11 +35049,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * */ __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) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 1229, __pyx_L1_error) __pyx_t_8 = (!__pyx_t_2); if (__pyx_t_8) { - /* "constraint/constraints.py":1220 + /* "constraint/constraints.py":1230 * * if not unassigned: * return assigned_prod <= target_value # <<<<<<<<<<<<<< @@ -34401,12 +35061,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, 1230, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1219 + /* "constraint/constraints.py":1229 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< @@ -34415,7 +35075,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1223 + /* "constraint/constraints.py":1233 * * # Estimate max possible value of full product * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned] # <<<<<<<<<<<<<< @@ -34423,7 +35083,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, 1233, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0; @@ -34431,20 +35091,20 @@ 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, 1233, __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_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1223, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1233, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_9genexpr41__pyx_v_v, __pyx_t_3); + __Pyx_XDECREF_SET(__pyx_9genexpr43__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_t_11 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr43__pyx_v_v); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1233, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = 1; { @@ -34453,13 +35113,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1233, __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_t_13 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr43__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1233, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_12 = 1; { @@ -34468,32 +35128,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1233, __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_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1233, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_9); __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_9, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1233, __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_9, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1233, __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) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1233, __pyx_L11_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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_9genexpr43__pyx_v_v); __pyx_9genexpr43__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_9genexpr43__pyx_v_v); __pyx_9genexpr43__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":1234 * # 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,12 +35161,12 @@ 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, 1234, __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, 1234, __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_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1234, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __pyx_v_domain_bounds; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; @@ -34514,13 +35174,13 @@ 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, 1224, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1234, __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_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1224, __pyx_L23_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1234, __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,7 +35188,7 @@ 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, 1234, __pyx_L23_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -34538,22 +35198,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1234, __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) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1234, __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_13 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1234, __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_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1234, __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, 1234, __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); @@ -34561,7 +35221,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1234, __pyx_L23_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L27_unpacking_done; @@ -34569,38 +35229,38 @@ 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, 1234, __pyx_L23_error) __pyx_L27_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr43__pyx_v_lo, __pyx_t_13); + __Pyx_XDECREF_SET(__pyx_9genexpr45__pyx_v_lo, __pyx_t_13); __pyx_t_13 = 0; - __Pyx_XDECREF_SET(__pyx_9genexpr43__pyx_v_hi, __pyx_t_11); + __Pyx_XDECREF_SET(__pyx_9genexpr45__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, 1234, __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_9genexpr45__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr45__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_9genexpr45__pyx_v_lo) != (0)) __PYX_ERR(0, 1234, __pyx_L23_error); + __Pyx_INCREF(__pyx_9genexpr45__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr45__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_9genexpr45__pyx_v_hi) != (0)) __PYX_ERR(0, 1234, __pyx_L23_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1234, __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_9genexpr45__pyx_v_hi); __pyx_9genexpr45__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_lo); __pyx_9genexpr45__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_9genexpr45__pyx_v_hi); __pyx_9genexpr45__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_lo); __pyx_9genexpr45__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_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1234, __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_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1234, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -34609,9 +35269,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1234, __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, 1234, __pyx_L18_error) } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; for (;;) { @@ -34620,7 +35280,7 @@ 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, 1224, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1234, __pyx_L18_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -34630,7 +35290,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1234, __pyx_L18_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -34641,46 +35301,46 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1224, __pyx_L18_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1234, __pyx_L18_error) } else { __pyx_t_9 = __pyx_t_5(__pyx_t_10); 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, 1224, __pyx_L18_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1234, __pyx_L18_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_9genexpr42__pyx_v_p, __pyx_t_9); + __Pyx_XDECREF_SET(__pyx_9genexpr44__pyx_v_p, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_6 = __pyx_v_self; __Pyx_INCREF(__pyx_t_6); __pyx_t_12 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_9genexpr42__pyx_v_p}; + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_9genexpr44__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)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1224, __pyx_L18_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1234, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_9); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1224, __pyx_L18_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1234, __pyx_L18_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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_9genexpr44__pyx_v_p); __pyx_9genexpr44__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_9genexpr44__pyx_v_p); __pyx_9genexpr44__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":1235 * 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 +35348,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, 1235, __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 +35356,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, 1235, __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_4; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1225, __pyx_L34_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1235, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_9genexpr44__pyx_v_c, __pyx_t_9); + __Pyx_XDECREF_SET(__pyx_9genexpr46__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_t_9 = PyNumber_Multiply(__pyx_v_assigned_prod, __pyx_9genexpr46__pyx_v_c); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1235, __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) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1235, __pyx_L34_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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_9genexpr46__pyx_v_c); __pyx_9genexpr46__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_9genexpr46__pyx_v_c); __pyx_9genexpr46__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":1236 * 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: # <<<<<<<<<<<<<< @@ -34738,16 +35398,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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_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, 1236, __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_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, 1236, __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_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_8) { - /* "constraint/constraints.py":1227 + /* "constraint/constraints.py":1237 * possible_prods = [assigned_prod * c for c in candidates] * if min(possible_prods) > target_value: * return False # <<<<<<<<<<<<<< @@ -34759,7 +35419,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1226 + /* "constraint/constraints.py":1236 * 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,17 +35428,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1229 + /* "constraint/constraints.py":1239 * 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, 1239, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1230 + /* "constraint/constraints.py":1240 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< @@ -34791,18 +35451,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1230, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1240, __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_4; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __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":1241 * if forwardcheck: * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] # <<<<<<<<<<<<<< @@ -34810,7 +35470,7 @@ 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, 1241, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_10); __pyx_t_16 = 0; @@ -34818,35 +35478,35 @@ 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, 1231, __pyx_L45_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1241, __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_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1231, __pyx_L45_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1241, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr45__pyx_v_v, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr47__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_9genexpr47__pyx_v_v, __pyx_v_var, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1241, __pyx_L45_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1241, __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_9genexpr47__pyx_v_v))) __PYX_ERR(0, 1241, __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_XDECREF(__pyx_9genexpr47__pyx_v_v); __pyx_9genexpr47__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_9genexpr47__pyx_v_v); __pyx_9genexpr47__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":1242 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< @@ -34854,10 +35514,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * 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) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_8 < 0))) __PYX_ERR(0, 1242, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1233 + /* "constraint/constraints.py":1243 * 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,7 +35525,7 @@ 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, 1243, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __pyx_v_other_unassigned; __Pyx_INCREF(__pyx_t_10); __pyx_t_16 = 0; @@ -34873,20 +35533,20 @@ 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, 1233, __pyx_L54_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1243, __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_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1233, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1243, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr46__pyx_v_v, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr48__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_9genexpr48__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1243, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_12 = 1; { @@ -34895,13 +35555,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1243, __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_t_14 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr48__pyx_v_v); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1243, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_12 = 1; { @@ -34910,32 +35570,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1243, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1233, __pyx_L54_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1243, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_3); __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); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1243, __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_3, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 1243, __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) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1243, __pyx_L54_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_v); __pyx_9genexpr46__pyx_v_v = 0; + __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_v); __pyx_9genexpr48__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_9genexpr48__pyx_v_v); __pyx_9genexpr48__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":1244 * 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,12 +35603,12 @@ 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, 1244, __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_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1244, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_10); { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1234, __pyx_L66_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1244, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = __pyx_v_bounds; __Pyx_INCREF(__pyx_t_11); __pyx_t_16 = 0; @@ -34956,13 +35616,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1234, __pyx_L66_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1244, __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_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1234, __pyx_L66_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1244, __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,7 +35630,7 @@ 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, 1244, __pyx_L66_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -34980,22 +35640,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1244, __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) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1244, __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_14 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1244, __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_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1244, __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, 1244, __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); @@ -35003,7 +35663,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1244, __pyx_L66_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; goto __pyx_L70_unpacking_done; @@ -35011,38 +35671,38 @@ 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, 1244, __pyx_L66_error) __pyx_L70_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr48__pyx_v_lo, __pyx_t_14); + __Pyx_XDECREF_SET(__pyx_9genexpr50__pyx_v_lo, __pyx_t_14); __pyx_t_14 = 0; - __Pyx_XDECREF_SET(__pyx_9genexpr48__pyx_v_hi, __pyx_t_13); + __Pyx_XDECREF_SET(__pyx_9genexpr50__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, 1244, __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_9genexpr50__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr50__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_9genexpr50__pyx_v_lo) != (0)) __PYX_ERR(0, 1244, __pyx_L66_error); + __Pyx_INCREF(__pyx_9genexpr50__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr50__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_9genexpr50__pyx_v_hi) != (0)) __PYX_ERR(0, 1244, __pyx_L66_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1244, __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_XDECREF(__pyx_9genexpr50__pyx_v_hi); __pyx_9genexpr50__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_lo); __pyx_9genexpr50__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_9genexpr50__pyx_v_hi); __pyx_9genexpr50__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_lo); __pyx_9genexpr50__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_t_11 = PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1244, __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_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1244, __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; @@ -35051,9 +35711,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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_t_16 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1244, __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_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1244, __pyx_L61_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -35062,7 +35722,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1234, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1244, __pyx_L61_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -35072,7 +35732,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1234, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1244, __pyx_L61_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -35083,46 +35743,46 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1234, __pyx_L61_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1244, __pyx_L61_error) } else { __pyx_t_3 = __pyx_t_5(__pyx_t_11); 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, 1234, __pyx_L61_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1244, __pyx_L61_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_9genexpr47__pyx_v_p, __pyx_t_3); + __Pyx_XDECREF_SET(__pyx_9genexpr49__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; { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr47__pyx_v_p}; + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr49__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) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1244, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_3); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1234, __pyx_L61_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1244, __pyx_L61_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_p); __pyx_9genexpr47__pyx_v_p = 0; + __Pyx_XDECREF(__pyx_9genexpr49__pyx_v_p); __pyx_9genexpr49__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_9genexpr49__pyx_v_p); __pyx_9genexpr49__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":1242 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< @@ -35132,7 +35792,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint goto __pyx_L51; } - /* "constraint/constraints.py":1236 + /* "constraint/constraints.py":1246 * other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in bounds])] * else: * other_products = [1] # <<<<<<<<<<<<<< @@ -35140,45 +35800,45 @@ 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, 1246, __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, 1246, __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":1248 * 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, 1248, __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":1249 * * 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, 1249, __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_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_t_16 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1249, __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_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1249, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -35187,7 +35847,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1239, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1249, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -35197,7 +35857,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1239, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1249, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -35208,13 +35868,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1239, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1249, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_5(__pyx_t_11); 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, 1249, __pyx_L1_error) PyErr_Clear(); } break; @@ -35224,7 +35884,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":1250 * domain = domains[var] * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] # <<<<<<<<<<<<<< @@ -35232,7 +35892,7 @@ 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, 1250, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_v_other_products; __Pyx_INCREF(__pyx_t_3); __pyx_t_18 = 0; @@ -35240,52 +35900,52 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1240, __pyx_L79_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1250, __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_18; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1240, __pyx_L79_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1250, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_XDECREF_SET(__pyx_9genexpr49__pyx_v_o, __pyx_t_10); + __Pyx_XDECREF_SET(__pyx_9genexpr51__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_t_10 = PyNumber_Multiply(__pyx_v_assigned_prod, __pyx_v_val); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1250, __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) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_10, __pyx_9genexpr51__pyx_v_o); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1250, __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) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1250, __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_XDECREF(__pyx_9genexpr51__pyx_v_o); __pyx_9genexpr51__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_9genexpr51__pyx_v_o); __pyx_9genexpr51__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":1251 * 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, 1251, __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_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { - /* "constraint/constraints.py":1242 + /* "constraint/constraints.py":1252 * prods = [assigned_prod * val * o for o in other_products] * if all(p > target_value for p in prods): * domain.hideValue(val) # <<<<<<<<<<<<<< @@ -35299,12 +35959,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint 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_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1242, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1241 + /* "constraint/constraints.py":1251 * 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 +35973,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1239 + /* "constraint/constraints.py":1249 * * domain = domains[var] * for val in domain[:]: # <<<<<<<<<<<<<< @@ -35323,18 +35983,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "constraint/constraints.py":1243 + /* "constraint/constraints.py":1253 * 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, 1253, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_8); if (__pyx_t_2) { - /* "constraint/constraints.py":1244 + /* "constraint/constraints.py":1254 * domain.hideValue(val) * if not domain: * return False # <<<<<<<<<<<<<< @@ -35347,7 +36007,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1243 + /* "constraint/constraints.py":1253 * if all(p > target_value for p in prods): * domain.hideValue(val) * if not domain: # <<<<<<<<<<<<<< @@ -35356,7 +36016,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1230 + /* "constraint/constraints.py":1240 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< @@ -35366,7 +36026,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":1229 + /* "constraint/constraints.py":1239 * return False * * if forwardcheck: # <<<<<<<<<<<<<< @@ -35375,7 +36035,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1246 + /* "constraint/constraints.py":1256 * return False * * return True # <<<<<<<<<<<<<< @@ -35387,7 +36047,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1205 + /* "constraint/constraints.py":1215 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -35421,25 +36081,25 @@ 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_gb_10constraint_11constraints_25VariableMaxProdConstraint_8__call___2generator14); + __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_v); + __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_p); + __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_lo); + __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_hi); + __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_c); + __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_v); + __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_v); + __Pyx_XDECREF(__pyx_9genexpr49__pyx_v_p); + __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_lo); + __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_hi); + __Pyx_XDECREF(__pyx_9genexpr51__pyx_v_o); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint_8__call___2generator16); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":1260 +/* "constraint/constraints.py":1270 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -35488,39 +36148,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, 1270, __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, 1270, __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, 1270, __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, 1270, __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, 1270, __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, 1270, __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, 1270, __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, 1270, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -35549,16 +36209,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1266 + /* "constraint/constraints.py":1276 * 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, 1276, __pyx_L1_error) - /* "constraint/constraints.py":1260 + /* "constraint/constraints.py":1270 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -35578,7 +36238,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( return __pyx_r; } -/* "constraint/constraints.py":1268 +/* "constraint/constraints.py":1278 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -35629,53 +36289,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, 1278, __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, 1278, __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, 1278, __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, 1278, __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, 1278, __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, 1278, __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, 1278, __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, 1278, __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, 1278, __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, 1278, __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, 1278, __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, 1278, __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, 1278, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -35689,7 +36349,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, 1278, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -35722,7 +36382,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1270 + /* "constraint/constraints.py":1280 * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 * # preProcess() will remove it. * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< @@ -35738,14 +36398,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ __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, 1270, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1280, __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, 1280, __pyx_L1_error) - /* "constraint/constraints.py":1268 + /* "constraint/constraints.py":1278 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -35765,7 +36425,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ return __pyx_r; } -/* "constraint/constraints.py":1272 +/* "constraint/constraints.py":1282 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -35816,50 +36476,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, 1282, __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, 1282, __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, 1282, __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, 1282, __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, 1282, __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, 1282, __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, 1282, __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, 1282, __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, 1282, __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, 1282, __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, 1282, __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, 1282, __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, 1282, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -35869,7 +36529,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, 1282, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -35880,9 +36540,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, 1282, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1282, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1282, __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 +36585,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1273 + /* "constraint/constraints.py":1283 * * 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, 1283, __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":1284 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -35949,9 +36609,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, 1284, __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, 1284, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -35959,7 +36619,7 @@ 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, 1284, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -35969,7 +36629,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce { 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, 1284, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -35980,13 +36640,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, 1284, __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, 1284, __pyx_L1_error) PyErr_Clear(); } break; @@ -35996,35 +36656,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":1285 * 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, 1285, __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":1286 * 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, 1286, __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, 1286, __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, 1286, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -36033,7 +36693,7 @@ 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, 1286, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -36043,7 +36703,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce { 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, 1286, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -36054,13 +36714,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, 1286, __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, 1286, __pyx_L1_error) PyErr_Clear(); } break; @@ -36070,17 +36730,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":1287 * 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, 1287, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1278 + /* "constraint/constraints.py":1288 * for value in domain[:]: * if value not in set: * domain.remove(value) # <<<<<<<<<<<<<< @@ -36094,12 +36754,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce 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_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, 1288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1277 + /* "constraint/constraints.py":1287 * domain = domains[variable] * for value in domain[:]: * if value not in set: # <<<<<<<<<<<<<< @@ -36108,7 +36768,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce */ } - /* "constraint/constraints.py":1276 + /* "constraint/constraints.py":1286 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -36118,25 +36778,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1279 + /* "constraint/constraints.py":1289 * 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, 1289, __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, 1289, __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, 1289, __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, 1289, __pyx_L1_error); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11}; @@ -36144,12 +36804,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce __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, 1289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1274 + /* "constraint/constraints.py":1284 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -36159,27 +36819,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":1290 * 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, 1290, __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, 1290, __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, 1290, __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, 1290, __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":1282 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -36208,7 +36868,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce return __pyx_r; } -/* "constraint/constraints.py":1294 +/* "constraint/constraints.py":1304 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -36257,39 +36917,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, 1304, __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, 1304, __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, 1304, __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, 1304, __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, 1304, __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, 1304, __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, 1304, __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, 1304, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -36318,16 +36978,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1300 + /* "constraint/constraints.py":1310 * 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, 1310, __pyx_L1_error) - /* "constraint/constraints.py":1294 + /* "constraint/constraints.py":1304 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -36347,7 +37007,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init return __pyx_r; } -/* "constraint/constraints.py":1302 +/* "constraint/constraints.py":1312 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -36398,53 +37058,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, 1312, __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, 1312, __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, 1312, __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, 1312, __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, 1312, __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, 1312, __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, 1312, __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, 1312, __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, 1312, __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, 1312, __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, 1312, __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, 1312, __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, 1312, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -36458,7 +37118,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, 1312, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -36491,7 +37151,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1304 + /* "constraint/constraints.py":1314 * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 * # preProcess() will remove it. * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< @@ -36507,14 +37167,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal __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, 1304, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1314, __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, 1314, __pyx_L1_error) - /* "constraint/constraints.py":1302 + /* "constraint/constraints.py":1312 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -36534,7 +37194,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal return __pyx_r; } -/* "constraint/constraints.py":1306 +/* "constraint/constraints.py":1316 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -36585,50 +37245,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, 1316, __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, 1316, __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, 1316, __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, 1316, __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, 1316, __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, 1316, __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, 1316, __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, 1316, __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, 1316, __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, 1316, __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, 1316, __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, 1316, __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, 1316, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -36638,7 +37298,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, 1316, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -36649,9 +37309,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, 1316, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1316, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1316, __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 +37354,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1307 + /* "constraint/constraints.py":1317 * * 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, 1317, __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":1318 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -36718,9 +37378,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, 1318, __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, 1318, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -36728,7 +37388,7 @@ 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, 1318, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -36738,7 +37398,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr { 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, 1318, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -36749,13 +37409,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, 1318, __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, 1318, __pyx_L1_error) PyErr_Clear(); } break; @@ -36765,35 +37425,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":1319 * 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, 1319, __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":1320 * 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, 1320, __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, 1320, __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, 1320, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -36802,7 +37462,7 @@ 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, 1320, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -36812,7 +37472,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr { 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, 1320, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -36823,13 +37483,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, 1320, __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, 1320, __pyx_L1_error) PyErr_Clear(); } break; @@ -36839,17 +37499,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":1321 * 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, 1321, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1312 + /* "constraint/constraints.py":1322 * for value in domain[:]: * if value in set: * domain.remove(value) # <<<<<<<<<<<<<< @@ -36863,12 +37523,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr 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_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, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1311 + /* "constraint/constraints.py":1321 * domain = domains[variable] * for value in domain[:]: * if value in set: # <<<<<<<<<<<<<< @@ -36877,7 +37537,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr */ } - /* "constraint/constraints.py":1310 + /* "constraint/constraints.py":1320 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -36887,25 +37547,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1313 + /* "constraint/constraints.py":1323 * 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, 1323, __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, 1323, __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, 1323, __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, 1323, __pyx_L1_error); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11}; @@ -36913,12 +37573,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr __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, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1308 + /* "constraint/constraints.py":1318 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -36928,27 +37588,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":1324 * 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, 1324, __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, 1324, __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, 1324, __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, 1324, __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":1316 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -36977,7 +37637,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr return __pyx_r; } -/* "constraint/constraints.py":1328 +/* "constraint/constraints.py":1338 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -37028,50 +37688,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, 1338, __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, 1338, __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, 1338, __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, 1338, __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, 1338, __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, 1338, __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, 1338, __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, 1338, __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, 1338, __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, 1338, __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, 1338, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -37085,7 +37745,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, 1338, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -37114,34 +37774,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1338 + /* "constraint/constraints.py":1348 * 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, 1348, __pyx_L1_error) - /* "constraint/constraints.py":1339 + /* "constraint/constraints.py":1349 * """ * 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, 1349, __pyx_L1_error) - /* "constraint/constraints.py":1340 + /* "constraint/constraints.py":1350 * 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, 1350, __pyx_L1_error) - /* "constraint/constraints.py":1328 + /* "constraint/constraints.py":1338 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -37161,7 +37821,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini return __pyx_r; } -/* "constraint/constraints.py":1342 +/* "constraint/constraints.py":1352 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -37212,53 +37872,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, 1352, __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, 1352, __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, 1352, __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, 1352, __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, 1352, __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, 1352, __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, 1352, __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, 1352, __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, 1352, __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, 1352, __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, 1352, __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, 1352, __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, 1352, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -37272,7 +37932,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, 1352, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -37283,8 +37943,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, 1352, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1352, __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 +37989,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":1353 * * 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, 1353, __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":1354 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * set = self._set * missing = 0 # <<<<<<<<<<<<<< @@ -37351,7 +38011,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":1355 * set = self._set * missing = 0 * found = 0 # <<<<<<<<<<<<<< @@ -37361,7 +38021,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":1356 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -37373,9 +38033,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, 1356, __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, 1356, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -37383,7 +38043,7 @@ 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, 1356, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -37393,7 +38053,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { 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, 1356, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -37404,13 +38064,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, 1356, __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, 1356, __pyx_L1_error) PyErr_Clear(); } break; @@ -37420,36 +38080,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":1357 * 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, 1357, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1348 + /* "constraint/constraints.py":1358 * 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, 1358, __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, 1358, __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, 1358, __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, 1358, __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":1357 * found = 0 * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -37459,7 +38119,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L5; } - /* "constraint/constraints.py":1350 + /* "constraint/constraints.py":1360 * found += assignments[variable] in set * else: * missing += 1 # <<<<<<<<<<<<<< @@ -37467,14 +38127,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, 1360, __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":1356 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -37484,53 +38144,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":1361 * 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, 1361, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1352 + /* "constraint/constraints.py":1362 * 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, 1362, __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, 1362, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1353 + /* "constraint/constraints.py":1363 * 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, 1363, __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, 1363, __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, 1363, __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, 1363, __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, 1363, __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":1364 * if self._exact: * if not (found <= self._n <= missing + found): * return False # <<<<<<<<<<<<<< @@ -37542,7 +38202,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1353 + /* "constraint/constraints.py":1363 * if missing: * if self._exact: * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< @@ -37551,7 +38211,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1352 + /* "constraint/constraints.py":1362 * missing += 1 * if missing: * if self._exact: # <<<<<<<<<<<<<< @@ -37561,7 +38221,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L8; } - /* "constraint/constraints.py":1356 + /* "constraint/constraints.py":1366 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -37569,18 +38229,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, 1366, __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, 1366, __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, 1366, __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, 1366, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":1357 + /* "constraint/constraints.py":1367 * else: * if self._n > missing + found: * return False # <<<<<<<<<<<<<< @@ -37592,7 +38252,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1356 + /* "constraint/constraints.py":1366 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -37603,33 +38263,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __pyx_L8:; - /* "constraint/constraints.py":1358 + /* "constraint/constraints.py":1368 * 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, 1368, __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, 1368, __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, 1368, __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, 1368, __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, 1368, __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":1371 * # All unassigned variables must be assigned to * # values in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -37641,9 +38301,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, 1371, __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, 1371, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -37651,7 +38311,7 @@ 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, 1371, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -37661,7 +38321,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { 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, 1371, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -37672,13 +38332,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, 1371, __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, 1371, __pyx_L1_error) PyErr_Clear(); } break; @@ -37688,45 +38348,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":1372 * # 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, 1372, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1363 + /* "constraint/constraints.py":1373 * 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, 1373, __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":1374 * 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, 1374, __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, 1374, __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, 1374, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -37735,7 +38395,7 @@ 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, 1374, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -37745,7 +38405,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { 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, 1374, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -37756,13 +38416,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, 1374, __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, 1374, __pyx_L1_error) PyErr_Clear(); } break; @@ -37772,17 +38432,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":1375 * 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, 1375, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1366 + /* "constraint/constraints.py":1376 * for value in domain[:]: * if value not in set: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -37796,12 +38456,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca 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_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, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1365 + /* "constraint/constraints.py":1375 * domain = domains[variable] * for value in domain[:]: * if value not in set: # <<<<<<<<<<<<<< @@ -37810,7 +38470,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1364 + /* "constraint/constraints.py":1374 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -37820,18 +38480,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":1377 * 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, 1377, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_7); if (__pyx_t_5) { - /* "constraint/constraints.py":1368 + /* "constraint/constraints.py":1378 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -37844,7 +38504,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":1377 * if value not in set: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -37853,7 +38513,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1362 + /* "constraint/constraints.py":1372 * # values in the set. * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -37862,7 +38522,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1361 + /* "constraint/constraints.py":1371 * # All unassigned variables must be assigned to * # values in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -37872,7 +38532,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":1368 * if self._n > missing + found: * return False * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< @@ -37881,7 +38541,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1351 + /* "constraint/constraints.py":1361 * else: * missing += 1 * if missing: # <<<<<<<<<<<<<< @@ -37891,7 +38551,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L7; } - /* "constraint/constraints.py":1370 + /* "constraint/constraints.py":1380 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -37899,28 +38559,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, 1380, __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, 1380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1371 + /* "constraint/constraints.py":1381 * 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, 1381, __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, 1381, __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, 1381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1372 + /* "constraint/constraints.py":1382 * if self._exact: * if found != self._n: * return False # <<<<<<<<<<<<<< @@ -37932,7 +38592,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1371 + /* "constraint/constraints.py":1381 * else: * if self._exact: * if found != self._n: # <<<<<<<<<<<<<< @@ -37941,7 +38601,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1370 + /* "constraint/constraints.py":1380 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -37951,7 +38611,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L23; } - /* "constraint/constraints.py":1374 + /* "constraint/constraints.py":1384 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -37959,15 +38619,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, 1384, __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, 1384, __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, 1384, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1375 + /* "constraint/constraints.py":1385 * else: * if found < self._n: * return False # <<<<<<<<<<<<<< @@ -37979,7 +38639,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1374 + /* "constraint/constraints.py":1384 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -37992,7 +38652,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __pyx_L7:; - /* "constraint/constraints.py":1376 + /* "constraint/constraints.py":1386 * if found < self._n: * return False * return True # <<<<<<<<<<<<<< @@ -38004,7 +38664,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1342 + /* "constraint/constraints.py":1352 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -38032,7 +38692,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca return __pyx_r; } -/* "constraint/constraints.py":1390 +/* "constraint/constraints.py":1400 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -38083,50 +38743,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, 1400, __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, 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, 1390, __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, 1390, __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, 1390, __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, "__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, 1400, __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, 1400, __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, 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, 1390, __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, 1390, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1400, __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, 1400, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -38140,7 +38800,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, 1400, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -38169,34 +38829,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1400 + /* "constraint/constraints.py":1410 * 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, 1410, __pyx_L1_error) - /* "constraint/constraints.py":1401 + /* "constraint/constraints.py":1411 * """ * 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, 1411, __pyx_L1_error) - /* "constraint/constraints.py":1402 + /* "constraint/constraints.py":1412 * 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, 1412, __pyx_L1_error) - /* "constraint/constraints.py":1390 + /* "constraint/constraints.py":1400 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -38216,7 +38876,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ return __pyx_r; } -/* "constraint/constraints.py":1404 +/* "constraint/constraints.py":1414 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -38267,53 +38927,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, 1414, __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, 1414, __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, 1414, __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, 1414, __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, 1414, __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, 1414, __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, 1414, __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, 1414, __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, 1414, __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, 1414, __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, 1414, __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, 1414, __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, 1414, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -38327,7 +38987,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, 1414, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -38338,8 +38998,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, 1414, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1414, __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 +39044,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1405 + /* "constraint/constraints.py":1415 * * 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, 1415, __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":1416 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * set = self._set * missing = 0 # <<<<<<<<<<<<<< @@ -38406,7 +39066,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":1417 * set = self._set * missing = 0 * found = 0 # <<<<<<<<<<<<<< @@ -38416,7 +39076,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":1418 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -38428,9 +39088,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, 1418, __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, 1418, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -38438,7 +39098,7 @@ 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, 1418, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -38448,7 +39108,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_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, 1408, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1418, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -38459,13 +39119,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, 1418, __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, 1418, __pyx_L1_error) PyErr_Clear(); } break; @@ -38475,36 +39135,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":1419 * 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, 1419, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1410 + /* "constraint/constraints.py":1420 * 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, 1420, __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, 1420, __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, 1420, __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, 1420, __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":1419 * found = 0 * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -38514,7 +39174,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L5; } - /* "constraint/constraints.py":1412 + /* "constraint/constraints.py":1422 * found += assignments[variable] not in set * else: * missing += 1 # <<<<<<<<<<<<<< @@ -38522,14 +39182,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, 1422, __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":1418 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -38539,53 +39199,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":1423 * 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, 1423, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1414 + /* "constraint/constraints.py":1424 * 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, 1424, __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, 1424, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1415 + /* "constraint/constraints.py":1425 * 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, 1425, __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, 1425, __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, 1425, __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, 1425, __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, 1425, __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":1426 * if self._exact: * if not (found <= self._n <= missing + found): * return False # <<<<<<<<<<<<<< @@ -38597,7 +39257,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1415 + /* "constraint/constraints.py":1425 * if missing: * if self._exact: * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< @@ -38606,7 +39266,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1414 + /* "constraint/constraints.py":1424 * missing += 1 * if missing: * if self._exact: # <<<<<<<<<<<<<< @@ -38616,7 +39276,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L8; } - /* "constraint/constraints.py":1418 + /* "constraint/constraints.py":1428 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -38624,18 +39284,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, 1428, __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, 1428, __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, 1428, __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, 1428, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":1419 + /* "constraint/constraints.py":1429 * else: * if self._n > missing + found: * return False # <<<<<<<<<<<<<< @@ -38647,7 +39307,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1418 + /* "constraint/constraints.py":1428 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -38658,33 +39318,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __pyx_L8:; - /* "constraint/constraints.py":1420 + /* "constraint/constraints.py":1430 * 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, 1430, __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, 1430, __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, 1430, __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, 1430, __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, 1430, __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":1433 * # All unassigned variables must be assigned to * # values not in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -38696,9 +39356,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, 1433, __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, 1433, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -38706,7 +39366,7 @@ 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, 1433, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -38716,7 +39376,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ { 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, 1433, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -38727,13 +39387,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, 1433, __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, 1433, __pyx_L1_error) PyErr_Clear(); } break; @@ -38743,45 +39403,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":1434 * # 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, 1434, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1425 + /* "constraint/constraints.py":1435 * 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, 1435, __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":1436 * 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, 1436, __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, 1436, __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, 1436, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -38790,7 +39450,7 @@ 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, 1436, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -38800,7 +39460,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ { 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, 1436, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -38811,13 +39471,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, 1436, __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, 1436, __pyx_L1_error) PyErr_Clear(); } break; @@ -38827,17 +39487,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":1437 * 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, 1437, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1428 + /* "constraint/constraints.py":1438 * for value in domain[:]: * if value in set: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -38851,12 +39511,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ 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_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, 1438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1427 + /* "constraint/constraints.py":1437 * domain = domains[variable] * for value in domain[:]: * if value in set: # <<<<<<<<<<<<<< @@ -38865,7 +39525,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1426 + /* "constraint/constraints.py":1436 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -38875,18 +39535,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":1439 * 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, 1439, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_7); if (__pyx_t_5) { - /* "constraint/constraints.py":1430 + /* "constraint/constraints.py":1440 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -38899,7 +39559,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":1439 * if value in set: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -38908,7 +39568,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1424 + /* "constraint/constraints.py":1434 * # values not in the set. * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -38917,7 +39577,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1423 + /* "constraint/constraints.py":1433 * # All unassigned variables must be assigned to * # values not in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -38927,7 +39587,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":1430 * if self._n > missing + found: * return False * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< @@ -38936,7 +39596,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1413 + /* "constraint/constraints.py":1423 * else: * missing += 1 * if missing: # <<<<<<<<<<<<<< @@ -38946,7 +39606,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L7; } - /* "constraint/constraints.py":1432 + /* "constraint/constraints.py":1442 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -38954,28 +39614,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, 1442, __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, 1442, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1433 + /* "constraint/constraints.py":1443 * 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, 1443, __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, 1443, __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, 1443, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1434 + /* "constraint/constraints.py":1444 * if self._exact: * if found != self._n: * return False # <<<<<<<<<<<<<< @@ -38987,7 +39647,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1433 + /* "constraint/constraints.py":1443 * else: * if self._exact: * if found != self._n: # <<<<<<<<<<<<<< @@ -38996,7 +39656,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1432 + /* "constraint/constraints.py":1442 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -39006,7 +39666,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L23; } - /* "constraint/constraints.py":1436 + /* "constraint/constraints.py":1446 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -39014,15 +39674,15 @@ 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, 1446, __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, 1446, __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, 1446, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1437 + /* "constraint/constraints.py":1447 * else: * if found < self._n: * return False # <<<<<<<<<<<<<< @@ -39033,7 +39693,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1436 + /* "constraint/constraints.py":1446 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -39046,7 +39706,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __pyx_L7:; - /* "constraint/constraints.py":1438 + /* "constraint/constraints.py":1448 * if found < self._n: * return False * return True # <<<<<<<<<<<<<< @@ -39056,7 +39716,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1404 + /* "constraint/constraints.py":1414 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -40897,16 +41557,184 @@ 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_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_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)); + (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; +} + +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_10_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 (((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); + } else + #endif + { + #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); + } + #endif + } +} + +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_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; + } + 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_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_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_10_genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr = { + 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*/ + 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 + 0, /*tp_vectorcall_offset*/ + #endif + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___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_11constraints___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 PY_VERSION_HEX >= 0x030800b1 && (!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_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_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -40919,23 +41747,21 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_10_g 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_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_10_genexpr) { + 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_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_value); #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 (((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); } else #endif { @@ -40950,49 +41776,43 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_10_ge } } -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_11_genexpr(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_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_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_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_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_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_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_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_10_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr = { 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_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_10_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -41014,7 +41834,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_10_ 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_10_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -41032,7 +41852,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_11_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -41065,16 +41885,16 @@ 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_12_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_12_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_12_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_12_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -41087,11 +41907,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_11_g 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_12_genexpr(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -41100,8 +41920,8 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_ge 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_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 (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_12_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_12_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_12_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *)o); } else #endif { @@ -41116,9 +41936,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_ge } } -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_12_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_12_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -41132,27 +41952,27 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_11_ge 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_12_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_12_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12_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_12_genexpr_spec = { + "constraint.constraints.__pyx_scope_struct_12_genexpr", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_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, + __pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_12_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_12_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -41174,7 +41994,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_ 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_12_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -41192,7 +42012,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_12_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -41225,16 +42045,16 @@ 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_13___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_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_13___call__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_13___call__[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_13___call__]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -41247,11 +42067,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12__ 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_13___call__(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___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_12___call__) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13___call__) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -41260,8 +42080,8 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12___ Py_CLEAR(p->__pyx_v_assigned_product); Py_CLEAR(p->__pyx_v_target_value); #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 (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_13___call__ < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_13___call__[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_13___call__++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *)o); } else #endif { @@ -41276,9 +42096,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12___ } } -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_13___call__(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_13___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -41292,9 +42112,9 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_12___ return 0; } -static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_12___call__(PyObject *o) { +static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_13___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; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *)o; tmp = ((PyObject*)p->__pyx_v_assigned_product); p->__pyx_v_assigned_product = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); @@ -41304,28 +42124,196 @@ static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_12___cal 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_13___call___slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13___call__}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_13___call__}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_13___call__}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_13___call__}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_13___call___spec = { + "constraint.constraints.__pyx_scope_struct_13___call__", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___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___call___slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_13___call__ = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct_13___call__", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13___call__, /*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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_13___call__, /*tp_traverse*/ + __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_13___call__, /*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_13___call__, /*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 PY_VERSION_HEX >= 0x030800b1 && (!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_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_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)); + (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; +} + +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_14_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_t_0); + #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); + } else + #endif + { + #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); + } + #endif + } +} + +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_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_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; + } + 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}, {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, + __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*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_14_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -41347,8 +42335,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_12_ 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*/ 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 +42353,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*/ @@ -41398,16 +42386,16 @@ 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_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_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -41420,11 +42408,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_13_g 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_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; #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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_15_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -41435,8 +42423,8 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13_ge 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_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 (((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); } else #endif { @@ -41451,9 +42439,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13_ge } } -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_genexpr(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_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -41473,27 +42461,27 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_13_ge 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_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}, {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_genexpr_spec = { + "constraint.constraints.__pyx_scope_struct_15_genexpr", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_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_13_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_15_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_15_genexpr = { 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_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_15_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -41515,7 +42503,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_13_ 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_13_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_15_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -41533,7 +42521,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_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -41566,16 +42554,16 @@ 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) & (int)(t->tp_basicsize == 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -41588,11 +42576,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_14_g 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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_16_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -41601,10 +42589,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_14_ge 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_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 (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_16_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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 { @@ -41619,9 +42606,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_14_ge } } -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; @@ -41635,33 +42622,30 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_14_ge 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_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, + __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*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_16_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -41683,7 +42667,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_14_ 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*/ 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 +42685,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*/ @@ -41734,16 +42718,16 @@ 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___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_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___call__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_17___call__[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_17___call__]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -41756,22 +42740,20 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_15_g 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___call__(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___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_15_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_17___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_v_target_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 (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_17___call__ < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_17___call__[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_17___call__++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__ *)o); } else #endif { @@ -41786,46 +42768,50 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_15_ge } } -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___call__(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___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___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_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_17___call__(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___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_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___call___slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_17___call__}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_17___call__}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_17___call__}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_17___call__}, {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___call___spec = { + "constraint.constraints.__pyx_scope_struct_17___call__", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___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_15_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_17___call___slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_15_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_17___call__ = { 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___call__", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_15_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_17___call__, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -41847,8 +42833,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_15_ 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_15_genexpr, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_17___call__, /*tp_traverse*/ + __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_17___call__, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -41865,7 +42851,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___call__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -41898,16 +42884,16 @@ 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) & (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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -41920,20 +42906,22 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_16__ 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 (__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_outer_scope); + Py_CLEAR(p->__pyx_genexpr_arg_0); + Py_CLEAR(p->__pyx_v_p); #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 (((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); } else #endif { @@ -41948,50 +42936,46 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_16___ } } -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_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; } - 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, + __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*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_18_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -42013,8 +42997,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_16_ 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*/ 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 +43015,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*/ @@ -42064,16 +43048,16 @@ 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_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_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_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_genexpr)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_19_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_19_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -42086,22 +43070,21 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_17_g 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_genexpr(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_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_17_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_19_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_p); + Py_CLEAR(p->__pyx_v_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 (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_19_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_genexpr)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_19_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_19_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_genexpr *)o); } else #endif { @@ -42116,46 +43099,43 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_17_ge } } -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_genexpr(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_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_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_p) { - e = (*v)(p->__pyx_v_p, 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_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_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_19_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_19_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_19_genexpr}, {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_genexpr_spec = { + "constraint.constraints.__pyx_scope_struct_19_genexpr", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_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_17_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_19_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_17_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_19_genexpr = { 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_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_17_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_19_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -42177,7 +43157,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_17_ 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_17_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_19_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -42195,7 +43175,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_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -42228,16 +43208,16 @@ 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) & (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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -42250,11 +43230,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_18_g 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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_20_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -42263,8 +43243,8 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_18_ge 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_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 (((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); } else #endif { @@ -42279,9 +43259,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_18_ge } } -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; @@ -42295,27 +43275,27 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_18_ge 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, + __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*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_20_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -42337,7 +43317,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_18_ 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*/ 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 +43335,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*/ @@ -42388,16 +43368,16 @@ 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___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_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___call__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_21___call__[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_21___call__]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -42410,11 +43390,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_19__ 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___call__(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___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_19___call__) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_21___call__) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -42422,8 +43402,8 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_19___ PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_target_value); #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 (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_21___call__ < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_21___call__[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_21___call__++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__ *)o); } else #endif { @@ -42438,9 +43418,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_19___ } } -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___call__(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___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__ *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -42451,37 +43431,37 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_19___ 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___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; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___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_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___call___slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_21___call__}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_21___call__}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_21___call__}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_21___call__}, {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___call___spec = { + "constraint.constraints.__pyx_scope_struct_21___call__", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___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_19___call___slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_21___call___slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_19___call__ = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_21___call__ = { 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___call__", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_19___call__, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_21___call__, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -42503,8 +43483,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_19_ 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*/ 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___call__, /*tp_traverse*/ + __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_21___call__, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -42521,7 +43501,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___call__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -42554,16 +43534,16 @@ 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) & (int)(t->tp_basicsize == 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -42576,11 +43556,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_20_g 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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_22_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -42590,8 +43570,8 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_20_ge Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_p); #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 (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_22_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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 { @@ -42606,9 +43586,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_20_ge } } -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; @@ -42625,27 +43605,27 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_20_ge 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, + __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*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_22_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -42667,7 +43647,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_20_ 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*/ 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 +43665,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*/ @@ -42964,15 +43944,15 @@ 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, 781, __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, 781, __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, 781, __pyx_L1_error) #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,47 +43960,47 @@ 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_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr)) __PYX_ERR(0, 810, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(0, 810, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__ = &__pyx_type_10constraint_11constraints___pyx_scope_struct_12___call__; + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_12_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_12___call__) < 0) __PYX_ERR(0, 890, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(0, 810, __pyx_L1_error) #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)) { - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__->tp_getattro = PyObject_GenericGetAttr; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr->tp_getattro = PyObject_GenericGetAttr; } #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___call__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_13___call___spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13___call__)) __PYX_ERR(0, 895, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_13___call___spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13___call__) < 0) __PYX_ERR(0, 895, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13___call__ = &__pyx_type_10constraint_11constraints___pyx_scope_struct_13___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_13_genexpr) < 0) __PYX_ERR(0, 913, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13___call__) < 0) __PYX_ERR(0, 895, __pyx_L1_error) #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)) { - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr->tp_getattro = PyObject_GenericGetAttr; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13___call__->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13___call__->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13___call__->tp_getattro = PyObject_GenericGetAttr; } #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, 918, __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, 918, __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, 918, __pyx_L1_error) #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,15 +44008,15 @@ 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_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, 919, __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, 919, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_15_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_15_genexpr) < 0) __PYX_ERR(0, 928, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15_genexpr) < 0) __PYX_ERR(0, 919, __pyx_L1_error) #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)) { @@ -43044,47 +44024,47 @@ 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_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, 933, __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, 933, __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, 933, __pyx_L1_error) #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___call__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_17___call___spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17___call__)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_17___call___spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17___call__) < 0) __PYX_ERR(0, 1039, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_17_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17___call__ = &__pyx_type_10constraint_11constraints___pyx_scope_struct_17___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_17_genexpr) < 0) __PYX_ERR(0, 1070, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17___call__) < 0) __PYX_ERR(0, 1039, __pyx_L1_error) #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)) { - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr->tp_getattro = PyObject_GenericGetAttr; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17___call__->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17___call__->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17___call__->tp_getattro = PyObject_GenericGetAttr; } #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, 1075, __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, 1075, __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, 1075, __pyx_L1_error) #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,37 +44072,69 @@ 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_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_19_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19_genexpr)) __PYX_ERR(0, 1110, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_19_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19_genexpr) < 0) __PYX_ERR(0, 1110, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__ = &__pyx_type_10constraint_11constraints___pyx_scope_struct_19___call__; + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_19_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_19___call__) < 0) __PYX_ERR(0, 1205, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19_genexpr) < 0) __PYX_ERR(0, 1110, __pyx_L1_error) #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)) { - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__->tp_getattro = PyObject_GenericGetAttr; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19_genexpr->tp_getattro = PyObject_GenericGetAttr; } #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, 1139, __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, 1139, __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, 1139, __pyx_L1_error) #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___call__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_21___call___spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21___call__)) __PYX_ERR(0, 1215, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_21___call___spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21___call__) < 0) __PYX_ERR(0, 1215, __pyx_L1_error) + #else + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21___call__ = &__pyx_type_10constraint_11constraints___pyx_scope_struct_21___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_21___call__) < 0) __PYX_ERR(0, 1215, __pyx_L1_error) + #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___call__->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21___call__->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21___call__->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, 1251, __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, 1251, __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, 1251, __pyx_L1_error) + #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:; @@ -43546,7 +44558,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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_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[17])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 11, __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); @@ -43567,7 +44579,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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_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[18])); 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); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -43586,7 +44598,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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_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[19])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __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) @@ -43647,7 +44659,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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_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[20])); 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); @@ -43667,7 +44679,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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_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[21])); 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) @@ -43738,7 +44750,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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_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[22])); 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); @@ -43753,7 +44765,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); * 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_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[23])); 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) @@ -43815,7 +44827,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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_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[24])); 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) @@ -43887,7 +44899,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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_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[25])); 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) @@ -43958,7 +44970,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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_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[26])); 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); @@ -43979,7 +44991,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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_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[27])); 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; @@ -43998,7 +45010,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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_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[28])); 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_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); @@ -44056,7 +45068,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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_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[29])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 377, __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); @@ -44077,7 +45089,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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_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[30])); 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_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -44096,7 +45108,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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_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[31])); 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); @@ -44153,7 +45165,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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_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[32])); 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); @@ -44173,7 +45185,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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_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[33])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 493, __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); @@ -44231,7 +45243,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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_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[34])); 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); @@ -44252,7 +45264,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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_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[35])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __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; @@ -44271,7 +45283,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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_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[36])); 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); @@ -44328,7 +45340,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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) + __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[37])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 595, __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); @@ -44349,7 +45361,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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) + __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[38])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 607, __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; @@ -44368,7 +45380,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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) + __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[39])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 642, __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_6); @@ -44426,7 +45438,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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) + __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[40])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __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_5); @@ -44447,7 +45459,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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) + __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[41])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -44466,7 +45478,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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) + __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[42])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 726, __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); @@ -44522,51 +45534,51 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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_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[43])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 765, __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) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":773 - * self._exactprod = exactprod + /* "constraint/constraints.py":774 + * 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, 773, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 774, __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) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 774, __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, 774, __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, 774, __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, 774, __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[44])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __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, 773, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_3) < 0) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":801 + /* "constraint/constraints.py":802 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * exactprod = self._exactprod * prod = 1 */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __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) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 802, __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, 802, __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, 802, __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[45])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 802, __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, 801, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 802, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/constraints.py":754 @@ -44584,862 +45596,862 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":828 + /* "constraint/constraints.py":833 * return True * * 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, 828, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __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, 833, __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, 833, __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, 833, __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_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, 833, __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, 833, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":839 + /* "constraint/constraints.py":844 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # <<<<<<<<<<<<<< * """Instantiate a VariableExactProdConstraint. * */ - __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(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __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) + 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, 844, __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, 844, __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[46])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 844, __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, 839, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_3) < 0) __PYX_ERR(0, 844, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":849 + /* "constraint/constraints.py":854 * 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_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[47])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __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) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_get_product_bounds, __pyx_t_3) < 0) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":869 + /* "constraint/constraints.py":874 * 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_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[48])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __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) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_safe_product, __pyx_t_3) < 0) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":875 + /* "constraint/constraints.py":880 * return prod * * 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_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __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) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 880, __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, 880, __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, 880, __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, 880, __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[49])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 880, __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 (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":890 + /* "constraint/constraints.py":895 * 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_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, 895, __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) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 895, __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, 895, __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, 895, __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[50])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 895, __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, 890, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_3) < 0) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":828 + /* "constraint/constraints.py":833 * return True * * class VariableExactProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the product of variables equals 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_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, 833, __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) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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":941 * * * 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, 936, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 941, __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, 941, __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, 941, __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, 941, __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_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, 941, __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, 936, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 941, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":947 + /* "constraint/constraints.py":952 * """ * * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MinProdConstraint. * */ - __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, 952, __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_minprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 952, __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[51])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 952, __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_init, __pyx_t_4) < 0) __PYX_ERR(0, 947, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 952, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":955 + /* "constraint/constraints.py":960 * 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_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, 960, __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, 960, __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, 960, __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, 960, __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, 960, __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[52])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 960, __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_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 955, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 960, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":966 + /* "constraint/constraints.py":971 * 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_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, 971, __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, 971, __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, 971, __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, 971, __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[53])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 971, __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_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_3, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 971, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":936 + /* "constraint/constraints.py":941 * * * class MinProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product up to at least 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_MinProdConstraint, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 941, __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 (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 941, __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_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":982 + /* "constraint/constraints.py":987 * * * 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, 982, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __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, 987, __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, 987, __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_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 987, __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_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, 987, __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, 987, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":993 + /* "constraint/constraints.py":998 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< * self.target_var = target_var * self.product_vars = product_vars */ - __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, 998, __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, 998, __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, 998, __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[54])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 998, __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_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, 998, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":997 + /* "constraint/constraints.py":1002 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< * 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_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_6)) __PYX_ERR(0, 1002, __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 (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_get_product_bounds, __pyx_t_6) < 0) __PYX_ERR(0, 1002, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1015 + /* "constraint/constraints.py":1020 * 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_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_6)) __PYX_ERR(0, 1020, __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 (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_safe_product, __pyx_t_6) < 0) __PYX_ERR(0, 1020, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1021 + /* "constraint/constraints.py":1026 * 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, 1026, __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, 1026, __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, 1026, __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, 1026, __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, 1026, __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[57])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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, 1026, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1034 + /* "constraint/constraints.py":1039 * 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_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1039, __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) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1039, __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, 1039, __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, 1039, __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[58])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __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) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 1039, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":982 + /* "constraint/constraints.py":987 * * * 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_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, 987, __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) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 987, __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_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1078 + /* "constraint/constraints.py":1083 * * * 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, 1083, __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_t_3 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1083, __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_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1083, __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_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, 1083, __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) + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 1083, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1089 + /* "constraint/constraints.py":1094 * """ * * def __init__(self, maxprod: Union[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_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1094, __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) + 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, 1094, __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[59])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1094, __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) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(0, 1094, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1097 - * self._maxprod = maxprod + /* "constraint/constraints.py":1103 + * 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_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1103, __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) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1103, __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, 1103, __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, 1103, __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, 1103, __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[60])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1103, __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) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_3) < 0) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1125 + /* "constraint/constraints.py":1131 * 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_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1131, __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) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1131, __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, 1131, __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, 1131, __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[61])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1131, __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) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1078 + /* "constraint/constraints.py":1083 * * * 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_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, 1083, __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) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 1083, __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":1153 + /* "constraint/constraints.py":1163 * * * 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, 1163, __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_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1163, __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, 1153, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1163, __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_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1163, __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_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, 1163, __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) + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 1163, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1164 + /* "constraint/constraints.py":1174 * """ # 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_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1174, __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) + 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, 1174, __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, 1174, __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[62])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __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) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_3) < 0) __PYX_ERR(0, 1174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1168 + /* "constraint/constraints.py":1178 * 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_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[63])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1178, __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) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_get_product_bounds, __pyx_t_3) < 0) __PYX_ERR(0, 1178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1186 + /* "constraint/constraints.py":1196 * 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_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[64])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1196, __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) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_safe_product, __pyx_t_3) < 0) __PYX_ERR(0, 1196, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1192 + /* "constraint/constraints.py":1202 * 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_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1202, __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) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1202, __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, 1202, __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, 1202, __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, 1202, __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[65])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1202, __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) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1205 + /* "constraint/constraints.py":1215 * 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_t_4 = __Pyx_PyDict_NewPresized(3); 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, 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) + 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_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1215, __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[66])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1215, __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) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_3) < 0) __PYX_ERR(0, 1215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1153 + /* "constraint/constraints.py":1163 * * * 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_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, 1163, __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) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 1163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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":1249 + /* "constraint/constraints.py":1259 * * * 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, 1259, __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_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1259, __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, 1249, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1259, __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_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1259, __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_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, 1259, __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) + if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 1259, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1260 + /* "constraint/constraints.py":1270 * """ * * 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_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[67])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1270, __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) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 1270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1268 + /* "constraint/constraints.py":1278 * 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_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[68])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1278, __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) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 1278, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1272 + /* "constraint/constraints.py":1282 * 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_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1282, __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) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1282, __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, 1282, __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, 1282, __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, 1282, __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[69])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1282, __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) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 1282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1249 + /* "constraint/constraints.py":1259 * * * 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_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, 1259, __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) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 1259, __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_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1283 + /* "constraint/constraints.py":1293 * * * 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, 1293, __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_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1293, __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, 1283, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1293, __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_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1293, __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_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, 1293, __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) + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 1293, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1294 + /* "constraint/constraints.py":1304 * """ * * 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_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[70])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1304, __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) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(0, 1304, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1302 + /* "constraint/constraints.py":1312 * 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_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[71])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1312, __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) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1306 + /* "constraint/constraints.py":1316 * 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_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1316, __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) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1316, __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, 1316, __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, 1316, __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, 1316, __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[72])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1316, __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) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 1316, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1283 + /* "constraint/constraints.py":1293 * * * 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_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, 1293, __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) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 1293, __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_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1317 + /* "constraint/constraints.py":1327 * * * 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, 1327, __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_t_3 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1327, __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_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1327, __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_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, 1327, __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) + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 1327, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1328 + /* "constraint/constraints.py":1338 * """ * * 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_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[73])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1338, __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) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_3) < 0) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1342 + /* "constraint/constraints.py":1352 * 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_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1352, __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) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1352, __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, 1352, __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, 1352, __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[74])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1352, __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) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 1352, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1317 + /* "constraint/constraints.py":1327 * * * 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_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, 1327, __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) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 1327, __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":1379 + /* "constraint/constraints.py":1389 * * * 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, 1389, __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_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1389, __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, 1379, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1389, __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_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1389, __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_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, 1389, __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) + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 1389, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1390 + /* "constraint/constraints.py":1400 * """ * * 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_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[75])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1400, __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) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 1400, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1404 + /* "constraint/constraints.py":1414 * 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_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1414, __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) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1414, __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, 1414, __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, 1414, __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[76])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1414, __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) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_3) < 0) __PYX_ERR(0, 1414, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1379 + /* "constraint/constraints.py":1389 * * * 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_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, 1389, __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) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 1389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -45556,6 +46568,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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___call___loc, sizeof(__pyx_k_ExactProdConstraint___call___loc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ExactProdConstraint___call___loc */ {__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 */ @@ -45573,6 +46586,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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___call___local, sizeof(__pyx_k_MaxProdConstraint___call___local), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxProdConstraint___call___local */ {__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 */ @@ -45822,7 +46836,7 @@ static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { __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_RuntimeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 1280, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -45845,14 +46859,14 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); - /* "constraint/constraints.py":862 + /* "constraint/constraints.py":867 * 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, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); @@ -45889,14 +46903,14 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); - /* "constraint/constraints.py":1328 + /* "constraint/constraints.py":1338 * """ * * 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_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, 1338, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]); __Pyx_RefNannyFinishContext(); @@ -45989,339 +47003,349 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { __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; } { - 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), 781, 2}; 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; } { - 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), 810, 2}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_value}; + __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_Q_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), 914, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 918, 2}; 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; } { - 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), 919, 2}; 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[11] = __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[11])) 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), 933, 2}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_c}; + __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_3, 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), 1075, 2}; 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[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_Q_3, 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), 1110, 2}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_value}; + __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, 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), 1104, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1139, 2}; 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[15] = __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[15])) 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), 1251, 2}; 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[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 11, 20}; 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[17] = __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[17])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 36, 109}; 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[18] = __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[18])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 64, 151}; 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[19] = __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[19])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 126, 25}; 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[20] = __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[20])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 138, 142}; 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[21] = __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[21])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 194, 23}; 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[22] = __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[22])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 198, 19}; 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[23] = __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[23])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 213, 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_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[24] = __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[24])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 251, 160}; 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[25] = __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[25])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 289, 27}; 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[26] = __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[26])) 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; + __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_preProcess, __pyx_k_77JJeef_QfKy_Q_d_4q_1_1Kq_IV1_v, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) 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; + __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_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[28])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 377, 86}; 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[29] = __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[29])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 396, 220}; 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[30] = __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[30])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 418, 347}; 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[31] = __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[31])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 481, 27}; 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[32] = __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[32])) 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; + __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_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[33])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 524, 86}; 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_k_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}; 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_k_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}; 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_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[36])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 595, 27}; 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_k_2_q_Kq_A, 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; + __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_k_77JJeef_QfKy_Q_6Q_L_7_gQa_q_d_Q, 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; + __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_k_55H_a_d_Q_a_1_1Kq_9Cq_az_1_z_q, 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}; 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_k_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}; 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_k_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}; 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_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[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), 765, 22}; 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_k_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), 774, 216}; 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_k_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), 802, 297}; + 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_k_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), 844, 25}; 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_k_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), 854, 161}; 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_k_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), 874, 24}; 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_k_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), 880, 167}; 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_k_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}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 32, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 895, 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; + __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_k_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), 952, 14}; 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_k_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), 960, 92}; 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_k_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), 971, 95}; 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_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[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), 998, 23}; 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_k_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), 1002, 148}; 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_k_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), 1020, 24}; 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_k_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), 1026, 138}; 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_k_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), 1039, 395}; 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_k_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), 1094, 22}; 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_k_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), 1103, 216}; 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_k_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), 1131, 287}; + 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_k_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), 1174, 23}; 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_k_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), 1178, 148}; 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_k_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), 1196, 24}; 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_k_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), 1202, 138}; 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_k_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), 1215, 395}; 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_k_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), 1270, 11}; 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_k_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), 1278, 14}; 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_k_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), 1282, 91}; 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_k_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), 1304, 11}; 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_k_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), 1312, 14}; 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_k_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), 1316, 91}; 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_k_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), 1338, 30}; 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_k_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), 1352, 249}; 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_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[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), 1400, 30}; 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_k_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), 1414, 249}; 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_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[76])) goto bad; } Py_DECREF(tuple_dedup_map); return 0; diff --git a/constraint/constraints.py b/constraint/constraints.py index c5038b9..59f2ce9 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -769,6 +769,7 @@ def __init__(self, exactprod: Union[int, float]): 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 +804,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] @@ -1093,6 +1098,7 @@ def __init__(self, maxprod: Union[int, float]): 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 +1133,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] diff --git a/pyproject.toml b/pyproject.toml index ca30069..e9dc285 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ 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.3.1" # 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"}, From 2b99fbf461cf766b41562283f661ddee8739986f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Jun 2025 04:53:10 +0000 Subject: [PATCH 46/87] Bump urllib3 from 2.3.0 to 2.5.0 in /docs Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.3.0 to 2.5.0. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/2.3.0...2.5.0) --- updated-dependencies: - dependency-name: urllib3 dependency-version: 2.5.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 4f61eb8..15d132e 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -29,5 +29,5 @@ 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" +urllib3==2.5.0 ; python_version >= "3.9" zipp==3.21.0 ; python_version >= "3.9" and python_version < "3.10" From d4b852e272c576d240ca8c9e6592b6d051866b75 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Wed, 25 Jun 2025 15:31:44 +0200 Subject: [PATCH 47/87] Extended tests for non-integer and mixed types --- tests/test_parser.py | 19 +++++++++++++++++++ tests/test_solvers.py | 34 +++++++++++++++++++++++++++++++--- 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/tests/test_parser.py b/tests/test_parser.py index 2d4117a..7788aff 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -137,3 +137,22 @@ def test_compile_to_constraints_picklable(): assert callable(r) else: assert isinstance(r, expected) + +def test_compile_non_numeric(): + domains = {"x": ["a", "b", "c"], "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) + 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 diff --git a/tests/test_solvers.py b/tests/test_solvers.py index adc4c31..2698537 100644 --- a/tests/test_solvers.py +++ b/tests/test_solvers.py @@ -94,7 +94,7 @@ 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) @@ -120,7 +120,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) @@ -175,4 +175,32 @@ 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]} + for var, domain in domains.items(): + problem.addVariable(var, domain) + constraints = [ + "x != 'a' or y < z", + "y or x != 'b'", + ] + problem.addConstraint(constraints) + solutions, _, _ = problem.getSolutionsAsListDict(order=list(domains.keys())) + + possible_solutions = [ + ('c', False, 1), + ('c', False, 0), + ('a', False, 1), + ('b', True, 0), + ('b', True, 1), + ('c', True, 0), + ('c', True, 1) + ] + + 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}" From 859d1ab4979fcb4669e46b824b4d24ad7d2c0f4c Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Wed, 25 Jun 2025 16:36:08 +0200 Subject: [PATCH 48/87] Extended tests for non-integer and mixed types --- tests/test_parser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_parser.py b/tests/test_parser.py index 7788aff..2219722 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -139,9 +139,9 @@ def test_compile_to_constraints_picklable(): assert isinstance(r, expected) def test_compile_non_numeric(): - domains = {"x": ["a", "b", "c"], "y": [True, False]} + domains = {"x": ["a2", "b4", "c6"], "y": [True, False]} constraints = [ - "x != 'a'", + "x == 'a'", "y == 'd' or x != 'b'", "'a' <= x + y < 'c'" ] @@ -150,7 +150,7 @@ def test_compile_non_numeric(): assert len(compiled) == 4 for r, vals, r_str in compiled: - assert isinstance(r, Constraint) + 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) From 055398130f149f582e3e6141b5888eabe1f1591b Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Thu, 10 Jul 2025 17:56:18 +0200 Subject: [PATCH 49/87] Improved error message, extended tests --- constraint/problem.c | 1028 ++++++++++++++++++++++------------------- constraint/problem.py | 4 +- tests/test_solvers.py | 22 +- 3 files changed, 570 insertions(+), 484 deletions(-) diff --git a/constraint/problem.c b/constraint/problem.c index 8a0f9e3..8cdb214 100644 --- a/constraint/problem.c +++ b/constraint/problem.c @@ -1566,7 +1566,7 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr { }; -/* "constraint/problem.py":286 +/* "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 # <<<<<<<<<<<<<< @@ -2159,24 +2159,6 @@ 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 -#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 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); @@ -2690,11 +2672,12 @@ 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__2[] = ", "; +static const char __pyx_k__3[] = "."; +static const char __pyx_k__4[] = "?"; +static const char __pyx_k__5[] = "\240\021"; +static const char __pyx_k__6[] = "\240\001"; +static const char __pyx_k__7[] = "_"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_Q_2[] = "\240Q"; static const char __pyx_k_doc[] = "__doc__"; @@ -2721,6 +2704,7 @@ 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_count[] = "count"; static const char __pyx_k_order[] = "order"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_reset[] = "reset"; @@ -2738,6 +2722,7 @@ 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_unique[] = " unique."; 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"; @@ -2780,6 +2765,7 @@ 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_Constraints[] = "Constraints: "; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_addVariable[] = "addVariable"; static const char __pyx_k_constraints[] = "_constraints"; @@ -2808,6 +2794,7 @@ 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_Duplicate_configs[] = "Duplicate configs: "; 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"; @@ -2849,12 +2836,12 @@ static const char __pyx_k_Problem_addConstraint_line_139[] = "Problem.addConstra 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_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\320&\\\320\\]\330\024\026\320\026-\250T\260\021\260#\260Q\260a\260r\270\024\270U\300/\320QT\320Tb\320bh\320hi\320il\320ln\320no\330\024\026\320\026'\240t\320+<\270D\300\001\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_duplicate_parameter_configurati[] = " duplicate parameter configurations out of "; 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 "; @@ -2953,7 +2940,8 @@ typedef struct { PyObject *__pyx_slice[1]; PyObject *__pyx_tuple[4]; PyObject *__pyx_codeobj_tab[17]; - PyObject *__pyx_string_tab[174]; + PyObject *__pyx_string_tab[179]; + PyObject *__pyx_int_1; /* #### Code section: module_state_contents ### */ #if CYTHON_USE_FREELISTS @@ -3031,170 +3019,175 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_Constraints __pyx_string_tab[10] +#define __pyx_kp_u_Constraints_must_be_instances_of __pyx_string_tab[11] +#define __pyx_n_u_Domain __pyx_string_tab[12] +#define __pyx_kp_u_Domain_is_empty __pyx_string_tab[13] +#define __pyx_kp_u_Domains_must_be_instances_of_sub __pyx_string_tab[14] +#define __pyx_kp_u_Duplicate_configs __pyx_string_tab[15] +#define __pyx_kp_u_Expected_constraints_to_be_strin __pyx_string_tab[16] +#define __pyx_kp_u_Find_and_return_a_solution_to_th __pyx_string_tab[17] +#define __pyx_kp_u_Find_and_return_all_solutions_to __pyx_string_tab[18] +#define __pyx_n_u_FunctionConstraint __pyx_string_tab[19] +#define __pyx_n_u_Hashable __pyx_string_tab[20] +#define __pyx_n_u_ImportError __pyx_string_tab[21] +#define __pyx_kp_u_None __pyx_string_tab[22] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[23] +#define __pyx_kp_u_Obtain_the_problem_solver_curren __pyx_string_tab[24] +#define __pyx_n_u_OptimizedBacktrackingSolver __pyx_string_tab[25] +#define __pyx_n_u_Optional __pyx_string_tab[26] +#define __pyx_kp_u_Optional_Sequence __pyx_string_tab[27] +#define __pyx_n_u_ParallelSolver __pyx_string_tab[28] +#define __pyx_kp_u_ParallelSolver_is_currently_expe __pyx_string_tab[29] +#define __pyx_n_u_Problem __pyx_string_tab[30] +#define __pyx_n_u_Problem___init __pyx_string_tab[31] +#define __pyx_n_u_Problem__getArgs __pyx_string_tab[32] +#define __pyx_n_u_Problem__getArgs_locals_genexpr __pyx_string_tab[33] +#define __pyx_n_u_Problem_addConstraint __pyx_string_tab[34] +#define __pyx_kp_u_Problem_addConstraint_line_139 __pyx_string_tab[35] +#define __pyx_n_u_Problem_addConstraint_locals_gen __pyx_string_tab[36] +#define __pyx_n_u_Problem_addVariable __pyx_string_tab[37] +#define __pyx_kp_u_Problem_addVariable_line_86 __pyx_string_tab[38] +#define __pyx_n_u_Problem_addVariables __pyx_string_tab[39] +#define __pyx_kp_u_Problem_addVariables_line_116 __pyx_string_tab[40] +#define __pyx_n_u_Problem_getSolution __pyx_string_tab[41] +#define __pyx_n_u_Problem_getSolutionIter __pyx_string_tab[42] +#define __pyx_kp_u_Problem_getSolutionIter_line_216 __pyx_string_tab[43] +#define __pyx_kp_u_Problem_getSolution_line_178 __pyx_string_tab[44] +#define __pyx_n_u_Problem_getSolutions __pyx_string_tab[45] +#define __pyx_n_u_Problem_getSolutionsAsListDict __pyx_string_tab[46] +#define __pyx_n_u_Problem_getSolutionsOrderedList __pyx_string_tab[47] +#define __pyx_n_u_Problem_getSolutionsOrderedList_2 __pyx_string_tab[48] +#define __pyx_kp_u_Problem_getSolutions_line_197 __pyx_string_tab[49] +#define __pyx_n_u_Problem_getSolver __pyx_string_tab[50] +#define __pyx_kp_u_Problem_getSolver_line_72 __pyx_string_tab[51] +#define __pyx_n_u_Problem_reset __pyx_string_tab[52] +#define __pyx_kp_u_Problem_reset_line_44 __pyx_string_tab[53] +#define __pyx_n_u_Problem_setSolver __pyx_string_tab[54] +#define __pyx_kp_u_Problem_setSolver_line_57 __pyx_string_tab[55] +#define __pyx_kp_u_Reset_the_current_problem_defini __pyx_string_tab[56] +#define __pyx_kp_u_Return_an_iterator_to_the_soluti __pyx_string_tab[57] +#define __pyx_n_u_Sequence __pyx_string_tab[58] +#define __pyx_n_u_Solver __pyx_string_tab[59] +#define __pyx_kp_u_Tried_to_insert_duplicated_varia __pyx_string_tab[60] +#define __pyx_n_u_TypeError __pyx_string_tab[61] +#define __pyx_n_u_Union __pyx_string_tab[62] +#define __pyx_kp_u_Union_Constraint_Callable_str __pyx_string_tab[63] +#define __pyx_kp_u_Using_the_ParallelSolver_in_Thre __pyx_string_tab[64] +#define __pyx_n_u_ValueError __pyx_string_tab[65] +#define __pyx_kp_u_You_have_used_FunctionConstraint __pyx_string_tab[66] +#define __pyx_kp_u__2 __pyx_string_tab[67] +#define __pyx_kp_u__3 __pyx_string_tab[68] +#define __pyx_kp_u__4 __pyx_string_tab[69] +#define __pyx_n_u__7 __pyx_string_tab[70] +#define __pyx_n_u_addConstraint __pyx_string_tab[71] +#define __pyx_n_u_addVariable __pyx_string_tab[72] +#define __pyx_n_u_addVariables __pyx_string_tab[73] +#define __pyx_kp_u_add_note __pyx_string_tab[74] +#define __pyx_n_u_allvariables __pyx_string_tab[75] +#define __pyx_n_u_append __pyx_string_tab[76] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[77] +#define __pyx_n_u_bool __pyx_string_tab[78] +#define __pyx_n_u_c __pyx_string_tab[79] +#define __pyx_n_u_clear __pyx_string_tab[80] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[81] +#define __pyx_n_u_close __pyx_string_tab[82] +#define __pyx_n_u_collections_abc __pyx_string_tab[83] +#define __pyx_n_u_compile_to_constraints __pyx_string_tab[84] +#define __pyx_n_u_constraint __pyx_string_tab[85] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[86] +#define __pyx_n_u_constraint_domain __pyx_string_tab[87] +#define __pyx_n_u_constraint_parser __pyx_string_tab[88] +#define __pyx_n_u_constraint_problem __pyx_string_tab[89] +#define __pyx_kp_u_constraint_problem_py __pyx_string_tab[90] +#define __pyx_n_u_constraint_solvers __pyx_string_tab[91] +#define __pyx_n_u_constraints __pyx_string_tab[92] +#define __pyx_n_u_constraints_2 __pyx_string_tab[93] +#define __pyx_n_u_copy __pyx_string_tab[94] +#define __pyx_n_u_count __pyx_string_tab[95] +#define __pyx_n_u_deepcopy __pyx_string_tab[96] +#define __pyx_kp_u_disable __pyx_string_tab[97] +#define __pyx_n_u_doc __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_duplicate_parameter_configurati __pyx_string_tab[101] +#define __pyx_kp_u_enable __pyx_string_tab[102] +#define __pyx_n_u_extend __pyx_string_tab[103] +#define __pyx_n_u_freethreading __pyx_string_tab[104] +#define __pyx_n_u_func __pyx_string_tab[105] +#define __pyx_kp_u_gc __pyx_string_tab[106] +#define __pyx_n_u_genexpr __pyx_string_tab[107] +#define __pyx_n_u_getArgs __pyx_string_tab[108] +#define __pyx_n_u_getSolution __pyx_string_tab[109] +#define __pyx_n_u_getSolutionIter __pyx_string_tab[110] +#define __pyx_n_u_getSolutions __pyx_string_tab[111] +#define __pyx_n_u_getSolutionsAsListDict __pyx_string_tab[112] +#define __pyx_n_u_getSolutionsOrderedList __pyx_string_tab[113] +#define __pyx_n_u_getSolver __pyx_string_tab[114] +#define __pyx_n_u_get_in_order __pyx_string_tab[115] +#define __pyx_n_u_getitem __pyx_string_tab[116] +#define __pyx_n_u_init __pyx_string_tab[117] +#define __pyx_n_u_initializing __pyx_string_tab[118] +#define __pyx_n_u_is_coroutine __pyx_string_tab[119] +#define __pyx_n_u_is_gil_enabled __pyx_string_tab[120] +#define __pyx_kp_u_isenabled __pyx_string_tab[121] +#define __pyx_n_u_itemgetter __pyx_string_tab[122] +#define __pyx_n_u_keys __pyx_string_tab[123] +#define __pyx_kp_u_list_str __pyx_string_tab[124] +#define __pyx_kp_u_list_tuple __pyx_string_tab[125] +#define __pyx_n_u_main __pyx_string_tab[126] +#define __pyx_n_u_metaclass __pyx_string_tab[127] +#define __pyx_n_u_module __pyx_string_tab[128] +#define __pyx_n_u_msg __pyx_string_tab[129] +#define __pyx_n_u_name __pyx_string_tab[130] +#define __pyx_n_u_next __pyx_string_tab[131] +#define __pyx_n_u_operator __pyx_string_tab[132] +#define __pyx_n_u_order __pyx_string_tab[133] +#define __pyx_n_u_params __pyx_string_tab[134] +#define __pyx_n_u_parsed __pyx_string_tab[135] +#define __pyx_n_u_picklable __pyx_string_tab[136] +#define __pyx_n_u_pop __pyx_string_tab[137] +#define __pyx_n_u_preProcess __pyx_string_tab[138] +#define __pyx_n_u_prepare __pyx_string_tab[139] +#define __pyx_n_u_process_mode __pyx_string_tab[140] +#define __pyx_n_u_qualname __pyx_string_tab[141] +#define __pyx_n_u_range __pyx_string_tab[142] +#define __pyx_n_u_requires_pickling __pyx_string_tab[143] +#define __pyx_n_u_reset __pyx_string_tab[144] +#define __pyx_n_u_resetState __pyx_string_tab[145] +#define __pyx_n_u_return __pyx_string_tab[146] +#define __pyx_n_u_self __pyx_string_tab[147] +#define __pyx_n_u_send __pyx_string_tab[148] +#define __pyx_n_u_setSolver __pyx_string_tab[149] +#define __pyx_n_u_set_name __pyx_string_tab[150] +#define __pyx_n_u_size_dict __pyx_string_tab[151] +#define __pyx_n_u_size_list __pyx_string_tab[152] +#define __pyx_n_u_solution __pyx_string_tab[153] +#define __pyx_n_u_solutions __pyx_string_tab[154] +#define __pyx_n_u_solutions_dict __pyx_string_tab[155] +#define __pyx_n_u_solutions_list __pyx_string_tab[156] +#define __pyx_n_u_solver __pyx_string_tab[157] +#define __pyx_n_u_solver_2 __pyx_string_tab[158] +#define __pyx_kp_u_solver_is_not_instance_of_Solve __pyx_string_tab[159] +#define __pyx_n_u_spec __pyx_string_tab[160] +#define __pyx_n_u_str_constraints __pyx_string_tab[161] +#define __pyx_n_u_sys __pyx_string_tab[162] +#define __pyx_n_u_test __pyx_string_tab[163] +#define __pyx_n_u_throw __pyx_string_tab[164] +#define __pyx_kp_u_tuple_list_tuple_dict_tuple_int __pyx_string_tab[165] +#define __pyx_n_u_typing __pyx_string_tab[166] +#define __pyx_kp_u_unique __pyx_string_tab[167] +#define __pyx_n_u_v __pyx_string_tab[168] +#define __pyx_n_u_validate __pyx_string_tab[169] +#define __pyx_n_u_value __pyx_string_tab[170] +#define __pyx_n_u_values __pyx_string_tab[171] +#define __pyx_n_u_variable __pyx_string_tab[172] +#define __pyx_n_u_variables __pyx_string_tab[173] +#define __pyx_n_u_variables_2 __pyx_string_tab[174] +#define __pyx_n_u_vconstraints __pyx_string_tab[175] +#define __pyx_n_u_warn __pyx_string_tab[176] +#define __pyx_n_u_warnings __pyx_string_tab[177] +#define __pyx_n_u_zip __pyx_string_tab[178] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3228,7 +3221,8 @@ 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<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]); } + for (int i=0; i<179; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + Py_CLEAR(clear_module_state->__pyx_int_1); return 0; } #endif @@ -3262,7 +3256,8 @@ 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<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]); } + for (int i=0; i<179; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1); return 0; } #endif @@ -6990,6 +6985,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic 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; @@ -7004,6 +7000,8 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; + PyObject *__pyx_t_13[4]; + PyObject *(*__pyx_t_14)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -7118,7 +7116,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * 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) @@ -7129,8 +7127,8 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * 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); @@ -7139,24 +7137,161 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic /* "constraint/problem.py":257 * if size_list != size_dict: * raise ValueError( - * f"{size_list - size_dict} duplicate parameter configurations in searchspace, should not happen." # <<<<<<<<<<<<<< - * ) - * return ( + * 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, 257, __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_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_PyObject_FormatSimple(__pyx_v_size_dict, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); + __pyx_t_13[0] = __pyx_t_8; + __pyx_t_13[1] = __pyx_mstate_global->__pyx_kp_u_duplicate_parameter_configurati; + __pyx_t_13[2] = __pyx_t_2; + __pyx_t_13[3] = __pyx_mstate_global->__pyx_kp_u_unique; + __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_13, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 43 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 8, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2)); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 257, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/problem.py":258 + * 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}" + * ) +*/ + { /* enter inner scope */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(PyList_CheckExact(__pyx_v_solutions_list)) || PyTuple_CheckExact(__pyx_v_solutions_list)) { + __pyx_t_8 = __pyx_v_solutions_list; __Pyx_INCREF(__pyx_t_8); + __pyx_t_4 = 0; + __pyx_t_14 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_solutions_list); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 258, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 258, __pyx_L7_error) + } + for (;;) { + if (likely(!__pyx_t_14)) { + 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, 258, __pyx_L7_error) + #endif + if (__pyx_t_4 >= __pyx_temp) break; + } + __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_4); + ++__pyx_t_4; + } 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, 258, __pyx_L7_error) + #endif + if (__pyx_t_4 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_4)); + #else + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_4); + #endif + ++__pyx_t_4; + } + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L7_error) + } else { + __pyx_t_7 = __pyx_t_14(__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, 258, __pyx_L7_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_c, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_11 = __pyx_v_solutions_list; + __Pyx_INCREF(__pyx_t_11); + __pyx_t_3 = 0; + { + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_8genexpr3__pyx_v_c}; + __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__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_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_7); + } + __pyx_t_11 = PyObject_RichCompare(__pyx_t_7, __pyx_mstate_global->__pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 258, __pyx_L7_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 258, __pyx_L7_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_12) { + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_8genexpr3__pyx_v_c))) __PYX_ERR(0, 258, __pyx_L7_error) + } + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_8 = PySet_New(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PySequence_List(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Duplicate_configs, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "constraint/problem.py":259 + * 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_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_constraints); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 259, __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, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_str_constraints); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __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_8); __pyx_t_8 = 0; + __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_Constraints; + __pyx_t_13[1] = __pyx_t_11; + __pyx_t_13[2] = __pyx_mstate_global->__pyx_kp_u__2; + __pyx_t_13[3] = __pyx_t_7; + __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_13, 4, 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 2 + __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_8)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_9, __pyx_t_2, __pyx_t_8}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __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_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -7170,7 +7305,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * 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.", */ } @@ -7183,8 +7318,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":261 + * f"Constraints: {self._constraints}, {self._str_constraints}" * ) * return ( # <<<<<<<<<<<<<< * solutions_list, @@ -7192,24 +7327,24 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic */ __Pyx_XDECREF(__pyx_r); - /* "constraint/problem.py":260 + /* "constraint/problem.py":262 * ) * 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, 262, __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, 262, __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, 262, __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, 262, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; @@ -7240,12 +7375,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":267 * ) * * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< @@ -7293,35 +7429,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, 267, __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, 267, __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, 267, __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, 267, __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, 267, __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, 267, __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, 267, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -7332,7 +7468,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, 267, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7354,7 +7490,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":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 # <<<<<<<<<<<<<< @@ -7374,7 +7510,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, 288, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -7382,7 +7518,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, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -7422,21 +7558,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, 288, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 288, __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, 288, __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, 286, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __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 +7580,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, 288, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -7454,22 +7590,22 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ __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) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __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) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __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, 288, __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, 288, __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, 288, __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 +7613,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, 288, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; @@ -7485,7 +7621,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, 288, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c); @@ -7496,9 +7632,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, 288, __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, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { __Pyx_XDECREF(__pyx_r); @@ -7540,7 +7676,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ return __pyx_r; } -/* "constraint/problem.py":265 +/* "constraint/problem.py":267 * ) * * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< @@ -7587,14 +7723,14 @@ 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":268 * * 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, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); @@ -7604,13 +7740,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __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_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, 268, __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":269 * def _getArgs(self, picklable=False): * domains = self._variables.copy() * allvariables = domains.keys() # <<<<<<<<<<<<<< @@ -7624,55 +7760,55 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE 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_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, 269, __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":270 * 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, 270, __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":273 * * # 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, 273, __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, 273, __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":275 * 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, 275, __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, 275, __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, 275, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -7681,7 +7817,7 @@ 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, 275, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -7691,7 +7827,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { 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, 275, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -7702,13 +7838,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, 275, __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, 275, __pyx_L1_error) PyErr_Clear(); } break; @@ -7718,7 +7854,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":276 * # 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 +7862,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, 276, __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, 276, __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, 276, __pyx_L1_error); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { @@ -7747,21 +7883,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, 276, __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) + 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, 276, __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); __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, 276, __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":277 * for constraint in self._str_constraints: * parsed = compile_to_constraints([constraint], domains, picklable=picklable) * for c, v, _ in parsed: # <<<<<<<<<<<<<< @@ -7773,9 +7909,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, 277, __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, 277, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_12)) { @@ -7783,7 +7919,7 @@ 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, 277, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -7793,7 +7929,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { 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, 277, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -7804,13 +7940,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, 277, __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, 277, __pyx_L1_error) PyErr_Clear(); } break; @@ -7823,7 +7959,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, 277, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -7835,27 +7971,27 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __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) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 277, __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) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 277, __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) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __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, 277, __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, 277, __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, 277, __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, 277, __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 +8001,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, 277, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L9_unpacking_done; @@ -7873,7 +8009,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, 277, __pyx_L1_error) __pyx_L9_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_10); @@ -7883,7 +8019,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":278 * parsed = compile_to_constraints([constraint], domains, picklable=picklable) * for c, v, _ in parsed: * self.addConstraint(c, v) # <<<<<<<<<<<<<< @@ -7897,12 +8033,12 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE 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_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, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/problem.py":275 + /* "constraint/problem.py":277 * for constraint in self._str_constraints: * parsed = compile_to_constraints([constraint], domains, picklable=picklable) * for c, v, _ in parsed: # <<<<<<<<<<<<<< @@ -7912,7 +8048,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":275 * 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 +8058,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":273 * * # parse string constraints * if len(self._str_constraints) > 0: # <<<<<<<<<<<<<< @@ -7931,23 +8067,23 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE */ } - /* "constraint/problem.py":279 + /* "constraint/problem.py":281 * * # 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, 281, __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, 281, __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, 281, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -7956,7 +8092,7 @@ 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, 281, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -7966,7 +8102,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { 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, 281, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -7977,13 +8113,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, 281, __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, 281, __pyx_L1_error) PyErr_Clear(); } break; @@ -7996,7 +8132,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, 281, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8006,22 +8142,22 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __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) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 281, __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) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __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, 281, __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, 281, __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, 281, __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 +8165,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, 281, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L15_unpacking_done; @@ -8037,7 +8173,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, 281, __pyx_L1_error) __pyx_L15_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_8); @@ -8045,30 +8181,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":282 * # 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, 282, __pyx_L1_error) __pyx_t_15 = (!__pyx_t_6); if (__pyx_t_15) { - /* "constraint/problem.py":281 + /* "constraint/problem.py":283 * 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, 283, __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":282 * # add regular constraints * for constraint, variables in self._constraints: * if not variables: # <<<<<<<<<<<<<< @@ -8077,25 +8213,25 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE */ } - /* "constraint/problem.py":282 + /* "constraint/problem.py":284 * 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, 284, __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, 284, __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, 284, __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, 284, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":279 + /* "constraint/problem.py":281 * * # add regular constraints * for constraint, variables in self._constraints: # <<<<<<<<<<<<<< @@ -8105,17 +8241,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":287 * * # 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, 287, __pyx_L1_error) if (__pyx_t_15) { - /* "constraint/problem.py":286 + /* "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 # <<<<<<<<<<<<<< @@ -8124,24 +8260,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, 288, __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, 288, __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, 288, __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_ERR(0, 288, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 286, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 288, __pyx_L1_error) #endif - /* "constraint/problem.py":285 + /* "constraint/problem.py":287 * * # check if there are any precompiled FunctionConstraints when there shouldn't be * if picklable: # <<<<<<<<<<<<<< @@ -8150,19 +8286,19 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE */ } - /* "constraint/problem.py":288 + /* "constraint/problem.py":290 * 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, 290, __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":291 * * vconstraints = {} * for variable in domains: # <<<<<<<<<<<<<< @@ -8174,9 +8310,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, 291, __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, 291, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -8184,7 +8320,7 @@ 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, 291, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -8194,7 +8330,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { 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, 291, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -8205,13 +8341,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, 291, __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, 291, __pyx_L1_error) PyErr_Clear(); } break; @@ -8221,19 +8357,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":292 * 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, 292, __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, 292, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":289 + /* "constraint/problem.py":291 * * vconstraints = {} * for variable in domains: # <<<<<<<<<<<<<< @@ -8243,7 +8379,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":293 * for variable in domains: * vconstraints[variable] = [] * for constraint, variables in constraints: # <<<<<<<<<<<<<< @@ -8256,13 +8392,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, 293, __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_5; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __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 +8406,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, 293, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8280,22 +8416,22 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __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) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 293, __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) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 293, __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, 293, __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, 293, __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, 293, __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 +8439,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, 293, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L25_unpacking_done; @@ -8311,7 +8447,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, 293, __pyx_L1_error) __pyx_L25_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_2); @@ -8319,7 +8455,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":294 * vconstraints[variable] = [] * for constraint, variables in constraints: * for variable in variables: # <<<<<<<<<<<<<< @@ -8331,9 +8467,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, 294, __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, 294, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -8341,7 +8477,7 @@ 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, 294, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -8351,7 +8487,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { 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, 294, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -8362,13 +8498,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, 294, __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, 294, __pyx_L1_error) PyErr_Clear(); } break; @@ -8378,28 +8514,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":295 * 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, 295, __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, 295, __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, 295, __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, 295, __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, 295, __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":294 * vconstraints[variable] = [] * for constraint, variables in constraints: * for variable in variables: # <<<<<<<<<<<<<< @@ -8409,7 +8545,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":293 * for variable in domains: * vconstraints[variable] = [] * for constraint, variables in constraints: # <<<<<<<<<<<<<< @@ -8419,14 +8555,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":296 * 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, 296, __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 +8571,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, 296, __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_5; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __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 +8585,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, 296, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8459,22 +8595,22 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __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) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __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) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 296, __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, 296, __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, 296, __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, 296, __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 +8618,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, 296, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L33_unpacking_done; @@ -8490,7 +8626,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, 296, __pyx_L1_error) __pyx_L33_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_2); @@ -8498,7 +8634,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":297 * vconstraints[variable].append((constraint, variables)) * for constraint, variables in constraints[:]: * constraint.preProcess(variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -8512,12 +8648,12 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE 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_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, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":294 + /* "constraint/problem.py":296 * for variable in variables: * vconstraints[variable].append((constraint, variables)) * for constraint, variables in constraints[:]: # <<<<<<<<<<<<<< @@ -8527,7 +8663,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":298 * for constraint, variables in constraints[:]: * constraint.preProcess(variables, domains, constraints, vconstraints) * for domain in domains.values(): # <<<<<<<<<<<<<< @@ -8537,9 +8673,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, 298, __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, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_3; @@ -8547,12 +8683,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, 298, __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":299 * constraint.preProcess(variables, domains, constraints, vconstraints) * for domain in domains.values(): * domain.resetState() # <<<<<<<<<<<<<< @@ -8566,23 +8702,23 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE 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_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, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":298 + /* "constraint/problem.py":300 * 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, 300, __pyx_L1_error) __pyx_t_15 = (!__pyx_t_6); if (__pyx_t_15) { - /* "constraint/problem.py":299 + /* "constraint/problem.py":301 * domain.resetState() * if not domain: * return None, None, None # <<<<<<<<<<<<<< @@ -8595,7 +8731,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":300 * for domain in domains.values(): * domain.resetState() * if not domain: # <<<<<<<<<<<<<< @@ -8606,28 +8742,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":303 * 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, 303, __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, 303, __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, 303, __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, 303, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/problem.py":265 + /* "constraint/problem.py":267 * ) * * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< @@ -9598,15 +9734,15 @@ 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, 288, __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, 288, __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, 288, __pyx_L1_error) #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)) { @@ -10435,17 +10571,17 @@ __Pyx_RefNannySetupContext("PyInit_problem", 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; - /* "constraint/problem.py":265 + /* "constraint/problem.py":267 * ) * * 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_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, 267, __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) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getArgs, __pyx_t_6) < 0) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/problem.py":21 @@ -10550,10 +10686,12 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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, sizeof(__pyx_k_Constraints), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraints */ {__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_Duplicate_configs, sizeof(__pyx_k_Duplicate_configs), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Duplicate_configs */ {__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 */ @@ -10607,7 +10745,8 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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__4, sizeof(__pyx_k__4), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__4 */ + {__pyx_k__7, sizeof(__pyx_k__7), 0, 1, 1}, /* PyObject cname: __pyx_n_u__7 */ {__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 */ @@ -10632,6 +10771,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_count, sizeof(__pyx_k_count), 0, 1, 1}, /* PyObject cname: __pyx_n_u_count */ {__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 */ @@ -10703,6 +10843,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_unique, sizeof(__pyx_k_unique), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_unique */ {__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 */ @@ -10751,14 +10892,14 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); - /* "constraint/problem.py":299 + /* "constraint/problem.py":301 * 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, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); @@ -10784,14 +10925,14 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); - /* "constraint/problem.py":265 + /* "constraint/problem.py":267 * ) * * 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_mstate_global->__pyx_tuple[3] = PyTuple_Pack(1, ((PyObject*)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_RefNannyFinishContext(); @@ -10807,6 +10948,7 @@ static int __Pyx_InitConstants(__pyx_mstatetype *__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); + __pyx_mstate->__pyx_int_1 = PyLong_FromLong(1); if (unlikely(!__pyx_mstate->__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -10839,7 +10981,7 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { { const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 162, 2}; 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_k__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}; @@ -10849,11 +10991,11 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { { const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 243, 2}; 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_k__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}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 288, 2}; + 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_k_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; } { @@ -10912,13 +11054,13 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { __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; } { - 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}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 245, 173}; + 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_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 = {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}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 267, 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__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_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; } Py_DECREF(tuple_dedup_map); @@ -12961,70 +13103,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) { @@ -13889,7 +13967,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; } @@ -15751,7 +15829,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; } diff --git a/constraint/problem.py b/constraint/problem.py index 0ae1e07..8fd8375 100644 --- a/constraint/problem.py +++ b/constraint/problem.py @@ -254,7 +254,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/tests/test_solvers.py b/tests/test_solvers.py index 2698537..fafc863 100644 --- a/tests/test_solvers.py +++ b/tests/test_solvers.py @@ -180,24 +180,30 @@ def create_problem(solver): 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]} + 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), - ('c', False, 0), - ('a', False, 1), - ('b', True, 0), - ('b', True, 1), - ('c', True, 0), - ('c', True, 1) + ('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" From c781cd2681687c89c4213d86a3f7db3989c3fa44 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Tue, 22 Jul 2025 16:14:55 +0200 Subject: [PATCH 50/87] README.rst is now part of the pytests via doctests --- README.rst | 20 +++++------ tests/test_doctests.py | 79 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 12 deletions(-) diff --git a/README.rst b/README.rst index e0b8031..cbc5ea4 100644 --- a/README.rst +++ b/README.rst @@ -41,11 +41,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 +53,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 +72,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 +101,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 -------- diff --git a/tests/test_doctests.py b/tests/test_doctests.py index 6e29711..5b608cf 100644 --- a/tests/test_doctests.py +++ b/tests/test_doctests.py @@ -4,7 +4,86 @@ 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 load_tests(loader, tests, ignore): +# tests.addTests(doctest.DocFileSuite( +# "../README.rst", +# module_relative=False, +# optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS +# )) +# raise ValueError(tests) +# return tests + +# assert doctest.testfile("../README.rst") + +def extract_python_code_blocks(path): + with open(path, encoding="utf-8") as f: + content = f.read() + + # # Match ".. code-block:: python" and capture the following indented block + # pattern = re.compile( + # r""" + # ^\.\. # literal ".." + # \s+code-block:: # " code-block::" + # \s+python # " python" + # \s* # optional trailing whitespace + # \n\n # blank line after directive + # ((?:[ ]{4}.*\n?)+) # capture indented block (4 spaces) + # """, + # re.MULTILINE | re.VERBOSE + # ) + + # 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) From 5aa8f7469eef66691b9a24e4d8921f615de42d6f Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Tue, 22 Jul 2025 17:23:43 +0200 Subject: [PATCH 51/87] Fixed an issue described in #101, other minor improvements --- README.rst | 1 + constraint/parser.c | 3793 +++++++++++++++++++++++----------------- constraint/parser.py | 9 + pyproject.toml | 6 +- tests/test_doctests.py | 24 - tests/test_parser.py | 14 +- 6 files changed, 2233 insertions(+), 1614 deletions(-) diff --git a/README.rst b/README.rst index cbc5ea4..c09690c 100644 --- a/README.rst +++ b/README.rst @@ -177,6 +177,7 @@ For an overview of recent changes, visit the `Changelog 0: # adjust when we support modifiers such as multipliers +*/ +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":177 * * # 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 +1638,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr { }; -/* "constraint/parser.py":169 +/* "constraint/parser.py":178 * # 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 +1653,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr { }; -/* "constraint/parser.py":172 +/* "constraint/parser.py":181 * 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] == "+": */ -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 +1668,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr { }; -/* "constraint/parser.py":238 +/* "constraint/parser.py":247 * # 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 +1683,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr { }; -/* "constraint/parser.py":245 +/* "constraint/parser.py":254 * 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 +1698,43 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr { }; -/* "constraint/parser.py":269 +/* "constraint/parser.py":278 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: */ -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":297 * 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":307 * * # 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] */ -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; @@ -2482,6 +2498,18 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, /* RaiseUnexpectedTypeError.proto */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); +/* py_dict_keys.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d); + +/* 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 + /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); @@ -2807,6 +2835,7 @@ static PyObject *__pyx_builtin_compile; static const char __pyx_k_[] = "']]"; static const char __pyx_k_1[] = "\2401"; static const char __pyx_k_Q[] = "\260Q"; +static const char __pyx_k_d[] = "[+-]?\\d+"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_m[] = "m"; static const char __pyx_k_o[] = "o"; @@ -2851,13 +2880,16 @@ 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_q_2[] = "\230q"; 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_var[] = "var"; 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_keys[] = "keys"; static const char __pyx_k_left[] = "left"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; @@ -2907,6 +2939,7 @@ 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_Variables[] = "Variables "; 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"; @@ -2964,6 +2997,7 @@ 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_not_in_tune_params[] = " not in tune_params "; 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"; @@ -3003,12 +3037,12 @@ static const char __pyx_k_restrictions_unique_indices[] = "restrictions_unique_i 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_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\020\210s\220!\220;\230c\240\021\330\020\027\220q\330\014\037\230q\330\020\026\220j\240\001\240\022\240>\3201P\320P[\320[`\320`a\330\014\017\210s\220!\2202\220X\230Q\230l\250.\270\002\270!\340\020\027\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\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_Ya_1_q_Q2_U_J_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\360J\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#\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."; @@ -3041,6 +3075,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric 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_26genexpr(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 */ @@ -3058,9 +3093,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 */ @@ -3110,9 +3146,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,16 +3161,18 @@ 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_keys; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; __Pyx_CachedCFunction __pyx_umethod_PyList_Type__index; __Pyx_CachedCFunction __pyx_umethod_PySet_Type__union; PyObject *__pyx_slice[4]; PyObject *__pyx_tuple[4]; - PyObject *__pyx_codeobj_tab[19]; - PyObject *__pyx_string_tab[205]; + PyObject *__pyx_codeobj_tab[20]; + PyObject *__pyx_string_tab[210]; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_neg_1; @@ -3203,19 +3242,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; @@ -3280,180 +3324,185 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_Variables __pyx_string_tab[31] +#define __pyx_kp_u__10 __pyx_string_tab[32] +#define __pyx_kp_u__11 __pyx_string_tab[33] +#define __pyx_kp_u__12 __pyx_string_tab[34] +#define __pyx_kp_u__13 __pyx_string_tab[35] +#define __pyx_kp_u__14 __pyx_string_tab[36] +#define __pyx_kp_u__15 __pyx_string_tab[37] +#define __pyx_kp_u__16 __pyx_string_tab[38] +#define __pyx_kp_u__17 __pyx_string_tab[39] +#define __pyx_kp_u__18 __pyx_string_tab[40] +#define __pyx_kp_u__19 __pyx_string_tab[41] +#define __pyx_kp_u__2 __pyx_string_tab[42] +#define __pyx_kp_u__20 __pyx_string_tab[43] +#define __pyx_kp_u__21 __pyx_string_tab[44] +#define __pyx_kp_u__22 __pyx_string_tab[45] +#define __pyx_kp_u__23 __pyx_string_tab[46] +#define __pyx_kp_u__24 __pyx_string_tab[47] +#define __pyx_kp_u__3 __pyx_string_tab[48] +#define __pyx_kp_u__4 __pyx_string_tab[49] +#define __pyx_kp_u__5 __pyx_string_tab[50] +#define __pyx_kp_u__6 __pyx_string_tab[51] +#define __pyx_kp_u__7 __pyx_string_tab[52] +#define __pyx_kp_u__8 __pyx_string_tab[53] +#define __pyx_kp_u__9 __pyx_string_tab[54] +#define __pyx_kp_u_a_zA_Z__0_9 __pyx_string_tab[55] +#define __pyx_kp_u_a_zA_Z__a_zA_Z__0_9 __pyx_string_tab[56] +#define __pyx_kp_u_add_note __pyx_string_tab[57] +#define __pyx_kp_u_and __pyx_string_tab[58] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[59] +#define __pyx_n_u_class_getitem __pyx_string_tab[60] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[61] +#define __pyx_n_u_close __pyx_string_tab[62] +#define __pyx_n_u_co_consts __pyx_string_tab[63] +#define __pyx_n_u_code_object __pyx_string_tab[64] +#define __pyx_n_u_comparator __pyx_string_tab[65] +#define __pyx_n_u_comparators __pyx_string_tab[66] +#define __pyx_n_u_comparators_found __pyx_string_tab[67] +#define __pyx_n_u_comparators_indices __pyx_string_tab[68] +#define __pyx_n_u_compile __pyx_string_tab[69] +#define __pyx_n_u_compile_to_constraints __pyx_string_tab[70] +#define __pyx_n_u_compiled_constraints __pyx_string_tab[71] +#define __pyx_n_u_constraint __pyx_string_tab[72] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[73] +#define __pyx_n_u_constraint_parser __pyx_string_tab[74] +#define __pyx_kp_u_constraint_parser_py __pyx_string_tab[75] +#define __pyx_n_u_constraints __pyx_string_tab[76] +#define __pyx_kp_u_d __pyx_string_tab[77] +#define __pyx_kp_u_def_r __pyx_string_tab[78] +#define __pyx_n_u_dict __pyx_string_tab[79] +#define __pyx_kp_u_disable __pyx_string_tab[80] +#define __pyx_n_u_domains __pyx_string_tab[81] +#define __pyx_kp_u_enable __pyx_string_tab[82] +#define __pyx_n_u_end __pyx_string_tab[83] +#define __pyx_n_u_equalities_found __pyx_string_tab[84] +#define __pyx_n_u_eval __pyx_string_tab[85] +#define __pyx_n_u_exec __pyx_string_tab[86] +#define __pyx_n_u_finalized_constraint __pyx_string_tab[87] +#define __pyx_n_u_findall __pyx_string_tab[88] +#define __pyx_n_u_finditer __pyx_string_tab[89] +#define __pyx_n_u_fromkeys __pyx_string_tab[90] +#define __pyx_n_u_func __pyx_string_tab[91] +#define __pyx_n_u_func_2 __pyx_string_tab[92] +#define __pyx_kp_u_gc __pyx_string_tab[93] +#define __pyx_n_u_genexpr __pyx_string_tab[94] +#define __pyx_n_u_group __pyx_string_tab[95] +#define __pyx_n_u_i __pyx_string_tab[96] +#define __pyx_n_u_index __pyx_string_tab[97] +#define __pyx_n_u_inequalities_found __pyx_string_tab[98] +#define __pyx_n_u_initializing __pyx_string_tab[99] +#define __pyx_n_u_is_coroutine __pyx_string_tab[100] +#define __pyx_kp_u_is_neither_a_string_or_Constrai __pyx_string_tab[101] +#define __pyx_n_u_is_or_evals_to_number __pyx_string_tab[102] +#define __pyx_kp_u_isenabled __pyx_string_tab[103] +#define __pyx_n_u_key __pyx_string_tab[104] +#define __pyx_n_u_keys __pyx_string_tab[105] +#define __pyx_n_u_left __pyx_string_tab[106] +#define __pyx_n_u_left_num __pyx_string_tab[107] +#define __pyx_n_u_left_remainder __pyx_string_tab[108] +#define __pyx_n_u_left_swap __pyx_string_tab[109] +#define __pyx_kp_u_list_str __pyx_string_tab[110] +#define __pyx_kp_u_list_tuple_Constraint_list_str_U __pyx_string_tab[111] +#define __pyx_kp_u_list_tuple_Union_Constraint_str __pyx_string_tab[112] +#define __pyx_n_u_m __pyx_string_tab[113] +#define __pyx_n_u_main __pyx_string_tab[114] +#define __pyx_n_u_match_object __pyx_string_tab[115] +#define __pyx_n_u_module __pyx_string_tab[116] +#define __pyx_n_u_name __pyx_string_tab[117] +#define __pyx_n_u_next __pyx_string_tab[118] +#define __pyx_n_u_next_stop __pyx_string_tab[119] +#define __pyx_kp_u_not_in_tune_params __pyx_string_tab[120] +#define __pyx_n_u_number __pyx_string_tab[121] +#define __pyx_n_u_o __pyx_string_tab[122] +#define __pyx_n_u_offset __pyx_string_tab[123] +#define __pyx_n_u_operator __pyx_string_tab[124] +#define __pyx_n_u_operators __pyx_string_tab[125] +#define __pyx_n_u_operators_found __pyx_string_tab[126] +#define __pyx_n_u_operators_left __pyx_string_tab[127] +#define __pyx_n_u_operators_right __pyx_string_tab[128] +#define __pyx_kp_u_or __pyx_string_tab[129] +#define __pyx_n_u_p __pyx_string_tab[130] +#define __pyx_n_u_param __pyx_string_tab[131] +#define __pyx_n_u_params __pyx_string_tab[132] +#define __pyx_kp_u_params_params_index __pyx_string_tab[133] +#define __pyx_n_u_params_used __pyx_string_tab[134] +#define __pyx_n_u_params_used_list __pyx_string_tab[135] +#define __pyx_n_u_parse_restrictions __pyx_string_tab[136] +#define __pyx_n_u_parse_restrictions_locals_genexp __pyx_string_tab[137] +#define __pyx_n_u_parse_restrictions_locals_replac __pyx_string_tab[138] +#define __pyx_n_u_parse_restrictions_locals_replac_2 __pyx_string_tab[139] +#define __pyx_n_u_parse_restrictions_locals_to_equ __pyx_string_tab[140] +#define __pyx_n_u_parse_restrictions_locals_to_equ_2 __pyx_string_tab[141] +#define __pyx_n_u_parse_restrictions_locals_to_mul __pyx_string_tab[142] +#define __pyx_n_u_parse_restrictions_locals_to_num __pyx_string_tab[143] +#define __pyx_n_u_parse_restrictions_locals_to_num_2 __pyx_string_tab[144] +#define __pyx_n_u_parse_restrictions_locals_to_num_3 __pyx_string_tab[145] +#define __pyx_n_u_parse_restrictions_locals_to_num_4 __pyx_string_tab[146] +#define __pyx_n_u_parsed_restriction __pyx_string_tab[147] +#define __pyx_n_u_parsed_restrictions __pyx_string_tab[148] +#define __pyx_n_u_picklable __pyx_string_tab[149] +#define __pyx_n_u_pop __pyx_string_tab[150] +#define __pyx_n_u_prev_stop __pyx_string_tab[151] +#define __pyx_n_u_qualname __pyx_string_tab[152] +#define __pyx_n_u_r __pyx_string_tab[153] +#define __pyx_n_u_range __pyx_string_tab[154] +#define __pyx_n_u_re __pyx_string_tab[155] +#define __pyx_n_u_regex_match_variable __pyx_string_tab[156] +#define __pyx_n_u_regex_match_variable_or_constant __pyx_string_tab[157] +#define __pyx_n_u_replace __pyx_string_tab[158] +#define __pyx_n_u_replace_params __pyx_string_tab[159] +#define __pyx_n_u_replace_params_split __pyx_string_tab[160] +#define __pyx_n_u_res __pyx_string_tab[161] +#define __pyx_n_u_restriction __pyx_string_tab[162] +#define __pyx_n_u_restrictions __pyx_string_tab[163] +#define __pyx_n_u_restrictions_cleaned __pyx_string_tab[164] +#define __pyx_n_u_restrictions_cleaned_unique __pyx_string_tab[165] +#define __pyx_n_u_restrictions_unique_indices __pyx_string_tab[166] +#define __pyx_n_u_return __pyx_string_tab[167] +#define __pyx_kp_u_return_2 __pyx_string_tab[168] +#define __pyx_n_u_right __pyx_string_tab[169] +#define __pyx_n_u_right_num __pyx_string_tab[170] +#define __pyx_n_u_right_remainder __pyx_string_tab[171] +#define __pyx_n_u_right_swap __pyx_string_tab[172] +#define __pyx_n_u_s __pyx_string_tab[173] +#define __pyx_n_u_search __pyx_string_tab[174] +#define __pyx_n_u_send __pyx_string_tab[175] +#define __pyx_n_u_set_name __pyx_string_tab[176] +#define __pyx_n_u_spec __pyx_string_tab[177] +#define __pyx_n_u_split __pyx_string_tab[178] +#define __pyx_n_u_split_restrictions __pyx_string_tab[179] +#define __pyx_n_u_splitted __pyx_string_tab[180] +#define __pyx_n_u_start __pyx_string_tab[181] +#define __pyx_n_u_str __pyx_string_tab[182] +#define __pyx_kp_u_string __pyx_string_tab[183] +#define __pyx_n_u_strip __pyx_string_tab[184] +#define __pyx_n_u_sub __pyx_string_tab[185] +#define __pyx_n_u_supported_operators __pyx_string_tab[186] +#define __pyx_n_u_swapped_side_first_component __pyx_string_tab[187] +#define __pyx_n_u_temp_copy __pyx_string_tab[188] +#define __pyx_n_u_test __pyx_string_tab[189] +#define __pyx_n_u_throw __pyx_string_tab[190] +#define __pyx_n_u_to_equality_constraint __pyx_string_tab[191] +#define __pyx_n_u_to_multiple_restrictions __pyx_string_tab[192] +#define __pyx_n_u_to_numeric_constraint __pyx_string_tab[193] +#define __pyx_n_u_tune_params __pyx_string_tab[194] +#define __pyx_n_u_types __pyx_string_tab[195] +#define __pyx_n_u_typing __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_var __pyx_string_tab[203] +#define __pyx_n_u_variable_operators_left __pyx_string_tab[204] +#define __pyx_n_u_variable_operators_right __pyx_string_tab[205] +#define __pyx_n_u_variable_supported_operators __pyx_string_tab[206] +#define __pyx_n_u_variable_unique_operators __pyx_string_tab[207] +#define __pyx_n_u_variables __pyx_string_tab[208] +#define __pyx_n_u_variables_on_left __pyx_string_tab[209] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3496,16 +3545,18 @@ 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]); } + for (int i=0; i<20; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<210; ++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); @@ -3551,16 +3602,18 @@ 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]); } + for (int i=0; i<20; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<210; ++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); @@ -5808,12 +5861,12 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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 */ -/* "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":170 + * 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('[+-]?\d+', restriction)) > 0: # adjust when we support modifiers such as multipliers */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { @@ -5828,7 +5881,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, 170, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5839,7 +5892,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_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, 170, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5860,6 +5913,187 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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; + 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; + __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) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 170, __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, 170, __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, 170, __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, 170, __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, 170, __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, 170, __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, 170, __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(__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, 170, __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, 170, __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, 170, __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, 170, __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_4); + __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_16generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "constraint/parser.py":177 + * + * # 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))) +*/ + +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_14genexpr(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 + 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_7_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 177, __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_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, 177, __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_16generator5(__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; + PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; int __pyx_t_4; @@ -5877,11 +6111,11 @@ 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) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 177, __pyx_L1_error) + __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 177, __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) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 177, __pyx_L1_error) } + __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -5890,20 +6124,20 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 177, __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_t_1)) __PYX_ERR(0, 177, __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 (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_variable_supported_operators)) { __Pyx_RaiseClosureNameError("variable_supported_operators"); __PYX_ERR(0, 177, __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, 177, __pyx_L1_error) if (__pyx_t_4) { __pyx_t_5 = __pyx_cur_scope->__pyx_v_s; __Pyx_INCREF(__pyx_t_5); @@ -5912,10 +6146,10 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __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) + if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } } @@ -5943,9 +6177,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_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_19generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":169 +/* "constraint/parser.py":178 * # 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) # <<<<<<<<<<<<<< @@ -5953,19 +6187,19 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric * # 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) { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *__pyx_cur_scope; +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_17genexpr(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 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_7_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_8_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 169, __pyx_L1_error) + __PYX_ERR(0, 178, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5976,7 +6210,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_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, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5992,9 +6226,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_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_19generator6(__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); + 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; @@ -6014,11 +6248,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 169, __pyx_L1_error) - __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 169, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 169, __pyx_L1_error) } - __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 178, __pyx_L1_error) } + __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -6027,20 +6261,20 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 169, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 178, __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, 169, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __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, 169, __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, 169, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_variable_supported_operators)) { __Pyx_RaiseClosureNameError("variable_supported_operators"); __PYX_ERR(0, 178, __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, 178, __pyx_L1_error) if (__pyx_t_4) { __pyx_t_5 = __pyx_cur_scope->__pyx_v_s; __Pyx_INCREF(__pyx_t_5); @@ -6049,10 +6283,10 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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, 169, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 169, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } } @@ -6080,9 +6314,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_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_22generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":172 +/* "constraint/parser.py":181 * 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 # <<<<<<<<<<<<<< @@ -6090,19 +6324,19 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric * 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) { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *__pyx_cur_scope; +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; 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_8_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_8_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __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_8_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 172, __pyx_L1_error) + __PYX_ERR(0, 181, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6113,7 +6347,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_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, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6129,9 +6363,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_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_22generator7(__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); + 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; @@ -6153,16 +6387,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, 181, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 181, __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, 181, __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, 181, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6170,7 +6404,7 @@ 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, 181, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6180,7 +6414,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 181, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6191,13 +6425,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, 181, __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, 181, __pyx_L1_error) PyErr_Clear(); } break; @@ -6215,11 +6449,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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_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, 181, __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, 181, __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, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = (!__pyx_t_7); if (__pyx_t_8) { @@ -6259,9 +6493,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_25generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":238 +/* "constraint/parser.py":247 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< @@ -6269,19 +6503,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_23genexpr(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, 247, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6292,7 +6526,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_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, 247, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6308,9 +6542,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_25generator8(__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 +6564,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, 247, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 247, __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, 247, __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, 247, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6347,7 +6581,7 @@ 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, 247, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6357,7 +6591,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 247, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6368,13 +6602,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, 247, __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, 247, __pyx_L1_error) PyErr_Clear(); } break; @@ -6385,9 +6619,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, 247, __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, 247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { @@ -6426,9 +6660,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_28generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":245 +/* "constraint/parser.py":254 * 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 +6670,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_26genexpr(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, 254, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6459,7 +6693,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_28generator9, ((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, 254, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6475,9 +6709,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_28generator9(__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 +6733,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, 254, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 254, __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, 254, __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, 254, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6516,7 +6750,7 @@ 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, 254, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6526,7 +6760,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 254, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6537,13 +6771,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, 254, __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, 254, __pyx_L1_error) PyErr_Clear(); } break; @@ -6561,11 +6795,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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_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, 254, __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, 254, __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, 254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = (!__pyx_t_7); if (__pyx_t_8) { @@ -6657,6 +6891,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ 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_28generator9 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -7745,7 +7980,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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_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[10])); 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; @@ -7832,7 +8067,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # 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) @@ -7866,148 +8101,307 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ /* "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))) + * # 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, 168, __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) # <<<<<<<<<<<<<< + /* "constraint/parser.py":169 + * # 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_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "constraint/parser.py":168 + * + * # 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): +*/ + } + + /* "constraint/parser.py":170 + * 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('[+-]?\d+', restriction)) > 0: # adjust when we support modifiers such as multipliers +*/ + __pyx_t_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_variables); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __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, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(__pyx_t_1)) { + + /* "constraint/parser.py":171 + * 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('[+-]?\d+', restriction)) > 0: # adjust when we support modifiers such as multipliers + * # if the restriction contains numbers, return None +*/ + __pyx_t_5 = NULL; + __Pyx_INCREF(__pyx_builtin_ValueError); + __pyx_t_2 = __pyx_builtin_ValueError; + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_variables, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 171, __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, 171, __pyx_L1_error) + } + __pyx_t_11 = __Pyx_PyDict_Keys(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tune_params); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_t_11, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Variables; + __pyx_t_10[1] = __pyx_t_8; + __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_not_in_tune_params; + __pyx_t_10[3] = __pyx_t_12; + __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 20 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12)); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_9 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_11}; + __pyx_t_7 = __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_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 171, __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, 171, __pyx_L1_error) + + /* "constraint/parser.py":170 + * 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('[+-]?\d+', restriction)) > 0: # adjust when we support modifiers such as multipliers +*/ + } + + /* "constraint/parser.py":172 + * 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('[+-]?\d+', restriction)) > 0: # adjust when we support modifiers such as multipliers # <<<<<<<<<<<<<< + * # if the restriction contains numbers, return None + * return None +*/ + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_9 = 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); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); + __pyx_t_9 = 0; + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_d, __pyx_v_restriction}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_5, __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; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __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, 172, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_1 = (__pyx_t_3 > 0); + if (__pyx_t_1) { + + /* "constraint/parser.py":174 + * if len(re.findall('[+-]?\d+', restriction)) > 0: # adjust when we support modifiers such as multipliers + * # 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":172 + * 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('[+-]?\d+', restriction)) > 0: # adjust when we support modifiers such as multipliers # <<<<<<<<<<<<<< + * # if the restriction contains numbers, return None + * return None +*/ + } + + /* "constraint/parser.py":177 + * + * # 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_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_t_7 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_14genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_left); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 177, __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_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 177, __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_v_variable_operators_left = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/parser.py":170 + /* "constraint/parser.py":178 + * # 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_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_17genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __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, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_variable_operators_right = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + + /* "constraint/parser.py":179 * 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 */ - __pyx_t_2 = PySet_New(__pyx_v_variable_operators_left); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_2 = PySet_New(__pyx_v_variable_operators_left); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __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_5 = __pyx_t_2; + __Pyx_INCREF(__pyx_t_5); + __pyx_t_11 = PySet_New(__pyx_v_variable_operators_right); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __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; + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_11}; + __pyx_t_7 = __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_5); __pyx_t_5 = 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, 170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_2 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_2 = PySequence_List(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_variable_unique_operators = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":172 + /* "constraint/parser.py":181 * 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] == "+": */ - __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_3 = __Pyx_PyList_GET_SIZE(__pyx_v_variable_unique_operators); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 181, __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; + goto __pyx_L57_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_20genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __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, 181, __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; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 181, __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_L54_bool_binop_done; + goto __pyx_L57_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_3 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators_left); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 181, __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_L57_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, 181, __pyx_L1_error) __pyx_t_6 = (__pyx_t_3 == 0); __pyx_t_1 = __pyx_t_6; - __pyx_L54_bool_binop_done:; + __pyx_L57_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":173 + /* "constraint/parser.py":182 * # 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 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, 182, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBool_FromLong((__pyx_t_3 > 0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 182, __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 + /* "constraint/parser.py":183 * 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 */ - __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, 183, __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_L62_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); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_mstate_global->__pyx_kp_u__10, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_1 = __pyx_t_6; - __pyx_L59_bool_binop_done:; + __pyx_L62_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":175 + /* "constraint/parser.py":184 * 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 == "<=": */ - __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, 184, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":176 + /* "constraint/parser.py":185 * 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 # <<<<<<<<<<<<<< @@ -8015,77 +8409,77 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # "B+C <= A" (maxsum) if variables_on_left else "A <= B+C" (minsum) */ __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) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 185, __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) - __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_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); + __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, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __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_5))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); + assert(__pyx_t_11); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __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_11, __pyx_t_12, __pyx_t_8}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __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_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_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_2; + __pyx_t_7 = __pyx_t_2; __pyx_t_2 = 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) + __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 185, __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_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, 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, 176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); __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); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_7); + 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_12, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __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; + PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_12, __pyx_t_11}; + __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)); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_2; + __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":175 + /* "constraint/parser.py":184 * variables_on_left = len(unique_operators_left) > 0 * if len(variable_unique_operators) == 0 or variable_unique_operators[0] == "+": * if comparator == "==": # <<<<<<<<<<<<<< @@ -8094,17 +8488,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":177 + /* "constraint/parser.py":186 * 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 VariableMaxSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMinSumConstraint(variables[0], variables[1:]) # noqa: E501 */ - __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 # <<<<<<<<<<<<<< @@ -8112,77 +8506,77 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # "B+C >= A" (minsum) if variables_on_left else "A >= B+C" (maxsum) */ __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) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 188, __pyx_L1_error) if (__pyx_t_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_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 188, __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_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); - assert(__pyx_t_12); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_12); + 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_8, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __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)); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_5}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__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_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) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_2; + __pyx_t_7 = __pyx_t_2; __pyx_t_2 = 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) - __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_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); + __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, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __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_5))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); + assert(__pyx_t_11); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __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_11, __pyx_t_12, __pyx_t_8}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __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_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_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_2; + __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":177 + /* "constraint/parser.py":186 * if comparator == "==": * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 * elif comparator == "<=": # <<<<<<<<<<<<<< @@ -8191,17 +8585,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":180 + /* "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:]) # 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 */ - __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, 189, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":182 + /* "constraint/parser.py":191 * 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 # <<<<<<<<<<<<<< @@ -8209,77 +8603,77 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if comparator == "==": */ __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) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 191, __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) + __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 191, __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_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, 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, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); __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); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_7); + 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_12, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __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; + PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_12, __pyx_t_11}; + __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)); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_2; + __pyx_t_7 = __pyx_t_2; __pyx_t_2 = 0; } else { - __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_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 191, __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_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); - assert(__pyx_t_12); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_12); + 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_8, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __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)); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_5}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__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_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) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_2; + __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":180 + /* "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:]) # noqa: E501 * elif comparator == ">=": # <<<<<<<<<<<<<< @@ -8288,40 +8682,40 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":174 + /* "constraint/parser.py":183 * 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 */ - goto __pyx_L58; + goto __pyx_L61; } - /* "constraint/parser.py":183 + /* "constraint/parser.py":192 * # "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 VariableExactProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactProdConstraint(variables[0], variables[1:]) # noqa: E501 */ - __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); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_mstate_global->__pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { - /* "constraint/parser.py":184 + /* "constraint/parser.py":193 * 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 * elif 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, 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, 193, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":185 + /* "constraint/parser.py":194 * 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 # <<<<<<<<<<<<<< @@ -8329,77 +8723,77 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # "B*C <= A" (maxprod) if variables_on_left else "A <= B*C" (minprod) */ __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) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 194, __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) - __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_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); + __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, 194, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __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_5))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); + assert(__pyx_t_11); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __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_11, __pyx_t_12, __pyx_t_8}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __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_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_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_2; + __pyx_t_7 = __pyx_t_2; __pyx_t_2 = 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) + __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 194, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 194, __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_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, 194, __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_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); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_7); + 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_12, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __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; + PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_12, __pyx_t_11}; + __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)); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_2; + __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":184 + /* "constraint/parser.py":193 * 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 == "==": # <<<<<<<<<<<<<< @@ -8408,17 +8802,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":186 + /* "constraint/parser.py":195 * 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 VariableMaxProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMinProdConstraint(variables[0], variables[1:]) # noqa: E501 */ - __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, 195, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":188 + /* "constraint/parser.py":197 * 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 # <<<<<<<<<<<<<< @@ -8426,77 +8820,77 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # "B*C >= A" (minprod) if variables_on_left else "A >= B*C" (maxprod) */ __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) + __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_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_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 197, __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_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); - assert(__pyx_t_12); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_12); + 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_8, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __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)); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_5}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__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_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) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_2; + __pyx_t_7 = __pyx_t_2; __pyx_t_2 = 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) - __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_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); + __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, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __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_5))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); + assert(__pyx_t_11); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __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_11, __pyx_t_12, __pyx_t_8}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __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_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_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_2; + __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":186 + /* "constraint/parser.py":195 * if comparator == "==": * return VariableExactProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactProdConstraint(variables[0], variables[1:]) # noqa: E501 * elif comparator == "<=": # <<<<<<<<<<<<<< @@ -8505,17 +8899,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":189 + /* "constraint/parser.py":198 * # "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 VariableMinProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxProdConstraint(variables[0], variables[1:]) # noqa: E501 */ - __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, 198, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":191 + /* "constraint/parser.py":200 * 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 # <<<<<<<<<<<<<< @@ -8523,77 +8917,77 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # left_num and right_num can't both be constants, or for other reasons we can't use a VariableConstraint */ __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) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 200, __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) + __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 200, __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_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, 200, __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_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); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_7); + 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_12, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __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; + PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_12, __pyx_t_11}; + __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)); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_2; + __pyx_t_7 = __pyx_t_2; __pyx_t_2 = 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) + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 200, __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_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); - assert(__pyx_t_12); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_12); + 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_8, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __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)); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_5}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__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_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) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_2; + __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":189 + /* "constraint/parser.py":198 * # "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 == ">=": # <<<<<<<<<<<<<< @@ -8602,7 +8996,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":183 + /* "constraint/parser.py":192 * # "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] == "*": # <<<<<<<<<<<<<< @@ -8610,9 +9004,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * return VariableExactProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactProdConstraint(variables[0], variables[1:]) # noqa: E501 */ } - __pyx_L58:; + __pyx_L61:; - /* "constraint/parser.py":172 + /* "constraint/parser.py":181 * 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 # <<<<<<<<<<<<<< @@ -8621,7 +9015,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":194 + /* "constraint/parser.py":203 * * # left_num and right_num can't both be constants, or for other reasons we can't use a VariableConstraint * return None # <<<<<<<<<<<<<< @@ -8641,7 +9035,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":198 + /* "constraint/parser.py":207 * # 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,83 +9044,83 @@ 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_11 = __pyx_v_right; + __Pyx_INCREF(__pyx_t_11); __pyx_t_9 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; + PyObject *__pyx_callargs[2] = {__pyx_t_11, 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_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __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_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __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); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_left_num) != (0)) __PYX_ERR(0, 207, __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_11, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 207, __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); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, Py_False) != (0)) __PYX_ERR(0, 207, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_5 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_7 = __pyx_t_11; + __pyx_t_11 = 0; } else { __pyx_t_2 = __pyx_v_left; __Pyx_INCREF(__pyx_t_2); __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_t_11 = __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); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __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_2, 0, __pyx_v_right_num) != (0)) __PYX_ERR(0, 207, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_11); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 207, __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_2, 2, Py_True) != (0)) __PYX_ERR(0, 207, __pyx_L1_error); + __pyx_t_11 = 0; + __pyx_t_7 = __pyx_t_2; __pyx_t_2 = 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, 206, __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_INCREF(__pyx_t_8); - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); - __Pyx_INCREF(__pyx_t_7); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_11); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __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_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_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); #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, 206, __pyx_L1_error) } - /* "constraint/parser.py":197 + /* "constraint/parser.py":206 * * # if one side is a number, the other side must be a variable or expression * number, variables, variables_on_left = ( # <<<<<<<<<<<<<< @@ -8735,12 +9129,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __pyx_v_number = __pyx_t_2; __pyx_t_2 = 0; - __pyx_v_variables = __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_11; + __pyx_t_11 = 0; + __Pyx_XDECREF_SET(__pyx_v_variables_on_left, __pyx_t_5); + __pyx_t_5 = 0; - /* "constraint/parser.py":202 + /* "constraint/parser.py":211 * * # we can map '>' to '>=' and '<' to '<=' by adding a tiny offset to the number * offset = 1e-12 # <<<<<<<<<<<<<< @@ -8749,52 +9143,52 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __pyx_v_offset = 1e-12; - /* "constraint/parser.py":203 + /* "constraint/parser.py":212 * # 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, 212, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":204 + /* "constraint/parser.py":213 * 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, 213, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":206 + /* "constraint/parser.py":215 * 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, 215, __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_5 = PyNumber_InPlaceSubtract(__pyx_v_number, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __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; - /* "constraint/parser.py":204 + /* "constraint/parser.py":213 * offset = 1e-12 * if comparator == "<": * if variables_on_left: # <<<<<<<<<<<<<< * # (x < 2) == (x <= 2-offset) * number -= offset */ - goto __pyx_L64; + goto __pyx_L67; } - /* "constraint/parser.py":209 + /* "constraint/parser.py":218 * else: * # (2 < x) == (2+offset <= x) * number += offset # <<<<<<<<<<<<<< @@ -8802,72 +9196,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_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_t_5 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __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_t_7 = PyNumber_InPlaceAdd(__pyx_v_number, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __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_L64:; + __pyx_L67:; - /* "constraint/parser.py":203 + /* "constraint/parser.py":212 * # 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_L66; } - /* "constraint/parser.py":210 + /* "constraint/parser.py":219 * # (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, 219, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":211 + /* "constraint/parser.py":220 * 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, 220, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":213 + /* "constraint/parser.py":222 * 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, 222, __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_5 = PyNumber_InPlaceAdd(__pyx_v_number, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __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; - /* "constraint/parser.py":211 + /* "constraint/parser.py":220 * number += offset * elif comparator == ">": * if variables_on_left: # <<<<<<<<<<<<<< * # (x > 2) == (x >= 2+offset) * number += offset */ - goto __pyx_L65; + goto __pyx_L68; } - /* "constraint/parser.py":216 + /* "constraint/parser.py":225 * else: * # (2 > x) == (2-offset >= x) * number -= offset # <<<<<<<<<<<<<< @@ -8875,17 +9269,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_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_t_5 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __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_t_7 = PyNumber_InPlaceSubtract(__pyx_v_number, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 225, __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_L65:; + __pyx_L68:; - /* "constraint/parser.py":210 + /* "constraint/parser.py":219 * # (2 < x) == (2+offset <= x) * number += offset * elif comparator == ">": # <<<<<<<<<<<<<< @@ -8893,102 +9287,102 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # (x > 2) == (x >= 2+offset) */ } - __pyx_L63:; + __pyx_L66:; - /* "constraint/parser.py":219 + /* "constraint/parser.py":228 * * # 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, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __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, 0, __pyx_mstate_global->__pyx_kp_u__13) != (0)) __PYX_ERR(0, 228, __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); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_kp_u__14) != (0)) __PYX_ERR(0, 228, __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__15) != (0)) __PYX_ERR(0, 228, __pyx_L1_error); + __pyx_v_operators = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/parser.py":220 + /* "constraint/parser.py":229 * # 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_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __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_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_operators); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 229, __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_7 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_7); + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_2, __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_5, __pyx_t_11, __pyx_v_variables}; + __pyx_t_7 = __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_5); __pyx_t_5 = 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, 220, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __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":230 * 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, 230, __pyx_L1_error) __pyx_t_1 = (__pyx_t_3 == 0); if (__pyx_t_1) { - /* "constraint/parser.py":223 + /* "constraint/parser.py":232 * 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, 232, __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_L71_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, 232, __pyx_L1_error) __pyx_t_1 = __pyx_t_6; - __pyx_L68_bool_binop_done:; + __pyx_L71_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":225 + /* "constraint/parser.py":234 * if len(params) != 1 or variables not in params: * # there were more than one variable but no operator * return None # <<<<<<<<<<<<<< @@ -8999,7 +9393,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":232 * if len(operators_found) == 0: * # no operators found, return only based on comparator * if len(params) != 1 or variables not in params: # <<<<<<<<<<<<<< @@ -9008,17 +9402,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":228 + /* "constraint/parser.py":237 * # 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, 237, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":229 + /* "constraint/parser.py":238 * # if there are restrictions with a single variable, it will be used to prune the domain at the start * elif comparator == "==": * return ExactSumConstraint(number) # <<<<<<<<<<<<<< @@ -9027,33 +9421,33 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __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_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_2 = PyMethod_GET_SELF(__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_8); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_8, __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_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_t_7 = __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_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 229, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __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":237 * # 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 +9456,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":230 + /* "constraint/parser.py":239 * 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, 239, __pyx_L1_error) if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L70_bool_binop_done; + goto __pyx_L73_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, 239, __pyx_L1_error) __pyx_t_1 = __pyx_t_6; - __pyx_L70_bool_binop_done:; + __pyx_L73_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":231 + /* "constraint/parser.py":240 * return ExactSumConstraint(number) * elif comparator == "<=" or comparator == "<": * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< @@ -9088,65 +9482,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, 240, __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_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_2); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __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_t_11 = __Pyx_PyObject_FastCall(__pyx_t_5, __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); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_5 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_7 = __pyx_t_11; + __pyx_t_11 = 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_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __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); + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_2, __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; + PyObject *__pyx_callargs[2] = {__pyx_t_5, __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_XDECREF(__pyx_t_5); __pyx_t_5 = 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); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_5 = __pyx_t_8; - __pyx_t_8 = 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":230 + /* "constraint/parser.py":239 * elif comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or comparator == "<": # <<<<<<<<<<<<<< @@ -9155,25 +9549,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":232 + /* "constraint/parser.py":241 * 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, 241, __pyx_L1_error) if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L72_bool_binop_done; + goto __pyx_L75_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, 241, __pyx_L1_error) __pyx_t_1 = __pyx_t_6; - __pyx_L72_bool_binop_done:; + __pyx_L75_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":233 + /* "constraint/parser.py":242 * 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 +9575,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, 242, __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_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_2); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __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_t_11 = __Pyx_PyObject_FastCall(__pyx_t_5, __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); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_5 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_7 = __pyx_t_11; + __pyx_t_11 = 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_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __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); + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_2, __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; + PyObject *__pyx_callargs[2] = {__pyx_t_5, __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_XDECREF(__pyx_t_5); __pyx_t_5 = 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); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_5 = __pyx_t_8; - __pyx_t_8 = 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":232 + /* "constraint/parser.py":241 * elif comparator == "<=" or comparator == "<": * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or comparator == ">": # <<<<<<<<<<<<<< @@ -9248,36 +9642,36 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":234 + /* "constraint/parser.py":243 * 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_t_11 = 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_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_comparator, __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_12}; + __pyx_t_7 = __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_12); __pyx_t_12 = 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, 243, __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, 243, __pyx_L1_error) - /* "constraint/parser.py":221 + /* "constraint/parser.py":230 * operators = [r"\*\*", r"\*", r"\+"] * operators_found = re.findall(str("|".join(operators)), variables) * if len(operators_found) == 0: # <<<<<<<<<<<<<< @@ -9286,37 +9680,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":237 + /* "constraint/parser.py":246 * * # 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); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 246, __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":247 * # 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_t_7 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_23genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_operators_found); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __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_7); __pyx_t_7 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = (!__pyx_t_1); if (__pyx_t_6) { - /* "constraint/parser.py":240 + /* "constraint/parser.py":249 * 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 +9721,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":247 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< @@ -9336,66 +9730,66 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":243 + /* "constraint/parser.py":252 * * # 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}; + PyObject *__pyx_callargs[2] = {__pyx_t_7, __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_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_splitted = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/parser.py":245 + /* "constraint/parser.py":254 * 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_3 = PyObject_Length(__pyx_v_splitted); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 254, __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_t_13 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_L79_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_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_26genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_splitted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __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_t_7 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __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_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 254, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_6 = __pyx_t_1; - __pyx_L76_bool_binop_done:; + __pyx_L79_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":247 + /* "constraint/parser.py":256 * 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__8, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 256, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":249 + /* "constraint/parser.py":258 * if operator == "**": * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None # <<<<<<<<<<<<<< @@ -9406,7 +9800,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":256 * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): * # map to a Constraint * if operator == "**": # <<<<<<<<<<<<<< @@ -9415,27 +9809,27 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":250 + /* "constraint/parser.py":259 * # 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__9, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 259, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":251 + /* "constraint/parser.py":260 * 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, 260, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":252 + /* "constraint/parser.py":261 * elif operator == "*": * if comparator == "==": * return ExactProdConstraint(number) # <<<<<<<<<<<<<< @@ -9444,33 +9838,33 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __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_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11); + if (unlikely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_12); assert(__pyx_t_2); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_12, __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_t_7 = __Pyx_PyObject_FastCall(__pyx_t_12, __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); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 261, __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":260 * return None * elif operator == "*": * if comparator == "==": # <<<<<<<<<<<<<< @@ -9479,25 +9873,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":253 + /* "constraint/parser.py":262 * 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, 262, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L80_bool_binop_done; + goto __pyx_L83_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, 262, __pyx_L1_error) __pyx_t_6 = __pyx_t_1; - __pyx_L80_bool_binop_done:; + __pyx_L83_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":254 + /* "constraint/parser.py":263 * return ExactProdConstraint(number) * elif comparator == "<=" or comparator == "<": * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) # <<<<<<<<<<<<<< @@ -9505,65 +9899,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, 263, __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_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_2 = PyMethod_GET_SELF(__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_8); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_8, __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_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_t_12 = __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_8); __pyx_t_8 = 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_12)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); } - __pyx_t_5 = __pyx_t_11; - __pyx_t_11 = 0; + __pyx_t_7 = __pyx_t_12; + __pyx_t_12 = 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_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __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_8 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_8); + __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_8); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__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_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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_number}; + __pyx_t_12 = __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_11)) __PYX_ERR(0, 254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); } - __pyx_t_5 = __pyx_t_11; - __pyx_t_11 = 0; + __pyx_t_7 = __pyx_t_12; + __pyx_t_12 = 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":262 * if comparator == "==": * return ExactProdConstraint(number) * elif comparator == "<=" or comparator == "<": # <<<<<<<<<<<<<< @@ -9572,25 +9966,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":255 + /* "constraint/parser.py":264 * 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, 264, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L82_bool_binop_done; + goto __pyx_L85_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, 264, __pyx_L1_error) __pyx_t_6 = __pyx_t_1; - __pyx_L82_bool_binop_done:; + __pyx_L85_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":256 + /* "constraint/parser.py":265 * 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 +9992,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, 265, __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_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_2 = PyMethod_GET_SELF(__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_8); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_8, __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_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_t_12 = __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_8); __pyx_t_8 = 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_12)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); } - __pyx_t_5 = __pyx_t_11; - __pyx_t_11 = 0; + __pyx_t_7 = __pyx_t_12; + __pyx_t_12 = 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_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __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_8 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_8); + __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_8); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__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_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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_number}; + __pyx_t_12 = __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_11)) __PYX_ERR(0, 256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); } - __pyx_t_5 = __pyx_t_11; - __pyx_t_11 = 0; + __pyx_t_7 = __pyx_t_12; + __pyx_t_12 = 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":264 * elif comparator == "<=" or comparator == "<": * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or comparator == ">": # <<<<<<<<<<<<<< @@ -9665,37 +10059,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":250 + /* "constraint/parser.py":259 * # 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_L81; } - /* "constraint/parser.py":257 + /* "constraint/parser.py":266 * 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__10, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 266, __pyx_L1_error) if (likely(__pyx_t_6)) { - /* "constraint/parser.py":258 + /* "constraint/parser.py":267 * 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, 267, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":259 + /* "constraint/parser.py":268 * elif operator == "+": * if comparator == "==": * return ExactSumConstraint(number) # <<<<<<<<<<<<<< @@ -9703,34 +10097,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_t_12 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __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_11 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_11); + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_12); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_2, __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; + PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_number}; + __pyx_t_7 = __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_12); __pyx_t_12 = 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); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 268, __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":267 * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": * if comparator == "==": # <<<<<<<<<<<<<< @@ -9739,25 +10133,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":260 + /* "constraint/parser.py":269 * 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, 269, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L85_bool_binop_done; + goto __pyx_L88_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, 269, __pyx_L1_error) __pyx_t_6 = __pyx_t_1; - __pyx_L85_bool_binop_done:; + __pyx_L88_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":262 + /* "constraint/parser.py":271 * elif comparator == "<=" or comparator == "<": * # raise ValueError(restriction, comparator) * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< @@ -9765,65 +10159,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, 271, __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_GOTREF(__pyx_t_8); + __pyx_t_12 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __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); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_11); + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); + assert(__pyx_t_12); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_8, __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_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; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_12, __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_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_2; + __pyx_t_7 = __pyx_t_2; __pyx_t_2 = 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_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __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); + if (unlikely(PyMethod_Check(__pyx_t_12))) { + __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_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_12, __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_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) + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_number}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __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_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_2; + __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":260 + /* "constraint/parser.py":269 * if comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or comparator == "<": # <<<<<<<<<<<<<< @@ -9832,25 +10226,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":263 + /* "constraint/parser.py":272 * # 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, 272, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L87_bool_binop_done; + goto __pyx_L90_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, 272, __pyx_L1_error) __pyx_t_6 = __pyx_t_1; - __pyx_L87_bool_binop_done:; + __pyx_L90_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":264 + /* "constraint/parser.py":273 * 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 +10252,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, 273, __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_GOTREF(__pyx_t_8); + __pyx_t_12 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __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); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_11); + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); + assert(__pyx_t_12); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_8, __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_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; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_12, __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_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_2; + __pyx_t_7 = __pyx_t_2; __pyx_t_2 = 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_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __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); + if (unlikely(PyMethod_Check(__pyx_t_12))) { + __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_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_12, __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_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) + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_number}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __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_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_2; + __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":263 + /* "constraint/parser.py":272 * # raise ValueError(restriction, comparator) * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or comparator == ">": # <<<<<<<<<<<<<< @@ -9925,17 +10319,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":257 + /* "constraint/parser.py":266 * 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_L81; } - /* "constraint/parser.py":266 + /* "constraint/parser.py":275 * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * else: * raise ValueError(f"Invalid operator {operator}") # <<<<<<<<<<<<<< @@ -9945,29 +10339,29 @@ 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_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_t_12 = __pyx_builtin_ValueError; + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_operator, __pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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)); + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_12, __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); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 275, __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, 275, __pyx_L1_error) } - __pyx_L78:; + __pyx_L81:; - /* "constraint/parser.py":245 + /* "constraint/parser.py":254 * 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 +10370,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":267 + /* "constraint/parser.py":276 * else: * raise ValueError(f"Invalid operator {operator}") * return None # <<<<<<<<<<<<<< @@ -10046,6 +10440,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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_28generator9); __Pyx_XDECREF(__pyx_v_restriction); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); @@ -10053,7 +10448,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ return __pyx_r; } -/* "constraint/parser.py":269 +/* "constraint/parser.py":278 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< @@ -10102,39 +10497,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, 278, __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, 278, __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, 278, __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, 278, __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, 278, __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, 278, __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, 278, __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, 278, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10145,8 +10540,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, 279, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 279, __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 +10560,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":297 * 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 +10571,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, 297, __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[11]), (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, 297, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -10214,9 +10609,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 +10632,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, 297, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 297, __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, 297, __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, 288, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __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); @@ -10264,11 +10659,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit 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_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, 297, __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, 297, __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, 297, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { @@ -10309,7 +10704,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit return __pyx_r; } -/* "constraint/parser.py":269 +/* "constraint/parser.py":278 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< @@ -10318,12 +10713,12 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit */ 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; @@ -10340,11 +10735,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality 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, 278, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10355,7 +10750,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":283 * """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 +10759,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, 283, __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, 283, __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, 283, __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, 283, __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":284 * # check if all parameters are involved * if len(params) != len(tune_params): * return None # <<<<<<<<<<<<<< @@ -10389,7 +10784,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":283 * """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 +10793,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":278 + /* "constraint/parser.py":287 * * # find whether (in)equalities appear in this restriction * equalities_found = re.findall("==", restriction) # <<<<<<<<<<<<<< @@ -10406,9 +10801,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, 287, __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, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = 1; @@ -10428,13 +10823,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 287, __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":288 * # find whether (in)equalities appear in this restriction * equalities_found = re.findall("==", restriction) * inequalities_found = re.findall("!=", restriction) # <<<<<<<<<<<<<< @@ -10442,9 +10837,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, 288, __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, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = 1; @@ -10464,37 +10859,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 288, __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":290 * 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, 290, __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, 290, __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, 290, __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, 290, __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, 290, __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, 290, __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":291 * # 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 +10900,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":290 * 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 +10909,22 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":283 + /* "constraint/parser.py":292 * 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, 292, __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); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 292, __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); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __pyx_t_6; __pyx_t_6 = 0; @@ -10537,29 +10932,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":295 * * # 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), -1L); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 295, __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":297 * 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, 297, __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, 297, __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 +10962,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, 297, __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, 297, __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, 297, __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":299 * 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, 299, __pyx_L1_error) if (__pyx_t_9) { - /* "constraint/parser.py":291 + /* "constraint/parser.py":300 * # map to a Constraint * if comparator == "==": * return AllEqualConstraint() # <<<<<<<<<<<<<< @@ -10597,7 +10992,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, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS @@ -10616,14 +11011,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 300, __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":299 * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): * # map to a Constraint * if comparator == "==": # <<<<<<<<<<<<<< @@ -10632,17 +11027,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":292 + /* "constraint/parser.py":301 * 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, 301, __pyx_L1_error) if (__pyx_t_9) { - /* "constraint/parser.py":293 + /* "constraint/parser.py":302 * return AllEqualConstraint() * elif comparator == "!=": * return AllDifferentConstraint() # <<<<<<<<<<<<<< @@ -10651,7 +11046,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, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS @@ -10670,14 +11065,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 302, __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":301 * if comparator == "==": * return AllEqualConstraint() * elif comparator == "!=": # <<<<<<<<<<<<<< @@ -10686,7 +11081,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":294 + /* "constraint/parser.py":303 * elif comparator == "!=": * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") # <<<<<<<<<<<<<< @@ -10697,9 +11092,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 303, __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_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, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = 1; @@ -10709,14 +11104,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __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":297 * 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 +11120,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":295 + /* "constraint/parser.py":304 * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") * return None # <<<<<<<<<<<<<< @@ -10736,7 +11131,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":269 + /* "constraint/parser.py":278 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< @@ -10758,15 +11153,15 @@ 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":307 * * # remove functionally duplicate restrictions (preserves order and whitespace) * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< @@ -10775,18 +11170,18 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator1 */ 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, 307, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10794,7 +11189,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[12]), (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, 307, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -10810,9 +11205,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 +11226,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, 307, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 307, __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, 307, __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, 298, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __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); @@ -10913,10 +11308,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_gb_10constraint_6parser_18parse_restrictions_12generator11 = 0; PyObject *__pyx_9genexpr17__pyx_v_r = NULL; - PyObject *__pyx_9genexpr18__pyx_v_i = NULL; + PyObject *__pyx_9genexpr18__pyx_v_r = NULL; + PyObject *__pyx_9genexpr19__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -10978,7 +11373,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * 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[13])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_replace_params = __pyx_t_1; __pyx_t_1 = 0; @@ -10990,7 +11385,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * # 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[14])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_replace_params_split = __pyx_t_1; __pyx_t_1 = 0; @@ -11006,7 +11401,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __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) + __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[15])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __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; @@ -11025,49 +11420,49 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED 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) + __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[16])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __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":278 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: */ - __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, 278, __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, 278, __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, 278, __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, 278, __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[17])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __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":307 * * # 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] */ - __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, 307, __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, 307, __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, 307, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "constraint/parser.py":300 + /* "constraint/parser.py":309 * if all(isinstance(r, str) for r in restrictions): * # clean the restriction strings to functional equivalence * restrictions_cleaned = [r.replace(' ', '') for r in restrictions] # <<<<<<<<<<<<<< @@ -11075,7 +11470,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * # 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, 309, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_v_restrictions; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; @@ -11083,36 +11478,36 @@ 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, 309, __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_4; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L6_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_XDECREF_SET(__pyx_9genexpr16__pyx_v_r, __pyx_t_5); + __Pyx_XDECREF_SET(__pyx_9genexpr17__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_9genexpr17__pyx_v_r, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __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, 309, __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, 309, __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_9genexpr17__pyx_v_r); __pyx_9genexpr17__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_9genexpr17__pyx_v_r); __pyx_9genexpr17__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":310 * # 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 # <<<<<<<<<<<<<< @@ -11126,16 +11521,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED 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_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, 310, __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, 310, __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 + /* "constraint/parser.py":312 * 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] # <<<<<<<<<<<<<< @@ -11143,7 +11538,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * */ { /* 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, 312, __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 +11546,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, 312, __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_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __pyx_L13_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr17__pyx_v_r, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr18__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_9genexpr18__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __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, 312, __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_9genexpr18__pyx_v_r); __pyx_9genexpr18__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_9genexpr18__pyx_v_r); __pyx_9genexpr18__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":313 * # 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 +11580,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, 313, __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,33 +11588,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, 304, __pyx_L20_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 313, __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_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L20_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr18__pyx_v_i, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr19__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_9genexpr19__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __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, 313, __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_9genexpr19__pyx_v_i); __pyx_9genexpr19__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_9genexpr19__pyx_v_i); __pyx_9genexpr19__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":307 * * # remove functionally duplicate restrictions (preserves order and whitespace) * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< @@ -11228,32 +11623,32 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":307 + /* "constraint/parser.py":316 * * # 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, 316, __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, 316, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_restrictions, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "constraint/parser.py":309 + /* "constraint/parser.py":318 * 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, 318, __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":319 * # split into functions that only take their relevant parameters * parsed_restrictions = list() * for res in restrictions: # <<<<<<<<<<<<<< @@ -11262,7 +11657,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, 319, __pyx_L1_error) } __pyx_t_2 = __pyx_v_restrictions; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; @@ -11270,32 +11665,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, 319, __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_4; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __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":320 * 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, 320, __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":321 * for res in restrictions: * params_used: set[str] = set() * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() # <<<<<<<<<<<<<< @@ -11303,9 +11698,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, 321, __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, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_7 = 1; @@ -11325,7 +11720,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __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_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, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __pyx_t_5; @@ -11336,25 +11731,25 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __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_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, 321, __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":322 * 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, 322, __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":323 * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() * params_used_list = list(params_used) * finalized_constraint = None # <<<<<<<<<<<<<< @@ -11364,25 +11759,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":324 * 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, 324, __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, 324, __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":326 * if " or " not in res and " and " not in res: * # if applicable, strip the outermost round brackets * while ( # <<<<<<<<<<<<<< @@ -11391,16 +11786,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ while (1) { - /* "constraint/parser.py":318 + /* "constraint/parser.py":327 * # 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); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __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, 327, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { } else { @@ -11408,16 +11803,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":319 + /* "constraint/parser.py":328 * 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); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __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, 328, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { } else { @@ -11425,16 +11820,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":320 + /* "constraint/parser.py":329 * 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, 329, __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, 329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { } else { @@ -11442,48 +11837,48 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":321 + /* "constraint/parser.py":330 * 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, 330, __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, 330, __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":332 * 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, 332, __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":334 * 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) + if (!(likely(PyUnicode_CheckExact(__pyx_v_parsed_restriction))||((__pyx_v_parsed_restriction) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_parsed_restriction))) __PYX_ERR(0, 334, __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, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":326 + /* "constraint/parser.py":335 * # 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 +11888,20 @@ 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":337 * 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) + if (!(likely(PyUnicode_CheckExact(__pyx_v_parsed_restriction))||((__pyx_v_parsed_restriction) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_parsed_restriction))) __PYX_ERR(0, 337, __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, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":326 + /* "constraint/parser.py":335 * # 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 +11910,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":315 + /* "constraint/parser.py":324 * params_used_list = list(params_used) * finalized_constraint = None * if " or " not in res and " and " not in res: # <<<<<<<<<<<<<< @@ -11524,7 +11919,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":329 + /* "constraint/parser.py":338 * # 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 +11929,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":340 * 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, 340, __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, 340, __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 +11946,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, 340, __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":338 * # 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 +11962,25 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":332 + /* "constraint/parser.py":341 * # 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, 341, __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, 341, __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, 341, __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, 341, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/parser.py":310 + /* "constraint/parser.py":319 * # split into functions that only take their relevant parameters * parsed_restrictions = list() * for res in restrictions: # <<<<<<<<<<<<<< @@ -11595,7 +11990,7 @@ 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":343 * parsed_restrictions.append((finalized_constraint, params_used_list)) * * return parsed_restrictions # <<<<<<<<<<<<<< @@ -11640,10 +12035,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_gb_10constraint_6parser_18parse_restrictions_12generator11); __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_r); - __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_r); + __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_i); __Pyx_XDECREF(__pyx_v_restrictions); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); @@ -11651,7 +12046,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED return __pyx_r; } -/* "constraint/parser.py":336 +/* "constraint/parser.py":345 * return parsed_restrictions * * def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 # <<<<<<<<<<<<<< @@ -11701,41 +12096,41 @@ 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, 345, __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, 345, __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, 345, __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, 345, __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, 345, __pyx_L3_error) 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, 345, __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, 345, __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, 345, __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, 345, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -11747,7 +12142,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, 345, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11758,8 +12153,8 @@ 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, 345, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 345, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_2compile_to_constraints(__pyx_self, __pyx_v_constraints, __pyx_v_domains, __pyx_v_picklable); /* function exit code */ @@ -11808,7 +12203,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compile_to_constraints", 0); - /* "constraint/parser.py":347 + /* "constraint/parser.py":356 * 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 * parsed_restrictions = parse_restrictions(constraints, domains) # <<<<<<<<<<<<<< @@ -11816,7 +12211,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * 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, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -11835,25 +12230,25 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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_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, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_parsed_restrictions = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":348 + /* "constraint/parser.py":357 * """ # noqa: E501 * parsed_restrictions = parse_restrictions(constraints, domains) * compiled_constraints: list[tuple[Constraint, list[str], Union[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, 357, __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":358 * parsed_restrictions = parse_restrictions(constraints, domains) * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: # <<<<<<<<<<<<<< @@ -11865,9 +12260,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, 358, __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, 358, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { @@ -11875,7 +12270,7 @@ 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, 358, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -11885,7 +12280,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN { 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, 358, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -11896,13 +12291,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, 358, __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, 358, __pyx_L1_error) PyErr_Clear(); } break; @@ -11915,7 +12310,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, 358, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -11925,22 +12320,22 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __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) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 358, __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, 358, __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, 358, __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, 358, __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 +12343,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, 358, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -11956,7 +12351,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, 358, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_restriction, __pyx_t_2); @@ -11964,7 +12359,7 @@ 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 + /* "constraint/parser.py":359 * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: * if isinstance(restriction, str): # <<<<<<<<<<<<<< @@ -11974,17 +12369,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":361 * 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, 361, __pyx_L1_error) if (__pyx_t_10) { - /* "constraint/parser.py":353 + /* "constraint/parser.py":362 * # if it's a string, wrap it in a (compilable or compiled) function constraint * if picklable: * constraint = CompilableFunctionConstraint(restriction) # <<<<<<<<<<<<<< @@ -11992,7 +12387,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, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -12011,13 +12406,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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_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, 362, __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":361 * if isinstance(restriction, str): * # if it's a string, wrap it in a (compilable or compiled) function constraint * if picklable: # <<<<<<<<<<<<<< @@ -12027,7 +12422,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L8; } - /* "constraint/parser.py":355 + /* "constraint/parser.py":364 * constraint = CompilableFunctionConstraint(restriction) * else: * code_object = compile(restriction, "", "exec") # <<<<<<<<<<<<<< @@ -12044,13 +12439,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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_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, 364, __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":365 * else: * code_object = compile(restriction, "", "exec") * func = FunctionType(code_object.co_consts[0], globals()) # <<<<<<<<<<<<<< @@ -12058,14 +12453,14 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * 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_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __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_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_code_object, __pyx_mstate_global->__pyx_n_u_co_consts); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __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); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 365, __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, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -12086,13 +12481,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __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":366 * code_object = compile(restriction, "", "exec") * func = FunctionType(code_object.co_consts[0], globals()) * constraint = FunctionConstraint(func) # <<<<<<<<<<<<<< @@ -12100,7 +12495,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * 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_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -12119,7 +12514,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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; __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, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_3); @@ -12127,28 +12522,28 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN } __pyx_L8:; - /* "constraint/parser.py":358 + /* "constraint/parser.py":367 * 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, 367, __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, 367, __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, 367, __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, 367, __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, 367, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":350 + /* "constraint/parser.py":359 * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: * if isinstance(restriction, str): # <<<<<<<<<<<<<< @@ -12158,41 +12553,41 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L7; } - /* "constraint/parser.py":359 + /* "constraint/parser.py":368 * 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, 368, __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, 368, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(__pyx_t_10)) { - /* "constraint/parser.py":361 + /* "constraint/parser.py":370 * 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, 370, __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, 370, __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, 370, __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, 370, __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, 370, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":359 + /* "constraint/parser.py":368 * constraint = FunctionConstraint(func) * compiled_constraints.append((constraint, params_used, restriction)) * elif isinstance(restriction, Constraint): # <<<<<<<<<<<<<< @@ -12202,7 +12597,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L7; } - /* "constraint/parser.py":363 + /* "constraint/parser.py":372 * compiled_constraints.append((restriction, params_used, None)) * else: * raise ValueError(f"Restriction {restriction} is neither a string or Constraint {type(restriction)}") # <<<<<<<<<<<<<< @@ -12213,16 +12608,16 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_restriction, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 372, __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(((PyObject *)Py_TYPE(__pyx_v_restriction)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_Restriction; __pyx_t_13[1] = __pyx_t_11; __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) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -12233,16 +12628,16 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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, 372, __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, 372, __pyx_L1_error) } __pyx_L7:; - /* "constraint/parser.py":349 + /* "constraint/parser.py":358 * parsed_restrictions = parse_restrictions(constraints, domains) * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: # <<<<<<<<<<<<<< @@ -12252,7 +12647,7 @@ 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":375 * * # return the restrictions and used parameters * return compiled_constraints # <<<<<<<<<<<<<< @@ -12262,7 +12657,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __pyx_r = __pyx_v_compiled_constraints; goto __pyx_L0; - /* "constraint/parser.py":336 + /* "constraint/parser.py":345 * return parsed_restrictions * * def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 # <<<<<<<<<<<<<< @@ -13349,7 +13744,7 @@ 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)))) { __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); @@ -13380,8 +13775,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; } @@ -13841,7 +14236,7 @@ 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)))) { __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); @@ -13872,8 +14267,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; } @@ -14005,7 +14400,7 @@ 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)))) { __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); @@ -14036,8 +14431,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; } @@ -14135,16 +14530,16 @@ 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_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_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_11_genexpr > 0) & (int)(t->tp_basicsize == 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -14157,21 +14552,22 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_11_to_equa 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_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((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 (__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_v_params); + 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_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 (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_11_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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 { @@ -14186,9 +14582,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_to_equal } } -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_11_genexpr(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_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; @@ -14196,46 +14592,36 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_11_to_equal if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } - if (p->__pyx_v_params) { - e = (*v)(p->__pyx_v_params, 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; -} - -static int __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_11_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; - 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); - tmp = ((PyObject*)p->__pyx_v_params); - p->__pyx_v_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_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_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_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_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_11_to_equality_constraint_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr = { 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_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_11_to_equality_constraint, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -14257,8 +14643,8 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_to_equ 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*/ 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_11_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -14275,7 +14661,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_11_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -14308,16 +14694,16 @@ 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_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_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_12_to_equality_constraint > 0) & (int)(t->tp_basicsize == 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -14330,22 +14716,21 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_12_genexpr 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_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_12_genexpr) { + 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; } } #endif 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_params); #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 (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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 { @@ -14360,9 +14745,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_genexpr( } } -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_12_to_equality_constraint(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_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; @@ -14370,36 +14755,46 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_12_genexpr( 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; + if (p->__pyx_v_params) { + e = (*v)(p->__pyx_v_params, a); if (e) return e; } return 0; } + +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_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); + tmp = ((PyObject*)p->__pyx_v_params); + p->__pyx_v_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_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_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_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_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_12_genexpr_slots, + __pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_12_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint = { 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_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_12_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -14421,8 +14816,8 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_12_genexp 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_12_genexpr, /*tp_traverse*/ - 0, /*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*/ @@ -14439,7 +14834,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_12_to_equality_constraint, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -14504,8 +14899,9 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_13_genexpr( } #endif PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_r); + Py_CLEAR(p->__pyx_v_s); #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); @@ -14530,11 +14926,14 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_13_genexpr( 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_r) { - e = (*v)(p->__pyx_v_r, a); if (e) return e; + if (p->__pyx_v_s) { + e = (*v)(p->__pyx_v_s, a); if (e) return e; } return 0; } @@ -14632,6 +15031,166 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexp }; #endif +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_14_genexpr > 0) & (int)(t->tp_basicsize == 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr)); + (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; +} + +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_14_genexpr) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + 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_14_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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 + { + #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); + } + #endif + } +} + +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_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; + } + if (p->__pyx_genexpr_arg_0) { + e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; + } + if (p->__pyx_v_r) { + e = (*v)(p->__pyx_v_r, a); if (e) return e; + } + return 0; +} +#if CYTHON_USE_TYPE_SPECS +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_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_14_genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_14_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "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_14_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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_14_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_14_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 PY_VERSION_HEX >= 0x030800b1 && (!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 PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; @@ -14782,15 +15341,15 @@ 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, 170, __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, 170, __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, 170, __pyx_L1_error) #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)) { @@ -14798,15 +15357,15 @@ 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) + __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, 177, __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, 177, __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, 177, __pyx_L1_error) #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 +15373,15 @@ 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, 178, __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, 178, __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, 178, __pyx_L1_error) #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 +15389,15 @@ 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, 181, __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, 181, __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, 181, __pyx_L1_error) #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 +15405,15 @@ 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, 247, __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, 247, __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, 247, __pyx_L1_error) #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 +15421,69 @@ 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, 254, __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, 254, __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, 254, __pyx_L1_error) #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, 278, __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, 278, __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, 278, __pyx_L1_error) #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, 297, __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, 297, __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, 297, __pyx_L1_error) #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, 307, __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, 307, __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, 307, __pyx_L1_error) + #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:; @@ -15379,31 +15954,31 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); 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_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[18])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __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) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":336 + /* "constraint/parser.py":345 * return parsed_restrictions * * 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) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __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) + 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, 345, __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, 345, __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, 345, __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[19])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __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); __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) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_compile_to_constraints, __pyx_t_3) < 0) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/parser.py":1 @@ -15506,6 +16081,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_Variables, sizeof(__pyx_k_Variables), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Variables */ {__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 */ @@ -15551,6 +16127,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_d, sizeof(__pyx_k_d), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_d */ {__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 */ @@ -15578,6 +16155,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_keys, sizeof(__pyx_k_keys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_keys */ {__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 */ @@ -15592,6 +16170,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_not_in_tune_params, sizeof(__pyx_k_not_in_tune_params), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_not_in_tune_params */ {__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 */ @@ -15674,6 +16253,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_var, sizeof(__pyx_k_var), 0, 1, 1}, /* PyObject cname: __pyx_n_u_var */ {__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 */ @@ -15690,10 +16270,10 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, c 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_ValueError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 171, __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, 364, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -15727,61 +16307,61 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); - /* "constraint/parser.py":176 + /* "constraint/parser.py":185 * 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) */ - __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, 185, __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) + __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, 185, __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":309 * 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 * # 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, 309, __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":330 * 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, 330, __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":332 * 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, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[3]); - /* "constraint/parser.py":336 + /* "constraint/parser.py":345 * return parsed_restrictions * * 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_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, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_RefNannyFinishContext(); @@ -15794,6 +16374,8 @@ 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_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__index.type = (PyObject*)(&PyList_Type); @@ -15854,79 +16436,84 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { __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; } { - 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), 170, 2}; + 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_k_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), 177, 2}; 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_k__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), 178, 2}; 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_k_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), 181, 2}; 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_k_Q_2, 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), 247, 2}; 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_k_Q_3, 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), 254, 2}; 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; + __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_k__27, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) 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[10] = __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[10])) 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), 297, 2}; 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[11] = __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[11])) 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), 307, 2}; 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[12] = __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[12])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 36, 50}; 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[13] = __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[13])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 44, 50}; 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[14] = __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[14])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 54, 251}; 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[15] = __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[15])) 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, 48, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 79, 2103}; + 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->__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_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[16])) 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), 278, 222}; 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[17] = __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[17])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 28, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 30, 391}; 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[18] = __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_J_U_6_Q_q_t4uA_d_4y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) 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), 345, 177}; 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[19] = __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[19])) goto bad; } Py_DECREF(tuple_dedup_map); return 0; @@ -19897,6 +20484,52 @@ __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) 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_keys */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) { + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_keys, d); +} + /* RaiseNoneIterError */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); diff --git a/constraint/parser.py b/constraint/parser.py index af7b0a8..d5979cf 100644 --- a/constraint/parser.py +++ b/constraint/parser.py @@ -164,6 +164,15 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # 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('[+-]?\d+', restriction)) > 0: # adjust when we support modifiers such as multipliers + # 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) diff --git a/pyproject.toml b/pyproject.toml index e9dc285..58895a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,11 +5,11 @@ 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.1" # adhere to PEP440 versioning: https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#id55 +version = "2.3.2" # 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" diff --git a/tests/test_doctests.py b/tests/test_doctests.py index 5b608cf..17a120f 100644 --- a/tests/test_doctests.py +++ b/tests/test_doctests.py @@ -13,34 +13,10 @@ assert doctest.testmod(constraints, extraglobs={'Problem': problem.Problem})[0] == 0 assert doctest.testmod(solvers, extraglobs={'Problem': problem.Problem})[0] == 0 -# def load_tests(loader, tests, ignore): -# tests.addTests(doctest.DocFileSuite( -# "../README.rst", -# module_relative=False, -# optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS -# )) -# raise ValueError(tests) -# return tests - -# assert doctest.testfile("../README.rst") - def extract_python_code_blocks(path): with open(path, encoding="utf-8") as f: content = f.read() - # # Match ".. code-block:: python" and capture the following indented block - # pattern = re.compile( - # r""" - # ^\.\. # literal ".." - # \s+code-block:: # " code-block::" - # \s+python # " python" - # \s* # optional trailing whitespace - # \n\n # blank line after directive - # ((?:[ ]{4}.*\n?)+) # capture indented block (4 spaces) - # """, - # re.MULTILINE | re.VERBOSE - # ) - # 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( diff --git a/tests/test_parser.py b/tests/test_parser.py index 2219722..190db71 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -57,14 +57,14 @@ def test_compile_to_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 + "100 == x + y", # ExactSumConstraint + "x == 100+y", # FunctionConstraint "x == x+y", # VariableExactSumConstraint "51 <= x+y", # MinSumConstraint "50 < x+y", # MinSumConstraint "100-y >= x", # MaxSumConstraint - "100 == x-y", # VariableExactSumConstraint - "x / y == 100", # VariableExactProdConstraint + "100 == x-y", # FunctionConstraint + "x / y == 100", # FunctionConstraint "x / y == x", # VariableExactProdConstraint "x / y <= x", # VariableMinProdConstraint "x / y >= x", # VariableMaxProdConstraint @@ -75,13 +75,13 @@ def test_compile_to_constraints(): FunctionConstraint, ExactSumConstraint, ExactSumConstraint, - VariableExactSumConstraint, + 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" + 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, From b20171b6ea182474cef10758f3c2e333742fd1b3 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Tue, 22 Jul 2025 23:38:30 +0200 Subject: [PATCH 52/87] Implemented support and tests for negative values in the SumConstraints and VariableSumConstraints --- constraint/constraints.py | 166 ++++++++++++++++++++++++++------------ 1 file changed, 113 insertions(+), 53 deletions(-) diff --git a/constraint/constraints.py b/constraint/constraints.py index 59f2ce9..0021c15 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -284,6 +284,11 @@ 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): @@ -297,40 +302,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) } + self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } + + # 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]) for variable in variables } + self._var_min = { variable: min(domains[variable]) for variable in variables } + 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 +365,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 +384,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,6 +397,13 @@ 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)]] """ def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): @@ -476,6 +508,11 @@ 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): @@ -519,6 +556,12 @@ 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): @@ -590,6 +633,11 @@ 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): @@ -603,55 +651,49 @@ def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = """ self._maxsum = maxsum self._multipliers = multipliers + self._var_min = {} + self._var_is_negative = {} + self._contains_negative = True # assume contains negative values by default 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) } + + # 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 and max after pruning + self._var_min = { variable: min(domains[variable]) for variable in variables } + 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 +706,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,6 +736,12 @@ 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): @@ -1446,3 +1499,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) From 2e54c94107c6dad42cc0befd172798b41b2a220c Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Wed, 23 Jul 2025 00:20:34 +0200 Subject: [PATCH 53/87] Much improved MinSumConstraint with preprocessing and other performance improvements --- constraint/constraints.py | 49 ++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/constraint/constraints.py b/constraint/constraints.py index 0021c15..70c0c87 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -325,8 +325,8 @@ def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple domain.remove(value) # recalculate the min and max after pruning - self._var_max = { variable: max(domains[variable]) for variable in variables } - self._var_min = { variable: min(domains[variable]) for variable in variables } + self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } + self._var_min = { variable: min(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } 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 @@ -526,26 +526,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) } - # 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 for variable, multiplier in zip(variables, multipliers) } + + 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. @@ -653,7 +677,6 @@ def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = self._multipliers = multipliers self._var_min = {} self._var_is_negative = {} - self._contains_negative = True # assume contains negative values by default def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 Constraint.preProcess(self, variables, domains, constraints, vconstraints) @@ -670,7 +693,7 @@ def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple domain.remove(value) # recalculate the min and max after pruning - self._var_min = { variable: min(domains[variable]) for variable in variables } + self._var_min = { variable: min(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } 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 From 88e1ceff31013af55a4da9331851bd9b3b5010ed Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Wed, 23 Jul 2025 00:52:09 +0200 Subject: [PATCH 54/87] Implemented support and tests for negative values in the ProdConstraints and VariableProdConstraints --- constraint/constraints.py | 60 ++++++++++++++++++++++++++++++--------- 1 file changed, 47 insertions(+), 13 deletions(-) diff --git a/constraint/constraints.py b/constraint/constraints.py index 70c0c87..7d9414a 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -836,6 +836,11 @@ 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]): @@ -915,6 +920,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]): @@ -997,19 +1008,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 @@ -1023,6 +1035,11 @@ 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)]] """ def __init__(self, minprod: Union[int, float]): @@ -1069,6 +1086,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 @@ -1165,6 +1188,11 @@ 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]): @@ -1245,6 +1273,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 From 4ed109b28a5ec9018d3281768b1de21b7f0f3fc2 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Wed, 23 Jul 2025 01:01:09 +0200 Subject: [PATCH 55/87] Negative numeric values are supported and tested against (related to #33) --- constraint/constraints.c | 19245 ++++++++++++++++++++---------------- constraint/constraints.py | 22 +- 2 files changed, 10478 insertions(+), 8789 deletions(-) diff --git a/constraint/constraints.c b/constraint/constraints.c index b06da78..fe5e2cf 100644 --- a/constraint/constraints.c +++ b/constraint/constraints.c @@ -1513,20 +1513,20 @@ 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_genexpr; -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__; +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_15___call__; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr; -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__; +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_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___call__; +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 @@ -1542,7 +1542,7 @@ struct __pyx_defaults { }; -/* "constraint/constraints.py":393 +/* "constraint/constraints.py":425 * 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." # <<<<<<<<<<<<<< @@ -1556,7 +1556,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr { }; -/* "constraint/constraints.py":396 +/* "constraint/constraints.py":428 * 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 # <<<<<<<<<<<<<< @@ -1570,7 +1570,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess { }; -/* "constraint/constraints.py":410 +/* "constraint/constraints.py":442 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -1588,7 +1588,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr { }; -/* "constraint/constraints.py":411 +/* "constraint/constraints.py":443 * 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) # <<<<<<<<<<<<<< @@ -1606,7 +1606,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr { }; -/* "constraint/constraints.py":540 +/* "constraint/constraints.py":607 * 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." # <<<<<<<<<<<<<< @@ -1620,7 +1620,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr { }; -/* "constraint/constraints.py":543 +/* "constraint/constraints.py":610 * 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 # <<<<<<<<<<<<<< @@ -1634,7 +1634,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess { }; -/* "constraint/constraints.py":551 +/* "constraint/constraints.py":618 * for var in self.sum_vars: * domain = domains[var] * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -1652,58 +1652,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":786 * 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":789 * 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":797 * 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; @@ -1712,58 +1698,57 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr { }; -/* "constraint/constraints.py":781 +/* "constraint/constraints.py":862 * 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_11_genexpr { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_value; }; -/* "constraint/constraints.py":810 +/* "constraint/constraints.py":891 * 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_12_genexpr { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_value; }; -/* "constraint/constraints.py":895 +/* "constraint/constraints.py":982 * 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 */ -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ { +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":918 +/* "constraint/constraints.py":1005 * 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) # <<<<<<<<<<<<<< * possible_max = max(assigned_product * c for c in candidates) * */ -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr { PyObject_HEAD - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *__pyx_outer_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_c; PyObject *__pyx_t_0; @@ -1771,16 +1756,16 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr { }; -/* "constraint/constraints.py":919 +/* "constraint/constraints.py":1006 * 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: */ -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr { PyObject_HEAD - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *__pyx_outer_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_c; PyObject *__pyx_t_0; @@ -1788,104 +1773,119 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr { }; -/* "constraint/constraints.py":933 - * 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_16_genexpr { - PyObject_HEAD - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *__pyx_outer_scope; - PyObject *__pyx_genexpr_arg_0; - PyObject *__pyx_v_c; -}; - - -/* "constraint/constraints.py":1039 +/* "constraint/constraints.py":1138 * 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_17___call__ { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__ { PyObject_HEAD PyObject *__pyx_v_target_value; }; -/* "constraint/constraints.py":1075 +/* "constraint/constraints.py":1174 * 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_18_genexpr { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr { PyObject_HEAD - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___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":1110 +/* "constraint/constraints.py":1214 * 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_19_genexpr { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_value; }; -/* "constraint/constraints.py":1139 +/* "constraint/constraints.py":1243 * 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_20_genexpr { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_value; }; -/* "constraint/constraints.py":1215 +/* "constraint/constraints.py":1325 * 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_21___call__ { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ { PyObject_HEAD PyObject *__pyx_v_target_value; }; -/* "constraint/constraints.py":1251 +/* "constraint/constraints.py":1361 * 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_22_genexpr { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr { PyObject_HEAD - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__ *__pyx_outer_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_p; }; + +/* "constraint/constraints.py":1563 + * # 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":1565 + * 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) --- */ @@ -2413,6 +2413,13 @@ 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); @@ -2461,13 +2468,6 @@ static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, l /* 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 */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); @@ -2980,11 +2980,11 @@ int __pyx_module_is_main_constraint__constraints = 0; /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_NotImplementedError; static PyObject *__pyx_builtin_zip; +static PyObject *__pyx_builtin_min; +static PyObject *__pyx_builtin_max; static PyObject *__pyx_builtin_round; static PyObject *__pyx_builtin_AssertionError; -static PyObject *__pyx_builtin_max; static PyObject *__pyx_builtin_sum; -static PyObject *__pyx_builtin_min; static PyObject *__pyx_builtin_RuntimeError; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "."; @@ -3001,13 +3001,14 @@ 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_3gQ[] = "\320\000\036\320\036:\270!\340\004\013\2103\210g\220Q"; static const char __pyx_k_A_2[] = "\250A"; static const char __pyx_k_Q_2[] = "\270Q"; static const char __pyx_k_Q_3[] = "\230Q"; +static const char __pyx_k_Q_4[] = "\220Q"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_dom[] = "dom"; static const char __pyx_k_get[] = "get"; @@ -3052,7 +3053,6 @@ 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"; @@ -3065,7 +3065,6 @@ 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"; @@ -3080,7 +3079,8 @@ 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_var_max[] = "_var_max"; +static const char __pyx_k_var_min[] = "_var_min"; 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"; @@ -3110,6 +3110,8 @@ 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_2_q_Kq_A_L[] = "\320\004\037\320\0372\260-\270q\360\022\000\t\r\210K\220q\330\010\014\320\014\034\230A\330\010\014\210L\230\001"; +static const char __pyx_k_4M_M_A_L_L[] = "\320\004!\320!4\260M\300\021\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"; static const char __pyx_k_Constraint[] = "Constraint"; static const char __pyx_k_Unassigned[] = "Unassigned"; static const char __pyx_k_all_bounds[] = "all_bounds"; @@ -3137,6 +3139,7 @@ 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_2_q_Kq_A_L_2[] = "\320\004\037\320\0372\260-\270q\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"; 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]"; @@ -3155,25 +3158,30 @@ 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_other_vars_max[] = "other_vars_max"; +static const char __pyx_k_other_vars_min[] = "other_vars_min"; static const char __pyx_k_possible_prods[] = "possible_prods"; +static const char __pyx_k_sum_other_vars[] = "sum_other_vars"; 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_max_sum_missing[] = "max_sum_missing"; +static const char __pyx_k_min_sum_missing[] = "min_sum_missing"; static const char __pyx_k_unassigned_vars[] = "unassigned_vars"; +static const char __pyx_k_var_is_negative[] = "_var_is_negative"; 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_missing_negative[] = "missing_negative"; 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"; @@ -3193,7 +3201,6 @@ 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__"; @@ -3223,9 +3230,9 @@ static const char __pyx_k_InSetConstraint_preProcess[] = "InSetConstraint.prePro 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_MinSumConstraint_preProcess[] = "MinSumConstraint.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"; @@ -3236,26 +3243,28 @@ static const char __pyx_k_ExactSumConstraint_preProcess[] = "ExactSumConstraint. 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_sum_other_vars_locals_genexpr[] = "sum_other_vars..genexpr"; 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_3at_Cs_1_A_7_Q_J_c[] = "\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"; 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_3at_Cs_1_A_7_Q_J_c[] = "\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"; -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_4_B_5_1A_4q_L[] = "\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[\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\330\010\014\320\014 \240\002\240*\250D\260\t\270\021\270*\300B\300b\310\004\310L\320XY"; +static const char __pyx_k_77JJeef_QfKy_Q_d_4_B_5_1A_L_Cq[] = "\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[\310\004\310J\320Vd\320dg\320gh\320hs\320st"; 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_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\360\"\000\t\020\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_4q_a_1_1_1Kq_9Cq_az_1_t[] = "\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!"; 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_55H_a_d_Q_a_1_1Kq_9Cq_az_1_t9AQ[] = "\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"; +static const char __pyx_k_55H_a_d_Q_a_1_1_1Kq_9Cq_az_1_t9[] = "\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"; 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_d_4_B_5_1A_Q_L_C[] = "\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[\310\004\310J\320Vd\320dg\320gh\320hs\320st\330\010\014\320\014 \240\002\240*\250D\260\t\270\021\270*\300B\300b\310\004\310L\320XY"; 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"; @@ -3276,15 +3285,14 @@ static const char __pyx_k_CompilableFunctionConstraint___c[] = "CompilableFuncti 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_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 >>> 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 "; +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 >>> 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 "; 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___call___loc[] = "ExactProdConstraint.__call__..genexpr"; static const char __pyx_k_ExactProdConstraint_preProcess_l[] = "ExactProdConstraint.preProcess..genexpr"; static const char __pyx_k_MaxProdConstraint___call___local[] = "MaxProdConstraint.__call__..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."; @@ -3311,17 +3319,17 @@ static const char __pyx_k_55H_a_d_4_7_1_4q_A_1_3at_a_4s_A_2[] = "\320\004\"\320\ 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_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 >>> 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 "; +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 >>> 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 "; +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 >>> 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 "; +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 >>> 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 "; 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_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 >>> problem = 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 "; +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 >>> 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 "; +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 >>> 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 "; +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 >>> 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 "; +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 >>> 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 "; +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 >>> 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 "; 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__"; @@ -3334,17 +3342,17 @@ static const char __pyx_k_Constraint_enforcing_that_values_10[] = "Constraint en /* #### 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_2__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_4__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_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_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 */ @@ -3356,14 +3364,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 */ @@ -3382,8 +3390,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 */ @@ -3414,6 +3421,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*/ @@ -3423,20 +3432,20 @@ 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_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_13___call__(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_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___call__(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_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___call__(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 ### */ @@ -3485,20 +3494,20 @@ 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_genexpr; - PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_13___call__; + 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_15___call__; PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_16_genexpr; - PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_17___call__; + 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_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___call__; + 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; @@ -3509,28 +3518,28 @@ 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_genexpr; - PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13___call__; + 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_15___call__; PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr; - PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17___call__; + 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_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___call__; + 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_pop; __Pyx_CachedCFunction __pyx_umethod_PyList_Type__remove; PyObject *__pyx_slice[1]; PyObject *__pyx_tuple[5]; - PyObject *__pyx_codeobj_tab[77]; - PyObject *__pyx_string_tab[290]; + PyObject *__pyx_codeobj_tab[78]; + PyObject *__pyx_string_tab[295]; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_10; @@ -3577,13 +3586,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 @@ -3597,13 +3606,13 @@ int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_11_genexpr; #endif #if CYTHON_USE_FREELISTS -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_12_genexpr[8]; -int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_12_genexpr; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_12___call__[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_12___call__; #endif #if CYTHON_USE_FREELISTS -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_13___call__[8]; -int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_13___call__; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_13_genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_13_genexpr; #endif #if CYTHON_USE_FREELISTS @@ -3612,8 +3621,8 @@ 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 @@ -3622,8 +3631,8 @@ int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_16_genexpr; #endif #if CYTHON_USE_FREELISTS -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__ *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_17___call__[8]; -int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_17___call__; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_17_genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_17_genexpr; #endif #if CYTHON_USE_FREELISTS @@ -3632,8 +3641,8 @@ int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_18_genexpr; #endif #if CYTHON_USE_FREELISTS -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_19_genexpr[8]; -int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_19_genexpr; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_19___call__[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_19___call__; #endif #if CYTHON_USE_FREELISTS @@ -3642,8 +3651,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___call__ *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_21___call__[8]; -int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_21___call__; +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 @@ -3755,14 +3764,14 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_MaxSumConstraint___call __pyx_string_tab[61] #define __pyx_n_u_MaxSumConstraint___init __pyx_string_tab[62] #define __pyx_n_u_MaxSumConstraint_preProcess __pyx_string_tab[63] -#define __pyx_n_u_MaxSumConstraint_preProcess_loca __pyx_string_tab[64] -#define __pyx_n_u_MinProdConstraint __pyx_string_tab[65] -#define __pyx_n_u_MinProdConstraint___call __pyx_string_tab[66] -#define __pyx_n_u_MinProdConstraint___init __pyx_string_tab[67] -#define __pyx_n_u_MinProdConstraint_preProcess __pyx_string_tab[68] -#define __pyx_n_u_MinSumConstraint __pyx_string_tab[69] -#define __pyx_n_u_MinSumConstraint___call __pyx_string_tab[70] -#define __pyx_n_u_MinSumConstraint___init __pyx_string_tab[71] +#define __pyx_n_u_MinProdConstraint __pyx_string_tab[64] +#define __pyx_n_u_MinProdConstraint___call __pyx_string_tab[65] +#define __pyx_n_u_MinProdConstraint___init __pyx_string_tab[66] +#define __pyx_n_u_MinProdConstraint_preProcess __pyx_string_tab[67] +#define __pyx_n_u_MinSumConstraint __pyx_string_tab[68] +#define __pyx_n_u_MinSumConstraint___call __pyx_string_tab[69] +#define __pyx_n_u_MinSumConstraint___init __pyx_string_tab[70] +#define __pyx_n_u_MinSumConstraint_preProcess __pyx_string_tab[71] #define __pyx_kp_u_Multipliers_must_be_numbers __pyx_string_tab[72] #define __pyx_kp_u_Multipliers_must_match_sum_varia __pyx_string_tab[73] #define __pyx_n_u_NotImplementedError __pyx_string_tab[74] @@ -3850,46 +3859,46 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_constraint_domain __pyx_string_tab[156] #define __pyx_n_u_constraints __pyx_string_tab[157] #define __pyx_n_u_contains_lt1 __pyx_string_tab[158] -#define __pyx_n_u_contains_negative __pyx_string_tab[159] -#define __pyx_n_u_dict __pyx_string_tab[160] -#define __pyx_kp_u_disable __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_kp_u_enable __pyx_string_tab[168] -#define __pyx_n_u_exact __pyx_string_tab[169] -#define __pyx_n_u_exact_2 __pyx_string_tab[170] -#define __pyx_n_u_exactprod __pyx_string_tab[171] -#define __pyx_n_u_exactprod_2 __pyx_string_tab[172] -#define __pyx_n_u_exactsum __pyx_string_tab[173] -#define __pyx_n_u_exactsum_2 __pyx_string_tab[174] -#define __pyx_n_u_exclude_var __pyx_string_tab[175] -#define __pyx_n_u_forwardCheck __pyx_string_tab[176] -#define __pyx_n_u_forwardcheck __pyx_string_tab[177] -#define __pyx_n_u_found __pyx_string_tab[178] -#define __pyx_n_u_func __pyx_string_tab[179] -#define __pyx_n_u_func_2 __pyx_string_tab[180] -#define __pyx_n_u_func_3 __pyx_string_tab[181] -#define __pyx_kp_u_gc __pyx_string_tab[182] -#define __pyx_n_u_genexpr __pyx_string_tab[183] -#define __pyx_n_u_get __pyx_string_tab[184] -#define __pyx_n_u_get_product_bounds __pyx_string_tab[185] -#define __pyx_n_u_hi __pyx_string_tab[186] -#define __pyx_n_u_hideValue __pyx_string_tab[187] -#define __pyx_n_u_index __pyx_string_tab[188] -#define __pyx_n_u_init __pyx_string_tab[189] -#define __pyx_n_u_is_coroutine __pyx_string_tab[190] -#define __pyx_kp_u_isenabled __pyx_string_tab[191] -#define __pyx_n_u_itertools __pyx_string_tab[192] -#define __pyx_kp_u_list_tuple __pyx_string_tab[193] -#define __pyx_n_u_lo __pyx_string_tab[194] -#define __pyx_n_u_m __pyx_string_tab[195] -#define __pyx_n_u_main __pyx_string_tab[196] -#define __pyx_n_u_max __pyx_string_tab[197] -#define __pyx_n_u_max_others __pyx_string_tab[198] +#define __pyx_n_u_dict __pyx_string_tab[159] +#define __pyx_kp_u_disable __pyx_string_tab[160] +#define __pyx_n_u_doc __pyx_string_tab[161] +#define __pyx_n_u_dom __pyx_string_tab[162] +#define __pyx_n_u_domain __pyx_string_tab[163] +#define __pyx_n_u_domain_bounds __pyx_string_tab[164] +#define __pyx_n_u_domain_dict __pyx_string_tab[165] +#define __pyx_n_u_domains __pyx_string_tab[166] +#define __pyx_kp_u_enable __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_kp_u_gc __pyx_string_tab[181] +#define __pyx_n_u_genexpr __pyx_string_tab[182] +#define __pyx_n_u_get __pyx_string_tab[183] +#define __pyx_n_u_get_product_bounds __pyx_string_tab[184] +#define __pyx_n_u_hi __pyx_string_tab[185] +#define __pyx_n_u_hideValue __pyx_string_tab[186] +#define __pyx_n_u_index __pyx_string_tab[187] +#define __pyx_n_u_init __pyx_string_tab[188] +#define __pyx_n_u_is_coroutine __pyx_string_tab[189] +#define __pyx_kp_u_isenabled __pyx_string_tab[190] +#define __pyx_n_u_itertools __pyx_string_tab[191] +#define __pyx_kp_u_list_tuple __pyx_string_tab[192] +#define __pyx_n_u_lo __pyx_string_tab[193] +#define __pyx_n_u_m __pyx_string_tab[194] +#define __pyx_n_u_main __pyx_string_tab[195] +#define __pyx_n_u_max __pyx_string_tab[196] +#define __pyx_n_u_max_others __pyx_string_tab[197] +#define __pyx_n_u_max_sum_missing __pyx_string_tab[198] #define __pyx_n_u_maxprod __pyx_string_tab[199] #define __pyx_n_u_maxprod_2 __pyx_string_tab[200] #define __pyx_n_u_maxsum __pyx_string_tab[201] @@ -3898,89 +3907,94 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_metaclass __pyx_string_tab[204] #define __pyx_n_u_min __pyx_string_tab[205] #define __pyx_n_u_min_others __pyx_string_tab[206] -#define __pyx_n_u_minprod __pyx_string_tab[207] -#define __pyx_n_u_minprod_2 __pyx_string_tab[208] -#define __pyx_n_u_minsum __pyx_string_tab[209] -#define __pyx_n_u_minsum_2 __pyx_string_tab[210] -#define __pyx_n_u_minval __pyx_string_tab[211] -#define __pyx_n_u_missing __pyx_string_tab[212] -#define __pyx_n_u_missing_lt1 __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_others __pyx_string_tab[228] -#define __pyx_n_u_others_bounds __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_singlevalue __pyx_string_tab[255] -#define __pyx_n_u_str __pyx_string_tab[256] -#define __pyx_n_u_sum __pyx_string_tab[257] -#define __pyx_n_u_sum_value __pyx_string_tab[258] -#define __pyx_n_u_sum_vars __pyx_string_tab[259] -#define __pyx_n_u_t_max __pyx_string_tab[260] -#define __pyx_n_u_t_min __pyx_string_tab[261] -#define __pyx_n_u_target_dom __pyx_string_tab[262] -#define __pyx_n_u_target_domain __pyx_string_tab[263] -#define __pyx_n_u_target_max __pyx_string_tab[264] -#define __pyx_n_u_target_min __pyx_string_tab[265] -#define __pyx_n_u_target_value __pyx_string_tab[266] -#define __pyx_n_u_target_var __pyx_string_tab[267] -#define __pyx_n_u_temp_sum __pyx_string_tab[268] -#define __pyx_n_u_test __pyx_string_tab[269] -#define __pyx_n_u_throw __pyx_string_tab[270] -#define __pyx_n_u_typing __pyx_string_tab[271] -#define __pyx_n_u_unassigned __pyx_string_tab[272] -#define __pyx_n_u_unassigned_2 __pyx_string_tab[273] -#define __pyx_n_u_unassigned_vars __pyx_string_tab[274] -#define __pyx_n_u_unassignedvariable __pyx_string_tab[275] -#define __pyx_n_u_v __pyx_string_tab[276] -#define __pyx_n_u_val __pyx_string_tab[277] -#define __pyx_n_u_value __pyx_string_tab[278] -#define __pyx_n_u_values __pyx_string_tab[279] -#define __pyx_n_u_var __pyx_string_tab[280] -#define __pyx_n_u_variable __pyx_string_tab[281] -#define __pyx_n_u_variable_contains_lt1 __pyx_string_tab[282] -#define __pyx_n_u_variable_contains_negative __pyx_string_tab[283] -#define __pyx_n_u_variable_with_lt1 __pyx_string_tab[284] -#define __pyx_n_u_variable_with_negative __pyx_string_tab[285] -#define __pyx_n_u_variables __pyx_string_tab[286] -#define __pyx_n_u_vconstraints __pyx_string_tab[287] -#define __pyx_n_u_x __pyx_string_tab[288] -#define __pyx_n_u_zip __pyx_string_tab[289] +#define __pyx_n_u_min_sum_missing __pyx_string_tab[207] +#define __pyx_n_u_minprod __pyx_string_tab[208] +#define __pyx_n_u_minprod_2 __pyx_string_tab[209] +#define __pyx_n_u_minsum __pyx_string_tab[210] +#define __pyx_n_u_minsum_2 __pyx_string_tab[211] +#define __pyx_n_u_minval __pyx_string_tab[212] +#define __pyx_n_u_missing __pyx_string_tab[213] +#define __pyx_n_u_missing_lt1 __pyx_string_tab[214] +#define __pyx_n_u_missing_negative __pyx_string_tab[215] +#define __pyx_n_u_module __pyx_string_tab[216] +#define __pyx_n_u_mro_entries __pyx_string_tab[217] +#define __pyx_n_u_multiplier __pyx_string_tab[218] +#define __pyx_n_u_multipliers __pyx_string_tab[219] +#define __pyx_n_u_multipliers_2 __pyx_string_tab[220] +#define __pyx_n_u_n __pyx_string_tab[221] +#define __pyx_n_u_n_2 __pyx_string_tab[222] +#define __pyx_n_u_name __pyx_string_tab[223] +#define __pyx_n_u_next __pyx_string_tab[224] +#define __pyx_n_u_o __pyx_string_tab[225] +#define __pyx_n_u_other_max __pyx_string_tab[226] +#define __pyx_n_u_other_min __pyx_string_tab[227] +#define __pyx_n_u_other_products __pyx_string_tab[228] +#define __pyx_n_u_other_unassigned __pyx_string_tab[229] +#define __pyx_n_u_other_vars_max __pyx_string_tab[230] +#define __pyx_n_u_other_vars_min __pyx_string_tab[231] +#define __pyx_n_u_others_max __pyx_string_tab[232] +#define __pyx_n_u_others_min __pyx_string_tab[233] +#define __pyx_n_u_p __pyx_string_tab[234] +#define __pyx_n_u_parms __pyx_string_tab[235] +#define __pyx_n_u_pop __pyx_string_tab[236] +#define __pyx_n_u_possible_max __pyx_string_tab[237] +#define __pyx_n_u_possible_min __pyx_string_tab[238] +#define __pyx_n_u_possible_prods __pyx_string_tab[239] +#define __pyx_n_u_preProcess __pyx_string_tab[240] +#define __pyx_n_u_prepare __pyx_string_tab[241] +#define __pyx_n_u_prod __pyx_string_tab[242] +#define __pyx_n_u_prods __pyx_string_tab[243] +#define __pyx_n_u_product __pyx_string_tab[244] +#define __pyx_n_u_product_vars __pyx_string_tab[245] +#define __pyx_n_u_products __pyx_string_tab[246] +#define __pyx_n_u_qualname __pyx_string_tab[247] +#define __pyx_n_u_remove __pyx_string_tab[248] +#define __pyx_n_u_round __pyx_string_tab[249] +#define __pyx_n_u_safe_product __pyx_string_tab[250] +#define __pyx_n_u_seen __pyx_string_tab[251] +#define __pyx_n_u_self __pyx_string_tab[252] +#define __pyx_n_u_send __pyx_string_tab[253] +#define __pyx_n_u_set __pyx_string_tab[254] +#define __pyx_n_u_set_2 __pyx_string_tab[255] +#define __pyx_n_u_set_name __pyx_string_tab[256] +#define __pyx_n_u_singlevalue __pyx_string_tab[257] +#define __pyx_n_u_str __pyx_string_tab[258] +#define __pyx_n_u_sum __pyx_string_tab[259] +#define __pyx_n_u_sum_other_vars __pyx_string_tab[260] +#define __pyx_n_u_sum_other_vars_locals_genexpr __pyx_string_tab[261] +#define __pyx_n_u_sum_value __pyx_string_tab[262] +#define __pyx_n_u_sum_vars __pyx_string_tab[263] +#define __pyx_n_u_t_max __pyx_string_tab[264] +#define __pyx_n_u_t_min __pyx_string_tab[265] +#define __pyx_n_u_target_dom __pyx_string_tab[266] +#define __pyx_n_u_target_domain __pyx_string_tab[267] +#define __pyx_n_u_target_max __pyx_string_tab[268] +#define __pyx_n_u_target_min __pyx_string_tab[269] +#define __pyx_n_u_target_value __pyx_string_tab[270] +#define __pyx_n_u_target_var __pyx_string_tab[271] +#define __pyx_n_u_temp_sum __pyx_string_tab[272] +#define __pyx_n_u_test __pyx_string_tab[273] +#define __pyx_n_u_throw __pyx_string_tab[274] +#define __pyx_n_u_typing __pyx_string_tab[275] +#define __pyx_n_u_unassigned __pyx_string_tab[276] +#define __pyx_n_u_unassigned_2 __pyx_string_tab[277] +#define __pyx_n_u_unassigned_vars __pyx_string_tab[278] +#define __pyx_n_u_unassignedvariable __pyx_string_tab[279] +#define __pyx_n_u_v __pyx_string_tab[280] +#define __pyx_n_u_val __pyx_string_tab[281] +#define __pyx_n_u_value __pyx_string_tab[282] +#define __pyx_n_u_values __pyx_string_tab[283] +#define __pyx_n_u_var __pyx_string_tab[284] +#define __pyx_n_u_var_is_negative __pyx_string_tab[285] +#define __pyx_n_u_var_max __pyx_string_tab[286] +#define __pyx_n_u_var_min __pyx_string_tab[287] +#define __pyx_n_u_variable __pyx_string_tab[288] +#define __pyx_n_u_variable_contains_lt1 __pyx_string_tab[289] +#define __pyx_n_u_variable_with_lt1 __pyx_string_tab[290] +#define __pyx_n_u_variables __pyx_string_tab[291] +#define __pyx_n_u_vconstraints __pyx_string_tab[292] +#define __pyx_n_u_x __pyx_string_tab[293] +#define __pyx_n_u_zip __pyx_string_tab[294] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -4019,40 +4033,40 @@ 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); Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13___call__); - Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_13___call__); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_12___call__); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr); + 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_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___call__); - Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_17___call__); + 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); Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_18_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19_genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_19_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__); + 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___call__); - Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_21___call__); + 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<77; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<290; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<78; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<295; ++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); @@ -4094,40 +4108,40 @@ 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); Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13___call__); - Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_13___call__); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_12___call__); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr); + 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_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___call__); - Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_17___call__); + 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); Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_18_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19_genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_19_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__); + 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___call__); - Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_21___call__); + 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<77; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<290; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<78; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<295; ++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); @@ -4741,7 +4755,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; @@ -5530,7 +5544,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; @@ -6231,7 +6245,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra * */ -static PyObject *__pyx_pf_10constraint_11constraints_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_10constraint_11constraints_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -6473,7 +6487,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra * variables: Sequence, */ -static PyObject *__pyx_pf_10constraint_11constraints_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_10constraint_11constraints_8__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -7117,7 +7131,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; @@ -7819,7 +7833,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call return __pyx_r; } -/* "constraint/constraints.py":289 +/* "constraint/constraints.py":294 * """ * * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -7869,41 +7883,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, 294, __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, 294, __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, 294, __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, 294, __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, 294, __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, 294, __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, 294, __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, 294, __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, 294, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -7915,7 +7929,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, 294, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7939,30 +7953,67 @@ 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":303 * 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, 303, __pyx_L1_error) - /* "constraint/constraints.py":299 + /* "constraint/constraints.py":304 * """ * 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, 304, __pyx_L1_error) + + /* "constraint/constraints.py":305 + * 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, 305, __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, 305, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":306 + * 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, 306, __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, 306, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":307 + * 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, 307, __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, 307, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":289 + /* "constraint/constraints.py":294 * """ * * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -7974,6 +8025,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:; @@ -7982,12 +8034,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint___init return __pyx_r; } -/* "constraint/constraints.py":301 - * self._multipliers = multipliers +/* "constraint/constraints.py":309 + * 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 */ @@ -8033,50 +8085,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, 309, __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, 309, __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, 309, __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, 309, __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, 309, __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, 309, __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, 309, __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, 309, __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, 309, __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, 309, __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, 309, __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, 309, __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, 309, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -8086,7 +8138,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, 309, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -8097,9 +8149,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, 309, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 309, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 309, __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 */ @@ -8125,7 +8177,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; @@ -8137,25 +8200,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":310 * * 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, 310, __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, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -8175,518 +8239,1166 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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_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, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":303 + /* "constraint/constraints.py":311 * 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, 311, __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, 311, __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, 311, __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, 311, __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, 311, __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, 311, __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":312 * 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, 312, __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":313 + * 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; + { /* enter inner scope */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_2 = __pyx_builtin_zip; + __pyx_t_3 = __pyx_builtin_zip; __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(__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_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __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_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __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_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_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L5_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, 313, __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))) { + 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, 306, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 313, __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_GetItemRef(__pyx_t_3, __pyx_t_7); ++__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, 306, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 313, __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_3, __pyx_t_7)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __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, 313, __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_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, 306, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 313, __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, 313, __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_INCREF(__pyx_t_3); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __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_XGOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L5_error) + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 313, __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_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 313, __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_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 313, __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_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + 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); - __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_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; + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 313, __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_XDECREF_SET(__pyx_v_variable, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_XDECREF_SET(__pyx_v_multiplier, __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_ERR(0, 313, __pyx_L5_error) + __pyx_L9_unpacking_done:; } - __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_variable, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_multiplier, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __Pyx_INCREF(__pyx_builtin_min); + __pyx_t_2 = __pyx_builtin_min; + __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_7genexpr__pyx_v_variable); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 313, __pyx_L5_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(__pyx_t_2, __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; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); } - __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_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_7genexpr__pyx_v_multiplier); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __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_2))) __PYX_ERR(0, 313, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 313, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":305 - * multipliers = self._multipliers + /* "constraint/constraints.py":314 * 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, 314, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = NULL; + __Pyx_INCREF(__pyx_builtin_zip); + __pyx_t_4 = __pyx_builtin_zip; + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_variables, __pyx_v_multipliers}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __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; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L14_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_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_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L14_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, 314, __pyx_L14_error) } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_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, 312, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 314, __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_3 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_7); ++__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_4); #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, 314, __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_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L14_error) } else { - __pyx_t_3 = __pyx_t_8(__pyx_t_2); + __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, 312, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 314, __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; - } 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) - __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) - } - __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) + 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, 314, __pyx_L14_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_10 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_10); } 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_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L14_error) + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 314, __pyx_L14_error) + __Pyx_XGOTREF(__pyx_t_10); } - __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) + #else + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 314, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_10); + #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - - /* "constraint/constraints.py":316 - * for value in domain[:]: - * if value > exactsum: - * 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, 316, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __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, 314, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); + index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L17_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_10 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_10)) goto __pyx_L17_unpacking_failed; + __Pyx_GOTREF(__pyx_t_10); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 2) < 0) __PYX_ERR(0, 314, __pyx_L14_error) + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L18_unpacking_done; + __pyx_L17_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, 314, __pyx_L14_error) + __pyx_L18_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_variable, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_multiplier, __pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = NULL; + __Pyx_INCREF(__pyx_builtin_max); + __pyx_t_2 = __pyx_builtin_max; + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr1__pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 314, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_9}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __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_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_3); + } + __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_8genexpr1__pyx_v_multiplier); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_8genexpr1__pyx_v_variable, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 314, __pyx_L14_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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, 314, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":315 - * domain = domains[variable] - * for value in domain[:]: - * if value > exactsum: # <<<<<<<<<<<<<< - * domain.remove(value) + /* "constraint/constraints.py":317 * + * # 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) */ - } - - /* "constraint/constraints.py":314 - * for variable in variables: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value > exactsum: - * domain.remove(value) -*/ - } + __pyx_t_4 = NULL; + __Pyx_INCREF(__pyx_builtin_zip); + __pyx_t_2 = __pyx_builtin_zip; + __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, 317, __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, 317, __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, 317, __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, 317, __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_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, 317, __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, 317, __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, 317, __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, 317, __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_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, 317, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __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, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __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, 317, __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_3 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L23_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 2) < 0) __PYX_ERR(0, 317, __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, 317, __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_3); + __pyx_t_3 = 0; + + /* "constraint/constraints.py":318 + * # 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, 318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":319 + * 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_3 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sum_other_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __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, 319, __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_3 = PyMethod_GET_SELF(__pyx_t_4); + assert(__pyx_t_3); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_variables, __pyx_v_variable, __pyx_t_9}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 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, 319, __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":320 + * 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, 320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __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, 320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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; + #endif + { + PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_variables, __pyx_v_variable, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__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_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __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":321 + * 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_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, 321, __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, 321, __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, 321, __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, 321, __pyx_L1_error) + #endif + if (__pyx_t_12 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_12); + ++__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, 321, __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, 321, __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, 321, __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":322 + * 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, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_v_other_vars_min); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "constraint/constraints.py":323 + * 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_3 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_3); + __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, 323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":322 + * 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":324 + * 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, 324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_v_other_vars_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_exactsum, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "constraint/constraints.py":325 + * domain.remove(value) + * if value * multiplier + other_vars_max < exactsum: + * domain.remove(value) # <<<<<<<<<<<<<< + * + * # recalculate the min and max after pruning +*/ + __pyx_t_3 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_3); + __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, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":324 + * if value * multiplier + other_vars_min > exactsum: + * domain.remove(value) + * if value * multiplier + other_vars_max < exactsum: # <<<<<<<<<<<<<< + * domain.remove(value) + * +*/ + } + + /* "constraint/constraints.py":321 + * 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":317 + * + * # 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_L3:; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":301 - * self._multipliers = multipliers + /* "constraint/constraints.py":328 + * + * # recalculate the min and max after pruning + * self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 # <<<<<<<<<<<<<< + * self._var_min = { variable: min(domains[variable]) * multiplier 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_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L33_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = NULL; + __Pyx_INCREF(__pyx_builtin_zip); + __pyx_t_3 = __pyx_builtin_zip; + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_variables, __pyx_v_multipliers}; + __pyx_t_9 = __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_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 328, __pyx_L33_error) + __Pyx_GOTREF(__pyx_t_9); + } + if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_3 = __pyx_t_9; __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_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L33_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, 328, __pyx_L33_error) + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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, 328, __pyx_L33_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + __pyx_t_9 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_7); + ++__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, 328, __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_3, __pyx_t_7)); + #else + __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); + #endif + ++__pyx_t_7; + } + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 328, __pyx_L33_error) + } else { + __pyx_t_9 = __pyx_t_8(__pyx_t_3); + 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, 328, __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, 328, __pyx_L33_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_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_4); + } else { + __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L33_error) + __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L33_error) + __Pyx_XGOTREF(__pyx_t_4); + } + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L33_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __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, 328, __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_1 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_1)) goto __pyx_L36_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + 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, 328, __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, 328, __pyx_L33_error) + __pyx_L37_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_multiplier, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __Pyx_INCREF(__pyx_builtin_max); + __pyx_t_1 = __pyx_builtin_max; + __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr2__pyx_v_variable); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 328, __pyx_L33_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_10}; + __pyx_t_9 = __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_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 328, __pyx_L33_error) + __Pyx_GOTREF(__pyx_t_9); + } + __pyx_t_1 = PyNumber_Multiply(__pyx_t_9, __pyx_8genexpr2__pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L33_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_8genexpr2__pyx_v_variable, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 328, __pyx_L33_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_2) < 0) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":329 + * # recalculate the min and max after pruning + * self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + * self._var_min = { variable: min(domains[variable]) * multiplier 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_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = NULL; + __Pyx_INCREF(__pyx_builtin_zip); + __pyx_t_9 = __pyx_builtin_zip; + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_variables, __pyx_v_multipliers}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __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_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_3); + } + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_9 = __pyx_t_3; __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_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 329, __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, 329, __pyx_L42_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 329, __pyx_L42_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_7); + ++__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, 329, __pyx_L42_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_9, __pyx_t_7)); + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_7); + #endif + ++__pyx_t_7; + } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L42_error) + } else { + __pyx_t_3 = __pyx_t_8(__pyx_t_9); + 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, 329, __pyx_L42_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, 329, __pyx_L42_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_10 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_10); + } else { + __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L42_error) + __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 329, __pyx_L42_error) + __Pyx_XGOTREF(__pyx_t_10); + } + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 329, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_10); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 329, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); + index = 0; __pyx_t_1 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L45_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_10 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_10)) goto __pyx_L45_unpacking_failed; + __Pyx_GOTREF(__pyx_t_10); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_4), 2) < 0) __PYX_ERR(0, 329, __pyx_L42_error) + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L46_unpacking_done; + __pyx_L45_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 329, __pyx_L42_error) + __pyx_L46_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_multiplier, __pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = NULL; + __Pyx_INCREF(__pyx_builtin_min); + __pyx_t_1 = __pyx_builtin_min; + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr3__pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 329, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_4}; + __pyx_t_3 = __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_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_3); + } + __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_8genexpr3__pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_8genexpr3__pyx_v_variable, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 329, __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_2) < 0) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":330 + * self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + * self._var_min = { variable: min(domains[variable]) * multiplier 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_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L51_error) + __Pyx_GOTREF(__pyx_t_2); + 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, 330, __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, 330, __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, 330, __pyx_L51_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_7); + ++__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, 330, __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, 330, __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, 330, __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, 330, __pyx_L51_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_8genexpr4__pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 330, __pyx_L51_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L51_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_8genexpr4__pyx_v_variable, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 330, __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_2) < 0) __PYX_ERR(0, 330, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":309 + * 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) */ /* function exit code */ @@ -8698,6 +9410,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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:; @@ -8706,14 +9419,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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":332 + * 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 @@ -8763,53 +9487,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, 332, __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, 332, __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, 332, __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, 332, __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, 332, __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, 332, __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, 332, __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, 332, __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, 332, __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, 332, __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, 332, __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, 332, __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, 332, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -8823,7 +9547,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, 332, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -8834,8 +9558,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, 332, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 332, __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 */ @@ -8859,7 +9583,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; @@ -8884,61 +9611,90 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":319 + /* "constraint/constraints.py":333 * * 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, 333, __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":334 * 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, 334, __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":335 * 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":336 * exactsum = self._exactsum * sum = 0 - * missing = False # <<<<<<<<<<<<<< - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): + * min_sum_missing = 0 # <<<<<<<<<<<<<< + * max_sum_missing = 0 + * missing = False */ - __pyx_v_missing = 0; + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_min_sum_missing = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":323 + /* "constraint/constraints.py":337 * sum = 0 + * min_sum_missing = 0 + * max_sum_missing = 0 # <<<<<<<<<<<<<< * missing = False - * if multipliers: # <<<<<<<<<<<<<< - * for variable, multiplier in zip(variables, multipliers): - * if variable in assignments: + * missing_negative = False */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 323, __pyx_L1_error) - if (__pyx_t_2) { + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_max_sum_missing = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":324 - * missing = False + /* "constraint/constraints.py":338 + * min_sum_missing = 0 + * max_sum_missing = 0 + * missing = False # <<<<<<<<<<<<<< + * missing_negative = False + * if multipliers: +*/ + __pyx_v_missing = 0; + + /* "constraint/constraints.py":339 + * 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":340 + * 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, 340, __pyx_L1_error) + if (__pyx_t_2) { + + /* "constraint/constraints.py":341 + * missing_negative = False * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable in assignments: @@ -8953,7 +9709,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __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_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, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -8961,9 +9717,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_t_6 = 0; __pyx_t_7 = 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_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __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_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 341, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -8972,7 +9728,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 324, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 341, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -8982,7 +9738,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 324, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 341, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -8993,13 +9749,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_7(__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, 324, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 341, __pyx_L1_error) PyErr_Clear(); } break; @@ -9012,7 +9768,7 @@ 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, 341, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -9022,22 +9778,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __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) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __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) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 341, __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_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __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_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 341, __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, 341, __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); @@ -9045,7 +9801,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_GOTREF(__pyx_t_3); 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, 341, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; @@ -9053,7 +9809,7 @@ 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, 341, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); @@ -9061,35 +9817,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":325 + /* "constraint/constraints.py":342 * 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, 342, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":326 + /* "constraint/constraints.py":343 * 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, 343, __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, 343, __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, 343, __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":342 * if multipliers: * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: # <<<<<<<<<<<<<< @@ -9099,20 +9855,90 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal goto __pyx_L8; } - /* "constraint/constraints.py":328 + /* "constraint/constraints.py":345 * 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, 345, __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, 345, __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, 345, __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":346 + * 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, 346, __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, 346, __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, 346, __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":347 + * 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":348 + * 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, 348, __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, 348, __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, 348, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + + /* "constraint/constraints.py":349 + * 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":348 + * 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":341 + * missing_negative = False * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable in assignments: @@ -9121,64 +9947,80 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":329 - * else: - * missing = True + /* "constraint/constraints.py":350 + * 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":351 + * 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_t_8 = NULL; __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_8 = __pyx_builtin_round; + __pyx_t_1 = __pyx_builtin_round; __pyx_t_5 = 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) + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_sum, __pyx_mstate_global->__pyx_int_10}; + __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, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":329 - * else: - * missing = True + /* "constraint/constraints.py":350 + * 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":352 * 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_t_4 = PyNumber_Add(__pyx_v_sum, __pyx_v_min_sum_missing); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_11) { + } else { + __pyx_t_2 = __pyx_t_11; + goto __pyx_L13_bool_binop_done; + } + __pyx_t_1 = PyNumber_Add(__pyx_v_sum, __pyx_v_max_sum_missing); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_v_exactsum, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __pyx_t_11; + __pyx_L13_bool_binop_done:; if (__pyx_t_2) { - /* "constraint/constraints.py":332 + /* "constraint/constraints.py":353 * 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); @@ -9186,95 +10028,101 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":331 + /* "constraint/constraints.py":352 * 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":354 + * 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, 354, __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":355 * 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_t_1 = NULL; __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_1 = __pyx_builtin_zip; + __pyx_t_8 = __pyx_builtin_zip; __pyx_t_5 = 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, 334, __pyx_L1_error) + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_variables, __pyx_v_multipliers}; + __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, 355, __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_8 = __pyx_t_4; __Pyx_INCREF(__pyx_t_8); __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, 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_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 355, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 355, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + 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, 355, __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_GetItemRef(__pyx_t_8, __pyx_t_6); ++__pyx_t_6; } 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, 355, __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_1, __pyx_t_6)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_6); #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_7(__pyx_t_1); + __pyx_t_4 = __pyx_t_7(__pyx_t_8); 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, 334, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 355, __pyx_L1_error) PyErr_Clear(); } break; @@ -9287,94 +10135,94 @@ 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, 334, __pyx_L1_error) + __PYX_ERR(0, 355, __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_1 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_3); } 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_1 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); } #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_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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; + 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_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L21_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) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 355, __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, 355, __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_variable, __pyx_t_1); + __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":335 - * if forwardcheck and missing: + /* "constraint/constraints.py":356 + * 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, 356, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":336 + /* "constraint/constraints.py":357 * 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_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":337 + /* "constraint/constraints.py":358 * 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_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, 358, __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_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_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __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_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 358, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -9383,7 +10231,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 337, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 358, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -9393,7 +10241,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 337, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 358, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -9404,13 +10252,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 358, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_13(__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, 337, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 358, __pyx_L1_error) PyErr_Clear(); } break; @@ -9420,44 +10268,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":338 + /* "constraint/constraints.py":359 * 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_t_4 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __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_t_1 = PyNumber_Add(__pyx_v_sum, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __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_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, 359, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":339 + /* "constraint/constraints.py":360 * 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_1 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_value}; + 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_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":338 + /* "constraint/constraints.py":359 * domain = domains[variable] * for value in domain[:]: * if sum + value * multiplier > exactsum: # <<<<<<<<<<<<<< @@ -9466,7 +10314,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":337 + /* "constraint/constraints.py":358 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -9476,18 +10324,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":340 + /* "constraint/constraints.py":361 * 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, 361, __pyx_L1_error) __pyx_t_11 = (!__pyx_t_2); if (__pyx_t_11) { - /* "constraint/constraints.py":341 + /* "constraint/constraints.py":362 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -9497,10 +10345,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":361 * if sum + value * multiplier > exactsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -9509,8 +10357,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":335 - * if forwardcheck and missing: + /* "constraint/constraints.py":356 + * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] @@ -9518,28 +10366,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":334 + /* "constraint/constraints.py":355 * 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":354 + * 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":340 * missing = False + * missing_negative = False * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: @@ -9547,7 +10395,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal goto __pyx_L3; } - /* "constraint/constraints.py":343 + /* "constraint/constraints.py":364 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -9556,48 +10404,48 @@ 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_8 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_8); __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, 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_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 364, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + 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, 364, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_6); ++__pyx_t_6; } 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, 364, __pyx_L1_error) #endif 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_6)); + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_6); #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_7(__pyx_t_1); + __pyx_t_3 = __pyx_t_7(__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, 343, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 364, __pyx_L1_error) PyErr_Clear(); } break; @@ -9607,54 +10455,124 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":344 + /* "constraint/constraints.py":365 * 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, 365, __pyx_L1_error) if (__pyx_t_11) { - /* "constraint/constraints.py":345 + /* "constraint/constraints.py":366 * 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_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __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_t_4 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 366, __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; - /* "constraint/constraints.py":344 + /* "constraint/constraints.py":365 * 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":368 * sum += assignments[variable] * else: + * min_sum_missing += self._var_min[variable] # <<<<<<<<<<<<<< + * max_sum_missing += self._var_max[variable] + * missing = True +*/ + /*else*/ { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_variable); 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_t_4 = PyNumber_InPlaceAdd(__pyx_v_min_sum_missing, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_min_sum_missing, __pyx_t_4); + __pyx_t_4 = 0; + + /* "constraint/constraints.py":369 + * 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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_max_sum_missing, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_max_sum_missing, __pyx_t_4); + __pyx_t_4 = 0; + + /* "constraint/constraints.py":370 + * 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":371 + * max_sum_missing += self._var_max[variable] + * missing = True + * if self._var_is_negative[variable]: # <<<<<<<<<<<<<< + * missing_negative = True + * if isinstance(sum, float): +*/ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_is_negative); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_11) { + + /* "constraint/constraints.py":372 + * 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":371 + * 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":364 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -9662,66 +10580,82 @@ 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":373 + * 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":374 + * 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_t_3 = NULL; __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_3 = __pyx_builtin_round; + __pyx_t_4 = __pyx_builtin_round; __pyx_t_5 = 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_3, __pyx_v_sum, __pyx_mstate_global->__pyx_int_10}; + __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_4, __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; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 374, __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":373 + * 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":375 * 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, 375, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __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, 375, __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, 375, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_2) { + } else { + __pyx_t_11 = __pyx_t_2; + goto __pyx_L37_bool_binop_done; + } + __pyx_t_4 = PyNumber_Add(__pyx_v_sum, __pyx_v_max_sum_missing); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 375, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_4, __pyx_v_exactsum, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 375, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 375, __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":376 * 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); @@ -9729,210 +10663,216 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":350 + /* "constraint/constraints.py":375 * 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":377 + * 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, 377, __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; } - __pyx_t_11 = __pyx_v_missing; - __pyx_L33_bool_binop_done:; + if (__pyx_v_missing) { + } else { + __pyx_t_11 = __pyx_v_missing; + goto __pyx_L40_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":378 * 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_8 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_8); __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, 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_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 378, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + 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, 378, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_6); ++__pyx_t_6; } 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, 378, __pyx_L1_error) #endif 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_6)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_6); #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 378, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_7(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { + __pyx_t_4 = __pyx_t_7(__pyx_t_8); + 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, 353, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 378, __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_4); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":354 - * if forwardcheck and missing: + /* "constraint/constraints.py":379 + * 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, 379, __pyx_L1_error) if (__pyx_t_11) { - /* "constraint/constraints.py":355 + /* "constraint/constraints.py":380 * 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_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":356 + /* "constraint/constraints.py":381 * 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_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, 381, __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_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_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 381, __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, 381, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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, 381, __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_4 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12); ++__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, 381, __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_4 = __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_4 = __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_4)) __PYX_ERR(0, 381, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_13(__pyx_t_4); - if (unlikely(!__pyx_t_3)) { + __pyx_t_4 = __pyx_t_13(__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, 356, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 381, __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_4); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":357 + /* "constraint/constraints.py":382 * 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_4 = PyNumber_Add(__pyx_v_sum, __pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { - /* "constraint/constraints.py":358 + /* "constraint/constraints.py":383 * 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_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_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_4, __pyx_v_value}; + __pyx_t_1 = __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_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __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":382 * domain = domains[variable] * for value in domain[:]: * if sum + value > exactsum: # <<<<<<<<<<<<<< @@ -9941,7 +10881,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":356 + /* "constraint/constraints.py":381 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -9949,33 +10889,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":384 * 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, 384, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_11); if (__pyx_t_2) { - /* "constraint/constraints.py":360 + /* "constraint/constraints.py":385 * 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":384 * if sum + value > exactsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -9984,8 +10924,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":354 - * if forwardcheck and missing: + /* "constraint/constraints.py":379 + * if forwardcheck and missing and not missing_negative: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] @@ -9993,20 +10933,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":353 + /* "constraint/constraints.py":378 * 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":377 + * 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: */ @@ -10014,39 +10954,59 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __pyx_L3:; - /* "constraint/constraints.py":361 + /* "constraint/constraints.py":386 * 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":387 * 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, 387, __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, 387, __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, 387, __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, 387, __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, 387, __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":386 * 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":389 + * return sum + min_sum_missing <= exactsum and sum + max_sum_missing >= exactsum * else: * return sum == exactsum # <<<<<<<<<<<<<< * @@ -10054,14 +11014,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, 389, __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":332 + * 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 @@ -10081,6 +11041,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); @@ -10090,8 +11052,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal return __pyx_r; } -/* "constraint/constraints.py":377 - * """ +/* "constraint/constraints.py":409 + * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. @@ -10141,47 +11103,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, 409, __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, 409, __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, 409, __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, 409, __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, 409, __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, 409, __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, 409, __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, 409, __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, 409, __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, 409, __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, 409, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -10194,7 +11156,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, 409, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10205,7 +11167,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, 409, __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 */ @@ -10226,7 +11188,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":425 * 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." # <<<<<<<<<<<<<< @@ -10246,7 +11208,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, 425, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10254,7 +11216,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, 425, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -10292,16 +11254,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, 425, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 425, __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, 425, __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, 425, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -10309,7 +11271,7 @@ 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, 425, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -10319,7 +11281,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain { 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, 425, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -10330,13 +11292,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, 425, __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, 425, __pyx_L1_error) PyErr_Clear(); } break; @@ -10394,8 +11356,8 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":377 - * """ +/* "constraint/constraints.py":409 + * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. @@ -10416,44 +11378,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":387 + /* "constraint/constraints.py":419 * 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, 419, __pyx_L1_error) - /* "constraint/constraints.py":388 + /* "constraint/constraints.py":420 * """ * 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, 420, __pyx_L1_error) - /* "constraint/constraints.py":389 + /* "constraint/constraints.py":421 * 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, 421, __pyx_L1_error) - /* "constraint/constraints.py":391 + /* "constraint/constraints.py":423 * 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, 423, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/constraints.py":392 + /* "constraint/constraints.py":424 * * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." # <<<<<<<<<<<<<< @@ -10462,19 +11424,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, 424, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 424, __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_ERR(0, 424, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 392, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 424, __pyx_L1_error) #endif - /* "constraint/constraints.py":393 + /* "constraint/constraints.py":425 * 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." # <<<<<<<<<<<<<< @@ -10483,23 +11445,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, 425, __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, 425, __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, 425, __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_ERR(0, 425, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 393, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 425, __pyx_L1_error) #endif - /* "constraint/constraints.py":394 + /* "constraint/constraints.py":426 * 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." # <<<<<<<<<<<<<< @@ -10508,20 +11470,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); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 426, __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, 426, __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_ERR(0, 426, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 394, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 426, __pyx_L1_error) #endif - /* "constraint/constraints.py":391 + /* "constraint/constraints.py":423 * self._multipliers = multipliers * * if multipliers: # <<<<<<<<<<<<<< @@ -10530,8 +11492,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":377 - * """ + /* "constraint/constraints.py":409 + * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. @@ -10553,7 +11515,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":396 +/* "constraint/constraints.py":428 * 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 # <<<<<<<<<<<<<< @@ -10604,50 +11566,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, 428, __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, 428, __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, 428, __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, 428, __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, 428, __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, 428, __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, 428, __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, 428, __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, 428, __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, 428, __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, 428, __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, 428, __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, 428, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -10657,7 +11619,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, 428, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10668,9 +11630,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, 428, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 428, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 428, __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 */ @@ -10691,7 +11653,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":442 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -10711,7 +11673,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, 442, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10722,7 +11684,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, 442, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -10766,17 +11728,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, 442, __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, 442, __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, 442, __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, 442, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -10784,7 +11746,7 @@ 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, 442, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -10794,7 +11756,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain { 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, 442, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -10805,13 +11767,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, 442, __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, 442, __pyx_L1_error) PyErr_Clear(); } break; @@ -10822,20 +11784,20 @@ 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, 442, __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, 442, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 442, __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, 442, __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, 442, __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_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, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; { @@ -10844,7 +11806,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain __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, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = __pyx_t_4; @@ -10865,7 +11827,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, 442, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10896,7 +11858,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":443 * 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) # <<<<<<<<<<<<<< @@ -10916,7 +11878,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, 443, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10927,7 +11889,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, 443, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -10971,17 +11933,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, 443, __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, 443, __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, 443, __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, 443, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -10989,7 +11951,7 @@ 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, 443, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -10999,7 +11961,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain { 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, 443, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -11010,13 +11972,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, 443, __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, 443, __pyx_L1_error) PyErr_Clear(); } break; @@ -11027,20 +11989,20 @@ 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, 443, __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, 443, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 443, __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, 443, __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, 443, __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_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, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; { @@ -11049,7 +12011,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain __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, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = __pyx_t_4; @@ -11070,7 +12032,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, 443, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11100,7 +12062,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":396 +/* "constraint/constraints.py":428 * 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 # <<<<<<<<<<<<<< @@ -11143,7 +12105,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, 428, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -11151,7 +12113,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":429 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -11159,9 +12121,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, 429, __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, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -11181,34 +12143,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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_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, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":399 + /* "constraint/constraints.py":431 * 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, 431, __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":433 * 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, 433, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/constraints.py":402 + /* "constraint/constraints.py":434 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -11218,7 +12180,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; { @@ -11227,7 +12189,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -11235,9 +12197,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, 434, __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, 434, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -11246,7 +12208,7 @@ 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, 434, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -11256,7 +12218,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 434, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -11267,13 +12229,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, 434, __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, 434, __pyx_L1_error) PyErr_Clear(); } break; @@ -11286,7 +12248,7 @@ 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, 434, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -11296,22 +12258,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __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) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __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, 402, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __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, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __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, 402, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 434, __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); @@ -11319,7 +12281,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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; __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 402, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 434, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; @@ -11327,7 +12289,7 @@ 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, 434, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_var); @@ -11337,35 +12299,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":403 + /* "constraint/constraints.py":435 * 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, 435, __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":436 * 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, 436, __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_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_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __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_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 436, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -11374,7 +12336,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 404, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 436, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -11384,7 +12346,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 404, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 436, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -11395,13 +12357,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_12(__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, 404, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 436, __pyx_L1_error) PyErr_Clear(); } break; @@ -11411,21 +12373,21 @@ 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":437 * 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, 437, __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_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 437, __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_t_15 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_5 = 1; @@ -11435,17 +12397,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - __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_13 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 437, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_6) { - /* "constraint/constraints.py":406 + /* "constraint/constraints.py":438 * for value in domain[:]: * if value * multiplier > max(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< @@ -11459,12 +12421,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain 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) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "constraint/constraints.py":405 + /* "constraint/constraints.py":437 * domain = domains[var] * for value in domain[:]: * if value * multiplier > max(domains[self.target_var]): # <<<<<<<<<<<<<< @@ -11473,7 +12435,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":404 + /* "constraint/constraints.py":436 * for var, multiplier in zip(self.sum_vars, multipliers): * domain = domains[var] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -11483,7 +12445,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":402 + /* "constraint/constraints.py":434 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -11493,7 +12455,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":401 + /* "constraint/constraints.py":433 * multipliers = self._multipliers * * if multipliers: # <<<<<<<<<<<<<< @@ -11503,7 +12465,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L3; } - /* "constraint/constraints.py":408 + /* "constraint/constraints.py":440 * domain.remove(value) * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -11511,16 +12473,16 @@ 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, 440, __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_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_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 440, __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_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 440, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -11529,7 +12491,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 408, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 440, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -11539,7 +12501,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 408, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 440, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -11550,13 +12512,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) } else { __pyx_t_2 = __pyx_t_8(__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, 408, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 440, __pyx_L1_error) PyErr_Clear(); } break; @@ -11568,19 +12530,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":409 + /* "constraint/constraints.py":441 * 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, 441, __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":442 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -11590,9 +12552,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __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_t_15 = __pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = 1; @@ -11602,13 +12564,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __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":443 * 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) # <<<<<<<<<<<<<< @@ -11618,9 +12580,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 443, __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_t_1 = __pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_3genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_5 = 1; @@ -11630,29 +12592,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __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":444 * 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, 444, __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_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_t_11 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 444, __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_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_15); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 444, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -11661,7 +12623,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_15); #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, 444, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -11671,7 +12633,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_15); #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, 444, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -11682,13 +12644,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error) } else { __pyx_t_2 = __pyx_t_12(__pyx_t_15); 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, 444, __pyx_L1_error) PyErr_Clear(); } break; @@ -11698,21 +12660,21 @@ 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":445 * 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, 445, __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_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 445, __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_t_14 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_5 = 1; @@ -11722,17 +12684,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__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, 445, __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, 445, __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, 445, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_6) { - /* "constraint/constraints.py":414 + /* "constraint/constraints.py":446 * for value in domain[:]: * if value + others_min > max(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< @@ -11746,12 +12708,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain 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_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, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "constraint/constraints.py":413 + /* "constraint/constraints.py":445 * 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]): # <<<<<<<<<<<<<< @@ -11760,21 +12722,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":415 + /* "constraint/constraints.py":447 * 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, 447, __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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __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_9 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -11784,17 +12746,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 447, __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_14 = PyObject_RichCompare(__pyx_t_13, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 447, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_6) { - /* "constraint/constraints.py":416 + /* "constraint/constraints.py":448 * domain.remove(value) * if value + others_max < min(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< @@ -11808,12 +12770,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain 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_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 416, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "constraint/constraints.py":415 + /* "constraint/constraints.py":447 * if value + others_min > max(domains[self.target_var]): * domain.remove(value) * if value + others_max < min(domains[self.target_var]): # <<<<<<<<<<<<<< @@ -11822,7 +12784,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":412 + /* "constraint/constraints.py":444 * 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[:]: # <<<<<<<<<<<<<< @@ -11832,7 +12794,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "constraint/constraints.py":408 + /* "constraint/constraints.py":440 * domain.remove(value) * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -11844,7 +12806,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __pyx_L3:; - /* "constraint/constraints.py":396 + /* "constraint/constraints.py":428 * 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 # <<<<<<<<<<<<<< @@ -11881,7 +12843,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":418 +/* "constraint/constraints.py":450 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -11932,53 +12894,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, 450, __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, 450, __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, 450, __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, 450, __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, 450, __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, 450, __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, 450, __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, 450, __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, 450, __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, 450, __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, 450, __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, 450, __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, 450, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -11992,7 +12954,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, 450, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -12003,8 +12965,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, 450, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 450, __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 */ @@ -12054,32 +13016,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":419 + /* "constraint/constraints.py":451 * * 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, 451, __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":453 * 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, 453, __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, 453, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":422 + /* "constraint/constraints.py":454 * * if self.target_var not in assignments: * return True # can't evaluate without target, defer to later # <<<<<<<<<<<<<< @@ -12091,7 +13053,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":421 + /* "constraint/constraints.py":453 * multipliers = self._multipliers * * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -12100,22 +13062,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":424 + /* "constraint/constraints.py":456 * 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, 456, __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, 456, __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":457 * * target_value = assignments[self.target_var] * sum_value = 0 # <<<<<<<<<<<<<< @@ -12125,7 +13087,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":458 * target_value = assignments[self.target_var] * sum_value = 0 * missing = False # <<<<<<<<<<<<<< @@ -12134,17 +13096,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ __pyx_v_missing = 0; - /* "constraint/constraints.py":428 + /* "constraint/constraints.py":460 * 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, 460, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":429 + /* "constraint/constraints.py":461 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -12154,7 +13116,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; { @@ -12163,7 +13125,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { @@ -12171,9 +13133,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 429, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 461, __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_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 461, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -12182,7 +13144,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 461, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -12192,7 +13154,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 461, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -12203,13 +13165,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L1_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, 429, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 461, __pyx_L1_error) PyErr_Clear(); } break; @@ -12222,7 +13184,7 @@ 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, 461, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -12232,22 +13194,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 461, __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) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); } #else - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 461, __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, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #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, 461, __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); @@ -12255,7 +13217,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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; __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 429, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 461, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; @@ -12263,7 +13225,7 @@ 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, 461, __pyx_L1_error) __pyx_L8_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_5); @@ -12271,35 +13233,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":430 + /* "constraint/constraints.py":462 * 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, 462, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":431 + /* "constraint/constraints.py":463 * 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, 463, __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_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __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_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":430 + /* "constraint/constraints.py":462 * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: # <<<<<<<<<<<<<< @@ -12309,7 +13271,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L9; } - /* "constraint/constraints.py":433 + /* "constraint/constraints.py":465 * sum_value += assignments[var] * multiplier * else: * missing = True # <<<<<<<<<<<<<< @@ -12321,7 +13283,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __pyx_L9:; - /* "constraint/constraints.py":429 + /* "constraint/constraints.py":461 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -12331,7 +13293,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":428 + /* "constraint/constraints.py":460 * missing = False * * if multipliers: # <<<<<<<<<<<<<< @@ -12341,7 +13303,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L4; } - /* "constraint/constraints.py":435 + /* "constraint/constraints.py":467 * missing = True * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -12349,16 +13311,16 @@ 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, 467, __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; } 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_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 467, __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_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 467, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -12367,7 +13329,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 467, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -12377,7 +13339,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 467, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -12388,13 +13350,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 467, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_8(__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, 467, __pyx_L1_error) PyErr_Clear(); } break; @@ -12404,32 +13366,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":468 * 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, 468, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":437 + /* "constraint/constraints.py":469 * 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, 469, __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_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":436 + /* "constraint/constraints.py":468 * else: * for var in self.sum_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -12439,7 +13401,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L13; } - /* "constraint/constraints.py":439 + /* "constraint/constraints.py":471 * sum_value += assignments[var] * else: * sum_value += min(domains[var]) # use min value if not assigned # <<<<<<<<<<<<<< @@ -12450,7 +13412,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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_t_9 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = 1; { @@ -12459,16 +13421,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __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_t_5 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 471, __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; - /* "constraint/constraints.py":440 + /* "constraint/constraints.py":472 * else: * sum_value += min(domains[var]) # use min value if not assigned * missing = True # <<<<<<<<<<<<<< @@ -12479,7 +13441,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __pyx_L13:; - /* "constraint/constraints.py":435 + /* "constraint/constraints.py":467 * missing = True * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -12491,7 +13453,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __pyx_L4:; - /* "constraint/constraints.py":442 + /* "constraint/constraints.py":474 * missing = True * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -12501,7 +13463,7 @@ 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":475 * * if isinstance(sum_value, float): * sum_value = round(sum_value, 10) # <<<<<<<<<<<<<< @@ -12517,13 +13479,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __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":474 * missing = True * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -12532,7 +13494,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":445 + /* "constraint/constraints.py":477 * sum_value = round(sum_value, 10) * * if missing: # <<<<<<<<<<<<<< @@ -12541,19 +13503,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ if (__pyx_v_missing) { - /* "constraint/constraints.py":447 + /* "constraint/constraints.py":479 * 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, 479, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":448 + /* "constraint/constraints.py":480 * # Partial assignments: only check feasibility * if sum_value > target_value: * return False # <<<<<<<<<<<<<< @@ -12565,7 +13527,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":447 + /* "constraint/constraints.py":479 * if missing: * # Partial assignments: only check feasibility * if sum_value > target_value: # <<<<<<<<<<<<<< @@ -12574,33 +13536,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":449 + /* "constraint/constraints.py":481 * 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, 481, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":450 + /* "constraint/constraints.py":482 * 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, 482, __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; } 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_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __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_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 482, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -12609,7 +13571,7 @@ static PyObject *__pyx_pf_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, 450, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 482, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -12619,7 +13581,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 482, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -12630,13 +13592,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 482, __pyx_L1_error) } else { __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, 450, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 482, __pyx_L1_error) PyErr_Clear(); } break; @@ -12646,55 +13608,55 @@ 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":483 * 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, 483, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":452 + /* "constraint/constraints.py":484 * 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, 484, __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":485 * 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, 485, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":454 + /* "constraint/constraints.py":486 * 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, 486, __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_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_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 486, __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_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 486, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -12703,7 +13665,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 454, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 486, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -12713,7 +13675,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 454, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 486, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -12724,13 +13686,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L1_error) } else { __pyx_t_3 = __pyx_t_12(__pyx_t_5); 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, 486, __pyx_L1_error) PyErr_Clear(); } break; @@ -12740,14 +13702,14 @@ 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":487 * 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_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __pyx_t_4; __Pyx_INCREF(__pyx_t_9); @@ -12757,34 +13719,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 487, __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_t_4 = __Pyx_PyObject_GetItem(__pyx_v_multipliers, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 487, __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_t_4 = PyNumber_Add(__pyx_v_sum_value, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_temp_sum, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":456 + /* "constraint/constraints.py":488 * 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_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, 488, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":457 + /* "constraint/constraints.py":489 * temp_sum = sum_value + (value * multipliers[self.sum_vars.index(var)]) * if temp_sum > target_value: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -12798,12 +13760,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain 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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 457, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":456 + /* "constraint/constraints.py":488 * for value in domain[:]: * temp_sum = sum_value + (value * multipliers[self.sum_vars.index(var)]) * if temp_sum > target_value: # <<<<<<<<<<<<<< @@ -12812,7 +13774,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":454 + /* "constraint/constraints.py":486 * domain = domains[var] * if multipliers: * for value in domain[:]: # <<<<<<<<<<<<<< @@ -12822,7 +13784,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":453 + /* "constraint/constraints.py":485 * if var not in assignments: * domain = domains[var] * if multipliers: # <<<<<<<<<<<<<< @@ -12832,7 +13794,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L22; } - /* "constraint/constraints.py":459 + /* "constraint/constraints.py":491 * domain.hideValue(value) * else: * for value in domain[:]: # <<<<<<<<<<<<<< @@ -12840,16 +13802,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain * if temp_sum > 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_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, 491, __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_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_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 491, __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_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 491, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { @@ -12858,7 +13820,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 459, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 491, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -12868,7 +13830,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 459, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 491, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -12879,13 +13841,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 491, __pyx_L1_error) } else { __pyx_t_5 = __pyx_t_12(__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, 459, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 491, __pyx_L1_error) PyErr_Clear(); } break; @@ -12895,31 +13857,31 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":460 + /* "constraint/constraints.py":492 * 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_t_5 = PyNumber_Add(__pyx_v_sum_value, __pyx_v_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_temp_sum, __pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":461 + /* "constraint/constraints.py":493 * for value in domain[:]: * temp_sum = sum_value + value * if temp_sum > 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_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, 493, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":462 + /* "constraint/constraints.py":494 * temp_sum = sum_value + value * if temp_sum > target_value: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -12933,12 +13895,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain 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) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":461 + /* "constraint/constraints.py":493 * for value in domain[:]: * temp_sum = sum_value + value * if temp_sum > target_value: # <<<<<<<<<<<<<< @@ -12947,7 +13909,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":459 + /* "constraint/constraints.py":491 * domain.hideValue(value) * else: * for value in domain[:]: # <<<<<<<<<<<<<< @@ -12959,18 +13921,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __pyx_L22:; - /* "constraint/constraints.py":463 + /* "constraint/constraints.py":495 * if temp_sum > 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, 495, __pyx_L1_error) __pyx_t_13 = (!__pyx_t_2); if (__pyx_t_13) { - /* "constraint/constraints.py":464 + /* "constraint/constraints.py":496 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -12983,7 +13945,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":463 + /* "constraint/constraints.py":495 * if temp_sum > target_value: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -12992,7 +13954,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":451 + /* "constraint/constraints.py":483 * if forwardcheck: * for var in self.sum_vars: * if var not in assignments: # <<<<<<<<<<<<<< @@ -13001,7 +13963,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":450 + /* "constraint/constraints.py":482 * return False * if forwardcheck: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -13011,7 +13973,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":449 + /* "constraint/constraints.py":481 * if sum_value > target_value: * return False * if forwardcheck: # <<<<<<<<<<<<<< @@ -13020,7 +13982,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":465 + /* "constraint/constraints.py":497 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -13032,7 +13994,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":445 + /* "constraint/constraints.py":477 * sum_value = round(sum_value, 10) * * if missing: # <<<<<<<<<<<<<< @@ -13041,7 +14003,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":467 + /* "constraint/constraints.py":499 * return True * else: * return sum_value == target_value # <<<<<<<<<<<<<< @@ -13050,13 +14012,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, 499, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } - /* "constraint/constraints.py":418 + /* "constraint/constraints.py":450 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -13087,7 +14049,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":481 +/* "constraint/constraints.py":518 * """ * * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -13137,41 +14099,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, 518, __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, 518, __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, 518, __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, 518, __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, 518, __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, 518, __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, 518, __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, 518, __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, 518, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -13183,7 +14145,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, 518, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -13207,30 +14169,43 @@ 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":527 * 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, 527, __pyx_L1_error) - /* "constraint/constraints.py":491 + /* "constraint/constraints.py":528 * """ * 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, 528, __pyx_L1_error) + + /* "constraint/constraints.py":529 + * 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, 529, __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, 529, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":481 + /* "constraint/constraints.py":518 * """ * * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -13242,6 +14217,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:; @@ -13250,24 +14226,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint___init__ return __pyx_r; } -/* "constraint/constraints.py":493 - * self._multipliers = multipliers +/* "constraint/constraints.py":531 + * 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_3__call__(PyObject *__pyx_self, +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_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_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 @@ -13276,9 +14252,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_variables = 0; - CYTHON_UNUSED PyObject *__pyx_v_domains = 0; - PyObject *__pyx_v_assignments = 0; - CYTHON_UNUSED PyObject *__pyx_v_forwardcheck = 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 @@ -13289,7 +14265,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + __Pyx_RefNannySetupContext("preProcess (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -13299,82 +14275,76 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #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,0}; + 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, 493, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 531, __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, 531, __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, 531, __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, 531, __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, 531, __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, 531, __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 (!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 (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < 0) __PYX_ERR(0, 531, __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, 531, __pyx_L3_error) } } + } else if (unlikely(__pyx_nargs != 5)) { + goto __pyx_L5_argtuple_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) - 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) - values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 493, __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) - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 493, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_error; - } - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 531, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 531, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 531, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 531, __pyx_L3_error) + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 531, __pyx_L3_error) } __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_v_constraints = ((PyObject*)values[3]); + __pyx_v_vconstraints = ((PyObject*)values[4]); } 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("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 531, __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.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __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, 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, 531, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 531, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 531, __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; @@ -13393,506 +14363,1478 @@ 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_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_minsum = NULL; - PyObject *__pyx_v_sum = 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; - Py_ssize_t __pyx_t_2; - PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - size_t __pyx_t_7; - PyObject *__pyx_t_8 = 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)(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("__call__", 0); + __Pyx_RefNannySetupContext("preProcess", 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 + /* "constraint/constraints.py":532 + * + * 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 */ - 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_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __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, 532, __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(__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, 532, __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; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "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":533 + * 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, 533, __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, 533, __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, 533, __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, 533, __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, 533, __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, 533, __pyx_L1_error); + } } - - /* "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_t_1 = __pyx_t_4; + __pyx_t_4 = 0; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "constraint/constraints.py":500 - * - * # with each variable assigned, sum the values - * 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_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 - * multipliers = self._multipliers - * minsum = self._minsum # <<<<<<<<<<<<<< - * sum = 0 - * if multipliers: -*/ - __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_GOTREF(__pyx_t_1); - __pyx_v_minsum = __pyx_t_1; - __pyx_t_1 = 0; - - /* "constraint/constraints.py":502 - * multipliers = self._multipliers - * minsum = self._minsum - * sum = 0 # <<<<<<<<<<<<<< - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): -*/ - __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); - __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; - - /* "constraint/constraints.py":503 - * minsum = self._minsum - * sum = 0 - * if multipliers: # <<<<<<<<<<<<<< - * for variable, multiplier in zip(variables, multipliers): - * sum += assignments[variable] * multiplier -*/ - __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) { - - /* "constraint/constraints.py":504 - * sum = 0 - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< - * sum += assignments[variable] * multiplier - * else: + /* "constraint/constraints.py":534 + * 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 */ - __pyx_t_4 = NULL; + { /* enter inner scope */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_6 = __pyx_builtin_zip; - __pyx_t_7 = 1; + __pyx_t_3 = __pyx_builtin_zip; + __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_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) - __Pyx_GOTREF(__pyx_t_1); + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_variables, __pyx_v_multipliers}; + __pyx_t_4 = __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_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); } - 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; + 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; } 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_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 534, __pyx_L5_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, 534, __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_3)) { - if (likely(PyList_CheckExact(__pyx_t_6))) { + if (likely(!__pyx_t_8)) { + 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, 534, __pyx_L5_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_2); - ++__pyx_t_2; + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_7); + ++__pyx_t_7; } 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, 534, __pyx_L5_error) #endif - if (__pyx_t_2 >= __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_6, __pyx_t_2)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_2); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); #endif - ++__pyx_t_2; + ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L5_error) } else { - __pyx_t_1 = __pyx_t_3(__pyx_t_6); - if (unlikely(!__pyx_t_1)) { + __pyx_t_4 = __pyx_t_8(__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, 504, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 534, __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, 504, __pyx_L1_error) + __PYX_ERR(0, 534, __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_8 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_8); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __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, 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_XGOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L5_error) + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 534, __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, 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_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 534, __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, 504, __pyx_L1_error) + __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 534, __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_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + 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); - __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; - __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 504, __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:; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_10 = NULL; + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 534, __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, 504, __pyx_L1_error) - __pyx_L11_unpacking_done:; + __PYX_ERR(0, 534, __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_8); - __pyx_t_8 = 0; - - /* "constraint/constraints.py":505 - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): - * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< - * 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; - - /* "constraint/constraints.py":504 - * sum = 0 - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< - * sum += assignments[variable] * multiplier - * else: -*/ + __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_variable, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_multiplier, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __Pyx_INCREF(__pyx_builtin_max); + __pyx_t_2 = __pyx_builtin_max; + __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr8__pyx_v_variable); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 534, __pyx_L5_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(__pyx_t_2, __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; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + } + __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_8genexpr8__pyx_v_multiplier); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __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_2))) __PYX_ERR(0, 534, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 534, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":503 - * minsum = self._minsum - * sum = 0 - * if multipliers: # <<<<<<<<<<<<<< - * for variable, multiplier in zip(variables, multipliers): - * sum += assignments[variable] * multiplier + /* "constraint/constraints.py":537 + * + * # 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) */ - goto __pyx_L7; + __pyx_t_3 = NULL; + __Pyx_INCREF(__pyx_builtin_zip); + __pyx_t_2 = __pyx_builtin_zip; + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __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_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - - /* "constraint/constraints.py":507 - * sum += assignments[variable] * multiplier - * else: - * for variable in variables: # <<<<<<<<<<<<<< - * sum += assignments[variable] - * if isinstance(sum, float): -*/ - /*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; - } 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) - } - for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_6))) { - { - 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, 507, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_2); - ++__pyx_t_2; - } 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, 507, __pyx_L1_error) - #endif - 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_6, __pyx_t_2)); - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_2); + 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, 537, __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, 537, __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, 537, __pyx_L1_error) #endif - ++__pyx_t_2; + if (__pyx_t_7 >= __pyx_temp) break; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_7); + ++__pyx_t_7; } else { - __pyx_t_1 = __pyx_t_3(__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, 507, __pyx_L1_error) - PyErr_Clear(); - } - break; + { + 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, 537, __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, 537, __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, 537, __pyx_L1_error) + PyErr_Clear(); } + break; } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); - __pyx_t_1 = 0; - - /* "constraint/constraints.py":508 - * else: - * for variable in variables: - * sum += assignments[variable] # <<<<<<<<<<<<<< - * 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; - - /* "constraint/constraints.py":507 - * sum += assignments[variable] * multiplier - * else: - * for variable in variables: # <<<<<<<<<<<<<< - * sum += assignments[variable] - * if isinstance(sum, float): -*/ } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __pyx_L7:; + __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, 537, __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_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __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, 537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __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_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_L14_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_4 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L14_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15_unpacking_done; + __pyx_L14_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, 537, __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":538 + * # 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, 538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":539 + * 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, 539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __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_10}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__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_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __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":540 + * 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, 540, __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, 540, __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, 540, __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, 540, __pyx_L1_error) + #endif + if (__pyx_t_12 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12); + ++__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, 540, __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, 540, __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, 540, __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":541 + * 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, 541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = PyNumber_Add(__pyx_t_1, __pyx_v_others_max); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __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, 541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_10, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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, 541, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + + /* "constraint/constraints.py":542 + * 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(__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, 542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":541 + * 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":540 + * 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":537 + * + * # 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":545 + * + * # recalculate the max after pruning + * self._var_max = { variable: max(domains[variable]) * multiplier 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, 545, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + __Pyx_INCREF(__pyx_builtin_zip); + __pyx_t_1 = __pyx_builtin_zip; + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_variables, __pyx_v_multipliers}; + __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_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L23_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; + } else { + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __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, 545, __pyx_L23_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 545, __pyx_L23_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_7); + ++__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, 545, __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_1, __pyx_t_7)); + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); + #endif + ++__pyx_t_7; + } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L23_error) + } else { + __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, 545, __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, 545, __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_INCREF(__pyx_t_4); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_10); + } else { + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L23_error) + __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 545, __pyx_L23_error) + __Pyx_XGOTREF(__pyx_t_10); + } + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 545, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_10); + #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, 545, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_L26_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + index = 1; __pyx_t_10 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_10)) goto __pyx_L26_unpacking_failed; + __Pyx_GOTREF(__pyx_t_10); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 2) < 0) __PYX_ERR(0, 545, __pyx_L23_error) + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L27_unpacking_done; + __pyx_L26_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_L23_error) + __pyx_L27_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_variable, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_multiplier, __pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = NULL; + __Pyx_INCREF(__pyx_builtin_max); + __pyx_t_4 = __pyx_builtin_max; + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr9__pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 545, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_9}; + __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_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); + } + __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_8genexpr9__pyx_v_multiplier); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_8genexpr9__pyx_v_variable, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 545, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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, 545, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":531 + * 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":547 + * self._var_max = { variable: max(domains[variable]) * multiplier 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_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_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 +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_variables = 0; + CYTHON_UNUSED PyObject *__pyx_v_domains = 0; + PyObject *__pyx_v_assignments = 0; + CYTHON_UNUSED PyObject *__pyx_v_forwardcheck = 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("__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,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, 547, __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, 547, __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, 547, __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, 547, __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, 547, __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, 547, __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, 547, __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, 547, __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, 547, __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, 547, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 547, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 547, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 547, __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, 547, __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.__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, 547, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 547, __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; + __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_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; + 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 *); + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *(*__pyx_t_10)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "constraint/constraints.py":548 + * + * 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, 548, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_multipliers = __pyx_t_1; + __pyx_t_1 = 0; - /* "constraint/constraints.py":509 + /* "constraint/constraints.py":549 + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * multipliers = self._multipliers + * minsum = self._minsum # <<<<<<<<<<<<<< + * sum = 0 + * 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, 549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_minsum = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":550 + * multipliers = self._multipliers + * minsum = self._minsum + * sum = 0 # <<<<<<<<<<<<<< + * 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":551 + * minsum = self._minsum + * sum = 0 + * missing = False # <<<<<<<<<<<<<< + * max_sum_missing = 0 + * if multipliers: +*/ + __pyx_v_missing = 0; + + /* "constraint/constraints.py":552 + * 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":553 + * missing = False + * max_sum_missing = 0 + * 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, 553, __pyx_L1_error) + if (__pyx_t_2) { + + /* "constraint/constraints.py":554 + * max_sum_missing = 0 + * 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; + { + 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_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, 554, __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; + } else { + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __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, 554, __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))) { + { + 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, 554, __pyx_L1_error) + #endif + if (__pyx_t_6 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_6); + ++__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, 554, __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_4, __pyx_t_6)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_7(__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, 554, __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, 554, __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_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, 554, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 554, __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, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 554, __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, 554, __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_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, 554, __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; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 554, __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_multiplier, __pyx_t_8); + __pyx_t_8 = 0; + + /* "constraint/constraints.py":555 + * 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, 555, __pyx_L1_error) + if (__pyx_t_2) { + + /* "constraint/constraints.py":556 + * 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, 556, __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, 556, __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, 556, __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":555 + * if multipliers: + * for variable, multiplier in zip(variables, multipliers): + * if variable in assignments: # <<<<<<<<<<<<<< + * sum += assignments[variable] * multiplier + * else: +*/ + goto __pyx_L8; + } + + /* "constraint/constraints.py":558 + * 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, 558, __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, 558, __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, 558, __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":559 + * else: + * max_sum_missing += self._var_max[variable] + * missing = True # <<<<<<<<<<<<<< + * else: * for variable in variables: - * sum += assignments[variable] +*/ + __pyx_v_missing = 1; + } + __pyx_L8:; + + /* "constraint/constraints.py":554 + * max_sum_missing = 0 + * 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; + + /* "constraint/constraints.py":553 + * missing = False + * max_sum_missing = 0 + * if multipliers: # <<<<<<<<<<<<<< + * for variable, multiplier in zip(variables, multipliers): + * if variable in assignments: +*/ + goto __pyx_L3; + } + + /* "constraint/constraints.py":561 + * missing = True + * else: + * for variable in variables: # <<<<<<<<<<<<<< + * if variable in assignments: + * sum += assignments[variable] +*/ + /*else*/ { + if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { + __pyx_t_4 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_4); + __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 561, __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, 561, __pyx_L1_error) + } + for (;;) { + 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, 561, __pyx_L1_error) + #endif + if (__pyx_t_6 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_6); + ++__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, 561, __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_4, __pyx_t_6)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); + #endif + ++__pyx_t_6; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_7(__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, 561, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":562 + * else: + * for variable in variables: + * 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, 562, __pyx_L1_error) + if (__pyx_t_2) { + + /* "constraint/constraints.py":563 + * 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, 563, __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, 563, __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":562 + * else: + * for variable in variables: + * if variable in assignments: # <<<<<<<<<<<<<< + * sum += assignments[variable] + * else: +*/ + goto __pyx_L12; + } + + /* "constraint/constraints.py":565 + * 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, 565, __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, 565, __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, 565, __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":566 + * else: + * max_sum_missing += self._var_max[variable] + * missing = True # <<<<<<<<<<<<<< + * + * if isinstance(sum, float): +*/ + __pyx_v_missing = 1; + } + __pyx_L12:; + + /* "constraint/constraints.py":561 + * missing = True + * else: + * for variable in variables: # <<<<<<<<<<<<<< + * if variable in assignments: + * sum += assignments[variable] +*/ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "constraint/constraints.py":568 + * 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":569 + * * 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_5 = 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_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_6)) __PYX_ERR(0, 510, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); } - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_6); - __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_4); + __pyx_t_4 = 0; - /* "constraint/constraints.py":509 - * for variable in variables: - * sum += assignments[variable] + /* "constraint/constraints.py":568 + * 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":570 + * if isinstance(sum, float): + * sum = round(sum, 10) + * if sum + max_sum_missing < minsum: # <<<<<<<<<<<<<< + * return False + * return sum >= minsum or missing +*/ + __pyx_t_4 = PyNumber_Add(__pyx_v_sum, __pyx_v_max_sum_missing); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_minsum, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 570, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "constraint/constraints.py":571 + * 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":570 * 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":572 + * 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_4 = PyObject_RichCompare(__pyx_v_sum, __pyx_v_minsum, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 572, __pyx_L1_error) + if (!__pyx_t_2) { + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + __Pyx_INCREF(__pyx_t_4); + __pyx_t_1 = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L16_bool_binop_done; + } + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_missing); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_L16_bool_binop_done:; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":493 - * self._multipliers = multipliers + /* "constraint/constraints.py":547 + * self._var_max = { variable: max(domains[variable]) * multiplier 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_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); __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":591 * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -13943,47 +15885,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, 591, __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, 591, __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, 591, __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, 591, __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, 591, __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, 591, __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, 591, __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, 591, __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, 591, __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, 591, __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, 591, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -13996,7 +15938,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, 591, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -14007,7 +15949,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, 591, __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 */ @@ -14028,7 +15970,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":607 * 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." # <<<<<<<<<<<<<< @@ -14048,7 +15990,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, 607, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -14056,7 +15998,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, 607, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -14094,16 +16036,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, 607, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 607, __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, 607, __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, 607, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -14111,7 +16053,7 @@ 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, 607, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -14121,7 +16063,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 607, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -14132,13 +16074,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, 607, __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, 607, __pyx_L1_error) PyErr_Clear(); } break; @@ -14196,7 +16138,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":524 +/* "constraint/constraints.py":591 * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -14218,44 +16160,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":534 + /* "constraint/constraints.py":601 * 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, 601, __pyx_L1_error) - /* "constraint/constraints.py":535 + /* "constraint/constraints.py":602 * """ * 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, 602, __pyx_L1_error) - /* "constraint/constraints.py":536 + /* "constraint/constraints.py":603 * 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, 603, __pyx_L1_error) - /* "constraint/constraints.py":538 + /* "constraint/constraints.py":605 * 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, 605, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/constraints.py":539 + /* "constraint/constraints.py":606 * * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." # <<<<<<<<<<<<<< @@ -14264,19 +16206,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, 606, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 606, __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_ERR(0, 606, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 539, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 606, __pyx_L1_error) #endif - /* "constraint/constraints.py":540 + /* "constraint/constraints.py":607 * 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." # <<<<<<<<<<<<<< @@ -14285,23 +16227,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, 607, __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, 607, __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, 607, __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_ERR(0, 607, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 540, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 607, __pyx_L1_error) #endif - /* "constraint/constraints.py":541 + /* "constraint/constraints.py":608 * 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." # <<<<<<<<<<<<<< @@ -14310,20 +16252,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); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __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, 608, __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_ERR(0, 608, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 541, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 608, __pyx_L1_error) #endif - /* "constraint/constraints.py":538 + /* "constraint/constraints.py":605 * self._multipliers = multipliers * * if multipliers: # <<<<<<<<<<<<<< @@ -14332,7 +16274,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":524 + /* "constraint/constraints.py":591 * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -14355,7 +16297,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":543 +/* "constraint/constraints.py":610 * 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 # <<<<<<<<<<<<<< @@ -14406,50 +16348,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, 610, __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, 610, __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, 610, __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, 610, __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, 610, __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, 610, __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, 610, __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, 610, __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, 610, __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, 610, __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, 610, __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, 610, __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, 610, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -14459,7 +16401,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, 610, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -14470,9 +16412,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, 610, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 610, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 610, __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 */ @@ -14493,7 +16435,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":618 * for var in self.sum_vars: * domain = domains[var] * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -14513,7 +16455,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, 618, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -14524,7 +16466,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, 618, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -14568,17 +16510,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, 618, __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, 618, __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, 618, __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, 618, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -14586,7 +16528,7 @@ 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, 618, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -14596,7 +16538,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 618, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -14607,13 +16549,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, 618, __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, 618, __pyx_L1_error) PyErr_Clear(); } break; @@ -14624,20 +16566,20 @@ 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, 618, __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, 618, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 618, __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, 618, __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, 618, __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_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, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; { @@ -14646,7 +16588,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ __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, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = __pyx_t_4; @@ -14667,7 +16609,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, 618, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -14697,7 +16639,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":543 +/* "constraint/constraints.py":610 * 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 # <<<<<<<<<<<<<< @@ -14737,7 +16679,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, 610, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -14745,7 +16687,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":611 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -14753,9 +16695,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, 611, __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, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -14775,51 +16717,51 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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_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, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":546 + /* "constraint/constraints.py":613 * 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, 613, __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":615 * 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, 615, __pyx_L1_error) __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { - /* "constraint/constraints.py":549 + /* "constraint/constraints.py":616 * * 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, 616, __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, 616, __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, 616, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -14828,7 +16770,7 @@ 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, 616, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -14838,7 +16780,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 616, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -14849,13 +16791,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, 616, __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, 616, __pyx_L1_error) PyErr_Clear(); } break; @@ -14867,19 +16809,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":550 + /* "constraint/constraints.py":617 * 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, 617, __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":618 * for var in self.sum_vars: * domain = domains[var] * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -14889,9 +16831,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 618, __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_t_11 = __pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_10preProcess_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_5 = 1; @@ -14901,29 +16843,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __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":619 * 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, 619, __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, 552, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 619, __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_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 619, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -14932,7 +16874,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 552, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 619, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -14942,7 +16884,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 552, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 619, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -14953,13 +16895,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __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, 552, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 619, __pyx_L1_error) PyErr_Clear(); } break; @@ -14969,21 +16911,21 @@ 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":620 * 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, 620, __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_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 620, __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_t_15 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_5 = 1; @@ -14993,17 +16935,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } - __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_10 = PyObject_RichCompare(__pyx_t_1, __pyx_t_11, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 620, __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_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":554 + /* "constraint/constraints.py":621 * for value in domain[:]: * if value + others_max < min(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< @@ -15017,12 +16959,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ 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) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "constraint/constraints.py":553 + /* "constraint/constraints.py":620 * 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]): # <<<<<<<<<<<<<< @@ -15031,7 +16973,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":552 + /* "constraint/constraints.py":619 * domain = domains[var] * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) * for value in domain[:]: # <<<<<<<<<<<<<< @@ -15041,7 +16983,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":549 + /* "constraint/constraints.py":616 * * if not multipliers: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -15051,7 +16993,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":548 + /* "constraint/constraints.py":615 * multipliers = self._multipliers * * if not multipliers: # <<<<<<<<<<<<<< @@ -15060,7 +17002,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":543 + /* "constraint/constraints.py":610 * 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 # <<<<<<<<<<<<<< @@ -15094,7 +17036,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":556 +/* "constraint/constraints.py":623 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -15145,53 +17087,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, 623, __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, 623, __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, 623, __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, 623, __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, 623, __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, 623, __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, 623, __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, 623, __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, 623, __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, 623, __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, 623, __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, 623, __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, 623, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -15205,7 +17147,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, 623, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -15216,8 +17158,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, 623, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 623, __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 */ @@ -15261,32 +17203,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":557 + /* "constraint/constraints.py":624 * * 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, 624, __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":626 * 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, 626, __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, 626, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":560 + /* "constraint/constraints.py":627 * * if self.target_var not in assignments: * return True # can't evaluate without target, defer to later # <<<<<<<<<<<<<< @@ -15298,7 +17240,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":559 + /* "constraint/constraints.py":626 * multipliers = self._multipliers * * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -15307,22 +17249,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":562 + /* "constraint/constraints.py":629 * 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, 629, __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, 629, __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":630 * * target_value = assignments[self.target_var] * sum_value = 0 # <<<<<<<<<<<<<< @@ -15332,17 +17274,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":632 * 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, 632, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":566 + /* "constraint/constraints.py":633 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -15352,7 +17294,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; { @@ -15361,7 +17303,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { @@ -15369,9 +17311,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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, 566, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __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_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 633, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -15380,7 +17322,7 @@ 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, 566, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 633, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -15390,7 +17332,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 633, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -15401,13 +17343,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L1_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, 566, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 633, __pyx_L1_error) PyErr_Clear(); } break; @@ -15420,7 +17362,7 @@ 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, 633, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -15430,22 +17372,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 633, __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) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); } #else - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 633, __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, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #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, 633, __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); @@ -15453,7 +17395,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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; __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 566, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 633, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; @@ -15461,7 +17403,7 @@ 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, 633, __pyx_L1_error) __pyx_L8_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_5); @@ -15469,35 +17411,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":567 + /* "constraint/constraints.py":634 * 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, 634, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":568 + /* "constraint/constraints.py":635 * 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, 635, __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_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __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_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":567 + /* "constraint/constraints.py":634 * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: # <<<<<<<<<<<<<< @@ -15507,7 +17449,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ goto __pyx_L9; } - /* "constraint/constraints.py":570 + /* "constraint/constraints.py":637 * sum_value += assignments[var] * multiplier * else: * sum_value += max(domains[var] * multiplier) # use max value if not assigned # <<<<<<<<<<<<<< @@ -15518,9 +17460,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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_9 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 637, __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_t_11 = PyNumber_Multiply(__pyx_t_9, __pyx_v_multiplier); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_6 = 1; @@ -15530,10 +17472,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 637, __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_t_5 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_5); @@ -15541,7 +17483,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __pyx_L9:; - /* "constraint/constraints.py":566 + /* "constraint/constraints.py":633 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -15551,7 +17493,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":565 + /* "constraint/constraints.py":632 * sum_value = 0 * * if multipliers: # <<<<<<<<<<<<<< @@ -15561,7 +17503,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ goto __pyx_L4; } - /* "constraint/constraints.py":572 + /* "constraint/constraints.py":639 * sum_value += max(domains[var] * multiplier) # use max value if not assigned * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -15569,16 +17511,16 @@ 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, 639, __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; } 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_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 639, __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_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 639, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -15587,7 +17529,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 572, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 639, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -15597,7 +17539,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 572, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 639, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -15608,13 +17550,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 639, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_8(__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, 572, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 639, __pyx_L1_error) PyErr_Clear(); } break; @@ -15624,32 +17566,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":640 * 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, 640, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":574 + /* "constraint/constraints.py":641 * 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, 641, __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, 641, __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":640 * else: * for var in self.sum_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -15659,7 +17601,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ goto __pyx_L13; } - /* "constraint/constraints.py":576 + /* "constraint/constraints.py":643 * sum_value += assignments[var] * else: * sum_value += max(domains[var]) # use max value if not assigned # <<<<<<<<<<<<<< @@ -15670,7 +17612,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 1; { @@ -15679,10 +17621,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __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_t_11 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_11); @@ -15690,7 +17632,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __pyx_L13:; - /* "constraint/constraints.py":572 + /* "constraint/constraints.py":639 * sum_value += max(domains[var] * multiplier) # use max value if not assigned * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -15702,7 +17644,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __pyx_L4:; - /* "constraint/constraints.py":578 + /* "constraint/constraints.py":645 * sum_value += max(domains[var]) # use max value if not assigned * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -15712,7 +17654,7 @@ 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":646 * * if isinstance(sum_value, float): * sum_value = round(sum_value, 10) # <<<<<<<<<<<<<< @@ -15728,13 +17670,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":578 + /* "constraint/constraints.py":645 * sum_value += max(domains[var]) # use max value if not assigned * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -15743,7 +17685,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":581 + /* "constraint/constraints.py":648 * sum_value = round(sum_value, 10) * * return sum_value >= target_value # <<<<<<<<<<<<<< @@ -15751,12 +17693,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_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, 648, __pyx_L1_error) __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/constraints.py":556 + /* "constraint/constraints.py":623 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -15785,7 +17727,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":595 +/* "constraint/constraints.py":667 * """ * * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -15835,41 +17777,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, 667, __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, 667, __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, 667, __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, 667, __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, 667, __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, 667, __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, 667, __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, 667, __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, 667, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -15881,7 +17823,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, 667, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -15905,30 +17847,55 @@ 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":676 * 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, 676, __pyx_L1_error) - /* "constraint/constraints.py":605 + /* "constraint/constraints.py":677 * """ * 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, 677, __pyx_L1_error) + + /* "constraint/constraints.py":678 + * 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, 678, __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, 678, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":679 + * 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, 679, __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, 679, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":595 + /* "constraint/constraints.py":667 * """ * * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -15940,6 +17907,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:; @@ -15948,12 +17916,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ return __pyx_r; } -/* "constraint/constraints.py":607 - * self._multipliers = multipliers +/* "constraint/constraints.py":681 + * 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 */ @@ -15999,272 +17967,105 @@ 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, 681, __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, 681, __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, 681, __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, 681, __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) - 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) - 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) - 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) } - } - } 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) - values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 607, __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) - values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 607, __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) - } - __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, 607, __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.MaxSumConstraint.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, 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) - __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 */ - 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_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 (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 681, __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, 681, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; } - 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; + 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, 681, __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, 681, __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, 681, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 681, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 681, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 681, __pyx_L3_error) + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 681, __pyx_L3_error) } - __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_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]); } - __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; + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 681, __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]); } - CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + __Pyx_AddTraceback("constraint.constraints.MaxSumConstraint.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, 681, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 681, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 681, __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 */ 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_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:; - __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); + 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; } -/* "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; @@ -16272,31 +18073,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":682 * * 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, 682, __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, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -16316,774 +18116,764 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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_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, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":611 - * - * # 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_GOTREF(__pyx_t_1); - __pyx_v_variable_contains_negative = ((PyObject*)__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]) -*/ - __Pyx_INCREF(Py_None); - __pyx_v_variable_with_negative = Py_None; - - /* "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":683 + * 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 */ - 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_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) - } - for (;;) { - 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, 613, __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_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, 613, __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_1, __pyx_t_6)); - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); - #endif - ++__pyx_t_6; - } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __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, 613, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } + __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, 683, __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, 683, __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, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); + __pyx_t_1 = __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: -*/ - __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) + } else { + __pyx_t_7 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 683, __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, 683, __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; - - /* "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: -*/ - __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) - - /* "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 -*/ - __pyx_t_9 = (__pyx_v_variable_with_negative != Py_None); - if (__pyx_t_9) { - - /* "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 - * -*/ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - - /* "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 -*/ + { 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, 683, __pyx_L1_error); } - - /* "constraint/constraints.py":620 - * # if more than one associated variables contain negative, we can't prune - * return - * variable_with_negative = variable # <<<<<<<<<<<<<< - * - * # 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":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) -*/ + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "constraint/constraints.py":623 - * - * # 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 + /* "constraint/constraints.py":684 + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * multipliers = self._multipliers if self._multipliers else [1] * len(variables) * maxsum = self._maxsum # <<<<<<<<<<<<<< - * 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 + * */ - __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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __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 + /* "constraint/constraints.py":685 + * 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 + * 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_t_4 = NULL; + { /* enter inner scope */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 685, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_2 = __pyx_builtin_zip; + __pyx_t_3 = __pyx_builtin_zip; __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_2, __pyx_v_variables, __pyx_v_multipliers}; + __pyx_t_4 = __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_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __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); - __pyx_t_6 = 0; - __pyx_t_7 = NULL; + 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; } 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_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L5_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, 685, __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_7)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(!__pyx_t_8)) { + 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, 626, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 685, __pyx_L5_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_4 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_7); + ++__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, 626, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 685, __pyx_L5_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_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __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_4)) __PYX_ERR(0, 685, __pyx_L5_error) } else { - __pyx_t_1 = __pyx_t_7(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { + __pyx_t_4 = __pyx_t_8(__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, 626, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 685, __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, 626, __pyx_L1_error) + __PYX_ERR(0, 685, __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_INCREF(__pyx_t_3); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __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, 626, __pyx_L1_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); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L5_error) + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 685, __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, 626, __pyx_L1_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); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 685, __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_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_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 685, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __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_4 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L11_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) + index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + 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, 685, __pyx_L5_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_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, 626, __pyx_L1_error) - __pyx_L12_unpacking_done:; + __PYX_ERR(0, 685, __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_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_variable, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_multiplier, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __Pyx_INCREF(__pyx_builtin_min); + __pyx_t_2 = __pyx_builtin_min; + __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr12__pyx_v_variable); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 685, __pyx_L5_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(__pyx_t_2, __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; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + } + __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_9genexpr12__pyx_v_multiplier); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __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_2))) __PYX_ERR(0, 685, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 685, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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] + /* "constraint/constraints.py":688 + * + * # 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_t_12 = (__pyx_v_variable_with_negative != Py_None); - if (__pyx_t_12) { + __pyx_t_3 = NULL; + __Pyx_INCREF(__pyx_builtin_zip); + __pyx_t_2 = __pyx_builtin_zip; + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __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_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __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, 688, __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, 688, __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, 688, __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_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, 688, __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, 688, __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, 688, __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, 688, __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_9 = __pyx_t_12; - goto __pyx_L14_bool_binop_done; + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); } - __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) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif __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; + } else { + Py_ssize_t index = -1; + __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_L14_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_4 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L14_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15_unpacking_done; + __pyx_L14_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, 688, __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":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":689 + * # 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_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; - /* "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: + /* "constraint/constraints.py":690 + * 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_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __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, 690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __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_10}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__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_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); - __pyx_t_1 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_other_vars_min, __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) + /* "constraint/constraints.py":691 + * 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_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); + __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, 691, __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, 691, __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, 691, __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, 691, __pyx_L1_error) #endif - ++__pyx_t_13; + if (__pyx_t_12 >= __pyx_temp) break; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12); + ++__pyx_t_12; } 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; + { + 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, 691, __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; } - __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_9) { + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __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, 691, __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":632 - * for value in domain[:]: - * if value * multiplier > maxsum: - * domain.remove(value) # <<<<<<<<<<<<<< - * else: - * for variable in variables: + /* "constraint/constraints.py":692 + * 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_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; + __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = PyNumber_Add(__pyx_t_1, __pyx_v_other_vars_min); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 692, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { - /* "constraint/constraints.py":631 - * domain = domains[variable] - * for value in domain[:]: - * if value * multiplier > maxsum: # <<<<<<<<<<<<<< - * domain.remove(value) - * else: + /* "constraint/constraints.py":693 + * for value in domain[:]: + * if value * multiplier + other_vars_min > maxsum: + * domain.remove(value) # <<<<<<<<<<<<<< + * + * # recalculate the min and max after pruning */ + __pyx_t_10 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_10); + __pyx_t_5 = 0; + { + PyObject *__pyx_callargs[2] = {__pyx_t_10, __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_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } + __Pyx_DECREF(__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) + /* "constraint/constraints.py":692 + * 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":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 + /* "constraint/constraints.py":691 + * 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_L9_continue:; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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: + /* "constraint/constraints.py":688 + * + * # 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) */ - goto __pyx_L8; } + __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":696 + * + * # recalculate the min and max after pruning + * self._var_min = { variable: min(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 # <<<<<<<<<<<<<< + * self._var_is_negative = { variable: self._var_min[variable] < 0 for variable in variables } + * */ - /*else*/ { - 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; + { /* enter inner scope */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = NULL; + __Pyx_INCREF(__pyx_builtin_zip); + __pyx_t_10 = __pyx_builtin_zip; + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_variables, __pyx_v_multipliers}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __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_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); + } + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_10 = __pyx_t_3; __Pyx_INCREF(__pyx_t_10); + __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_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 696, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 696, __pyx_L23_error) } + __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_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, 634, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 696, __pyx_L23_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_GetItemRef(__pyx_t_10, __pyx_t_7); + ++__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_10); #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, 696, __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_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6)); + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_7)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_10, __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, 696, __pyx_L23_error) } else { - __pyx_t_3 = __pyx_t_7(__pyx_t_2); + __pyx_t_3 = __pyx_t_8(__pyx_t_10); 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, 696, __pyx_L23_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) { + 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, 696, __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_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_4); + } else { + __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L23_error) + __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L23_error) + __Pyx_XGOTREF(__pyx_t_4); + } + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_9 = __pyx_t_12; - goto __pyx_L24_bool_binop_done; + Py_ssize_t index = -1; + __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 696, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); + index = 0; __pyx_t_1 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L26_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_4 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L26_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 2) < 0) __PYX_ERR(0, 696, __pyx_L23_error) + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L27_unpacking_done; + __pyx_L26_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_L23_error) + __pyx_L27_unpacking_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] -*/ + __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_multiplier, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __Pyx_INCREF(__pyx_builtin_min); + __pyx_t_1 = __pyx_builtin_min; + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr13__pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 696, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_9}; + __pyx_t_3 = __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_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); } + __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_9genexpr13__pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr13__pyx_v_variable, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 696, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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, 696, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "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_t_3 = 0; - - /* "constraint/constraints.py":638 - * continue - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value > maxsum: - * domain.remove(value) + /* "constraint/constraints.py":697 + * # recalculate the min and max after pruning + * self._var_min = { variable: min(domains[variable]) * multiplier 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 */ - __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_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_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); + { /* enter inner scope */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L32_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { + __pyx_t_10 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_10); + __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 697, __pyx_L32_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 697, __pyx_L32_error) + } + for (;;) { + if (likely(!__pyx_t_8)) { + 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, 697, __pyx_L32_error) #endif - ++__pyx_t_13; + if (__pyx_t_7 >= __pyx_temp) break; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_7); + ++__pyx_t_7; } 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; + { + 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, 697, __pyx_L32_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_10, __pyx_t_7)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_7); + #endif + ++__pyx_t_7; } - __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); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L32_error) + } else { + __pyx_t_1 = __pyx_t_8(__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, 697, __pyx_L32_error) + PyErr_Clear(); } - __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) - * -*/ + break; } - - /* "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_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_9genexpr14__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, 697, __pyx_L32_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_9genexpr14__pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L32_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L32_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr14__pyx_v_variable, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 697, __pyx_L32_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_L8:; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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, 697, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":607 - * self._multipliers = multipliers + /* "constraint/constraints.py":681 + * 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 */ @@ -17094,27 +18884,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":699 + * 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 @@ -17164,53 +18957,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, 699, __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, 699, __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, 699, __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, 699, __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, 699, __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, 699, __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, 699, __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, 699, __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, 699, __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, 699, __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, 699, __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, 699, __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, 699, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -17224,7 +19017,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, 699, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -17235,8 +19028,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, 699, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 699, __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 */ @@ -17260,6 +19053,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; @@ -17276,60 +19072,88 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ 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":700 * * 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, 700, __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":701 * 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, 701, __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":702 * 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":703 * 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":704 + * sum = 0 + * min_sum_missing = 0 + * missing = False # <<<<<<<<<<<<<< + * missing_negative = False + * if multipliers: +*/ + __pyx_v_missing = 0; + + /* "constraint/constraints.py":705 + * 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":706 + * 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, 706, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":647 - * sum = 0 + /* "constraint/constraints.py":707 + * missing_negative = False * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable in assignments: @@ -17344,7 +19168,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __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_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, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -17352,9 +19176,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_t_6 = 0; __pyx_t_7 = 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_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 707, __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_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 707, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -17363,7 +19187,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 647, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 707, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -17373,7 +19197,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 647, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 707, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -17384,13 +19208,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_7(__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, 647, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 707, __pyx_L1_error) PyErr_Clear(); } break; @@ -17403,7 +19227,7 @@ 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, 707, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -17413,22 +19237,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __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) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 707, __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) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 707, __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_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 707, __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_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 707, __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, 707, __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); @@ -17436,7 +19260,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_GOTREF(__pyx_t_3); 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, 707, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; @@ -17444,7 +19268,7 @@ 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, 707, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); @@ -17452,45 +19276,110 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":648 + /* "constraint/constraints.py":708 * 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, 708, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":649 + /* "constraint/constraints.py":709 * 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, 709, __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, 709, __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, 709, __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":708 * if multipliers: * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * multiplier + * else: +*/ + goto __pyx_L8; + } + + /* "constraint/constraints.py":711 + * 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, 711, __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, 711, __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, 711, __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":712 + * 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":713 + * 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, 713, __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, 713, __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, 713, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + + /* "constraint/constraints.py":714 + * 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":713 + * 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":707 + * missing_negative = False * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable in assignments: @@ -17499,64 +19388,67 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":650 - * if variable in assignments: - * sum += assignments[variable] * multiplier + /* "constraint/constraints.py":715 + * 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":716 + * 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_t_8 = NULL; __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_8 = __pyx_builtin_round; + __pyx_t_1 = __pyx_builtin_round; __pyx_t_5 = 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) + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_sum, __pyx_mstate_global->__pyx_int_10}; + __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, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":650 - * if variable in assignments: - * sum += assignments[variable] * multiplier + /* "constraint/constraints.py":715 + * 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":717 * 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_t_4 = PyNumber_Add(__pyx_v_sum, __pyx_v_min_sum_missing); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 717, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 717, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":653 + /* "constraint/constraints.py":718 * 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); @@ -17564,271 +19456,284 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":652 + /* "constraint/constraints.py":717 * 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":719 + * 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, 719, __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":720 * 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_t_4 = NULL; __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_1 = __pyx_builtin_zip; + __pyx_t_8 = __pyx_builtin_zip; __pyx_t_5 = 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_4, __pyx_v_variables, __pyx_v_multipliers}; + __pyx_t_1 = __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_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); __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, 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_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 720, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + 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, 655, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 720, __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_1 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_6); ++__pyx_t_6; } 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, 655, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 720, __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_1, __pyx_t_6)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_6); #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 655, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_7(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { + __pyx_t_1 = __pyx_t_7(__pyx_t_8); + 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, 655, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 720, __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_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, 655, __pyx_L1_error) + __PYX_ERR(0, 720, __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_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_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_4 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 720, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 655, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); } #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_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __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_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; + index = 0; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L19_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_L19_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) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 720, __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, 720, __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_variable, __pyx_t_4); + __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":656 - * if forwardcheck: + /* "constraint/constraints.py":721 + * 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, 721, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":657 + /* "constraint/constraints.py":722 * 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_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":658 + /* "constraint/constraints.py":723 * 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_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, 723, __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_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 723, __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_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 723, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_12)) { + 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, 658, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 723, __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_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12); + ++__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, 658, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 723, __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_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __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_1)) __PYX_ERR(0, 723, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_12(__pyx_t_3); - if (unlikely(!__pyx_t_4)) { + __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, 658, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 723, __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_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":659 + /* "constraint/constraints.py":724 * 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_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyNumber_Add(__pyx_v_sum, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 724, __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_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_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_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":660 + /* "constraint/constraints.py":725 * 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_4 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_4); __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_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_4, __pyx_v_value}; + __pyx_t_1 = __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_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":659 + /* "constraint/constraints.py":724 * domain = domains[variable] * for value in domain[:]: * if sum + value * multiplier > maxsum: # <<<<<<<<<<<<<< @@ -17837,7 +19742,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":658 + /* "constraint/constraints.py":723 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -17847,18 +19752,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":661 + /* "constraint/constraints.py":726 * 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, 726, __pyx_L1_error) + __pyx_t_11 = (!__pyx_t_2); + if (__pyx_t_11) { - /* "constraint/constraints.py":662 + /* "constraint/constraints.py":727 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -17868,10 +19773,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_8); __pyx_t_8 = 0; goto __pyx_L0; - /* "constraint/constraints.py":661 + /* "constraint/constraints.py":726 * if sum + value * multiplier > maxsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -17880,8 +19785,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":656 - * if forwardcheck: + /* "constraint/constraints.py":721 + * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] @@ -17889,28 +19794,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":655 + /* "constraint/constraints.py":720 * 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_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":654 - * if sum > maxsum: + /* "constraint/constraints.py":719 + * 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":706 + * missing = False + * missing_negative = False * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: @@ -17918,7 +19823,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ goto __pyx_L3; } - /* "constraint/constraints.py":664 + /* "constraint/constraints.py":729 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -17927,48 +19832,48 @@ 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_8 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_8); __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, 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_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 729, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + 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, 664, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 729, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_6); ++__pyx_t_6; } 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, 664, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 729, __pyx_L1_error) #endif 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_6)); + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_6); #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 729, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_7(__pyx_t_1); + __pyx_t_3 = __pyx_t_7(__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, 664, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 729, __pyx_L1_error) PyErr_Clear(); } break; @@ -17978,41 +19883,106 @@ 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":665 + /* "constraint/constraints.py":730 * 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, 730, __pyx_L1_error) + if (__pyx_t_11) { - /* "constraint/constraints.py":666 + /* "constraint/constraints.py":731 * 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_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 731, __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_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":665 + /* "constraint/constraints.py":730 * else: * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] + * else: +*/ + goto __pyx_L30; + } + + /* "constraint/constraints.py":733 + * sum += assignments[variable] + * 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, 733, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 733, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_min_sum_missing, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 733, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_min_sum_missing, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":734 + * 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":735 + * 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, 735, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 735, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_11) { + + /* "constraint/constraints.py":736 + * 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":735 + * 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":729 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -18020,66 +19990,69 @@ 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_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":667 - * if variable in assignments: - * sum += assignments[variable] + /* "constraint/constraints.py":737 + * 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":738 + * 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_t_3 = NULL; __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_3 = __pyx_builtin_round; + __pyx_t_1 = __pyx_builtin_round; __pyx_t_5 = 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_3, __pyx_v_sum, __pyx_mstate_global->__pyx_int_10}; + __pyx_t_8 = __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_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 738, __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":667 - * if variable in assignments: - * sum += assignments[variable] + /* "constraint/constraints.py":737 + * 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":739 * 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_t_8 = PyNumber_Add(__pyx_v_sum, __pyx_v_min_sum_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 739, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_13) { + if (__pyx_t_11) { - /* "constraint/constraints.py":670 + /* "constraint/constraints.py":740 * 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); @@ -18087,28 +20060,41 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":669 + /* "constraint/constraints.py":739 * 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":741 + * 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, 741, __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":742 * return False - * if forwardcheck: + * if forwardcheck and missing and not missing_negative: * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] @@ -18118,9 +20104,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __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, 672, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __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_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 742, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -18128,162 +20114,162 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_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, 672, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 742, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); ++__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, 672, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 742, __pyx_L1_error) #endif 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_6)); + __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 672, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 742, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_7(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { + __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, 672, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 742, __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_8); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":673 - * if forwardcheck: + /* "constraint/constraints.py":743 + * 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, 743, __pyx_L1_error) + if (__pyx_t_11) { - /* "constraint/constraints.py":674 + /* "constraint/constraints.py":744 * 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_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 744, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":675 + /* "constraint/constraints.py":745 * 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_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_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, 745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + 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_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_3 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 745, __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, 745, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_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, 675, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 745, __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_8 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12); + ++__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, 675, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 745, __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_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_3, __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_8)) __PYX_ERR(0, 745, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_12(__pyx_t_4); - if (unlikely(!__pyx_t_3)) { + __pyx_t_8 = __pyx_t_13(__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, 675, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 745, __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_8); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":676 + /* "constraint/constraints.py":746 * 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_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_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_t_8 = PyNumber_Add(__pyx_v_sum, __pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __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, 746, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__pyx_t_13) { + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_11) { - /* "constraint/constraints.py":677 + /* "constraint/constraints.py":747 * for value in domain[:]: * if sum + value > maxsum: * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False */ - __pyx_t_3 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_3); + __pyx_t_8 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_8); __pyx_t_5 = 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, 677, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + 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, 747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":676 + /* "constraint/constraints.py":746 * domain = domains[variable] * for value in domain[:]: * if sum + value > maxsum: # <<<<<<<<<<<<<< @@ -18292,7 +20278,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":675 + /* "constraint/constraints.py":745 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -18300,20 +20286,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_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":678 + /* "constraint/constraints.py":748 * 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, 748, __pyx_L1_error) + __pyx_t_2 = (!__pyx_t_11); if (__pyx_t_2) { - /* "constraint/constraints.py":679 + /* "constraint/constraints.py":749 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -18326,7 +20312,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":678 + /* "constraint/constraints.py":748 * if sum + value > maxsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -18335,8 +20321,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":673 - * if forwardcheck: + /* "constraint/constraints.py":743 + * if forwardcheck and missing and not missing_negative: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] @@ -18344,9 +20330,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":672 + /* "constraint/constraints.py":742 * return False - * if forwardcheck: + * if forwardcheck and missing and not missing_negative: * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] @@ -18354,10 +20340,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":671 - * if sum > maxsum: + /* "constraint/constraints.py":741 + * 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: */ @@ -18365,7 +20351,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __pyx_L3:; - /* "constraint/constraints.py":680 + /* "constraint/constraints.py":750 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -18377,8 +20363,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":699 + * 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 @@ -18398,6 +20384,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); @@ -18407,7 +20394,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ return __pyx_r; } -/* "constraint/constraints.py":694 +/* "constraint/constraints.py":770 * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -18458,47 +20445,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, 770, __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, 770, __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, 770, __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, 770, __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, 770, __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, 770, __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, 770, __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, 770, __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, 770, __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, 770, __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, 770, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -18511,7 +20498,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, 770, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18522,7 +20509,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, 770, __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 */ @@ -18541,9 +20528,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":786 * 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." # <<<<<<<<<<<<<< @@ -18552,18 +20539,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, 786, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -18571,7 +20558,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, 786, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -18587,9 +20574,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; @@ -18609,16 +20596,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, 786, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 786, __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, 786, __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, 786, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -18626,7 +20613,7 @@ 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, 786, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -18636,7 +20623,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 786, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -18647,13 +20634,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, 786, __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, 786, __pyx_L1_error) PyErr_Clear(); } break; @@ -18711,7 +20698,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":694 +/* "constraint/constraints.py":770 * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -18720,7 +20707,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ */ 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; @@ -18733,44 +20720,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":704 + /* "constraint/constraints.py":780 * 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, 780, __pyx_L1_error) - /* "constraint/constraints.py":705 + /* "constraint/constraints.py":781 * """ * 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, 781, __pyx_L1_error) - /* "constraint/constraints.py":706 + /* "constraint/constraints.py":782 * 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, 782, __pyx_L1_error) - /* "constraint/constraints.py":708 + /* "constraint/constraints.py":784 * 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, 784, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/constraints.py":709 + /* "constraint/constraints.py":785 * * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." # <<<<<<<<<<<<<< @@ -18779,19 +20766,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, 785, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 785, __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_ERR(0, 785, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 709, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 785, __pyx_L1_error) #endif - /* "constraint/constraints.py":710 + /* "constraint/constraints.py":786 * 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." # <<<<<<<<<<<<<< @@ -18800,23 +20787,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, 786, __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, 786, __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, 786, __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_ERR(0, 786, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 710, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 786, __pyx_L1_error) #endif - /* "constraint/constraints.py":711 + /* "constraint/constraints.py":787 * 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." # <<<<<<<<<<<<<< @@ -18825,20 +20812,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); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 787, __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, 787, __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_ERR(0, 787, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 711, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 787, __pyx_L1_error) #endif - /* "constraint/constraints.py":708 + /* "constraint/constraints.py":784 * self._multipliers = multipliers * * if multipliers: # <<<<<<<<<<<<<< @@ -18847,7 +20834,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":694 + /* "constraint/constraints.py":770 * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -18864,13 +20851,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":789 * 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 # <<<<<<<<<<<<<< @@ -18921,50 +20908,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, 789, __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, 789, __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, 789, __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, 789, __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, 789, __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, 789, __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, 789, __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, 789, __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, 789, __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, 789, __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, 789, __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, 789, __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, 789, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -18974,7 +20961,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, 789, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18985,9 +20972,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, 789, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 789, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 789, __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 */ @@ -19006,9 +20993,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":797 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -19017,29 +21004,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, 797, __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, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -19055,9 +21042,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; @@ -19083,17 +21070,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, 797, __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, 797, __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, 797, __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, 797, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -19101,7 +21088,7 @@ 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, 797, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -19111,7 +21098,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 797, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -19122,13 +21109,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, 797, __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, 797, __pyx_L1_error) PyErr_Clear(); } break; @@ -19139,20 +21126,20 @@ 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, 797, __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, 797, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 797, __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, 797, __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, 797, __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_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, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; { @@ -19161,7 +21148,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ __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, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = __pyx_t_4; @@ -19182,7 +21169,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, 797, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19212,7 +21199,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":713 +/* "constraint/constraints.py":789 * 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 # <<<<<<<<<<<<<< @@ -19221,12 +21208,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; @@ -19248,11 +21235,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ 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, 789, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -19260,7 +21247,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":790 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -19268,9 +21255,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, 790, __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, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -19290,51 +21277,51 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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_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, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":716 + /* "constraint/constraints.py":792 * 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, 792, __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":794 * 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, 794, __pyx_L1_error) __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { - /* "constraint/constraints.py":719 + /* "constraint/constraints.py":795 * * 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, 795, __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, 795, __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, 795, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -19343,7 +21330,7 @@ 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, 795, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -19353,7 +21340,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 795, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -19364,13 +21351,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, 795, __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, 795, __pyx_L1_error) PyErr_Clear(); } break; @@ -19382,19 +21369,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":720 + /* "constraint/constraints.py":796 * 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, 796, __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":797 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -19404,9 +21391,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 797, __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_t_11 = __pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_10preProcess_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_5 = 1; @@ -19416,29 +21403,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 797, __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":798 * 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, 798, __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, 722, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 798, __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_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 798, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -19447,7 +21434,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 722, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 798, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -19457,7 +21444,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 722, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 798, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -19468,13 +21455,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 798, __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, 722, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 798, __pyx_L1_error) PyErr_Clear(); } break; @@ -19484,21 +21471,21 @@ 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":799 * 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, 799, __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_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 799, __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_t_15 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_5 = 1; @@ -19508,17 +21495,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } - __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_10 = PyObject_RichCompare(__pyx_t_1, __pyx_t_11, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 799, __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_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 799, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":724 + /* "constraint/constraints.py":800 * for value in domain[:]: * if value + others_min > max(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< @@ -19532,12 +21519,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ 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) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "constraint/constraints.py":723 + /* "constraint/constraints.py":799 * 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]): # <<<<<<<<<<<<<< @@ -19546,7 +21533,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":722 + /* "constraint/constraints.py":798 * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) * for value in domain[:]: # <<<<<<<<<<<<<< @@ -19556,7 +21543,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":719 + /* "constraint/constraints.py":795 * * if not multipliers: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -19566,7 +21553,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":718 + /* "constraint/constraints.py":794 * multipliers = self._multipliers * * if not multipliers: # <<<<<<<<<<<<<< @@ -19575,7 +21562,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":713 + /* "constraint/constraints.py":789 * 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 # <<<<<<<<<<<<<< @@ -19602,14 +21589,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":802 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -19660,53 +21647,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, 802, __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, 802, __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, 802, __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, 802, __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, 802, __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, 802, __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, 802, __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, 802, __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, 802, __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, 802, __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, 802, __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, 802, __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, 802, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -19720,7 +21707,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, 802, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19731,8 +21718,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, 802, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 802, __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 */ @@ -19776,32 +21763,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":727 + /* "constraint/constraints.py":803 * * 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, 803, __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":805 * 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, 805, __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, 805, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":730 + /* "constraint/constraints.py":806 * * if self.target_var not in assignments: * return True # can't evaluate without target, defer to later # <<<<<<<<<<<<<< @@ -19813,7 +21800,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":729 + /* "constraint/constraints.py":805 * multipliers = self._multipliers * * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -19822,22 +21809,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":732 + /* "constraint/constraints.py":808 * 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, 808, __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, 808, __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":809 * * target_value = assignments[self.target_var] * sum_value = 0 # <<<<<<<<<<<<<< @@ -19847,17 +21834,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":811 * 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, 811, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":736 + /* "constraint/constraints.py":812 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -19867,7 +21854,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; { @@ -19876,7 +21863,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { @@ -19884,9 +21871,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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, 736, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 812, __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_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 812, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -19895,7 +21882,7 @@ 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, 736, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 812, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -19905,7 +21892,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 812, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -19916,13 +21903,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 736, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 812, __pyx_L1_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, 736, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 812, __pyx_L1_error) PyErr_Clear(); } break; @@ -19935,7 +21922,7 @@ 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, 812, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -19945,22 +21932,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 736, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 812, __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) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); } #else - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 812, __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, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #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, 812, __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); @@ -19968,7 +21955,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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; __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 736, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 812, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; @@ -19976,7 +21963,7 @@ 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, 812, __pyx_L1_error) __pyx_L8_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_5); @@ -19984,35 +21971,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":737 + /* "constraint/constraints.py":813 * 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, 813, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":738 + /* "constraint/constraints.py":814 * 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, 814, __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_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __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_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":737 + /* "constraint/constraints.py":813 * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: # <<<<<<<<<<<<<< @@ -20022,7 +22009,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ goto __pyx_L9; } - /* "constraint/constraints.py":740 + /* "constraint/constraints.py":816 * sum_value += assignments[var] * multiplier * else: * sum_value += min(domains[var] * multiplier) # use min value if not assigned # <<<<<<<<<<<<<< @@ -20033,9 +22020,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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_9 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 816, __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_t_11 = PyNumber_Multiply(__pyx_t_9, __pyx_v_multiplier); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_6 = 1; @@ -20045,10 +22032,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __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_t_5 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_5); @@ -20056,7 +22043,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __pyx_L9:; - /* "constraint/constraints.py":736 + /* "constraint/constraints.py":812 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -20066,7 +22053,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":735 + /* "constraint/constraints.py":811 * sum_value = 0 * * if multipliers: # <<<<<<<<<<<<<< @@ -20076,7 +22063,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ goto __pyx_L4; } - /* "constraint/constraints.py":742 + /* "constraint/constraints.py":818 * sum_value += min(domains[var] * multiplier) # use min value if not assigned * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -20084,16 +22071,16 @@ 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, 818, __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; } 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_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 818, __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_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 818, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -20102,7 +22089,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 742, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 818, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -20112,7 +22099,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 742, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 818, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -20123,13 +22110,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 742, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_8(__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, 742, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 818, __pyx_L1_error) PyErr_Clear(); } break; @@ -20139,32 +22126,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":819 * 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, 819, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":744 + /* "constraint/constraints.py":820 * 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, 820, __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, 820, __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":819 * else: * for var in self.sum_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -20174,7 +22161,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ goto __pyx_L13; } - /* "constraint/constraints.py":746 + /* "constraint/constraints.py":822 * sum_value += assignments[var] * else: * sum_value += min(domains[var]) # use min value if not assigned # <<<<<<<<<<<<<< @@ -20185,7 +22172,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = 1; { @@ -20194,10 +22181,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 822, __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_t_11 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_11); @@ -20205,7 +22192,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __pyx_L13:; - /* "constraint/constraints.py":742 + /* "constraint/constraints.py":818 * sum_value += min(domains[var] * multiplier) # use min value if not assigned * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -20217,7 +22204,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __pyx_L4:; - /* "constraint/constraints.py":748 + /* "constraint/constraints.py":824 * sum_value += min(domains[var]) # use min value if not assigned * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -20227,7 +22214,7 @@ 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":825 * * if isinstance(sum_value, float): * sum_value = round(sum_value, 10) # <<<<<<<<<<<<<< @@ -20243,13 +22230,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":748 + /* "constraint/constraints.py":824 * sum_value += min(domains[var]) # use min value if not assigned * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -20258,7 +22245,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":751 + /* "constraint/constraints.py":827 * sum_value = round(sum_value, 10) * * return sum_value <= target_value # <<<<<<<<<<<<<< @@ -20266,12 +22253,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_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, 827, __pyx_L1_error) __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "constraint/constraints.py":726 + /* "constraint/constraints.py":802 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -20300,7 +22287,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":765 +/* "constraint/constraints.py":846 * """ * * def __init__(self, exactprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -20349,39 +22336,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, 846, __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, 846, __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, 846, __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, 846, __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, 846, __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, 846, __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, 846, __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, 846, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20411,28 +22398,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint___ini int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":771 + /* "constraint/constraints.py":852 * 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, 771, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exactprod_2, __pyx_v_exactprod) < 0) __PYX_ERR(0, 852, __pyx_L1_error) - /* "constraint/constraints.py":772 + /* "constraint/constraints.py":853 * """ * self._exactprod = exactprod * self._variable_contains_lt1: list[bool] = list() # <<<<<<<<<<<<<< * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __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, 772, __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, 853, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":765 + /* "constraint/constraints.py":846 * """ * * def __init__(self, exactprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -20453,7 +22440,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint___ini return __pyx_r; } -/* "constraint/constraints.py":774 +/* "constraint/constraints.py":855 * self._variable_contains_lt1: list[bool] = list() * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -20504,50 +22491,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, 774, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 855, __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, 774, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 855, __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, 774, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 855, __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, 774, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 855, __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, 774, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 855, __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, 774, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 855, __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, 774, __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, 855, __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, 774, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 855, __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, 774, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 855, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 774, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 855, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 774, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 855, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 774, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 855, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 774, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 855, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -20557,7 +22544,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, 774, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 855, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20568,9 +22555,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, 774, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 774, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 774, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 855, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 855, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 855, __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 */ @@ -20589,9 +22576,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":781 +/* "constraint/constraints.py":862 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -20600,18 +22587,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, 781, __pyx_L1_error) + __PYX_ERR(0, 862, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -20619,7 +22606,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, 781, __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, 862, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -20635,9 +22622,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; @@ -20656,16 +22643,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 781, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 781, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 862, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 862, __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, 781, __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, 862, __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, 781, __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, 862, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -20673,7 +22660,7 @@ 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, 781, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 862, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -20683,7 +22670,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre { 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, 781, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 862, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -20694,13 +22681,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 781, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __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, 781, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 862, __pyx_L1_error) PyErr_Clear(); } break; @@ -20711,8 +22698,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, 781, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 781, __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, 862, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 862, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_XDECREF(__pyx_r); @@ -20751,7 +22738,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre return __pyx_r; } -/* "constraint/constraints.py":774 +/* "constraint/constraints.py":855 * self._variable_contains_lt1: list[bool] = list() * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -20766,7 +22753,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; @@ -20788,7 +22775,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":775 + /* "constraint/constraints.py":856 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -20796,9 +22783,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, 775, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __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, 775, __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, 856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -20818,24 +22805,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __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_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, 775, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":778 + /* "constraint/constraints.py":859 * * # 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, 778, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __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, 778, __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, 859, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":779 + /* "constraint/constraints.py":860 * # check if there are any values less than 1 in the associated variables * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None # <<<<<<<<<<<<<< @@ -20845,7 +22832,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_INCREF(Py_None); __pyx_v_variable_with_lt1 = Py_None; - /* "constraint/constraints.py":780 + /* "constraint/constraints.py":861 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -20857,9 +22844,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, 780, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 861, __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, 780, __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, 861, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -20867,7 +22854,7 @@ 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, 780, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 861, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -20877,7 +22864,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { 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, 861, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -20888,13 +22875,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 780, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 861, __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, 780, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 861, __pyx_L1_error) PyErr_Clear(); } break; @@ -20904,37 +22891,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":781 + /* "constraint/constraints.py":862 * 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, 781, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __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, 781, __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, 862, __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, 781, __pyx_L1_error) + __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __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":782 + /* "constraint/constraints.py":863 * 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, 782, __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, 863, __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, 782, __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, 863, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":780 + /* "constraint/constraints.py":861 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -20944,7 +22931,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":783 + /* "constraint/constraints.py":864 * 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): # <<<<<<<<<<<<<< @@ -20954,7 +22941,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __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, 783, __pyx_L1_error) + __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, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; { @@ -20963,7 +22950,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __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, 783, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -20971,9 +22958,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, 783, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 864, __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, 783, __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, 864, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -20982,7 +22969,7 @@ 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, 783, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 864, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -20992,7 +22979,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { 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, 783, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 864, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -21003,13 +22990,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 864, __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, 783, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 864, __pyx_L1_error) PyErr_Clear(); } break; @@ -21022,7 +23009,7 @@ 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, 783, __pyx_L1_error) + __PYX_ERR(0, 864, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -21032,22 +23019,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 783, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 783, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 864, __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, 783, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 783, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 864, __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, 783, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 864, __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); @@ -21055,7 +23042,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __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; __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 783, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 864, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_unpacking_done; @@ -21063,7 +23050,7 @@ 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, 783, __pyx_L1_error) + __PYX_ERR(0, 864, __pyx_L1_error) __pyx_L9_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); @@ -21071,7 +23058,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":784 + /* "constraint/constraints.py":865 * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: # <<<<<<<<<<<<<< @@ -21081,7 +23068,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":785 + /* "constraint/constraints.py":866 * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< @@ -21091,7 +23078,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":787 + /* "constraint/constraints.py":868 * if variable_with_lt1 is not None: * # if more than one associated variables contain less than 1, we can't prune * return # <<<<<<<<<<<<<< @@ -21103,7 +23090,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/constraints.py":785 + /* "constraint/constraints.py":866 * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< @@ -21112,7 +23099,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ } - /* "constraint/constraints.py":788 + /* "constraint/constraints.py":869 * # if more than one associated variables contain less than 1, we can't prune * return * variable_with_lt1 = variable # <<<<<<<<<<<<<< @@ -21122,7 +23109,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":784 + /* "constraint/constraints.py":865 * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: # <<<<<<<<<<<<<< @@ -21131,7 +23118,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ } - /* "constraint/constraints.py":783 + /* "constraint/constraints.py":864 * 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): # <<<<<<<<<<<<<< @@ -21141,19 +23128,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":791 + /* "constraint/constraints.py":872 * * # 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, 791, __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, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_exactprod = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/constraints.py":792 + /* "constraint/constraints.py":873 * # prune the associated variables of values > exactprod * exactprod = self._exactprod * for variable in variables: # <<<<<<<<<<<<<< @@ -21165,9 +23152,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, 792, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 873, __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, 792, __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, 873, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -21175,7 +23162,7 @@ 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, 792, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 873, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -21185,7 +23172,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { 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, 792, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 873, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -21196,13 +23183,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 792, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __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, 792, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 873, __pyx_L1_error) PyErr_Clear(); } break; @@ -21212,7 +23199,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":793 + /* "constraint/constraints.py":874 * exactprod = self._exactprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -21225,14 +23212,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, 793, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 793, __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, 874, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 874, __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":794 + /* "constraint/constraints.py":875 * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: * continue # <<<<<<<<<<<<<< @@ -21241,7 +23228,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ goto __pyx_L13_continue; - /* "constraint/constraints.py":793 + /* "constraint/constraints.py":874 * exactprod = self._exactprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -21250,35 +23237,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ } - /* "constraint/constraints.py":795 + /* "constraint/constraints.py":876 * 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, 795, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":796 + /* "constraint/constraints.py":877 * 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, 796, __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, 877, __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_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, 796, __pyx_L1_error) + __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __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, 796, __pyx_L1_error) + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 877, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -21287,7 +23274,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { 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, 796, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 877, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -21297,7 +23284,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { 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, 796, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 877, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -21308,13 +23295,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif ++__pyx_t_13; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 796, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_14(__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, 796, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 877, __pyx_L1_error) PyErr_Clear(); } break; @@ -21324,19 +23311,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":797 + /* "constraint/constraints.py":878 * 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, 797, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 797, __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, 878, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { - /* "constraint/constraints.py":798 + /* "constraint/constraints.py":879 * for value in domain[:]: * if value > exactprod: * domain.remove(value) # <<<<<<<<<<<<<< @@ -21350,12 +23337,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP 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, 798, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":797 + /* "constraint/constraints.py":878 * domain = domains[variable] * for value in domain[:]: * if value > exactprod: # <<<<<<<<<<<<<< @@ -21365,25 +23352,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP goto __pyx_L20; } - /* "constraint/constraints.py":799 + /* "constraint/constraints.py":880 * 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, 799, __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, 880, __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, 799, __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, 880, __pyx_L1_error) __pyx_t_11 = __pyx_t_12; __pyx_L21_bool_binop_done:; if (__pyx_t_11) { - /* "constraint/constraints.py":800 + /* "constraint/constraints.py":881 * domain.remove(value) * elif value == 0 and exactprod != 0: * domain.remove(value) # <<<<<<<<<<<<<< @@ -21397,12 +23384,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP 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, 800, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":799 + /* "constraint/constraints.py":880 * if value > exactprod: * domain.remove(value) * elif value == 0 and exactprod != 0: # <<<<<<<<<<<<<< @@ -21412,7 +23399,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __pyx_L20:; - /* "constraint/constraints.py":796 + /* "constraint/constraints.py":877 * continue * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -21422,7 +23409,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":792 + /* "constraint/constraints.py":873 * # prune the associated variables of values > exactprod * exactprod = self._exactprod * for variable in variables: # <<<<<<<<<<<<<< @@ -21433,7 +23420,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":774 + /* "constraint/constraints.py":855 * self._variable_contains_lt1: list[bool] = list() * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -21459,13 +23446,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":802 +/* "constraint/constraints.py":883 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -21516,53 +23503,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, 802, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 883, __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, 802, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 883, __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, 802, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 883, __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, 802, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 883, __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, 802, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 883, __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, 802, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 883, __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, 802, __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, 883, __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, 802, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 883, __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, 802, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 883, __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, 802, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 883, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 802, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 883, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 802, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 883, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 802, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 883, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -21576,7 +23563,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, 802, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 883, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -21587,8 +23574,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, 802, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 802, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 883, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 883, __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 */ @@ -21607,9 +23594,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__call___2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +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":810 +/* "constraint/constraints.py":891 * 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])) # <<<<<<<<<<<<<< @@ -21618,18 +23605,18 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__ca */ 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_12_genexpr *__pyx_cur_scope; + 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_12_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __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_12_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 810, __pyx_L1_error) + __PYX_ERR(0, 891, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -21637,7 +23624,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_8__ca __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___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_ExactProdConstraint___call___loc, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 810, __pyx_L1_error) + __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, 891, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -21653,9 +23640,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_8__ca return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__call___2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +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_12_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *)__pyx_generator->closure); + 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; @@ -21674,16 +23661,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__ca return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 810, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 810, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 891, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 891, __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, 810, __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, 891, __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, 810, __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, 891, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -21691,7 +23678,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__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, 810, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 891, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -21701,7 +23688,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__ca { 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, 810, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 891, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -21712,13 +23699,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__ca #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 810, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 891, __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, 810, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 891, __pyx_L1_error) PyErr_Clear(); } break; @@ -21729,8 +23716,8 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__ca __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, 810, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 810, __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, 891, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 891, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_XDECREF(__pyx_r); @@ -21769,7 +23756,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__ca return __pyx_r; } -/* "constraint/constraints.py":802 +/* "constraint/constraints.py":883 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -21786,7 +23773,7 @@ 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___2generator9 = 0; + PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__call___2generator8 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -21808,19 +23795,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":803 + /* "constraint/constraints.py":884 * * 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, 803, __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, 884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_exactprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":804 + /* "constraint/constraints.py":885 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * exactprod = self._exactprod * prod = 1 # <<<<<<<<<<<<<< @@ -21830,7 +23817,7 @@ 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":805 + /* "constraint/constraints.py":886 * exactprod = self._exactprod * prod = 1 * missing = False # <<<<<<<<<<<<<< @@ -21839,34 +23826,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ __pyx_v_missing = 0; - /* "constraint/constraints.py":806 + /* "constraint/constraints.py":887 * 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): */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 806, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_missing_lt1 = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":808 + /* "constraint/constraints.py":889 * 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, 808, __pyx_L1_error) + __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, 889, __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, 808, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 889, __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, 808, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 889, __pyx_L1_error) __pyx_t_4 = (__pyx_t_2 != __pyx_t_3); if (__pyx_t_4) { - /* "constraint/constraints.py":809 + /* "constraint/constraints.py":890 * # find out which variables contain values less than 1 if not preprocessed * if len(self._variable_contains_lt1) != len(variables): * for variable in variables: # <<<<<<<<<<<<<< @@ -21878,9 +23865,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __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, 809, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __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, 809, __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, 890, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { @@ -21888,7 +23875,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__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, 809, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 890, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -21898,7 +23885,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca { 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, 809, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 890, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -21909,13 +23896,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 890, __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, 809, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 890, __pyx_L1_error) PyErr_Clear(); } break; @@ -21925,28 +23912,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":810 + /* "constraint/constraints.py":891 * 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, 810, __pyx_L1_error) + __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, 891, __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, 810, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 891, __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, 810, __pyx_L1_error) + __pyx_t_8 = __pyx_pf_10constraint_11constraints_19ExactProdConstraint_8__call___genexpr(NULL, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 891, __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, 810, __pyx_L1_error) + __pyx_t_7 = __Pyx_Generator_GetInlinedResult(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 891, __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, 810, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_6, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 891, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":809 + /* "constraint/constraints.py":890 * # find out which variables contain values less than 1 if not preprocessed * if len(self._variable_contains_lt1) != len(variables): * for variable in variables: # <<<<<<<<<<<<<< @@ -21956,7 +23943,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":808 + /* "constraint/constraints.py":889 * missing_lt1 = [] * # find out which variables contain values less than 1 if not preprocessed * if len(self._variable_contains_lt1) != len(variables): # <<<<<<<<<<<<<< @@ -21965,7 +23952,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":811 + /* "constraint/constraints.py":892 * 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): # <<<<<<<<<<<<<< @@ -21975,7 +23962,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_t_7 = NULL; __Pyx_INCREF(__pyx_builtin_zip); __pyx_t_6 = __pyx_builtin_zip; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 811, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = 1; { @@ -21984,7 +23971,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_XDECREF(__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_1)) __PYX_ERR(0, 811, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -21992,9 +23979,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_t_3 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 811, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 892, __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, 811, __pyx_L1_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -22003,7 +23990,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__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, 811, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 892, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -22013,7 +24000,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca { 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, 811, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 892, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -22024,13 +24011,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) } else { __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, 811, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 892, __pyx_L1_error) PyErr_Clear(); } break; @@ -22043,7 +24030,7 @@ 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, 811, __pyx_L1_error) + __PYX_ERR(0, 892, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -22053,22 +24040,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_INCREF(__pyx_t_7); } else { __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 811, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 811, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 892, __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, 811, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 811, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 811, __pyx_L1_error) + __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); @@ -22076,7 +24063,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_GOTREF(__pyx_t_8); index = 1; __pyx_t_7 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_7)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 811, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 892, __pyx_L1_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L10_unpacking_done; @@ -22084,7 +24071,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 811, __pyx_L1_error) + __PYX_ERR(0, 892, __pyx_L1_error) __pyx_L10_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_8); @@ -22092,32 +24079,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":812 + /* "constraint/constraints.py":893 * 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_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 812, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 893, __pyx_L1_error) if (__pyx_t_4) { - /* "constraint/constraints.py":813 + /* "constraint/constraints.py":894 * 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, 813, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 813, __pyx_L1_error) + __pyx_t_7 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":812 + /* "constraint/constraints.py":893 * 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: # <<<<<<<<<<<<<< @@ -22127,7 +24114,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca goto __pyx_L11; } - /* "constraint/constraints.py":815 + /* "constraint/constraints.py":896 * prod *= assignments[variable] * else: * missing = True # <<<<<<<<<<<<<< @@ -22137,26 +24124,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca /*else*/ { __pyx_v_missing = 1; - /* "constraint/constraints.py":816 + /* "constraint/constraints.py":897 * else: * missing = True * if contains_lt1: # <<<<<<<<<<<<<< * missing_lt1.append(variable) * if isinstance(prod, float): */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_contains_lt1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_contains_lt1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 897, __pyx_L1_error) if (__pyx_t_4) { - /* "constraint/constraints.py":817 + /* "constraint/constraints.py":898 * missing = True * if contains_lt1: * missing_lt1.append(variable) # <<<<<<<<<<<<<< * if isinstance(prod, float): * prod = round(prod, 10) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_missing_lt1, __pyx_v_variable); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 817, __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, 898, __pyx_L1_error) - /* "constraint/constraints.py":816 + /* "constraint/constraints.py":897 * else: * missing = True * if contains_lt1: # <<<<<<<<<<<<<< @@ -22167,7 +24154,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca } __pyx_L11:; - /* "constraint/constraints.py":811 + /* "constraint/constraints.py":892 * 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): # <<<<<<<<<<<<<< @@ -22177,7 +24164,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":818 + /* "constraint/constraints.py":899 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -22187,7 +24174,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_t_4 = PyFloat_Check(__pyx_v_prod); if (__pyx_t_4) { - /* "constraint/constraints.py":819 + /* "constraint/constraints.py":900 * missing_lt1.append(variable) * if isinstance(prod, float): * prod = round(prod, 10) # <<<<<<<<<<<<<< @@ -22203,13 +24190,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __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_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 819, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":818 + /* "constraint/constraints.py":899 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -22218,7 +24205,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":820 + /* "constraint/constraints.py":901 * if isinstance(prod, float): * prod = round(prod, 10) * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): # <<<<<<<<<<<<<< @@ -22230,8 +24217,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca goto __pyx_L17_next_or; } else { } - __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, 820, __pyx_L1_error) - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 820, __pyx_L1_error) + __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, 901, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_13) { } else { @@ -22239,21 +24226,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca goto __pyx_L16_bool_binop_done; } __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, 820, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 901, __pyx_L1_error) __pyx_t_13 = (__pyx_t_3 == 0); if (__pyx_t_13) { } else { __pyx_t_4 = __pyx_t_13; goto __pyx_L16_bool_binop_done; } - __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, 820, __pyx_L1_error) - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 820, __pyx_L1_error) + __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, 901, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 901, __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":821 + /* "constraint/constraints.py":902 * prod = round(prod, 10) * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): * return False # <<<<<<<<<<<<<< @@ -22265,7 +24252,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":820 + /* "constraint/constraints.py":901 * if isinstance(prod, float): * prod = round(prod, 10) * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): # <<<<<<<<<<<<<< @@ -22274,17 +24261,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":822 + /* "constraint/constraints.py":903 * 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_4 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 822, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 903, __pyx_L1_error) if (__pyx_t_4) { - /* "constraint/constraints.py":823 + /* "constraint/constraints.py":904 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -22296,9 +24283,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_t_3 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 823, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 904, __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, 823, __pyx_L1_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 904, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { @@ -22306,7 +24293,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__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, 823, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 904, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -22316,7 +24303,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca { 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, 823, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 904, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -22327,13 +24314,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 823, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 904, __pyx_L1_error) } else { __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, 823, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 904, __pyx_L1_error) PyErr_Clear(); } break; @@ -22343,60 +24330,60 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":824 + /* "constraint/constraints.py":905 * 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_13 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 824, __pyx_L1_error) + __pyx_t_13 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 905, __pyx_L1_error) if (__pyx_t_13) { } else { __pyx_t_4 = __pyx_t_13; goto __pyx_L24_bool_binop_done; } - __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable, __pyx_v_missing_lt1, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 824, __pyx_L1_error) + __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable, __pyx_v_missing_lt1, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 905, __pyx_L1_error) if (!__pyx_t_13) { } else { __pyx_t_4 = __pyx_t_13; goto __pyx_L24_bool_binop_done; } - __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 824, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 905, __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":825 + /* "constraint/constraints.py":906 * 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, 825, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":826 + /* "constraint/constraints.py":907 * 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, 826, __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, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); __pyx_t_2 = 0; __pyx_t_14 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 826, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 826, __pyx_L1_error) + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 907, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -22405,7 +24392,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca { 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, 826, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 907, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -22415,7 +24402,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca { 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, 826, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 907, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -22426,13 +24413,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 826, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_14(__pyx_t_7); 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, 826, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 907, __pyx_L1_error) PyErr_Clear(); } break; @@ -22442,22 +24429,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":827 + /* "constraint/constraints.py":908 * 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, 827, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_v_prod, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_v_exactprod, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 827, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_v_exactprod, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 827, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_4) { - /* "constraint/constraints.py":828 + /* "constraint/constraints.py":909 * for value in domain[:]: * if prod * value > exactprod: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -22471,12 +24458,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_value}; __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__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_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 828, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 909, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":827 + /* "constraint/constraints.py":908 * domain = domains[variable] * for value in domain[:]: * if prod * value > exactprod: # <<<<<<<<<<<<<< @@ -22485,7 +24472,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":826 + /* "constraint/constraints.py":907 * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -22495,18 +24482,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":829 + /* "constraint/constraints.py":910 * if prod * value > exactprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False * return True */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 829, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 910, __pyx_L1_error) __pyx_t_13 = (!__pyx_t_4); if (__pyx_t_13) { - /* "constraint/constraints.py":830 + /* "constraint/constraints.py":911 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -22519,7 +24506,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/constraints.py":829 + /* "constraint/constraints.py":910 * if prod * value > exactprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -22528,7 +24515,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":824 + /* "constraint/constraints.py":905 * if forwardcheck: * for variable in variables: * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): # <<<<<<<<<<<<<< @@ -22537,7 +24524,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":823 + /* "constraint/constraints.py":904 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -22547,7 +24534,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":822 + /* "constraint/constraints.py":903 * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): * return False * if forwardcheck: # <<<<<<<<<<<<<< @@ -22556,7 +24543,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":831 + /* "constraint/constraints.py":912 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -22568,7 +24555,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":802 + /* "constraint/constraints.py":883 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -22593,13 +24580,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___2generator9); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__call___2generator8); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":844 +/* "constraint/constraints.py":931 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # <<<<<<<<<<<<<< @@ -22649,38 +24636,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, 844, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 931, __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, 844, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 931, __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, 844, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 931, __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, 844, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 931, __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, 844, __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, 931, __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, 844, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(0, 931, __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, 844, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 931, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 844, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 931, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 844, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 931, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_target_var = ((PyObject*)values[1]); @@ -22688,7 +24675,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, 844, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 931, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -22699,7 +24686,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, 844, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 931, __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 */ @@ -22727,25 +24714,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":851 + /* "constraint/constraints.py":938 * 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, 851, __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, 938, __pyx_L1_error) - /* "constraint/constraints.py":852 + /* "constraint/constraints.py":939 * """ * 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, 852, __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, 939, __pyx_L1_error) - /* "constraint/constraints.py":844 + /* "constraint/constraints.py":931 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # <<<<<<<<<<<<<< @@ -22765,7 +24752,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":854 +/* "constraint/constraints.py":941 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -22815,41 +24802,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, 854, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 941, __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, 854, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 941, __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, 854, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 941, __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, 854, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 941, __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, 854, __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, 941, __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, 854, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, i); __PYX_ERR(0, 941, __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, 854, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 941, __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, 854, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 941, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 854, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 941, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -22861,7 +24848,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, 854, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 941, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -22889,11 +24876,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_9genexpr10__pyx_v_b = NULL; - PyObject *__pyx_9genexpr11__pyx_v_b = NULL; - PyObject *__pyx_9genexpr12__pyx_v_lo = NULL; - PyObject *__pyx_9genexpr12__pyx_v_hi = NULL; - PyObject *__pyx_9genexpr13__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; @@ -22916,35 +24903,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_product_bounds", 0); - /* "constraint/constraints.py":856 + /* "constraint/constraints.py":943 * 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, 856, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":857 + /* "constraint/constraints.py":944 * """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, 857, __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, 944, __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, 857, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 944, __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, 857, __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, 944, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -22953,7 +24940,7 @@ 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, 857, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 944, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -22963,7 +24950,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 857, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 944, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -22974,13 +24961,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __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, 857, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 944, __pyx_L1_error) PyErr_Clear(); } break; @@ -22990,19 +24977,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":858 + /* "constraint/constraints.py":945 * 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, 858, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 858, __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, 945, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":859 + /* "constraint/constraints.py":946 * for var in self.product_vars: * if var == exclude_var: * continue # <<<<<<<<<<<<<< @@ -23011,7 +24998,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ goto __pyx_L3_continue; - /* "constraint/constraints.py":858 + /* "constraint/constraints.py":945 * bounds = [] * for var in self.product_vars: * if var == exclude_var: # <<<<<<<<<<<<<< @@ -23020,30 +25007,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":860 + /* "constraint/constraints.py":947 * 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, 860, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_domain_dict, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":861 + /* "constraint/constraints.py":948 * 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, 861, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_dom); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 948, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { - /* "constraint/constraints.py":862 + /* "constraint/constraints.py":949 * dom = domain_dict[var] * if not dom: * continue # <<<<<<<<<<<<<< @@ -23052,7 +25039,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ goto __pyx_L3_continue; - /* "constraint/constraints.py":861 + /* "constraint/constraints.py":948 * continue * dom = domain_dict[var] * if not dom: # <<<<<<<<<<<<<< @@ -23061,7 +25048,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":863 + /* "constraint/constraints.py":950 * if not dom: * continue * bounds.append((min(dom), max(dom))) # <<<<<<<<<<<<<< @@ -23077,7 +25064,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_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, 863, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_7 = NULL; @@ -23089,21 +25076,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 863, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 863, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 863, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 950, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 863, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 950, __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, 863, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_bounds, __pyx_t_10); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "constraint/constraints.py":857 + /* "constraint/constraints.py":944 * """Return min and max product of domains of product_vars (excluding `exclude_var` if given).""" * bounds = [] * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -23114,7 +25101,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":865 + /* "constraint/constraints.py":952 * bounds.append((min(dom), max(dom))) * * all_bounds = [b for b in bounds] # <<<<<<<<<<<<<< @@ -23122,7 +25109,7 @@ 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, 865, __pyx_L10_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 952, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = __pyx_v_bounds; __Pyx_INCREF(__pyx_t_10); __pyx_t_3 = 0; @@ -23130,30 +25117,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 865, __pyx_L10_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 952, __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_3; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 865, __pyx_L10_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 952, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_b, __pyx_t_8); + __Pyx_XDECREF_SET(__pyx_9genexpr19__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_L10_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr19__pyx_v_b))) __PYX_ERR(0, 952, __pyx_L10_error) } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_b); __pyx_9genexpr10__pyx_v_b = 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_9genexpr10__pyx_v_b); __pyx_9genexpr10__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":866 + /* "constraint/constraints.py":953 * * all_bounds = [b for b in bounds] * if not all_bounds: # <<<<<<<<<<<<<< @@ -23161,11 +25148,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * */ __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, 866, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_6 < 0))) __PYX_ERR(0, 953, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_6); if (__pyx_t_5) { - /* "constraint/constraints.py":867 + /* "constraint/constraints.py":954 * all_bounds = [b for b in bounds] * if not all_bounds: * return 1, 1 # <<<<<<<<<<<<<< @@ -23177,7 +25164,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = __pyx_mstate_global->__pyx_tuple[0]; goto __pyx_L0; - /* "constraint/constraints.py":866 + /* "constraint/constraints.py":953 * * all_bounds = [b for b in bounds] * if not all_bounds: # <<<<<<<<<<<<<< @@ -23186,7 +25173,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":870 + /* "constraint/constraints.py":957 * * # 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])] # <<<<<<<<<<<<<< @@ -23194,12 +25181,12 @@ 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, 870, __pyx_L18_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 957, __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, 870, __pyx_L18_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 957, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_10); { /* enter inner scope */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 870, __pyx_L23_error) + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 957, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __pyx_v_all_bounds; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; @@ -23207,13 +25194,13 @@ 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, 870, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 957, __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_3; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 870, __pyx_L23_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 957, __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; @@ -23221,7 +25208,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, 870, __pyx_L23_error) + __PYX_ERR(0, 957, __pyx_L23_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -23231,22 +25218,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_INCREF(__pyx_t_13); } else { __pyx_t_12 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 870, __pyx_L23_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 957, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 870, __pyx_L23_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 957, __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, 870, __pyx_L23_error) + __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 957, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 870, __pyx_L23_error) + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 957, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_13); #endif __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { Py_ssize_t index = -1; - __pyx_t_14 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 870, __pyx_L23_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 957, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); @@ -23254,7 +25241,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 870, __pyx_L23_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 957, __pyx_L23_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L27_unpacking_done; @@ -23262,38 +25249,38 @@ 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, 870, __pyx_L23_error) + __PYX_ERR(0, 957, __pyx_L23_error) __pyx_L27_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr12__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_9genexpr12__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, 870, __pyx_L23_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 957, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(__pyx_9genexpr12__pyx_v_lo); - __Pyx_GIVEREF(__pyx_9genexpr12__pyx_v_lo); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_9genexpr12__pyx_v_lo) != (0)) __PYX_ERR(0, 870, __pyx_L23_error); - __Pyx_INCREF(__pyx_9genexpr12__pyx_v_hi); - __Pyx_GIVEREF(__pyx_9genexpr12__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_9genexpr12__pyx_v_hi) != (0)) __PYX_ERR(0, 870, __pyx_L23_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 870, __pyx_L23_error) + __Pyx_INCREF(__pyx_9genexpr21__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr21__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_9genexpr21__pyx_v_lo) != (0)) __PYX_ERR(0, 957, __pyx_L23_error); + __Pyx_INCREF(__pyx_9genexpr21__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr21__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_9genexpr21__pyx_v_hi) != (0)) __PYX_ERR(0, 957, __pyx_L23_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 957, __pyx_L23_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_hi); __pyx_9genexpr12__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_lo); __pyx_9genexpr12__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_9genexpr12__pyx_v_hi); __pyx_9genexpr12__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_lo); __pyx_9genexpr12__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, 870, __pyx_L18_error) + __pyx_t_1 = PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __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, 870, __pyx_L18_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 957, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -23302,9 +25289,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 870, __pyx_L18_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __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, 870, __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, 957, __pyx_L18_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -23313,7 +25300,7 @@ 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, 870, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 957, __pyx_L18_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -23323,7 +25310,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 870, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 957, __pyx_L18_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -23334,35 +25321,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 870, __pyx_L18_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 957, __pyx_L18_error) } else { __pyx_t_8 = __pyx_t_4(__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, 870, __pyx_L18_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 957, __pyx_L18_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_b, __pyx_t_8); + __Pyx_XDECREF_SET(__pyx_9genexpr20__pyx_v_b, __pyx_t_8); __pyx_t_8 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr11__pyx_v_b))) __PYX_ERR(0, 870, __pyx_L18_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr20__pyx_v_b))) __PYX_ERR(0, 957, __pyx_L18_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_b); __pyx_9genexpr11__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_9genexpr11__pyx_v_b); __pyx_9genexpr11__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":871 + /* "constraint/constraints.py":958 * # 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] # <<<<<<<<<<<<<< @@ -23370,7 +25357,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, 871, __pyx_L34_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 958, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_v_candidates; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; @@ -23378,41 +25365,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, 871, __pyx_L34_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 958, __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_3; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 871, __pyx_L34_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 958, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_p, __pyx_t_8); + __Pyx_XDECREF_SET(__pyx_9genexpr22__pyx_v_p, __pyx_t_8); __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_9genexpr13__pyx_v_p}; + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr22__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, 871, __pyx_L34_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 958, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_8); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 871, __pyx_L34_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 958, __pyx_L34_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_p); __pyx_9genexpr13__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_9genexpr13__pyx_v_p); __pyx_9genexpr13__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":872 + /* "constraint/constraints.py":959 * 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) # <<<<<<<<<<<<<< @@ -23429,7 +25416,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 872, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_1 = NULL; @@ -23441,22 +25428,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 872, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 872, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 872, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 959, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 872, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 959, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_8 = 0; __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; - /* "constraint/constraints.py":854 + /* "constraint/constraints.py":941 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -23483,17 +25470,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_9genexpr10__pyx_v_b); - __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_b); - __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_lo); - __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_hi); - __Pyx_XDECREF(__pyx_9genexpr13__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":874 +/* "constraint/constraints.py":961 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -23541,39 +25528,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, 874, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 961, __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, 874, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 961, __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, 874, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 961, __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, 874, __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, 961, __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, 874, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, i); __PYX_ERR(0, 961, __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, 874, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 961, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 874, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 961, __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, 874, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 961, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -23608,7 +25595,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_safe_product", 0); - /* "constraint/constraints.py":875 + /* "constraint/constraints.py":962 * * def _safe_product(self, values): * prod = 1 # <<<<<<<<<<<<<< @@ -23618,7 +25605,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":876 + /* "constraint/constraints.py":963 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -23630,9 +25617,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, 876, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __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, 876, __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, 963, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -23640,7 +25627,7 @@ 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, 876, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 963, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -23650,7 +25637,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 876, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 963, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -23661,13 +25648,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 876, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 963, __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, 876, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 963, __pyx_L1_error) PyErr_Clear(); } break; @@ -23677,19 +25664,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":877 + /* "constraint/constraints.py":964 * 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, 877, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":876 + /* "constraint/constraints.py":963 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -23699,7 +25686,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":878 + /* "constraint/constraints.py":965 * for v in values: * prod *= v * return prod # <<<<<<<<<<<<<< @@ -23711,7 +25698,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = __pyx_v_prod; goto __pyx_L0; - /* "constraint/constraints.py":874 + /* "constraint/constraints.py":961 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -23733,7 +25720,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":880 +/* "constraint/constraints.py":967 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -23784,50 +25771,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, 880, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 967, __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, 880, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 967, __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, 880, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 967, __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, 880, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 967, __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, 880, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 967, __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, 880, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 967, __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, 880, __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, 967, __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, 880, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 967, __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, 880, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 967, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 880, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 967, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 880, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 967, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 880, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 967, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 880, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 967, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -23837,7 +25824,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, 880, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 967, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -23848,9 +25835,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, 880, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 880, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 880, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 967, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 967, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 967, __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 */ @@ -23903,7 +25890,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":881 + /* "constraint/constraints.py":968 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -23911,9 +25898,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, 881, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 968, __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, 881, __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, 968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -23933,27 +25920,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_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, 881, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":883 + /* "constraint/constraints.py":970 * 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, 883, __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, 970, __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, 883, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 970, __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":884 + /* "constraint/constraints.py":971 * * target_domain = domains[self.target_var] * target_min = min(target_domain) # <<<<<<<<<<<<<< @@ -23969,13 +25956,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_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, 884, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_target_min = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/constraints.py":885 + /* "constraint/constraints.py":972 * target_domain = domains[self.target_var] * target_min = min(target_domain) * target_max = max(target_domain) # <<<<<<<<<<<<<< @@ -23991,29 +25978,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 885, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_target_max = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/constraints.py":886 + /* "constraint/constraints.py":973 * 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, 886, __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, 973, __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, 886, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __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, 886, __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, 973, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -24022,7 +26009,7 @@ 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, 886, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 973, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -24032,7 +26019,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 886, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 973, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -24043,13 +26030,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 886, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 973, __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, 886, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 973, __pyx_L1_error) PyErr_Clear(); } break; @@ -24059,7 +26046,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":887 + /* "constraint/constraints.py":974 * target_max = max(target_domain) * for var in self.product_vars: * other_min, other_max = self._get_product_bounds(domains, exclude_var=var) # <<<<<<<<<<<<<< @@ -24071,13 +26058,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, 887, __pyx_L1_error) + __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 974, __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, 887, __pyx_L1_error) + 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, 974, __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_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 887, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { @@ -24086,7 +26073,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, 887, __pyx_L1_error) + __PYX_ERR(0, 974, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -24096,22 +26083,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 887, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 887, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __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, 887, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 887, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __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, 887, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 974, __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); @@ -24119,7 +26106,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, 887, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 974, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -24127,7 +26114,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, 887, __pyx_L1_error) + __PYX_ERR(0, 974, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_other_min, __pyx_t_3); @@ -24135,35 +26122,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":888 + /* "constraint/constraints.py":975 * 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, 888, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":889 + /* "constraint/constraints.py":976 * 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, 889, __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, 976, __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, 889, __pyx_L1_error) + __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __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, 889, __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, 976, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -24172,7 +26159,7 @@ 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, 889, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 976, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -24182,7 +26169,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 889, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 976, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -24193,13 +26180,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_10; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 889, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __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, 889, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 976, __pyx_L1_error) PyErr_Clear(); } break; @@ -24209,29 +26196,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":890 + /* "constraint/constraints.py":977 * 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, 890, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_v_value, __pyx_v_other_min); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 977, __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, 890, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_value, __pyx_v_other_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 890, __pyx_L1_error) + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 977, __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, 890, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 977, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 890, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 977, __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":891 + /* "constraint/constraints.py":978 * for value in domain[:]: * candidates = [value * other_min, value * other_max] * minval, maxval = min(candidates), max(candidates) # <<<<<<<<<<<<<< @@ -24247,7 +26234,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_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, 891, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_3 = NULL; @@ -24259,7 +26246,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 891, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_minval, __pyx_t_8); @@ -24267,29 +26254,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_maxval, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":892 + /* "constraint/constraints.py":979 * 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, 892, __pyx_L1_error) - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 892, __pyx_L1_error) + __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, 979, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 979, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_14) { } else { __pyx_t_13 = __pyx_t_14; 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, 892, __pyx_L1_error) - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 892, __pyx_L1_error) + __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, 979, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 979, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_13 = __pyx_t_14; __pyx_L10_bool_binop_done:; if (__pyx_t_13) { - /* "constraint/constraints.py":893 + /* "constraint/constraints.py":980 * minval, maxval = min(candidates), max(candidates) * if maxval < target_min or minval > target_max: * domain.remove(value) # <<<<<<<<<<<<<< @@ -24303,12 +26290,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":892 + /* "constraint/constraints.py":979 * candidates = [value * other_min, value * other_max] * minval, maxval = min(candidates), max(candidates) * if maxval < target_min or minval > target_max: # <<<<<<<<<<<<<< @@ -24317,7 +26304,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":889 + /* "constraint/constraints.py":976 * other_min, other_max = self._get_product_bounds(domains, exclude_var=var) * domain = domains[var] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -24327,7 +26314,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":886 + /* "constraint/constraints.py":973 * target_min = min(target_domain) * target_max = max(target_domain) * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -24337,7 +26324,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":880 + /* "constraint/constraints.py":967 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -24374,7 +26361,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":895 +/* "constraint/constraints.py":982 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -24402,7 +26389,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 @@ -24425,53 +26412,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, 895, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 982, __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, 895, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 982, __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, 895, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 982, __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, 895, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 982, __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, 895, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 982, __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, 895, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 982, __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, 895, __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, 982, __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, 895, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 982, __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, 895, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 982, __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, 895, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 982, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 895, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 982, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 895, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 982, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 895, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 982, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -24485,7 +26472,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, 895, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 982, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -24496,8 +26483,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, 895, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 895, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 982, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 982, __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 */ @@ -24516,9 +26503,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___2generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +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":918 +/* "constraint/constraints.py":1005 * 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) # <<<<<<<<<<<<<< @@ -24527,29 +26514,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai */ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_8__call___genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *__pyx_cur_scope; + struct __pyx_obj_10constraint_11constraints___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_11constraints___pyx_scope_struct_14_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_14_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_13_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 918, __pyx_L1_error) + __PYX_ERR(0, 1005, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *) __pyx_self; + __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___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_VariableExactProdConstraint___ca, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 918, __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, 1005, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -24565,9 +26552,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___2generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -24587,29 +26574,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, 918, __pyx_L1_error) + __PYX_ERR(0, 1005, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 918, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1005, __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, 918, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1005, __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, 918, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1005, __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, 918, __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, 918, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_assigned_product)) { __Pyx_RaiseClosureNameError("assigned_product"); __PYX_ERR(0, 1005, __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, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -24627,7 +26614,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, 918, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1005, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -24652,9 +26639,9 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___5generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +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":919 +/* "constraint/constraints.py":1006 * 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) # <<<<<<<<<<<<<< @@ -24663,29 +26650,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai */ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_8__call___3genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr *__pyx_cur_scope; + struct __pyx_obj_10constraint_11constraints___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_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); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_14_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_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_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 919, __pyx_L1_error) + __PYX_ERR(0, 1006, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *) __pyx_self; + __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___5generator11, ((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, 919, __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, 1006, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -24701,9 +26688,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___5generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___5generator10(__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); + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -24723,29 +26710,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, 919, __pyx_L1_error) + __PYX_ERR(0, 1006, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 919, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1006, __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, 919, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1006, __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, 919, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1006, __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, 919, __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, 919, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_assigned_product)) { __Pyx_RaiseClosureNameError("assigned_product"); __PYX_ERR(0, 1006, __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, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -24763,7 +26750,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, 919, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1006, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -24788,139 +26775,8 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___8generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "constraint/constraints.py":933 - * 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_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_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_16_genexpr *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 933, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___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___8generator12, ((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_VariableExactProdConstraint___ca, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 933, __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___8generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ -{ - 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; - 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, 933, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 933, __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, 933, __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, 933, __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, 933, __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, 933, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 933, __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":895 +/* "constraint/constraints.py":982 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -24928,32 +26784,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) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *__pyx_cur_scope; +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_9genexpr14__pyx_v_v = NULL; - PyObject *__pyx_9genexpr15__pyx_v_p = NULL; - PyObject *__pyx_9genexpr16__pyx_v_lo = NULL; - PyObject *__pyx_9genexpr16__pyx_v_hi = NULL; - PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___2generator10 = 0; - PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___5generator11 = 0; - PyObject *__pyx_9genexpr19__pyx_v_v = NULL; - PyObject *__pyx_9genexpr20__pyx_v_v = NULL; - PyObject *__pyx_9genexpr21__pyx_v_p = NULL; - PyObject *__pyx_9genexpr22__pyx_v_lo = NULL; - PyObject *__pyx_9genexpr22__pyx_v_hi = NULL; - PyObject *__pyx_9genexpr23__pyx_v_p = NULL; - PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___8generator12 = 0; + 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_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -24971,36 +26816,33 @@ 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; __Pyx_RefNannySetupContext("__call__", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_13___call__(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13___call__, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12___call__(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 895, __pyx_L1_error) + __PYX_ERR(0, 982, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/constraints.py":896 + /* "constraint/constraints.py":983 * * 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, 896, __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, 983, __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, 896, __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, 983, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":897 + /* "constraint/constraints.py":984 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: * return True # <<<<<<<<<<<<<< @@ -25012,7 +26854,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":896 + /* "constraint/constraints.py":983 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -25021,23 +26863,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":899 + /* "constraint/constraints.py":986 * 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, 899, __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, 986, __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, 899, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 986, __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":900 + /* "constraint/constraints.py":987 * * target_value = assignments[self.target_var] * assigned_product = 1 # <<<<<<<<<<<<<< @@ -25048,35 +26889,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":901 + /* "constraint/constraints.py":988 * 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, 901, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_unassigned_vars = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":903 + /* "constraint/constraints.py":990 * 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, 903, __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, 990, __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, 903, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 990, __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, 903, __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, 990, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -25085,7 +26926,7 @@ 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, 903, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 990, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -25095,7 +26936,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 903, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 990, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -25106,13 +26947,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 903, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 990, __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, 903, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 990, __pyx_L1_error) PyErr_Clear(); } break; @@ -25122,26 +26963,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":904 + /* "constraint/constraints.py":991 * * 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, 904, __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, 991, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":905 + /* "constraint/constraints.py":992 * 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, 905, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 992, __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, 905, __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, 992, __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); @@ -25149,7 +26990,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":904 + /* "constraint/constraints.py":991 * * for var in self.product_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -25159,7 +27000,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai goto __pyx_L6; } - /* "constraint/constraints.py":907 + /* "constraint/constraints.py":994 * assigned_product *= assignments[var] * else: * unassigned_vars.append(var) # <<<<<<<<<<<<<< @@ -25167,11 +27008,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, 907, __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, 994, __pyx_L1_error) } __pyx_L6:; - /* "constraint/constraints.py":903 + /* "constraint/constraints.py":990 * unassigned_vars = [] * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -25181,7 +27022,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":909 + /* "constraint/constraints.py":996 * unassigned_vars.append(var) * * if isinstance(assigned_product, float): # <<<<<<<<<<<<<< @@ -25194,7 +27035,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":910 + /* "constraint/constraints.py":997 * * if isinstance(assigned_product, float): * assigned_product = round(assigned_product, 10) # <<<<<<<<<<<<<< @@ -25210,7 +27051,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_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, 910, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_assigned_product); @@ -25218,7 +27059,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":909 + /* "constraint/constraints.py":996 * unassigned_vars.append(var) * * if isinstance(assigned_product, float): # <<<<<<<<<<<<<< @@ -25227,7 +27068,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":912 + /* "constraint/constraints.py":999 * assigned_product = round(assigned_product, 10) * * if not unassigned_vars: # <<<<<<<<<<<<<< @@ -25235,11 +27076,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * */ __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, 912, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 999, __pyx_L1_error) __pyx_t_9 = (!__pyx_t_2); if (__pyx_t_9) { - /* "constraint/constraints.py":913 + /* "constraint/constraints.py":1000 * * if not unassigned_vars: * return assigned_product == target_value # <<<<<<<<<<<<<< @@ -25247,12 +27088,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, 913, __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, 1000, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":912 + /* "constraint/constraints.py":999 * assigned_product = round(assigned_product, 10) * * if not unassigned_vars: # <<<<<<<<<<<<<< @@ -25261,7 +27102,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":916 + /* "constraint/constraints.py":1003 * * # Partial assignment check feasibility * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned_vars] # <<<<<<<<<<<<<< @@ -25269,7 +27110,7 @@ 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, 916, __pyx_L12_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_v_unassigned_vars; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; @@ -25277,20 +27118,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 916, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1003, __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_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 916, __pyx_L12_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1003, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_v, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr23__pyx_v_v, __pyx_t_6); __pyx_t_6 = 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_9genexpr14__pyx_v_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 916, __pyx_L12_error) + __pyx_t_12 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr23__pyx_v_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1003, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_8 = 1; { @@ -25299,13 +27140,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 916, __pyx_L12_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1003, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_6); } __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_9genexpr14__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 916, __pyx_L12_error) + __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr23__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1003, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_8 = 1; { @@ -25314,32 +27155,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 916, __pyx_L12_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1003, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 916, __pyx_L12_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1003, __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, 916, __pyx_L12_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1003, __pyx_L12_error); __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 916, __pyx_L12_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 1003, __pyx_L12_error); __pyx_t_6 = 0; __pyx_t_11 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 916, __pyx_L12_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1003, __pyx_L12_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_v); __pyx_9genexpr14__pyx_v_v = 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_9genexpr14__pyx_v_v); __pyx_9genexpr14__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":917 + /* "constraint/constraints.py":1004 * # 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])] # <<<<<<<<<<<<<< @@ -25347,12 +27188,12 @@ 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, 917, __pyx_L19_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1004, __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, 917, __pyx_L19_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1004, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); { /* enter inner scope */ - __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 917, __pyx_L24_error) + __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1004, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __pyx_v_domain_bounds; __Pyx_INCREF(__pyx_t_11); __pyx_t_4 = 0; @@ -25360,857 +27201,267 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 917, __pyx_L24_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1004, __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_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 917, __pyx_L24_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1004, __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; 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, 917, __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_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, 917, __pyx_L24_error) - __Pyx_XGOTREF(__pyx_t_13); - __pyx_t_12 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 917, __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, 917, __pyx_L24_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 917, __pyx_L24_error) - __Pyx_GOTREF(__pyx_t_12); - #endif - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_14 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 917, __pyx_L24_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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; - __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, 917, __pyx_L24_error) - __pyx_t_15 = NULL; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - goto __pyx_L28_unpacking_done; - __pyx_L27_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, 917, __pyx_L24_error) - __pyx_L28_unpacking_done:; - } - __Pyx_XDECREF_SET(__pyx_9genexpr16__pyx_v_lo, __pyx_t_13); - __pyx_t_13 = 0; - __Pyx_XDECREF_SET(__pyx_9genexpr16__pyx_v_hi, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 917, __pyx_L24_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_9genexpr16__pyx_v_lo); - __Pyx_GIVEREF(__pyx_9genexpr16__pyx_v_lo); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_9genexpr16__pyx_v_lo) != (0)) __PYX_ERR(0, 917, __pyx_L24_error); - __Pyx_INCREF(__pyx_9genexpr16__pyx_v_hi); - __Pyx_GIVEREF(__pyx_9genexpr16__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_9genexpr16__pyx_v_hi) != (0)) __PYX_ERR(0, 917, __pyx_L24_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 917, __pyx_L24_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_hi); __pyx_9genexpr16__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_lo); __pyx_9genexpr16__pyx_v_lo = 0; - goto __pyx_L30_exit_scope; - __pyx_L24_error:; - __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_hi); __pyx_9genexpr16__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_lo); __pyx_9genexpr16__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, 917, __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, 917, __pyx_L19_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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); - __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, 917, __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, 917, __pyx_L19_error) - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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, 917, __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_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, 917, __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)); - #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_4); - #endif - ++__pyx_t_4; - } - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 917, __pyx_L19_error) - } else { - __pyx_t_10 = __pyx_t_5(__pyx_t_11); - 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, 917, __pyx_L19_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_10); - __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_p, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_3 = __pyx_v_self; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_8 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_9genexpr15__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, 917, __pyx_L19_error) - __Pyx_GOTREF(__pyx_t_10); - } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 917, __pyx_L19_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_p); __pyx_9genexpr15__pyx_v_p = 0; - goto __pyx_L32_exit_scope; - __pyx_L19_error:; - __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_p); __pyx_9genexpr15__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":918 - * 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) # <<<<<<<<<<<<<< - * possible_max = max(assigned_product * c for c in candidates) - * -*/ - __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, 918, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __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)); - __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, 918, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } - __pyx_v_possible_min = __pyx_t_1; - __pyx_t_1 = 0; - - /* "constraint/constraints.py":919 - * 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, 919, __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; - __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, 919, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } - __pyx_v_possible_max = __pyx_t_1; - __pyx_t_1 = 0; - - /* "constraint/constraints.py":921 - * 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, 921, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 921, __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, 921, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 921, __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":922 - * - * if target_value < possible_min or target_value > possible_max: - * return False # <<<<<<<<<<<<<< - * - * if forwardcheck: -*/ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - - /* "constraint/constraints.py":921 - * possible_max = max(assigned_product * c for c in candidates) - * - * if target_value < possible_min or target_value > possible_max: # <<<<<<<<<<<<<< - * return False - * -*/ - } - - /* "constraint/constraints.py":924 - * 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, 924, __pyx_L1_error) - if (__pyx_t_9) { - - /* "constraint/constraints.py":925 - * - * 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, 925, __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, 925, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":926 - * 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, 926, __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, 926, __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, 926, __pyx_L41_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_XDECREF_SET(__pyx_9genexpr19__pyx_v_v, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = PyObject_RichCompare(__pyx_9genexpr19__pyx_v_v, __pyx_v_var, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 926, __pyx_L41_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 926, __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_9genexpr19__pyx_v_v))) __PYX_ERR(0, 926, __pyx_L41_error) - } - } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_v); __pyx_9genexpr19__pyx_v_v = 0; - goto __pyx_L46_exit_scope; - __pyx_L41_error:; - __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_v); __pyx_9genexpr19__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":927 - * 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, 927, __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, 927, __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, 927, __pyx_L51_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr20__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_9genexpr20__pyx_v_v); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 927, __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, 927, __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_9genexpr20__pyx_v_v); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 927, __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, 927, __pyx_L51_error) - __Pyx_GOTREF(__pyx_t_13); - } - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 927, __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, 927, __pyx_L51_error); - __Pyx_GIVEREF(__pyx_t_13); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_13) != (0)) __PYX_ERR(0, 927, __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, 927, __pyx_L51_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_v); __pyx_9genexpr20__pyx_v_v = 0; - goto __pyx_L55_exit_scope; - __pyx_L51_error:; - __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_v); __pyx_9genexpr20__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, 927, __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, 927, __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, 927, __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":928 - * 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, 928, __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, 928, __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, 928, __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, 928, __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, 928, __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, 928, __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, 928, __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, 928, __pyx_L63_error) - __Pyx_XGOTREF(__pyx_t_6); - __pyx_t_17 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 928, __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, 928, __pyx_L63_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_17 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 928, __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, 928, __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, 928, __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, 928, __pyx_L63_error) - __pyx_L67_unpacking_done:; - } - __Pyx_XDECREF_SET(__pyx_9genexpr22__pyx_v_lo, __pyx_t_6); - __pyx_t_6 = 0; - __Pyx_XDECREF_SET(__pyx_9genexpr22__pyx_v_hi, __pyx_t_17); - __pyx_t_17 = 0; - __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 928, __pyx_L63_error) - __Pyx_GOTREF(__pyx_t_13); - __Pyx_INCREF(__pyx_9genexpr22__pyx_v_lo); - __Pyx_GIVEREF(__pyx_9genexpr22__pyx_v_lo); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_9genexpr22__pyx_v_lo) != (0)) __PYX_ERR(0, 928, __pyx_L63_error); - __Pyx_INCREF(__pyx_9genexpr22__pyx_v_hi); - __Pyx_GIVEREF(__pyx_9genexpr22__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_9genexpr22__pyx_v_hi) != (0)) __PYX_ERR(0, 928, __pyx_L63_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_13))) __PYX_ERR(0, 928, __pyx_L63_error) - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - } - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_hi); __pyx_9genexpr22__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_lo); __pyx_9genexpr22__pyx_v_lo = 0; - goto __pyx_L69_exit_scope; - __pyx_L63_error:; - __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_hi); __pyx_9genexpr22__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_lo); __pyx_9genexpr22__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, 928, __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, 928, __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, 928, __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, 928, __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, 928, __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, 928, __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, 928, __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, 928, __pyx_L58_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_10); - __Pyx_XDECREF_SET(__pyx_9genexpr21__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_9genexpr21__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, 928, __pyx_L58_error) - __Pyx_GOTREF(__pyx_t_10); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 1004, __pyx_L24_error) } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 928, __pyx_L58_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0); + __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, 1004, __pyx_L24_error) + __Pyx_XGOTREF(__pyx_t_13); + __pyx_t_12 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1004, __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, 1004, __pyx_L24_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1004, __pyx_L24_error) + __Pyx_GOTREF(__pyx_t_12); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_14 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1004, __pyx_L24_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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; + __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, 1004, __pyx_L24_error) + __pyx_t_15 = NULL; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L28_unpacking_done; + __pyx_L27_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, 1004, __pyx_L24_error) + __pyx_L28_unpacking_done:; } - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_p); __pyx_9genexpr21__pyx_v_p = 0; - goto __pyx_L71_exit_scope; - __pyx_L58_error:; - __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_p); __pyx_9genexpr21__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":930 - * 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, 930, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":931 - * - * 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, 931, __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, 931, __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, 931, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_9genexpr25__pyx_v_lo, __pyx_t_13); + __pyx_t_13 = 0; + __Pyx_XDECREF_SET(__pyx_9genexpr25__pyx_v_hi, __pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1004, __pyx_L24_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_9genexpr25__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr25__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_9genexpr25__pyx_v_lo) != (0)) __PYX_ERR(0, 1004, __pyx_L24_error); + __Pyx_INCREF(__pyx_9genexpr25__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr25__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_9genexpr25__pyx_v_hi) != (0)) __PYX_ERR(0, 1004, __pyx_L24_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1004, __pyx_L24_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __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, 931, __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, 931, __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); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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_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, 1004, __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, 1004, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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); + __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, 1004, __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, 1004, __pyx_L19_error) + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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, 1004, __pyx_L19_error) #endif - ++__pyx_t_16; + if (__pyx_t_4 >= __pyx_temp) break; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 931, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyList_GetItemRef(__pyx_t_11, __pyx_t_4); + ++__pyx_t_4; } 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, 931, __pyx_L1_error) - PyErr_Clear(); - } - break; + { + 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, 1004, __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)); + #else + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_4); + #endif + ++__pyx_t_4; } - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":932 - * 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, 932, __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, 932, __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, 932, __pyx_L76_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_XDECREF_SET(__pyx_9genexpr23__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, 932, __pyx_L76_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_13 = PyNumber_Multiply(__pyx_t_11, __pyx_9genexpr23__pyx_v_p); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 932, __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, 932, __pyx_L76_error) - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_p); __pyx_9genexpr23__pyx_v_p = 0; - goto __pyx_L80_exit_scope; - __pyx_L76_error:; - __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_p); __pyx_9genexpr23__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":933 - * 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, 933, __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, 933, __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, 933, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__pyx_t_9) { - - /* "constraint/constraints.py":934 - * 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, 934, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1004, __pyx_L19_error) + } else { + __pyx_t_10 = __pyx_t_5(__pyx_t_11); + 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, 1004, __pyx_L19_error) + PyErr_Clear(); } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "constraint/constraints.py":933 - * 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: -*/ + break; } - - /* "constraint/constraints.py":931 - * - * 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; + __Pyx_GOTREF(__pyx_t_10); + __Pyx_XDECREF_SET(__pyx_9genexpr24__pyx_v_p, __pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_3 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_8 = 0; + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_9genexpr24__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, 1004, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_10); + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1004, __pyx_L19_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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_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":935 - * if all(c != target_value for c in candidates): - * domain.hideValue(value) - * if not domain: # <<<<<<<<<<<<<< - * return False + /* "constraint/constraints.py":1005 + * 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) # <<<<<<<<<<<<<< + * possible_max = max(assigned_product * c for c in candidates) * */ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 935, __pyx_L1_error) - __pyx_t_2 = (!__pyx_t_9); - if (__pyx_t_2) { + __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, 1005, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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)); + __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, 1005, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __pyx_v_possible_min = __pyx_t_1; + __pyx_t_1 = 0; - /* "constraint/constraints.py":936 - * domain.hideValue(value) - * if not domain: - * return False # <<<<<<<<<<<<<< + /* "constraint/constraints.py":1006 + * 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) # <<<<<<<<<<<<<< * - * return True + * if target_value < possible_min or target_value > possible_max: */ - __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_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, 1006, __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; + __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, 1006, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __pyx_v_possible_max = __pyx_t_1; + __pyx_t_1 = 0; - /* "constraint/constraints.py":935 - * if all(c != target_value for c in candidates): - * domain.hideValue(value) - * if not domain: # <<<<<<<<<<<<<< - * return False + /* "constraint/constraints.py":1008 + * 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_v_target_value, __pyx_v_possible_min, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1008, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1008, __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_v_target_value, __pyx_v_possible_max, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1008, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1008, __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":925 + /* "constraint/constraints.py":1009 * - * 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)] + * if target_value < possible_min or target_value > possible_max: + * return False # <<<<<<<<<<<<<< + * + * # the below forwardcheck is incorrect for mixes of negative and positive values */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; - /* "constraint/constraints.py":924 + /* "constraint/constraints.py":1008 + * possible_max = max(assigned_product * c for c in candidates) + * + * 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] */ } - /* "constraint/constraints.py":938 - * return False + /* "constraint/constraints.py":1026 + * # return False * * return True # <<<<<<<<<<<<<< * @@ -26221,7 +27472,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":895 + /* "constraint/constraints.py":982 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -26239,42 +27490,30 @@ 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_9genexpr14__pyx_v_v); - __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_p); - __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_lo); - __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_hi); - __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___2generator10); - __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___5generator11); - __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_v); - __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_v); - __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_p); - __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_lo); - __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_hi); - __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_p); - __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___8generator12); + __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_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":952 - * """ +/* "constraint/constraints.py":1045 + * """ # noqa: E501 * * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MinProdConstraint. @@ -26322,39 +27561,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, 952, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1045, __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, 952, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1045, __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, 952, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1045, __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, 952, __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, 1045, __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, 952, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1045, __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, 952, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1045, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 952, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1045, __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, 952, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1045, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26383,17 +27622,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":958 + /* "constraint/constraints.py":1051 * 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, 958, __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, 1051, __pyx_L1_error) - /* "constraint/constraints.py":952 - * """ + /* "constraint/constraints.py":1045 + * """ # noqa: E501 * * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MinProdConstraint. @@ -26412,7 +27651,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ return __pyx_r; } -/* "constraint/constraints.py":960 +/* "constraint/constraints.py":1053 * self._minprod = minprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -26463,50 +27702,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, 960, __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 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 960, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1053, __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, 960, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1053, __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, 960, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1053, __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, 960, __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, 960, __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, "preProcess", 0) < 0) __PYX_ERR(0, 960, __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, 1053, __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, 960, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1053, __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, 960, __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, 960, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1053, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 960, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1053, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 960, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1053, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 960, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1053, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -26516,7 +27755,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, 960, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1053, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26527,9 +27766,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, 960, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 960, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 960, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1053, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1053, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1053, __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 */ @@ -26572,7 +27811,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":961 + /* "constraint/constraints.py":1054 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -26580,9 +27819,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, 961, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1054, __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, 961, __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, 1054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -26602,24 +27841,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro __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_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, 961, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":964 + /* "constraint/constraints.py":1057 * * # 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, 964, __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, 1057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_minprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":965 + /* "constraint/constraints.py":1058 * # prune the associated variables of values > minprod * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< @@ -26631,9 +27870,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, 965, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1058, __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, 965, __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, 1058, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -26641,7 +27880,7 @@ 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, 965, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1058, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -26651,7 +27890,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro { 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, 965, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1058, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -26662,13 +27901,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 965, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1058, __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, 965, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1058, __pyx_L1_error) PyErr_Clear(); } break; @@ -26678,35 +27917,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":966 + /* "constraint/constraints.py":1059 * 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, 966, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":967 + /* "constraint/constraints.py":1060 * 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, 967, __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, 1060, __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, 967, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1060, __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, 967, __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, 1060, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -26715,7 +27954,7 @@ 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, 967, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1060, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -26725,7 +27964,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro { 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, 967, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1060, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -26736,13 +27975,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 967, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1060, __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, 967, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1060, __pyx_L1_error) PyErr_Clear(); } break; @@ -26752,27 +27991,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":968 + /* "constraint/constraints.py":1061 * 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, 968, __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, 1061, __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, 968, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 968, __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, 1061, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1061, __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":969 + /* "constraint/constraints.py":1062 * for value in domain[:]: * if value == 0 and minprod > 0: * domain.remove(value) # <<<<<<<<<<<<<< @@ -26786,12 +28025,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro 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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 969, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1062, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":968 + /* "constraint/constraints.py":1061 * domain = domains[variable] * for value in domain[:]: * if value == 0 and minprod > 0: # <<<<<<<<<<<<<< @@ -26800,7 +28039,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro */ } - /* "constraint/constraints.py":967 + /* "constraint/constraints.py":1060 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -26810,7 +28049,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":965 + /* "constraint/constraints.py":1058 * # prune the associated variables of values > minprod * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< @@ -26820,7 +28059,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":960 + /* "constraint/constraints.py":1053 * self._minprod = minprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -26848,7 +28087,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro return __pyx_r; } -/* "constraint/constraints.py":971 +/* "constraint/constraints.py":1064 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -26899,53 +28138,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, 971, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1064, __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, 971, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1064, __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, 971, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1064, __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, 971, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1064, __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, 971, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1064, __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, 971, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1064, __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, 971, __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, 1064, __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, 971, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1064, __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, 971, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1064, __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, 971, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1064, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 971, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1064, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 971, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1064, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 971, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1064, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -26959,7 +28198,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, 971, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1064, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26970,8 +28209,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, 971, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 971, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1064, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1064, __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 */ @@ -27009,7 +28248,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":973 + /* "constraint/constraints.py":1066 * 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: # <<<<<<<<<<<<<< @@ -27021,9 +28260,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, 973, __pyx_L1_error) + __pyx_t_2 = -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_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 973, __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, 1066, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -27031,7 +28270,7 @@ 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, 973, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -27041,7 +28280,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call { 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, 973, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -27052,13 +28291,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 973, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1066, __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, 973, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1066, __pyx_L1_error) PyErr_Clear(); } break; @@ -27068,17 +28307,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":974 + /* "constraint/constraints.py":1067 * # 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, 974, __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, 1067, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":975 + /* "constraint/constraints.py":1068 * for variable in variables: * if variable not in assignments: * return True # <<<<<<<<<<<<<< @@ -27091,7 +28330,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":974 + /* "constraint/constraints.py":1067 * # check if each variable is in the assignments * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -27100,7 +28339,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call */ } - /* "constraint/constraints.py":973 + /* "constraint/constraints.py":1066 * 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: # <<<<<<<<<<<<<< @@ -27110,19 +28349,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":978 + /* "constraint/constraints.py":1071 * * # 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, 978, __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, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_minprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":979 + /* "constraint/constraints.py":1072 * # with each variable assigned, sum the values * minprod = self._minprod * prod = 1 # <<<<<<<<<<<<<< @@ -27132,7 +28371,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":980 + /* "constraint/constraints.py":1073 * minprod = self._minprod * prod = 1 * for variable in variables: # <<<<<<<<<<<<<< @@ -27144,9 +28383,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, 980, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1073, __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, 980, __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, 1073, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -27154,7 +28393,7 @@ 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, 980, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1073, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -27164,7 +28403,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call { 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, 980, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1073, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -27175,13 +28414,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 980, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1073, __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, 980, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1073, __pyx_L1_error) PyErr_Clear(); } break; @@ -27191,22 +28430,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":981 + /* "constraint/constraints.py":1074 * 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, 981, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1074, __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, 981, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1074, __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":980 + /* "constraint/constraints.py":1073 * minprod = self._minprod * prod = 1 * for variable in variables: # <<<<<<<<<<<<<< @@ -27216,7 +28455,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":982 + /* "constraint/constraints.py":1075 * for variable in variables: * prod *= assignments[variable] * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -27226,7 +28465,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":983 + /* "constraint/constraints.py":1076 * prod *= assignments[variable] * if isinstance(prod, float): * prod = round(prod, 10) # <<<<<<<<<<<<<< @@ -27242,13 +28481,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call __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_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, 983, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":982 + /* "constraint/constraints.py":1075 * for variable in variables: * prod *= assignments[variable] * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -27257,7 +28496,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call */ } - /* "constraint/constraints.py":984 + /* "constraint/constraints.py":1077 * if isinstance(prod, float): * prod = round(prod, 10) * return prod >= minprod # <<<<<<<<<<<<<< @@ -27265,12 +28504,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, 984, __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, 1077, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":971 + /* "constraint/constraints.py":1064 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -27294,7 +28533,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call return __pyx_r; } -/* "constraint/constraints.py":998 +/* "constraint/constraints.py":1097 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -27343,38 +28582,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, 998, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1097, __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, 998, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1097, __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, 998, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1097, __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, 998, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1097, __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, 998, __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, 1097, __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, 998, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(0, 1097, __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, 998, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1097, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 998, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1097, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 998, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1097, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_target_var = ((PyObject*)values[1]); @@ -27382,7 +28621,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, 998, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1097, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27393,7 +28632,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, 998, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 1097, __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 */ @@ -27421,25 +28660,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":999 + /* "constraint/constraints.py":1098 * * 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, 999, __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, 1098, __pyx_L1_error) - /* "constraint/constraints.py":1000 + /* "constraint/constraints.py":1099 * 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, 1000, __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, 1099, __pyx_L1_error) - /* "constraint/constraints.py":998 + /* "constraint/constraints.py":1097 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -27459,7 +28698,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1002 +/* "constraint/constraints.py":1101 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -27508,41 +28747,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, 1002, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1101, __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, 1002, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1101, __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, 1002, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1101, __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, 1002, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1101, __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, 1002, __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, 1101, __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, 1002, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, i); __PYX_ERR(0, 1101, __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, 1002, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1101, __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, 1002, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1101, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1002, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1101, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -27554,7 +28793,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, 1002, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1101, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27581,10 +28820,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_9genexpr25__pyx_v_p = NULL; - PyObject *__pyx_9genexpr26__pyx_v_lo = NULL; - PyObject *__pyx_9genexpr26__pyx_v_hi = NULL; - PyObject *__pyx_9genexpr27__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; @@ -27607,35 +28846,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_product_bounds", 0); - /* "constraint/constraints.py":1003 + /* "constraint/constraints.py":1102 * * 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, 1003, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1004 + /* "constraint/constraints.py":1103 * 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, 1004, __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, 1103, __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, 1004, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __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, 1004, __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, 1103, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -27644,7 +28883,7 @@ 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, 1004, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1103, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -27654,7 +28893,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1004, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1103, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -27665,13 +28904,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1004, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1103, __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, 1004, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1103, __pyx_L1_error) PyErr_Clear(); } break; @@ -27681,19 +28920,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1005 + /* "constraint/constraints.py":1104 * 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, 1005, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1005, __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, 1104, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1006 + /* "constraint/constraints.py":1105 * for var in self.product_vars: * if var == exclude_var: * continue # <<<<<<<<<<<<<< @@ -27702,7 +28941,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ goto __pyx_L3_continue; - /* "constraint/constraints.py":1005 + /* "constraint/constraints.py":1104 * bounds = [] * for var in self.product_vars: * if var == exclude_var: # <<<<<<<<<<<<<< @@ -27711,30 +28950,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1007 + /* "constraint/constraints.py":1106 * 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, 1007, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_domain_dict, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1008 + /* "constraint/constraints.py":1107 * 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, 1008, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_dom); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1107, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { - /* "constraint/constraints.py":1009 + /* "constraint/constraints.py":1108 * dom = domain_dict[var] * if not dom: * continue # <<<<<<<<<<<<<< @@ -27743,7 +28982,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ goto __pyx_L3_continue; - /* "constraint/constraints.py":1008 + /* "constraint/constraints.py":1107 * continue * dom = domain_dict[var] * if not dom: # <<<<<<<<<<<<<< @@ -27752,7 +28991,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1010 + /* "constraint/constraints.py":1109 * if not dom: * continue * bounds.append((min(dom), max(dom))) # <<<<<<<<<<<<<< @@ -27768,7 +29007,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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_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, 1010, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_7 = NULL; @@ -27780,21 +29019,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1010, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1010, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1010, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1109, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 1010, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 1109, __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, 1010, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_bounds, __pyx_t_10); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "constraint/constraints.py":1004 + /* "constraint/constraints.py":1103 * def _get_product_bounds(self, domain_dict, exclude_var=None): * bounds = [] * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -27805,7 +29044,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1012 + /* "constraint/constraints.py":1111 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< @@ -27813,11 +29052,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * */ __pyx_t_6 = (__Pyx_PyList_GET_SIZE(__pyx_v_bounds) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_6 < 0))) __PYX_ERR(0, 1012, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_6 < 0))) __PYX_ERR(0, 1111, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_6); if (__pyx_t_5) { - /* "constraint/constraints.py":1013 + /* "constraint/constraints.py":1112 * * if not bounds: * return 1, 1 # <<<<<<<<<<<<<< @@ -27829,7 +29068,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = __pyx_mstate_global->__pyx_tuple[0]; goto __pyx_L0; - /* "constraint/constraints.py":1012 + /* "constraint/constraints.py":1111 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< @@ -27838,7 +29077,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1016 + /* "constraint/constraints.py":1115 * * # Try all corner combinations * candidates = [p for p in product(*[(lo, hi) for lo, hi in bounds])] # <<<<<<<<<<<<<< @@ -27846,12 +29085,12 @@ 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, 1016, __pyx_L11_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1115, __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, 1016, __pyx_L11_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1115, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); { /* enter inner scope */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1016, __pyx_L16_error) + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1115, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __pyx_v_bounds; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; @@ -27859,13 +29098,13 @@ 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, 1016, __pyx_L16_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1115, __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_3; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1016, __pyx_L16_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1115, __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; @@ -27873,7 +29112,7 @@ 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, 1016, __pyx_L16_error) + __PYX_ERR(0, 1115, __pyx_L16_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -27883,22 +29122,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_INCREF(__pyx_t_13); } else { __pyx_t_12 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1016, __pyx_L16_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1115, __pyx_L16_error) __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1016, __pyx_L16_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1115, __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, 1016, __pyx_L16_error) + __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1115, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1016, __pyx_L16_error) + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1115, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_13); #endif __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { Py_ssize_t index = -1; - __pyx_t_14 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1016, __pyx_L16_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1115, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); @@ -27906,7 +29145,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1016, __pyx_L16_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 1115, __pyx_L16_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L20_unpacking_done; @@ -27914,38 +29153,38 @@ 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, 1016, __pyx_L16_error) + __PYX_ERR(0, 1115, __pyx_L16_error) __pyx_L20_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr26__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_9genexpr26__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, 1016, __pyx_L16_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1115, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(__pyx_9genexpr26__pyx_v_lo); - __Pyx_GIVEREF(__pyx_9genexpr26__pyx_v_lo); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_9genexpr26__pyx_v_lo) != (0)) __PYX_ERR(0, 1016, __pyx_L16_error); - __Pyx_INCREF(__pyx_9genexpr26__pyx_v_hi); - __Pyx_GIVEREF(__pyx_9genexpr26__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_9genexpr26__pyx_v_hi) != (0)) __PYX_ERR(0, 1016, __pyx_L16_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1016, __pyx_L16_error) + __Pyx_INCREF(__pyx_9genexpr29__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr29__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_9genexpr29__pyx_v_lo) != (0)) __PYX_ERR(0, 1115, __pyx_L16_error); + __Pyx_INCREF(__pyx_9genexpr29__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr29__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_9genexpr29__pyx_v_hi) != (0)) __PYX_ERR(0, 1115, __pyx_L16_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1115, __pyx_L16_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_hi); __pyx_9genexpr26__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_lo); __pyx_9genexpr26__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_9genexpr26__pyx_v_hi); __pyx_9genexpr26__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_lo); __pyx_9genexpr26__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, 1016, __pyx_L11_error) + __pyx_t_1 = PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1115, __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, 1016, __pyx_L11_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1115, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -27954,9 +29193,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1016, __pyx_L11_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1115, __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, 1016, __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, 1115, __pyx_L11_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -27965,7 +29204,7 @@ 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, 1016, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1115, __pyx_L11_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -27975,7 +29214,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1016, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1115, __pyx_L11_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -27986,35 +29225,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1016, __pyx_L11_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1115, __pyx_L11_error) } else { __pyx_t_8 = __pyx_t_4(__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, 1016, __pyx_L11_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1115, __pyx_L11_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr25__pyx_v_p, __pyx_t_8); + __Pyx_XDECREF_SET(__pyx_9genexpr28__pyx_v_p, __pyx_t_8); __pyx_t_8 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr25__pyx_v_p))) __PYX_ERR(0, 1016, __pyx_L11_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr28__pyx_v_p))) __PYX_ERR(0, 1115, __pyx_L11_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_p); __pyx_9genexpr25__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_9genexpr25__pyx_v_p); __pyx_9genexpr25__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":1017 + /* "constraint/constraints.py":1116 * # 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] # <<<<<<<<<<<<<< @@ -28022,7 +29261,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, 1017, __pyx_L27_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1116, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_v_candidates; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; @@ -28030,41 +29269,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, 1017, __pyx_L27_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1116, __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_3; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1017, __pyx_L27_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1116, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr27__pyx_v_p, __pyx_t_8); + __Pyx_XDECREF_SET(__pyx_9genexpr30__pyx_v_p, __pyx_t_8); __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_9genexpr27__pyx_v_p}; + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr30__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, 1017, __pyx_L27_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1116, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_8); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 1017, __pyx_L27_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 1116, __pyx_L27_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_p); __pyx_9genexpr27__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_9genexpr27__pyx_v_p); __pyx_9genexpr27__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":1018 + /* "constraint/constraints.py":1117 * 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) # <<<<<<<<<<<<<< @@ -28081,7 +29320,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_1 = NULL; @@ -28093,22 +29332,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1018, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1018, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1018, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1117, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 1018, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 1117, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_8 = 0; __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1002 + /* "constraint/constraints.py":1101 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -28134,16 +29373,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_9genexpr25__pyx_v_p); - __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_lo); - __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_hi); - __Pyx_XDECREF(__pyx_9genexpr27__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":1020 +/* "constraint/constraints.py":1119 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -28191,39 +29430,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, 1020, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1119, __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, 1020, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1119, __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, 1020, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1119, __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, 1020, __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, 1119, __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, 1020, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, i); __PYX_ERR(0, 1119, __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, 1020, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1119, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1020, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1119, __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, 1020, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1119, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -28258,7 +29497,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_safe_product", 0); - /* "constraint/constraints.py":1021 + /* "constraint/constraints.py":1120 * * def _safe_product(self, values): * prod = 1 # <<<<<<<<<<<<<< @@ -28268,7 +29507,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":1022 + /* "constraint/constraints.py":1121 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -28280,9 +29519,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, 1022, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1121, __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, 1022, __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, 1121, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -28290,7 +29529,7 @@ 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, 1022, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1121, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -28300,7 +29539,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1022, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1121, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -28311,13 +29550,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1022, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1121, __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, 1022, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1121, __pyx_L1_error) PyErr_Clear(); } break; @@ -28327,19 +29566,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1023 + /* "constraint/constraints.py":1122 * 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, 1023, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1022 + /* "constraint/constraints.py":1121 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -28349,7 +29588,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1024 + /* "constraint/constraints.py":1123 * for v in values: * prod *= v * return prod # <<<<<<<<<<<<<< @@ -28361,7 +29600,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = __pyx_v_prod; goto __pyx_L0; - /* "constraint/constraints.py":1020 + /* "constraint/constraints.py":1119 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -28383,7 +29622,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1026 +/* "constraint/constraints.py":1125 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -28434,50 +29673,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, 1026, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1125, __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, 1026, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1125, __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, 1026, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1125, __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, 1026, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1125, __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, 1026, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1125, __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, 1026, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1125, __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, 1026, __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, 1125, __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, 1026, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1125, __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, 1026, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1125, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1026, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1125, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1026, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1125, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1026, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1125, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1026, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1125, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -28487,7 +29726,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, 1026, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1125, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -28498,9 +29737,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, 1026, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1026, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1026, __pyx_L1_error) + 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_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1125, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1125, __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 */ @@ -28548,7 +29787,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1027 + /* "constraint/constraints.py":1126 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -28556,9 +29795,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, 1027, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1126, __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, 1027, __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, 1126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -28578,27 +29817,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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_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, 1027, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1028 + /* "constraint/constraints.py":1127 * 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, 1028, __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, 1127, __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, 1028, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1127, __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":1029 + /* "constraint/constraints.py":1128 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * target_dom = domains[self.target_var] * t_min = min(target_dom) # <<<<<<<<<<<<<< @@ -28614,29 +29853,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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_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, 1029, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_t_min = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/constraints.py":1031 + /* "constraint/constraints.py":1130 * 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, 1031, __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, 1130, __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_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, 1031, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1130, __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, 1031, __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, 1130, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -28645,7 +29884,7 @@ 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, 1031, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1130, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -28655,7 +29894,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1031, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1130, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -28666,13 +29905,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1031, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1130, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_7(__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, 1031, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1130, __pyx_L1_error) PyErr_Clear(); } break; @@ -28682,7 +29921,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1032 + /* "constraint/constraints.py":1131 * * for var in self.product_vars: * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) # <<<<<<<<<<<<<< @@ -28694,13 +29933,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1032, __pyx_L1_error) + __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1131, __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, 1032, __pyx_L1_error) + 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, 1131, __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; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1032, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { @@ -28709,7 +29948,7 @@ 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, 1032, __pyx_L1_error) + __PYX_ERR(0, 1131, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -28719,22 +29958,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1032, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1032, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #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, 1032, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1131, __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); @@ -28742,7 +29981,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1032, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 1131, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -28750,7 +29989,7 @@ 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, 1032, __pyx_L1_error) + __PYX_ERR(0, 1131, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_min_others, __pyx_t_3); @@ -28758,35 +29997,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_max_others, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1033 + /* "constraint/constraints.py":1132 * 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, 1033, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1034 + /* "constraint/constraints.py":1133 * 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, 1034, __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, 1133, __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_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, 1034, __pyx_L1_error) + __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __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, 1034, __pyx_L1_error) + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1133, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -28795,7 +30034,7 @@ 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, 1034, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1133, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -28805,7 +30044,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1034, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1133, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -28816,13 +30055,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_10; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1034, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1133, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_11(__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, 1034, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1133, __pyx_L1_error) PyErr_Clear(); } break; @@ -28832,29 +30071,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1035 + /* "constraint/constraints.py":1134 * 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, 1035, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_v_val, __pyx_v_min_others); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1134, __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, 1035, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_val, __pyx_v_max_others); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1035, __pyx_L1_error) + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1134, __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, 1035, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 1134, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1035, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1134, __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":1036 + /* "constraint/constraints.py":1135 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if max(possible_prods) < t_min: # <<<<<<<<<<<<<< @@ -28870,16 +30109,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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_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, 1036, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1135, __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, 1036, __pyx_L1_error) + __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, 1135, __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, 1036, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_12) { - /* "constraint/constraints.py":1037 + /* "constraint/constraints.py":1136 * possible_prods = [val * min_others, val * max_others] * if max(possible_prods) < t_min: * dom.remove(val) # <<<<<<<<<<<<<< @@ -28893,12 +30132,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1036 + /* "constraint/constraints.py":1135 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if max(possible_prods) < t_min: # <<<<<<<<<<<<<< @@ -28907,7 +30146,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1034 + /* "constraint/constraints.py":1133 * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) * dom = domains[var] * for val in dom[:]: # <<<<<<<<<<<<<< @@ -28917,7 +30156,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1031 + /* "constraint/constraints.py":1130 * t_min = min(target_dom) * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -28927,7 +30166,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1026 + /* "constraint/constraints.py":1125 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -28960,7 +30199,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1039 +/* "constraint/constraints.py":1138 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -29011,53 +30250,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, 1039, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1138, __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, 1039, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1138, __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, 1039, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1138, __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, 1039, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1138, __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, 1039, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1138, __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, 1039, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1138, __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, 1039, __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, 1138, __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, 1039, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1138, __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, 1039, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1138, __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, 1039, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1138, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1039, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1138, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1039, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1138, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1039, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1138, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -29071,7 +30310,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, 1039, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1138, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -29082,8 +30321,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, 1039, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1138, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1138, __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 */ @@ -29102,9 +30341,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint_8__call___2generator13(__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":1075 +/* "constraint/constraints.py":1174 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p < target_value for p in prods): # <<<<<<<<<<<<<< @@ -29113,29 +30352,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_18_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_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_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_18_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, 1075, __pyx_L1_error) + __PYX_ERR(0, 1174, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___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___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_VariableMinProdConstraint___call, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 1075, __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, 1174, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -29151,9 +30390,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint_8__call___2generator13(__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_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_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; @@ -29172,29 +30411,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1075, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1075, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1174, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1174, __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, 1075, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1174, __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, 1075, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __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, 1075, __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, 1075, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1075, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_target_value)) { __Pyx_RaiseClosureNameError("target_value"); __PYX_ERR(0, 1174, __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, 1174, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = (!__pyx_t_4); if (__pyx_t_5) { @@ -29234,7 +30473,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1039 +/* "constraint/constraints.py":1138 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -29243,7 +30482,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_17___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; @@ -29256,18 +30495,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_9genexpr28__pyx_v_v = NULL; - PyObject *__pyx_9genexpr29__pyx_v_p = NULL; - PyObject *__pyx_9genexpr30__pyx_v_lo = NULL; - PyObject *__pyx_9genexpr30__pyx_v_hi = NULL; - PyObject *__pyx_9genexpr31__pyx_v_c = NULL; - PyObject *__pyx_9genexpr32__pyx_v_v = NULL; - PyObject *__pyx_9genexpr33__pyx_v_v = NULL; - PyObject *__pyx_9genexpr34__pyx_v_p = NULL; - PyObject *__pyx_9genexpr35__pyx_v_lo = NULL; - PyObject *__pyx_9genexpr35__pyx_v_hi = NULL; - PyObject *__pyx_9genexpr36__pyx_v_o = NULL; - PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint_8__call___2generator13 = 0; + PyObject *__pyx_9genexpr31__pyx_v_v = NULL; + 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; @@ -29292,29 +30531,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_17___call__ *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_17___call__(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17___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_17___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, 1039, __pyx_L1_error) + __PYX_ERR(0, 1138, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/constraints.py":1040 + /* "constraint/constraints.py":1139 * * 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, 1040, __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, 1139, __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, 1040, __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, 1139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":1041 + /* "constraint/constraints.py":1140 * 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 # <<<<<<<<<<<<<< @@ -29326,7 +30565,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1040 + /* "constraint/constraints.py":1139 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -29335,23 +30574,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1043 + /* "constraint/constraints.py":1142 * 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, 1043, __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, 1142, __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, 1043, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1142, __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":1044 + /* "constraint/constraints.py":1143 * * target_value = assignments[self.target_var] * assigned_prod = 1 # <<<<<<<<<<<<<< @@ -29361,35 +30600,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":1045 + /* "constraint/constraints.py":1144 * 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, 1045, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_unassigned = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1047 + /* "constraint/constraints.py":1146 * 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, 1047, __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, 1146, __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, 1047, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1146, __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, 1047, __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, 1146, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -29398,7 +30637,7 @@ 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, 1047, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1146, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -29408,7 +30647,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1047, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1146, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -29419,13 +30658,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1047, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1146, __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, 1047, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1146, __pyx_L1_error) PyErr_Clear(); } break; @@ -29435,32 +30674,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1048 + /* "constraint/constraints.py":1147 * * 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, 1048, __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, 1147, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":1049 + /* "constraint/constraints.py":1148 * 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, 1049, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1148, __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, 1049, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_assigned_prod, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1148, __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":1048 + /* "constraint/constraints.py":1147 * * for var in self.product_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -29470,7 +30709,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint goto __pyx_L6; } - /* "constraint/constraints.py":1051 + /* "constraint/constraints.py":1150 * assigned_prod *= assignments[var] * else: * unassigned.append(var) # <<<<<<<<<<<<<< @@ -29478,11 +30717,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, 1051, __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, 1150, __pyx_L1_error) } __pyx_L6:; - /* "constraint/constraints.py":1047 + /* "constraint/constraints.py":1146 * unassigned = [] * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -29492,7 +30731,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1053 + /* "constraint/constraints.py":1152 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< @@ -29500,11 +30739,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * */ __pyx_t_2 = (__Pyx_PyList_GET_SIZE(__pyx_v_unassigned) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 1053, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 1152, __pyx_L1_error) __pyx_t_8 = (!__pyx_t_2); if (__pyx_t_8) { - /* "constraint/constraints.py":1054 + /* "constraint/constraints.py":1153 * * if not unassigned: * return assigned_prod >= target_value # <<<<<<<<<<<<<< @@ -29512,12 +30751,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, 1054, __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, 1153, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1053 + /* "constraint/constraints.py":1152 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< @@ -29526,7 +30765,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1057 + /* "constraint/constraints.py":1156 * * # Estimate min possible value of full product * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned] # <<<<<<<<<<<<<< @@ -29534,7 +30773,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, 1057, __pyx_L11_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1156, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0; @@ -29542,20 +30781,20 @@ 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, 1057, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1156, __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_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1057, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1156, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_9genexpr28__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_9genexpr28__pyx_v_v); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1057, __pyx_L11_error) + __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr31__pyx_v_v); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1156, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = 1; { @@ -29564,13 +30803,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1057, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1156, __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_9genexpr28__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1057, __pyx_L11_error) + __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr31__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1156, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_12 = 1; { @@ -29579,32 +30818,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1057, __pyx_L11_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1156, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); } - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1057, __pyx_L11_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1156, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1057, __pyx_L11_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1156, __pyx_L11_error); __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1057, __pyx_L11_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1156, __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, 1057, __pyx_L11_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1156, __pyx_L11_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_v); __pyx_9genexpr28__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_9genexpr28__pyx_v_v); __pyx_9genexpr28__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":1058 + /* "constraint/constraints.py":1157 * # 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])] # <<<<<<<<<<<<<< @@ -29612,12 +30851,12 @@ 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, 1058, __pyx_L18_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1157, __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, 1058, __pyx_L18_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1157, __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, 1058, __pyx_L23_error) + __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1157, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __pyx_v_domain_bounds; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; @@ -29625,13 +30864,13 @@ 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, 1058, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1157, __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_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1058, __pyx_L23_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1157, __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; @@ -29639,7 +30878,7 @@ 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, 1058, __pyx_L23_error) + __PYX_ERR(0, 1157, __pyx_L23_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -29649,22 +30888,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_INCREF(__pyx_t_11); } else { __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1058, __pyx_L23_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1157, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_13); __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1058, __pyx_L23_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1157, __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, 1058, __pyx_L23_error) + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1157, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1058, __pyx_L23_error) + __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1157, __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, 1058, __pyx_L23_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1157, __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); @@ -29672,7 +30911,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1058, __pyx_L23_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 1157, __pyx_L23_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L27_unpacking_done; @@ -29680,38 +30919,38 @@ 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, 1058, __pyx_L23_error) + __PYX_ERR(0, 1157, __pyx_L23_error) __pyx_L27_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr30__pyx_v_lo, __pyx_t_13); + __Pyx_XDECREF_SET(__pyx_9genexpr33__pyx_v_lo, __pyx_t_13); __pyx_t_13 = 0; - __Pyx_XDECREF_SET(__pyx_9genexpr30__pyx_v_hi, __pyx_t_11); + __Pyx_XDECREF_SET(__pyx_9genexpr33__pyx_v_hi, __pyx_t_11); __pyx_t_11 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1058, __pyx_L23_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1157, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_9genexpr30__pyx_v_lo); - __Pyx_GIVEREF(__pyx_9genexpr30__pyx_v_lo); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_9genexpr30__pyx_v_lo) != (0)) __PYX_ERR(0, 1058, __pyx_L23_error); - __Pyx_INCREF(__pyx_9genexpr30__pyx_v_hi); - __Pyx_GIVEREF(__pyx_9genexpr30__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_9genexpr30__pyx_v_hi) != (0)) __PYX_ERR(0, 1058, __pyx_L23_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1058, __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, 1157, __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, 1157, __pyx_L23_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1157, __pyx_L23_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_hi); __pyx_9genexpr30__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_lo); __pyx_9genexpr30__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_9genexpr30__pyx_v_hi); __pyx_9genexpr30__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_lo); __pyx_9genexpr30__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, 1058, __pyx_L18_error) + __pyx_t_10 = PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1157, __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, 1058, __pyx_L18_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1157, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -29720,9 +30959,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1058, __pyx_L18_error) + __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1157, __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, 1058, __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, 1157, __pyx_L18_error) } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; for (;;) { @@ -29731,7 +30970,7 @@ 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, 1058, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1157, __pyx_L18_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -29741,7 +30980,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1058, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1157, __pyx_L18_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -29752,46 +30991,46 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1058, __pyx_L18_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1157, __pyx_L18_error) } else { __pyx_t_9 = __pyx_t_5(__pyx_t_10); 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, 1058, __pyx_L18_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1157, __pyx_L18_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_9genexpr29__pyx_v_p, __pyx_t_9); + __Pyx_XDECREF_SET(__pyx_9genexpr32__pyx_v_p, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_6 = __pyx_v_self; __Pyx_INCREF(__pyx_t_6); __pyx_t_12 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_9genexpr29__pyx_v_p}; + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_9genexpr32__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)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1058, __pyx_L18_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1157, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_9); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1058, __pyx_L18_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1157, __pyx_L18_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_p); __pyx_9genexpr29__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_9genexpr29__pyx_v_p); __pyx_9genexpr29__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":1059 + /* "constraint/constraints.py":1158 * 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] # <<<<<<<<<<<<<< @@ -29799,7 +31038,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, 1059, __pyx_L34_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1158, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __pyx_v_candidates; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; @@ -29807,33 +31046,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, 1059, __pyx_L34_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1158, __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_4; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1059, __pyx_L34_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1158, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_9genexpr31__pyx_v_c, __pyx_t_9); + __Pyx_XDECREF_SET(__pyx_9genexpr34__pyx_v_c, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Multiply(__pyx_v_assigned_prod, __pyx_9genexpr31__pyx_v_c); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1059, __pyx_L34_error) + __pyx_t_9 = PyNumber_Multiply(__pyx_v_assigned_prod, __pyx_9genexpr34__pyx_v_c); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1158, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_9); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1059, __pyx_L34_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1158, __pyx_L34_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_c); __pyx_9genexpr31__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_9genexpr31__pyx_v_c); __pyx_9genexpr31__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":1060 + /* "constraint/constraints.py":1159 * 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: # <<<<<<<<<<<<<< @@ -29849,16 +31088,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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_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, 1060, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1159, __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, 1060, __pyx_L1_error) + __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, 1159, __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, 1060, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_8) { - /* "constraint/constraints.py":1061 + /* "constraint/constraints.py":1160 * possible_prods = [assigned_prod * c for c in candidates] * if max(possible_prods) < target_value: * return False # <<<<<<<<<<<<<< @@ -29870,7 +31109,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1060 + /* "constraint/constraints.py":1159 * 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: # <<<<<<<<<<<<<< @@ -29879,17 +31118,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1063 + /* "constraint/constraints.py":1162 * 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, 1063, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1162, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1064 + /* "constraint/constraints.py":1163 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< @@ -29902,18 +31141,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1064, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1163, __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_4; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1064, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1065 + /* "constraint/constraints.py":1164 * if forwardcheck: * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] # <<<<<<<<<<<<<< @@ -29921,7 +31160,7 @@ 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, 1065, __pyx_L45_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1164, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_10); __pyx_t_16 = 0; @@ -29929,35 +31168,35 @@ 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, 1065, __pyx_L45_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1164, __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_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1065, __pyx_L45_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1164, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr32__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_9genexpr32__pyx_v_v, __pyx_v_var, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1065, __pyx_L45_error) - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1065, __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, 1164, __pyx_L45_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1164, __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_9genexpr32__pyx_v_v))) __PYX_ERR(0, 1065, __pyx_L45_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr35__pyx_v_v))) __PYX_ERR(0, 1164, __pyx_L45_error) } } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_v); __pyx_9genexpr32__pyx_v_v = 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_9genexpr32__pyx_v_v); __pyx_9genexpr32__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":1066 + /* "constraint/constraints.py":1165 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< @@ -29965,10 +31204,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * 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, 1066, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_8 < 0))) __PYX_ERR(0, 1165, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1067 + /* "constraint/constraints.py":1166 * 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] # <<<<<<<<<<<<<< @@ -29976,7 +31215,7 @@ 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, 1067, __pyx_L54_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1166, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __pyx_v_other_unassigned; __Pyx_INCREF(__pyx_t_10); __pyx_t_16 = 0; @@ -29984,20 +31223,20 @@ 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, 1067, __pyx_L54_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1166, __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_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1067, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1166, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr33__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_9genexpr33__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1067, __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, 1166, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_12 = 1; { @@ -30006,13 +31245,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1067, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1166, __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_9genexpr33__pyx_v_v); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1067, __pyx_L54_error) + __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr36__pyx_v_v); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1166, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_12 = 1; { @@ -30021,32 +31260,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1067, __pyx_L54_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1166, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1067, __pyx_L54_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1166, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1067, __pyx_L54_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1166, __pyx_L54_error); __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 1067, __pyx_L54_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 1166, __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, 1067, __pyx_L54_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1166, __pyx_L54_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_v); __pyx_9genexpr33__pyx_v_v = 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_9genexpr33__pyx_v_v); __pyx_9genexpr33__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":1068 + /* "constraint/constraints.py":1167 * 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])] # <<<<<<<<<<<<<< @@ -30054,12 +31293,12 @@ 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, 1068, __pyx_L61_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1167, __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, 1068, __pyx_L61_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1167, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_10); { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L66_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1167, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = __pyx_v_bounds; __Pyx_INCREF(__pyx_t_11); __pyx_t_16 = 0; @@ -30067,13 +31306,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1068, __pyx_L66_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1167, __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_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1068, __pyx_L66_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1167, __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; @@ -30081,7 +31320,7 @@ 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, 1068, __pyx_L66_error) + __PYX_ERR(0, 1167, __pyx_L66_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -30091,22 +31330,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_INCREF(__pyx_t_13); } else { __pyx_t_14 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1068, __pyx_L66_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1167, __pyx_L66_error) __Pyx_XGOTREF(__pyx_t_14); __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1068, __pyx_L66_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1167, __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, 1068, __pyx_L66_error) + __pyx_t_14 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1167, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1068, __pyx_L66_error) + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1167, __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, 1068, __pyx_L66_error) + __pyx_t_17 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1167, __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); @@ -30114,7 +31353,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1068, __pyx_L66_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_17), 2) < 0) __PYX_ERR(0, 1167, __pyx_L66_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; goto __pyx_L70_unpacking_done; @@ -30122,38 +31361,38 @@ 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, 1068, __pyx_L66_error) + __PYX_ERR(0, 1167, __pyx_L66_error) __pyx_L70_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr35__pyx_v_lo, __pyx_t_14); + __Pyx_XDECREF_SET(__pyx_9genexpr38__pyx_v_lo, __pyx_t_14); __pyx_t_14 = 0; - __Pyx_XDECREF_SET(__pyx_9genexpr35__pyx_v_hi, __pyx_t_13); + __Pyx_XDECREF_SET(__pyx_9genexpr38__pyx_v_hi, __pyx_t_13); __pyx_t_13 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1068, __pyx_L66_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1167, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_9genexpr35__pyx_v_lo); - __Pyx_GIVEREF(__pyx_9genexpr35__pyx_v_lo); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_9genexpr35__pyx_v_lo) != (0)) __PYX_ERR(0, 1068, __pyx_L66_error); - __Pyx_INCREF(__pyx_9genexpr35__pyx_v_hi); - __Pyx_GIVEREF(__pyx_9genexpr35__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_9genexpr35__pyx_v_hi) != (0)) __PYX_ERR(0, 1068, __pyx_L66_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1068, __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, 1167, __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, 1167, __pyx_L66_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1167, __pyx_L66_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_hi); __pyx_9genexpr35__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_lo); __pyx_9genexpr35__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_L72_exit_scope; __pyx_L66_error:; - __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_hi); __pyx_9genexpr35__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_lo); __pyx_9genexpr35__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, 1068, __pyx_L61_error) + __pyx_t_11 = PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1167, __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, 1068, __pyx_L61_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1167, __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; @@ -30162,9 +31401,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1068, __pyx_L61_error) + __pyx_t_16 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1167, __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, 1068, __pyx_L61_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, 1167, __pyx_L61_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -30173,7 +31412,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1068, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1167, __pyx_L61_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -30183,7 +31422,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1068, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1167, __pyx_L61_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -30194,46 +31433,46 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L61_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1167, __pyx_L61_error) } else { __pyx_t_3 = __pyx_t_5(__pyx_t_11); 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, 1068, __pyx_L61_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1167, __pyx_L61_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_9genexpr34__pyx_v_p, __pyx_t_3); + __Pyx_XDECREF_SET(__pyx_9genexpr37__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; { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr34__pyx_v_p}; + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr37__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, 1068, __pyx_L61_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1167, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_3); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1068, __pyx_L61_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1167, __pyx_L61_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_p); __pyx_9genexpr34__pyx_v_p = 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_9genexpr34__pyx_v_p); __pyx_9genexpr34__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":1066 + /* "constraint/constraints.py":1165 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< @@ -30243,7 +31482,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint goto __pyx_L51; } - /* "constraint/constraints.py":1070 + /* "constraint/constraints.py":1169 * other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in bounds])] * else: * other_products = [1] # <<<<<<<<<<<<<< @@ -30251,45 +31490,45 @@ 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, 1070, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1169, __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, 1070, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 1169, __pyx_L1_error); __Pyx_XDECREF_SET(__pyx_v_other_products, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; } __pyx_L51:; - /* "constraint/constraints.py":1072 + /* "constraint/constraints.py":1171 * 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, 1072, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1073 + /* "constraint/constraints.py":1172 * * 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, 1073, __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, 1172, __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_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, 1073, __pyx_L1_error) + __pyx_t_16 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1172, __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, 1073, __pyx_L1_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, 1172, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -30298,7 +31537,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1073, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1172, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -30308,7 +31547,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1073, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1172, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -30319,13 +31558,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1073, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_5(__pyx_t_11); 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, 1073, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1172, __pyx_L1_error) PyErr_Clear(); } break; @@ -30335,7 +31574,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1074 + /* "constraint/constraints.py":1173 * domain = domains[var] * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] # <<<<<<<<<<<<<< @@ -30343,7 +31582,7 @@ 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, 1074, __pyx_L79_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_v_other_products; __Pyx_INCREF(__pyx_t_3); __pyx_t_18 = 0; @@ -30351,52 +31590,52 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1074, __pyx_L79_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1173, __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_18; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1074, __pyx_L79_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1173, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_XDECREF_SET(__pyx_9genexpr36__pyx_v_o, __pyx_t_10); + __Pyx_XDECREF_SET(__pyx_9genexpr39__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, 1074, __pyx_L79_error) + __pyx_t_10 = PyNumber_Multiply(__pyx_v_assigned_prod, __pyx_v_val); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1173, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = PyNumber_Multiply(__pyx_t_10, __pyx_9genexpr36__pyx_v_o); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1074, __pyx_L79_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_10, __pyx_9genexpr39__pyx_v_o); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1173, __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, 1074, __pyx_L79_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1173, __pyx_L79_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_o); __pyx_9genexpr36__pyx_v_o = 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_9genexpr36__pyx_v_o); __pyx_9genexpr36__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":1075 + /* "constraint/constraints.py":1174 * 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, 1075, __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, 1174, __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, 1075, __pyx_L1_error) + __pyx_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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, 1075, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { - /* "constraint/constraints.py":1076 + /* "constraint/constraints.py":1175 * prods = [assigned_prod * val * o for o in other_products] * if all(p < target_value for p in prods): * domain.hideValue(val) # <<<<<<<<<<<<<< @@ -30410,12 +31649,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint 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_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1076, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1075 + /* "constraint/constraints.py":1174 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p < target_value for p in prods): # <<<<<<<<<<<<<< @@ -30424,7 +31663,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1073 + /* "constraint/constraints.py":1172 * * domain = domains[var] * for val in domain[:]: # <<<<<<<<<<<<<< @@ -30434,18 +31673,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "constraint/constraints.py":1077 + /* "constraint/constraints.py":1176 * 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, 1077, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1176, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_8); if (__pyx_t_2) { - /* "constraint/constraints.py":1078 + /* "constraint/constraints.py":1177 * domain.hideValue(val) * if not domain: * return False # <<<<<<<<<<<<<< @@ -30458,7 +31697,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1077 + /* "constraint/constraints.py":1176 * if all(p < target_value for p in prods): * domain.hideValue(val) * if not domain: # <<<<<<<<<<<<<< @@ -30467,7 +31706,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1064 + /* "constraint/constraints.py":1163 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< @@ -30477,7 +31716,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":1063 + /* "constraint/constraints.py":1162 * return False * * if forwardcheck: # <<<<<<<<<<<<<< @@ -30486,7 +31725,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1080 + /* "constraint/constraints.py":1179 * return False * * return True # <<<<<<<<<<<<<< @@ -30498,7 +31737,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1039 + /* "constraint/constraints.py":1138 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -30532,25 +31771,25 @@ 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_9genexpr28__pyx_v_v); - __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_p); - __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_lo); - __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_hi); - __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_c); - __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_v); - __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_v); - __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_p); - __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_lo); - __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_hi); - __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_o); - __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint_8__call___2generator13); + __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_v); + __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":1094 +/* "constraint/constraints.py":1198 * """ * * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -30599,39 +31838,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, 1094, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1198, __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, 1094, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1198, __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, 1094, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1198, __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, 1094, __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, 1198, __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, 1094, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1198, __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, 1094, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1198, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1094, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1198, __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, 1094, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1198, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -30661,28 +31900,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1100 + /* "constraint/constraints.py":1204 * 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, 1100, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxprod_2, __pyx_v_maxprod) < 0) __PYX_ERR(0, 1204, __pyx_L1_error) - /* "constraint/constraints.py":1101 + /* "constraint/constraints.py":1205 * """ * self._maxprod = maxprod * self._variable_contains_lt1: list[bool] = list() # <<<<<<<<<<<<<< * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 */ - __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, 1205, __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, 1205, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1094 + /* "constraint/constraints.py":1198 * """ * * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -30703,7 +31942,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ return __pyx_r; } -/* "constraint/constraints.py":1103 +/* "constraint/constraints.py":1207 * self._variable_contains_lt1: list[bool] = list() * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -30754,50 +31993,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, 1103, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1207, __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, 1103, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1207, __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, 1103, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1207, __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, 1103, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1207, __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, 1103, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1207, __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, 1103, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1207, __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, 1103, __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, 1207, __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, 1103, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1207, __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, 1103, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1207, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1103, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1207, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1103, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1207, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1103, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1207, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1103, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1207, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -30807,7 +32046,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, 1103, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1207, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -30818,9 +32057,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, 1103, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1103, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1103, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1207, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1207, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1207, __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 */ @@ -30839,9 +32078,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator14(__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":1110 +/* "constraint/constraints.py":1214 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -30850,18 +32089,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_19_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_19_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_19_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19_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_19_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, 1110, __pyx_L1_error) + __PYX_ERR(0, 1214, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -30869,7 +32108,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_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_MaxProdConstraint_preProcess_loc, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 1110, __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, 1214, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -30885,9 +32124,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_10prePr return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator14(__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_19_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_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; @@ -30906,16 +32145,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1110, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1110, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1214, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1214, __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, 1110, __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, 1214, __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, 1110, __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, 1214, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -30923,7 +32162,7 @@ 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, 1110, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1214, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -30933,7 +32172,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr { 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, 1110, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1214, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -30944,13 +32183,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1110, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1214, __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, 1110, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1214, __pyx_L1_error) PyErr_Clear(); } break; @@ -30961,8 +32200,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, 1110, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1110, __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, 1214, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1214, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_XDECREF(__pyx_r); @@ -31001,7 +32240,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr return __pyx_r; } -/* "constraint/constraints.py":1103 +/* "constraint/constraints.py":1207 * self._variable_contains_lt1: list[bool] = list() * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -31016,7 +32255,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_2generator14 = 0; + PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator12 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -31038,7 +32277,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1104 + /* "constraint/constraints.py":1208 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -31046,9 +32285,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, 1104, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1208, __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, 1104, __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, 1208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -31068,24 +32307,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __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_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, 1104, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1107 + /* "constraint/constraints.py":1211 * * # 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, 1107, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __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, 1107, __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, 1211, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1108 + /* "constraint/constraints.py":1212 * # check if there are any values less than 1 in the associated variables * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None # <<<<<<<<<<<<<< @@ -31095,7 +32334,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_INCREF(Py_None); __pyx_v_variable_with_lt1 = Py_None; - /* "constraint/constraints.py":1109 + /* "constraint/constraints.py":1213 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -31107,9 +32346,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, 1109, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __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, 1109, __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, 1213, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -31117,7 +32356,7 @@ 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, 1109, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1213, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -31127,7 +32366,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 1109, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1213, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -31138,13 +32377,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1109, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1213, __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, 1109, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1213, __pyx_L1_error) PyErr_Clear(); } break; @@ -31154,37 +32393,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":1110 + /* "constraint/constraints.py":1214 * 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, 1110, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1214, __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, 1110, __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, 1214, __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, 1110, __pyx_L1_error) + __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1214, __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":1111 + /* "constraint/constraints.py":1215 * 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, 1111, __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, 1215, __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, 1111, __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, 1215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1109 + /* "constraint/constraints.py":1213 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -31194,7 +32433,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1112 + /* "constraint/constraints.py":1216 * 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): # <<<<<<<<<<<<<< @@ -31204,7 +32443,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __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, 1112, __pyx_L1_error) + __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, 1216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; { @@ -31213,7 +32452,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __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, 1112, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -31221,9 +32460,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, 1112, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1216, __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, 1112, __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, 1216, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -31232,7 +32471,7 @@ 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, 1112, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1216, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -31242,7 +32481,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 1112, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1216, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -31253,13 +32492,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1112, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1216, __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, 1112, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1216, __pyx_L1_error) PyErr_Clear(); } break; @@ -31272,7 +32511,7 @@ 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, 1112, __pyx_L1_error) + __PYX_ERR(0, 1216, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -31282,22 +32521,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1216, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1112, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1216, __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, 1112, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1112, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1216, __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, 1112, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1216, __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); @@ -31305,7 +32544,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __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; __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1112, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1216, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_unpacking_done; @@ -31313,7 +32552,7 @@ 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, 1112, __pyx_L1_error) + __PYX_ERR(0, 1216, __pyx_L1_error) __pyx_L9_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); @@ -31321,7 +32560,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1113 + /* "constraint/constraints.py":1217 * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: # <<<<<<<<<<<<<< @@ -31331,7 +32570,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":1114 + /* "constraint/constraints.py":1218 * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< @@ -31341,7 +32580,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":1116 + /* "constraint/constraints.py":1220 * if variable_with_lt1 is not None: * # if more than one associated variables contain less than 1, we can't prune * return # <<<<<<<<<<<<<< @@ -31353,7 +32592,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1114 + /* "constraint/constraints.py":1218 * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< @@ -31362,7 +32601,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":1117 + /* "constraint/constraints.py":1221 * # if more than one associated variables contain less than 1, we can't prune * return * variable_with_lt1 = variable # <<<<<<<<<<<<<< @@ -31372,7 +32611,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":1113 + /* "constraint/constraints.py":1217 * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: # <<<<<<<<<<<<<< @@ -31381,7 +32620,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":1112 + /* "constraint/constraints.py":1216 * 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): # <<<<<<<<<<<<<< @@ -31391,19 +32630,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1120 + /* "constraint/constraints.py":1224 * * # 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, 1120, __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, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_maxprod = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/constraints.py":1121 + /* "constraint/constraints.py":1225 * # prune the associated variables of values > maxprod * maxprod = self._maxprod * for variable in variables: # <<<<<<<<<<<<<< @@ -31415,9 +32654,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, 1121, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1225, __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, 1121, __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, 1225, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -31425,7 +32664,7 @@ 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, 1121, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1225, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -31435,7 +32674,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 1121, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1225, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -31446,13 +32685,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1121, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1225, __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, 1121, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1225, __pyx_L1_error) PyErr_Clear(); } break; @@ -31462,7 +32701,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":1122 + /* "constraint/constraints.py":1226 * maxprod = self._maxprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -31475,14 +32714,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, 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_variable_with_lt1, __pyx_v_variable, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1226, __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":1123 + /* "constraint/constraints.py":1227 * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: * continue # <<<<<<<<<<<<<< @@ -31491,7 +32730,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ goto __pyx_L13_continue; - /* "constraint/constraints.py":1122 + /* "constraint/constraints.py":1226 * maxprod = self._maxprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -31500,35 +32739,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":1124 + /* "constraint/constraints.py":1228 * 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, 1124, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1125 + /* "constraint/constraints.py":1229 * 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, 1125, __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, 1229, __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_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, 1125, __pyx_L1_error) + __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1229, __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, 1125, __pyx_L1_error) + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1229, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -31537,7 +32776,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 1125, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1229, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -31547,7 +32786,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 1125, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1229, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -31558,13 +32797,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_13; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1125, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1229, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_14(__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, 1125, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1229, __pyx_L1_error) PyErr_Clear(); } break; @@ -31574,19 +32813,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1126 + /* "constraint/constraints.py":1230 * 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, 1126, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1126, __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, 1230, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { - /* "constraint/constraints.py":1127 + /* "constraint/constraints.py":1231 * for value in domain[:]: * if value > maxprod: * domain.remove(value) # <<<<<<<<<<<<<< @@ -31600,12 +32839,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro 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, 1127, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1126 + /* "constraint/constraints.py":1230 * domain = domains[variable] * for value in domain[:]: * if value > maxprod: # <<<<<<<<<<<<<< @@ -31615,27 +32854,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro goto __pyx_L20; } - /* "constraint/constraints.py":1128 + /* "constraint/constraints.py":1232 * 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, 1128, __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, 1232, __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, 1128, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1128, __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, 1232, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1232, __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":1129 + /* "constraint/constraints.py":1233 * domain.remove(value) * elif value == 0 and maxprod < 0: * domain.remove(value) # <<<<<<<<<<<<<< @@ -31649,12 +32888,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro 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, 1129, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1128 + /* "constraint/constraints.py":1232 * if value > maxprod: * domain.remove(value) * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< @@ -31664,7 +32903,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __pyx_L20:; - /* "constraint/constraints.py":1125 + /* "constraint/constraints.py":1229 * continue * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -31674,7 +32913,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1121 + /* "constraint/constraints.py":1225 * # prune the associated variables of values > maxprod * maxprod = self._maxprod * for variable in variables: # <<<<<<<<<<<<<< @@ -31685,7 +32924,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1103 + /* "constraint/constraints.py":1207 * self._variable_contains_lt1: list[bool] = list() * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -31711,13 +32950,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_2generator14); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator12); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":1131 +/* "constraint/constraints.py":1235 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -31768,53 +33007,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, 1131, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1235, __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, 1131, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1235, __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, 1131, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1235, __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, 1131, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1235, __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, 1131, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1235, __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, 1131, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1235, __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, 1131, __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, 1235, __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, 1131, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1235, __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, 1131, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1235, __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, 1131, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1235, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1131, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1235, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1131, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1235, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1131, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1235, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -31828,7 +33067,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, 1131, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1235, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -31839,8 +33078,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, 1131, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1131, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1235, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1235, __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 */ @@ -31859,9 +33098,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call___2generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +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":1139 +/* "constraint/constraints.py":1243 * 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])) # <<<<<<<<<<<<<< @@ -31870,18 +33109,18 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call */ 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_20_genexpr *__pyx_cur_scope; + 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_20_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_20_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __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_20_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1139, __pyx_L1_error) + __PYX_ERR(0, 1243, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -31889,7 +33128,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_8__call __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___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_MaxProdConstraint___call___local, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 1139, __pyx_L1_error) + __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, 1243, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -31905,9 +33144,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_8__call return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call___2generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +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_20_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *)__pyx_generator->closure); + 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; @@ -31926,16 +33165,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1139, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1139, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1243, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1243, __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, 1139, __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, 1243, __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, 1139, __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, 1243, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -31943,7 +33182,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__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, 1139, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1243, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -31953,7 +33192,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call { 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, 1139, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1243, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -31964,13 +33203,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1139, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1243, __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, 1139, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1243, __pyx_L1_error) PyErr_Clear(); } break; @@ -31981,8 +33220,8 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call __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, 1139, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1139, __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, 1243, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_XDECREF(__pyx_r); @@ -32021,7 +33260,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call return __pyx_r; } -/* "constraint/constraints.py":1131 +/* "constraint/constraints.py":1235 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -32038,7 +33277,7 @@ 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___2generator15 = 0; + PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call___2generator13 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -32060,19 +33299,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1132 + /* "constraint/constraints.py":1236 * * 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, 1132, __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, 1236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_maxprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1133 + /* "constraint/constraints.py":1237 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * maxprod = self._maxprod * prod = 1 # <<<<<<<<<<<<<< @@ -32082,7 +33321,7 @@ 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":1134 + /* "constraint/constraints.py":1238 * maxprod = self._maxprod * prod = 1 * missing = False # <<<<<<<<<<<<<< @@ -32091,34 +33330,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ __pyx_v_missing = 0; - /* "constraint/constraints.py":1135 + /* "constraint/constraints.py":1239 * 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): */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_missing_lt1 = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1137 + /* "constraint/constraints.py":1241 * 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, 1137, __pyx_L1_error) + __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, 1241, __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, 1137, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1241, __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, 1137, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1241, __pyx_L1_error) __pyx_t_4 = (__pyx_t_2 != __pyx_t_3); if (__pyx_t_4) { - /* "constraint/constraints.py":1138 + /* "constraint/constraints.py":1242 * # find out which variables contain values less than 1 if not preprocessed * if len(self._variable_contains_lt1) != len(variables): * for variable in variables: # <<<<<<<<<<<<<< @@ -32130,9 +33369,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __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, 1138, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __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, 1138, __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, 1242, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { @@ -32140,7 +33379,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_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, 1138, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1242, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -32150,7 +33389,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 1138, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1242, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -32161,13 +33400,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1138, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __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, 1138, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1242, __pyx_L1_error) PyErr_Clear(); } break; @@ -32177,28 +33416,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1139 + /* "constraint/constraints.py":1243 * 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, 1139, __pyx_L1_error) + __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, 1243, __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, 1139, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1243, __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, 1139, __pyx_L1_error) + __pyx_t_8 = __pyx_pf_10constraint_11constraints_17MaxProdConstraint_8__call___genexpr(NULL, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1243, __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, 1139, __pyx_L1_error) + __pyx_t_7 = __Pyx_Generator_GetInlinedResult(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1243, __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, 1139, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_6, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 1243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1138 + /* "constraint/constraints.py":1242 * # find out which variables contain values less than 1 if not preprocessed * if len(self._variable_contains_lt1) != len(variables): * for variable in variables: # <<<<<<<<<<<<<< @@ -32208,7 +33447,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1137 + /* "constraint/constraints.py":1241 * missing_lt1 = [] * # find out which variables contain values less than 1 if not preprocessed * if len(self._variable_contains_lt1) != len(variables): # <<<<<<<<<<<<<< @@ -32217,7 +33456,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1140 + /* "constraint/constraints.py":1244 * 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): # <<<<<<<<<<<<<< @@ -32227,7 +33466,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_t_7 = NULL; __Pyx_INCREF(__pyx_builtin_zip); __pyx_t_6 = __pyx_builtin_zip; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1140, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = 1; { @@ -32236,7 +33475,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_XDECREF(__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_1)) __PYX_ERR(0, 1140, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -32244,9 +33483,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_t_3 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1140, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1244, __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, 1140, __pyx_L1_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1244, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -32255,7 +33494,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 1140, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1244, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -32265,7 +33504,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 1140, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1244, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -32276,13 +33515,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error) } else { __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, 1140, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1244, __pyx_L1_error) PyErr_Clear(); } break; @@ -32295,7 +33534,7 @@ 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, 1140, __pyx_L1_error) + __PYX_ERR(0, 1244, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -32305,22 +33544,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_INCREF(__pyx_t_7); } else { __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1140, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1140, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1244, __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, 1140, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1140, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1140, __pyx_L1_error) + __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); @@ -32328,7 +33567,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_GOTREF(__pyx_t_8); index = 1; __pyx_t_7 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_7)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1140, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1244, __pyx_L1_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L10_unpacking_done; @@ -32336,7 +33575,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1140, __pyx_L1_error) + __PYX_ERR(0, 1244, __pyx_L1_error) __pyx_L10_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_8); @@ -32344,32 +33583,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1141 + /* "constraint/constraints.py":1245 * 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_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1141, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1245, __pyx_L1_error) if (__pyx_t_4) { - /* "constraint/constraints.py":1142 + /* "constraint/constraints.py":1246 * 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, 1142, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1142, __pyx_L1_error) + __pyx_t_7 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1141 + /* "constraint/constraints.py":1245 * 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: # <<<<<<<<<<<<<< @@ -32379,7 +33618,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call goto __pyx_L11; } - /* "constraint/constraints.py":1144 + /* "constraint/constraints.py":1248 * prod *= assignments[variable] * else: * missing = True # <<<<<<<<<<<<<< @@ -32389,26 +33628,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call /*else*/ { __pyx_v_missing = 1; - /* "constraint/constraints.py":1145 + /* "constraint/constraints.py":1249 * else: * missing = True * if contains_lt1: # <<<<<<<<<<<<<< * missing_lt1.append(variable) * if isinstance(prod, float): */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_contains_lt1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1145, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_contains_lt1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1249, __pyx_L1_error) if (__pyx_t_4) { - /* "constraint/constraints.py":1146 + /* "constraint/constraints.py":1250 * missing = True * if contains_lt1: * missing_lt1.append(variable) # <<<<<<<<<<<<<< * if isinstance(prod, float): * prod = round(prod, 10) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_missing_lt1, __pyx_v_variable); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 1146, __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, 1250, __pyx_L1_error) - /* "constraint/constraints.py":1145 + /* "constraint/constraints.py":1249 * else: * missing = True * if contains_lt1: # <<<<<<<<<<<<<< @@ -32419,7 +33658,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } __pyx_L11:; - /* "constraint/constraints.py":1140 + /* "constraint/constraints.py":1244 * 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): # <<<<<<<<<<<<<< @@ -32429,7 +33668,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1147 + /* "constraint/constraints.py":1251 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -32439,7 +33678,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_t_4 = PyFloat_Check(__pyx_v_prod); if (__pyx_t_4) { - /* "constraint/constraints.py":1148 + /* "constraint/constraints.py":1252 * missing_lt1.append(variable) * if isinstance(prod, float): * prod = round(prod, 10) # <<<<<<<<<<<<<< @@ -32455,13 +33694,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __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_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1148, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1147 + /* "constraint/constraints.py":1251 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -32470,7 +33709,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1149 + /* "constraint/constraints.py":1253 * if isinstance(prod, float): * prod = round(prod, 10) * if (not missing or len(missing_lt1) == 0) and prod > maxprod: # <<<<<<<<<<<<<< @@ -32482,7 +33721,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } else { goto __pyx_L17_next_and; } - __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1149, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1253, __pyx_L1_error) __pyx_t_13 = (__pyx_t_3 == 0); if (__pyx_t_13) { } else { @@ -32490,14 +33729,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call goto __pyx_L16_bool_binop_done; } __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, 1149, __pyx_L1_error) - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1149, __pyx_L1_error) + __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, 1253, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1253, __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":1150 + /* "constraint/constraints.py":1254 * prod = round(prod, 10) * if (not missing or len(missing_lt1) == 0) and prod > maxprod: * return False # <<<<<<<<<<<<<< @@ -32509,7 +33748,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1149 + /* "constraint/constraints.py":1253 * if isinstance(prod, float): * prod = round(prod, 10) * if (not missing or len(missing_lt1) == 0) and prod > maxprod: # <<<<<<<<<<<<<< @@ -32518,17 +33757,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1151 + /* "constraint/constraints.py":1255 * 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_4 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1151, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1255, __pyx_L1_error) if (__pyx_t_4) { - /* "constraint/constraints.py":1152 + /* "constraint/constraints.py":1256 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -32540,9 +33779,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_t_3 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1152, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1256, __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, 1152, __pyx_L1_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1256, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { @@ -32550,7 +33789,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 1152, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1256, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -32560,7 +33799,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 1152, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1256, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -32571,13 +33810,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1152, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1256, __pyx_L1_error) } else { __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, 1152, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1256, __pyx_L1_error) PyErr_Clear(); } break; @@ -32587,60 +33826,60 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1153 + /* "constraint/constraints.py":1257 * 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_13 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_13 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1257, __pyx_L1_error) if (__pyx_t_13) { } else { __pyx_t_4 = __pyx_t_13; goto __pyx_L23_bool_binop_done; } - __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable, __pyx_v_missing_lt1, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable, __pyx_v_missing_lt1, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1257, __pyx_L1_error) if (!__pyx_t_13) { } else { __pyx_t_4 = __pyx_t_13; goto __pyx_L23_bool_binop_done; } - __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1257, __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":1154 + /* "constraint/constraints.py":1258 * 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, 1154, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1155 + /* "constraint/constraints.py":1259 * 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, 1155, __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, 1259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); __pyx_t_2 = 0; __pyx_t_14 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1155, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1155, __pyx_L1_error) + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1259, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -32649,7 +33888,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__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, 1155, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1259, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -32659,7 +33898,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 1155, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1259, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -32670,13 +33909,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1155, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1259, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_14(__pyx_t_7); 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, 1155, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1259, __pyx_L1_error) PyErr_Clear(); } break; @@ -32686,22 +33925,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1156 + /* "constraint/constraints.py":1260 * 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, 1156, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_v_prod, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_v_maxprod, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1156, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_v_maxprod, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1156, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_4) { - /* "constraint/constraints.py":1157 + /* "constraint/constraints.py":1261 * for value in domain[:]: * if prod * value > maxprod: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -32715,12 +33954,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_value}; __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__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_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1157, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":1156 + /* "constraint/constraints.py":1260 * domain = domains[variable] * for value in domain[:]: * if prod * value > maxprod: # <<<<<<<<<<<<<< @@ -32729,7 +33968,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1155 + /* "constraint/constraints.py":1259 * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -32739,18 +33978,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1158 + /* "constraint/constraints.py":1262 * if prod * value > maxprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False * return True */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1158, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1262, __pyx_L1_error) __pyx_t_13 = (!__pyx_t_4); if (__pyx_t_13) { - /* "constraint/constraints.py":1159 + /* "constraint/constraints.py":1263 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -32763,7 +34002,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1158 + /* "constraint/constraints.py":1262 * if prod * value > maxprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -32772,7 +34011,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1153 + /* "constraint/constraints.py":1257 * if forwardcheck: * for variable in variables: * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): # <<<<<<<<<<<<<< @@ -32781,7 +34020,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1152 + /* "constraint/constraints.py":1256 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -32791,7 +34030,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1151 + /* "constraint/constraints.py":1255 * if (not missing or len(missing_lt1) == 0) and prod > maxprod: * return False * if forwardcheck: # <<<<<<<<<<<<<< @@ -32800,7 +34039,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1160 + /* "constraint/constraints.py":1264 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -32812,7 +34051,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1131 + /* "constraint/constraints.py":1235 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -32837,13 +34076,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___2generator15); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call___2generator13); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":1174 +/* "constraint/constraints.py":1284 * """ # noqa: E501 * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -32892,38 +34131,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, 1174, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1284, __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, 1174, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1284, __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, 1174, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1284, __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, 1174, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1284, __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, 1174, __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, 1284, __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, 1174, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(0, 1284, __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, 1174, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1284, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1174, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1284, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1174, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1284, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_target_var = ((PyObject*)values[1]); @@ -32931,7 +34170,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, 1174, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1284, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -32942,7 +34181,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, 1174, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 1284, __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 */ @@ -32970,25 +34209,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1175 + /* "constraint/constraints.py":1285 * * 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, 1175, __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, 1285, __pyx_L1_error) - /* "constraint/constraints.py":1176 + /* "constraint/constraints.py":1286 * 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, 1176, __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, 1286, __pyx_L1_error) - /* "constraint/constraints.py":1174 + /* "constraint/constraints.py":1284 * """ # noqa: E501 * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -33008,7 +34247,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1178 +/* "constraint/constraints.py":1288 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -33057,41 +34296,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, 1178, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1288, __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, 1178, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1288, __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, 1178, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1288, __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, 1178, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1288, __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, 1178, __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, 1288, __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, 1178, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, i); __PYX_ERR(0, 1288, __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, 1178, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1288, __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, 1178, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1288, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1178, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1288, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -33103,7 +34342,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, 1178, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1288, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -33130,10 +34369,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_9genexpr40__pyx_v_p = NULL; - PyObject *__pyx_9genexpr41__pyx_v_lo = NULL; - PyObject *__pyx_9genexpr41__pyx_v_hi = NULL; - PyObject *__pyx_9genexpr42__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; @@ -33156,35 +34395,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_product_bounds", 0); - /* "constraint/constraints.py":1179 + /* "constraint/constraints.py":1289 * * 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, 1179, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1180 + /* "constraint/constraints.py":1290 * 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, 1180, __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, 1290, __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, 1180, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1290, __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, 1180, __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, 1290, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -33193,7 +34432,7 @@ 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, 1180, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1290, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -33203,7 +34442,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1180, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1290, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -33214,13 +34453,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1180, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1290, __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, 1180, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1290, __pyx_L1_error) PyErr_Clear(); } break; @@ -33230,19 +34469,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1181 + /* "constraint/constraints.py":1291 * 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, 1181, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1181, __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, 1291, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1291, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1182 + /* "constraint/constraints.py":1292 * for var in self.product_vars: * if var == exclude_var: * continue # <<<<<<<<<<<<<< @@ -33251,7 +34490,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ goto __pyx_L3_continue; - /* "constraint/constraints.py":1181 + /* "constraint/constraints.py":1291 * bounds = [] * for var in self.product_vars: * if var == exclude_var: # <<<<<<<<<<<<<< @@ -33260,30 +34499,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1183 + /* "constraint/constraints.py":1293 * 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, 1183, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_domain_dict, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1184 + /* "constraint/constraints.py":1294 * 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, 1184, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_dom); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1294, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { - /* "constraint/constraints.py":1185 + /* "constraint/constraints.py":1295 * dom = domain_dict[var] * if not dom: * continue # <<<<<<<<<<<<<< @@ -33292,7 +34531,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ goto __pyx_L3_continue; - /* "constraint/constraints.py":1184 + /* "constraint/constraints.py":1294 * continue * dom = domain_dict[var] * if not dom: # <<<<<<<<<<<<<< @@ -33301,7 +34540,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1186 + /* "constraint/constraints.py":1296 * if not dom: * continue * bounds.append((min(dom), max(dom))) # <<<<<<<<<<<<<< @@ -33317,7 +34556,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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_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, 1186, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_7 = NULL; @@ -33329,21 +34568,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1186, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1186, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1186, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1296, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 1186, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 1296, __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, 1186, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_bounds, __pyx_t_10); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1296, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "constraint/constraints.py":1180 + /* "constraint/constraints.py":1290 * def _get_product_bounds(self, domain_dict, exclude_var=None): * bounds = [] * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -33354,7 +34593,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1188 + /* "constraint/constraints.py":1298 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< @@ -33362,11 +34601,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * */ __pyx_t_6 = (__Pyx_PyList_GET_SIZE(__pyx_v_bounds) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_6 < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_6 < 0))) __PYX_ERR(0, 1298, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_6); if (__pyx_t_5) { - /* "constraint/constraints.py":1189 + /* "constraint/constraints.py":1299 * * if not bounds: * return 1, 1 # <<<<<<<<<<<<<< @@ -33378,7 +34617,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = __pyx_mstate_global->__pyx_tuple[0]; goto __pyx_L0; - /* "constraint/constraints.py":1188 + /* "constraint/constraints.py":1298 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< @@ -33387,7 +34626,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1192 + /* "constraint/constraints.py":1302 * * # Try all corner combinations * candidates = [p for p in product(*[(lo, hi) for lo, hi in bounds])] # <<<<<<<<<<<<<< @@ -33395,12 +34634,12 @@ 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, 1192, __pyx_L11_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1302, __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, 1192, __pyx_L11_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1302, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); { /* enter inner scope */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1192, __pyx_L16_error) + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1302, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __pyx_v_bounds; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; @@ -33408,13 +34647,13 @@ 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, 1192, __pyx_L16_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1302, __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_3; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1192, __pyx_L16_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1302, __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; @@ -33422,7 +34661,7 @@ 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, 1192, __pyx_L16_error) + __PYX_ERR(0, 1302, __pyx_L16_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -33432,22 +34671,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_INCREF(__pyx_t_13); } else { __pyx_t_12 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1192, __pyx_L16_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1302, __pyx_L16_error) __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1192, __pyx_L16_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1302, __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, 1192, __pyx_L16_error) + __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1302, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1192, __pyx_L16_error) + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1302, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_13); #endif __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { Py_ssize_t index = -1; - __pyx_t_14 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1192, __pyx_L16_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1302, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); @@ -33455,7 +34694,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1192, __pyx_L16_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 1302, __pyx_L16_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L20_unpacking_done; @@ -33463,38 +34702,38 @@ 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, 1192, __pyx_L16_error) + __PYX_ERR(0, 1302, __pyx_L16_error) __pyx_L20_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr41__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_9genexpr41__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, 1192, __pyx_L16_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1302, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(__pyx_9genexpr41__pyx_v_lo); - __Pyx_GIVEREF(__pyx_9genexpr41__pyx_v_lo); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_9genexpr41__pyx_v_lo) != (0)) __PYX_ERR(0, 1192, __pyx_L16_error); - __Pyx_INCREF(__pyx_9genexpr41__pyx_v_hi); - __Pyx_GIVEREF(__pyx_9genexpr41__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_9genexpr41__pyx_v_hi) != (0)) __PYX_ERR(0, 1192, __pyx_L16_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1192, __pyx_L16_error) + __Pyx_INCREF(__pyx_9genexpr44__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr44__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_9genexpr44__pyx_v_lo) != (0)) __PYX_ERR(0, 1302, __pyx_L16_error); + __Pyx_INCREF(__pyx_9genexpr44__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr44__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_9genexpr44__pyx_v_hi) != (0)) __PYX_ERR(0, 1302, __pyx_L16_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1302, __pyx_L16_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_hi); __pyx_9genexpr41__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_lo); __pyx_9genexpr41__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_9genexpr41__pyx_v_hi); __pyx_9genexpr41__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_lo); __pyx_9genexpr41__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, 1192, __pyx_L11_error) + __pyx_t_1 = PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1302, __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, 1192, __pyx_L11_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1302, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -33503,9 +34742,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1192, __pyx_L11_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1302, __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, 1192, __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, 1302, __pyx_L11_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -33514,7 +34753,7 @@ 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, 1192, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1302, __pyx_L11_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -33524,7 +34763,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1192, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1302, __pyx_L11_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -33535,35 +34774,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1192, __pyx_L11_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1302, __pyx_L11_error) } else { __pyx_t_8 = __pyx_t_4(__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, 1192, __pyx_L11_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1302, __pyx_L11_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr40__pyx_v_p, __pyx_t_8); + __Pyx_XDECREF_SET(__pyx_9genexpr43__pyx_v_p, __pyx_t_8); __pyx_t_8 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr40__pyx_v_p))) __PYX_ERR(0, 1192, __pyx_L11_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr43__pyx_v_p))) __PYX_ERR(0, 1302, __pyx_L11_error) } __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_9genexpr43__pyx_v_p); __pyx_9genexpr43__pyx_v_p = 0; goto __pyx_L24_exit_scope; __pyx_L11_error:; - __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_p); __pyx_9genexpr40__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":1193 + /* "constraint/constraints.py":1303 * # 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] # <<<<<<<<<<<<<< @@ -33571,7 +34810,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, 1193, __pyx_L27_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1303, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_v_candidates; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; @@ -33579,41 +34818,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, 1193, __pyx_L27_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1303, __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_3; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1193, __pyx_L27_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1303, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr42__pyx_v_p, __pyx_t_8); + __Pyx_XDECREF_SET(__pyx_9genexpr45__pyx_v_p, __pyx_t_8); __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_9genexpr42__pyx_v_p}; + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr45__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, 1193, __pyx_L27_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1303, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_8); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 1193, __pyx_L27_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 1303, __pyx_L27_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr42__pyx_v_p); __pyx_9genexpr42__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_9genexpr42__pyx_v_p); __pyx_9genexpr42__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":1194 + /* "constraint/constraints.py":1304 * 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) # <<<<<<<<<<<<<< @@ -33630,7 +34869,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1194, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_1 = NULL; @@ -33642,22 +34881,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1194, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1194, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1194, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1304, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 1194, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 1304, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_8 = 0; __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1178 + /* "constraint/constraints.py":1288 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -33683,16 +34922,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_9genexpr40__pyx_v_p); - __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_lo); - __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_hi); - __Pyx_XDECREF(__pyx_9genexpr42__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":1196 +/* "constraint/constraints.py":1306 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -33740,39 +34979,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, 1196, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1306, __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, 1196, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1306, __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, 1196, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1306, __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, 1196, __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, 1306, __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, 1196, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, i); __PYX_ERR(0, 1306, __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, 1196, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1306, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1196, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1306, __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, 1196, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1306, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -33807,7 +35046,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_safe_product", 0); - /* "constraint/constraints.py":1197 + /* "constraint/constraints.py":1307 * * def _safe_product(self, values): * prod = 1 # <<<<<<<<<<<<<< @@ -33817,7 +35056,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":1198 + /* "constraint/constraints.py":1308 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -33829,9 +35068,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, 1198, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1308, __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, 1198, __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, 1308, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -33839,7 +35078,7 @@ 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, 1198, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1308, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -33849,7 +35088,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1198, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1308, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -33860,13 +35099,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1198, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1308, __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, 1198, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1308, __pyx_L1_error) PyErr_Clear(); } break; @@ -33876,19 +35115,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1199 + /* "constraint/constraints.py":1309 * 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, 1199, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1198 + /* "constraint/constraints.py":1308 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -33898,7 +35137,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1200 + /* "constraint/constraints.py":1310 * for v in values: * prod *= v * return prod # <<<<<<<<<<<<<< @@ -33910,7 +35149,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = __pyx_v_prod; goto __pyx_L0; - /* "constraint/constraints.py":1196 + /* "constraint/constraints.py":1306 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -33932,7 +35171,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1202 +/* "constraint/constraints.py":1312 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -33983,50 +35222,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, 1202, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1312, __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, 1202, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1312, __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, 1202, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1312, __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, 1202, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1312, __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, 1202, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1312, __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, 1202, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1312, __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, 1202, __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, 1312, __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, 1202, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1312, __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, 1202, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1312, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1202, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1312, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1202, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1312, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1202, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1312, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1202, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1312, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -34036,7 +35275,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, 1202, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1312, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -34047,9 +35286,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, 1202, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1202, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1202, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1312, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1312, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1312, __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 */ @@ -34097,7 +35336,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1203 + /* "constraint/constraints.py":1313 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -34105,9 +35344,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, 1203, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1313, __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, 1203, __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, 1313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -34127,27 +35366,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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_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, 1203, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1204 + /* "constraint/constraints.py":1314 * 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, 1204, __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, 1314, __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, 1204, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1314, __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":1205 + /* "constraint/constraints.py":1315 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * target_dom = domains[self.target_var] * t_max = max(target_dom) # <<<<<<<<<<<<<< @@ -34163,29 +35402,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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_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, 1205, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_t_max = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/constraints.py":1207 + /* "constraint/constraints.py":1317 * 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, 1207, __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, 1317, __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_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, 1207, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1317, __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, 1207, __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, 1317, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -34194,7 +35433,7 @@ 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, 1207, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1317, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -34204,7 +35443,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1207, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1317, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -34215,13 +35454,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1207, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1317, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_7(__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, 1207, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1317, __pyx_L1_error) PyErr_Clear(); } break; @@ -34231,7 +35470,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1208 + /* "constraint/constraints.py":1318 * * for var in self.product_vars: * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) # <<<<<<<<<<<<<< @@ -34243,13 +35482,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1208, __pyx_L1_error) + __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1318, __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, 1208, __pyx_L1_error) + 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, 1318, __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; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1208, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { @@ -34258,7 +35497,7 @@ 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, 1208, __pyx_L1_error) + __PYX_ERR(0, 1318, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -34268,22 +35507,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1208, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1318, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1208, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1318, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1208, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1208, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #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, 1208, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1318, __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); @@ -34291,7 +35530,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1208, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 1318, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -34299,7 +35538,7 @@ 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, 1208, __pyx_L1_error) + __PYX_ERR(0, 1318, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_min_others, __pyx_t_3); @@ -34307,35 +35546,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_max_others, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1209 + /* "constraint/constraints.py":1319 * 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, 1209, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1210 + /* "constraint/constraints.py":1320 * 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, 1210, __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, 1320, __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_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, 1210, __pyx_L1_error) + __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1320, __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, 1210, __pyx_L1_error) + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1320, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -34344,7 +35583,7 @@ 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, 1210, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1320, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -34354,7 +35593,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1210, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1320, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -34365,13 +35604,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_10; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1210, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1320, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_11(__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, 1210, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1320, __pyx_L1_error) PyErr_Clear(); } break; @@ -34381,29 +35620,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1211 + /* "constraint/constraints.py":1321 * 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, 1211, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_v_val, __pyx_v_min_others); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1321, __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, 1211, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_val, __pyx_v_max_others); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1321, __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, 1211, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 1321, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1211, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1321, __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":1212 + /* "constraint/constraints.py":1322 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if min(possible_prods) > t_max: # <<<<<<<<<<<<<< @@ -34419,16 +35658,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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_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, 1212, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1322, __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, 1212, __pyx_L1_error) + __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, 1322, __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, 1212, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_12) { - /* "constraint/constraints.py":1213 + /* "constraint/constraints.py":1323 * possible_prods = [val * min_others, val * max_others] * if min(possible_prods) > t_max: * dom.remove(val) # <<<<<<<<<<<<<< @@ -34442,12 +35681,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1213, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1212 + /* "constraint/constraints.py":1322 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if min(possible_prods) > t_max: # <<<<<<<<<<<<<< @@ -34456,7 +35695,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1210 + /* "constraint/constraints.py":1320 * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) * dom = domains[var] * for val in dom[:]: # <<<<<<<<<<<<<< @@ -34466,7 +35705,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1207 + /* "constraint/constraints.py":1317 * t_max = max(target_dom) * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -34476,7 +35715,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1202 + /* "constraint/constraints.py":1312 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -34509,7 +35748,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1215 +/* "constraint/constraints.py":1325 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -34560,53 +35799,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, 1215, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1325, __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, 1215, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1325, __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, 1215, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1325, __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, 1215, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1325, __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, 1215, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1325, __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, 1215, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1325, __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, 1215, __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, 1325, __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, 1215, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1325, __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, 1215, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1325, __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, 1215, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1325, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1215, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1325, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1215, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1325, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1215, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1325, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -34620,7 +35859,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, 1215, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1325, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -34631,8 +35870,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, 1215, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1215, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1325, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1325, __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 */ @@ -34651,9 +35890,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint_8__call___2generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +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":1251 +/* "constraint/constraints.py":1361 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p > target_value for p in prods): # <<<<<<<<<<<<<< @@ -34662,29 +35901,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint */ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint_8__call___genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr *__pyx_cur_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_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); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_20_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_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_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1251, __pyx_L1_error) + __PYX_ERR(0, 1361, __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___call__ *) __pyx_self; + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___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_25VariableMaxProdConstraint_8__call___2generator16, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16]), (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, 1251, __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, 1361, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -34700,9 +35939,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint_8__call___2generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint_8__call___2generator14(__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); + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -34721,29 +35960,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint 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 (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1361, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1361, __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, 1251, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1361, __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, 1251, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1361, __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, 1251, __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, 1251, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1251, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_target_value)) { __Pyx_RaiseClosureNameError("target_value"); __PYX_ERR(0, 1361, __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, 1361, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1361, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = (!__pyx_t_4); if (__pyx_t_5) { @@ -34783,7 +36022,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1215 +/* "constraint/constraints.py":1325 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -34792,7 +36031,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint */ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint_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_21___call__ *__pyx_cur_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *__pyx_cur_scope; PyObject *__pyx_v_assigned_prod = NULL; PyObject *__pyx_v_unassigned = NULL; PyObject *__pyx_v_var = NULL; @@ -34805,18 +36044,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint PyObject *__pyx_v_domain = NULL; PyObject *__pyx_v_val = NULL; PyObject *__pyx_v_prods = NULL; - PyObject *__pyx_9genexpr43__pyx_v_v = NULL; - PyObject *__pyx_9genexpr44__pyx_v_p = NULL; - PyObject *__pyx_9genexpr45__pyx_v_lo = NULL; - PyObject *__pyx_9genexpr45__pyx_v_hi = NULL; - PyObject *__pyx_9genexpr46__pyx_v_c = NULL; - PyObject *__pyx_9genexpr47__pyx_v_v = NULL; - PyObject *__pyx_9genexpr48__pyx_v_v = NULL; - PyObject *__pyx_9genexpr49__pyx_v_p = NULL; - PyObject *__pyx_9genexpr50__pyx_v_lo = NULL; - PyObject *__pyx_9genexpr50__pyx_v_hi = NULL; - PyObject *__pyx_9genexpr51__pyx_v_o = NULL; - PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint_8__call___2generator16 = 0; + 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_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 PyObject *__pyx_t_1 = NULL; @@ -34841,29 +36080,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__ *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_21___call__(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21___call__, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_19___call__(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__ *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1215, __pyx_L1_error) + __PYX_ERR(0, 1325, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/constraints.py":1216 + /* "constraint/constraints.py":1326 * * 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, 1216, __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, 1326, __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, 1216, __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, 1326, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":1217 + /* "constraint/constraints.py":1327 * 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 # <<<<<<<<<<<<<< @@ -34875,7 +36114,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1216 + /* "constraint/constraints.py":1326 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -34884,23 +36123,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1219 + /* "constraint/constraints.py":1329 * 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, 1219, __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, 1329, __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, 1219, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1329, __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":1220 + /* "constraint/constraints.py":1330 * * target_value = assignments[self.target_var] * assigned_prod = 1 # <<<<<<<<<<<<<< @@ -34910,35 +36149,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":1221 + /* "constraint/constraints.py":1331 * 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, 1221, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_unassigned = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1223 + /* "constraint/constraints.py":1333 * 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, 1223, __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, 1333, __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, 1223, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1333, __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, 1223, __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, 1333, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -34947,7 +36186,7 @@ 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, 1223, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1333, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -34957,7 +36196,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1223, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1333, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -34968,13 +36207,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1223, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1333, __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, 1223, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1333, __pyx_L1_error) PyErr_Clear(); } break; @@ -34984,32 +36223,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1224 + /* "constraint/constraints.py":1334 * * 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, 1224, __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, 1334, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":1225 + /* "constraint/constraints.py":1335 * 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, 1225, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1335, __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, 1225, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_assigned_prod, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1335, __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":1224 + /* "constraint/constraints.py":1334 * * for var in self.product_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -35019,7 +36258,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint goto __pyx_L6; } - /* "constraint/constraints.py":1227 + /* "constraint/constraints.py":1337 * assigned_prod *= assignments[var] * else: * unassigned.append(var) # <<<<<<<<<<<<<< @@ -35027,11 +36266,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, 1227, __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, 1337, __pyx_L1_error) } __pyx_L6:; - /* "constraint/constraints.py":1223 + /* "constraint/constraints.py":1333 * unassigned = [] * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -35041,7 +36280,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1229 + /* "constraint/constraints.py":1339 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< @@ -35049,11 +36288,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * */ __pyx_t_2 = (__Pyx_PyList_GET_SIZE(__pyx_v_unassigned) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 1229, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 1339, __pyx_L1_error) __pyx_t_8 = (!__pyx_t_2); if (__pyx_t_8) { - /* "constraint/constraints.py":1230 + /* "constraint/constraints.py":1340 * * if not unassigned: * return assigned_prod <= target_value # <<<<<<<<<<<<<< @@ -35061,12 +36300,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, 1230, __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, 1340, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1229 + /* "constraint/constraints.py":1339 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< @@ -35075,7 +36314,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1233 + /* "constraint/constraints.py":1343 * * # Estimate max possible value of full product * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned] # <<<<<<<<<<<<<< @@ -35083,7 +36322,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, 1233, __pyx_L11_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1343, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0; @@ -35091,20 +36330,20 @@ 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, 1233, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1343, __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_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1233, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1343, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_9genexpr43__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_9genexpr43__pyx_v_v); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1233, __pyx_L11_error) + __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr46__pyx_v_v); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1343, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = 1; { @@ -35113,13 +36352,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1233, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1343, __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_9genexpr43__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1233, __pyx_L11_error) + __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr46__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1343, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_12 = 1; { @@ -35128,32 +36367,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1233, __pyx_L11_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1343, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); } - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1233, __pyx_L11_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1343, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1233, __pyx_L11_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1343, __pyx_L11_error); __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1233, __pyx_L11_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1343, __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, 1233, __pyx_L11_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1343, __pyx_L11_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_v); __pyx_9genexpr43__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_9genexpr43__pyx_v_v); __pyx_9genexpr43__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":1234 + /* "constraint/constraints.py":1344 * # 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])] # <<<<<<<<<<<<<< @@ -35161,12 +36400,12 @@ 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, 1234, __pyx_L18_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __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, 1234, __pyx_L18_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1344, __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, 1234, __pyx_L23_error) + __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1344, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __pyx_v_domain_bounds; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; @@ -35174,13 +36413,13 @@ 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, 1234, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1344, __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_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1234, __pyx_L23_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1344, __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; @@ -35188,7 +36427,7 @@ 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_L23_error) + __PYX_ERR(0, 1344, __pyx_L23_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -35198,22 +36437,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_INCREF(__pyx_t_11); } else { __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1234, __pyx_L23_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1344, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_13); __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1234, __pyx_L23_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1344, __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, 1234, __pyx_L23_error) + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1344, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1234, __pyx_L23_error) + __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1344, __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, 1234, __pyx_L23_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1344, __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); @@ -35221,7 +36460,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1234, __pyx_L23_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 1344, __pyx_L23_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L27_unpacking_done; @@ -35229,38 +36468,38 @@ 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, 1234, __pyx_L23_error) + __PYX_ERR(0, 1344, __pyx_L23_error) __pyx_L27_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr45__pyx_v_lo, __pyx_t_13); + __Pyx_XDECREF_SET(__pyx_9genexpr48__pyx_v_lo, __pyx_t_13); __pyx_t_13 = 0; - __Pyx_XDECREF_SET(__pyx_9genexpr45__pyx_v_hi, __pyx_t_11); + __Pyx_XDECREF_SET(__pyx_9genexpr48__pyx_v_hi, __pyx_t_11); __pyx_t_11 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1234, __pyx_L23_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1344, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_9genexpr45__pyx_v_lo); - __Pyx_GIVEREF(__pyx_9genexpr45__pyx_v_lo); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_9genexpr45__pyx_v_lo) != (0)) __PYX_ERR(0, 1234, __pyx_L23_error); - __Pyx_INCREF(__pyx_9genexpr45__pyx_v_hi); - __Pyx_GIVEREF(__pyx_9genexpr45__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_9genexpr45__pyx_v_hi) != (0)) __PYX_ERR(0, 1234, __pyx_L23_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1234, __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, 1344, __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, 1344, __pyx_L23_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1344, __pyx_L23_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_hi); __pyx_9genexpr45__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_lo); __pyx_9genexpr45__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_9genexpr45__pyx_v_hi); __pyx_9genexpr45__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_lo); __pyx_9genexpr45__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, 1234, __pyx_L18_error) + __pyx_t_10 = PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1344, __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, 1234, __pyx_L18_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1344, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -35269,9 +36508,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1234, __pyx_L18_error) + __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1344, __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, 1234, __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, 1344, __pyx_L18_error) } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; for (;;) { @@ -35280,7 +36519,7 @@ 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, 1234, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1344, __pyx_L18_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -35290,7 +36529,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1234, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1344, __pyx_L18_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -35301,46 +36540,46 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1234, __pyx_L18_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1344, __pyx_L18_error) } else { __pyx_t_9 = __pyx_t_5(__pyx_t_10); 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_L18_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1344, __pyx_L18_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_9genexpr44__pyx_v_p, __pyx_t_9); + __Pyx_XDECREF_SET(__pyx_9genexpr47__pyx_v_p, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_6 = __pyx_v_self; __Pyx_INCREF(__pyx_t_6); __pyx_t_12 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_9genexpr44__pyx_v_p}; + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_9genexpr47__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)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1234, __pyx_L18_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1344, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_9); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1234, __pyx_L18_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1344, __pyx_L18_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_p); __pyx_9genexpr44__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_9genexpr44__pyx_v_p); __pyx_9genexpr44__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":1235 + /* "constraint/constraints.py":1345 * 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] # <<<<<<<<<<<<<< @@ -35348,7 +36587,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, 1235, __pyx_L34_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1345, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __pyx_v_candidates; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; @@ -35356,33 +36595,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, 1235, __pyx_L34_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1345, __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_4; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1235, __pyx_L34_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1345, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_9genexpr46__pyx_v_c, __pyx_t_9); + __Pyx_XDECREF_SET(__pyx_9genexpr49__pyx_v_c, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Multiply(__pyx_v_assigned_prod, __pyx_9genexpr46__pyx_v_c); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1235, __pyx_L34_error) + __pyx_t_9 = PyNumber_Multiply(__pyx_v_assigned_prod, __pyx_9genexpr49__pyx_v_c); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1345, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_9); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1235, __pyx_L34_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1345, __pyx_L34_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_c); __pyx_9genexpr46__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_9genexpr46__pyx_v_c); __pyx_9genexpr46__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":1236 + /* "constraint/constraints.py":1346 * 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: # <<<<<<<<<<<<<< @@ -35398,16 +36637,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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_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, 1236, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1346, __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, 1236, __pyx_L1_error) + __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, 1346, __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, 1236, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1346, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_8) { - /* "constraint/constraints.py":1237 + /* "constraint/constraints.py":1347 * possible_prods = [assigned_prod * c for c in candidates] * if min(possible_prods) > target_value: * return False # <<<<<<<<<<<<<< @@ -35419,7 +36658,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1236 + /* "constraint/constraints.py":1346 * 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: # <<<<<<<<<<<<<< @@ -35428,17 +36667,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1239 + /* "constraint/constraints.py":1349 * 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, 1239, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1349, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1240 + /* "constraint/constraints.py":1350 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< @@ -35451,18 +36690,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1350, __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_4; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1241 + /* "constraint/constraints.py":1351 * if forwardcheck: * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] # <<<<<<<<<<<<<< @@ -35470,7 +36709,7 @@ 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, 1241, __pyx_L45_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1351, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_10); __pyx_t_16 = 0; @@ -35478,35 +36717,35 @@ 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, 1241, __pyx_L45_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1351, __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_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1241, __pyx_L45_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1351, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr47__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_9genexpr47__pyx_v_v, __pyx_v_var, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1241, __pyx_L45_error) - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1241, __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, 1351, __pyx_L45_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1351, __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_9genexpr47__pyx_v_v))) __PYX_ERR(0, 1241, __pyx_L45_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr50__pyx_v_v))) __PYX_ERR(0, 1351, __pyx_L45_error) } } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_v); __pyx_9genexpr47__pyx_v_v = 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_9genexpr47__pyx_v_v); __pyx_9genexpr47__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":1242 + /* "constraint/constraints.py":1352 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< @@ -35514,10 +36753,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * 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, 1242, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_8 < 0))) __PYX_ERR(0, 1352, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1243 + /* "constraint/constraints.py":1353 * 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] # <<<<<<<<<<<<<< @@ -35525,7 +36764,7 @@ 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, 1243, __pyx_L54_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __pyx_v_other_unassigned; __Pyx_INCREF(__pyx_t_10); __pyx_t_16 = 0; @@ -35533,20 +36772,20 @@ 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, 1243, __pyx_L54_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1353, __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_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1243, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1353, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr48__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_9genexpr48__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1243, __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, 1353, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_12 = 1; { @@ -35555,13 +36794,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1243, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1353, __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_9genexpr48__pyx_v_v); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1243, __pyx_L54_error) + __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr51__pyx_v_v); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1353, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_12 = 1; { @@ -35570,32 +36809,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1243, __pyx_L54_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1353, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1243, __pyx_L54_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1353, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1243, __pyx_L54_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1353, __pyx_L54_error); __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 1243, __pyx_L54_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 1353, __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, 1243, __pyx_L54_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1353, __pyx_L54_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_v); __pyx_9genexpr48__pyx_v_v = 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_9genexpr48__pyx_v_v); __pyx_9genexpr48__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":1244 + /* "constraint/constraints.py":1354 * 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])] # <<<<<<<<<<<<<< @@ -35603,12 +36842,12 @@ 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, 1244, __pyx_L61_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1354, __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, 1244, __pyx_L61_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1354, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_10); { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1244, __pyx_L66_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1354, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = __pyx_v_bounds; __Pyx_INCREF(__pyx_t_11); __pyx_t_16 = 0; @@ -35616,13 +36855,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1244, __pyx_L66_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1354, __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_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1244, __pyx_L66_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1354, __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; @@ -35630,7 +36869,7 @@ 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, 1244, __pyx_L66_error) + __PYX_ERR(0, 1354, __pyx_L66_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -35640,22 +36879,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_INCREF(__pyx_t_13); } else { __pyx_t_14 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1244, __pyx_L66_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1354, __pyx_L66_error) __Pyx_XGOTREF(__pyx_t_14); __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1244, __pyx_L66_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1354, __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, 1244, __pyx_L66_error) + __pyx_t_14 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1354, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1244, __pyx_L66_error) + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1354, __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, 1244, __pyx_L66_error) + __pyx_t_17 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1354, __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); @@ -35663,7 +36902,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1244, __pyx_L66_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_17), 2) < 0) __PYX_ERR(0, 1354, __pyx_L66_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; goto __pyx_L70_unpacking_done; @@ -35671,38 +36910,38 @@ 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, 1244, __pyx_L66_error) + __PYX_ERR(0, 1354, __pyx_L66_error) __pyx_L70_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr50__pyx_v_lo, __pyx_t_14); + __Pyx_XDECREF_SET(__pyx_9genexpr53__pyx_v_lo, __pyx_t_14); __pyx_t_14 = 0; - __Pyx_XDECREF_SET(__pyx_9genexpr50__pyx_v_hi, __pyx_t_13); + __Pyx_XDECREF_SET(__pyx_9genexpr53__pyx_v_hi, __pyx_t_13); __pyx_t_13 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1244, __pyx_L66_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1354, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_9genexpr50__pyx_v_lo); - __Pyx_GIVEREF(__pyx_9genexpr50__pyx_v_lo); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_9genexpr50__pyx_v_lo) != (0)) __PYX_ERR(0, 1244, __pyx_L66_error); - __Pyx_INCREF(__pyx_9genexpr50__pyx_v_hi); - __Pyx_GIVEREF(__pyx_9genexpr50__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_9genexpr50__pyx_v_hi) != (0)) __PYX_ERR(0, 1244, __pyx_L66_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1244, __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, 1354, __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, 1354, __pyx_L66_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1354, __pyx_L66_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_hi); __pyx_9genexpr50__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_lo); __pyx_9genexpr50__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_L72_exit_scope; __pyx_L66_error:; - __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_hi); __pyx_9genexpr50__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_lo); __pyx_9genexpr50__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, 1244, __pyx_L61_error) + __pyx_t_11 = PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1354, __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, 1244, __pyx_L61_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1354, __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; @@ -35711,9 +36950,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1244, __pyx_L61_error) + __pyx_t_16 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1354, __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, 1244, __pyx_L61_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, 1354, __pyx_L61_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -35722,7 +36961,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1244, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1354, __pyx_L61_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -35732,7 +36971,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1244, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1354, __pyx_L61_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -35743,46 +36982,46 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1244, __pyx_L61_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1354, __pyx_L61_error) } else { __pyx_t_3 = __pyx_t_5(__pyx_t_11); 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, 1244, __pyx_L61_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1354, __pyx_L61_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_9genexpr49__pyx_v_p, __pyx_t_3); + __Pyx_XDECREF_SET(__pyx_9genexpr52__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; { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr49__pyx_v_p}; + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr52__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, 1244, __pyx_L61_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1354, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_3); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1244, __pyx_L61_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1354, __pyx_L61_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_XDECREF(__pyx_9genexpr49__pyx_v_p); __pyx_9genexpr49__pyx_v_p = 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_9genexpr49__pyx_v_p); __pyx_9genexpr49__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":1242 + /* "constraint/constraints.py":1352 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< @@ -35792,7 +37031,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint goto __pyx_L51; } - /* "constraint/constraints.py":1246 + /* "constraint/constraints.py":1356 * other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in bounds])] * else: * other_products = [1] # <<<<<<<<<<<<<< @@ -35800,45 +37039,45 @@ 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, 1246, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1356, __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, 1246, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 1356, __pyx_L1_error); __Pyx_XDECREF_SET(__pyx_v_other_products, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; } __pyx_L51:; - /* "constraint/constraints.py":1248 + /* "constraint/constraints.py":1358 * 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, 1248, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1249 + /* "constraint/constraints.py":1359 * * 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, 1249, __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, 1359, __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_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, 1249, __pyx_L1_error) + __pyx_t_16 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1359, __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, 1249, __pyx_L1_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, 1359, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -35847,7 +37086,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1249, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1359, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -35857,7 +37096,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1249, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1359, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -35868,13 +37107,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1249, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1359, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_5(__pyx_t_11); 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, 1249, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1359, __pyx_L1_error) PyErr_Clear(); } break; @@ -35884,7 +37123,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1250 + /* "constraint/constraints.py":1360 * domain = domains[var] * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] # <<<<<<<<<<<<<< @@ -35892,7 +37131,7 @@ 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, 1250, __pyx_L79_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_v_other_products; __Pyx_INCREF(__pyx_t_3); __pyx_t_18 = 0; @@ -35900,52 +37139,52 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1250, __pyx_L79_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1360, __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_18; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1250, __pyx_L79_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1360, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_XDECREF_SET(__pyx_9genexpr51__pyx_v_o, __pyx_t_10); + __Pyx_XDECREF_SET(__pyx_9genexpr54__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, 1250, __pyx_L79_error) + __pyx_t_10 = PyNumber_Multiply(__pyx_v_assigned_prod, __pyx_v_val); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1360, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = PyNumber_Multiply(__pyx_t_10, __pyx_9genexpr51__pyx_v_o); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1250, __pyx_L79_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_10, __pyx_9genexpr54__pyx_v_o); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1360, __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, 1250, __pyx_L79_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1360, __pyx_L79_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr51__pyx_v_o); __pyx_9genexpr51__pyx_v_o = 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_9genexpr51__pyx_v_o); __pyx_9genexpr51__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":1251 + /* "constraint/constraints.py":1361 * 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, 1251, __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, 1361, __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, 1251, __pyx_L1_error) + __pyx_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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, 1251, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1361, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { - /* "constraint/constraints.py":1252 + /* "constraint/constraints.py":1362 * prods = [assigned_prod * val * o for o in other_products] * if all(p > target_value for p in prods): * domain.hideValue(val) # <<<<<<<<<<<<<< @@ -35959,12 +37198,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint 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_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1252, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1251 + /* "constraint/constraints.py":1361 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p > target_value for p in prods): # <<<<<<<<<<<<<< @@ -35973,7 +37212,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1249 + /* "constraint/constraints.py":1359 * * domain = domains[var] * for val in domain[:]: # <<<<<<<<<<<<<< @@ -35983,18 +37222,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "constraint/constraints.py":1253 + /* "constraint/constraints.py":1363 * 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, 1253, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1363, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_8); if (__pyx_t_2) { - /* "constraint/constraints.py":1254 + /* "constraint/constraints.py":1364 * domain.hideValue(val) * if not domain: * return False # <<<<<<<<<<<<<< @@ -36007,7 +37246,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1253 + /* "constraint/constraints.py":1363 * if all(p > target_value for p in prods): * domain.hideValue(val) * if not domain: # <<<<<<<<<<<<<< @@ -36016,7 +37255,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1240 + /* "constraint/constraints.py":1350 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< @@ -36026,7 +37265,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":1239 + /* "constraint/constraints.py":1349 * return False * * if forwardcheck: # <<<<<<<<<<<<<< @@ -36035,7 +37274,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1256 + /* "constraint/constraints.py":1366 * return False * * return True # <<<<<<<<<<<<<< @@ -36047,7 +37286,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1215 + /* "constraint/constraints.py":1325 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -36081,25 +37320,25 @@ 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_9genexpr43__pyx_v_v); - __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_p); - __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_lo); - __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_hi); - __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_c); - __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_v); - __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_v); - __Pyx_XDECREF(__pyx_9genexpr49__pyx_v_p); - __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_lo); - __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_hi); - __Pyx_XDECREF(__pyx_9genexpr51__pyx_v_o); - __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint_8__call___2generator16); + __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_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); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":1270 +/* "constraint/constraints.py":1380 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -36148,39 +37387,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, 1270, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1380, __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, 1270, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1380, __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, 1270, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1380, __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, 1270, __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, 1380, __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, 1270, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1380, __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, 1270, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1380, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1270, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1380, __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, 1270, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1380, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -36209,16 +37448,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1276 + /* "constraint/constraints.py":1386 * 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, 1276, __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, 1386, __pyx_L1_error) - /* "constraint/constraints.py":1270 + /* "constraint/constraints.py":1380 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -36238,7 +37477,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( return __pyx_r; } -/* "constraint/constraints.py":1278 +/* "constraint/constraints.py":1388 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -36289,53 +37528,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, 1278, __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 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1278, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1388, __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, 1278, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1388, __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, 1278, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1388, __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, 1278, __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, 1278, __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, "__call__", 0) < 0) __PYX_ERR(0, 1278, __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, 1388, __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, 1278, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1388, __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, 1278, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1388, __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, 1278, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1388, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1278, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __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, 1278, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1388, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1278, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1388, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -36349,7 +37588,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, 1278, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1388, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -36382,7 +37621,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1280 + /* "constraint/constraints.py":1390 * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 * # preProcess() will remove it. * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< @@ -36398,14 +37637,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ __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, 1280, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1390, __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, 1280, __pyx_L1_error) + __PYX_ERR(0, 1390, __pyx_L1_error) - /* "constraint/constraints.py":1278 + /* "constraint/constraints.py":1388 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -36425,7 +37664,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ return __pyx_r; } -/* "constraint/constraints.py":1282 +/* "constraint/constraints.py":1392 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -36476,50 +37715,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, 1282, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1392, __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, 1282, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1392, __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, 1282, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1392, __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, 1282, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1392, __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, 1282, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1392, __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, 1282, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1392, __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, 1282, __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, 1392, __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, 1282, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1392, __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, 1282, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1392, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1282, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1392, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1282, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1392, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1282, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1392, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1282, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1392, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -36529,7 +37768,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, 1282, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1392, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -36540,9 +37779,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, 1282, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1282, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1282, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1392, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1392, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1392, __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 */ @@ -36585,19 +37824,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1283 + /* "constraint/constraints.py":1393 * * 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, 1283, __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, 1393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1284 + /* "constraint/constraints.py":1394 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -36609,9 +37848,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, 1284, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1394, __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, 1284, __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, 1394, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -36619,7 +37858,7 @@ 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, 1284, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1394, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -36629,7 +37868,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce { 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, 1284, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1394, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -36640,13 +37879,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1284, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1394, __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, 1284, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1394, __pyx_L1_error) PyErr_Clear(); } break; @@ -36656,35 +37895,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":1285 + /* "constraint/constraints.py":1395 * 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, 1285, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1286 + /* "constraint/constraints.py":1396 * 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, 1286, __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, 1396, __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, 1286, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1396, __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, 1286, __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, 1396, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -36693,7 +37932,7 @@ 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, 1286, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1396, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -36703,7 +37942,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce { 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, 1286, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1396, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -36714,13 +37953,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1286, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1396, __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, 1286, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1396, __pyx_L1_error) PyErr_Clear(); } break; @@ -36730,17 +37969,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":1287 + /* "constraint/constraints.py":1397 * 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, 1287, __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, 1397, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1288 + /* "constraint/constraints.py":1398 * for value in domain[:]: * if value not in set: * domain.remove(value) # <<<<<<<<<<<<<< @@ -36754,12 +37993,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce 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_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1288, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1287 + /* "constraint/constraints.py":1397 * domain = domains[variable] * for value in domain[:]: * if value not in set: # <<<<<<<<<<<<<< @@ -36768,7 +38007,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce */ } - /* "constraint/constraints.py":1286 + /* "constraint/constraints.py":1396 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -36778,25 +38017,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1289 + /* "constraint/constraints.py":1399 * 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, 1289, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1399, __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, 1289, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1399, __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, 1289, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1399, __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, 1289, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1399, __pyx_L1_error); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11}; @@ -36804,12 +38043,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce __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, 1289, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1284 + /* "constraint/constraints.py":1394 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -36819,27 +38058,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1290 + /* "constraint/constraints.py":1400 * 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, 1290, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1400, __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, 1290, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1400, __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, 1290, __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, 1290, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1400, __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, 1400, __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":1282 + /* "constraint/constraints.py":1392 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -36868,7 +38107,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce return __pyx_r; } -/* "constraint/constraints.py":1304 +/* "constraint/constraints.py":1414 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -36917,39 +38156,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, 1304, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1414, __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, 1304, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1414, __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, 1304, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1414, __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, 1304, __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, 1414, __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, 1304, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1414, __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, 1304, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1414, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1304, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1414, __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, 1304, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1414, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -36978,16 +38217,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1310 + /* "constraint/constraints.py":1420 * 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, 1310, __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, 1420, __pyx_L1_error) - /* "constraint/constraints.py":1304 + /* "constraint/constraints.py":1414 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -37007,7 +38246,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init return __pyx_r; } -/* "constraint/constraints.py":1312 +/* "constraint/constraints.py":1422 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -37058,53 +38297,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, 1312, __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 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1422, __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, 1312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1422, __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, 1312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1422, __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, 1312, __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, 1312, __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, "__call__", 0) < 0) __PYX_ERR(0, 1312, __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, 1422, __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, 1312, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1422, __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, 1312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1422, __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, 1312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1422, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __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, 1312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1422, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1422, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -37118,7 +38357,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, 1312, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1422, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -37151,7 +38390,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1314 + /* "constraint/constraints.py":1424 * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 * # preProcess() will remove it. * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< @@ -37167,14 +38406,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal __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, 1314, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1424, __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, 1314, __pyx_L1_error) + __PYX_ERR(0, 1424, __pyx_L1_error) - /* "constraint/constraints.py":1312 + /* "constraint/constraints.py":1422 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -37194,7 +38433,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal return __pyx_r; } -/* "constraint/constraints.py":1316 +/* "constraint/constraints.py":1426 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -37245,50 +38484,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, 1316, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1426, __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, 1316, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1426, __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, 1316, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1426, __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, 1316, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1426, __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, 1316, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1426, __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, 1316, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1426, __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, 1316, __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, 1426, __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, 1316, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1426, __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, 1316, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1426, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1316, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1426, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1316, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1426, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1316, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1426, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1316, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1426, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -37298,7 +38537,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, 1316, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1426, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -37309,9 +38548,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, 1316, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1316, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1316, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1426, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1426, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1426, __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 */ @@ -37354,19 +38593,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1317 + /* "constraint/constraints.py":1427 * * 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, 1317, __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, 1427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1318 + /* "constraint/constraints.py":1428 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -37378,9 +38617,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, 1318, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1428, __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, 1318, __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, 1428, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -37388,7 +38627,7 @@ 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, 1318, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1428, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -37398,7 +38637,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr { 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, 1318, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1428, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -37409,13 +38648,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1318, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1428, __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, 1318, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1428, __pyx_L1_error) PyErr_Clear(); } break; @@ -37425,35 +38664,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":1319 + /* "constraint/constraints.py":1429 * 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, 1319, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1320 + /* "constraint/constraints.py":1430 * 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, 1320, __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, 1430, __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, 1320, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1430, __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, 1320, __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, 1430, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -37462,7 +38701,7 @@ 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, 1320, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1430, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -37472,7 +38711,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr { 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, 1320, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1430, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -37483,13 +38722,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1320, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1430, __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, 1320, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1430, __pyx_L1_error) PyErr_Clear(); } break; @@ -37499,17 +38738,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":1321 + /* "constraint/constraints.py":1431 * 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, 1321, __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, 1431, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1322 + /* "constraint/constraints.py":1432 * for value in domain[:]: * if value in set: * domain.remove(value) # <<<<<<<<<<<<<< @@ -37523,12 +38762,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr 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_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1322, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1321 + /* "constraint/constraints.py":1431 * domain = domains[variable] * for value in domain[:]: * if value in set: # <<<<<<<<<<<<<< @@ -37537,7 +38776,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr */ } - /* "constraint/constraints.py":1320 + /* "constraint/constraints.py":1430 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -37547,25 +38786,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1323 + /* "constraint/constraints.py":1433 * 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, 1323, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1433, __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, 1323, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1433, __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, 1323, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1433, __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, 1323, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1433, __pyx_L1_error); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11}; @@ -37573,12 +38812,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr __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, 1323, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1318 + /* "constraint/constraints.py":1428 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -37588,27 +38827,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1324 + /* "constraint/constraints.py":1434 * 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, 1324, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __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, 1324, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1434, __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, 1324, __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, 1324, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1434, __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, 1434, __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":1316 + /* "constraint/constraints.py":1426 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -37637,7 +38876,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr return __pyx_r; } -/* "constraint/constraints.py":1338 +/* "constraint/constraints.py":1448 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -37688,50 +38927,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, 1338, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1448, __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, 1338, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1448, __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, 1338, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1448, __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, 1338, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1448, __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, 1338, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1448, __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, 1338, __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, 1448, __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, 1338, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, i); __PYX_ERR(0, 1448, __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, 1338, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1448, __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, 1338, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1448, __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, 1338, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1448, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1338, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1448, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -37745,7 +38984,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, 1338, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1448, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -37774,34 +39013,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1348 + /* "constraint/constraints.py":1458 * 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, 1348, __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, 1458, __pyx_L1_error) - /* "constraint/constraints.py":1349 + /* "constraint/constraints.py":1459 * """ * 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, 1349, __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, 1459, __pyx_L1_error) - /* "constraint/constraints.py":1350 + /* "constraint/constraints.py":1460 * 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, 1350, __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, 1460, __pyx_L1_error) - /* "constraint/constraints.py":1338 + /* "constraint/constraints.py":1448 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -37821,7 +39060,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini return __pyx_r; } -/* "constraint/constraints.py":1352 +/* "constraint/constraints.py":1462 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -37872,53 +39111,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, 1352, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1462, __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, 1352, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1462, __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, 1352, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1462, __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, 1352, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1462, __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, 1352, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1462, __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, 1352, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1462, __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, 1352, __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, 1462, __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, 1352, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1462, __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, 1352, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1462, __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, 1352, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1462, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1352, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1462, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1352, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1462, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1352, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1462, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -37932,7 +39171,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, 1352, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1462, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -37943,8 +39182,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, 1352, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1352, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1462, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1462, __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 */ @@ -37989,19 +39228,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1353 + /* "constraint/constraints.py":1463 * * 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, 1353, __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, 1463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1354 + /* "constraint/constraints.py":1464 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * set = self._set * missing = 0 # <<<<<<<<<<<<<< @@ -38011,7 +39250,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":1355 + /* "constraint/constraints.py":1465 * set = self._set * missing = 0 * found = 0 # <<<<<<<<<<<<<< @@ -38021,7 +39260,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":1356 + /* "constraint/constraints.py":1466 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -38033,9 +39272,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, 1356, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1466, __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, 1356, __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, 1466, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -38043,7 +39282,7 @@ 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, 1356, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1466, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -38053,7 +39292,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { 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, 1356, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1466, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -38064,13 +39303,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1356, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1466, __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, 1356, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1466, __pyx_L1_error) PyErr_Clear(); } break; @@ -38080,36 +39319,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":1357 + /* "constraint/constraints.py":1467 * 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, 1357, __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, 1467, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1358 + /* "constraint/constraints.py":1468 * 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, 1358, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1468, __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, 1358, __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, 1468, __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, 1358, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1468, __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, 1358, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_found, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1468, __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":1357 + /* "constraint/constraints.py":1467 * found = 0 * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -38119,7 +39358,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L5; } - /* "constraint/constraints.py":1360 + /* "constraint/constraints.py":1470 * found += assignments[variable] in set * else: * missing += 1 # <<<<<<<<<<<<<< @@ -38127,14 +39366,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, 1360, __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, 1470, __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":1356 + /* "constraint/constraints.py":1466 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -38144,53 +39383,53 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1361 + /* "constraint/constraints.py":1471 * 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, 1361, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_missing); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1471, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1362 + /* "constraint/constraints.py":1472 * 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, 1362, __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, 1472, __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, 1362, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1472, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1363 + /* "constraint/constraints.py":1473 * 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, 1363, __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, 1473, __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, 1363, __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, 1473, __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, 1363, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1473, __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, 1363, __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, 1473, __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, 1363, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1473, __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":1364 + /* "constraint/constraints.py":1474 * if self._exact: * if not (found <= self._n <= missing + found): * return False # <<<<<<<<<<<<<< @@ -38202,7 +39441,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1363 + /* "constraint/constraints.py":1473 * if missing: * if self._exact: * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< @@ -38211,7 +39450,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1362 + /* "constraint/constraints.py":1472 * missing += 1 * if missing: * if self._exact: # <<<<<<<<<<<<<< @@ -38221,7 +39460,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L8; } - /* "constraint/constraints.py":1366 + /* "constraint/constraints.py":1476 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -38229,18 +39468,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, 1366, __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, 1476, __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, 1366, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1476, __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, 1366, __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, 1476, __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, 1366, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1476, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":1367 + /* "constraint/constraints.py":1477 * else: * if self._n > missing + found: * return False # <<<<<<<<<<<<<< @@ -38252,7 +39491,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1366 + /* "constraint/constraints.py":1476 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -38263,33 +39502,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __pyx_L8:; - /* "constraint/constraints.py":1368 + /* "constraint/constraints.py":1478 * 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, 1368, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1478, __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, 1368, __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, 1478, __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, 1368, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1478, __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, 1368, __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, 1478, __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, 1368, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1478, __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":1371 + /* "constraint/constraints.py":1481 * # All unassigned variables must be assigned to * # values in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -38301,9 +39540,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, 1371, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1481, __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, 1371, __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, 1481, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -38311,7 +39550,7 @@ 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, 1371, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1481, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -38321,7 +39560,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { 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, 1371, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1481, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -38332,13 +39571,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1371, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1481, __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, 1371, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1481, __pyx_L1_error) PyErr_Clear(); } break; @@ -38348,45 +39587,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":1372 + /* "constraint/constraints.py":1482 * # 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, 1372, __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, 1482, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1373 + /* "constraint/constraints.py":1483 * 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, 1373, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1374 + /* "constraint/constraints.py":1484 * 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, 1374, __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, 1484, __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, 1374, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1484, __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, 1374, __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, 1484, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -38395,7 +39634,7 @@ 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, 1374, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1484, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -38405,7 +39644,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { 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, 1374, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1484, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -38416,13 +39655,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1484, __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, 1374, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1484, __pyx_L1_error) PyErr_Clear(); } break; @@ -38432,17 +39671,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":1375 + /* "constraint/constraints.py":1485 * 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, 1375, __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, 1485, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1376 + /* "constraint/constraints.py":1486 * for value in domain[:]: * if value not in set: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -38456,12 +39695,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca 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_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1375 + /* "constraint/constraints.py":1485 * domain = domains[variable] * for value in domain[:]: * if value not in set: # <<<<<<<<<<<<<< @@ -38470,7 +39709,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1374 + /* "constraint/constraints.py":1484 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -38480,18 +39719,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1377 + /* "constraint/constraints.py":1487 * 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, 1377, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1487, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_7); if (__pyx_t_5) { - /* "constraint/constraints.py":1378 + /* "constraint/constraints.py":1488 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -38504,7 +39743,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":1377 + /* "constraint/constraints.py":1487 * if value not in set: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -38513,7 +39752,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1372 + /* "constraint/constraints.py":1482 * # values in the set. * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -38522,7 +39761,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1371 + /* "constraint/constraints.py":1481 * # All unassigned variables must be assigned to * # values in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -38532,7 +39771,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1368 + /* "constraint/constraints.py":1478 * if self._n > missing + found: * return False * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< @@ -38541,7 +39780,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1361 + /* "constraint/constraints.py":1471 * else: * missing += 1 * if missing: # <<<<<<<<<<<<<< @@ -38551,7 +39790,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L7; } - /* "constraint/constraints.py":1380 + /* "constraint/constraints.py":1490 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -38559,28 +39798,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, 1380, __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, 1490, __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, 1380, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1490, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1381 + /* "constraint/constraints.py":1491 * 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, 1381, __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, 1491, __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, 1381, __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, 1491, __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, 1381, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1491, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1382 + /* "constraint/constraints.py":1492 * if self._exact: * if found != self._n: * return False # <<<<<<<<<<<<<< @@ -38592,7 +39831,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1381 + /* "constraint/constraints.py":1491 * else: * if self._exact: * if found != self._n: # <<<<<<<<<<<<<< @@ -38601,7 +39840,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1380 + /* "constraint/constraints.py":1490 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -38611,7 +39850,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L23; } - /* "constraint/constraints.py":1384 + /* "constraint/constraints.py":1494 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -38619,15 +39858,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, 1384, __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, 1494, __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, 1384, __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, 1494, __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, 1384, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1494, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1385 + /* "constraint/constraints.py":1495 * else: * if found < self._n: * return False # <<<<<<<<<<<<<< @@ -38639,7 +39878,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1384 + /* "constraint/constraints.py":1494 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -38652,7 +39891,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __pyx_L7:; - /* "constraint/constraints.py":1386 + /* "constraint/constraints.py":1496 * if found < self._n: * return False * return True # <<<<<<<<<<<<<< @@ -38664,7 +39903,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1352 + /* "constraint/constraints.py":1462 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -38692,7 +39931,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca return __pyx_r; } -/* "constraint/constraints.py":1400 +/* "constraint/constraints.py":1510 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -38743,50 +39982,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, 1400, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1510, __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, 1400, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1510, __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, 1400, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1510, __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, 1400, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1510, __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, 1400, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1510, __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, 1400, __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, 1510, __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, 1400, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, i); __PYX_ERR(0, 1510, __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, 1400, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1510, __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, 1400, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1510, __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, 1400, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1510, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1400, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1510, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -38800,7 +40039,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, 1400, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1510, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -38829,34 +40068,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1410 + /* "constraint/constraints.py":1520 * 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, 1410, __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, 1520, __pyx_L1_error) - /* "constraint/constraints.py":1411 + /* "constraint/constraints.py":1521 * """ * 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, 1411, __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, 1521, __pyx_L1_error) - /* "constraint/constraints.py":1412 + /* "constraint/constraints.py":1522 * 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, 1412, __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, 1522, __pyx_L1_error) - /* "constraint/constraints.py":1400 + /* "constraint/constraints.py":1510 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -38876,7 +40115,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ return __pyx_r; } -/* "constraint/constraints.py":1414 +/* "constraint/constraints.py":1524 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -38927,53 +40166,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, 1414, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1524, __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, 1414, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1524, __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, 1414, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1524, __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, 1414, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1524, __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, 1414, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1524, __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, 1414, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1524, __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, 1414, __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, 1524, __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, 1414, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1524, __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, 1414, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1524, __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, 1414, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1524, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1414, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1524, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1414, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1524, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1414, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1524, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -38987,7 +40226,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, 1414, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1524, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -38998,8 +40237,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, 1414, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1414, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1524, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1524, __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 */ @@ -39044,19 +40283,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1415 + /* "constraint/constraints.py":1525 * * 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, 1415, __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, 1525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1416 + /* "constraint/constraints.py":1526 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * set = self._set * missing = 0 # <<<<<<<<<<<<<< @@ -39066,7 +40305,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":1417 + /* "constraint/constraints.py":1527 * set = self._set * missing = 0 * found = 0 # <<<<<<<<<<<<<< @@ -39076,7 +40315,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":1418 + /* "constraint/constraints.py":1528 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -39088,9 +40327,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, 1418, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1528, __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, 1418, __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, 1528, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -39098,7 +40337,7 @@ 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, 1418, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1528, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -39108,7 +40347,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_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, 1418, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1528, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -39119,13 +40358,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1418, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1528, __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, 1418, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1528, __pyx_L1_error) PyErr_Clear(); } break; @@ -39135,36 +40374,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":1419 + /* "constraint/constraints.py":1529 * 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, 1419, __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, 1529, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1420 + /* "constraint/constraints.py":1530 * 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, 1420, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1530, __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, 1420, __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, 1530, __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, 1420, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1530, __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, 1420, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_found, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1530, __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":1419 + /* "constraint/constraints.py":1529 * found = 0 * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -39174,7 +40413,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L5; } - /* "constraint/constraints.py":1422 + /* "constraint/constraints.py":1532 * found += assignments[variable] not in set * else: * missing += 1 # <<<<<<<<<<<<<< @@ -39182,14 +40421,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, 1422, __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, 1532, __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":1418 + /* "constraint/constraints.py":1528 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -39199,53 +40438,53 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1423 + /* "constraint/constraints.py":1533 * 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, 1423, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_missing); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1533, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1424 + /* "constraint/constraints.py":1534 * 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, 1424, __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, 1534, __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, 1424, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1534, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1425 + /* "constraint/constraints.py":1535 * 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, 1425, __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, 1535, __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, 1425, __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, 1535, __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, 1425, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1535, __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, 1425, __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, 1535, __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, 1425, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1535, __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":1426 + /* "constraint/constraints.py":1536 * if self._exact: * if not (found <= self._n <= missing + found): * return False # <<<<<<<<<<<<<< @@ -39257,7 +40496,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1425 + /* "constraint/constraints.py":1535 * if missing: * if self._exact: * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< @@ -39266,7 +40505,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1424 + /* "constraint/constraints.py":1534 * missing += 1 * if missing: * if self._exact: # <<<<<<<<<<<<<< @@ -39276,7 +40515,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L8; } - /* "constraint/constraints.py":1428 + /* "constraint/constraints.py":1538 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -39284,18 +40523,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, 1428, __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, 1538, __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, 1428, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1538, __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, 1428, __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, 1538, __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, 1428, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1538, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":1429 + /* "constraint/constraints.py":1539 * else: * if self._n > missing + found: * return False # <<<<<<<<<<<<<< @@ -39307,7 +40546,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1428 + /* "constraint/constraints.py":1538 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -39318,33 +40557,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __pyx_L8:; - /* "constraint/constraints.py":1430 + /* "constraint/constraints.py":1540 * 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, 1430, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1540, __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, 1430, __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, 1540, __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, 1430, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1540, __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, 1430, __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, 1540, __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, 1430, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1540, __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":1433 + /* "constraint/constraints.py":1543 * # All unassigned variables must be assigned to * # values not in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -39356,9 +40595,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, 1433, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1543, __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, 1433, __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, 1543, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -39366,7 +40605,7 @@ 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, 1433, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1543, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -39376,7 +40615,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ { 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, 1433, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1543, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -39387,13 +40626,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1433, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1543, __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, 1433, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1543, __pyx_L1_error) PyErr_Clear(); } break; @@ -39403,45 +40642,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":1434 + /* "constraint/constraints.py":1544 * # 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, 1434, __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, 1544, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1435 + /* "constraint/constraints.py":1545 * 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, 1435, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1436 + /* "constraint/constraints.py":1546 * 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, 1436, __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, 1546, __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, 1436, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1546, __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, 1436, __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, 1546, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -39450,7 +40689,7 @@ 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, 1436, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1546, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -39460,7 +40699,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ { 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, 1436, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1546, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -39471,13 +40710,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1546, __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, 1436, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1546, __pyx_L1_error) PyErr_Clear(); } break; @@ -39487,17 +40726,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":1437 + /* "constraint/constraints.py":1547 * 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, 1437, __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, 1547, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1438 + /* "constraint/constraints.py":1548 * for value in domain[:]: * if value in set: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -39511,12 +40750,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ 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_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1438, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1437 + /* "constraint/constraints.py":1547 * domain = domains[variable] * for value in domain[:]: * if value in set: # <<<<<<<<<<<<<< @@ -39525,7 +40764,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1436 + /* "constraint/constraints.py":1546 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -39535,18 +40774,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1439 + /* "constraint/constraints.py":1549 * 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, 1439, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1549, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_7); if (__pyx_t_5) { - /* "constraint/constraints.py":1440 + /* "constraint/constraints.py":1550 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -39559,7 +40798,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1439 + /* "constraint/constraints.py":1549 * if value in set: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -39568,7 +40807,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1434 + /* "constraint/constraints.py":1544 * # values not in the set. * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -39577,7 +40816,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1433 + /* "constraint/constraints.py":1543 * # All unassigned variables must be assigned to * # values not in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -39587,7 +40826,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1430 + /* "constraint/constraints.py":1540 * if self._n > missing + found: * return False * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< @@ -39596,7 +40835,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1423 + /* "constraint/constraints.py":1533 * else: * missing += 1 * if missing: # <<<<<<<<<<<<<< @@ -39606,7 +40845,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L7; } - /* "constraint/constraints.py":1442 + /* "constraint/constraints.py":1552 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -39614,28 +40853,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, 1442, __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, 1552, __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, 1442, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1552, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1443 + /* "constraint/constraints.py":1553 * 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, 1443, __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, 1553, __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, 1443, __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, 1553, __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, 1443, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1553, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1444 + /* "constraint/constraints.py":1554 * if self._exact: * if found != self._n: * return False # <<<<<<<<<<<<<< @@ -39647,7 +40886,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1443 + /* "constraint/constraints.py":1553 * else: * if self._exact: * if found != self._n: # <<<<<<<<<<<<<< @@ -39656,7 +40895,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1442 + /* "constraint/constraints.py":1552 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -39666,7 +40905,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L23; } - /* "constraint/constraints.py":1446 + /* "constraint/constraints.py":1556 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -39674,26 +40913,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, 1446, __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, 1556, __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, 1446, __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, 1556, __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, 1446, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1556, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1447 + /* "constraint/constraints.py":1557 * 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":1446 + /* "constraint/constraints.py":1556 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -39706,17 +40946,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __pyx_L7:; - /* "constraint/constraints.py":1448 + /* "constraint/constraints.py":1558 * 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":1414 + /* "constraint/constraints.py":1524 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -39743,6 +40985,395 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __Pyx_RefNannyFinishContext(); return __pyx_r; } + +/* "constraint/constraints.py":1563 + * # 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, 1563, __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, 1563, __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, 1563, __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, 1563, __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, 1563, __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, 1563, __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, 1563, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1563, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1563, __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, 1563, __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, 1563, __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":1565 + * 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, 1565, __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, 1565, __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, 1565, __pyx_L1_error) + } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1565, __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, 1565, __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, 1565, __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, 1565, __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, 1565, __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, 1565, __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, 1565, __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, 1565, __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, 1565, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1565, __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, 1565, __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, 1565, __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, 1565, __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, 1565, __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":1563 + * # 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; + PyObject *__pyx_t_4 = NULL; + size_t __pyx_t_5; + 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, 1563, __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":1565 + * 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_INCREF(__pyx_builtin_sum); + __pyx_t_3 = __pyx_builtin_sum; + __pyx_t_4 = __pyx_pf_10constraint_11constraints_14sum_other_vars_genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4}; + __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)); + __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, 1565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "constraint/constraints.py":1563 + * # 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_XDECREF(__pyx_t_4); + __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) { @@ -40227,16 +41858,184 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_1_p }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr)); + (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; +} + +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_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 (((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)))) { + __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 + { + #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); + } + #endif + } +} + +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_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_2_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr_spec = { + "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, + __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct_2_genexpr", /*tp_name*/ + 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*/ + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_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_2_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 PY_VERSION_HEX >= 0x030800b1 && (!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_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_2_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr)); + 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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -40249,11 +42048,11 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_ge 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -40264,8 +42063,8 @@ 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)))) { - __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); + 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)))) { + __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 { @@ -40280,9 +42079,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_gen } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -40302,27 +42101,27 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_gen return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_genexpr}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_2_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_spec = { + "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, - __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_2_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_3_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -40344,7 +42143,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_g 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -40362,7 +42161,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_g #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -40395,16 +42194,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_g }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_3_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr)); + 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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -40417,23 +42216,21 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_ge 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_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); + Py_CLEAR(p->__pyx_v_m); #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)))) { - __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); + 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)))) { + __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 { @@ -40448,49 +42245,43 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_gen } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_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; + 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_3_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_3_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_spec = { + "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, - __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_3_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_4_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -40512,7 +42303,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_g 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -40530,7 +42321,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_g #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -40563,16 +42354,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_g }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_4_genexpr > 0) & (int)(t->tp_basicsize == 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr)); + 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)))) { + 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -40585,21 +42376,21 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_ge 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; +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 (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_preProcess) { 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_domains); + Py_CLEAR(p->__pyx_v_var); #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)))) { - __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); + 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)))) { + __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 { @@ -40614,43 +42405,56 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_gen } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_preProcess(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *)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_domains) { + e = (*v)(p->__pyx_v_domains, 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_var) { + e = (*v)(p->__pyx_v_var, a); if (e) return e; } return 0; } + +static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_5_preProcess(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_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_4_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_preProcess}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_preProcess}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_5_preProcess}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_preProcess}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_4_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess_spec = { + "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, - __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_4_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_5_preProcess", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_preProcess, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -40672,8 +42476,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_g 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_preProcess, /*tp_traverse*/ + __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_5_preProcess, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -40690,7 +42494,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_g #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_preProcess, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -40723,16 +42527,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_g }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_preProcess(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +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_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)))) { - 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]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -40745,21 +42549,23 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_pr 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; +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((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_5_preProcess) { + 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_v_domains); - Py_CLEAR(p->__pyx_v_var); + 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 (((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)))) { - __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); + 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); } else #endif { @@ -40774,56 +42580,49 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_pre } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_preProcess(PyObject *o, visitproc v, void *a) { +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_5_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *)o; + 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_v_domains) { - e = (*v)(p->__pyx_v_domains, 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_var) { - e = (*v)(p->__pyx_v_var, 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; -} - -static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_5_preProcess(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_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_5_preProcess_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_preProcess}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_preProcess}, - {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_5_preProcess}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_preProcess}, +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_5_preProcess_spec = { - "constraint.constraints.__pyx_scope_struct_5_preProcess", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess), +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|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_5_preProcess", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess), /*tp_basicsize*/ + "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_5_preProcess, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_6_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -40845,8 +42644,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_p 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*/ 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*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_6_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -40863,7 +42662,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_p #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_preProcess, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_6_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -40896,16 +42695,16 @@ 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_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_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -40918,23 +42717,21 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_6_ge 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_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((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 (__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_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_m); #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 (((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); } else #endif { @@ -40949,49 +42746,43 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_6_gen } } -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_7_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; + 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_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_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_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_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_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_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|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_7_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*/ + "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_6_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_7_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -41013,7 +42804,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_6_g 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_6_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_7_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -41031,7 +42822,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_7_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -41064,16 +42855,16 @@ 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_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_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_8_preProcess > 0) & (int)(t->tp_basicsize == 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -41086,21 +42877,21 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_7_ge 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_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_7_genexpr) { + 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_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_value); + 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_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 (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_8_preProcess < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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 { @@ -41115,43 +42906,56 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_7_gen } } -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_8_preProcess(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_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_genexpr_arg_0) { - e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; + if (p->__pyx_v_domains) { + e = (*v)(p->__pyx_v_domains, 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_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_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_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_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_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_7_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_8_preProcess_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_8_preProcess = { 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_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_7_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_8_preProcess, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -41173,8 +42977,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_7_g 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_7_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*/ @@ -41191,7 +42995,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_8_preProcess, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -41224,16 +43028,16 @@ 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_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_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_9_genexpr > 0) & (int)(t->tp_basicsize == 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -41246,21 +43050,23 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_8_ge 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_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_8_genexpr) { + 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_m); + 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_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 (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_9_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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 { @@ -41275,43 +43081,49 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_8_gen } } -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_9_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_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_m) { - e = (*v)(p->__pyx_v_m, 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_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_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_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_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_8_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_9_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_8_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_9_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_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_8_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_9_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -41333,7 +43145,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_8_g 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_8_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_9_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -41351,7 +43163,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_9_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -41384,16 +43196,16 @@ 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_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_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -41406,21 +43218,21 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_9_pr 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_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_9_preProcess) { + 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_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 (((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); } else #endif { @@ -41435,56 +43247,43 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_9_pre } } -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_10_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_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; } - 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_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_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_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_9_preProcess_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_9_preProcess = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_10_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_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_9_preProcess, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_10_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -41506,8 +43305,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_9_p 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*/ 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_10_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -41524,7 +43323,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_10_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -41557,16 +43356,16 @@ 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_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_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_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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -41579,23 +43378,21 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_10_g 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_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_10_genexpr) { + 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_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_value); #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 (((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); } else #endif { @@ -41610,49 +43407,43 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_10_ge } } -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_11_genexpr(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_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_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_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_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_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_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_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_10_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr = { 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_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_10_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -41674,7 +43465,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_10_ 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_10_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -41692,7 +43483,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_11_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -41725,16 +43516,16 @@ 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_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_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_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__)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -41747,21 +43538,20 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_11_g 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_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_11_genexpr) { + 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_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_value); + Py_CLEAR(p->__pyx_v_assigned_product); #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 (((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); } else #endif { @@ -41776,43 +43566,50 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_ge } } -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_12___call__(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_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_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_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_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_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_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_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_11_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_12___call___slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_12___call__ = { 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_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_11_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12___call__, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -41834,8 +43631,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_ 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_11_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*/ @@ -41852,7 +43649,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_12___call__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -41885,16 +43682,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_ }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12_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_12_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_12_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_12_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -41907,21 +43704,23 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12_g return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12_genexpr(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_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_12_genexpr) { + 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_12_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_12_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_12_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_genexpr *)o); + 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); } else #endif { @@ -41936,43 +43735,49 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12_ge } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_12_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_12_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_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_12_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_12_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12_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_12_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_12_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_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_12_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_12_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12_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_12_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -41994,7 +43799,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_12_ 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_12_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_13_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -42012,180 +43817,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_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 PY_VERSION_HEX >= 0x030800b1 && (!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_13___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___call__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_13___call__[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_13___call__]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__)); - (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; -} - -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13___call__(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___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___call__) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_assigned_product); - Py_CLEAR(p->__pyx_v_target_value); - #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_13___call__ < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_13___call__[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_13___call__++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *)o); - } else - #endif - { - #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); - } - #endif - } -} - -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_13___call__(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *)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_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_13___call__(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___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_13___call___slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13___call__}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_13___call__}, - {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_13___call__}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_13___call__}, - {0, 0}, -}; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_13___call___spec = { - "constraint.constraints.__pyx_scope_struct_13___call__", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___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___call___slots, -}; -#else - -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_13___call__ = { - PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_13___call__", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13___call__), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13___call__, /*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*/ - 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_13___call__, /*tp_traverse*/ - __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_13___call__, /*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_13___call__, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_13_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -42386,16 +44018,16 @@ 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_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_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_15___call__ > 0) & (int)(t->tp_basicsize == 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__]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -42408,23 +44040,20 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_15_g 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_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_15_genexpr) { + 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_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 (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_15___call__ < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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 { @@ -42439,49 +44068,50 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_15_ge } } -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_15___call__(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_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_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_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_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_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_15_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_15___call___slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_15_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_15___call__ = { 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_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_15_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_15___call__, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -42503,8 +44133,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_15_ 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_15_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*/ @@ -42521,7 +44151,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_15___call__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -42588,7 +44218,7 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_16_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_v_p); #if CYTHON_USE_FREELISTS if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_16_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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); @@ -42619,8 +44249,8 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_16_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_v_p) { + e = (*v)(p->__pyx_v_p, a); if (e) return e; } return 0; } @@ -42718,16 +44348,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_16_ }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_17___call__(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_17___call__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_17___call__[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_17___call__]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__)); + 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)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -42740,20 +44370,21 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_17__ return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_17___call__(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__ *)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_17___call__) { + 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_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_17___call__ < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_17___call__[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_17___call__++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__ *)o); + 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); } else #endif { @@ -42768,50 +44399,43 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_17___ } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_17___call__(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_17___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__ *)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_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_17___call__(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___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___call___slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_17___call__}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_17___call__}, - {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_17___call__}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_17___call__}, +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_17___call___spec = { - "constraint.constraints.__pyx_scope_struct_17___call__", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__), +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_17___call___slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_17_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_17___call__ = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_17_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_17___call__", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17___call__), /*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_17___call__, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_17_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -42833,8 +44457,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_17_ 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_17___call__, /*tp_traverse*/ - __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_17___call__, /*tp_clear*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_17_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -42851,7 +44475,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___call__, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_17_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -42916,9 +44540,8 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_18_ge } #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_value); #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); @@ -42943,14 +44566,11 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_18_ge 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_value) { + e = (*v)(p->__pyx_v_value, a); if (e) return e; } return 0; } @@ -43048,16 +44668,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_18_ }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_19_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_19_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_genexpr)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_19_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_19_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_genexpr)); + 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__)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -43070,21 +44690,20 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_19_g return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_19_genexpr(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_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_19_genexpr) { + 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_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_value); + Py_CLEAR(p->__pyx_v_target_value); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_19_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_genexpr)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_19_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_19_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_genexpr *)o); + 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); } else #endif { @@ -43099,43 +44718,50 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_19_ge } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_19_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_19_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_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_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_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_19_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_19_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_19_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_19_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_19_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_19_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_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_19_genexpr_slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_19___call___slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_19_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_19___call__ = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_19_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19_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_19_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_19___call__, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -43157,8 +44783,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_19_ 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_19_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*/ @@ -43175,7 +44801,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_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*/ @@ -43240,8 +44866,9 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_20_ge } #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_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); @@ -43266,11 +44893,14 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_20_ge 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; } @@ -43368,16 +44998,16 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_20_ }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_21___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_21___call__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_21___call__[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_21___call__]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars > 0) & (int)(t->tp_basicsize == 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]; + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -43390,20 +45020,21 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_21__ return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_21___call__(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___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_21___call__) { + 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_21___call__ < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_21___call__[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_21___call__++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___call__ *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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 { @@ -43418,50 +45049,56 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_21___ } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_21___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_21___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___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_21___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_21___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___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_21___call___slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_21___call__}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_21___call__}, - {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_21___call__}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_21___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_21___call___spec = { - "constraint.constraints.__pyx_scope_struct_21___call__", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___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_21___call___slots, + __pyx_type_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_21___call__ = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_21___call__", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21___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_21___call__, /*tp_dealloc*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -43483,8 +45120,8 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_21_ 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*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_21___call__, /*tp_traverse*/ - __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_21___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*/ @@ -43501,7 +45138,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_21_ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_21___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*/ @@ -43568,7 +45205,8 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_22_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_22_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == 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); @@ -43599,8 +45237,11 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_22_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; } @@ -43768,15 +45409,15 @@ 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, 425, __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, 425, __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, 425, __pyx_L1_error) #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)) { @@ -43784,15 +45425,15 @@ 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, 428, __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, 428, __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, 428, __pyx_L1_error) #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)) { @@ -43800,15 +45441,15 @@ 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, 442, __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, 442, __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, 442, __pyx_L1_error) #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)) { @@ -43816,15 +45457,15 @@ 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, 443, __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, 443, __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, 443, __pyx_L1_error) #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)) { @@ -43832,15 +45473,15 @@ 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, 607, __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, 607, __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, 607, __pyx_L1_error) #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)) { @@ -43848,15 +45489,15 @@ 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, 610, __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, 610, __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, 610, __pyx_L1_error) #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)) { @@ -43864,15 +45505,15 @@ 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, 618, __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, 618, __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, 618, __pyx_L1_error) #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)) { @@ -43880,15 +45521,15 @@ 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, 786, __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, 786, __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, 786, __pyx_L1_error) #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)) { @@ -43896,47 +45537,47 @@ 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, 789, __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, 789, __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, 789, __pyx_L1_error) #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, 797, __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, 797, __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, 797, __pyx_L1_error) #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, 862, __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, 862, __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, 862, __pyx_L1_error) #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)) { @@ -43944,15 +45585,15 @@ 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, 781, __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, 781, __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, 891, __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, 891, __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, 781, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr) < 0) __PYX_ERR(0, 891, __pyx_L1_error) #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)) { @@ -43960,47 +45601,47 @@ 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_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr)) __PYX_ERR(0, 810, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(0, 810, __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, 982, __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, 982, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_12_genexpr; + __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_genexpr) < 0) __PYX_ERR(0, 810, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__) < 0) __PYX_ERR(0, 982, __pyx_L1_error) #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_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12_genexpr->tp_getattro = PyObject_GenericGetAttr; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13___call__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_13___call___spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13___call__)) __PYX_ERR(0, 895, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_13___call___spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13___call__) < 0) __PYX_ERR(0, 895, __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, 1005, __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, 1005, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13___call__ = &__pyx_type_10constraint_11constraints___pyx_scope_struct_13___call__; + __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___call__) < 0) __PYX_ERR(0, 895, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr) < 0) __PYX_ERR(0, 1005, __pyx_L1_error) #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___call__->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13___call__->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13___call__->tp_getattro = PyObject_GenericGetAttr; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr->tp_getattro = PyObject_GenericGetAttr; } #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, 918, __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, 918, __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, 1006, __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, 1006, __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, 918, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr) < 0) __PYX_ERR(0, 1006, __pyx_L1_error) #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)) { @@ -44008,31 +45649,31 @@ 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, 919, __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, 919, __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, 1138, __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, 1138, __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, 919, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15___call__) < 0) __PYX_ERR(0, 1138, __pyx_L1_error) #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_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, 933, __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, 933, __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, 1174, __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, 1174, __pyx_L1_error) #else __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_genexpr) < 0) __PYX_ERR(0, 933, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr) < 0) __PYX_ERR(0, 1174, __pyx_L1_error) #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_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -44040,31 +45681,31 @@ 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_17___call__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_17___call___spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17___call__)) __PYX_ERR(0, 1039, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_17___call___spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17___call__) < 0) __PYX_ERR(0, 1039, __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, 1214, __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, 1214, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17___call__ = &__pyx_type_10constraint_11constraints___pyx_scope_struct_17___call__; + __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___call__) < 0) __PYX_ERR(0, 1039, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr) < 0) __PYX_ERR(0, 1214, __pyx_L1_error) #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___call__->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17___call__->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17___call__->tp_getattro = PyObject_GenericGetAttr; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr->tp_getattro = PyObject_GenericGetAttr; } #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, 1075, __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, 1075, __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, 1243, __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, 1243, __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, 1075, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr) < 0) __PYX_ERR(0, 1243, __pyx_L1_error) #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)) { @@ -44072,31 +45713,31 @@ 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_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_19_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19_genexpr)) __PYX_ERR(0, 1110, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_19_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19_genexpr) < 0) __PYX_ERR(0, 1110, __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, 1325, __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, 1325, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_19_genexpr; + __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_genexpr) < 0) __PYX_ERR(0, 1110, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__) < 0) __PYX_ERR(0, 1325, __pyx_L1_error) #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_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19_genexpr->tp_getattro = PyObject_GenericGetAttr; + 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)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__->tp_getattro = PyObject_GenericGetAttr; } #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, 1139, __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, 1139, __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, 1361, __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, 1361, __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, 1139, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr) < 0) __PYX_ERR(0, 1361, __pyx_L1_error) #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)) { @@ -44104,31 +45745,31 @@ 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_21___call__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_21___call___spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21___call__)) __PYX_ERR(0, 1215, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_21___call___spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21___call__) < 0) __PYX_ERR(0, 1215, __pyx_L1_error) + __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, 1563, __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, 1563, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21___call__ = &__pyx_type_10constraint_11constraints___pyx_scope_struct_21___call__; + __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___call__) < 0) __PYX_ERR(0, 1215, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars) < 0) __PYX_ERR(0, 1563, __pyx_L1_error) #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___call__->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21___call__->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21___call__->tp_getattro = PyObject_GenericGetAttr; + 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, 1251, __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, 1251, __pyx_L1_error) + __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, 1565, __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, 1565, __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, 1251, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_22_genexpr) < 0) __PYX_ERR(0, 1565, __pyx_L1_error) #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)) { @@ -44558,7 +46199,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[17])); if (unlikely(!__pyx_t_4)) __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[16])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 11, __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); @@ -44579,7 +46220,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[18])); if (unlikely(!__pyx_t_3)) __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[17])); 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); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -44598,7 +46239,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[19])); if (unlikely(!__pyx_t_4)) __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[18])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __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) @@ -44606,7 +46247,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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_SetDefaultsGetter(__pyx_t_4, __pyx_pf_10constraint_11constraints_2__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) @@ -44659,7 +46300,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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[20])); if (unlikely(!__pyx_t_6)) __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[19])); 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); @@ -44679,7 +46320,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[21])); if (unlikely(!__pyx_t_4)) __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[20])); 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) @@ -44695,7 +46336,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_4)->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_SetDefaultsGetter(__pyx_t_4, __pyx_pf_10constraint_11constraints_4__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) @@ -44750,7 +46391,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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[22])); if (unlikely(!__pyx_t_6)) __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[21])); 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); @@ -44765,7 +46406,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); * 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[23])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L1_error) + __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[22])); 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) @@ -44773,7 +46414,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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__); + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_6, __pyx_pf_10constraint_11constraints_6__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; @@ -44827,7 +46468,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[24])); if (unlikely(!__pyx_t_3)) __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[23])); 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) @@ -44843,7 +46484,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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_SetDefaultsGetter(__pyx_t_3, __pyx_pf_10constraint_11constraints_8__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) @@ -44899,7 +46540,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); 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[25])); if (unlikely(!__pyx_t_5)) __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[24])); 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) @@ -44915,7 +46556,7 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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_SetDefaultsGetter(__pyx_t_5, __pyx_pf_10constraint_11constraints_10__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) @@ -44959,63 +46600,63 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":289 + /* "constraint/constraints.py":294 * """ * * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __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(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __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[26])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error) + 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, 294, __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, 294, __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[25])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __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) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":301 - * self._multipliers = multipliers + /* "constraint/constraints.py":309 + * 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) */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __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[27])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 301, __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, 309, __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, 309, __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, 309, __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, 309, __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[26])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __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) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":318 - * domain.remove(value) + /* "constraint/constraints.py":332 + * 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 */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __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[28])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __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, 332, __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, 332, __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, 332, __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[27])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __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_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_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":278 @@ -45033,1439 +46674,1477 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":366 + /* "constraint/constraints.py":391 * return sum == exactsum * * 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, 366, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __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_t_3 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __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_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __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_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, 391, __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 (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 391, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":377 - * """ + /* "constraint/constraints.py":409 + * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __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[29])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 377, __pyx_L1_error) + 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, 409, __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, 409, __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, 409, __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[28])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 409, __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) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":396 + /* "constraint/constraints.py":428 * 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, 396, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 428, __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[30])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __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, 428, __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, 428, __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, 428, __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, 428, __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[29])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __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_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_3) < 0) __PYX_ERR(0, 396, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_3) < 0) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":418 + /* "constraint/constraints.py":450 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __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[31])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 450, __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, 450, __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, 450, __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[30])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 450, __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) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":366 + /* "constraint/constraints.py":391 * return sum == exactsum * * class VariableExactSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the sum of variables equals the value of another variable. * */ - __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_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, 391, __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 (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 391, __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":470 + /* "constraint/constraints.py":502 * * * 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, 470, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __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_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __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, 470, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __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, 502, __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_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, 502, __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 (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 502, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":481 + /* "constraint/constraints.py":518 * """ * * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 518, __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[32])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error) + 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, 518, __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, 518, __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[31])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 518, __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); __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) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_3) < 0) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":493 - * self._multipliers = multipliers + /* "constraint/constraints.py":531 + * 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) */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 531, __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[33])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 493, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 531, __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, 531, __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, 531, __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, 531, __pyx_L1_error) + __pyx_t_5 = __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_5)) __PYX_ERR(0, 531, __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, 493, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "constraint/constraints.py":547 + * self._var_max = { variable: max(domains[variable]) * multiplier 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 +*/ + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 547, __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, 547, __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, 547, __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, 547, __pyx_L1_error) + __pyx_t_3 = __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_3)) __PYX_ERR(0, 547, __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_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, 547, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":470 + /* "constraint/constraints.py":502 * * * class MinSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum at least 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_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) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __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_3)) __PYX_ERR(0, 502, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 502, __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":513 - * return sum >= minsum + /* "constraint/constraints.py":574 + * return sum >= minsum or missing * * 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, 513, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __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, 574, __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, 574, __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, 574, __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_GOTREF(__pyx_t_5); + __pyx_t_3 = __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_3)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); 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_3, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 574, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":524 + /* "constraint/constraints.py":591 * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = 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, 591, __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[34])); 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, 591, __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, 591, __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, 591, __pyx_L1_error) + __pyx_t_5 = __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_5)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[3]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __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_3, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":543 + /* "constraint/constraints.py":610 * 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[35])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 610, __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, 610, __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, 610, __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, 610, __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, 610, __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[35])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 610, __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) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":556 + /* "constraint/constraints.py":623 * 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, 623, __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[36])); 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, 623, __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, 623, __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, 623, __pyx_L1_error) + __pyx_t_5 = __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_5)) __PYX_ERR(0, 623, __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_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_3, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 623, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":513 - * return sum >= minsum + /* "constraint/constraints.py":574 + * return sum >= minsum or missing * * class VariableMinSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the sum of variables sum at least to 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_5 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 574, __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_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":584 + /* "constraint/constraints.py":651 * * * 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, 584, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 651, __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, 651, __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, 651, __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_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_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 651, __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_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_5)) __PYX_ERR(0, 651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); 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_5, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 651, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":595 + /* "constraint/constraints.py":667 * """ * * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = 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, 667, __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[37])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 595, __pyx_L1_error) + 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, 667, __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, 667, __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[37])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 667, __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_3, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 595, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":607 - * self._multipliers = multipliers + /* "constraint/constraints.py":681 + * 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_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, 681, __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[38])); 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, 681, __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, 681, __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, 681, __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, 681, __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[38])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 681, __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_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 607, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":642 - * domain.remove(value) + /* "constraint/constraints.py":699 + * 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 */ - __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, 699, __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[39])); 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, 699, __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, 699, __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, 699, __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[39])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __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_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_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":584 + /* "constraint/constraints.py":651 * * * class MaxSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum up 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_3, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 651, __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 (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 651, __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_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":683 + /* "constraint/constraints.py":753 * * * 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, 683, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __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_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __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_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __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_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 753, __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_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, 753, __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 (__pyx_t_2 != __pyx_t_3) { + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 753, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":694 + /* "constraint/constraints.py":770 * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __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[40])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __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, 770, __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, 770, __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, 770, __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[40])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 770, __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_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) + __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, 770, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":713 + /* "constraint/constraints.py":789 * 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, 789, __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[41])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 713, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __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, 789, __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, 789, __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, 789, __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, 789, __pyx_L1_error) + __pyx_t_3 = __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_3)) __PYX_ERR(0, 789, __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_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 713, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_3) < 0) __PYX_ERR(0, 789, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":726 + /* "constraint/constraints.py":802 * 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_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[42])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __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, 802, __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, 802, __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, 802, __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[42])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 802, __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, 726, __pyx_L1_error) + __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, 802, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":683 + /* "constraint/constraints.py":753 * * * class VariableMaxSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the sum of variables sum at most 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_5, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 753, __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 (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 753, __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_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":754 + /* "constraint/constraints.py":830 * * * 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, 754, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 830, __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_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 830, __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, 754, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 830, __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, 830, __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_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, 830, __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_5) { + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 830, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":765 + /* "constraint/constraints.py":846 * """ * * def __init__(self, exactprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate an ExactProdConstraint. * */ - __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[43])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 765, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 846, __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 (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exactprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 846, __pyx_L1_error) + __pyx_t_3 = __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_3)) __PYX_ERR(0, 846, __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_init, __pyx_t_3) < 0) __PYX_ERR(0, 846, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":774 + /* "constraint/constraints.py":855 * 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, 774, __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, 774, __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, 774, __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, 774, __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, 774, __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[44])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __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, 774, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 855, __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, 855, __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, 855, __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, 855, __pyx_L1_error) + __pyx_t_5 = __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_5)) __PYX_ERR(0, 855, __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_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":802 + /* "constraint/constraints.py":883 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * exactprod = self._exactprod * prod = 1 */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __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, 802, __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, 802, __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, 802, __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[45])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 802, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 883, __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, 802, __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, 883, __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, 883, __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, 883, __pyx_L1_error) + __pyx_t_3 = __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_3)) __PYX_ERR(0, 883, __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_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, 883, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":754 + /* "constraint/constraints.py":830 * * * class ExactProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product of exactly 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_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) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __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_3)) __PYX_ERR(0, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 830, __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":833 + /* "constraint/constraints.py":914 * return True * * 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, 833, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 914, __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, 833, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 914, __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, 833, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 914, __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, 833, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 914, __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, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __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_3)) __PYX_ERR(0, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_2 != __pyx_t_4) { - if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 833, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 914, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":844 + /* "constraint/constraints.py":931 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # <<<<<<<<<<<<<< * """Instantiate a VariableExactProdConstraint. * */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 931, __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, 844, __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, 844, __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[46])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 844, __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, 931, __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, 931, __pyx_L1_error) + __pyx_t_5 = __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_5)) __PYX_ERR(0, 931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __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, 844, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(0, 931, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":854 + /* "constraint/constraints.py":941 * 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[47])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __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, 854, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __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_5)) __PYX_ERR(0, 941, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[3]); + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_get_product_bounds, __pyx_t_5) < 0) __PYX_ERR(0, 941, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":874 + /* "constraint/constraints.py":961 * 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[48])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __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, 874, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __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_5)) __PYX_ERR(0, 961, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_safe_product, __pyx_t_5) < 0) __PYX_ERR(0, 961, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":880 + /* "constraint/constraints.py":967 * return prod * * 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, 880, __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, 880, __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, 880, __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, 880, __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, 880, __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[49])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 967, __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, 967, __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, 967, __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, 967, __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, 967, __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[49])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 967, __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, 880, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":895 + /* "constraint/constraints.py":982 * 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_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 895, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 982, __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, 895, __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, 895, __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, 895, __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[50])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 895, __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, 982, __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, 982, __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, 982, __pyx_L1_error) + __pyx_t_5 = __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_5)) __PYX_ERR(0, 982, __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_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, 895, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 982, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":833 + /* "constraint/constraints.py":914 * return True * * class VariableExactProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the product of variables equals 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, 833, __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, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 914, __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_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":941 + /* "constraint/constraints.py":1029 * * * 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, 941, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1029, __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, 941, __pyx_L1_error) + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1029, __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, 941, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1029, __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, 941, __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, 941, __pyx_L1_error) + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1029, __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_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_5)) __PYX_ERR(0, 1029, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2 != __pyx_t_6) { - if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 941, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 1029, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":952 - * """ + /* "constraint/constraints.py":1045 + * """ # noqa: E501 * * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MinProdConstraint. * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 952, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1045, __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, 952, __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[51])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 952, __pyx_L1_error) + 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, 1045, __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[51])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1045, __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_init, __pyx_t_4) < 0) __PYX_ERR(0, 952, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 1045, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":960 + /* "constraint/constraints.py":1053 * 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_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 960, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1053, __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, 960, __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, 960, __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, 960, __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, 960, __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[52])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 960, __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, 1053, __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, 1053, __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, 1053, __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, 1053, __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[52])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1053, __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_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 960, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 1053, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":971 + /* "constraint/constraints.py":1064 * 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_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 971, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1064, __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, 971, __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, 971, __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, 971, __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[53])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 971, __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, 1064, __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, 1064, __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, 1064, __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[53])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1064, __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_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, 971, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 1064, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":941 + /* "constraint/constraints.py":1029 * * * class MinProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product up to at least 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, 941, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1029, __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, 941, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 1029, __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_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":987 + /* "constraint/constraints.py":1080 * * * 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, 987, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __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, 987, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1080, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __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, 987, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __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, 987, __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, 987, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1080, __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_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, 1080, __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, 987, __pyx_L1_error) + if (__pyx_t_2 != __pyx_t_3) { + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 1080, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":998 + /* "constraint/constraints.py":1097 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< * self.target_var = target_var * self.product_vars = product_vars */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 998, __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, 998, __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, 998, __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[54])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 998, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1097, __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, 1097, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_product_vars, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < 0) __PYX_ERR(0, 1097, __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[54])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1097, __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_init, __pyx_t_6) < 0) __PYX_ERR(0, 998, __pyx_L1_error) + __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, 1097, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1002 + /* "constraint/constraints.py":1101 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< * 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[55])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1002, __pyx_L1_error) + __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[55])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1101, __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, 1002, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_get_product_bounds, __pyx_t_6) < 0) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1020 + /* "constraint/constraints.py":1119 * 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[56])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1020, __pyx_L1_error) + __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[56])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1119, __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, 1020, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_safe_product, __pyx_t_6) < 0) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1026 + /* "constraint/constraints.py":1125 * 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, 1026, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1125, __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, 1026, __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, 1026, __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, 1026, __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, 1026, __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[57])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __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, 1125, __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, 1125, __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, 1125, __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, 1125, __pyx_L1_error) + __pyx_t_3 = __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_3)) __PYX_ERR(0, 1125, __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_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_3) < 0) __PYX_ERR(0, 1125, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1039 + /* "constraint/constraints.py":1138 * 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, 1039, __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, 1039, __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, 1039, __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, 1039, __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[58])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1138, __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, 1138, __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, 1138, __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, 1138, __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[58])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1138, __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, 1039, __pyx_L1_error) + __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, 1138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":987 + /* "constraint/constraints.py":1080 * * * 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, 987, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __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, 987, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 1080, __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_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1083 + /* "constraint/constraints.py":1182 * * * 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, 1083, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1182, __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, 1083, __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, 1182, __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, 1083, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1182, __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, 1083, __pyx_L1_error) + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1182, __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, 1083, __pyx_L1_error) + __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, 1182, __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, 1083, __pyx_L1_error) + if (__pyx_t_2 != __pyx_t_5) { + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 1182, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1094 + /* "constraint/constraints.py":1198 * """ * * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MaxProdConstraint. * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1094, __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, 1094, __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[59])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1094, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1198, __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, 1094, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_maxprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 1198, __pyx_L1_error) + __pyx_t_3 = __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_3)) __PYX_ERR(0, 1198, __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_init, __pyx_t_3) < 0) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1103 + /* "constraint/constraints.py":1207 * 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, 1103, __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, 1103, __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, 1103, __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, 1103, __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, 1103, __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[60])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1103, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1207, __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, 1103, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1207, __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, 1207, __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, 1207, __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, 1207, __pyx_L1_error) + __pyx_t_5 = __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_5)) __PYX_ERR(0, 1207, __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_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 1207, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1131 + /* "constraint/constraints.py":1235 * 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, 1131, __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, 1131, __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, 1131, __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, 1131, __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[61])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1131, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1235, __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, 1131, __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, 1235, __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, 1235, __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, 1235, __pyx_L1_error) + __pyx_t_3 = __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_3)) __PYX_ERR(0, 1235, __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_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, 1235, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1083 + /* "constraint/constraints.py":1182 * * * 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, 1083, __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, 1083, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __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_3)) __PYX_ERR(0, 1182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 1182, __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":1163 + /* "constraint/constraints.py":1267 * * * 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, 1163, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1267, __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, 1163, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1267, __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, 1163, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1267, __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, 1163, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1267, __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, 1163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __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_3)) __PYX_ERR(0, 1267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_2 != __pyx_t_4) { - if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 1163, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 1267, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1174 + /* "constraint/constraints.py":1284 * """ # 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, 1174, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1284, __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, 1174, __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, 1174, __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[62])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __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, 1284, __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, 1284, __pyx_L1_error) + __pyx_t_5 = __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_5)) __PYX_ERR(0, 1284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __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, 1174, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(0, 1284, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1178 + /* "constraint/constraints.py":1288 * 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[63])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1178, __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, 1178, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __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_5)) __PYX_ERR(0, 1288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[3]); + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_get_product_bounds, __pyx_t_5) < 0) __PYX_ERR(0, 1288, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1196 + /* "constraint/constraints.py":1306 * 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[64])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1196, __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, 1196, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __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_5)) __PYX_ERR(0, 1306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_safe_product, __pyx_t_5) < 0) __PYX_ERR(0, 1306, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1202 + /* "constraint/constraints.py":1312 * 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, 1202, __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, 1202, __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, 1202, __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, 1202, __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, 1202, __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[65])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1202, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1312, __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, 1312, __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, 1312, __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, 1312, __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, 1312, __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[65])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1312, __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, 1202, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1215 + /* "constraint/constraints.py":1325 * 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, 1215, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1325, __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_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1215, __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[66])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1215, __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, 1325, __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, 1325, __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, 1325, __pyx_L1_error) + __pyx_t_5 = __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_5)) __PYX_ERR(0, 1325, __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_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, 1215, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 1325, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1163 + /* "constraint/constraints.py":1267 * * * 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, 1163, __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, 1163, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 1267, __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_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1259 + /* "constraint/constraints.py":1369 * * * 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, 1259, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1369, __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, 1259, __pyx_L1_error) + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1369, __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, 1259, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1369, __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, 1259, __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, 1259, __pyx_L1_error) + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1369, __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_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_5)) __PYX_ERR(0, 1369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2 != __pyx_t_6) { - if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 1259, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 1369, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1270 + /* "constraint/constraints.py":1380 * """ * * 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[67])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1270, __pyx_L1_error) + __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[67])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1380, __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, 1270, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 1380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1278 + /* "constraint/constraints.py":1388 * 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[68])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1278, __pyx_L1_error) + __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[68])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1388, __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, 1278, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 1388, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1282 + /* "constraint/constraints.py":1392 * 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, 1282, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1392, __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, 1282, __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, 1282, __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, 1282, __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, 1282, __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[69])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1282, __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, 1392, __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, 1392, __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, 1392, __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, 1392, __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[69])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1392, __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, 1282, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 1392, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1259 + /* "constraint/constraints.py":1369 * * * 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, 1259, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1369, __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, 1259, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 1369, __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_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":1293 + /* "constraint/constraints.py":1403 * * * 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, 1293, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1403, __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, 1293, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1403, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __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, 1293, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1403, __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, 1293, __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, 1293, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1403, __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_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, 1403, __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, 1293, __pyx_L1_error) + if (__pyx_t_2 != __pyx_t_3) { + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 1403, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1304 + /* "constraint/constraints.py":1414 * """ * * 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[70])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1304, __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, 1304, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __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_3)) __PYX_ERR(0, 1414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_3) < 0) __PYX_ERR(0, 1414, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1312 + /* "constraint/constraints.py":1422 * 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[71])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1312, __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, 1312, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __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_3)) __PYX_ERR(0, 1422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[1]); + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_3) < 0) __PYX_ERR(0, 1422, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1316 + /* "constraint/constraints.py":1426 * 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, 1316, __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, 1316, __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, 1316, __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, 1316, __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, 1316, __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[72])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1316, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1426, __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, 1426, __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, 1426, __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, 1426, __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, 1426, __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[72])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1426, __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, 1316, __pyx_L1_error) + __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_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 1426, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1293 + /* "constraint/constraints.py":1403 * * * 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, 1293, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1403, __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, 1293, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 1403, __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_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1327 + /* "constraint/constraints.py":1437 * * * 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, 1327, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1437, __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, 1327, __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, 1437, __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, 1327, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1437, __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, 1327, __pyx_L1_error) + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1437, __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, 1327, __pyx_L1_error) + __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, 1437, __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, 1327, __pyx_L1_error) + if (__pyx_t_2 != __pyx_t_5) { + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 1437, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1338 + /* "constraint/constraints.py":1448 * """ * * 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[73])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1338, __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, 1338, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __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_5)) __PYX_ERR(0, 1448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[4]); + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(0, 1448, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1352 + /* "constraint/constraints.py":1462 * 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, 1352, __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, 1352, __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, 1352, __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, 1352, __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[74])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1352, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1462, __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, 1352, __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, 1462, __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, 1462, __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, 1462, __pyx_L1_error) + __pyx_t_3 = __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_3)) __PYX_ERR(0, 1462, __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_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, 1462, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1327 + /* "constraint/constraints.py":1437 * * * 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, 1327, __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, 1327, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __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_3)) __PYX_ERR(0, 1437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 1437, __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":1389 + /* "constraint/constraints.py":1499 * * * 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, 1389, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1499, __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, 1389, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1499, __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, 1389, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1499, __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, 1389, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1499, __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, 1389, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __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_3)) __PYX_ERR(0, 1499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_2 != __pyx_t_4) { - if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 1389, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 1499, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1400 + /* "constraint/constraints.py":1510 * """ * * 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[75])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1400, __pyx_L1_error) + __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[75])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1510, __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, 1400, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 1510, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1414 + /* "constraint/constraints.py":1524 * 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, 1414, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1524, __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, 1414, __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, 1414, __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, 1414, __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[76])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1414, __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, 1524, __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, 1524, __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, 1524, __pyx_L1_error) + __pyx_t_5 = __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_5)) __PYX_ERR(0, 1524, __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_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, 1414, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 1524, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1389 + /* "constraint/constraints.py":1499 * * * 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, 1389, __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, 1389, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 1499, __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_2); __pyx_t_2 = 0; + /* "constraint/constraints.py":1563 + * # 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) +*/ + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1563, __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, 1563, __pyx_L1_error) + __pyx_t_6 = __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_6)) __PYX_ERR(0, 1563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __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_sum_other_vars, __pyx_t_6) < 0) __PYX_ERR(0, 1563, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + /* "constraint/constraints.py":1 * """Module containing the code for constraint definitions.""" # <<<<<<<<<<<<<< * * from constraint.domain import Unassigned */ - __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; + __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 ---*/ @@ -46507,11 +48186,11 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); typedef struct { const char *s; -#if 645 <= 65535 +#if 1027 <= 65535 const unsigned short n; -#elif 645 / 2 < INT_MAX +#elif 1027 / 2 < INT_MAX const unsigned int n; -#elif 645 / 2 < LONG_MAX +#elif 1027 / 2 < LONG_MAX const unsigned long n; #else const Py_ssize_t n; @@ -46594,7 +48273,6 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -46602,6 +48280,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_MinSumConstraint_preProcess, sizeof(__pyx_k_MinSumConstraint_preProcess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinSumConstraint_preProcess */ {__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 */ @@ -46689,7 +48368,6 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -46729,6 +48407,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_max_sum_missing, sizeof(__pyx_k_max_sum_missing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_max_sum_missing */ {__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 */ @@ -46737,6 +48416,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_min_sum_missing, sizeof(__pyx_k_min_sum_missing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_min_sum_missing */ {__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 */ @@ -46744,6 +48424,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_missing_negative, sizeof(__pyx_k_missing_negative), 0, 1, 1}, /* PyObject cname: __pyx_n_u_missing_negative */ {__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 */ @@ -46758,8 +48439,8 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_other_vars_max, sizeof(__pyx_k_other_vars_max), 0, 1, 1}, /* PyObject cname: __pyx_n_u_other_vars_max */ + {__pyx_k_other_vars_min, sizeof(__pyx_k_other_vars_min), 0, 1, 1}, /* PyObject cname: __pyx_n_u_other_vars_min */ {__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 */ @@ -46788,6 +48469,8 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_other_vars, sizeof(__pyx_k_sum_other_vars), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sum_other_vars */ + {__pyx_k_sum_other_vars_locals_genexpr, sizeof(__pyx_k_sum_other_vars_locals_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sum_other_vars_locals_genexpr */ {__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 */ @@ -46811,11 +48494,12 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_var_is_negative, sizeof(__pyx_k_var_is_negative), 0, 1, 1}, /* PyObject cname: __pyx_n_u_var_is_negative */ + {__pyx_k_var_max, sizeof(__pyx_k_var_max), 0, 1, 1}, /* PyObject cname: __pyx_n_u_var_max */ + {__pyx_k_var_min, sizeof(__pyx_k_var_min), 0, 1, 1}, /* PyObject cname: __pyx_n_u_var_min */ {__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 */ @@ -46830,13 +48514,13 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, c 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, 1280, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_min); if (!__pyx_builtin_min) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_max); if (!__pyx_builtin_max) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_round); if (!__pyx_builtin_round) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 1390, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -46859,14 +48543,14 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); - /* "constraint/constraints.py":867 + /* "constraint/constraints.py":954 * 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, 867, __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, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); @@ -46892,25 +48576,25 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); - /* "constraint/constraints.py":289 + /* "constraint/constraints.py":294 * """ * * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """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(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); - /* "constraint/constraints.py":1338 + /* "constraint/constraints.py":1448 * """ * * 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, 1338, __pyx_L1_error) + __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, 1448, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]); __Pyx_RefNannyFinishContext(); @@ -46943,7 +48627,7 @@ static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { unsigned int argcount : 3; unsigned int num_posonly_args : 1; unsigned int num_kwonly_args : 1; - unsigned int nlocals : 6; + unsigned int nlocals : 5; unsigned int flags : 10; unsigned int first_line : 11; unsigned int line_table_length : 14; @@ -46963,390 +48647,395 @@ 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), 425, 2}; 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; } { - 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), 442, 2}; 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; } { - 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), 443, 2}; 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; } { - 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), 607, 2}; 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; } { - 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), 618, 2}; 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; - } - { - 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), 786, 2}; 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_k__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), 797, 2}; 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_k_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), 781, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 862, 2}; 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_k_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), 810, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 891, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_value}; - __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_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; + __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_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), 918, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1005, 2}; 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_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), 919, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1006, 2}; 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_A_2, 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), 933, 2}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_c}; - __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_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) 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_k_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), 1075, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1174, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_p}; - __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_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) 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_k_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), 1110, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1214, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_value}; - __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, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad; + __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, 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), 1139, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1243, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_value}; - __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_k_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) 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_k_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), 1251, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1361, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_p}; - __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_genexpr, __pyx_k_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) 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_k_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), 1565, 2}; + 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_k_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}; 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[17] = __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[17])) 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_k_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}; 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[18] = __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[18])) 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_k_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}; 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[19] = __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[19])) 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_k_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}; 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_Zz_IQ_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) 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_k_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}; 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[21] = __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[21])) 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_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[20])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 194, 23}; 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[22] = __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[22])) 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_k_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}; 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[23] = __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[23])) 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_k_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}; 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[24] = __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[24])) 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_k_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}; 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[25] = __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[25])) 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_k_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), 294, 49}; 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[26] = __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[26])) 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_k_4M_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[27] = __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[27])) goto bad; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 22, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 309, 378}; + 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_k_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[28] = __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[28])) goto bad; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 332, 535}; + 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_k_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), 409, 86}; 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[29] = __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[29])) 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_k_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), 428, 220}; 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[30] = __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[30])) 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_k_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), 450, 347}; 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[31] = __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[31])) 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_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[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), 518, 34}; 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[32] = __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[32])) 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_k_2_q_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[33] = __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[33])) goto bad; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 531, 219}; + 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_k_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), 547, 195}; + 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_k_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), 591, 86}; 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[34] = __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[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), 610, 114}; 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[35] = __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[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), 623, 184}; 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[36] = __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[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), 667, 42}; 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[37] = __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[37])) 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_k_2_q_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[38] = __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[38])) goto bad; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 681, 253}; + 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_k_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[39] = __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[39])) goto bad; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 699, 445}; + 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_k_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), 770, 86}; 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[40] = __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[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), 789, 114}; 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[41] = __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[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), 802, 184}; 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[42] = __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[42])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 765, 22}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 846, 22}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exactprod}; __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_k_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), 774, 216}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 855, 216}; 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[44] = __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[44])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 802, 297}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 883, 297}; 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_k_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), 844, 25}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 931, 25}; 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[46] = __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[46])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 854, 161}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 941, 161}; 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[47] = __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[47])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 874, 24}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 961, 24}; 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[48] = __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[48])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 880, 167}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 967, 167}; 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[49] = __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[49])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 32, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 895, 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}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 20, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 982, 246}; + 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_k_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), 952, 14}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1045, 14}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_minprod}; __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_k_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), 960, 92}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1053, 92}; 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[52] = __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[52])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 971, 95}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1064, 95}; 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[53] = __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[53])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 998, 23}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1097, 23}; 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[54] = __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[54])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1002, 148}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1101, 148}; 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[55] = __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[55])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1020, 24}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1119, 24}; 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[56] = __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[56])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1026, 138}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1125, 138}; 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[57] = __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[57])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 31, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1039, 395}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 31, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1138, 395}; 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[58] = __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[58])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1094, 22}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1198, 22}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_maxprod}; __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_k_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), 1103, 216}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1207, 216}; 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[60] = __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[60])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1131, 287}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1235, 287}; 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_k_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), 1174, 23}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1284, 23}; 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[62] = __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[62])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1178, 148}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1288, 148}; 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[63] = __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[63])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1196, 24}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1306, 24}; 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[64] = __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[64])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1202, 138}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1312, 138}; 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[65] = __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[65])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 31, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1215, 395}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 31, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1325, 395}; 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[66] = __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[66])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1270, 11}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1380, 11}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set}; __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_k_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), 1278, 14}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1388, 14}; 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[68] = __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[68])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1282, 91}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1392, 91}; 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[69] = __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[69])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1304, 11}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1414, 11}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set}; __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_k_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), 1312, 14}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1422, 14}; 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[71] = __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[71])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1316, 91}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1426, 91}; 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[72] = __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[72])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1338, 30}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1448, 30}; 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; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1352, 249}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1462, 249}; 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_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), 1400, 30}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1510, 30}; 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[75] = __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[75])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1414, 249}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1524, 249}; 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[76] = __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[76])) goto bad; } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1563, 17}; + 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_k_3gQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[77])) goto bad; + } Py_DECREF(tuple_dedup_map); return 0; bad: @@ -49707,6 +51396,56 @@ 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); + } + 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 + /* RaiseUnboundLocalError */ static void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); @@ -49911,56 +51650,6 @@ 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) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { diff --git a/constraint/constraints.py b/constraint/constraints.py index 7d9414a..40556da 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -310,9 +310,9 @@ def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple Constraint.preProcess(self, variables, domains, constraints, vconstraints) multipliers = self._multipliers if self._multipliers else [1] * len(variables) exactsum = self._exactsum - self._var_min = { variable: min(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } - self._var_max = { variable: max(domains[variable]) * multiplier 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 + # preprocess the domains to remove values that cannot contribute to the exact sum for variable, multiplier in zip(variables, multipliers): domain = domains[variable] @@ -325,8 +325,8 @@ def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple domain.remove(value) # recalculate the min and max after pruning - self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } - self._var_min = { variable: min(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } + self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + self._var_min = { variable: min(domains[variable]) * multiplier 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 @@ -404,7 +404,7 @@ class VariableExactSumConstraint(Constraint): >>> 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): """Initialization method. @@ -531,7 +531,7 @@ def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = 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) } + 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 for variable, multiplier in zip(variables, multipliers): @@ -542,7 +542,7 @@ def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple domain.remove(value) # recalculate the max after pruning - self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } + self._var_max = { variable: max(domains[variable]) * multiplier 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 @@ -682,7 +682,7 @@ def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple 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) } + 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): @@ -693,7 +693,7 @@ def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple domain.remove(value) # recalculate the min and max after pruning - self._var_min = { variable: min(domains[variable]) * multiplier 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_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 @@ -1040,7 +1040,7 @@ class MinProdConstraint(Constraint): >>> 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]): """Instantiate a MinProdConstraint. From daedca017dea06f170ae12e2f818366d7f5d7d08 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Wed, 23 Jul 2025 01:01:34 +0200 Subject: [PATCH 56/87] Resolved an issue with the number detection regex --- constraint/parser.c | 18 +++++++++--------- constraint/parser.py | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/constraint/parser.c b/constraint/parser.c index f5ed95c..949c913 100644 --- a/constraint/parser.c +++ b/constraint/parser.c @@ -1613,7 +1613,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr { * 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('[+-]?\d+', restriction)) > 0: # adjust when we support modifiers such as multipliers + * if len(re.findall(r'[+-]?\d+', restriction)) > 0: # TODO adjust when we support modifiers such as multipliers (see roadmap) # noqa: E501 */ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr { PyObject_HEAD @@ -3037,7 +3037,7 @@ static const char __pyx_k_restrictions_unique_indices[] = "restrictions_unique_i 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\020\210s\220!\220;\230c\240\021\330\020\027\220q\330\014\037\230q\330\020\026\220j\240\001\240\022\240>\3201P\320P[\320[`\320`a\330\014\017\210s\220!\2202\220X\230Q\230l\250.\270\002\270!\340\020\027\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\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_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\020\210s\220!\220;\230c\240\021\330\020\027\220q\330\014\037\230q\330\020\026\220j\240\001\240\022\240>\3201P\320P[\320[`\320`a\330\014\017\210s\220!\2202\220X\230Q\230m\250>\270\022\2701\340\020\027\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\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]]"; @@ -5866,7 +5866,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric * 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('[+-]?\d+', restriction)) > 0: # adjust when we support modifiers such as multipliers + * if len(re.findall(r'[+-]?\d+', restriction)) > 0: # TODO adjust when we support modifiers such as multipliers (see roadmap) # noqa: E501 */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { @@ -8135,7 +8135,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * 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('[+-]?\d+', restriction)) > 0: # adjust when we support modifiers such as multipliers + * if len(re.findall(r'[+-]?\d+', restriction)) > 0: # TODO adjust when we support modifiers such as multipliers (see roadmap) # noqa: E501 */ __pyx_t_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_variables); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -8150,7 +8150,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * 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('[+-]?\d+', restriction)) > 0: # adjust when we support modifiers such as multipliers + * 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_5 = NULL; @@ -8196,14 +8196,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * 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('[+-]?\d+', restriction)) > 0: # adjust when we support modifiers such as multipliers + * if len(re.findall(r'[+-]?\d+', restriction)) > 0: # TODO adjust when we support modifiers such as multipliers (see roadmap) # noqa: E501 */ } /* "constraint/parser.py":172 * 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('[+-]?\d+', restriction)) > 0: # adjust when we support modifiers such as multipliers # <<<<<<<<<<<<<< + * 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 */ @@ -8239,7 +8239,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ if (__pyx_t_1) { /* "constraint/parser.py":174 - * if len(re.findall('[+-]?\d+', restriction)) > 0: # adjust when we support modifiers such as multipliers + * 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 # <<<<<<<<<<<<<< * @@ -8252,7 +8252,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ /* "constraint/parser.py":172 * 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('[+-]?\d+', restriction)) > 0: # adjust when we support modifiers such as multipliers # <<<<<<<<<<<<<< + * 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 */ diff --git a/constraint/parser.py b/constraint/parser.py index d5979cf..62d19ea 100644 --- a/constraint/parser.py +++ b/constraint/parser.py @@ -169,7 +169,7 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: 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('[+-]?\d+', restriction)) > 0: # adjust when we support modifiers such as multipliers + 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 From ac758b1455ffd9d30f476d87350b6de398002e2f Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Wed, 23 Jul 2025 01:04:06 +0200 Subject: [PATCH 57/87] Bumped version number to next expected release --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 58895a2..a4ca0a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ 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.2" # adhere to PEP440 versioning: https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#id55 +version = "2.4.0" # adhere to PEP440 versioning: https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#id55 authors = [ {name = "Floris-Jan Willemsen", email = "fjwillemsen97@gmail.com"}, {name = "Sébastien Celles", email = "s.celles@gmail.com"}, From 2584997c94d629579d706e34c7d51dce16334d5e Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Wed, 23 Jul 2025 01:40:59 +0200 Subject: [PATCH 58/87] Addressing #56: Variables values can be instantiated with any type that can be made iterable --- constraint/problem.c | 1359 +++++++++++++++++++++-------------------- constraint/problem.py | 4 +- 2 files changed, 712 insertions(+), 651 deletions(-) diff --git a/constraint/problem.c b/constraint/problem.c index 8cdb214..7a74fe0 100644 --- a/constraint/problem.c +++ b/constraint/problem.c @@ -1510,7 +1510,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":164 * return * elif isinstance(constraint, list): * assert all(isinstance(c, str) for c in constraint), f"Expected constraints to be strings, got {constraint}" # <<<<<<<<<<<<<< @@ -1524,7 +1524,7 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr { }; -/* "constraint/problem.py":237 +/* "constraint/problem.py":239 * return self._solver.getSolutionIter(domains, constraints, vconstraints) * * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: # <<<<<<<<<<<<<< @@ -1537,7 +1537,7 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedL }; -/* "constraint/problem.py":241 +/* "constraint/problem.py":243 * solutions: list[dict] = self.getSolutions() * if order is None or len(order) == 1: * return list(tuple(solution.values()) for solution in solutions) # <<<<<<<<<<<<<< @@ -1551,7 +1551,7 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr { }; -/* "constraint/problem.py":243 +/* "constraint/problem.py":245 * 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 +1566,7 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr { }; -/* "constraint/problem.py":288 +/* "constraint/problem.py":290 * # 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 # <<<<<<<<<<<<<< @@ -2827,15 +2827,15 @@ static const char __pyx_k_Problem_setSolver_line_57[] = "Problem.setSolver (line 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_Problem_getSolution_line_180[] = "Problem.getSolution (line 180)"; +static const char __pyx_k_Problem_addVariables_line_118[] = "Problem.addVariables (line 118)"; +static const char __pyx_k_Problem_getSolutions_line_199[] = "Problem.getSolutions (line 199)"; 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_addConstraint_line_141[] = "Problem.addConstraint (line 141)"; 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_9Ct1_D_AQ_4z_V7_4t7_8ST_T_Qha[] = "\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\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"; 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\320&\\\320\\]\330\024\026\320\026-\250T\260\021\260#\260Q\260a\260r\270\024\270U\300/\320QT\320Tb\320bh\320hi\320il\320ln\320no\330\024\026\320\026'\240t\320+<\270D\300\001\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"; @@ -2844,7 +2844,7 @@ static const char __pyx_k_Problem_getSolutionsOrderedList[] = "Problem.getSoluti static const char __pyx_k_duplicate_parameter_configurati[] = " duplicate parameter configurations out of "; 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_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, set, 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."; @@ -2858,7 +2858,7 @@ static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note that Cython 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_Problem_getSolutionIter_line_218[] = "Problem.getSolutionIter (line 218)"; 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 "; @@ -3044,21 +3044,21 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_Problem__getArgs __pyx_string_tab[32] #define __pyx_n_u_Problem__getArgs_locals_genexpr __pyx_string_tab[33] #define __pyx_n_u_Problem_addConstraint __pyx_string_tab[34] -#define __pyx_kp_u_Problem_addConstraint_line_139 __pyx_string_tab[35] +#define __pyx_kp_u_Problem_addConstraint_line_141 __pyx_string_tab[35] #define __pyx_n_u_Problem_addConstraint_locals_gen __pyx_string_tab[36] #define __pyx_n_u_Problem_addVariable __pyx_string_tab[37] #define __pyx_kp_u_Problem_addVariable_line_86 __pyx_string_tab[38] #define __pyx_n_u_Problem_addVariables __pyx_string_tab[39] -#define __pyx_kp_u_Problem_addVariables_line_116 __pyx_string_tab[40] +#define __pyx_kp_u_Problem_addVariables_line_118 __pyx_string_tab[40] #define __pyx_n_u_Problem_getSolution __pyx_string_tab[41] #define __pyx_n_u_Problem_getSolutionIter __pyx_string_tab[42] -#define __pyx_kp_u_Problem_getSolutionIter_line_216 __pyx_string_tab[43] -#define __pyx_kp_u_Problem_getSolution_line_178 __pyx_string_tab[44] +#define __pyx_kp_u_Problem_getSolutionIter_line_218 __pyx_string_tab[43] +#define __pyx_kp_u_Problem_getSolution_line_180 __pyx_string_tab[44] #define __pyx_n_u_Problem_getSolutions __pyx_string_tab[45] #define __pyx_n_u_Problem_getSolutionsAsListDict __pyx_string_tab[46] #define __pyx_n_u_Problem_getSolutionsOrderedList __pyx_string_tab[47] #define __pyx_n_u_Problem_getSolutionsOrderedList_2 __pyx_string_tab[48] -#define __pyx_kp_u_Problem_getSolutions_line_197 __pyx_string_tab[49] +#define __pyx_kp_u_Problem_getSolutions_line_199 __pyx_string_tab[49] #define __pyx_n_u_Problem_getSolver __pyx_string_tab[50] #define __pyx_kp_u_Problem_getSolver_line_72 __pyx_string_tab[51] #define __pyx_n_u_Problem_reset __pyx_string_tab[52] @@ -4112,7 +4112,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 @@ -4215,8 +4215,9 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; size_t __pyx_t_5; - PyObject *__pyx_t_6 = NULL; + int __pyx_t_6; int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -4241,7 +4242,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * 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_GOTREF(__pyx_t_1); @@ -4258,8 +4259,8 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * 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); @@ -4289,116 +4290,174 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU /* "constraint/problem.py":105 * 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_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_7 = PyList_Check(__pyx_v_variable); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_7 = PyTuple_Check(__pyx_v_variable); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_7 = PyObject_IsInstance(__pyx_v_variable, __pyx_t_1); + __pyx_t_6 = __pyx_t_7; + __pyx_L7_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = (!__pyx_t_6); + if (__pyx_t_7) { + } else { + __pyx_t_2 = __pyx_t_7; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_7 = __Pyx_HasAttr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_getitem); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_6 = (!__pyx_t_7); + __pyx_t_2 = __pyx_t_6; + __pyx_L5_bool_binop_done:; if (__pyx_t_2) { /* "constraint/problem.py":106 * 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) +*/ + __pyx_t_1 = PySequence_List(__pyx_v_domain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __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) + * if not isinstance(variable, (list, tuple, Domain)) and not hasattr(domain, "__getitem__"): # <<<<<<<<<<<<<< + * domain = list(domain) + * if isinstance(domain, Domain): +*/ + } + + /* "constraint/problem.py":107 + * 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, 107, __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, 107, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "constraint/problem.py":108 + * domain = list(domain) * if isinstance(domain, Domain): * domain = copy.deepcopy(domain) # <<<<<<<<<<<<<< * elif hasattr(domain, "__getitem__"): * domain = Domain(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_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __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_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_deepcopy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __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); + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8); assert(__pyx_t_4); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_5 = 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_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __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) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __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":107 + * 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":109 * 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, 109, __pyx_L1_error) if (likely(__pyx_t_2)) { - /* "constraint/problem.py":108 + /* "constraint/problem.py":110 * 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_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Domain); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 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); + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); + assert(__pyx_t_8); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_domain}; + PyObject *__pyx_callargs[2] = {__pyx_t_8, __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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __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":109 * 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":112 * domain = Domain(domain) * else: * msg = "Domains must be instances of subclasses of the Domain class" # <<<<<<<<<<<<<< @@ -4409,7 +4468,7 @@ 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":113 * else: * msg = "Domains must be instances of subclasses of the Domain class" * raise TypeError(msg) # <<<<<<<<<<<<<< @@ -4418,57 +4477,57 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU */ __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_builtin_TypeError); - __pyx_t_6 = __pyx_builtin_TypeError; + __pyx_t_8 = __pyx_builtin_TypeError; __pyx_t_5 = 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_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __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) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __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, 113, __pyx_L1_error) } - __pyx_L4:; + __pyx_L10:; - /* "constraint/problem.py":112 + /* "constraint/problem.py":114 * 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, 114, __pyx_L1_error) + __pyx_t_6 = (!__pyx_t_2); + if (unlikely(__pyx_t_6)) { - /* "constraint/problem.py":113 + /* "constraint/problem.py":115 * raise TypeError(msg) * if not domain: * raise ValueError("Domain is empty") # <<<<<<<<<<<<<< * self._variables[variable] = domain * */ - __pyx_t_6 = NULL; + __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_builtin_ValueError); __pyx_t_4 = __pyx_builtin_ValueError; __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_Domain_is_empty}; + PyObject *__pyx_callargs[2] = {__pyx_t_8, __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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __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, 115, __pyx_L1_error) - /* "constraint/problem.py":112 + /* "constraint/problem.py":114 * msg = "Domains must be instances of subclasses of the Domain class" * raise TypeError(msg) * if not domain: # <<<<<<<<<<<<<< @@ -4477,16 +4536,16 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU */ } - /* "constraint/problem.py":114 + /* "constraint/problem.py":116 * 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, 116, __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, 116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/problem.py":86 @@ -4504,7 +4563,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("constraint.problem.Problem.addVariable", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -4515,7 +4574,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU return __pyx_r; } -/* "constraint/problem.py":116 +/* "constraint/problem.py":118 * self._variables[variable] = domain * * def addVariables(self, variables: Sequence, domain): # <<<<<<<<<<<<<< @@ -4565,38 +4624,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, 118, __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, 118, __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, 118, __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, 118, __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, 118, __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, 118, __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, 118, __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, 118, __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, 118, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -4604,7 +4663,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, 118, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4640,7 +4699,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":138 * may assume * """ * for variable in variables: # <<<<<<<<<<<<<< @@ -4652,9 +4711,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, 138, __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, 138, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -4662,7 +4721,7 @@ 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, 138, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -4672,7 +4731,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U { 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, 138, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -4683,13 +4742,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, 138, __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, 138, __pyx_L1_error) PyErr_Clear(); } break; @@ -4699,7 +4758,7 @@ 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":139 * """ * for variable in variables: * self.addVariable(variable, domain) # <<<<<<<<<<<<<< @@ -4713,12 +4772,12 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U 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_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, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/problem.py":136 + /* "constraint/problem.py":138 * may assume * """ * for variable in variables: # <<<<<<<<<<<<<< @@ -4728,7 +4787,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":118 * self._variables[variable] = domain * * def addVariables(self, variables: Sequence, domain): # <<<<<<<<<<<<<< @@ -4752,7 +4811,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U return __pyx_r; } -/* "constraint/problem.py":139 +/* "constraint/problem.py":141 * self.addVariable(variable, domain) * * def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -4802,41 +4861,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, 141, __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, 141, __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, 141, __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, 141, __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, 141, __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, 141, __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, 141, __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, 141, __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, 141, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -4848,7 +4907,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, 141, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4870,7 +4929,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":164 * return * elif isinstance(constraint, list): * assert all(isinstance(c, str) for c in constraint), f"Expected constraints to be strings, got {constraint}" # <<<<<<<<<<<<<< @@ -4890,7 +4949,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, 164, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -4898,7 +4957,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, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -4936,16 +4995,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, 164, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 164, __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, 164, __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, 164, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -4953,7 +5012,7 @@ 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, 164, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -4963,7 +5022,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2genera { 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, 164, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -4974,13 +5033,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, 164, __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, 164, __pyx_L1_error) PyErr_Clear(); } break; @@ -5030,7 +5089,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2genera return __pyx_r; } -/* "constraint/problem.py":139 +/* "constraint/problem.py":141 * self.addVariable(variable, domain) * * def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -5056,7 +5115,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":160 * """ # noqa: E501 * # compile string constraints (variables argument ignored as it is inferred from the string and may be reordered) * if isinstance(constraint, str): # <<<<<<<<<<<<<< @@ -5066,19 +5125,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":161 * # 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, 161, __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, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":160 + /* "constraint/problem.py":162 * if isinstance(constraint, str): * self._str_constraints.append(constraint) * return # <<<<<<<<<<<<<< @@ -5089,7 +5148,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":160 * """ # noqa: E501 * # compile string constraints (variables argument ignored as it is inferred from the string and may be reordered) * if isinstance(constraint, str): # <<<<<<<<<<<<<< @@ -5098,7 +5157,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ */ } - /* "constraint/problem.py":161 + /* "constraint/problem.py":163 * self._str_constraints.append(constraint) * return * elif isinstance(constraint, list): # <<<<<<<<<<<<<< @@ -5108,7 +5167,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":164 * return * elif isinstance(constraint, list): * assert all(isinstance(c, str) for c in constraint), f"Expected constraints to be strings, got {constraint}" # <<<<<<<<<<<<<< @@ -5117,36 +5176,36 @@ 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, 164, __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, 164, __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, 164, __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, 164, __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, 164, __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_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 162, __pyx_L1_error) + __PYX_ERR(0, 164, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 162, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 164, __pyx_L1_error) #endif - /* "constraint/problem.py":163 + /* "constraint/problem.py":165 * 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, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); @@ -5156,12 +5215,12 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ __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_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, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":164 + /* "constraint/problem.py":166 * assert all(isinstance(c, str) for c in constraint), f"Expected constraints to be strings, got {constraint}" * self._str_constraints.extend(constraint) * return # <<<<<<<<<<<<<< @@ -5172,7 +5231,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":163 * self._str_constraints.append(constraint) * return * elif isinstance(constraint, list): # <<<<<<<<<<<<<< @@ -5181,31 +5240,31 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ */ } - /* "constraint/problem.py":167 + /* "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") */ - __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, 169, __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, 169, __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":170 * # 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, 170, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/problem.py":170 + /* "constraint/problem.py":172 * if callable(constraint): * # future warn("A function or lambda has been used for a constraint, consider using string constraints") * constraint = FunctionConstraint(constraint) # <<<<<<<<<<<<<< @@ -5213,7 +5272,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, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -5232,13 +5291,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ __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_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, 172, __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":170 * # add regular constraints * if not isinstance(constraint, Constraint): * if callable(constraint): # <<<<<<<<<<<<<< @@ -5248,7 +5307,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ goto __pyx_L5; } - /* "constraint/problem.py":171 + /* "constraint/problem.py":173 * # future warn("A function or lambda has been used for a constraint, consider using string constraints") * constraint = FunctionConstraint(constraint) * elif isinstance(constraint, str): # <<<<<<<<<<<<<< @@ -5258,7 +5317,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":174 * constraint = FunctionConstraint(constraint) * elif isinstance(constraint, str): * constraint = CompilableFunctionConstraint(constraint) # <<<<<<<<<<<<<< @@ -5266,7 +5325,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, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -5285,13 +5344,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ __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_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, 174, __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":173 * # future warn("A function or lambda has been used for a constraint, consider using string constraints") * constraint = FunctionConstraint(constraint) * elif isinstance(constraint, str): # <<<<<<<<<<<<<< @@ -5301,7 +5360,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ goto __pyx_L5; } - /* "constraint/problem.py":174 + /* "constraint/problem.py":176 * constraint = CompilableFunctionConstraint(constraint) * else: * msg = "Constraints must be instances of subclasses " "of the Constraint class" # <<<<<<<<<<<<<< @@ -5312,7 +5371,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":177 * else: * msg = "Constraints must be instances of subclasses " "of the Constraint class" * raise ValueError(msg) # <<<<<<<<<<<<<< @@ -5328,16 +5387,16 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ __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_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, 177, __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, 177, __pyx_L1_error) } __pyx_L5:; - /* "constraint/problem.py":167 + /* "constraint/problem.py":169 * * # add regular constraints * if not isinstance(constraint, Constraint): # <<<<<<<<<<<<<< @@ -5346,28 +5405,28 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ */ } - /* "constraint/problem.py":176 + /* "constraint/problem.py":178 * 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, 178, __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_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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_4, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 178, __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_4, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 178, __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, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/problem.py":139 + /* "constraint/problem.py":141 * self.addVariable(variable, domain) * * def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -5393,7 +5452,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ return __pyx_r; } -/* "constraint/problem.py":178 +/* "constraint/problem.py":180 * self._constraints.append((constraint, variables)) * * def getSolution(self): # <<<<<<<<<<<<<< @@ -5441,32 +5500,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, 180, __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, 180, __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, 180, __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, 180, __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, 180, __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, 180, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5507,7 +5566,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":194 * dictionary mapping variables to values: Solution for the problem * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) # <<<<<<<<<<<<<< @@ -5516,22 +5575,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, 194, __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, 194, __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, 194, __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) + 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, 194, __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); __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, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -5540,7 +5599,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, 194, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -5552,27 +5611,27 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN __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) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __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) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __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) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __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, 194, __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, 194, __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, 194, __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, 194, __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); @@ -5582,7 +5641,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, 194, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_unpacking_done; @@ -5590,7 +5649,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, 194, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_domains = __pyx_t_3; @@ -5600,18 +5659,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":195 * """ * 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, 195, __pyx_L1_error) __pyx_t_9 = (!__pyx_t_8); if (__pyx_t_9) { - /* "constraint/problem.py":194 + /* "constraint/problem.py":196 * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: * return None # <<<<<<<<<<<<<< @@ -5622,7 +5681,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":195 * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: # <<<<<<<<<<<<<< @@ -5631,7 +5690,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN */ } - /* "constraint/problem.py":195 + /* "constraint/problem.py":197 * if not domains: * return None * return self._solver.getSolution(domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -5639,7 +5698,7 @@ 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, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); @@ -5649,14 +5708,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN __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_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, 197, __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":180 * self._constraints.append((constraint, variables)) * * def getSolution(self): # <<<<<<<<<<<<<< @@ -5682,7 +5741,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN return __pyx_r; } -/* "constraint/problem.py":197 +/* "constraint/problem.py":199 * return self._solver.getSolution(domains, constraints, vconstraints) * * def getSolutions(self): # <<<<<<<<<<<<<< @@ -5730,32 +5789,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, 199, __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, 199, __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, 199, __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, 199, __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, 199, __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, 199, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5796,7 +5855,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":213 * list of dictionaries mapping variables to values: All solutions for the problem * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) # <<<<<<<<<<<<<< @@ -5805,22 +5864,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, 213, __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, 213, __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, 213, __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) + 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, 213, __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); __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, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -5829,7 +5888,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, 213, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -5841,27 +5900,27 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U __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) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __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) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __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) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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); @@ -5871,7 +5930,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, 213, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_unpacking_done; @@ -5879,7 +5938,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, 213, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_domains = __pyx_t_3; @@ -5889,18 +5948,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":214 * """ * 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, 214, __pyx_L1_error) __pyx_t_9 = (!__pyx_t_8); if (__pyx_t_9) { - /* "constraint/problem.py":213 + /* "constraint/problem.py":215 * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: * return [] # <<<<<<<<<<<<<< @@ -5908,13 +5967,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, 215, __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":214 * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: # <<<<<<<<<<<<<< @@ -5923,7 +5982,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U */ } - /* "constraint/problem.py":214 + /* "constraint/problem.py":216 * if not domains: * return [] * return self._solver.getSolutions(domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -5931,7 +5990,7 @@ 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, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); @@ -5941,14 +6000,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U __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_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, 216, __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":199 * return self._solver.getSolution(domains, constraints, vconstraints) * * def getSolutions(self): # <<<<<<<<<<<<<< @@ -5974,7 +6033,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U return __pyx_r; } -/* "constraint/problem.py":216 +/* "constraint/problem.py":218 * return self._solver.getSolutions(domains, constraints, vconstraints) * * def getSolutionIter(self): # <<<<<<<<<<<<<< @@ -6022,32 +6081,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, 218, __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, 218, __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, 218, __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, 218, __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, 218, __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, 218, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6088,7 +6147,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":234 * StopIteration * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) # <<<<<<<<<<<<<< @@ -6097,22 +6156,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, 234, __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, 234, __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, 234, __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) + 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, 234, __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); __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, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -6121,7 +6180,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, 234, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -6133,27 +6192,27 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO __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) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __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) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __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) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __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, 234, __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, 234, __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, 234, __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, 234, __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); @@ -6163,7 +6222,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, 234, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_unpacking_done; @@ -6171,7 +6230,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, 234, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_domains = __pyx_t_3; @@ -6181,18 +6240,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":235 * """ * 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, 235, __pyx_L1_error) __pyx_t_9 = (!__pyx_t_8); if (__pyx_t_9) { - /* "constraint/problem.py":234 + /* "constraint/problem.py":236 * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: * return iter(()) # <<<<<<<<<<<<<< @@ -6200,13 +6259,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, 236, __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":235 * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: # <<<<<<<<<<<<<< @@ -6215,7 +6274,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO */ } - /* "constraint/problem.py":235 + /* "constraint/problem.py":237 * if not domains: * return iter(()) * return self._solver.getSolutionIter(domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -6223,7 +6282,7 @@ 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, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); @@ -6233,14 +6292,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO __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_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, 237, __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":218 * return self._solver.getSolutions(domains, constraints, vconstraints) * * def getSolutionIter(self): # <<<<<<<<<<<<<< @@ -6266,7 +6325,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO return __pyx_r; } -/* "constraint/problem.py":237 +/* "constraint/problem.py":239 * return self._solver.getSolutionIter(domains, constraints, vconstraints) * * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: # <<<<<<<<<<<<<< @@ -6315,35 +6374,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, 239, __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, 239, __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, 239, __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, 239, __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, 239, __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, 239, __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, 239, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -6354,7 +6413,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, 239, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6365,7 +6424,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, 239, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedList(__pyx_self, __pyx_v_self, __pyx_v_order); /* function exit code */ @@ -6386,7 +6445,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":243 * solutions: list[dict] = self.getSolutions() * if order is None or len(order) == 1: * return list(tuple(solution.values()) for solution in solutions) # <<<<<<<<<<<<<< @@ -6406,7 +6465,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, 243, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6414,7 +6473,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, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6451,13 +6510,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, 243, __pyx_L1_error) + __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 243, __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, 243, __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, 243, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; @@ -6465,13 +6524,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, 243, __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, 241, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __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); @@ -6484,13 +6543,13 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi 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_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, 243, __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, 243, __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, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -6519,7 +6578,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":245 * return list(tuple(solution.values()) for solution in solutions) * get_in_order = itemgetter(*order) * return list(get_in_order(params) for params in solutions) # <<<<<<<<<<<<<< @@ -6539,7 +6598,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, 245, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6550,7 +6609,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, 245, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6588,13 +6647,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, 245, __pyx_L1_error) + __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 245, __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, 245, __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, 245, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; @@ -6602,20 +6661,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, 245, __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, 243, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __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, 245, __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; @@ -6635,10 +6694,10 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi __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_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, 245, __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, 245, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -6667,7 +6726,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi return __pyx_r; } -/* "constraint/problem.py":237 +/* "constraint/problem.py":239 * return self._solver.getSolutionIter(domains, constraints, vconstraints) * * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: # <<<<<<<<<<<<<< @@ -6697,12 +6756,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, 239, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/problem.py":239 + /* "constraint/problem.py":241 * 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() # <<<<<<<<<<<<<< @@ -6716,14 +6775,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi 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_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, 241, __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, 241, __pyx_L1_error) __pyx_v_solutions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":240 + /* "constraint/problem.py":242 * """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: # <<<<<<<<<<<<<< @@ -6738,15 +6797,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, 242, __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, 242, __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":243 * solutions: list[dict] = self.getSolutions() * if order is None or len(order) == 1: * return list(tuple(solution.values()) for solution in solutions) # <<<<<<<<<<<<<< @@ -6754,16 +6813,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, 243, __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, 243, __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":242 * """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: # <<<<<<<<<<<<<< @@ -6772,18 +6831,18 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi */ } - /* "constraint/problem.py":242 + /* "constraint/problem.py":244 * 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, 244, __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, 244, __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, 244, __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; @@ -6791,7 +6850,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":245 * return list(tuple(solution.values()) for solution in solutions) * get_in_order = itemgetter(*order) * return list(get_in_order(params) for params in solutions) # <<<<<<<<<<<<<< @@ -6799,16 +6858,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, 245, __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, 245, __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":239 * return self._solver.getSolutionIter(domains, constraints, vconstraints) * * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: # <<<<<<<<<<<<<< @@ -6833,7 +6892,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi return __pyx_r; } -/* "constraint/problem.py":245 +/* "constraint/problem.py":247 * return list(get_in_order(params) for params in solutions) * * def getSolutionsAsListDict( # <<<<<<<<<<<<<< @@ -6883,28 +6942,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, 247, __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, 247, __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, 247, __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, 247, __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, 247, __pyx_L3_error) - /* "constraint/problem.py":246 + /* "constraint/problem.py":248 * * def getSolutionsAsListDict( * self, order: list[str] = None, validate: bool = True # <<<<<<<<<<<<<< @@ -6914,21 +6973,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds 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, 247, __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, 247, __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, 247, __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, 247, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -6941,7 +7000,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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, 247, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6952,10 +7011,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, 248, __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":247 * return list(get_in_order(params) for params in solutions) * * def getSolutionsAsListDict( # <<<<<<<<<<<<<< @@ -7007,7 +7066,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolutionsAsListDict", 0); - /* "constraint/problem.py":249 + /* "constraint/problem.py":251 * ) -> 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,26 +7080,26 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic 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_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, 251, __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":252 * """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, 252, __pyx_L1_error) + __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __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":253 * solutions_list = self.getSolutionsOrderedList(order) * size_list = len(solutions_list) * solutions_dict: dict = dict(zip(solutions_list, range(size_list))) # <<<<<<<<<<<<<< @@ -7062,7 +7121,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic __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) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_t_3 = 1; @@ -7072,7 +7131,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic __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) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_3 = 1; @@ -7082,48 +7141,48 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic __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, 253, __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":254 * 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) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_validate); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 254, __pyx_L1_error) if (__pyx_t_12) { - /* "constraint/problem.py":254 + /* "constraint/problem.py":256 * 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, 256, __pyx_L1_error) + __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __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":257 * # check for duplicates * size_dict = len(solutions_dict) * if size_list != size_dict: # <<<<<<<<<<<<<< * raise ValueError( * 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, 257, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_12)) { - /* "constraint/problem.py":256 + /* "constraint/problem.py":258 * size_dict = len(solutions_dict) * if size_list != size_dict: * raise ValueError( # <<<<<<<<<<<<<< @@ -7134,31 +7193,31 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic __Pyx_INCREF(__pyx_builtin_ValueError); __pyx_t_6 = __pyx_builtin_ValueError; - /* "constraint/problem.py":257 + /* "constraint/problem.py":259 * if size_list != size_dict: * 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}" */ - __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) + __pyx_t_2 = PyNumber_Subtract(__pyx_v_size_list, __pyx_v_size_dict); 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_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __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, 257, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_size_dict, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13[0] = __pyx_t_8; __pyx_t_13[1] = __pyx_mstate_global->__pyx_kp_u_duplicate_parameter_configurati; __pyx_t_13[2] = __pyx_t_2; __pyx_t_13[3] = __pyx_mstate_global->__pyx_kp_u_unique; __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_13, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 43 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 8, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2)); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 257, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":258 + /* "constraint/problem.py":260 * 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]))}", # <<<<<<<<<<<<<< @@ -7166,16 +7225,16 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * ) */ { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L7_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_v_solutions_list)) || PyTuple_CheckExact(__pyx_v_solutions_list)) { __pyx_t_8 = __pyx_v_solutions_list; __Pyx_INCREF(__pyx_t_8); __pyx_t_4 = 0; __pyx_t_14 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_solutions_list); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 258, __pyx_L7_error) + __pyx_t_4 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_solutions_list); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 260, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 258, __pyx_L7_error) + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 260, __pyx_L7_error) } for (;;) { if (likely(!__pyx_t_14)) { @@ -7183,7 +7242,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic { 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, 258, __pyx_L7_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 260, __pyx_L7_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -7193,7 +7252,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic { 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, 258, __pyx_L7_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 260, __pyx_L7_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -7204,13 +7263,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L7_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 260, __pyx_L7_error) } else { __pyx_t_7 = __pyx_t_14(__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, 258, __pyx_L7_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 260, __pyx_L7_error) PyErr_Clear(); } break; @@ -7226,15 +7285,15 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_8genexpr3__pyx_v_c}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__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_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L7_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 260, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_11 = PyObject_RichCompare(__pyx_t_7, __pyx_mstate_global->__pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 258, __pyx_L7_error) + __pyx_t_11 = PyObject_RichCompare(__pyx_t_7, __pyx_mstate_global->__pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 260, __pyx_L7_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 258, __pyx_L7_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 260, __pyx_L7_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_12) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_8genexpr3__pyx_v_c))) __PYX_ERR(0, 258, __pyx_L7_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_8genexpr3__pyx_v_c))) __PYX_ERR(0, 260, __pyx_L7_error) } } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -7245,34 +7304,34 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic goto __pyx_L1_error; __pyx_L12_exit_scope:; } /* exit inner scope */ - __pyx_t_8 = PySet_New(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_8 = PySet_New(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PySequence_List(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_2 = PySequence_List(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __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_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Duplicate_configs, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Duplicate_configs, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/problem.py":259 + /* "constraint/problem.py":261 * 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_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_constraints); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_constraints); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __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, 259, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_str_constraints); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_str_constraints); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_Constraints; @@ -7280,7 +7339,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic __pyx_t_13[2] = __pyx_mstate_global->__pyx_kp_u__2; __pyx_t_13[3] = __pyx_t_7; __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_13, 4, 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 2 + __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_8)) __PYX_ERR(0, 259, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -7293,14 +7352,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __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, 258, __pyx_L1_error) - /* "constraint/problem.py":255 + /* "constraint/problem.py":257 * # check for duplicates * size_dict = len(solutions_dict) * if size_list != size_dict: # <<<<<<<<<<<<<< @@ -7309,7 +7368,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic */ } - /* "constraint/problem.py":252 + /* "constraint/problem.py":254 * size_list = len(solutions_list) * solutions_dict: dict = dict(zip(solutions_list, range(size_list))) * if validate: # <<<<<<<<<<<<<< @@ -7318,7 +7377,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic */ } - /* "constraint/problem.py":261 + /* "constraint/problem.py":263 * f"Constraints: {self._constraints}, {self._str_constraints}" * ) * return ( # <<<<<<<<<<<<<< @@ -7327,29 +7386,29 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic */ __Pyx_XDECREF(__pyx_r); - /* "constraint/problem.py":262 + /* "constraint/problem.py":264 * ) * return ( * solutions_list, # <<<<<<<<<<<<<< * solutions_dict, * size_list, */ - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __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, 262, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_solutions_list) != (0)) __PYX_ERR(0, 264, __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, 262, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_solutions_dict) != (0)) __PYX_ERR(0, 264, __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, 262, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_size_list) != (0)) __PYX_ERR(0, 264, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/problem.py":245 + /* "constraint/problem.py":247 * return list(get_in_order(params) for params in solutions) * * def getSolutionsAsListDict( # <<<<<<<<<<<<<< @@ -7381,7 +7440,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic return __pyx_r; } -/* "constraint/problem.py":267 +/* "constraint/problem.py":269 * ) * * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< @@ -7429,35 +7488,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, 267, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 269, __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, 267, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 269, __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, 267, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 269, __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, 267, __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, 269, __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, 267, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_getArgs", 0, 1, 2, i); __PYX_ERR(0, 269, __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, 267, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 269, __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, 267, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 269, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -7468,7 +7527,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, 267, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_getArgs", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 269, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7490,7 +7549,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":288 +/* "constraint/problem.py":290 * # 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 # <<<<<<<<<<<<<< @@ -7510,7 +7569,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, 288, __pyx_L1_error) + __PYX_ERR(0, 290, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -7518,7 +7577,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, 288, __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, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -7558,21 +7617,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, 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, 290, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 290, __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, 290, __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, 288, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __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; @@ -7580,7 +7639,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, 288, __pyx_L1_error) + __PYX_ERR(0, 290, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -7590,22 +7649,22 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ __Pyx_INCREF(__pyx_t_5); } else { __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __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, 288, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __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, 288, __pyx_L1_error) + __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __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); @@ -7613,7 +7672,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, 288, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; @@ -7621,7 +7680,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, 288, __pyx_L1_error) + __PYX_ERR(0, 290, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c); @@ -7632,9 +7691,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, 288, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __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, 288, __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, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { __Pyx_XDECREF(__pyx_r); @@ -7676,7 +7735,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ return __pyx_r; } -/* "constraint/problem.py":267 +/* "constraint/problem.py":269 * ) * * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< @@ -7723,14 +7782,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_getArgs", 0); - /* "constraint/problem.py":268 + /* "constraint/problem.py":270 * * 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, 268, __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, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); @@ -7740,13 +7799,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __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_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, 268, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_domains = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/problem.py":269 + /* "constraint/problem.py":271 * def _getArgs(self, picklable=False): * domains = self._variables.copy() * allvariables = domains.keys() # <<<<<<<<<<<<<< @@ -7760,55 +7819,55 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE 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_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_allvariables = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/problem.py":270 + /* "constraint/problem.py":272 * 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, 270, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_constraints = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":273 + /* "constraint/problem.py":275 * * # 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, 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, 275, __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, 273, __pyx_L1_error) + __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 275, __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":275 + /* "constraint/problem.py":277 * 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, 275, __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, 277, __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, 275, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __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, 275, __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, 277, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -7817,7 +7876,7 @@ 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, 275, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 277, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -7827,7 +7886,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { 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, 275, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 277, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -7838,13 +7897,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __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, 275, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 277, __pyx_L1_error) PyErr_Clear(); } break; @@ -7854,7 +7913,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":276 + /* "constraint/problem.py":278 * # 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) # <<<<<<<<<<<<<< @@ -7862,13 +7921,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, 276, __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, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 278, __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, 276, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 278, __pyx_L1_error); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { @@ -7883,21 +7942,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, 276, __pyx_L1_error) + __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 278, __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, 276, __pyx_L1_error) + 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, 278, __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); __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, 276, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_parsed, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":277 + /* "constraint/problem.py":279 * for constraint in self._str_constraints: * parsed = compile_to_constraints([constraint], domains, picklable=picklable) * for c, v, _ in parsed: # <<<<<<<<<<<<<< @@ -7909,9 +7968,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, 277, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parsed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __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, 277, __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, 279, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_12)) { @@ -7919,7 +7978,7 @@ 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, 277, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 279, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -7929,7 +7988,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { 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, 277, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 279, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -7940,13 +7999,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 277, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 279, __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, 277, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 279, __pyx_L1_error) PyErr_Clear(); } break; @@ -7959,7 +8018,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, 277, __pyx_L1_error) + __PYX_ERR(0, 279, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -7971,27 +8030,27 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 277, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_10); __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 277, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_9); __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 2); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __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, 277, __pyx_L1_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __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, 277, __pyx_L1_error) + __pyx_t_13 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 279, __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); @@ -8001,7 +8060,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, 277, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 3) < 0) __PYX_ERR(0, 279, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L9_unpacking_done; @@ -8009,7 +8068,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, 277, __pyx_L1_error) + __PYX_ERR(0, 279, __pyx_L1_error) __pyx_L9_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_10); @@ -8019,7 +8078,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":278 + /* "constraint/problem.py":280 * parsed = compile_to_constraints([constraint], domains, picklable=picklable) * for c, v, _ in parsed: * self.addConstraint(c, v) # <<<<<<<<<<<<<< @@ -8033,12 +8092,12 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE 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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 278, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/problem.py":277 + /* "constraint/problem.py":279 * for constraint in self._str_constraints: * parsed = compile_to_constraints([constraint], domains, picklable=picklable) * for c, v, _ in parsed: # <<<<<<<<<<<<<< @@ -8048,7 +8107,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":275 + /* "constraint/problem.py":277 * 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: # <<<<<<<<<<<<<< @@ -8058,7 +8117,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":273 + /* "constraint/problem.py":275 * * # parse string constraints * if len(self._str_constraints) > 0: # <<<<<<<<<<<<<< @@ -8067,23 +8126,23 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE */ } - /* "constraint/problem.py":281 + /* "constraint/problem.py":283 * * # 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, 281, __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, 283, __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, 281, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __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, 281, __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, 283, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -8092,7 +8151,7 @@ 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, 281, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 283, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -8102,7 +8161,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { 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, 281, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 283, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -8113,13 +8172,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __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, 281, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 283, __pyx_L1_error) PyErr_Clear(); } break; @@ -8132,7 +8191,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, 281, __pyx_L1_error) + __PYX_ERR(0, 283, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8142,22 +8201,22 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 281, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __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, 281, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __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, 281, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 283, __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); @@ -8165,7 +8224,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, 281, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_9), 2) < 0) __PYX_ERR(0, 283, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L15_unpacking_done; @@ -8173,7 +8232,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, 281, __pyx_L1_error) + __PYX_ERR(0, 283, __pyx_L1_error) __pyx_L15_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_8); @@ -8181,30 +8240,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":282 + /* "constraint/problem.py":284 * # 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, 282, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 284, __pyx_L1_error) __pyx_t_15 = (!__pyx_t_6); if (__pyx_t_15) { - /* "constraint/problem.py":283 + /* "constraint/problem.py":285 * 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, 283, __pyx_L1_error) + __pyx_t_3 = PySequence_List(__pyx_v_allvariables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_variables, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":282 + /* "constraint/problem.py":284 * # add regular constraints * for constraint, variables in self._constraints: * if not variables: # <<<<<<<<<<<<<< @@ -8213,25 +8272,25 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE */ } - /* "constraint/problem.py":284 + /* "constraint/problem.py":286 * 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, 284, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __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, 284, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 286, __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, 284, __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, 284, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 286, __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, 286, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":281 + /* "constraint/problem.py":283 * * # add regular constraints * for constraint, variables in self._constraints: # <<<<<<<<<<<<<< @@ -8241,17 +8300,17 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":287 + /* "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 * */ - __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_picklable); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 287, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_picklable); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 289, __pyx_L1_error) if (__pyx_t_15) { - /* "constraint/problem.py":288 + /* "constraint/problem.py":290 * # 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 # <<<<<<<<<<<<<< @@ -8260,24 +8319,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, 288, __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, 290, __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, 288, __pyx_L1_error) + __pyx_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __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, 288, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 290, __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, 288, __pyx_L1_error) + __PYX_ERR(0, 290, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 288, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 290, __pyx_L1_error) #endif - /* "constraint/problem.py":287 + /* "constraint/problem.py":289 * * # check if there are any precompiled FunctionConstraints when there shouldn't be * if picklable: # <<<<<<<<<<<<<< @@ -8286,19 +8345,19 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE */ } - /* "constraint/problem.py":290 + /* "constraint/problem.py":292 * 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, 290, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_vconstraints = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":291 + /* "constraint/problem.py":293 * * vconstraints = {} * for variable in domains: # <<<<<<<<<<<<<< @@ -8310,9 +8369,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, 291, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_domains); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __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, 291, __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, 293, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -8320,7 +8379,7 @@ 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, 293, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -8330,7 +8389,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { 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, 291, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 293, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -8341,13 +8400,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __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, 291, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 293, __pyx_L1_error) PyErr_Clear(); } break; @@ -8357,19 +8416,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":292 + /* "constraint/problem.py":294 * 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, 292, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __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, 292, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_vconstraints, __pyx_v_variable, __pyx_t_1) < 0))) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":291 + /* "constraint/problem.py":293 * * vconstraints = {} * for variable in domains: # <<<<<<<<<<<<<< @@ -8379,7 +8438,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":293 + /* "constraint/problem.py":295 * for variable in domains: * vconstraints[variable] = [] * for constraint, variables in constraints: # <<<<<<<<<<<<<< @@ -8392,13 +8451,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, 293, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 295, __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_5; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __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; @@ -8406,7 +8465,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, 293, __pyx_L1_error) + __PYX_ERR(0, 295, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8416,22 +8475,22 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 293, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 293, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 295, __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, 293, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 293, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 295, __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, 293, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 295, __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); @@ -8439,7 +8498,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, 293, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_9), 2) < 0) __PYX_ERR(0, 295, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L25_unpacking_done; @@ -8447,7 +8506,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, 293, __pyx_L1_error) + __PYX_ERR(0, 295, __pyx_L1_error) __pyx_L25_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_2); @@ -8455,7 +8514,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":294 + /* "constraint/problem.py":296 * vconstraints[variable] = [] * for constraint, variables in constraints: * for variable in variables: # <<<<<<<<<<<<<< @@ -8467,9 +8526,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, 294, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __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, 294, __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, 296, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -8477,7 +8536,7 @@ 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, 296, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -8487,7 +8546,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { 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, 294, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 296, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -8498,13 +8557,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 294, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 296, __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, 294, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 296, __pyx_L1_error) PyErr_Clear(); } break; @@ -8514,28 +8573,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":295 + /* "constraint/problem.py":297 * 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, 295, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __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, 295, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 297, __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, 295, __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, 295, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 297, __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, 297, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":294 + /* "constraint/problem.py":296 * vconstraints[variable] = [] * for constraint, variables in constraints: * for variable in variables: # <<<<<<<<<<<<<< @@ -8545,7 +8604,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":293 + /* "constraint/problem.py":295 * for variable in domains: * vconstraints[variable] = [] * for constraint, variables in constraints: # <<<<<<<<<<<<<< @@ -8555,14 +8614,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":296 + /* "constraint/problem.py":298 * 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, 296, __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, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; @@ -8571,13 +8630,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, 296, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 298, __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_5; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __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; @@ -8585,7 +8644,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, 296, __pyx_L1_error) + __PYX_ERR(0, 298, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8595,22 +8654,22 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 296, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 298, __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, 296, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 298, __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, 296, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 298, __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); @@ -8618,7 +8677,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, 296, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_9), 2) < 0) __PYX_ERR(0, 298, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L33_unpacking_done; @@ -8626,7 +8685,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, 296, __pyx_L1_error) + __PYX_ERR(0, 298, __pyx_L1_error) __pyx_L33_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_2); @@ -8634,7 +8693,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":297 + /* "constraint/problem.py":299 * vconstraints[variable].append((constraint, variables)) * for constraint, variables in constraints[:]: * constraint.preProcess(variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -8648,12 +8707,12 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE 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_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, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":296 + /* "constraint/problem.py":298 * for variable in variables: * vconstraints[variable].append((constraint, variables)) * for constraint, variables in constraints[:]: # <<<<<<<<<<<<<< @@ -8663,7 +8722,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":298 + /* "constraint/problem.py":300 * for constraint, variables in constraints[:]: * constraint.preProcess(variables, domains, constraints, vconstraints) * for domain in domains.values(): # <<<<<<<<<<<<<< @@ -8673,9 +8732,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, 298, __pyx_L1_error) + __PYX_ERR(0, 300, __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, 298, __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, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_3; @@ -8683,12 +8742,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, 298, __pyx_L1_error) + if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":299 + /* "constraint/problem.py":301 * constraint.preProcess(variables, domains, constraints, vconstraints) * for domain in domains.values(): * domain.resetState() # <<<<<<<<<<<<<< @@ -8702,23 +8761,23 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE 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_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":300 + /* "constraint/problem.py":302 * 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, 300, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 302, __pyx_L1_error) __pyx_t_15 = (!__pyx_t_6); if (__pyx_t_15) { - /* "constraint/problem.py":301 + /* "constraint/problem.py":303 * domain.resetState() * if not domain: * return None, None, None # <<<<<<<<<<<<<< @@ -8731,7 +8790,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":300 + /* "constraint/problem.py":302 * for domain in domains.values(): * domain.resetState() * if not domain: # <<<<<<<<<<<<<< @@ -8742,28 +8801,28 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":303 + /* "constraint/problem.py":305 * 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, 303, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __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, 303, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_domains) != (0)) __PYX_ERR(0, 305, __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, 303, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_constraints) != (0)) __PYX_ERR(0, 305, __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, 303, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_vconstraints) != (0)) __PYX_ERR(0, 305, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/problem.py":267 + /* "constraint/problem.py":269 * ) * * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< @@ -9670,15 +9729,15 @@ 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, 164, __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, 164, __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, 164, __pyx_L1_error) #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)) { @@ -9686,15 +9745,15 @@ 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, 239, __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, 239, __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, 239, __pyx_L1_error) #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)) { @@ -9702,15 +9761,15 @@ 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, 243, __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, 243, __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, 243, __pyx_L1_error) #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)) { @@ -9718,15 +9777,15 @@ 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, 245, __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, 245, __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, 245, __pyx_L1_error) #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)) { @@ -9734,15 +9793,15 @@ 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, 288, __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, 288, __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, 290, __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, 290, __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, 288, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 290, __pyx_L1_error) #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)) { @@ -10460,128 +10519,128 @@ __Pyx_RefNannySetupContext("PyInit_problem", 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; - /* "constraint/problem.py":116 + /* "constraint/problem.py":118 * 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_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 118, __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) + 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, 118, __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, 118, __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) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_addVariables, __pyx_t_3) < 0) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":139 + /* "constraint/problem.py":141 * self.addVariable(variable, domain) * * def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = 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_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __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) + 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, 141, __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, 141, __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, 141, __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) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_addConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/problem.py":178 + /* "constraint/problem.py":180 * 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_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, 180, __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) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_6) < 0) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/problem.py":197 + /* "constraint/problem.py":199 * 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_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, 199, __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) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_t_6) < 0) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/problem.py":216 + /* "constraint/problem.py":218 * 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_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, 218, __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) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_t_6) < 0) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/problem.py":237 + /* "constraint/problem.py":239 * 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_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __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) + 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, 239, __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, 239, __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, 239, __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) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolutionsOrderedList, __pyx_t_3) < 0) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":245 + /* "constraint/problem.py":247 * 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_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __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) + 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, 247, __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, 247, __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, 247, __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, 247, __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) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolutionsAsListDict, __pyx_t_6) < 0) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/problem.py":267 + /* "constraint/problem.py":269 * ) * * 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, 267, __pyx_L1_error) + __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, 269, __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, 267, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getArgs, __pyx_t_6) < 0) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/problem.py":21 @@ -10608,11 +10667,11 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); 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_t_2, __pyx_mstate_global->__pyx_kp_u_Problem_addVariables_line_118, __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_141, __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_180, __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_199, __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_218, __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; @@ -10711,21 +10770,21 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_line_141, sizeof(__pyx_k_Problem_addConstraint_line_141), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_addConstraint_line_141 */ {__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_addVariables_line_118, sizeof(__pyx_k_Problem_addVariables_line_118), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_addVariables_line_118 */ {__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_getSolutionIter_line_218, sizeof(__pyx_k_Problem_getSolutionIter_line_218), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_getSolutionIter_line_218 */ + {__pyx_k_Problem_getSolution_line_180, sizeof(__pyx_k_Problem_getSolution_line_180), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_getSolution_line_180 */ {__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_getSolutions_line_199, sizeof(__pyx_k_Problem_getSolutions_line_199), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_getSolutions_line_199 */ {__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 */ @@ -10867,9 +10926,9 @@ static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__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_TypeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(0, 253, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -10892,14 +10951,14 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); - /* "constraint/problem.py":301 + /* "constraint/problem.py":303 * 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, 301, __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, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); @@ -10914,25 +10973,25 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); - /* "constraint/problem.py":245 + /* "constraint/problem.py":247 * 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_mstate_global->__pyx_tuple[2] = PyTuple_Pack(2, Py_None, ((PyObject*)Py_True)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); - /* "constraint/problem.py":267 + /* "constraint/problem.py":269 * ) * * 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, 267, __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, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_RefNannyFinishContext(); @@ -10979,22 +11038,22 @@ 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), 164, 2}; 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__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), 243, 2}; 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; } { - 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), 245, 2}; 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__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), 288, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 290, 2}; 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_k_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; } @@ -11019,47 +11078,47 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { __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; } { - 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), 86, 161}; 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_k_A_9Ct1_D_AQ_4z_V7_4t7_8ST_T_Qha, 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), 118, 25}; 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; } { - 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), 141, 157}; 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; } { - 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), 180, 55}; 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; } { - 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), 199, 55}; 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; } { - 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), 218, 60}; 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; } { - 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), 239, 63}; 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; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 245, 173}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 247, 173}; 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_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 = {2, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 267, 278}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 269, 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__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_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; } diff --git a/constraint/problem.py b/constraint/problem.py index 8fd8375..881dc9d 100644 --- a/constraint/problem.py +++ b/constraint/problem.py @@ -95,13 +95,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__"): From 9b35f14f630a9a9904dc2cfc275c9248ec3d1bec Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Wed, 23 Jul 2025 01:54:35 +0200 Subject: [PATCH 59/87] Addressed #65: Error in ABC example --- examples/abc/abc.py | 1 + tests/test_constraint.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) 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/tests/test_constraint.py b/tests/test_constraint.py index 6785e3a..863e167 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(): From f7039364a6ed46c482b6a9aae3b8e979c17572c1 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Wed, 23 Jul 2025 01:55:09 +0200 Subject: [PATCH 60/87] Addressed #13: python 3 compatibility --- examples/wordmath/seisseisdoze.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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__": From e259b18587cdd759b11a765dd16085a3a022bf84 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Wed, 23 Jul 2025 11:05:37 +0200 Subject: [PATCH 61/87] Much improved implementation for extrating operators in parser that differentiates between minus as operator and minus as sign for constant --- constraint/parser.c | 6925 ++++++++++++++++++++++-------------------- constraint/parser.py | 149 +- 2 files changed, 3804 insertions(+), 3270 deletions(-) diff --git a/constraint/parser.c b/constraint/parser.c index 949c913..4e11fd7 100644 --- a/constraint/parser.c +++ b/constraint/parser.c @@ -1520,11 +1520,11 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constrai 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 + * """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 { @@ -1536,12 +1536,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]) -> Optional[ # <<<<<<<<<<<<<< + * Union[ + * MinSumConstraint, */ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint { PyObject_HEAD @@ -1552,7 +1552,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint }; -/* "constraint/parser.py":84 +/* "constraint/parser.py":99 * """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): # <<<<<<<<<<<<<< @@ -1574,7 +1574,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr { }; -/* "constraint/parser.py":95 +/* "constraint/parser.py":110 * * # split the string on the comparison and remove leading and trailing whitespace * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< @@ -1591,12 +1591,12 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr { }; -/* "constraint/parser.py":140 +/* "constraint/parser.py":155 * * # 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 @@ -1608,12 +1608,12 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr { }; -/* "constraint/parser.py":170 +/* "constraint/parser.py":175 * 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 ( */ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr { PyObject_HEAD @@ -1623,7 +1623,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr { }; -/* "constraint/parser.py":177 +/* "constraint/parser.py":184 * * # 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) # <<<<<<<<<<<<<< @@ -1638,7 +1638,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr { }; -/* "constraint/parser.py":178 +/* "constraint/parser.py":185 * # 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) # <<<<<<<<<<<<<< @@ -1653,12 +1653,12 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr { }; -/* "constraint/parser.py":181 - * 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":190 + * 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_9_genexpr { PyObject_HEAD @@ -1668,7 +1668,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr { }; -/* "constraint/parser.py":247 +/* "constraint/parser.py":282 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< @@ -1683,7 +1683,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr { }; -/* "constraint/parser.py":254 +/* "constraint/parser.py":289 * 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): # <<<<<<<<<<<<<< @@ -1698,7 +1698,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr { }; -/* "constraint/parser.py":278 +/* "constraint/parser.py":313 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< @@ -1712,7 +1712,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constrai }; -/* "constraint/parser.py":297 +/* "constraint/parser.py":332 * 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): # <<<<<<<<<<<<<< @@ -1727,12 +1727,12 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr { }; -/* "constraint/parser.py":307 +/* "constraint/parser.py":342 * * # 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_14_genexpr { PyObject_HEAD @@ -2239,53 +2239,6 @@ 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); @@ -2359,6 +2312,24 @@ static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, in static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char); +/* py_dict_keys.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d); + +/* 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 + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + /* LimitedApiGetTypeDict.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp); @@ -2498,21 +2469,6 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, /* RaiseUnexpectedTypeError.proto */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); -/* py_dict_keys.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d); - -/* 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 - -/* RaiseNoneIterError.proto */ -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); - /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); @@ -2525,6 +2481,50 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* Globals.proto */ static PyObject* __Pyx_Globals(void); +/* 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 + +/* 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 + /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); @@ -2828,9 +2828,9 @@ int __pyx_module_is_main_constraint__parser = 0; /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_compile; static PyObject *__pyx_builtin_eval; static PyObject *__pyx_builtin_AssertionError; -static PyObject *__pyx_builtin_compile; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "']]"; static const char __pyx_k_1[] = "\2401"; @@ -2850,20 +2850,19 @@ 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__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_Q_2[] = "\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[] = ""; @@ -2875,7 +2874,8 @@ 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__27[] = "\240!"; +static const char __pyx_k__28[] = "\270!"; static const char __pyx_k_and[] = " and "; static const char __pyx_k_end[] = "end"; static const char __pyx_k_key[] = "key"; @@ -2888,6 +2888,7 @@ static const char __pyx_k_var[] = "var"; 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_expr[] = "expr"; static const char __pyx_k_func[] = "__func__"; static const char __pyx_k_keys[] = "keys"; static const char __pyx_k_left[] = "left"; @@ -2922,11 +2923,14 @@ 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_VERBOSE[] = "VERBOSE"; 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_matches[] = "matches"; +static const char __pyx_k_pattern[] = "pattern"; static const char __pyx_k_replace[] = "replace"; static const char __pyx_k_Optional[] = "Optional"; static const char __pyx_k_add_note[] = "add_note"; @@ -2968,7 +2972,7 @@ 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_XQ_Qa_z_5_q_q[] = "\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"; 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"; @@ -2989,6 +2993,7 @@ 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_extract_operators[] = "extract_operators"; 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"; @@ -3006,7 +3011,6 @@ 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"; @@ -3017,6 +3021,7 @@ 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_HA_4vRxq_Q_a_b_1AV3d_q[] = "\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"; 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"; @@ -3037,14 +3042,15 @@ static const char __pyx_k_restrictions_unique_indices[] = "restrictions_unique_i 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\020\210s\220!\220;\230c\240\021\330\020\027\220q\330\014\037\230q\330\020\026\220j\240\001\240\022\240>\3201P\320P[\320[`\320`a\330\014\017\210s\220!\2202\220X\230Q\230m\250>\270\022\2701\340\020\027\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\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_Ya_1_q_Q2_m5_aP_U_6_Q_q_t4uA_d[] = "\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\360P\007\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_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_J_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\360J\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#\2402\240Z\250t\2605\270\001\3209V\320VW\330\010\033\2307\240\"\320$:\270!\340\004\013\2101"; +static const char __pyx_k_V1_A_UUV__A_Qm1_q_9_gQm_q_1Kz_g[] = "\200\001\330\021%\240V\2501\330\005\006\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_a_3axs_C_1_avV6_a_Bhas_q_a_3a_Q[] = "\320\004+\250=\270\016\300a\360$\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\"\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\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\022\240>\3201P\320P[\320[`\320`a\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.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"; +static const char __pyx_k_parse_restrictions_locals_to_num_3[] = "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_26genexpr(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*/ @@ -3169,10 +3175,11 @@ typedef struct { __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; __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[20]; - PyObject *__pyx_string_tab[210]; + PyObject *__pyx_codeobj_tab[21]; + PyObject *__pyx_string_tab[214]; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_neg_1; @@ -3317,192 +3324,196 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_Variables __pyx_string_tab[31] -#define __pyx_kp_u__10 __pyx_string_tab[32] -#define __pyx_kp_u__11 __pyx_string_tab[33] -#define __pyx_kp_u__12 __pyx_string_tab[34] -#define __pyx_kp_u__13 __pyx_string_tab[35] -#define __pyx_kp_u__14 __pyx_string_tab[36] -#define __pyx_kp_u__15 __pyx_string_tab[37] -#define __pyx_kp_u__16 __pyx_string_tab[38] -#define __pyx_kp_u__17 __pyx_string_tab[39] -#define __pyx_kp_u__18 __pyx_string_tab[40] -#define __pyx_kp_u__19 __pyx_string_tab[41] -#define __pyx_kp_u__2 __pyx_string_tab[42] -#define __pyx_kp_u__20 __pyx_string_tab[43] -#define __pyx_kp_u__21 __pyx_string_tab[44] -#define __pyx_kp_u__22 __pyx_string_tab[45] -#define __pyx_kp_u__23 __pyx_string_tab[46] -#define __pyx_kp_u__24 __pyx_string_tab[47] -#define __pyx_kp_u__3 __pyx_string_tab[48] -#define __pyx_kp_u__4 __pyx_string_tab[49] -#define __pyx_kp_u__5 __pyx_string_tab[50] -#define __pyx_kp_u__6 __pyx_string_tab[51] -#define __pyx_kp_u__7 __pyx_string_tab[52] -#define __pyx_kp_u__8 __pyx_string_tab[53] -#define __pyx_kp_u__9 __pyx_string_tab[54] -#define __pyx_kp_u_a_zA_Z__0_9 __pyx_string_tab[55] -#define __pyx_kp_u_a_zA_Z__a_zA_Z__0_9 __pyx_string_tab[56] -#define __pyx_kp_u_add_note __pyx_string_tab[57] -#define __pyx_kp_u_and __pyx_string_tab[58] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[59] -#define __pyx_n_u_class_getitem __pyx_string_tab[60] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[61] -#define __pyx_n_u_close __pyx_string_tab[62] -#define __pyx_n_u_co_consts __pyx_string_tab[63] -#define __pyx_n_u_code_object __pyx_string_tab[64] -#define __pyx_n_u_comparator __pyx_string_tab[65] -#define __pyx_n_u_comparators __pyx_string_tab[66] -#define __pyx_n_u_comparators_found __pyx_string_tab[67] -#define __pyx_n_u_comparators_indices __pyx_string_tab[68] -#define __pyx_n_u_compile __pyx_string_tab[69] -#define __pyx_n_u_compile_to_constraints __pyx_string_tab[70] -#define __pyx_n_u_compiled_constraints __pyx_string_tab[71] -#define __pyx_n_u_constraint __pyx_string_tab[72] -#define __pyx_n_u_constraint_constraints __pyx_string_tab[73] -#define __pyx_n_u_constraint_parser __pyx_string_tab[74] -#define __pyx_kp_u_constraint_parser_py __pyx_string_tab[75] -#define __pyx_n_u_constraints __pyx_string_tab[76] -#define __pyx_kp_u_d __pyx_string_tab[77] -#define __pyx_kp_u_def_r __pyx_string_tab[78] -#define __pyx_n_u_dict __pyx_string_tab[79] -#define __pyx_kp_u_disable __pyx_string_tab[80] -#define __pyx_n_u_domains __pyx_string_tab[81] -#define __pyx_kp_u_enable __pyx_string_tab[82] -#define __pyx_n_u_end __pyx_string_tab[83] -#define __pyx_n_u_equalities_found __pyx_string_tab[84] -#define __pyx_n_u_eval __pyx_string_tab[85] -#define __pyx_n_u_exec __pyx_string_tab[86] -#define __pyx_n_u_finalized_constraint __pyx_string_tab[87] -#define __pyx_n_u_findall __pyx_string_tab[88] -#define __pyx_n_u_finditer __pyx_string_tab[89] -#define __pyx_n_u_fromkeys __pyx_string_tab[90] -#define __pyx_n_u_func __pyx_string_tab[91] -#define __pyx_n_u_func_2 __pyx_string_tab[92] -#define __pyx_kp_u_gc __pyx_string_tab[93] -#define __pyx_n_u_genexpr __pyx_string_tab[94] -#define __pyx_n_u_group __pyx_string_tab[95] -#define __pyx_n_u_i __pyx_string_tab[96] -#define __pyx_n_u_index __pyx_string_tab[97] -#define __pyx_n_u_inequalities_found __pyx_string_tab[98] -#define __pyx_n_u_initializing __pyx_string_tab[99] -#define __pyx_n_u_is_coroutine __pyx_string_tab[100] -#define __pyx_kp_u_is_neither_a_string_or_Constrai __pyx_string_tab[101] -#define __pyx_n_u_is_or_evals_to_number __pyx_string_tab[102] -#define __pyx_kp_u_isenabled __pyx_string_tab[103] -#define __pyx_n_u_key __pyx_string_tab[104] -#define __pyx_n_u_keys __pyx_string_tab[105] -#define __pyx_n_u_left __pyx_string_tab[106] -#define __pyx_n_u_left_num __pyx_string_tab[107] -#define __pyx_n_u_left_remainder __pyx_string_tab[108] -#define __pyx_n_u_left_swap __pyx_string_tab[109] -#define __pyx_kp_u_list_str __pyx_string_tab[110] -#define __pyx_kp_u_list_tuple_Constraint_list_str_U __pyx_string_tab[111] -#define __pyx_kp_u_list_tuple_Union_Constraint_str __pyx_string_tab[112] -#define __pyx_n_u_m __pyx_string_tab[113] -#define __pyx_n_u_main __pyx_string_tab[114] -#define __pyx_n_u_match_object __pyx_string_tab[115] -#define __pyx_n_u_module __pyx_string_tab[116] -#define __pyx_n_u_name __pyx_string_tab[117] -#define __pyx_n_u_next __pyx_string_tab[118] -#define __pyx_n_u_next_stop __pyx_string_tab[119] -#define __pyx_kp_u_not_in_tune_params __pyx_string_tab[120] -#define __pyx_n_u_number __pyx_string_tab[121] -#define __pyx_n_u_o __pyx_string_tab[122] -#define __pyx_n_u_offset __pyx_string_tab[123] -#define __pyx_n_u_operator __pyx_string_tab[124] -#define __pyx_n_u_operators __pyx_string_tab[125] -#define __pyx_n_u_operators_found __pyx_string_tab[126] -#define __pyx_n_u_operators_left __pyx_string_tab[127] -#define __pyx_n_u_operators_right __pyx_string_tab[128] -#define __pyx_kp_u_or __pyx_string_tab[129] -#define __pyx_n_u_p __pyx_string_tab[130] -#define __pyx_n_u_param __pyx_string_tab[131] -#define __pyx_n_u_params __pyx_string_tab[132] -#define __pyx_kp_u_params_params_index __pyx_string_tab[133] -#define __pyx_n_u_params_used __pyx_string_tab[134] -#define __pyx_n_u_params_used_list __pyx_string_tab[135] -#define __pyx_n_u_parse_restrictions __pyx_string_tab[136] -#define __pyx_n_u_parse_restrictions_locals_genexp __pyx_string_tab[137] -#define __pyx_n_u_parse_restrictions_locals_replac __pyx_string_tab[138] -#define __pyx_n_u_parse_restrictions_locals_replac_2 __pyx_string_tab[139] -#define __pyx_n_u_parse_restrictions_locals_to_equ __pyx_string_tab[140] -#define __pyx_n_u_parse_restrictions_locals_to_equ_2 __pyx_string_tab[141] -#define __pyx_n_u_parse_restrictions_locals_to_mul __pyx_string_tab[142] -#define __pyx_n_u_parse_restrictions_locals_to_num __pyx_string_tab[143] -#define __pyx_n_u_parse_restrictions_locals_to_num_2 __pyx_string_tab[144] -#define __pyx_n_u_parse_restrictions_locals_to_num_3 __pyx_string_tab[145] -#define __pyx_n_u_parse_restrictions_locals_to_num_4 __pyx_string_tab[146] -#define __pyx_n_u_parsed_restriction __pyx_string_tab[147] -#define __pyx_n_u_parsed_restrictions __pyx_string_tab[148] -#define __pyx_n_u_picklable __pyx_string_tab[149] -#define __pyx_n_u_pop __pyx_string_tab[150] -#define __pyx_n_u_prev_stop __pyx_string_tab[151] -#define __pyx_n_u_qualname __pyx_string_tab[152] -#define __pyx_n_u_r __pyx_string_tab[153] -#define __pyx_n_u_range __pyx_string_tab[154] -#define __pyx_n_u_re __pyx_string_tab[155] -#define __pyx_n_u_regex_match_variable __pyx_string_tab[156] -#define __pyx_n_u_regex_match_variable_or_constant __pyx_string_tab[157] -#define __pyx_n_u_replace __pyx_string_tab[158] -#define __pyx_n_u_replace_params __pyx_string_tab[159] -#define __pyx_n_u_replace_params_split __pyx_string_tab[160] -#define __pyx_n_u_res __pyx_string_tab[161] -#define __pyx_n_u_restriction __pyx_string_tab[162] -#define __pyx_n_u_restrictions __pyx_string_tab[163] -#define __pyx_n_u_restrictions_cleaned __pyx_string_tab[164] -#define __pyx_n_u_restrictions_cleaned_unique __pyx_string_tab[165] -#define __pyx_n_u_restrictions_unique_indices __pyx_string_tab[166] -#define __pyx_n_u_return __pyx_string_tab[167] -#define __pyx_kp_u_return_2 __pyx_string_tab[168] -#define __pyx_n_u_right __pyx_string_tab[169] -#define __pyx_n_u_right_num __pyx_string_tab[170] -#define __pyx_n_u_right_remainder __pyx_string_tab[171] -#define __pyx_n_u_right_swap __pyx_string_tab[172] -#define __pyx_n_u_s __pyx_string_tab[173] -#define __pyx_n_u_search __pyx_string_tab[174] -#define __pyx_n_u_send __pyx_string_tab[175] -#define __pyx_n_u_set_name __pyx_string_tab[176] -#define __pyx_n_u_spec __pyx_string_tab[177] -#define __pyx_n_u_split __pyx_string_tab[178] -#define __pyx_n_u_split_restrictions __pyx_string_tab[179] -#define __pyx_n_u_splitted __pyx_string_tab[180] -#define __pyx_n_u_start __pyx_string_tab[181] -#define __pyx_n_u_str __pyx_string_tab[182] -#define __pyx_kp_u_string __pyx_string_tab[183] -#define __pyx_n_u_strip __pyx_string_tab[184] -#define __pyx_n_u_sub __pyx_string_tab[185] -#define __pyx_n_u_supported_operators __pyx_string_tab[186] -#define __pyx_n_u_swapped_side_first_component __pyx_string_tab[187] -#define __pyx_n_u_temp_copy __pyx_string_tab[188] -#define __pyx_n_u_test __pyx_string_tab[189] -#define __pyx_n_u_throw __pyx_string_tab[190] -#define __pyx_n_u_to_equality_constraint __pyx_string_tab[191] -#define __pyx_n_u_to_multiple_restrictions __pyx_string_tab[192] -#define __pyx_n_u_to_numeric_constraint __pyx_string_tab[193] -#define __pyx_n_u_tune_params __pyx_string_tab[194] -#define __pyx_n_u_types __pyx_string_tab[195] -#define __pyx_n_u_typing __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_var __pyx_string_tab[203] -#define __pyx_n_u_variable_operators_left __pyx_string_tab[204] -#define __pyx_n_u_variable_operators_right __pyx_string_tab[205] -#define __pyx_n_u_variable_supported_operators __pyx_string_tab[206] -#define __pyx_n_u_variable_unique_operators __pyx_string_tab[207] -#define __pyx_n_u_variables __pyx_string_tab[208] -#define __pyx_n_u_variables_on_left __pyx_string_tab[209] +#define __pyx_n_u_VERBOSE __pyx_string_tab[24] +#define __pyx_n_u_ValueError __pyx_string_tab[25] +#define __pyx_n_u_VariableExactProdConstraint __pyx_string_tab[26] +#define __pyx_n_u_VariableExactSumConstraint __pyx_string_tab[27] +#define __pyx_n_u_VariableMaxProdConstraint __pyx_string_tab[28] +#define __pyx_n_u_VariableMaxSumConstraint __pyx_string_tab[29] +#define __pyx_n_u_VariableMinProdConstraint __pyx_string_tab[30] +#define __pyx_n_u_VariableMinSumConstraint __pyx_string_tab[31] +#define __pyx_kp_u_Variables __pyx_string_tab[32] +#define __pyx_kp_u__10 __pyx_string_tab[33] +#define __pyx_kp_u__11 __pyx_string_tab[34] +#define __pyx_kp_u__12 __pyx_string_tab[35] +#define __pyx_kp_u__13 __pyx_string_tab[36] +#define __pyx_kp_u__14 __pyx_string_tab[37] +#define __pyx_kp_u__15 __pyx_string_tab[38] +#define __pyx_kp_u__16 __pyx_string_tab[39] +#define __pyx_kp_u__17 __pyx_string_tab[40] +#define __pyx_kp_u__18 __pyx_string_tab[41] +#define __pyx_kp_u__19 __pyx_string_tab[42] +#define __pyx_kp_u__2 __pyx_string_tab[43] +#define __pyx_kp_u__20 __pyx_string_tab[44] +#define __pyx_kp_u__21 __pyx_string_tab[45] +#define __pyx_kp_u__22 __pyx_string_tab[46] +#define __pyx_kp_u__23 __pyx_string_tab[47] +#define __pyx_kp_u__24 __pyx_string_tab[48] +#define __pyx_kp_u__3 __pyx_string_tab[49] +#define __pyx_kp_u__4 __pyx_string_tab[50] +#define __pyx_kp_u__5 __pyx_string_tab[51] +#define __pyx_kp_u__6 __pyx_string_tab[52] +#define __pyx_kp_u__7 __pyx_string_tab[53] +#define __pyx_kp_u__8 __pyx_string_tab[54] +#define __pyx_kp_u__9 __pyx_string_tab[55] +#define __pyx_kp_u_a_zA_Z__0_9 __pyx_string_tab[56] +#define __pyx_kp_u_a_zA_Z__a_zA_Z__0_9 __pyx_string_tab[57] +#define __pyx_kp_u_add_note __pyx_string_tab[58] +#define __pyx_kp_u_and __pyx_string_tab[59] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[60] +#define __pyx_n_u_class_getitem __pyx_string_tab[61] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[62] +#define __pyx_n_u_close __pyx_string_tab[63] +#define __pyx_n_u_co_consts __pyx_string_tab[64] +#define __pyx_n_u_code_object __pyx_string_tab[65] +#define __pyx_n_u_comparator __pyx_string_tab[66] +#define __pyx_n_u_comparators __pyx_string_tab[67] +#define __pyx_n_u_comparators_found __pyx_string_tab[68] +#define __pyx_n_u_comparators_indices __pyx_string_tab[69] +#define __pyx_n_u_compile __pyx_string_tab[70] +#define __pyx_n_u_compile_to_constraints __pyx_string_tab[71] +#define __pyx_n_u_compiled_constraints __pyx_string_tab[72] +#define __pyx_n_u_constraint __pyx_string_tab[73] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[74] +#define __pyx_n_u_constraint_parser __pyx_string_tab[75] +#define __pyx_kp_u_constraint_parser_py __pyx_string_tab[76] +#define __pyx_n_u_constraints __pyx_string_tab[77] +#define __pyx_kp_u_d __pyx_string_tab[78] +#define __pyx_kp_u_def_r __pyx_string_tab[79] +#define __pyx_n_u_dict __pyx_string_tab[80] +#define __pyx_kp_u_disable __pyx_string_tab[81] +#define __pyx_n_u_domains __pyx_string_tab[82] +#define __pyx_kp_u_enable __pyx_string_tab[83] +#define __pyx_n_u_end __pyx_string_tab[84] +#define __pyx_n_u_equalities_found __pyx_string_tab[85] +#define __pyx_n_u_eval __pyx_string_tab[86] +#define __pyx_n_u_exec __pyx_string_tab[87] +#define __pyx_n_u_expr __pyx_string_tab[88] +#define __pyx_n_u_extract_operators __pyx_string_tab[89] +#define __pyx_n_u_finalized_constraint __pyx_string_tab[90] +#define __pyx_n_u_findall __pyx_string_tab[91] +#define __pyx_n_u_finditer __pyx_string_tab[92] +#define __pyx_n_u_fromkeys __pyx_string_tab[93] +#define __pyx_n_u_func __pyx_string_tab[94] +#define __pyx_n_u_func_2 __pyx_string_tab[95] +#define __pyx_kp_u_gc __pyx_string_tab[96] +#define __pyx_n_u_genexpr __pyx_string_tab[97] +#define __pyx_n_u_group __pyx_string_tab[98] +#define __pyx_n_u_i __pyx_string_tab[99] +#define __pyx_n_u_index __pyx_string_tab[100] +#define __pyx_n_u_inequalities_found __pyx_string_tab[101] +#define __pyx_n_u_initializing __pyx_string_tab[102] +#define __pyx_n_u_is_coroutine __pyx_string_tab[103] +#define __pyx_kp_u_is_neither_a_string_or_Constrai __pyx_string_tab[104] +#define __pyx_n_u_is_or_evals_to_number __pyx_string_tab[105] +#define __pyx_kp_u_isenabled __pyx_string_tab[106] +#define __pyx_n_u_key __pyx_string_tab[107] +#define __pyx_n_u_keys __pyx_string_tab[108] +#define __pyx_n_u_left __pyx_string_tab[109] +#define __pyx_n_u_left_num __pyx_string_tab[110] +#define __pyx_n_u_left_remainder __pyx_string_tab[111] +#define __pyx_n_u_left_swap __pyx_string_tab[112] +#define __pyx_kp_u_list_str __pyx_string_tab[113] +#define __pyx_kp_u_list_tuple_Constraint_list_str_U __pyx_string_tab[114] +#define __pyx_kp_u_list_tuple_Union_Constraint_str __pyx_string_tab[115] +#define __pyx_n_u_m __pyx_string_tab[116] +#define __pyx_n_u_main __pyx_string_tab[117] +#define __pyx_kp_u_match_but_not_w_d_binary_preced __pyx_string_tab[118] +#define __pyx_n_u_match_object __pyx_string_tab[119] +#define __pyx_n_u_matches __pyx_string_tab[120] +#define __pyx_n_u_module __pyx_string_tab[121] +#define __pyx_n_u_name __pyx_string_tab[122] +#define __pyx_n_u_next __pyx_string_tab[123] +#define __pyx_n_u_next_stop __pyx_string_tab[124] +#define __pyx_kp_u_not_in_tune_params __pyx_string_tab[125] +#define __pyx_n_u_number __pyx_string_tab[126] +#define __pyx_n_u_o __pyx_string_tab[127] +#define __pyx_n_u_offset __pyx_string_tab[128] +#define __pyx_n_u_operator __pyx_string_tab[129] +#define __pyx_n_u_operators __pyx_string_tab[130] +#define __pyx_n_u_operators_found __pyx_string_tab[131] +#define __pyx_n_u_operators_left __pyx_string_tab[132] +#define __pyx_n_u_operators_right __pyx_string_tab[133] +#define __pyx_kp_u_or __pyx_string_tab[134] +#define __pyx_n_u_p __pyx_string_tab[135] +#define __pyx_n_u_param __pyx_string_tab[136] +#define __pyx_n_u_params __pyx_string_tab[137] +#define __pyx_kp_u_params_params_index __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_range __pyx_string_tab[159] +#define __pyx_n_u_re __pyx_string_tab[160] +#define __pyx_n_u_regex_match_variable __pyx_string_tab[161] +#define __pyx_n_u_regex_match_variable_or_constant __pyx_string_tab[162] +#define __pyx_n_u_replace __pyx_string_tab[163] +#define __pyx_n_u_replace_params __pyx_string_tab[164] +#define __pyx_n_u_replace_params_split __pyx_string_tab[165] +#define __pyx_n_u_res __pyx_string_tab[166] +#define __pyx_n_u_restriction __pyx_string_tab[167] +#define __pyx_n_u_restrictions __pyx_string_tab[168] +#define __pyx_n_u_restrictions_cleaned __pyx_string_tab[169] +#define __pyx_n_u_restrictions_cleaned_unique __pyx_string_tab[170] +#define __pyx_n_u_restrictions_unique_indices __pyx_string_tab[171] +#define __pyx_n_u_return __pyx_string_tab[172] +#define __pyx_kp_u_return_2 __pyx_string_tab[173] +#define __pyx_n_u_right __pyx_string_tab[174] +#define __pyx_n_u_right_num __pyx_string_tab[175] +#define __pyx_n_u_right_remainder __pyx_string_tab[176] +#define __pyx_n_u_right_swap __pyx_string_tab[177] +#define __pyx_n_u_s __pyx_string_tab[178] +#define __pyx_n_u_search __pyx_string_tab[179] +#define __pyx_n_u_send __pyx_string_tab[180] +#define __pyx_n_u_set_name __pyx_string_tab[181] +#define __pyx_n_u_spec __pyx_string_tab[182] +#define __pyx_n_u_split __pyx_string_tab[183] +#define __pyx_n_u_split_restrictions __pyx_string_tab[184] +#define __pyx_n_u_splitted __pyx_string_tab[185] +#define __pyx_n_u_start __pyx_string_tab[186] +#define __pyx_n_u_str __pyx_string_tab[187] +#define __pyx_kp_u_string __pyx_string_tab[188] +#define __pyx_n_u_strip __pyx_string_tab[189] +#define __pyx_n_u_sub __pyx_string_tab[190] +#define __pyx_n_u_swapped_side_first_component __pyx_string_tab[191] +#define __pyx_n_u_temp_copy __pyx_string_tab[192] +#define __pyx_n_u_test __pyx_string_tab[193] +#define __pyx_n_u_throw __pyx_string_tab[194] +#define __pyx_n_u_to_equality_constraint __pyx_string_tab[195] +#define __pyx_n_u_to_multiple_restrictions __pyx_string_tab[196] +#define __pyx_n_u_to_numeric_constraint __pyx_string_tab[197] +#define __pyx_n_u_tune_params __pyx_string_tab[198] +#define __pyx_n_u_types __pyx_string_tab[199] +#define __pyx_n_u_typing __pyx_string_tab[200] +#define __pyx_n_u_union __pyx_string_tab[201] +#define __pyx_n_u_unique_operators __pyx_string_tab[202] +#define __pyx_n_u_unique_operators_left __pyx_string_tab[203] +#define __pyx_n_u_unique_operators_right __pyx_string_tab[204] +#define __pyx_n_u_v __pyx_string_tab[205] +#define __pyx_n_u_value __pyx_string_tab[206] +#define __pyx_n_u_var __pyx_string_tab[207] +#define __pyx_n_u_variable_operators_left __pyx_string_tab[208] +#define __pyx_n_u_variable_operators_right __pyx_string_tab[209] +#define __pyx_n_u_variable_supported_operators __pyx_string_tab[210] +#define __pyx_n_u_variable_unique_operators __pyx_string_tab[211] +#define __pyx_n_u_variables __pyx_string_tab[212] +#define __pyx_n_u_variables_on_left __pyx_string_tab[213] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3555,8 +3566,8 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { 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<20; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<210; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<21; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<214; ++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); @@ -3612,8 +3623,8 @@ 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_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<20; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<210; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<21; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<214; ++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); @@ -3622,11 +3633,11 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void #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 + * """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 */ @@ -3671,39 +3682,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:; @@ -3714,8 +3725,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 */ @@ -3735,7 +3746,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): # <<<<<<<<<<<<<< @@ -3782,32 +3793,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:; @@ -3846,7 +3857,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) # <<<<<<<<<<<<<< @@ -3860,40 +3871,40 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para 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_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 + "']]" # <<<<<<<<<<<<<< @@ -3901,16 +3912,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_ConcatInPlace(__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: # <<<<<<<<<<<<<< @@ -3919,7 +3930,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 # <<<<<<<<<<<<<< @@ -3933,7 +3944,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): # <<<<<<<<<<<<<< @@ -3955,7 +3966,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): # <<<<<<<<<<<<<< @@ -4002,32 +4013,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:; @@ -4067,7 +4078,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) # <<<<<<<<<<<<<< @@ -4081,54 +4092,54 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par 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_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 # <<<<<<<<<<<<<< @@ -4140,7 +4151,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: # <<<<<<<<<<<<<< @@ -4149,7 +4160,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par */ } - /* "constraint/parser.py":52 + /* "constraint/parser.py":54 * return param * else: * return key # <<<<<<<<<<<<<< @@ -4163,7 +4174,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): # <<<<<<<<<<<<<< @@ -4185,7 +4196,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]: # <<<<<<<<<<<<<< @@ -4233,32 +4244,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:; @@ -4269,7 +4280,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 */ @@ -4320,19 +4331,19 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple 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: # <<<<<<<<<<<<<< @@ -4345,45 +4356,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_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 # <<<<<<<<<<<<<< @@ -4392,7 +4403,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: # <<<<<<<<<<<<<< @@ -4401,31 +4412,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)] # <<<<<<<<<<<<<< @@ -4433,15 +4444,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 @@ -4461,7 +4472,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __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)) { @@ -4469,9 +4480,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 (;;) { @@ -4480,7 +4491,7 @@ 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; } @@ -4490,7 +4501,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple { 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; } @@ -4501,13 +4512,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; @@ -4523,7 +4534,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple 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_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; @@ -4533,18 +4544,18 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple 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_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; @@ -4558,27 +4569,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 # <<<<<<<<<<<<<< @@ -4587,7 +4598,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: # <<<<<<<<<<<<<< @@ -4596,7 +4607,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)): # <<<<<<<<<<<<<< @@ -4606,8 +4617,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __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_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_9 = PyLong_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = 1; { @@ -4616,7 +4627,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __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)) { @@ -4624,9 +4635,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_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_12 = -1; __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, 70, __pyx_L1_error) + __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 (;;) { @@ -4635,7 +4646,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple { 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) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 72, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -4645,7 +4656,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple { 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) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 72, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -4656,13 +4667,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __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; @@ -4672,7 +4683,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 # <<<<<<<<<<<<<< @@ -4682,26 +4693,26 @@ 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_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, 74, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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_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, 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, 72, __pyx_L1_error) + __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_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_GetItemInt(__pyx_t_10, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); 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_PyLong_AddObjC(__pyx_t_9, __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_3 = __pyx_t_10; @@ -4713,34 +4724,34 @@ 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_t_14 = __Pyx_PyList_GET_SIZE(__pyx_v_comparators_indices); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_10 = PyLong_FromSsize_t((__pyx_t_14 - 1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 76, __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_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, 76, __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_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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_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, 76, __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_PyObject_GetItem(__pyx_v_comparators_indices, __pyx_t_9); 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_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); 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; } 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_t_14 = PyObject_Length(__pyx_v_temp_copy); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = __pyx_t_9; __pyx_t_9 = 0; @@ -4748,14 +4759,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __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_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, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = __pyx_t_10; __Pyx_INCREF(__pyx_t_9); @@ -4765,13 +4776,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __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) + 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)): # <<<<<<<<<<<<<< @@ -4781,7 +4792,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: # <<<<<<<<<<<<<< @@ -4792,19 +4803,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]) -> Optional[ */ __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]: # <<<<<<<<<<<<<< @@ -4837,12 +4848,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]) -> Optional[ # <<<<<<<<<<<<<< + * Union[ + * MinSumConstraint, */ /* Python wrapper */ @@ -4886,39 +4897,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:; @@ -4929,8 +4940,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 */ @@ -4949,344 +4960,41 @@ 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":99 + * """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]); + __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, 99, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - 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_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); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; + __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, 99, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; } /* function exit code */ @@ -5321,16 +5029,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, 84, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 84, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 99, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 99, __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, 84, __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, 99, __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, 84, __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, 99, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -5338,7 +5046,7 @@ 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, 84, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 99, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5348,7 +5056,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 84, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 99, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5359,13 +5067,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __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, 84, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 99, __pyx_L1_error) PyErr_Clear(); } break; @@ -5423,7 +5131,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; @@ -5436,7 +5144,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_2_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 84, __pyx_L1_error) + __PYX_ERR(0, 99, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5447,7 +5155,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, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5464,7 +5172,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; @@ -5486,40 +5194,40 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 84, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 84, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 99, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 99, __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, 84, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 99, __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, 84, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __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_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 84, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 99, __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 subscriptable"); - __PYX_ERR(0, 84, __pyx_L1_error) + __PYX_ERR(0, 99, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_tune_params, __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_tune_params, __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7genexpr_genexpr(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_4 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7genexpr_genexpr(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { @@ -5559,9 +5267,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_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 +/* "constraint/parser.py":110 * * # split the string on the comparison and remove leading and trailing whitespace * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< @@ -5569,7 +5277,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 @@ -5581,7 +5289,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_4_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 95, __pyx_L1_error) + __PYX_ERR(0, 110, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5592,7 +5300,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, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5608,7 +5316,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; @@ -5632,11 +5340,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __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, 95, __pyx_L1_error) + __PYX_ERR(0, 110, __pyx_L1_error) } - 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) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 110, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 110, __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, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -5645,13 +5353,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 95, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 110, __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, 95, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __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); @@ -5664,7 +5372,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_r = __pyx_t_1; @@ -5683,7 +5391,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_2); __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 95, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 110, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -5709,17 +5417,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 +/* "constraint/parser.py":155 * * # 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 @@ -5731,7 +5439,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_5_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 140, __pyx_L1_error) + __PYX_ERR(0, 155, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5742,7 +5450,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, 155, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5758,7 +5466,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; @@ -5782,11 +5490,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __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, 140, __pyx_L1_error) + __PYX_ERR(0, 155, __pyx_L1_error) } - 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) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 155, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 155, __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, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -5795,13 +5503,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 140, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 155, __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, 140, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __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); @@ -5814,7 +5522,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_r = __pyx_t_1; @@ -5833,7 +5541,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_2); __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 140, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 155, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -5859,17 +5567,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":170 +/* "constraint/parser.py":175 * 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 ( */ -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 @@ -5881,7 +5589,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, 170, __pyx_L1_error) + __PYX_ERR(0, 175, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5892,7 +5600,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, 170, __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, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5908,7 +5616,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_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; @@ -5931,16 +5639,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, 170, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 170, __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, 170, __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, 170, __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)) { @@ -5948,7 +5656,7 @@ 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, 170, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 175, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5958,7 +5666,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 170, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 175, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5969,13 +5677,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __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, 170, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 175, __pyx_L1_error) PyErr_Clear(); } break; @@ -5993,15 +5701,15 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __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_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 170, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 175, __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, 170, __pyx_L1_error) + __PYX_ERR(0, 175, __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, 170, __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, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { __Pyx_XDECREF(__pyx_r); @@ -6040,9 +5748,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_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":177 +/* "constraint/parser.py":184 * * # 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) # <<<<<<<<<<<<<< @@ -6050,7 +5758,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric * variable_unique_operators = list(set(variable_operators_left).union(set(variable_operators_right))) */ -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 @@ -6062,7 +5770,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_7_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 177, __pyx_L1_error) + __PYX_ERR(0, 184, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6073,7 +5781,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, 177, __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, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6089,7 +5797,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; @@ -6111,11 +5819,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 177, __pyx_L1_error) - __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 177, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 177, __pyx_L1_error) } - __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 184, __pyx_L1_error) } + __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -6124,20 +5832,20 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 177, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 184, __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, 177, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __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, 177, __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, 177, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_variable_supported_operators)) { __Pyx_RaiseClosureNameError("variable_supported_operators"); __PYX_ERR(0, 184, __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, 184, __pyx_L1_error) if (__pyx_t_4) { __pyx_t_5 = __pyx_cur_scope->__pyx_v_s; __Pyx_INCREF(__pyx_t_5); @@ -6146,10 +5854,10 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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, 177, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 177, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } } @@ -6177,9 +5885,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_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":178 +/* "constraint/parser.py":185 * # 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) # <<<<<<<<<<<<<< @@ -6187,7 +5895,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric * # 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_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 @@ -6199,7 +5907,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, 178, __pyx_L1_error) + __PYX_ERR(0, 185, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6210,7 +5918,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, 178, __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, 185, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6226,7 +5934,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_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; @@ -6248,11 +5956,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 178, __pyx_L1_error) - __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 178, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 178, __pyx_L1_error) } - __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 185, __pyx_L1_error) } + __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -6261,20 +5969,20 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 178, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 185, __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, 178, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __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, 178, __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, 178, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_variable_supported_operators)) { __Pyx_RaiseClosureNameError("variable_supported_operators"); __PYX_ERR(0, 185, __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, 185, __pyx_L1_error) if (__pyx_t_4) { __pyx_t_5 = __pyx_cur_scope->__pyx_v_s; __Pyx_INCREF(__pyx_t_5); @@ -6283,10 +5991,10 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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, 178, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 178, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } } @@ -6314,17 +6022,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_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_20generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":181 - * 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":190 + * 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_20genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { +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 @@ -6336,7 +6044,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_9_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 181, __pyx_L1_error) + __PYX_ERR(0, 190, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6347,7 +6055,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, 181, __pyx_L1_error) + __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, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6363,7 +6071,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_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_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; @@ -6387,16 +6095,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, 181, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 181, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 190, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 190, __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, 181, __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, 190, __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, 181, __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, 190, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6404,7 +6112,7 @@ 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, 181, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 190, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6414,7 +6122,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 181, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 190, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6425,13 +6133,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __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, 181, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 190, __pyx_L1_error) PyErr_Clear(); } break; @@ -6449,11 +6157,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __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, 181, __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, 181, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 190, __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, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = (!__pyx_t_7); if (__pyx_t_8) { @@ -6493,9 +6201,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_23generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":247 +/* "constraint/parser.py":282 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< @@ -6503,7 +6211,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric * return None */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_23genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { +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 @@ -6515,7 +6223,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_10_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 247, __pyx_L1_error) + __PYX_ERR(0, 282, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6526,7 +6234,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, 247, __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, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6542,7 +6250,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_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_23generator8(__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); PyObject *__pyx_r = NULL; @@ -6564,16 +6272,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, 247, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 247, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 282, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 282, __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, 247, __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, 282, __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, 247, __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, 282, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6581,7 +6289,7 @@ 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, 247, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 282, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6591,7 +6299,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 247, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 282, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6602,13 +6310,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __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, 247, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 282, __pyx_L1_error) PyErr_Clear(); } break; @@ -6619,9 +6327,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, 247, __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, 247, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 247, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_operator)) { __Pyx_RaiseClosureNameError("operator"); __PYX_ERR(0, 282, __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, 282, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { @@ -6660,9 +6368,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_28generator9(__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":254 +/* "constraint/parser.py":289 * 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): # <<<<<<<<<<<<<< @@ -6670,7 +6378,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric * if operator == "**": */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_26genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { +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 @@ -6682,7 +6390,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_11_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 254, __pyx_L1_error) + __PYX_ERR(0, 289, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6693,7 +6401,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_28generator9, ((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, 254, __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, 289, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6709,7 +6417,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_28generator9(__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_11_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; @@ -6733,16 +6441,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, 254, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 254, __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) } 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, 254, __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, 289, __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, 254, __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, 289, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6750,7 +6458,7 @@ 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, 254, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 289, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6760,7 +6468,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 254, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 289, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6771,13 +6479,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __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, 254, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 289, __pyx_L1_error) PyErr_Clear(); } break; @@ -6795,11 +6503,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __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, 254, __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, 254, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 289, __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, 289, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = (!__pyx_t_7); if (__pyx_t_8) { @@ -6840,12 +6548,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]) -> Optional[ # <<<<<<<<<<<<<< + * Union[ + * MinSumConstraint, */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_constraint(PyObject *__pyx_self, PyObject *__pyx_v_restriction, PyObject *__pyx_v_params) { @@ -6855,7 +6563,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; @@ -6867,7 +6574,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; @@ -6879,19 +6585,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_28generator9 = 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; @@ -6915,7 +6617,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); } @@ -6927,7 +6629,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_params); __Pyx_INCREF(__pyx_v_restriction); - /* "constraint/parser.py":84 + /* "constraint/parser.py":99 * """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): # <<<<<<<<<<<<<< @@ -6936,7 +6638,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __pyx_t_2 = __pyx_cur_scope->__pyx_v_params; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 == 0); if (!__pyx_t_4) { @@ -6944,19 +6646,19 @@ 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, 99, __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_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = (!__pyx_t_4); __pyx_t_1 = __pyx_t_6; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":85 + /* "constraint/parser.py":100 * # 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 # <<<<<<<<<<<<<< @@ -6967,7 +6669,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":84 + /* "constraint/parser.py":99 * """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): # <<<<<<<<<<<<<< @@ -6976,34 +6678,34 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":87 + /* "constraint/parser.py":102 * return None * * comparators = ["<=", "==", ">=", ">", "<"] # <<<<<<<<<<<<<< * comparators_found = re.findall("|".join(comparators), restriction) * # check if there is exactly one comparator, if not, return None */ - __pyx_t_5 = PyList_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_5 = PyList_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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_5, 0, __pyx_mstate_global->__pyx_kp_u__2) != (0)) __PYX_ERR(0, 87, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_mstate_global->__pyx_kp_u__2) != (0)) __PYX_ERR(0, 102, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__7); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_mstate_global->__pyx_kp_u__7) != (0)) __PYX_ERR(0, 87, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_mstate_global->__pyx_kp_u__7) != (0)) __PYX_ERR(0, 102, __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_5, 2, __pyx_mstate_global->__pyx_kp_u__3) != (0)) __PYX_ERR(0, 87, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_mstate_global->__pyx_kp_u__3) != (0)) __PYX_ERR(0, 102, __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_5, 3, __pyx_mstate_global->__pyx_kp_u__4) != (0)) __PYX_ERR(0, 87, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 3, __pyx_mstate_global->__pyx_kp_u__4) != (0)) __PYX_ERR(0, 102, __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_5, 4, __pyx_mstate_global->__pyx_kp_u__5) != (0)) __PYX_ERR(0, 87, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 4, __pyx_mstate_global->__pyx_kp_u__5) != (0)) __PYX_ERR(0, 102, __pyx_L1_error); __pyx_v_comparators = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/parser.py":88 + /* "constraint/parser.py":103 * * comparators = ["<=", "==", ">=", ">", "<"] * comparators_found = re.findall("|".join(comparators), restriction) # <<<<<<<<<<<<<< @@ -7011,12 +6713,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if len(comparators_found) != 1: */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_comparators); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_7 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_comparators); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -7036,24 +6738,24 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_v_comparators_found = __pyx_t_5; __pyx_t_5 = 0; - /* "constraint/parser.py":90 + /* "constraint/parser.py":105 * comparators_found = re.findall("|".join(comparators), restriction) * # check if there is exactly one comparator, if not, return None * if len(comparators_found) != 1: # <<<<<<<<<<<<<< * return None * comparator = comparators_found[0] */ - __pyx_t_3 = PyObject_Length(__pyx_v_comparators_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_comparators_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 105, __pyx_L1_error) __pyx_t_1 = (__pyx_t_3 != 1); if (__pyx_t_1) { - /* "constraint/parser.py":91 + /* "constraint/parser.py":106 * # check if there is exactly one comparator, if not, return None * if len(comparators_found) != 1: * return None # <<<<<<<<<<<<<< @@ -7064,7 +6766,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":90 + /* "constraint/parser.py":105 * comparators_found = re.findall("|".join(comparators), restriction) * # check if there is exactly one comparator, if not, return None * if len(comparators_found) != 1: # <<<<<<<<<<<<<< @@ -7073,28 +6775,28 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":92 + /* "constraint/parser.py":107 * if len(comparators_found) != 1: * return None * comparator = comparators_found[0] # <<<<<<<<<<<<<< * * # 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); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_comparator = __pyx_t_5; __pyx_t_5 = 0; - /* "constraint/parser.py":95 + /* "constraint/parser.py":110 * * # split the string on the comparison and remove leading and trailing whitespace * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< * * # 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, 110, __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_t_8 = __Pyx_PySequence_Tuple(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (1) { @@ -7103,7 +6805,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 95, __pyx_L1_error) + __PYX_ERR(0, 110, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); @@ -7111,9 +6813,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -7123,166 +6825,93 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_v_right = __pyx_t_7; __pyx_t_7 = 0; - /* "constraint/parser.py":98 + /* "constraint/parser.py":113 * * # 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] -*/ - __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_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" + * operators_left = extract_operators(left) # <<<<<<<<<<<<<< + * operators_right = extract_operators(right) + * if len(operators_left) > 0 and len(operators_right) > 0: */ - { /* 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_t_7 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_extract_operators); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 113, __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(__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; - __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); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + } + __pyx_v_operators_left = __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" + /* "constraint/parser.py":114 + * # if we have an inverse operation, rewrite to the other side + * 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, 114, __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(__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, 114, __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":115 + * 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, 115, __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, 115, __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":117 * 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 # <<<<<<<<<<<<<< @@ -7293,90 +6922,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":115 + * 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":118 * # 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, 118, __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":119 * 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, 119, __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":120 * 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, 120, __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":121 * 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, 121, __pyx_L1_error) __pyx_t_1 = (__pyx_t_3 == 1); if (__pyx_t_1) { - /* "constraint/parser.py":109 + /* "constraint/parser.py":122 * 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, 122, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong((__pyx_t_3 > 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 122, __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":123 * 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, 123, __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, 123, __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":124 + * 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, 124, __pyx_L1_error) } + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 124, __pyx_L1_error) if (__pyx_t_1) { __Pyx_INCREF(__pyx_v_left); __pyx_t_5 = __pyx_v_left; @@ -7402,15 +7039,15 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 123, __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 + /* "constraint/parser.py":126 + * 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 @@ -7418,7 +7055,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_1 = (__pyx_v_swapped_side_first_component == Py_None); if (__pyx_t_1) { - /* "constraint/parser.py":113 + /* "constraint/parser.py":128 * if swapped_side_first_component is None: * # if there is no variable on the left side, we can't handle this yet * return None # <<<<<<<<<<<<<< @@ -7429,16 +7066,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":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 + /* "constraint/parser.py":126 + * 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 */ } - /* "constraint/parser.py":115 + /* "constraint/parser.py":130 * return None * else: * swapped_side_first_component = swapped_side_first_component.group(0) # <<<<<<<<<<<<<< @@ -7453,83 +7090,83 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ 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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 115, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_DECREF_SET(__pyx_v_swapped_side_first_component, __pyx_t_8); __pyx_t_8 = 0; } - /* "constraint/parser.py":116 + /* "constraint/parser.py":131 * else: * swapped_side_first_component = swapped_side_first_component.group(0) * if "-" in unique_operators: # <<<<<<<<<<<<<< * 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, 131, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":117 + /* "constraint/parser.py":132 * swapped_side_first_component = swapped_side_first_component.group(0) * 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_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 132, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_1); if (__pyx_t_6) { - /* "constraint/parser.py":119 + /* "constraint/parser.py":134 * 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}" */ - __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_component); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 119, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_right, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_component); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_right, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_right_remainder = __pyx_t_8; __pyx_t_8 = 0; - /* "constraint/parser.py":120 + /* "constraint/parser.py":135 * # 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_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_left_swap = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/parser.py":121 - * right_remainder = right[len(swapped_side_first_component):] + /* "constraint/parser.py":136 + * 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" */ - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_component, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_component, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_10[0] = __pyx_t_2; __pyx_t_10[1] = __pyx_t_8; __pyx_t_10[2] = __pyx_t_5; __pyx_t_10[3] = __pyx_t_7; __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7)); - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 121, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -7538,66 +7175,66 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF_SET(__pyx_v_restriction, ((PyObject*)__pyx_t_11)); __pyx_t_11 = 0; - /* "constraint/parser.py":117 + /* "constraint/parser.py":132 * swapped_side_first_component = swapped_side_first_component.group(0) * 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 + /* "constraint/parser.py":139 * 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}" */ /*else*/ { - __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_component); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 124, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_v_left, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_component); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_v_left, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_v_left_remainder = __pyx_t_11; __pyx_t_11 = 0; - /* "constraint/parser.py":125 + /* "constraint/parser.py":140 * # 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: */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_v_right_swap = __pyx_t_7; __pyx_t_7 = 0; - /* "constraint/parser.py":126 - * left_remainder = left[len(swapped_side_first_component):] + /* "constraint/parser.py":141 + * 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: */ - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_component, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_component, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10[0] = __pyx_t_7; __pyx_t_10[1] = __pyx_t_11; __pyx_t_10[2] = __pyx_t_5; __pyx_t_10[3] = __pyx_t_8; __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8)); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __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; @@ -7606,9 +7243,9 @@ 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 + /* "constraint/parser.py":131 * else: * swapped_side_first_component = swapped_side_first_component.group(0) * if "-" in unique_operators: # <<<<<<<<<<<<<< @@ -7617,76 +7254,76 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":127 + /* "constraint/parser.py":142 * 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" */ - __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, 142, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":128 + /* "constraint/parser.py":143 * 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) :] */ - __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_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 143, __pyx_L1_error) __pyx_t_1 = (!__pyx_t_6); if (__pyx_t_1) { - /* "constraint/parser.py":130 + /* "constraint/parser.py":145 * 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}" */ - __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_component); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 130, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_right, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_component); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_right, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_right_remainder, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":131 + /* "constraint/parser.py":146 * # 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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_left_swap, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/parser.py":132 - * right_remainder = right[len(swapped_side_first_component):] + /* "constraint/parser.py":147 + * 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" */ - __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_component, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_component, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10[0] = __pyx_t_8; __pyx_t_10[1] = __pyx_t_2; __pyx_t_10[2] = __pyx_t_5; __pyx_t_10[3] = __pyx_t_11; __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11)); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 132, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 147, __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; @@ -7695,66 +7332,66 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF_SET(__pyx_v_restriction, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; - /* "constraint/parser.py":128 + /* "constraint/parser.py":143 * 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) :] */ - goto __pyx_L31; + goto __pyx_L15; } - /* "constraint/parser.py":135 + /* "constraint/parser.py":150 * 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}" */ /*else*/ { - __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_component); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 135, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_left, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_component); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_left, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_left_remainder, __pyx_t_7); __pyx_t_7 = 0; - /* "constraint/parser.py":136 + /* "constraint/parser.py":151 * # 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}" * */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_right_swap, __pyx_t_11); __pyx_t_11 = 0; - /* "constraint/parser.py":137 - * left_remainder = left[len(swapped_side_first_component):] + /* "constraint/parser.py":152 + * 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 */ - __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_component, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_component, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10[0] = __pyx_t_11; __pyx_t_10[1] = __pyx_t_7; __pyx_t_10[2] = __pyx_t_5; __pyx_t_10[3] = __pyx_t_2; __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2)); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 137, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -7763,9 +7400,9 @@ 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 + /* "constraint/parser.py":142 * right_swap = left_remainder.replace("-", "+") * restriction = f"{swapped_side_first_component}{comparator}{right}{right_swap}" * if "/" in unique_operators: # <<<<<<<<<<<<<< @@ -7774,16 +7411,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":140 + /* "constraint/parser.py":155 * * # 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, 155, __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_t_2 = __Pyx_PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (1) { @@ -7792,7 +7429,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 140, __pyx_L1_error) + __PYX_ERR(0, 155, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); @@ -7800,9 +7437,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -7812,305 +7449,281 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF_SET(__pyx_v_right, __pyx_t_5); __pyx_t_5 = 0; - /* "constraint/parser.py":141 + /* "constraint/parser.py":156 * # 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, 156, __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(__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, 156, __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 + /* "constraint/parser.py":157 * 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, 157, __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(__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, 157, __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] + /* "constraint/parser.py":158 + * 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) */ - __pyx_t_2 = PySet_New(__pyx_v_operators_left); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_2 = PySet_New(__pyx_v_operators_left); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_unique_operators_left, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "constraint/parser.py":144 - * operators_right = [s.strip() for s in list(right) if s in supported_operators] + /* "constraint/parser.py":159 + * 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) * */ - __pyx_t_2 = PySet_New(__pyx_v_operators_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_2 = PySet_New(__pyx_v_operators_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_unique_operators_right, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "constraint/parser.py":145 + /* "constraint/parser.py":160 * 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 */ - __pyx_t_2 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PySet_Type__union, __pyx_v_unique_operators_left, __pyx_v_unique_operators_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_2 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PySet_Type__union, __pyx_v_unique_operators_left, __pyx_v_unique_operators_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_unique_operators, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "constraint/parser.py":108 + /* "constraint/parser.py":121 * 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":164 * # 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[10])); 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, 164, __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(__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, 164, __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":165 * # 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, 165, __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(__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, 165, __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":166 * 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":168 * 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, 168, __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, 168, __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, 168, __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":170 + * 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 */ - __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, 170, __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, 170, __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, 170, __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(__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, 170, __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":173 * * # 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_3 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 173, __pyx_L1_error) __pyx_t_1 = (__pyx_t_3 == 0); if (__pyx_t_1) { - /* "constraint/parser.py":169 + /* "constraint/parser.py":174 * # if the restriction contains more than the variables and supported operators, return None * if len(variables) == 0: * return None # <<<<<<<<<<<<<< @@ -8121,7 +7734,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":168 + /* "constraint/parser.py":173 * * # if the restriction contains more than the variables and supported operators, return None * if len(variables) == 0: # <<<<<<<<<<<<<< @@ -8130,42 +7743,42 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":170 + /* "constraint/parser.py":175 * 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 ( */ - __pyx_t_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_variables); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __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, 170, __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, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_t_1)) { - /* "constraint/parser.py":171 + /* "constraint/parser.py":176 * 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 + * if ( + * len(re.findall(r"[+-]?\d+", restriction)) > 0 */ - __pyx_t_5 = NULL; + __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_builtin_ValueError); - __pyx_t_2 = __pyx_builtin_ValueError; - __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_variables, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_5 = __pyx_builtin_ValueError; + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_variables, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 171, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 176, __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, 171, __pyx_L1_error) + __PYX_ERR(0, 176, __pyx_L1_error) } - __pyx_t_11 = __Pyx_PyDict_Keys(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tune_params); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_Keys(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tune_params); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_t_11, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_t_11, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Variables; @@ -8173,73 +7786,81 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_not_in_tune_params; __pyx_t_10[3] = __pyx_t_12; __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 20 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12)); - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 171, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_9 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_11}; - __pyx_t_7 = __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_5); __pyx_t_5 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_11}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_5, __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_7)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 176, __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, 171, __pyx_L1_error) + __PYX_ERR(0, 176, __pyx_L1_error) - /* "constraint/parser.py":170 + /* "constraint/parser.py":175 * 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 ( */ } - /* "constraint/parser.py":172 - * if any(var.strip() not in tune_params for var in variables): + /* "constraint/parser.py":178 * 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 ( + * 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 */ - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_9 = 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); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_2); + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_5); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_d, __pyx_v_restriction}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_5, __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; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error) + PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_d, __pyx_v_restriction}; + __pyx_t_7 = __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_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 178, __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, 172, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_1 = (__pyx_t_3 > 0); + + /* "constraint/parser.py":177 + * 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":174 - * if len(re.findall(r'[+-]?\d+', restriction)) > 0: # TODO adjust when we support modifiers such as multipliers (see roadmap) # noqa: E501 + /* "constraint/parser.py":181 + * ): # TODO adjust when we support modifiers such as multipliers (see roadmap) # noqa: E501 * # if the restriction contains numbers, return None * return None # <<<<<<<<<<<<<< * @@ -8249,272 +7870,336 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":172 + /* "constraint/parser.py":177 * 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 + * if ( # <<<<<<<<<<<<<< + * len(re.findall(r"[+-]?\d+", restriction)) > 0 + * ): # TODO adjust when we support modifiers such as multipliers (see roadmap) # noqa: E501 */ } - /* "constraint/parser.py":177 + /* "constraint/parser.py":184 * * # 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_14genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_left); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 177, __pyx_L1_error) + __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, 184, __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, 177, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_variable_operators_left = ((PyObject*)__pyx_t_5); - __pyx_t_5 = 0; + __pyx_v_variable_operators_left = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/parser.py":178 + /* "constraint/parser.py":185 * # 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_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_17genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __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, 178, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_15genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_variable_operators_right = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/parser.py":179 + /* "constraint/parser.py":186 * 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 ( */ - __pyx_t_2 = PySet_New(__pyx_v_variable_operators_left); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_t_2; - __Pyx_INCREF(__pyx_t_5); - __pyx_t_11 = PySet_New(__pyx_v_variable_operators_right); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_5 = PySet_New(__pyx_v_variable_operators_left); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __pyx_t_5; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_11 = PySet_New(__pyx_v_variable_operators_right); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_11}; + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_11}; __pyx_t_7 = __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_5); __pyx_t_5 = 0; + __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_7)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_2 = PySequence_List(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PySequence_List(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_variable_unique_operators = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; + __pyx_v_variable_unique_operators = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; - /* "constraint/parser.py":181 - * variable_unique_operators = list(set(variable_operators_left).union(set(variable_operators_right))) + /* "constraint/parser.py":189 * # 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) + * 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, 181, __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, 189, __pyx_L1_error) __pyx_t_6 = (__pyx_t_3 <= 1); if (__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L57_bool_binop_done; + goto __pyx_L25_bool_binop_done; } - __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_20genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 181, __pyx_L1_error) + + /* "constraint/parser.py":190 + * 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_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_18genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_variables); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 190, __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, 190, __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_7); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 190, __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_L57_bool_binop_done; + goto __pyx_L25_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, 181, __pyx_L1_error) + + /* "constraint/parser.py":191 + * 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, 191, __pyx_L1_error) __pyx_t_6 = (__pyx_t_3 == 0); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L57_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, 181, __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, 191, __pyx_L1_error) __pyx_t_6 = (__pyx_t_3 == 0); __pyx_t_1 = __pyx_t_6; - __pyx_L57_bool_binop_done:; - if (__pyx_t_1) { + __pyx_L25_bool_binop_done:; - /* "constraint/parser.py":182 + /* "constraint/parser.py":188 + * 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":193 + * 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, 182, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyBool_FromLong((__pyx_t_3 > 0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 182, __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, 193, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBool_FromLong((__pyx_t_3 > 0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 193, __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":183 - * 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":194 + * ): # 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, 183, __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, 194, __pyx_L1_error) __pyx_t_6 = (__pyx_t_3 == 0); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L62_bool_binop_done; + goto __pyx_L30_bool_binop_done; } - __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_variable_unique_operators, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_variable_unique_operators, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_mstate_global->__pyx_kp_u__10, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 183, __pyx_L1_error) + __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, 194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_1 = __pyx_t_6; - __pyx_L62_bool_binop_done:; + __pyx_L30_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":184 + /* "constraint/parser.py":195 * 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, 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, 195, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":185 + /* "constraint/parser.py":196 * 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, 185, __pyx_L1_error) + + /* "constraint/parser.py":198 + * 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, 198, __pyx_L1_error) if (__pyx_t_1) { + + /* "constraint/parser.py":197 + * if comparator == "==": + * return ( + * VariableExactSumConstraint(variables[-1], variables[:-1]) # <<<<<<<<<<<<<< + * if variables_on_left + * else VariableExactSumConstraint(variables[0], variables[1:]) +*/ __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __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, 185, __pyx_L1_error) + __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, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); + 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_5); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_12, __pyx_t_8}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_7 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_5; + __pyx_t_5 = 0; } else { - __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 185, __pyx_L1_error) + + /* "constraint/parser.py":199 + * VariableExactSumConstraint(variables[-1], variables[:-1]) + * if variables_on_left + * else VariableExactSumConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< + * ) # noqa: E501 + * elif comparator == "<=": +*/ + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __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, 185, __pyx_L1_error) + __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, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __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); + __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_5); + __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[3] = {__pyx_t_5, __pyx_t_12, __pyx_t_11}; - __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)); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_12, __pyx_t_11}; + __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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_7 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_5; + __pyx_t_5 = 0; } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":184 + /* "constraint/parser.py":195 * 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":186 - * if comparator == "==": - * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 + /* "constraint/parser.py":201 + * 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, 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, 201, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":188 + /* "constraint/parser.py":203 * 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, 188, __pyx_L1_error) + + /* "constraint/parser.py":205 + * 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, 205, __pyx_L1_error) if (__pyx_t_1) { + + /* "constraint/parser.py":204 + * # "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_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 188, __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, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_11))) { @@ -8528,122 +8213,154 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_5}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_2}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__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_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_7 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_5; + __pyx_t_5 = 0; } else { + + /* "constraint/parser.py":206 + * VariableMaxSumConstraint(variables[-1], variables[:-1]) + * if variables_on_left + * else VariableMinSumConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< + * ) # noqa: E501 + * elif comparator == ">=": +*/ __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __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, 188, __pyx_L1_error) + __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, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); + 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_5); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_12, __pyx_t_8}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_5)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_7 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __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 VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 + /* "constraint/parser.py":201 + * 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":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:]) # noqa: E501 + /* "constraint/parser.py":208 + * 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, 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, 208, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":191 + /* "constraint/parser.py":210 * 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, 191, __pyx_L1_error) + + /* "constraint/parser.py":212 + * 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, 212, __pyx_L1_error) if (__pyx_t_1) { - __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 191, __pyx_L1_error) + + /* "constraint/parser.py":211 + * # "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_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __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, 191, __pyx_L1_error) + __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, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __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); + __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_5); + __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[3] = {__pyx_t_5, __pyx_t_12, __pyx_t_11}; - __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)); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_12, __pyx_t_11}; + __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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_7 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_5; + __pyx_t_5 = 0; } else { + + /* "constraint/parser.py":213 + * VariableMinSumConstraint(variables[-1], variables[:-1]) + * if variables_on_left + * else VariableMaxSumConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< + * ) # noqa: E501 + * elif variable_unique_operators[0] == "*": +*/ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 191, __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, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_11))) { @@ -8657,178 +8374,218 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_5}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_2}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__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_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_7 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __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" (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":208 + * 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":183 - * 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":194 + * ): # 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_L61; + goto __pyx_L29; } - /* "constraint/parser.py":192 - * # "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":215 + * 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_7 = __Pyx_GetItemInt_List(__pyx_v_variable_unique_operators, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_variable_unique_operators, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_mstate_global->__pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 192, __pyx_L1_error) + __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, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { - /* "constraint/parser.py":193 - * return VariableMinSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxSumConstraint(variables[0], variables[1:]) # noqa: E501 + /* "constraint/parser.py":216 + * ) # 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, 193, __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, 216, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":194 + /* "constraint/parser.py":217 * 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, 194, __pyx_L1_error) + + /* "constraint/parser.py":219 + * 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, 219, __pyx_L1_error) if (__pyx_t_1) { + + /* "constraint/parser.py":218 + * if comparator == "==": + * return ( + * VariableExactProdConstraint(variables[-1], variables[:-1]) # <<<<<<<<<<<<<< + * if variables_on_left + * else VariableExactProdConstraint(variables[0], variables[1:]) +*/ __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 194, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __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, 194, __pyx_L1_error) + __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, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); + 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_5); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_12, __pyx_t_8}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_7 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_5; + __pyx_t_5 = 0; } else { - __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 194, __pyx_L1_error) + + /* "constraint/parser.py":220 + * VariableExactProdConstraint(variables[-1], variables[:-1]) + * if variables_on_left + * else VariableExactProdConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< + * ) # noqa: E501 + * elif comparator == "<=": +*/ + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __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, 194, __pyx_L1_error) + __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, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __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); + __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_5); + __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[3] = {__pyx_t_5, __pyx_t_12, __pyx_t_11}; - __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)); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_12, __pyx_t_11}; + __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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_7 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_5; + __pyx_t_5 = 0; } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":193 - * return VariableMinSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxSumConstraint(variables[0], variables[1:]) # noqa: E501 + /* "constraint/parser.py":216 + * ) # 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":195 - * if comparator == "==": - * return VariableExactProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactProdConstraint(variables[0], variables[1:]) # noqa: E501 + /* "constraint/parser.py":222 + * 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, 195, __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, 222, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":197 + /* "constraint/parser.py":224 * 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, 197, __pyx_L1_error) + + /* "constraint/parser.py":226 + * 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, 226, __pyx_L1_error) if (__pyx_t_1) { + + /* "constraint/parser.py":225 + * # "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_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __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, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_11))) { @@ -8842,122 +8599,154 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_5}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_2}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__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_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_7 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_5; + __pyx_t_5 = 0; } else { + + /* "constraint/parser.py":227 + * VariableMaxProdConstraint(variables[-1], variables[:-1]) + * if variables_on_left + * else VariableMinProdConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< + * ) # noqa: E501 + * elif comparator == ">=": +*/ __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __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, 197, __pyx_L1_error) + __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, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); + 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_5); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_12, __pyx_t_8}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_7 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_5; + __pyx_t_5 = 0; } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":195 - * if comparator == "==": - * return VariableExactProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactProdConstraint(variables[0], variables[1:]) # noqa: E501 + /* "constraint/parser.py":222 + * 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":198 - * # "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":229 + * 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, 198, __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, 229, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":200 + /* "constraint/parser.py":231 * 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, 200, __pyx_L1_error) + + /* "constraint/parser.py":233 + * 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, 233, __pyx_L1_error) if (__pyx_t_1) { - __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 200, __pyx_L1_error) + + /* "constraint/parser.py":232 + * # "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_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __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, 200, __pyx_L1_error) + __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, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __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); + __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_5); + __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[3] = {__pyx_t_5, __pyx_t_12, __pyx_t_11}; - __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)); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_12, __pyx_t_11}; + __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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_7 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_5; + __pyx_t_5 = 0; } else { + + /* "constraint/parser.py":234 + * VariableMinProdConstraint(variables[-1], variables[:-1]) + * if variables_on_left + * else VariableMaxProdConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< + * ) # noqa: E501 + * +*/ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 200, __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, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_11))) { @@ -8971,51 +8760,51 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_5}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_2}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__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_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_7 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_5; + __pyx_t_5 = 0; } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":198 - * # "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":229 + * 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":192 - * # "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":215 + * 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_L61:; + __pyx_L29:; - /* "constraint/parser.py":181 + /* "constraint/parser.py":188 * 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":203 + /* "constraint/parser.py":238 * * # left_num and right_num can't both be constants, or for other reasons we can't use a VariableConstraint * return None # <<<<<<<<<<<<<< @@ -9026,16 +8815,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":166 * 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":207 + /* "constraint/parser.py":242 * # 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) # <<<<<<<<<<<<<< @@ -9049,48 +8838,48 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_11, 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_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_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_v_left_num); __Pyx_GIVEREF(__pyx_v_left_num); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_left_num) != (0)) __PYX_ERR(0, 207, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 207, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_left_num) != (0)) __PYX_ERR(0, 242, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 242, __pyx_L1_error); __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, Py_False) != (0)) __PYX_ERR(0, 207, __pyx_L1_error); - __pyx_t_2 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, Py_False) != (0)) __PYX_ERR(0, 242, __pyx_L1_error); + __pyx_t_5 = 0; __pyx_t_7 = __pyx_t_11; __pyx_t_11 = 0; } else { - __pyx_t_2 = __pyx_v_left; - __Pyx_INCREF(__pyx_t_2); + __pyx_t_5 = __pyx_v_left; + __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; + PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_11 = __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_11)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __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, 207, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_right_num) != (0)) __PYX_ERR(0, 242, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 207, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 242, __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, 207, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, Py_True) != (0)) __PYX_ERR(0, 242, __pyx_L1_error); __pyx_t_11 = 0; - __pyx_t_7 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_5; + __pyx_t_5 = 0; } if (likely(__pyx_t_7 != Py_None)) { PyObject* sequence = __pyx_t_7; @@ -9098,43 +8887,43 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 206, __pyx_L1_error) + __PYX_ERR(0, 241, __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_5 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_11); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); - __Pyx_INCREF(__pyx_t_5); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_2); #else - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 241, __pyx_L1_error) } - /* "constraint/parser.py":206 + /* "constraint/parser.py":241 * * # 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_number = __pyx_t_5; + __pyx_t_5 = 0; __pyx_v_variables = __pyx_t_11; __pyx_t_11 = 0; - __Pyx_XDECREF_SET(__pyx_v_variables_on_left, __pyx_t_5); - __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_variables_on_left, __pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/parser.py":211 + /* "constraint/parser.py":246 * * # we can map '>' to '>=' and '<' to '<=' by adding a tiny offset to the number * offset = 1e-12 # <<<<<<<<<<<<<< @@ -9143,52 +8932,52 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __pyx_v_offset = 1e-12; - /* "constraint/parser.py":212 + /* "constraint/parser.py":247 * # 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, 212, __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, 247, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":213 + /* "constraint/parser.py":248 * 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, 213, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 248, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":215 + /* "constraint/parser.py":250 * if variables_on_left: * # (x < 2) == (x <= 2-offset) * number -= offset # <<<<<<<<<<<<<< * else: * # (2 < x) == (2+offset <= x) */ - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 250, __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, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyNumber_InPlaceSubtract(__pyx_v_number, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_5); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/parser.py":213 + /* "constraint/parser.py":248 * offset = 1e-12 * if comparator == "<": * if variables_on_left: # <<<<<<<<<<<<<< * # (x < 2) == (x <= 2-offset) * number -= offset */ - goto __pyx_L67; + goto __pyx_L35; } - /* "constraint/parser.py":218 + /* "constraint/parser.py":253 * else: * # (2 < x) == (2+offset <= x) * number += offset # <<<<<<<<<<<<<< @@ -9196,72 +8985,72 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if variables_on_left: */ /*else*/ { - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __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, 218, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_number, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_7); __pyx_t_7 = 0; } - __pyx_L67:; + __pyx_L35:; - /* "constraint/parser.py":212 + /* "constraint/parser.py":247 * # 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_L66; + goto __pyx_L34; } - /* "constraint/parser.py":219 + /* "constraint/parser.py":254 * # (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, 219, __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, 254, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":220 + /* "constraint/parser.py":255 * 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, 220, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 255, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":222 + /* "constraint/parser.py":257 * if variables_on_left: * # (x > 2) == (x >= 2+offset) * number += offset # <<<<<<<<<<<<<< * else: * # (2 > x) == (2-offset >= x) */ - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 257, __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, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_number, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_5); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/parser.py":220 + /* "constraint/parser.py":255 * number += offset * elif comparator == ">": * if variables_on_left: # <<<<<<<<<<<<<< * # (x > 2) == (x >= 2+offset) * number += offset */ - goto __pyx_L68; + goto __pyx_L36; } - /* "constraint/parser.py":225 + /* "constraint/parser.py":260 * else: * # (2 > x) == (2-offset >= x) * number -= offset # <<<<<<<<<<<<<< @@ -9269,17 +9058,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_5 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __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, 225, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyNumber_InPlaceSubtract(__pyx_v_number, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_7); __pyx_t_7 = 0; } - __pyx_L68:; + __pyx_L36:; - /* "constraint/parser.py":219 + /* "constraint/parser.py":254 * # (2 < x) == (2+offset <= x) * number += offset * elif comparator == ">": # <<<<<<<<<<<<<< @@ -9287,80 +9076,80 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # (x > 2) == (x >= 2+offset) */ } - __pyx_L66:; + __pyx_L34:; - /* "constraint/parser.py":228 + /* "constraint/parser.py":263 * * # 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_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 263, __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, 263, __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_7, 0, __pyx_mstate_global->__pyx_kp_u__13) != (0)) __PYX_ERR(0, 228, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_kp_u__13) != (0)) __PYX_ERR(0, 263, __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_7, 1, __pyx_mstate_global->__pyx_kp_u__14) != (0)) __PYX_ERR(0, 228, __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_7, 2, __pyx_mstate_global->__pyx_kp_u__15) != (0)) __PYX_ERR(0, 228, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 2, __pyx_mstate_global->__pyx_kp_u__14) != (0)) __PYX_ERR(0, 263, __pyx_L1_error); __pyx_v_operators = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/parser.py":229 + /* "constraint/parser.py":264 * # 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_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_operators); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_11 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_operators); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 264, __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_5 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_5); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_11, __pyx_v_variables}; - __pyx_t_7 = __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_5); __pyx_t_5 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_11, __pyx_v_variables}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_5, __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_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_v_operators_found = __pyx_t_7; __pyx_t_7 = 0; - /* "constraint/parser.py":230 + /* "constraint/parser.py":265 * 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, 230, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_operators_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 265, __pyx_L1_error) __pyx_t_1 = (__pyx_t_3 == 0); if (__pyx_t_1) { - /* "constraint/parser.py":232 + /* "constraint/parser.py":267 * if len(operators_found) == 0: * # no operators found, return only based on comparator * if len(params) != 1 or variables not in params: # <<<<<<<<<<<<<< @@ -9369,20 +9158,20 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __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, 232, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_t_7); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 267, __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_L71_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, 232, __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, 267, __pyx_L1_error) __pyx_t_1 = __pyx_t_6; - __pyx_L71_bool_binop_done:; + __pyx_L39_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":234 + /* "constraint/parser.py":269 * if len(params) != 1 or variables not in params: * # there were more than one variable but no operator * return None # <<<<<<<<<<<<<< @@ -9393,7 +9182,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":232 + /* "constraint/parser.py":267 * if len(operators_found) == 0: * # no operators found, return only based on comparator * if len(params) != 1 or variables not in params: # <<<<<<<<<<<<<< @@ -9402,17 +9191,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":237 + /* "constraint/parser.py":272 * # 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, 237, __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, 272, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":238 + /* "constraint/parser.py":273 * # if there are restrictions with a single variable, it will be used to prune the domain at the start * elif comparator == "==": * return ExactSumConstraint(number) # <<<<<<<<<<<<<< @@ -9420,34 +9209,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_11, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __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); + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11); + assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__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}; + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_number}; __pyx_t_7 = __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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":237 + /* "constraint/parser.py":272 * # 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 == "==": # <<<<<<<<<<<<<< @@ -9456,25 +9245,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":239 + /* "constraint/parser.py":274 * 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, 239, __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, 274, __pyx_L1_error) if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L73_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, 239, __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, 274, __pyx_L1_error) __pyx_t_1 = __pyx_t_6; - __pyx_L73_bool_binop_done:; + __pyx_L41_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":240 + /* "constraint/parser.py":275 * return ExactSumConstraint(number) * elif comparator == "<=" or comparator == "<": * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< @@ -9482,36 +9271,10 @@ 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, 240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 275, __pyx_L1_error) if (__pyx_t_1) { - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 240, __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_2 = PyMethod_GET_SELF(__pyx_t_5); - assert(__pyx_t_2); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_5, __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_5, __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_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - } - __pyx_t_7 = __pyx_t_11; - __pyx_t_11 = 0; - } else { __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -9530,7 +9293,33 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 240, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + } + __pyx_t_7 = __pyx_t_11; + __pyx_t_11 = 0; + } else { + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 275, __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_2 = PyMethod_GET_SELF(__pyx_t_5); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __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_5, __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_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } __pyx_t_7 = __pyx_t_11; @@ -9540,7 +9329,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":239 + /* "constraint/parser.py":274 * elif comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or comparator == "<": # <<<<<<<<<<<<<< @@ -9549,25 +9338,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":241 + /* "constraint/parser.py":276 * 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, 241, __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, 276, __pyx_L1_error) if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L75_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, 241, __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, 276, __pyx_L1_error) __pyx_t_1 = __pyx_t_6; - __pyx_L75_bool_binop_done:; + __pyx_L43_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":242 + /* "constraint/parser.py":277 * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or comparator == ">": * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) # <<<<<<<<<<<<<< @@ -9575,37 +9364,11 @@ 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, 242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 277, __pyx_L1_error) if (__pyx_t_1) { - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 242, __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_2 = PyMethod_GET_SELF(__pyx_t_5); - assert(__pyx_t_2); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_5, __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_5, __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_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - } - __pyx_t_7 = __pyx_t_11; - __pyx_t_11 = 0; - } else { - __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { @@ -9623,7 +9386,33 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 242, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + } + __pyx_t_7 = __pyx_t_11; + __pyx_t_11 = 0; + } else { + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 277, __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_2 = PyMethod_GET_SELF(__pyx_t_5); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __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_5, __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_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } __pyx_t_7 = __pyx_t_11; @@ -9633,7 +9422,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":241 + /* "constraint/parser.py":276 * elif comparator == "<=" or comparator == "<": * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or comparator == ">": # <<<<<<<<<<<<<< @@ -9642,7 +9431,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":243 + /* "constraint/parser.py":278 * elif comparator == ">=" or comparator == ">": * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * raise ValueError(f"Invalid comparator {comparator}") # <<<<<<<<<<<<<< @@ -9651,27 +9440,27 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __pyx_t_11 = NULL; __Pyx_INCREF(__pyx_builtin_ValueError); - __pyx_t_2 = __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, 243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_comparator, __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_t_5 = __pyx_builtin_ValueError; + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_comparator, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_12}; - __pyx_t_7 = __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_7 = __Pyx_PyObject_FastCall(__pyx_t_5, __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_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 278, __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, 243, __pyx_L1_error) + __PYX_ERR(0, 278, __pyx_L1_error) - /* "constraint/parser.py":230 + /* "constraint/parser.py":265 * operators = [r"\*\*", r"\*", r"\+"] * operators_found = re.findall(str("|".join(operators)), variables) * if len(operators_found) == 0: # <<<<<<<<<<<<<< @@ -9680,37 +9469,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":246 + /* "constraint/parser.py":281 * * # 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_7 = __Pyx_GetItemInt(__pyx_v_operators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_operators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __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":247 + /* "constraint/parser.py":282 * # 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_7 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_23genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_operators_found); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 247, __pyx_L1_error) + __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, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 247, __pyx_L1_error) - __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, 282, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = (!__pyx_t_1); if (__pyx_t_6) { - /* "constraint/parser.py":249 + /* "constraint/parser.py":284 * 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 # <<<<<<<<<<<<<< @@ -9721,7 +9510,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":282 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< @@ -9730,7 +9519,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":252 + /* "constraint/parser.py":287 * * # split the string on the comparison * splitted = variables.split(operator) # <<<<<<<<<<<<<< @@ -9742,54 +9531,54 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_7, __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_t_5 = __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_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_v_splitted = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_splitted = __pyx_t_5; + __pyx_t_5 = 0; - /* "constraint/parser.py":254 + /* "constraint/parser.py":289 * 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, 254, __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, 254, __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, 289, __pyx_L1_error) + __pyx_t_5 = __pyx_cur_scope->__pyx_v_params; + __Pyx_INCREF(__pyx_t_5); + __pyx_t_13 = __Pyx_PyList_GET_SIZE(__pyx_t_5); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = (__pyx_t_3 == __pyx_t_13); if (__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L79_bool_binop_done; + goto __pyx_L47_bool_binop_done; } - __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_26genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_splitted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_24genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_splitted); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __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, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 254, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_6 = __pyx_t_1; - __pyx_L79_bool_binop_done:; + __pyx_L47_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":256 + /* "constraint/parser.py":291 * 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, 256, __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, 291, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":258 + /* "constraint/parser.py":293 * if operator == "**": * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None # <<<<<<<<<<<<<< @@ -9800,7 +9589,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":256 + /* "constraint/parser.py":291 * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): * # map to a Constraint * if operator == "**": # <<<<<<<<<<<<<< @@ -9809,27 +9598,27 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":259 + /* "constraint/parser.py":294 * # 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, 259, __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, 294, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":260 + /* "constraint/parser.py":295 * 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, 260, __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, 295, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":261 + /* "constraint/parser.py":296 * elif operator == "*": * if comparator == "==": * return ExactProdConstraint(number) # <<<<<<<<<<<<<< @@ -9837,34 +9626,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_12, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_12); - assert(__pyx_t_2); + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_12); + assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_number}; + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_number}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_12, __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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 261, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":260 + /* "constraint/parser.py":295 * return None * elif operator == "*": * if comparator == "==": # <<<<<<<<<<<<<< @@ -9873,25 +9662,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":262 + /* "constraint/parser.py":297 * 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, 262, __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, 297, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L83_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, 262, __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, 297, __pyx_L1_error) __pyx_t_6 = __pyx_t_1; - __pyx_L83_bool_binop_done:; + __pyx_L51_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":263 + /* "constraint/parser.py":298 * return ExactProdConstraint(number) * elif comparator == "<=" or comparator == "<": * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) # <<<<<<<<<<<<<< @@ -9899,55 +9688,55 @@ 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, 263, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 298, __pyx_L1_error) if (__pyx_t_6) { - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __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); + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11); + assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__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}; + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_number}; __pyx_t_12 = __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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 263, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); } __pyx_t_7 = __pyx_t_12; __pyx_t_12 = 0; } else { __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_11); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_number}; - __pyx_t_12 = __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_12 = __Pyx_PyObject_FastCall(__pyx_t_5, __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_12)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); } __pyx_t_7 = __pyx_t_12; @@ -9957,7 +9746,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":262 + /* "constraint/parser.py":297 * if comparator == "==": * return ExactProdConstraint(number) * elif comparator == "<=" or comparator == "<": # <<<<<<<<<<<<<< @@ -9966,25 +9755,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":264 + /* "constraint/parser.py":299 * 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, 264, __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, 299, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L85_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, 264, __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, 299, __pyx_L1_error) __pyx_t_6 = __pyx_t_1; - __pyx_L85_bool_binop_done:; + __pyx_L53_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":265 + /* "constraint/parser.py":300 * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or comparator == ">": * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) # <<<<<<<<<<<<<< @@ -9992,55 +9781,55 @@ 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, 265, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 300, __pyx_L1_error) if (__pyx_t_6) { - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __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); + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11); + assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__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}; + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_number}; __pyx_t_12 = __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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 265, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); } __pyx_t_7 = __pyx_t_12; __pyx_t_12 = 0; } else { __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_11); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_number}; - __pyx_t_12 = __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_12 = __Pyx_PyObject_FastCall(__pyx_t_5, __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_12)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); } __pyx_t_7 = __pyx_t_12; @@ -10050,7 +9839,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":264 + /* "constraint/parser.py":299 * elif comparator == "<=" or comparator == "<": * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or comparator == ">": # <<<<<<<<<<<<<< @@ -10059,37 +9848,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":259 + /* "constraint/parser.py":294 * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None * elif operator == "*": # <<<<<<<<<<<<<< * if comparator == "==": * return ExactProdConstraint(number) */ - goto __pyx_L81; + goto __pyx_L49; } - /* "constraint/parser.py":266 + /* "constraint/parser.py":301 * 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, 266, __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, 301, __pyx_L1_error) if (likely(__pyx_t_6)) { - /* "constraint/parser.py":267 + /* "constraint/parser.py":302 * 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, 267, __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, 302, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":268 + /* "constraint/parser.py":303 * elif operator == "+": * if comparator == "==": * return ExactSumConstraint(number) # <<<<<<<<<<<<<< @@ -10098,33 +9887,33 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __Pyx_XDECREF(__pyx_r); __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_12); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_number}; - __pyx_t_7 = __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_7 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":267 + /* "constraint/parser.py":302 * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": * if comparator == "==": # <<<<<<<<<<<<<< @@ -10133,25 +9922,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":269 + /* "constraint/parser.py":304 * 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, 269, __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, 304, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L88_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, 269, __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, 304, __pyx_L1_error) __pyx_t_6 = __pyx_t_1; - __pyx_L88_bool_binop_done:; + __pyx_L56_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":271 + /* "constraint/parser.py":306 * elif comparator == "<=" or comparator == "<": * # raise ValueError(restriction, comparator) * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< @@ -10159,10 +9948,10 @@ 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, 271, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 306, __pyx_L1_error) if (__pyx_t_6) { __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -10178,17 +9967,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, __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_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_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_7 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_5; + __pyx_t_5 = 0; } else { __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -10204,20 +9993,20 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_number}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_12, __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_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_7 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_5; + __pyx_t_5 = 0; } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":269 + /* "constraint/parser.py":304 * if comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or comparator == "<": # <<<<<<<<<<<<<< @@ -10226,25 +10015,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":272 + /* "constraint/parser.py":307 * # 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, 272, __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, 307, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L90_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, 272, __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, 307, __pyx_L1_error) __pyx_t_6 = __pyx_t_1; - __pyx_L90_bool_binop_done:; + __pyx_L58_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":273 + /* "constraint/parser.py":308 * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or comparator == ">": * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) # <<<<<<<<<<<<<< @@ -10252,10 +10041,10 @@ 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, 273, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 308, __pyx_L1_error) if (__pyx_t_6) { __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -10271,17 +10060,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, __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_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_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_7 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_5; + __pyx_t_5 = 0; } else { __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -10297,20 +10086,20 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_number}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_12, __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_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_7 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_5; + __pyx_t_5 = 0; } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":272 + /* "constraint/parser.py":307 * # raise ValueError(restriction, comparator) * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or comparator == ">": # <<<<<<<<<<<<<< @@ -10319,17 +10108,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":266 + /* "constraint/parser.py":301 * elif comparator == ">=" or comparator == ">": * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": # <<<<<<<<<<<<<< * if comparator == "==": * return ExactSumConstraint(number) */ - goto __pyx_L81; + goto __pyx_L49; } - /* "constraint/parser.py":275 + /* "constraint/parser.py":310 * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * else: * raise ValueError(f"Invalid operator {operator}") # <<<<<<<<<<<<<< @@ -10337,31 +10126,31 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * */ /*else*/ { - __pyx_t_2 = NULL; + __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_builtin_ValueError); __pyx_t_12 = __pyx_builtin_ValueError; - __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_operator, __pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_operator, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_9 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5}; + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_12, __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_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__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_7)) __PYX_ERR(0, 275, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 310, __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, 275, __pyx_L1_error) + __PYX_ERR(0, 310, __pyx_L1_error) } - __pyx_L81:; + __pyx_L49:; - /* "constraint/parser.py":254 + /* "constraint/parser.py":289 * 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): # <<<<<<<<<<<<<< @@ -10370,7 +10159,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":276 + /* "constraint/parser.py":311 * else: * raise ValueError(f"Invalid operator {operator}") * return None # <<<<<<<<<<<<<< @@ -10381,12 +10170,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]) -> Optional[ # <<<<<<<<<<<<<< + * Union[ + * MinSumConstraint, */ /* function exit code */ @@ -10405,7 +10194,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); @@ -10417,7 +10205,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); @@ -10428,19 +10215,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_28generator9); + __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); @@ -10448,7 +10231,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ return __pyx_r; } -/* "constraint/parser.py":278 +/* "constraint/parser.py":313 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< @@ -10497,39 +10280,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, 278, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 313, __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, 278, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 313, __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, 278, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 313, __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, 278, __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, 313, __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, 278, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_equality_constraint", 1, 2, 2, i); __PYX_ERR(0, 313, __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, 278, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 313, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 278, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 313, __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, 278, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("to_equality_constraint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 313, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10540,8 +10323,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, 279, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 279, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restriction), (&PyUnicode_Type), 0, "restriction", 2))) __PYX_ERR(0, 314, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 314, __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 */ @@ -10562,7 +10345,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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":297 +/* "constraint/parser.py":332 * 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): # <<<<<<<<<<<<<< @@ -10582,7 +10365,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_22to_equalit if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 297, __pyx_L1_error) + __PYX_ERR(0, 332, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10593,7 +10376,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_22to_equalit __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_2generator10, ((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_to_equ, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 297, __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, 332, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -10632,21 +10415,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, 297, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 297, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 332, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 332, __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, 297, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 332, __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, 297, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __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); @@ -10659,11 +10442,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit 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_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __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, 297, __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, 297, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 332, __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, 332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { @@ -10704,7 +10487,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit return __pyx_r; } -/* "constraint/parser.py":278 +/* "constraint/parser.py":313 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< @@ -10739,7 +10522,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 278, __pyx_L1_error) + __PYX_ERR(0, 313, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10750,7 +10533,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":283 + /* "constraint/parser.py":318 * """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): # <<<<<<<<<<<<<< @@ -10759,21 +10542,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, 283, __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, 318, __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, 283, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 318, __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, 283, __pyx_L1_error) + __PYX_ERR(0, 318, __pyx_L1_error) } - __pyx_t_3 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_3 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 318, __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":284 + /* "constraint/parser.py":319 * # check if all parameters are involved * if len(params) != len(tune_params): * return None # <<<<<<<<<<<<<< @@ -10784,7 +10567,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":283 + /* "constraint/parser.py":318 * """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): # <<<<<<<<<<<<<< @@ -10793,7 +10576,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":287 + /* "constraint/parser.py":322 * * # find whether (in)equalities appear in this restriction * equalities_found = re.findall("==", restriction) # <<<<<<<<<<<<<< @@ -10801,9 +10584,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, 287, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 322, __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, 287, __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, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = 1; @@ -10823,13 +10606,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 287, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_equalities_found = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":288 + /* "constraint/parser.py":323 * # find whether (in)equalities appear in this restriction * equalities_found = re.findall("==", restriction) * inequalities_found = re.findall("!=", restriction) # <<<<<<<<<<<<<< @@ -10837,9 +10620,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, 288, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 323, __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, 288, __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, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = 1; @@ -10859,37 +10642,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 288, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_inequalities_found = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":290 + /* "constraint/parser.py":325 * 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, 290, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 325, __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, 290, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_4))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __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, 290, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_inequalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 325, __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, 290, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBool_FromLong((!(!__pyx_t_4))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __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, 290, __pyx_L1_error) + __pyx_t_7 = PyNumber_Xor(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __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, 290, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 325, __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":291 + /* "constraint/parser.py":326 * # 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 # <<<<<<<<<<<<<< @@ -10900,7 +10683,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":290 + /* "constraint/parser.py":325 * 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)): # <<<<<<<<<<<<<< @@ -10909,22 +10692,22 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":292 + /* "constraint/parser.py":327 * 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, 292, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 327, __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, 292, __pyx_L1_error) + __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, 327, __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, 292, __pyx_L1_error) + __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, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __pyx_t_6; __pyx_t_6 = 0; @@ -10932,29 +10715,29 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __pyx_v_comparator = __pyx_t_7; __pyx_t_7 = 0; - /* "constraint/parser.py":295 + /* "constraint/parser.py":330 * * # 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, 295, __pyx_L1_error) + __pyx_t_7 = PyUnicode_Split(__pyx_v_restriction, __Pyx_NoneAsNull(__pyx_v_comparator), -1L); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_splitted = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/parser.py":297 + /* "constraint/parser.py":332 * 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, 297, __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, 332, __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, 297, __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, 332, __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) { @@ -10962,28 +10745,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, 297, __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, 332, __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, 297, __pyx_L1_error) + __pyx_t_6 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __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, 297, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 332, __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":299 + /* "constraint/parser.py":334 * 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, 299, __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, 334, __pyx_L1_error) if (__pyx_t_9) { - /* "constraint/parser.py":300 + /* "constraint/parser.py":335 * # map to a Constraint * if comparator == "==": * return AllEqualConstraint() # <<<<<<<<<<<<<< @@ -10992,7 +10775,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, 300, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS @@ -11011,14 +10794,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 300, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/parser.py":299 + /* "constraint/parser.py":334 * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): * # map to a Constraint * if comparator == "==": # <<<<<<<<<<<<<< @@ -11027,17 +10810,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":301 + /* "constraint/parser.py":336 * 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, 301, __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, 336, __pyx_L1_error) if (__pyx_t_9) { - /* "constraint/parser.py":302 + /* "constraint/parser.py":337 * return AllEqualConstraint() * elif comparator == "!=": * return AllDifferentConstraint() # <<<<<<<<<<<<<< @@ -11046,7 +10829,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, 302, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS @@ -11065,14 +10848,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_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, 302, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/parser.py":301 + /* "constraint/parser.py":336 * if comparator == "==": * return AllEqualConstraint() * elif comparator == "!=": # <<<<<<<<<<<<<< @@ -11081,7 +10864,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":303 + /* "constraint/parser.py":338 * elif comparator == "!=": * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") # <<<<<<<<<<<<<< @@ -11092,9 +10875,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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, 303, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 338, __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, 303, __pyx_L1_error) + __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, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = 1; @@ -11104,14 +10887,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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, 303, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/parser.py":297 + /* "constraint/parser.py":332 * 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): # <<<<<<<<<<<<<< @@ -11120,7 +10903,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":304 + /* "constraint/parser.py":339 * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") * return None # <<<<<<<<<<<<<< @@ -11131,7 +10914,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":278 + /* "constraint/parser.py":313 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< @@ -11161,12 +10944,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality } 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":307 +/* "constraint/parser.py":342 * * # 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) { @@ -11181,7 +10964,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(CY if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 307, __pyx_L1_error) + __PYX_ERR(0, 342, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -11189,7 +10972,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_12generator11, ((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_parse_restrictions_locals_genexp, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 307, __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, 342, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -11226,21 +11009,21 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator1 return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 307, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 307, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 342, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 342, __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, 307, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 342, __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, 307, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __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); @@ -11285,11 +11068,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 + * """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 */ @@ -11309,9 +11092,9 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED PyObject *__pyx_v_params_used_list = NULL; PyObject *__pyx_v_finalized_constraint = NULL; PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator11 = 0; - PyObject *__pyx_9genexpr17__pyx_v_r = NULL; - PyObject *__pyx_9genexpr18__pyx_v_r = NULL; - PyObject *__pyx_9genexpr19__pyx_v_i = NULL; + 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; @@ -11335,7 +11118,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); } @@ -11344,8 +11127,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]*)" @@ -11355,7 +11138,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]*)" # <<<<<<<<<<<<<< @@ -11366,111 +11149,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[13])); 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[14])); 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[15])); 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]) -> Optional[ # <<<<<<<<<<<<<< + * Union[ + * MinSumConstraint, */ - __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[16])); 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_Optional_Union_MinSumConstraint) < 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":278 + /* "constraint/parser.py":313 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __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, 278, __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, 278, __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, 278, __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[17])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __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, 313, __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, 313, __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, 313, __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, 313, __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":307 + /* "constraint/parser.py":342 * * # 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, 307, __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, 342, __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, 307, __pyx_L1_error) + __pyx_t_1 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __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, 307, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "constraint/parser.py":309 + /* "constraint/parser.py":344 * 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, 309, __pyx_L6_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_v_restrictions; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; @@ -11478,39 +11261,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, 309, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 344, __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_4; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L6_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 344, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_XDECREF_SET(__pyx_9genexpr17__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_9genexpr17__pyx_v_r, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __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, 344, __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, 309, __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, 344, __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, 309, __pyx_L6_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 344, __pyx_L6_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_r); __pyx_9genexpr17__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_9genexpr17__pyx_v_r); __pyx_9genexpr17__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":310 + /* "constraint/parser.py":345 * # 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] */ @@ -11521,24 +11304,24 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED 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_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __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, 310, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __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":312 - * restrictions_cleaned_unique = list(dict.fromkeys(restrictions_cleaned)) # dict preserves order + /* "constraint/parser.py":347 + * 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, 312, __pyx_L13_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __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; @@ -11546,33 +11329,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, 312, __pyx_L13_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 347, __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_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L13_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 347, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr18__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_9genexpr18__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __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, 347, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 312, __pyx_L13_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 347, __pyx_L13_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_r); __pyx_9genexpr18__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_9genexpr18__pyx_v_r); __pyx_9genexpr18__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":313 + /* "constraint/parser.py":348 * # 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] # <<<<<<<<<<<<<< @@ -11580,7 +11363,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, 313, __pyx_L20_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __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; @@ -11588,67 +11371,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, 313, __pyx_L20_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 348, __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_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L20_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr19__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_9genexpr19__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __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, 348, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 313, __pyx_L20_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 348, __pyx_L20_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_i); __pyx_9genexpr19__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_9genexpr19__pyx_v_i); __pyx_9genexpr19__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":307 + /* "constraint/parser.py":342 * * # 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":316 + /* "constraint/parser.py":351 * * # 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, 316, __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, 351, __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, 316, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_restrictions, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "constraint/parser.py":318 + /* "constraint/parser.py":353 * 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, 318, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_parsed_restrictions = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":319 + /* "constraint/parser.py":354 * # split into functions that only take their relevant parameters * parsed_restrictions = list() * for res in restrictions: # <<<<<<<<<<<<<< @@ -11657,7 +11440,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, 319, __pyx_L1_error) + __PYX_ERR(0, 354, __pyx_L1_error) } __pyx_t_2 = __pyx_v_restrictions; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; @@ -11665,32 +11448,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, 319, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 354, __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_4; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":320 + /* "constraint/parser.py":355 * 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, 320, __pyx_L1_error) + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __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":321 + /* "constraint/parser.py":356 * for res in restrictions: * params_used: set[str] = set() * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() # <<<<<<<<<<<<<< @@ -11698,9 +11481,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, 321, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 356, __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, 321, __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, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_7 = 1; @@ -11720,7 +11503,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __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_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, 321, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __pyx_t_5; @@ -11731,25 +11514,25 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __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_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, 321, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __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":322 + /* "constraint/parser.py":357 * 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, 322, __pyx_L1_error) + __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_v_params_used); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __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":323 + /* "constraint/parser.py":358 * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() * params_used_list = list(params_used) * finalized_constraint = None # <<<<<<<<<<<<<< @@ -11759,25 +11542,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":324 + /* "constraint/parser.py":359 * 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, 324, __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, 359, __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, 324, __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, 359, __pyx_L1_error) __pyx_t_3 = __pyx_t_11; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - /* "constraint/parser.py":326 + /* "constraint/parser.py":361 * if " or " not in res and " and " not in res: * # if applicable, strip the outermost round brackets * while ( # <<<<<<<<<<<<<< @@ -11786,16 +11569,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ while (1) { - /* "constraint/parser.py":327 + /* "constraint/parser.py":362 * # 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, 327, __pyx_L1_error) + __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, 362, __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, 327, __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, 362, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { } else { @@ -11803,16 +11586,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":328 + /* "constraint/parser.py":363 * 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, 328, __pyx_L1_error) + __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, 363, __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, 328, __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, 363, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { } else { @@ -11820,16 +11603,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":329 + /* "constraint/parser.py":364 * 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, 329, __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, 364, __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, 329, __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, 364, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { } else { @@ -11837,48 +11620,48 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":330 + /* "constraint/parser.py":365 * 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, 330, __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, 365, __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, 330, __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, 365, __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":332 + /* "constraint/parser.py":367 * 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, 332, __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, 367, __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":334 + /* "constraint/parser.py":369 * 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, 334, __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, 334, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_parsed_restriction))||((__pyx_v_parsed_restriction) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_parsed_restriction))) __PYX_ERR(0, 369, __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, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":335 + /* "constraint/parser.py":370 * # 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: # <<<<<<<<<<<<<< @@ -11888,20 +11671,20 @@ 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":337 + /* "constraint/parser.py":372 * 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, 337, __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, 337, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_parsed_restriction))||((__pyx_v_parsed_restriction) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_parsed_restriction))) __PYX_ERR(0, 372, __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, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":335 + /* "constraint/parser.py":370 * # 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: # <<<<<<<<<<<<<< @@ -11910,7 +11693,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":324 + /* "constraint/parser.py":359 * params_used_list = list(params_used) * finalized_constraint = None * if " or " not in res and " and " not in res: # <<<<<<<<<<<<<< @@ -11919,7 +11702,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":338 + /* "constraint/parser.py":373 * # 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: # <<<<<<<<<<<<<< @@ -11929,16 +11712,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":340 + /* "constraint/parser.py":375 * 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, 340, __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, 375, __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, 340, __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, 375, __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; @@ -11946,14 +11729,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, 340, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __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":338 + /* "constraint/parser.py":373 * # 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: # <<<<<<<<<<<<<< @@ -11962,25 +11745,25 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":341 + /* "constraint/parser.py":376 * # 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, 341, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __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, 341, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_finalized_constraint) != (0)) __PYX_ERR(0, 376, __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, 341, __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, 341, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_params_used_list) != (0)) __PYX_ERR(0, 376, __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, 376, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/parser.py":319 + /* "constraint/parser.py":354 * # split into functions that only take their relevant parameters * parsed_restrictions = list() * for res in restrictions: # <<<<<<<<<<<<<< @@ -11990,23 +11773,23 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":343 + /* "constraint/parser.py":378 * 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 + * """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 */ @@ -12036,9 +11819,9 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __Pyx_XDECREF(__pyx_v_params_used_list); __Pyx_XDECREF(__pyx_v_finalized_constraint); __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_12generator11); - __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_r); - __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_r); - __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_i); + __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); @@ -12046,12 +11829,12 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED return __pyx_r; } -/* "constraint/parser.py":345 - * return parsed_restrictions +/* "constraint/parser.py":381 * - * 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], Union[str, None]]]: # noqa: E501 */ /* Python wrapper */ @@ -12096,41 +11879,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, 345, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 381, __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, 345, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 381, __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, 345, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 381, __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, 345, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 381, __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, 345, __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, 381, __pyx_L3_error) + + /* "constraint/parser.py":382 + * + * 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. +*/ 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, 345, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("compile_to_constraints", 0, 2, 3, i); __PYX_ERR(0, 381, __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, 345, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 381, __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, 345, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 381, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 345, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 381, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -12142,7 +11933,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, 345, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compile_to_constraints", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 381, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -12153,10 +11944,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, 345, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 345, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 382, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 382, __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":381 + * + * + * def compile_to_constraints( # <<<<<<<<<<<<<< + * constraints: list[str], domains: dict, picklable=False + * ) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 +*/ + /* function exit code */ goto __pyx_L0; __pyx_L1_error:; @@ -12203,15 +12002,15 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compile_to_constraints", 0); - /* "constraint/parser.py":356 + /* "constraint/parser.py":394 * 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() * 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, 356, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_parse_restrictions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -12230,25 +12029,25 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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_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, 356, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_parsed_restrictions = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":357 - * """ # noqa: E501 + /* "constraint/parser.py":395 + * """ # noqa: E501 * parsed_restrictions = parse_restrictions(constraints, domains) * compiled_constraints: list[tuple[Constraint, list[str], Union[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, 357, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_compiled_constraints = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":358 + /* "constraint/parser.py":396 * parsed_restrictions = parse_restrictions(constraints, domains) * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: # <<<<<<<<<<<<<< @@ -12260,9 +12059,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, 358, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parsed_restrictions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 396, __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, 358, __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, 396, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { @@ -12270,7 +12069,7 @@ 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, 358, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 396, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -12280,7 +12079,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN { 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, 358, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 396, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -12291,13 +12090,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __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, 358, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 396, __pyx_L1_error) PyErr_Clear(); } break; @@ -12310,7 +12109,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, 358, __pyx_L1_error) + __PYX_ERR(0, 396, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -12320,22 +12119,22 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __Pyx_INCREF(__pyx_t_7); } else { __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 396, __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, 358, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 396, __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, 358, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 396, __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); @@ -12343,7 +12142,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, 358, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 396, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -12351,7 +12150,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, 358, __pyx_L1_error) + __PYX_ERR(0, 396, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_restriction, __pyx_t_2); @@ -12359,7 +12158,7 @@ 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":359 + /* "constraint/parser.py":397 * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: * if isinstance(restriction, str): # <<<<<<<<<<<<<< @@ -12369,17 +12168,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":361 + /* "constraint/parser.py":399 * 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, 361, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_picklable); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 399, __pyx_L1_error) if (__pyx_t_10) { - /* "constraint/parser.py":362 + /* "constraint/parser.py":400 * # if it's a string, wrap it in a (compilable or compiled) function constraint * if picklable: * constraint = CompilableFunctionConstraint(restriction) # <<<<<<<<<<<<<< @@ -12387,7 +12186,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, 362, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -12406,13 +12205,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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_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, 362, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":361 + /* "constraint/parser.py":399 * if isinstance(restriction, str): * # if it's a string, wrap it in a (compilable or compiled) function constraint * if picklable: # <<<<<<<<<<<<<< @@ -12422,7 +12221,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L8; } - /* "constraint/parser.py":364 + /* "constraint/parser.py":402 * constraint = CompilableFunctionConstraint(restriction) * else: * code_object = compile(restriction, "", "exec") # <<<<<<<<<<<<<< @@ -12439,13 +12238,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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_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, 364, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __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":365 + /* "constraint/parser.py":403 * else: * code_object = compile(restriction, "", "exec") * func = FunctionType(code_object.co_consts[0], globals()) # <<<<<<<<<<<<<< @@ -12453,14 +12252,14 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * 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, 365, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 403, __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, 365, __pyx_L1_error) + __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, 403, __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, 365, __pyx_L1_error) + __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, 403, __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, 365, __pyx_L1_error) + __pyx_t_8 = __Pyx_Globals(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -12481,13 +12280,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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, 365, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":366 + /* "constraint/parser.py":404 * code_object = compile(restriction, "", "exec") * func = FunctionType(code_object.co_consts[0], globals()) * constraint = FunctionConstraint(func) # <<<<<<<<<<<<<< @@ -12495,7 +12294,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * 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, 366, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -12514,7 +12313,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_3); @@ -12522,28 +12321,28 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN } __pyx_L8:; - /* "constraint/parser.py":367 + /* "constraint/parser.py":405 * 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, 367, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __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, 367, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 405, __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, 367, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_params_used) != (0)) __PYX_ERR(0, 405, __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, 367, __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, 367, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_restriction) != (0)) __PYX_ERR(0, 405, __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, 405, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":359 + /* "constraint/parser.py":397 * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: * if isinstance(restriction, str): # <<<<<<<<<<<<<< @@ -12553,41 +12352,41 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L7; } - /* "constraint/parser.py":368 + /* "constraint/parser.py":406 * 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, 368, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __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, 368, __pyx_L1_error) + __pyx_t_10 = PyObject_IsInstance(__pyx_v_restriction, __pyx_t_3); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(__pyx_t_10)) { - /* "constraint/parser.py":370 + /* "constraint/parser.py":408 * 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, 370, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 408, __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, 370, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_restriction) != (0)) __PYX_ERR(0, 408, __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, 370, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_params_used) != (0)) __PYX_ERR(0, 408, __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, 370, __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, 370, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None) != (0)) __PYX_ERR(0, 408, __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, 408, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":368 + /* "constraint/parser.py":406 * constraint = FunctionConstraint(func) * compiled_constraints.append((constraint, params_used, restriction)) * elif isinstance(restriction, Constraint): # <<<<<<<<<<<<<< @@ -12597,7 +12396,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L7; } - /* "constraint/parser.py":372 + /* "constraint/parser.py":410 * compiled_constraints.append((restriction, params_used, None)) * else: * raise ValueError(f"Restriction {restriction} is neither a string or Constraint {type(restriction)}") # <<<<<<<<<<<<<< @@ -12608,16 +12407,16 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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, 372, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_restriction, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 410, __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, 372, __pyx_L1_error) + __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, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_Restriction; __pyx_t_13[1] = __pyx_t_11; __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, 372, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -12628,16 +12427,16 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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, 372, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __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, 372, __pyx_L1_error) + __PYX_ERR(0, 410, __pyx_L1_error) } __pyx_L7:; - /* "constraint/parser.py":358 + /* "constraint/parser.py":396 * parsed_restrictions = parse_restrictions(constraints, domains) * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: # <<<<<<<<<<<<<< @@ -12647,22 +12446,24 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":375 + /* "constraint/parser.py":413 * * # 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":345 - * return parsed_restrictions + /* "constraint/parser.py":381 * - * 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], Union[str, None]]]: # noqa: E501 */ /* function exit code */ @@ -12688,54 +12489,660 @@ 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":419 + * + * + * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< + * """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 - { + 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, 419, __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, 419, __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, 419, __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, 419, __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, 419, __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, 419, __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.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, 419, __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]); + } + 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_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; + 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":421 + * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: + * """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":423 + * 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, 423, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 423, __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, 423, __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, 423, __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, 423, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_4); + } + __pyx_v_number = __pyx_t_4; + __pyx_t_4 = 0; + + /* "constraint/parser.py":424 + * # 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, 424, __pyx_L3_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 424, __pyx_L3_error) + #endif + + /* "constraint/parser.py":425 + * 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":421 + * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: + * """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; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "constraint/parser.py":426 + * 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":428 + * 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":421 + * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: + * """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":419 + * + * + * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< + * """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_XDECREF(__pyx_t_8); + __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":431 + * + * + * 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 + #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, 431, __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, 431, __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, 431, __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, 431, __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, 431, __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, 431, __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, 431, __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":437 + * + * # 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, 437, __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, -1L); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __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":440 + * + * # 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":445 + * [+\*[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, 445, __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, 445, __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, 445, __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, 445, __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(__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, 445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_v_matches = __pyx_t_2; + __pyx_t_2 = 0; + + /* "constraint/parser.py":446 + * """ + * 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, 446, __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, 446, __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, 446, __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, 446, __pyx_L5_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_7); + ++__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, 446, __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, 446, __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, 446, __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(__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, 446, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_5); + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 446, __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":431 + * + * + * 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_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; +} + +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; + } + } + #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 + #endif + { + #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); } @@ -15245,15 +15652,15 @@ 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_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)) { @@ -15261,15 +15668,15 @@ 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_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)) { @@ -15277,15 +15684,15 @@ 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) + __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, 99, __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, 99, __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, 99, __pyx_L1_error) #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)) { @@ -15293,15 +15700,15 @@ 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) + __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, 99, __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, 99, __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, 99, __pyx_L1_error) #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)) { @@ -15309,15 +15716,15 @@ 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) + __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, 110, __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, 110, __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, 110, __pyx_L1_error) #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)) { @@ -15325,15 +15732,15 @@ 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) + __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, 155, __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, 155, __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, 155, __pyx_L1_error) #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)) { @@ -15341,15 +15748,15 @@ 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, 170, __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, 170, __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, 175, __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, 175, __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, 170, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 175, __pyx_L1_error) #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)) { @@ -15357,15 +15764,15 @@ 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, 177, __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, 177, __pyx_L1_error) + __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, 184, __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, 184, __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, 177, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 184, __pyx_L1_error) #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)) { @@ -15373,15 +15780,15 @@ 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, 178, __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, 178, __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, 185, __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, 185, __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, 178, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(0, 185, __pyx_L1_error) #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)) { @@ -15389,15 +15796,15 @@ 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, 181, __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, 181, __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, 190, __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, 190, __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, 181, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr) < 0) __PYX_ERR(0, 190, __pyx_L1_error) #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)) { @@ -15405,15 +15812,15 @@ 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, 247, __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, 247, __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, 282, __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, 282, __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, 247, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr) < 0) __PYX_ERR(0, 282, __pyx_L1_error) #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)) { @@ -15421,15 +15828,15 @@ 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_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, 254, __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, 254, __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, 289, __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, 289, __pyx_L1_error) #else __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_genexpr) < 0) __PYX_ERR(0, 254, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr) < 0) __PYX_ERR(0, 289, __pyx_L1_error) #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_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -15437,15 +15844,15 @@ 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_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, 278, __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, 278, __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, 313, __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, 313, __pyx_L1_error) #else __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_to_equality_constraint) < 0) __PYX_ERR(0, 278, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint) < 0) __PYX_ERR(0, 313, __pyx_L1_error) #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_to_equality_constraint->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint->tp_getattro == PyObject_GenericGetAttr)) { @@ -15453,15 +15860,15 @@ 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_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, 297, __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, 297, __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, 332, __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, 332, __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, 297, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr) < 0) __PYX_ERR(0, 332, __pyx_L1_error) #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)) { @@ -15469,15 +15876,15 @@ 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_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, 307, __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, 307, __pyx_L1_error) + __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, 342, __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, 342, __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, 307, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_14_genexpr) < 0) __PYX_ERR(0, 342, __pyx_L1_error) #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)) { @@ -15801,190 +16208,227 @@ __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_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_re, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __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) + 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; - /* "constraint/parser.py":3 - * """Module containing the code for parsing string constraints.""" + /* "constraint/parser.py":4 + * * 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_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, 3, __pyx_L1_error) + __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, 3, __pyx_L1_error) + __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) __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_FunctionType, __pyx_t_2) < 0) __PYX_ERR(0, 4, __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 + /* "constraint/parser.py":5 * import re * from types import FunctionType * from typing import Union, Optional # <<<<<<<<<<<<<< * 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_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, 5, __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) + __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_typing, __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_Union); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Union); 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_Union, __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_Union, __pyx_t_3) < 0) __PYX_ERR(0, 5, __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_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Optional); 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_Optional, __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_Optional, __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/parser.py":6 + /* "constraint/parser.py":7 * 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_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, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "constraint/parser.py":5 + /* "constraint/parser.py":6 * 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_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_AllDifferentConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint); 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_AllDifferentConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, __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_AllEqualConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint); 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_AllEqualConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint, __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_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __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, 8, __pyx_L1_error) + 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_ExactSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); 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_ExactSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, __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_MinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); 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_MinSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __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_MaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); 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_MaxSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __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_ExactProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint); 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_ExactProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint, __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_MinProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); 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_MinProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __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_MaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); 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_MaxProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __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_FunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __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, 15, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __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_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __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) __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) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __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_VariableExactSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); 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_VariableExactSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint, __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_VariableMinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); 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_VariableMinSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint, __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_VariableMaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); 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_VariableMaxSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 20, __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) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint); 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_VariableExactProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 21, __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_VariableMinProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint); 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_VariableMinProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 22, __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_VariableMaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint); 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_VariableMaxProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint, __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; - /* "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 + * """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_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __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[18])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) + 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, 32, __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, 32, __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, 32, __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, 32, __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_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_parse_restrictions, __pyx_t_2) < 0) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":345 - * return parsed_restrictions + /* "constraint/parser.py":381 * - * 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], Union[str, None]]]: # noqa: E501 */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __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, 345, __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, 345, __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, 345, __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[19])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error) + 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, 381, __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, 381, __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, 381, __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, 381, __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); __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, 345, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_compile_to_constraints, __pyx_t_3) < 0) __PYX_ERR(0, 381, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/parser.py":419 + * + * + * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< + * """Check if the string is a number or can be evaluated to a number.""" + * try: +*/ + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_s, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 419, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_Union_int_float) < 0) __PYX_ERR(0, 419, __pyx_L1_error) + __pyx_t_2 = __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_2)) __PYX_ERR(0, 419, __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_is_or_evals_to_number, __pyx_t_2) < 0) __PYX_ERR(0, 419, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/parser.py":431 + * + * + * def extract_operators(expr: str) -> list[str]: # <<<<<<<<<<<<<< + * """Extracts all operators from an expression string.""" + * # Regex for all supported binary operators: +*/ + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_expr, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 431, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_str) < 0) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_3 = __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_3)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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_extract_operators, __pyx_t_3) < 0) __PYX_ERR(0, 431, __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); @@ -16074,6 +16518,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_VERBOSE, sizeof(__pyx_k_VERBOSE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VERBOSE */ {__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 */ @@ -16137,6 +16582,8 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_expr, sizeof(__pyx_k_expr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_expr */ + {__pyx_k_extract_operators, sizeof(__pyx_k_extract_operators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_extract_operators */ {__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 */ @@ -16165,7 +16612,9 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_but_not_w_d_binary_preced, sizeof(__pyx_k_match_but_not_w_d_binary_preced), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_match_but_not_w_d_binary_preced */ {__pyx_k_match_object, sizeof(__pyx_k_match_object), 0, 1, 1}, /* PyObject cname: __pyx_n_u_match_object */ + {__pyx_k_matches, sizeof(__pyx_k_matches), 0, 1, 1}, /* PyObject cname: __pyx_n_u_matches */ {__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 */ @@ -16196,9 +16645,9 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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_pattern, sizeof(__pyx_k_pattern), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pattern */ {__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 */ @@ -16236,7 +16685,6 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__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 */ @@ -16269,11 +16717,11 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, c 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, 171, __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, 364, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(0, 72, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_compile); if (!__pyx_builtin_compile) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_eval); if (!__pyx_builtin_eval) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 424, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -16285,83 +16733,91 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "constraint/parser.py":120 + /* "constraint/parser.py":135 * # 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, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); - /* "constraint/parser.py":131 + /* "constraint/parser.py":146 * # 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, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); - /* "constraint/parser.py":185 - * if len(variable_unique_operators) == 0 or variable_unique_operators[0] == "+": + /* "constraint/parser.py":197 * 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, 185, __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, 197, __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, 185, __pyx_L1_error) + + /* "constraint/parser.py":199 + * 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, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[1]); - /* "constraint/parser.py":309 + /* "constraint/parser.py":344 * 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, 309, __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, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); - /* "constraint/parser.py":330 + /* "constraint/parser.py":365 * 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, 330, __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, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[2]); - /* "constraint/parser.py":332 + /* "constraint/parser.py":367 * 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, 332, __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, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[3]); - /* "constraint/parser.py":345 - * return parsed_restrictions + /* "constraint/parser.py":381 * - * 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], Union[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, 345, __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, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_RefNannyFinishContext(); @@ -16382,6 +16838,8 @@ static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { __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; 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) @@ -16416,104 +16874,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), 99, 2}; 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; } { - 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), 99, 2}; 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; } { - 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), 110, 2}; 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; } { - 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), 155, 2}; 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; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 170, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 175, 2}; 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_k_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), 177, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 184, 2}; 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__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), 178, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 185, 2}; 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_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), 181, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 190, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; - __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_2, 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_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__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), 247, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 282, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_o}; - __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_Q_3, 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_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_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), 254, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 289, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; - __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_k__27, 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_k__28, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) 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[10] = __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[10])) goto bad; - } - { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 297, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 332, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; - __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__27, 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_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__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), 307, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 342, 2}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_r}; - __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_genexpr, __pyx_k_Q_3, 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_parser_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; } { - 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, 50}; 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, __pyx_k_A_l_4s_Cq_2V2Q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) 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_k_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, 50}; 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[14] = __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[14])) 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_k_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, 251}; 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[15] = __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[15])) 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_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; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 48, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 79, 2103}; - 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->__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_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[16])) goto bad; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 41, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 81, 1732}; + 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_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, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 278, 222}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 313, 222}; 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[17] = __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[17])) 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_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; } { - 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, 389}; 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[18] = __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_J_U_6_Q_q_t4uA_d_4y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) 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_k_Ya_1_q_Q2_m5_aP_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), 345, 177}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 381, 175}; 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[19] = __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[19])) 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_k_V1_A_UUV__A_Qm1_q_9_gQm_q_1Kz_g, 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), 419, 45}; + 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_k_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), 431, 69}; + 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_k_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; @@ -16527,11 +16990,6 @@ 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) - - /* AssertionsEnabled.init */ - if (likely(__Pyx_init_assertions_enabled() == 0)); else - if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) /* CachedMethodType.init */ @@ -16546,6 +17004,11 @@ if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) } // error handling follows #endif +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) return 0; @@ -18252,371 +18715,181 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize wrapped_i += PyTuple_GET_SIZE(o); } 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; - } - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); -#else - 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 - 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)) { - 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; - } - } else { - PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; - PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; - if (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 (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { - Py_ssize_t l = sm->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - return NULL; - PyErr_Clear(); - } - } - return sm->sq_item(o, i); - } - } -#else - if (is_list || !PyMapping_Check(o)) { - 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); -} - -/* 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 - -/* 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; + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif } - -/* 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; +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 + 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); + } } - 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; + else 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; } - 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 { + PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; + PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; + if (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 (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { + Py_ssize_t l = sm->sq_length(o); + if (likely(l >= 0)) { + i += l; } else { - type = instance_class; + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); } } + return sm->sq_item(o, i); } - 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 + if (is_list || !PyMapping_Check(o)) { + return PySequence_GetItem(o, i); } -bad: - Py_XDECREF(owned_instance); - return; +#endif + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); } -/* 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; - } - return exc_info; +/* 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); } -#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); +/* 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); } - #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 + 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 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 +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 + +/* 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; +} /* RaiseUnboundLocalError */ static void __Pyx_RaiseUnboundLocalError(const char *varname) { @@ -18915,85 +19188,244 @@ static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, in if (unlikely(result < 0)) { result = __Pyx_PySet_ContainsUnhashable(set, key); } - return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); -} - -/* JoinPyUnicode */ -static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, - Py_UCS4 max_char) { -#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - PyObject *result_uval; - int result_ukind, kind_shift; - Py_ssize_t i, char_pos; - void *result_udata; - if (max_char > 1114111) max_char = 1114111; - result_uval = PyUnicode_New(result_ulength, max_char); - if (unlikely(!result_uval)) return NULL; - result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; - kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; - result_udata = PyUnicode_DATA(result_uval); - assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); - if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0)) - goto overflow; - char_pos = 0; - for (i=0; i < value_count; i++) { - int ukind; - Py_ssize_t ulength; - void *udata; - PyObject *uval = values[i]; - #if !CYTHON_COMPILING_IN_LIMITED_API - if (__Pyx_PyUnicode_READY(uval) == (-1)) - goto bad; - #endif - ulength = __Pyx_PyUnicode_GET_LENGTH(uval); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely(ulength < 0)) goto bad; - #endif - if (unlikely(!ulength)) - continue; - if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) - goto overflow; - ukind = __Pyx_PyUnicode_KIND(uval); - udata = __Pyx_PyUnicode_DATA(uval); - if (ukind == result_ukind) { - memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* JoinPyUnicode */ +static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, + Py_UCS4 max_char) { +#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + PyObject *result_uval; + int result_ukind, kind_shift; + Py_ssize_t i, char_pos; + void *result_udata; + if (max_char > 1114111) max_char = 1114111; + result_uval = PyUnicode_New(result_ulength, max_char); + if (unlikely(!result_uval)) return NULL; + result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; + kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; + result_udata = PyUnicode_DATA(result_uval); + assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); + if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0)) + goto overflow; + char_pos = 0; + for (i=0; i < value_count; i++) { + int ukind; + Py_ssize_t ulength; + void *udata; + PyObject *uval = values[i]; + #if !CYTHON_COMPILING_IN_LIMITED_API + if (__Pyx_PyUnicode_READY(uval) == (-1)) + goto bad; + #endif + ulength = __Pyx_PyUnicode_GET_LENGTH(uval); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(ulength < 0)) goto bad; + #endif + if (unlikely(!ulength)) + continue; + if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) + goto overflow; + ukind = __Pyx_PyUnicode_KIND(uval); + udata = __Pyx_PyUnicode_DATA(uval); + if (ukind == result_ukind) { + memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); + } else { + #if PY_VERSION_HEX >= 0x030d0000 + if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; + #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters) + _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); + #else + Py_ssize_t j; + for (j=0; j < ulength; j++) { + Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); + __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); + } + #endif + } + char_pos += ulength; + } + return result_uval; +overflow: + PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); +bad: + Py_DECREF(result_uval); + return NULL; +#else + Py_ssize_t i; + PyObject *result = NULL; + PyObject *value_tuple = PyTuple_New(value_count); + if (unlikely(!value_tuple)) return NULL; + CYTHON_UNUSED_VAR(max_char); + CYTHON_UNUSED_VAR(result_ulength); + for (i=0; i__pyx_empty_unicode, value_tuple); +bad: + Py_DECREF(value_tuple); + return result; +#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; +} + +/* 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 { - #if PY_VERSION_HEX >= 0x030d0000 - if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; - #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters) - _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); - #else - Py_ssize_t j; - for (j=0; j < ulength; j++) { - Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); - __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); - } - #endif + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; } - char_pos += ulength; + PyException_SetCause(value, fixed_cause); } - return result_uval; -overflow: - PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); -bad: - Py_DECREF(result_uval); - return NULL; + 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 - Py_ssize_t i; - PyObject *result = NULL; - PyObject *value_tuple = PyTuple_New(value_count); - if (unlikely(!value_tuple)) return NULL; - CYTHON_UNUSED_VAR(max_char); - CYTHON_UNUSED_VAR(result_ulength); - for (i=0; i__pyx_empty_unicode, value_tuple); bad: - Py_DECREF(value_tuple); - return result; -#endif + Py_XDECREF(owned_instance); + return; +} + +/* RaiseNoneIterError */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* LimitedApiGetTypeDict */ @@ -20484,57 +20916,6 @@ __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) 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_keys */ -static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) { - return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_keys, d); -} - -/* 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; @@ -20574,6 +20955,88 @@ static PyObject* __Pyx_Globals(void) { return __Pyx_NewRef(__pyx_mstate_global->__pyx_d); } +/* 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; + } + 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 + /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; diff --git a/constraint/parser.py b/constraint/parser.py index 62d19ea..d7734a3 100644 --- a/constraint/parser.py +++ b/constraint/parser.py @@ -1,4 +1,5 @@ """Module containing the code for parsing string constraints.""" + import re from types import FunctionType from typing import Union, Optional @@ -27,8 +28,9 @@ # SomeNotInSetConstraint, ) + 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 + """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,22 @@ 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]) -> Optional[ + Union[ + MinSumConstraint, + VariableMinSumConstraint, + ExactSumConstraint, + VariableExactSumConstraint, + MaxSumConstraint, + VariableMaxSumConstraint, + MinProdConstraint, + VariableMinProdConstraint, + ExactProdConstraint, + VariableExactProdConstraint, + MaxProdConstraint, + VariableMaxProdConstraint, + ] + ]: # 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 +110,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 +120,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,51 +131,41 @@ 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) @@ -169,7 +174,9 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: 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 ( + 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 @@ -178,26 +185,54 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: 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 @@ -302,12 +337,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] @@ -342,7 +377,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], 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. Args: @@ -352,7 +390,7 @@ 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() for restriction, params_used in parsed_restrictions: @@ -373,3 +411,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) -> Optional[Union[int, float]]: + """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""" + (? Date: Wed, 23 Jul 2025 11:06:29 +0200 Subject: [PATCH 62/87] Implemented test for operator extraction in parser --- tests/test_parser.py | 123 +++++++++++++++++++++++++------------------ 1 file changed, 71 insertions(+), 52 deletions(-) diff --git a/tests/test_parser.py b/tests/test_parser.py index 190db71..380d4c7 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 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 - "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 + "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, - FunctionConstraint, # TODO should be VariableExactSumConstraint after Roadmap point 1 is implemented + 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" - 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" + 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) @@ -138,16 +142,13 @@ def test_compile_to_constraints_picklable(): 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'" - ] - + 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)) @@ -156,3 +157,21 @@ def test_compile_non_numeric(): assert isinstance(r_str, str) else: assert r_str 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: **, - + ("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)}" From e9b40ad62de3867d5ce8ff9135ae6e800a7a5dba Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Wed, 23 Jul 2025 11:09:03 +0200 Subject: [PATCH 63/87] Implemented test for operator extraction in parser --- tests/test_parser.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_parser.py b/tests/test_parser.py index 380d4c7..7c2877c 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -166,6 +166,7 @@ def test_extract_operators(): ("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: **, + From 33c0da32392cd21f3104aafb93ffbc8a5192ff37 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Wed, 23 Jul 2025 11:15:50 +0200 Subject: [PATCH 64/87] Implemented test for evaluating numbers in parser --- tests/test_parser.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/test_parser.py b/tests/test_parser.py index 7c2877c..69e01b7 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -15,7 +15,7 @@ VariableMinProdConstraint, VariableMaxProdConstraint, ) -from constraint.parser import extract_operators +from constraint.parser import extract_operators, is_or_evals_to_number from collections.abc import Iterable @@ -159,6 +159,21 @@ def test_compile_non_numeric(): 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") == None + assert is_or_evals_to_number("2 + '3'") == None + assert is_or_evals_to_number("x1 + y2") == None + assert is_or_evals_to_number("3 + 2j") == None + + def test_extract_operators(): expression_and_solutions = [ ("-3<=x+y", ["+"]), # should find: + From ba10031f11e4d94b297573a3bbeb68938f6a1572 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Wed, 23 Jul 2025 11:16:36 +0200 Subject: [PATCH 65/87] Implemented test for evaluating numbers in parser --- tests/test_parser.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_parser.py b/tests/test_parser.py index 69e01b7..6a39d2b 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -168,10 +168,10 @@ def test_is_or_evals_to_number(): 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") == None - assert is_or_evals_to_number("2 + '3'") == None - assert is_or_evals_to_number("x1 + y2") == None - assert is_or_evals_to_number("3 + 2j") == None + 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(): From d4bde294290044a2f952566808c2e6851c20f0ee Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Wed, 23 Jul 2025 11:17:25 +0200 Subject: [PATCH 66/87] Implemented general test for correct handling of negative values --- tests/test_solvers.py | 84 ++++++++++++++++++++++++++++++------------- 1 file changed, 60 insertions(+), 24 deletions(-) diff --git a/tests/test_solvers.py b/tests/test_solvers.py index fafc863..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)) @@ -100,6 +114,7 @@ def test_parallel_solver(): 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)) @@ -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}" @@ -177,36 +199,50 @@ def create_problem(solver): assert size == len(base_solution) # 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] - } + 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" - ] + 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), + ("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) From e9c314d8c1585fce337511605ad7ae6244348dbb Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Wed, 23 Jul 2025 11:18:00 +0200 Subject: [PATCH 67/87] Updated roadmap in README --- README.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/README.rst b/README.rst index c09690c..9cab614 100644 --- a/README.rst +++ b/README.rst @@ -178,6 +178,7 @@ For an overview of recent changes, visit the `Changelog Date: Tue, 6 Jan 2026 20:14:17 +0100 Subject: [PATCH 68/87] Bump urllib3 from 2.5.0 to 2.6.0 in /docs (#104) Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.5.0 to 2.6.0. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/2.5.0...2.6.0) --- updated-dependencies: - dependency-name: urllib3 dependency-version: 2.6.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 15d132e..1f23936 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -29,5 +29,5 @@ 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.5.0 ; python_version >= "3.9" +urllib3==2.6.0 ; python_version >= "3.9" zipp==3.21.0 ; python_version >= "3.9" and python_version < "3.10" From 826894dce7ca66d78207ad9e17da8e1d09efbde9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Jan 2026 08:01:01 +0100 Subject: [PATCH 69/87] Bump urllib3 from 2.6.0 to 2.6.3 in /docs (#105) Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.6.0 to 2.6.3. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/2.6.0...2.6.3) --- updated-dependencies: - dependency-name: urllib3 dependency-version: 2.6.3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 1f23936..686294c 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -29,5 +29,5 @@ 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.6.0 ; python_version >= "3.9" +urllib3==2.6.3 ; python_version >= "3.9" zipp==3.21.0 ; python_version >= "3.9" and python_version < "3.10" From 9ec9b0b087fa5ea1f36d7ce20985b112e987aadf Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Thu, 8 Jan 2026 11:15:37 +0100 Subject: [PATCH 70/87] Prevented ValueErrors on empty domains in preprocessing as described in issue #103 --- constraint/constraints.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/constraint/constraints.py b/constraint/constraints.py index 40556da..b18e36f 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -325,8 +325,8 @@ def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple domain.remove(value) # recalculate the min and max after pruning - self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 - 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 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 @@ -542,7 +542,7 @@ def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple domain.remove(value) # recalculate the max after pruning - self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + 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 @@ -692,8 +692,8 @@ def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple if value * multiplier + other_vars_min > maxsum: domain.remove(value) - # recalculate the min and max after pruning - self._var_min = { variable: min(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + # 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 From 07f6d961673d020bd373e8d239a1eb383d12f651 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Thu, 8 Jan 2026 11:18:43 +0100 Subject: [PATCH 71/87] Extended FunctionConstraint doctest with sorted results --- constraint/constraints.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/constraint/constraints.py b/constraint/constraints.py index b18e36f..08839f1 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -121,6 +121,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): From 7fad7e22af804e73565ab7e5c0b7e6162ab09eba Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Thu, 8 Jan 2026 11:20:52 +0100 Subject: [PATCH 72/87] Added support for Python 3.14, bumped version, updated changelog --- .github/workflows/publish-package.yml | 2 +- CHANGELOG.md | 15 +++++++++++++++ noxfile.py | 2 +- pyproject.toml | 15 ++++++++------- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index cfb7a6c..4b3f812 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -24,7 +24,7 @@ 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"] + pyversion: ["3.9", "3.10", "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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dcaf88..d10936c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,21 @@ 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.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/noxfile.py b/noxfile.py index 6faa52c..b045a79 100644 --- a/noxfile.py +++ b/noxfile.py @@ -17,7 +17,7 @@ "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 a4ca0a8..ebef04c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ 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.4.0" # adhere to PEP440 versioning: https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#id55 +version = "2.5.0" # adhere to PEP440 versioning: https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#id55 authors = [ {name = "Floris-Jan Willemsen", email = "fjwillemsen97@gmail.com"}, {name = "Sébastien Celles", email = "s.celles@gmail.com"}, @@ -38,6 +38,7 @@ classifiers = [ "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` @@ -73,14 +74,14 @@ 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.4" [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" +pytest = "^8.4.2" +pytest-benchmark = "^5.2.3" +pytest-cov = "^6.3.0" +nox = "^2025.11.12" ruff = "^0.9.6" 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 @@ -107,7 +108,7 @@ select = [ convention = "google" [tool.pytest.ini_options] -minversion = "8.3" +minversion = "8.4" pythonpath = [ "constraint", ] # necessary to get coverage reports without installing with `-e` From 2a4d725c30c34631d6c62b0225dcc4b5d29b4da8 Mon Sep 17 00:00:00 2001 From: fjwillemsen Date: Thu, 8 Jan 2026 13:27:10 +0100 Subject: [PATCH 73/87] Recythonized C files --- constraint/constraints.c | 21422 ++++++++++++++++++------------------- constraint/domain.c | 2452 +++-- constraint/parser.c | 6212 ++++++----- constraint/problem.c | 4221 ++++---- constraint/solvers.c | 6128 ++++++----- 5 files changed, 20089 insertions(+), 20346 deletions(-) diff --git a/constraint/constraints.c b/constraint/constraints.c index fe5e2cf..8fe8d0b 100644 --- a/constraint/constraints.c +++ b/constraint/constraints.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.1.2 */ +/* Generated by Cython 3.2.4 */ /* 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_4" +#define CYTHON_HEX_VERSION 0x030204F0 #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,6 +888,22 @@ 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 +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 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) @@ -907,6 +921,12 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #else #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) #endif +#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyList_GetItemRefFast(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_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(o, i) +#endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) #elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS @@ -966,15 +986,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 +1092,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 +1140,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 +1351,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 +1387,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 +1412,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 +1422,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 +1438,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 +1454,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 +1471,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 +1487,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 +1517,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 ### */ @@ -1542,7 +1563,7 @@ struct __pyx_defaults { }; -/* "constraint/constraints.py":425 +/* "constraint/constraints.py":432 * 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." # <<<<<<<<<<<<<< @@ -1556,7 +1577,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr { }; -/* "constraint/constraints.py":428 +/* "constraint/constraints.py":435 * 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 # <<<<<<<<<<<<<< @@ -1570,7 +1591,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess { }; -/* "constraint/constraints.py":442 +/* "constraint/constraints.py":449 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -1588,7 +1609,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr { }; -/* "constraint/constraints.py":443 +/* "constraint/constraints.py":450 * 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) # <<<<<<<<<<<<<< @@ -1606,7 +1627,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr { }; -/* "constraint/constraints.py":607 +/* "constraint/constraints.py":614 * 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." # <<<<<<<<<<<<<< @@ -1620,7 +1641,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr { }; -/* "constraint/constraints.py":610 +/* "constraint/constraints.py":617 * 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 # <<<<<<<<<<<<<< @@ -1634,7 +1655,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess { }; -/* "constraint/constraints.py":618 +/* "constraint/constraints.py":625 * for var in self.sum_vars: * domain = domains[var] * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -1652,7 +1673,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr { }; -/* "constraint/constraints.py":786 +/* "constraint/constraints.py":793 * 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." # <<<<<<<<<<<<<< @@ -1666,7 +1687,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr { }; -/* "constraint/constraints.py":789 +/* "constraint/constraints.py":796 * 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 # <<<<<<<<<<<<<< @@ -1680,7 +1701,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess { }; -/* "constraint/constraints.py":797 +/* "constraint/constraints.py":804 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -1698,7 +1719,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr { }; -/* "constraint/constraints.py":862 +/* "constraint/constraints.py":869 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -1712,7 +1733,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr { }; -/* "constraint/constraints.py":891 +/* "constraint/constraints.py":898 * 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])) # <<<<<<<<<<<<<< @@ -1726,7 +1747,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr { }; -/* "constraint/constraints.py":982 +/* "constraint/constraints.py":989 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -1739,7 +1760,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ { }; -/* "constraint/constraints.py":1005 +/* "constraint/constraints.py":1012 * 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) # <<<<<<<<<<<<<< @@ -1756,7 +1777,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr { }; -/* "constraint/constraints.py":1006 +/* "constraint/constraints.py":1013 * 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) # <<<<<<<<<<<<<< @@ -1773,7 +1794,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr { }; -/* "constraint/constraints.py":1138 +/* "constraint/constraints.py":1145 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -1786,7 +1807,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__ { }; -/* "constraint/constraints.py":1174 +/* "constraint/constraints.py":1181 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p < target_value for p in prods): # <<<<<<<<<<<<<< @@ -1801,7 +1822,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr { }; -/* "constraint/constraints.py":1214 +/* "constraint/constraints.py":1221 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -1815,7 +1836,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr { }; -/* "constraint/constraints.py":1243 +/* "constraint/constraints.py":1250 * 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])) # <<<<<<<<<<<<<< @@ -1829,7 +1850,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr { }; -/* "constraint/constraints.py":1325 +/* "constraint/constraints.py":1332 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -1842,7 +1863,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ { }; -/* "constraint/constraints.py":1361 +/* "constraint/constraints.py":1368 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p > target_value for p in prods): # <<<<<<<<<<<<<< @@ -1857,7 +1878,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr { }; -/* "constraint/constraints.py":1563 +/* "constraint/constraints.py":1570 * # Utility functions * * def sum_other_vars(variables: Sequence, variable, values: dict): # <<<<<<<<<<<<<< @@ -1871,7 +1892,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars }; -/* "constraint/constraints.py":1565 +/* "constraint/constraints.py":1572 * 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) # <<<<<<<<<<<<<< @@ -1962,7 +1983,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_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); @@ -1970,7 +1991,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; @@ -1988,7 +2009,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) @@ -2013,20 +2034,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 @@ -2034,13 +2055,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 */ @@ -2079,19 +2100,10 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #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)\ @@ -2101,52 +2113,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; @@ -2179,6 +2165,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); @@ -2188,37 +2227,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 @@ -2244,7 +2294,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 */ @@ -2262,7 +2312,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 @@ -2310,43 +2360,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( @@ -2366,7 +2418,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) @@ -2377,7 +2429,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);\ @@ -2423,7 +2475,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *k /* 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); @@ -2435,9 +2487,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; @@ -2462,13 +2517,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); -/* PyObjectCallMethod1.proto */ +/* PyObjectCallMethod1.proto (used by append) */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* append.proto */ @@ -2498,7 +2556,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 @@ -2523,6 +2581,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 @@ -2530,19 +2594,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 @@ -2550,37 +2628,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); + +/* 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 @@ -2610,14 +2703,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; @@ -2662,7 +2756,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) @@ -2687,10 +2781,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) @@ -2709,14 +2803,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 @@ -2797,12 +2891,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); @@ -2813,7 +2916,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); @@ -2821,16 +2924,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 @@ -2847,7 +2950,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; @@ -2915,12 +3020,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*); @@ -2978,376 +3083,22 @@ 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_min; static PyObject *__pyx_builtin_max; static PyObject *__pyx_builtin_round; -static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_sum; -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_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_gc[] = "gc"; -static const char __pyx_k_hi[] = "hi"; -static const char __pyx_k_lo[] = "lo"; -static const char __pyx_k_3gQ[] = "\320\000\036\320\036:\270!\340\004\013\2103\210g\220Q"; -static const char __pyx_k_A_2[] = "\250A"; -static const char __pyx_k_Q_2[] = "\270Q"; -static const char __pyx_k_Q_3[] = "\230Q"; -static const char __pyx_k_Q_4[] = "\220Q"; -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_L_6a[] = "\320\004 \240\001\360\014\000\t\r\210L\230\001\330\010\014\320\0146\260a"; -static const char __pyx_k_N_6a[] = "\320\004\"\240!\360\014\000\t\r\210N\230!\330\010\014\320\0146\260a"; -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_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_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_var_max[] = "_var_max"; -static const char __pyx_k_var_min[] = "_var_min"; -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_2_q_Kq_A_L[] = "\320\004\037\320\0372\260-\270q\360\022\000\t\r\210K\220q\330\010\014\320\014\034\230A\330\010\014\210L\230\001"; -static const char __pyx_k_4M_M_A_L_L[] = "\320\004!\320!4\260M\300\021\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"; -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_2_q_Kq_A_L_2[] = "\320\004\037\320\0372\260-\270q\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"; -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_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_other_vars_max[] = "other_vars_max"; -static const char __pyx_k_other_vars_min[] = "other_vars_min"; -static const char __pyx_k_possible_prods[] = "possible_prods"; -static const char __pyx_k_sum_other_vars[] = "sum_other_vars"; -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_max_sum_missing[] = "max_sum_missing"; -static const char __pyx_k_min_sum_missing[] = "min_sum_missing"; -static const char __pyx_k_unassigned_vars[] = "unassigned_vars"; -static const char __pyx_k_var_is_negative[] = "_var_is_negative"; -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_missing_negative[] = "missing_negative"; -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_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_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_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_MinSumConstraint_preProcess[] = "MinSumConstraint.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_sum_other_vars_locals_genexpr[] = "sum_other_vars..genexpr"; -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_3at_Cs_1_A_7_Q_J_c[] = "\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"; -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_a_q_a_3at_Cs_1_A_7_Q_J_c[] = "\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"; -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_4_B_5_1A_4q_L[] = "\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[\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\330\010\014\320\014 \240\002\240*\250D\260\t\270\021\270*\300B\300b\310\004\310L\320XY"; -static const char __pyx_k_77JJeef_QfKy_Q_d_4_B_5_1A_L_Cq[] = "\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[\310\004\310J\320Vd\320dg\320gh\320hs\320st"; -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\360\"\000\t\020\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_1_1Kq_9Cq_az_1_t[] = "\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!"; -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_55H_a_d_Q_a_1_1Kq_9Cq_az_1_t9AQ[] = "\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"; -static const char __pyx_k_55H_a_d_Q_a_1_1_1Kq_9Cq_az_1_t9[] = "\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"; -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_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_4_B_5_1A_Q_L_C[] = "\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[\310\004\310J\320Vd\320dg\320gh\320hs\320st\330\010\014\320\014 \240\002\240*\250D\260\t\270\021\270*\300B\300b\310\004\310L\320XY"; -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 >>> 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 "; -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 >>> 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 "; -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___call___loc[] = "ExactProdConstraint.__call__..genexpr"; -static const char __pyx_k_ExactProdConstraint_preProcess_l[] = "ExactProdConstraint.preProcess..genexpr"; -static const char __pyx_k_MaxProdConstraint___call___local[] = "MaxProdConstraint.__call__..genexpr"; -static const char __pyx_k_MaxProdConstraint_preProcess_loc[] = "MaxProdConstraint.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 >>> 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 "; -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 >>> 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 "; -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 >>> 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 "; -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 >>> 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 "; -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 >>> problem = 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 "; -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 >>> 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 "; -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 >>> 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 "; -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 >>> 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 "; -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 >>> 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 "; -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 >>> 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 "; -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_2__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_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_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_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_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 */ @@ -3467,24 +3218,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; @@ -3534,15 +3267,15 @@ typedef struct { 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_tuple[4]; PyObject *__pyx_codeobj_tab[78]; - PyObject *__pyx_string_tab[295]; - PyObject *__pyx_int_0; - PyObject *__pyx_int_1; - PyObject *__pyx_int_10; + PyObject *__pyx_string_tab[351]; + PyObject *__pyx_number_tab[3]; /* #### Code section: module_state_contents ### */ #if CYTHON_USE_FREELISTS @@ -3667,6 +3400,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; @@ -3675,6 +3411,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; @@ -3702,186 +3441,186 @@ 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___call___loc __pyx_string_tab[38] -#define __pyx_n_u_ExactProdConstraint___init __pyx_string_tab[39] -#define __pyx_n_u_ExactProdConstraint_preProcess __pyx_string_tab[40] -#define __pyx_n_u_ExactProdConstraint_preProcess_l __pyx_string_tab[41] -#define __pyx_n_u_ExactSumConstraint __pyx_string_tab[42] -#define __pyx_n_u_ExactSumConstraint___call __pyx_string_tab[43] -#define __pyx_n_u_ExactSumConstraint___init __pyx_string_tab[44] -#define __pyx_n_u_ExactSumConstraint_preProcess __pyx_string_tab[45] -#define __pyx_n_u_FunctionConstraint __pyx_string_tab[46] -#define __pyx_n_u_FunctionConstraint___call __pyx_string_tab[47] -#define __pyx_n_u_FunctionConstraint___init __pyx_string_tab[48] -#define __pyx_n_u_InSetConstraint __pyx_string_tab[49] -#define __pyx_n_u_InSetConstraint___call __pyx_string_tab[50] -#define __pyx_n_u_InSetConstraint___init __pyx_string_tab[51] -#define __pyx_n_u_InSetConstraint_preProcess __pyx_string_tab[52] -#define __pyx_kp_u_Last_multiplier_must_be_1_as_it __pyx_string_tab[53] -#define __pyx_n_u_MaxProdConstraint __pyx_string_tab[54] -#define __pyx_n_u_MaxProdConstraint___call __pyx_string_tab[55] -#define __pyx_n_u_MaxProdConstraint___call___local __pyx_string_tab[56] -#define __pyx_n_u_MaxProdConstraint___init __pyx_string_tab[57] -#define __pyx_n_u_MaxProdConstraint_preProcess __pyx_string_tab[58] -#define __pyx_n_u_MaxProdConstraint_preProcess_loc __pyx_string_tab[59] -#define __pyx_n_u_MaxSumConstraint __pyx_string_tab[60] -#define __pyx_n_u_MaxSumConstraint___call __pyx_string_tab[61] -#define __pyx_n_u_MaxSumConstraint___init __pyx_string_tab[62] -#define __pyx_n_u_MaxSumConstraint_preProcess __pyx_string_tab[63] -#define __pyx_n_u_MinProdConstraint __pyx_string_tab[64] -#define __pyx_n_u_MinProdConstraint___call __pyx_string_tab[65] -#define __pyx_n_u_MinProdConstraint___init __pyx_string_tab[66] -#define __pyx_n_u_MinProdConstraint_preProcess __pyx_string_tab[67] -#define __pyx_n_u_MinSumConstraint __pyx_string_tab[68] -#define __pyx_n_u_MinSumConstraint___call __pyx_string_tab[69] -#define __pyx_n_u_MinSumConstraint___init __pyx_string_tab[70] -#define __pyx_n_u_MinSumConstraint_preProcess __pyx_string_tab[71] -#define __pyx_kp_u_Multipliers_must_be_numbers __pyx_string_tab[72] -#define __pyx_kp_u_Multipliers_must_match_sum_varia __pyx_string_tab[73] -#define __pyx_n_u_NotImplementedError __pyx_string_tab[74] -#define __pyx_n_u_NotInSetConstraint __pyx_string_tab[75] -#define __pyx_n_u_NotInSetConstraint___call __pyx_string_tab[76] -#define __pyx_n_u_NotInSetConstraint___init __pyx_string_tab[77] -#define __pyx_n_u_NotInSetConstraint_preProcess __pyx_string_tab[78] -#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[79] -#define __pyx_n_u_Optional __pyx_string_tab[80] -#define __pyx_kp_u_Optional_Sequence __pyx_string_tab[81] -#define __pyx_n_u_RuntimeError __pyx_string_tab[82] -#define __pyx_n_u_Sequence __pyx_string_tab[83] -#define __pyx_kp_u_Sequence_str __pyx_string_tab[84] -#define __pyx_n_u_SomeInSetConstraint __pyx_string_tab[85] -#define __pyx_n_u_SomeInSetConstraint___call __pyx_string_tab[86] -#define __pyx_n_u_SomeInSetConstraint___init __pyx_string_tab[87] -#define __pyx_n_u_SomeNotInSetConstraint __pyx_string_tab[88] -#define __pyx_n_u_SomeNotInSetConstraint___call __pyx_string_tab[89] -#define __pyx_n_u_SomeNotInSetConstraint___init __pyx_string_tab[90] -#define __pyx_n_u_Unassigned __pyx_string_tab[91] -#define __pyx_n_u_Union __pyx_string_tab[92] -#define __pyx_kp_u_Union_int_float __pyx_string_tab[93] -#define __pyx_n_u_VariableExactProdConstraint __pyx_string_tab[94] -#define __pyx_n_u_VariableExactProdConstraint___ca __pyx_string_tab[95] -#define __pyx_n_u_VariableExactProdConstraint___ca_2 __pyx_string_tab[96] -#define __pyx_n_u_VariableExactProdConstraint___in __pyx_string_tab[97] -#define __pyx_n_u_VariableExactProdConstraint__get __pyx_string_tab[98] -#define __pyx_n_u_VariableExactProdConstraint__saf __pyx_string_tab[99] -#define __pyx_n_u_VariableExactProdConstraint_preP __pyx_string_tab[100] -#define __pyx_n_u_VariableExactSumConstraint __pyx_string_tab[101] -#define __pyx_n_u_VariableExactSumConstraint___cal __pyx_string_tab[102] -#define __pyx_n_u_VariableExactSumConstraint___ini __pyx_string_tab[103] -#define __pyx_n_u_VariableExactSumConstraint___ini_2 __pyx_string_tab[104] -#define __pyx_n_u_VariableExactSumConstraint_prePr __pyx_string_tab[105] -#define __pyx_n_u_VariableExactSumConstraint_prePr_2 __pyx_string_tab[106] -#define __pyx_n_u_VariableMaxProdConstraint __pyx_string_tab[107] -#define __pyx_n_u_VariableMaxProdConstraint___call __pyx_string_tab[108] -#define __pyx_n_u_VariableMaxProdConstraint___call_2 __pyx_string_tab[109] -#define __pyx_n_u_VariableMaxProdConstraint___init __pyx_string_tab[110] -#define __pyx_n_u_VariableMaxProdConstraint__get_p __pyx_string_tab[111] -#define __pyx_n_u_VariableMaxProdConstraint__safe __pyx_string_tab[112] -#define __pyx_n_u_VariableMaxProdConstraint_prePro __pyx_string_tab[113] -#define __pyx_n_u_VariableMaxSumConstraint __pyx_string_tab[114] -#define __pyx_n_u_VariableMaxSumConstraint___call __pyx_string_tab[115] -#define __pyx_n_u_VariableMaxSumConstraint___init __pyx_string_tab[116] -#define __pyx_n_u_VariableMaxSumConstraint___init_2 __pyx_string_tab[117] -#define __pyx_n_u_VariableMaxSumConstraint_preProc __pyx_string_tab[118] -#define __pyx_n_u_VariableMaxSumConstraint_preProc_2 __pyx_string_tab[119] -#define __pyx_n_u_VariableMinProdConstraint __pyx_string_tab[120] -#define __pyx_n_u_VariableMinProdConstraint___call __pyx_string_tab[121] -#define __pyx_n_u_VariableMinProdConstraint___call_2 __pyx_string_tab[122] -#define __pyx_n_u_VariableMinProdConstraint___init __pyx_string_tab[123] -#define __pyx_n_u_VariableMinProdConstraint__get_p __pyx_string_tab[124] -#define __pyx_n_u_VariableMinProdConstraint__safe __pyx_string_tab[125] -#define __pyx_n_u_VariableMinProdConstraint_prePro __pyx_string_tab[126] -#define __pyx_n_u_VariableMinSumConstraint __pyx_string_tab[127] -#define __pyx_n_u_VariableMinSumConstraint___call __pyx_string_tab[128] -#define __pyx_n_u_VariableMinSumConstraint___init __pyx_string_tab[129] -#define __pyx_n_u_VariableMinSumConstraint___init_2 __pyx_string_tab[130] -#define __pyx_n_u_VariableMinSumConstraint_preProc __pyx_string_tab[131] -#define __pyx_n_u_VariableMinSumConstraint_preProc_2 __pyx_string_tab[132] -#define __pyx_kp_u_Wrapper_function_for_picklable_s __pyx_string_tab[133] -#define __pyx_kp_u__2 __pyx_string_tab[134] -#define __pyx_kp_u_add_note __pyx_string_tab[135] -#define __pyx_n_u_all_bounds __pyx_string_tab[136] -#define __pyx_n_u_append __pyx_string_tab[137] -#define __pyx_n_u_assigned __pyx_string_tab[138] -#define __pyx_n_u_assigned_2 __pyx_string_tab[139] -#define __pyx_n_u_assigned_prod __pyx_string_tab[140] -#define __pyx_n_u_assigned_product __pyx_string_tab[141] -#define __pyx_n_u_assignments __pyx_string_tab[142] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[143] -#define __pyx_n_u_b __pyx_string_tab[144] -#define __pyx_n_u_bool __pyx_string_tab[145] -#define __pyx_n_u_bounds __pyx_string_tab[146] -#define __pyx_n_u_c __pyx_string_tab[147] -#define __pyx_n_u_call __pyx_string_tab[148] -#define __pyx_n_u_candidates __pyx_string_tab[149] -#define __pyx_n_u_class_getitem __pyx_string_tab[150] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[151] -#define __pyx_n_u_close __pyx_string_tab[152] -#define __pyx_n_u_collections_abc __pyx_string_tab[153] -#define __pyx_n_u_constraint_constraints __pyx_string_tab[154] -#define __pyx_kp_u_constraint_constraints_py __pyx_string_tab[155] -#define __pyx_n_u_constraint_domain __pyx_string_tab[156] -#define __pyx_n_u_constraints __pyx_string_tab[157] -#define __pyx_n_u_contains_lt1 __pyx_string_tab[158] -#define __pyx_n_u_dict __pyx_string_tab[159] -#define __pyx_kp_u_disable __pyx_string_tab[160] -#define __pyx_n_u_doc __pyx_string_tab[161] -#define __pyx_n_u_dom __pyx_string_tab[162] -#define __pyx_n_u_domain __pyx_string_tab[163] -#define __pyx_n_u_domain_bounds __pyx_string_tab[164] -#define __pyx_n_u_domain_dict __pyx_string_tab[165] -#define __pyx_n_u_domains __pyx_string_tab[166] -#define __pyx_kp_u_enable __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_kp_u_gc __pyx_string_tab[181] +#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_Optional_Sequence __pyx_string_tab[27] +#define __pyx_kp_u_Sequence_str __pyx_string_tab[28] +#define __pyx_kp_u_Union_int_float __pyx_string_tab[29] +#define __pyx_kp_u_Wrapper_function_for_picklable_s __pyx_string_tab[30] +#define __pyx_kp_u__2 __pyx_string_tab[31] +#define __pyx_kp_u_add_note __pyx_string_tab[32] +#define __pyx_kp_u_constraint_constraints_py __pyx_string_tab[33] +#define __pyx_kp_u_disable __pyx_string_tab[34] +#define __pyx_kp_u_enable __pyx_string_tab[35] +#define __pyx_kp_u_gc __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_Optional __pyx_string_tab[90] +#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[91] +#define __pyx_n_u_Sequence __pyx_string_tab[92] +#define __pyx_n_u_SomeInSetConstraint __pyx_string_tab[93] +#define __pyx_n_u_SomeInSetConstraint___call __pyx_string_tab[94] +#define __pyx_n_u_SomeInSetConstraint___init __pyx_string_tab[95] +#define __pyx_n_u_SomeNotInSetConstraint __pyx_string_tab[96] +#define __pyx_n_u_SomeNotInSetConstraint___call __pyx_string_tab[97] +#define __pyx_n_u_SomeNotInSetConstraint___init __pyx_string_tab[98] +#define __pyx_n_u_Unassigned __pyx_string_tab[99] +#define __pyx_n_u_Union __pyx_string_tab[100] +#define __pyx_n_u_VariableExactProdConstraint __pyx_string_tab[101] +#define __pyx_n_u_VariableExactProdConstraint___ca __pyx_string_tab[102] +#define __pyx_n_u_VariableExactProdConstraint___ca_2 __pyx_string_tab[103] +#define __pyx_n_u_VariableExactProdConstraint___in __pyx_string_tab[104] +#define __pyx_n_u_VariableExactProdConstraint__get __pyx_string_tab[105] +#define __pyx_n_u_VariableExactProdConstraint__saf __pyx_string_tab[106] +#define __pyx_n_u_VariableExactProdConstraint_preP __pyx_string_tab[107] +#define __pyx_n_u_VariableExactSumConstraint __pyx_string_tab[108] +#define __pyx_n_u_VariableExactSumConstraint___cal __pyx_string_tab[109] +#define __pyx_n_u_VariableExactSumConstraint___ini __pyx_string_tab[110] +#define __pyx_n_u_VariableExactSumConstraint___ini_2 __pyx_string_tab[111] +#define __pyx_n_u_VariableExactSumConstraint_prePr __pyx_string_tab[112] +#define __pyx_n_u_VariableExactSumConstraint_prePr_2 __pyx_string_tab[113] +#define __pyx_n_u_VariableMaxProdConstraint __pyx_string_tab[114] +#define __pyx_n_u_VariableMaxProdConstraint___call __pyx_string_tab[115] +#define __pyx_n_u_VariableMaxProdConstraint___call_2 __pyx_string_tab[116] +#define __pyx_n_u_VariableMaxProdConstraint___init __pyx_string_tab[117] +#define __pyx_n_u_VariableMaxProdConstraint__get_p __pyx_string_tab[118] +#define __pyx_n_u_VariableMaxProdConstraint__safe __pyx_string_tab[119] +#define __pyx_n_u_VariableMaxProdConstraint_prePro __pyx_string_tab[120] +#define __pyx_n_u_VariableMaxSumConstraint __pyx_string_tab[121] +#define __pyx_n_u_VariableMaxSumConstraint___call __pyx_string_tab[122] +#define __pyx_n_u_VariableMaxSumConstraint___init __pyx_string_tab[123] +#define __pyx_n_u_VariableMaxSumConstraint___init_2 __pyx_string_tab[124] +#define __pyx_n_u_VariableMaxSumConstraint_preProc __pyx_string_tab[125] +#define __pyx_n_u_VariableMaxSumConstraint_preProc_2 __pyx_string_tab[126] +#define __pyx_n_u_VariableMinProdConstraint __pyx_string_tab[127] +#define __pyx_n_u_VariableMinProdConstraint___call __pyx_string_tab[128] +#define __pyx_n_u_VariableMinProdConstraint___call_2 __pyx_string_tab[129] +#define __pyx_n_u_VariableMinProdConstraint___init __pyx_string_tab[130] +#define __pyx_n_u_VariableMinProdConstraint__get_p __pyx_string_tab[131] +#define __pyx_n_u_VariableMinProdConstraint__safe __pyx_string_tab[132] +#define __pyx_n_u_VariableMinProdConstraint_prePro __pyx_string_tab[133] +#define __pyx_n_u_VariableMinSumConstraint __pyx_string_tab[134] +#define __pyx_n_u_VariableMinSumConstraint___call __pyx_string_tab[135] +#define __pyx_n_u_VariableMinSumConstraint___init __pyx_string_tab[136] +#define __pyx_n_u_VariableMinSumConstraint___init_2 __pyx_string_tab[137] +#define __pyx_n_u_VariableMinSumConstraint_preProc __pyx_string_tab[138] +#define __pyx_n_u_VariableMinSumConstraint_preProc_2 __pyx_string_tab[139] +#define __pyx_n_u_all_bounds __pyx_string_tab[140] +#define __pyx_n_u_append __pyx_string_tab[141] +#define __pyx_n_u_assigned __pyx_string_tab[142] +#define __pyx_n_u_assigned_2 __pyx_string_tab[143] +#define __pyx_n_u_assigned_prod __pyx_string_tab[144] +#define __pyx_n_u_assigned_product __pyx_string_tab[145] +#define __pyx_n_u_assignments __pyx_string_tab[146] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[147] +#define __pyx_n_u_b __pyx_string_tab[148] +#define __pyx_n_u_bool __pyx_string_tab[149] +#define __pyx_n_u_bounds __pyx_string_tab[150] +#define __pyx_n_u_c __pyx_string_tab[151] +#define __pyx_n_u_call __pyx_string_tab[152] +#define __pyx_n_u_candidates __pyx_string_tab[153] +#define __pyx_n_u_class_getitem __pyx_string_tab[154] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[155] +#define __pyx_n_u_close __pyx_string_tab[156] +#define __pyx_n_u_collections_abc __pyx_string_tab[157] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[158] +#define __pyx_n_u_constraint_domain __pyx_string_tab[159] +#define __pyx_n_u_constraints __pyx_string_tab[160] +#define __pyx_n_u_contains_lt1 __pyx_string_tab[161] +#define __pyx_n_u_dict __pyx_string_tab[162] +#define __pyx_n_u_doc __pyx_string_tab[163] +#define __pyx_n_u_dom __pyx_string_tab[164] +#define __pyx_n_u_domain __pyx_string_tab[165] +#define __pyx_n_u_domain_bounds __pyx_string_tab[166] +#define __pyx_n_u_domain_dict __pyx_string_tab[167] +#define __pyx_n_u_domains __pyx_string_tab[168] +#define __pyx_n_u_exact __pyx_string_tab[169] +#define __pyx_n_u_exact_2 __pyx_string_tab[170] +#define __pyx_n_u_exactprod __pyx_string_tab[171] +#define __pyx_n_u_exactprod_2 __pyx_string_tab[172] +#define __pyx_n_u_exactsum __pyx_string_tab[173] +#define __pyx_n_u_exactsum_2 __pyx_string_tab[174] +#define __pyx_n_u_exclude_var __pyx_string_tab[175] +#define __pyx_n_u_forwardCheck __pyx_string_tab[176] +#define __pyx_n_u_forwardcheck __pyx_string_tab[177] +#define __pyx_n_u_found __pyx_string_tab[178] +#define __pyx_n_u_func __pyx_string_tab[179] +#define __pyx_n_u_func_2 __pyx_string_tab[180] +#define __pyx_n_u_func_3 __pyx_string_tab[181] #define __pyx_n_u_genexpr __pyx_string_tab[182] #define __pyx_n_u_get __pyx_string_tab[183] #define __pyx_n_u_get_product_bounds __pyx_string_tab[184] @@ -3890,73 +3629,73 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_index __pyx_string_tab[187] #define __pyx_n_u_init __pyx_string_tab[188] #define __pyx_n_u_is_coroutine __pyx_string_tab[189] -#define __pyx_kp_u_isenabled __pyx_string_tab[190] +#define __pyx_n_u_items __pyx_string_tab[190] #define __pyx_n_u_itertools __pyx_string_tab[191] -#define __pyx_kp_u_list_tuple __pyx_string_tab[192] -#define __pyx_n_u_lo __pyx_string_tab[193] -#define __pyx_n_u_m __pyx_string_tab[194] -#define __pyx_n_u_main __pyx_string_tab[195] -#define __pyx_n_u_max __pyx_string_tab[196] -#define __pyx_n_u_max_others __pyx_string_tab[197] -#define __pyx_n_u_max_sum_missing __pyx_string_tab[198] -#define __pyx_n_u_maxprod __pyx_string_tab[199] -#define __pyx_n_u_maxprod_2 __pyx_string_tab[200] -#define __pyx_n_u_maxsum __pyx_string_tab[201] -#define __pyx_n_u_maxsum_2 __pyx_string_tab[202] -#define __pyx_n_u_maxval __pyx_string_tab[203] -#define __pyx_n_u_metaclass __pyx_string_tab[204] -#define __pyx_n_u_min __pyx_string_tab[205] -#define __pyx_n_u_min_others __pyx_string_tab[206] -#define __pyx_n_u_min_sum_missing __pyx_string_tab[207] -#define __pyx_n_u_minprod __pyx_string_tab[208] -#define __pyx_n_u_minprod_2 __pyx_string_tab[209] -#define __pyx_n_u_minsum __pyx_string_tab[210] -#define __pyx_n_u_minsum_2 __pyx_string_tab[211] -#define __pyx_n_u_minval __pyx_string_tab[212] -#define __pyx_n_u_missing __pyx_string_tab[213] -#define __pyx_n_u_missing_lt1 __pyx_string_tab[214] -#define __pyx_n_u_missing_negative __pyx_string_tab[215] -#define __pyx_n_u_module __pyx_string_tab[216] -#define __pyx_n_u_mro_entries __pyx_string_tab[217] -#define __pyx_n_u_multiplier __pyx_string_tab[218] -#define __pyx_n_u_multipliers __pyx_string_tab[219] -#define __pyx_n_u_multipliers_2 __pyx_string_tab[220] -#define __pyx_n_u_n __pyx_string_tab[221] -#define __pyx_n_u_n_2 __pyx_string_tab[222] -#define __pyx_n_u_name __pyx_string_tab[223] -#define __pyx_n_u_next __pyx_string_tab[224] -#define __pyx_n_u_o __pyx_string_tab[225] -#define __pyx_n_u_other_max __pyx_string_tab[226] -#define __pyx_n_u_other_min __pyx_string_tab[227] -#define __pyx_n_u_other_products __pyx_string_tab[228] -#define __pyx_n_u_other_unassigned __pyx_string_tab[229] -#define __pyx_n_u_other_vars_max __pyx_string_tab[230] -#define __pyx_n_u_other_vars_min __pyx_string_tab[231] -#define __pyx_n_u_others_max __pyx_string_tab[232] -#define __pyx_n_u_others_min __pyx_string_tab[233] -#define __pyx_n_u_p __pyx_string_tab[234] -#define __pyx_n_u_parms __pyx_string_tab[235] -#define __pyx_n_u_pop __pyx_string_tab[236] -#define __pyx_n_u_possible_max __pyx_string_tab[237] -#define __pyx_n_u_possible_min __pyx_string_tab[238] -#define __pyx_n_u_possible_prods __pyx_string_tab[239] -#define __pyx_n_u_preProcess __pyx_string_tab[240] -#define __pyx_n_u_prepare __pyx_string_tab[241] -#define __pyx_n_u_prod __pyx_string_tab[242] -#define __pyx_n_u_prods __pyx_string_tab[243] -#define __pyx_n_u_product __pyx_string_tab[244] -#define __pyx_n_u_product_vars __pyx_string_tab[245] -#define __pyx_n_u_products __pyx_string_tab[246] -#define __pyx_n_u_qualname __pyx_string_tab[247] -#define __pyx_n_u_remove __pyx_string_tab[248] -#define __pyx_n_u_round __pyx_string_tab[249] -#define __pyx_n_u_safe_product __pyx_string_tab[250] -#define __pyx_n_u_seen __pyx_string_tab[251] -#define __pyx_n_u_self __pyx_string_tab[252] -#define __pyx_n_u_send __pyx_string_tab[253] -#define __pyx_n_u_set __pyx_string_tab[254] -#define __pyx_n_u_set_2 __pyx_string_tab[255] -#define __pyx_n_u_set_name __pyx_string_tab[256] +#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_max_sum_missing __pyx_string_tab[197] +#define __pyx_n_u_maxprod __pyx_string_tab[198] +#define __pyx_n_u_maxprod_2 __pyx_string_tab[199] +#define __pyx_n_u_maxsum __pyx_string_tab[200] +#define __pyx_n_u_maxsum_2 __pyx_string_tab[201] +#define __pyx_n_u_maxval __pyx_string_tab[202] +#define __pyx_n_u_metaclass __pyx_string_tab[203] +#define __pyx_n_u_min __pyx_string_tab[204] +#define __pyx_n_u_min_others __pyx_string_tab[205] +#define __pyx_n_u_min_sum_missing __pyx_string_tab[206] +#define __pyx_n_u_minprod __pyx_string_tab[207] +#define __pyx_n_u_minprod_2 __pyx_string_tab[208] +#define __pyx_n_u_minsum __pyx_string_tab[209] +#define __pyx_n_u_minsum_2 __pyx_string_tab[210] +#define __pyx_n_u_minval __pyx_string_tab[211] +#define __pyx_n_u_missing __pyx_string_tab[212] +#define __pyx_n_u_missing_lt1 __pyx_string_tab[213] +#define __pyx_n_u_missing_negative __pyx_string_tab[214] +#define __pyx_n_u_module __pyx_string_tab[215] +#define __pyx_n_u_mro_entries __pyx_string_tab[216] +#define __pyx_n_u_multiplier __pyx_string_tab[217] +#define __pyx_n_u_multipliers __pyx_string_tab[218] +#define __pyx_n_u_multipliers_2 __pyx_string_tab[219] +#define __pyx_n_u_n __pyx_string_tab[220] +#define __pyx_n_u_n_2 __pyx_string_tab[221] +#define __pyx_n_u_name __pyx_string_tab[222] +#define __pyx_n_u_next __pyx_string_tab[223] +#define __pyx_n_u_o __pyx_string_tab[224] +#define __pyx_n_u_other_max __pyx_string_tab[225] +#define __pyx_n_u_other_min __pyx_string_tab[226] +#define __pyx_n_u_other_products __pyx_string_tab[227] +#define __pyx_n_u_other_unassigned __pyx_string_tab[228] +#define __pyx_n_u_other_vars_max __pyx_string_tab[229] +#define __pyx_n_u_other_vars_min __pyx_string_tab[230] +#define __pyx_n_u_others_max __pyx_string_tab[231] +#define __pyx_n_u_others_min __pyx_string_tab[232] +#define __pyx_n_u_p __pyx_string_tab[233] +#define __pyx_n_u_parms __pyx_string_tab[234] +#define __pyx_n_u_pop __pyx_string_tab[235] +#define __pyx_n_u_possible_max __pyx_string_tab[236] +#define __pyx_n_u_possible_min __pyx_string_tab[237] +#define __pyx_n_u_possible_prods __pyx_string_tab[238] +#define __pyx_n_u_preProcess __pyx_string_tab[239] +#define __pyx_n_u_prepare __pyx_string_tab[240] +#define __pyx_n_u_prod __pyx_string_tab[241] +#define __pyx_n_u_prods __pyx_string_tab[242] +#define __pyx_n_u_product __pyx_string_tab[243] +#define __pyx_n_u_product_vars __pyx_string_tab[244] +#define __pyx_n_u_products __pyx_string_tab[245] +#define __pyx_n_u_qualname __pyx_string_tab[246] +#define __pyx_n_u_remove __pyx_string_tab[247] +#define __pyx_n_u_round __pyx_string_tab[248] +#define __pyx_n_u_safe_product __pyx_string_tab[249] +#define __pyx_n_u_seen __pyx_string_tab[250] +#define __pyx_n_u_self __pyx_string_tab[251] +#define __pyx_n_u_send __pyx_string_tab[252] +#define __pyx_n_u_set __pyx_string_tab[253] +#define __pyx_n_u_set_2 __pyx_string_tab[254] +#define __pyx_n_u_set_name __pyx_string_tab[255] +#define __pyx_n_u_setdefault __pyx_string_tab[256] #define __pyx_n_u_singlevalue __pyx_string_tab[257] #define __pyx_n_u_str __pyx_string_tab[258] #define __pyx_n_u_sum __pyx_string_tab[259] @@ -3995,6 +3734,65 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_vconstraints __pyx_string_tab[292] #define __pyx_n_u_x __pyx_string_tab[293] #define __pyx_n_u_zip __pyx_string_tab[294] +#define __pyx_kp_b_iso88591_2_q_Kq_A_L __pyx_string_tab[295] +#define __pyx_kp_b_iso88591_2_q_Kq_A_L_2 __pyx_string_tab[296] +#define __pyx_kp_b_iso88591_3gQ __pyx_string_tab[297] +#define __pyx_kp_b_iso88591_4M_M_A_L_L __pyx_string_tab[298] +#define __pyx_kp_b_iso88591_55H_a_4_7_1_4q_1_G4q_t3a_Kq_waq __pyx_string_tab[299] +#define __pyx_kp_b_iso88591_55H_a_4_7_1_4q_Q_G4q_t3a_AQ_4q __pyx_string_tab[300] +#define __pyx_kp_b_iso88591_55H_a_D_q_a_3at_Cs_1_A_7_Q_J_c __pyx_string_tab[301] +#define __pyx_kp_b_iso88591_55H_a_L_y_q_q_a_q_L_Kq_QfA_5_q __pyx_string_tab[302] +#define __pyx_kp_b_iso88591_55H_a_a_q_a_3at_Cs_1_A_7_Q_J_c __pyx_string_tab[303] +#define __pyx_kp_b_iso88591_55H_a_d_4_7_1_4q_A_1_3at_a_4s_A __pyx_string_tab[304] +#define __pyx_kp_b_iso88591_55H_a_d_4_7_1_4q_A_1_3at_a_4s_A_2 __pyx_string_tab[305] +#define __pyx_kp_b_iso88591_55H_a_d_4q_a_1_1_1Kq_9Cq_az_1_t __pyx_string_tab[306] +#define __pyx_kp_b_iso88591_55H_a_d_L_y_1_AZs_1_1_t1_5_c_WH __pyx_string_tab[307] +#define __pyx_kp_b_iso88591_55H_a_d_L_y_1_AZwa_1_1_t1_5_c_W __pyx_string_tab[308] +#define __pyx_kp_b_iso88591_55H_a_d_Q_a_1_1Kq_9Cq_az_1_t9AQ __pyx_string_tab[309] +#define __pyx_kp_b_iso88591_55H_a_d_Q_a_1_1_1Kq_9Cq_az_1_t9 __pyx_string_tab[310] +#define __pyx_kp_b_iso88591_55H_a_q __pyx_string_tab[311] +#define __pyx_kp_b_iso88591_6a_N_A __pyx_string_tab[312] +#define __pyx_kp_b_iso88591_6a_N_A_2 __pyx_string_tab[313] +#define __pyx_kp_b_iso88591_77JJeef_3a_Q_y_WAQ_q_4t1Kz_1_wb __pyx_string_tab[314] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_6a_A_L_gQ_waq_J __pyx_string_tab[315] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_6a_A_L_gQ_waq_J_2 __pyx_string_tab[316] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_WAT_1A_G4q_T_Qi __pyx_string_tab[317] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_a_L_WAQ_q_6_Bd_A __pyx_string_tab[318] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_1_3at_a_IV1_vR __pyx_string_tab[319] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4_B_5_1A_4q_L __pyx_string_tab[320] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4_B_5_1A_L_Cq __pyx_string_tab[321] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4_B_5_1A_Q_L_C __pyx_string_tab[322] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4q_t1_S_A_IV1 __pyx_string_tab[323] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_q_A_S_S_G4q_4_1I __pyx_string_tab[324] +#define __pyx_kp_b_iso88591_77JJeef_d_L_WAQ_q_6_6_7_F __pyx_string_tab[325] +#define __pyx_kp_b_iso88591_77JJeef_d_L_WAQ_q_6_A_6_7_F __pyx_string_tab[326] +#define __pyx_kp_b_iso88591_88XXY __pyx_string_tab[327] +#define __pyx_kp_b_iso88591_8_l_1 __pyx_string_tab[328] +#define __pyx_kp_b_iso88591_99LL___Q_L_y_q_c_1_q_1_4t1Ky_AQ __pyx_string_tab[329] +#define __pyx_kp_b_iso88591_A __pyx_string_tab[330] +#define __pyx_kp_b_iso88591_A_2 __pyx_string_tab[331] +#define __pyx_kp_b_iso88591_A_A_E_r_A_WA_WAQ_1_82Q_D_3d_M_HC __pyx_string_tab[332] +#define __pyx_kp_b_iso88591_A_HA __pyx_string_tab[333] +#define __pyx_kp_b_iso88591_A_a_L_Kt1Ja_3a_a_wl_fCq_q_L_q_A __pyx_string_tab[334] +#define __pyx_kp_b_iso88591_A_q_E_A_q __pyx_string_tab[335] +#define __pyx_kp_b_iso88591_A_q_L_Kt1Ja_vWA_6_A_1_AYa_1_A_9G __pyx_string_tab[336] +#define __pyx_kp_b_iso88591_E_HA_F_Ja __pyx_string_tab[337] +#define __pyx_kp_b_iso88591_L __pyx_string_tab[338] +#define __pyx_kp_b_iso88591_L_6a __pyx_string_tab[339] +#define __pyx_kp_b_iso88591_N_6a __pyx_string_tab[340] +#define __pyx_kp_b_iso88591_Q __pyx_string_tab[341] +#define __pyx_kp_b_iso88591_Q_2 __pyx_string_tab[342] +#define __pyx_kp_b_iso88591_Q_3 __pyx_string_tab[343] +#define __pyx_kp_b_iso88591_Q_4 __pyx_string_tab[344] +#define __pyx_kp_b_iso88591_U_A_IQ_M __pyx_string_tab[345] +#define __pyx_kp_b_iso88591_Zz_IQ_M __pyx_string_tab[346] +#define __pyx_kp_b_iso88591__3 __pyx_string_tab[347] +#define __pyx_kp_b_iso88591_a_N_L_A_1_3a_Cs_Rs_J_b_3c __pyx_string_tab[348] +#define __pyx_kp_b_iso88591_q_G4q_t3a_Qa_t1_3avS_4q_3a_Qb_E __pyx_string_tab[349] +#define __pyx_kp_b_iso88591_q_G4q_t3a_Qa_t1_3avS_Qb_E_4q_3a __pyx_string_tab[350] +#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) { @@ -4006,12 +3804,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 @@ -4064,13 +3856,22 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { 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<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<295; ++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<351; ++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 ### */ @@ -4084,12 +3885,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); @@ -4139,13 +3934,22 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void 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<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<295; ++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<351; ++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 ### */ @@ -4229,7 +4033,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, "__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, 11, __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) } @@ -4405,7 +4209,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, "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, 36, __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) } } @@ -4503,7 +4307,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * 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, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_variable = __pyx_t_3; __pyx_t_3 = 0; @@ -4549,7 +4353,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY #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_GetItemRefFast(__pyx_t_4, __pyx_t_1, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_1; } else { { @@ -4594,7 +4398,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY __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_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, 59, __pyx_L1_error) __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { @@ -4609,7 +4413,7 @@ 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; @@ -4633,7 +4437,7 @@ 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) __Pyx_GOTREF(__pyx_t_3); @@ -4701,7 +4505,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY __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; @@ -4866,7 +4670,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, "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, 64, __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) } @@ -4988,7 +4792,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( #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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -5159,7 +4963,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( #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_GetItemRefFast(__pyx_t_4, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -5225,7 +5029,7 @@ 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) @@ -5248,7 +5052,7 @@ 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) __Pyx_GOTREF(__pyx_t_1); @@ -5373,7 +5177,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( return __pyx_r; } -/* "constraint/constraints.py":126 +/* "constraint/constraints.py":133 * """ * * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< @@ -5400,7 +5204,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 @@ -5423,53 +5227,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, 133, __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, 133, __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, 133, __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, 133, __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, 133, __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, 133, __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, 133, __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, 133, __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, 133, __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, 133, __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, 133, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5490,33 +5296,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":142 * 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, 142, __pyx_L1_error) - /* "constraint/constraints.py":136 + /* "constraint/constraints.py":143 * """ * 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, 143, __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, 143, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":126 + /* "constraint/constraints.py":133 * """ * * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< @@ -5528,6 +5338,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:; @@ -5536,7 +5347,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init return __pyx_r; } -/* "constraint/constraints.py":138 +/* "constraint/constraints.py":145 * self._assigned = assigned * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -5555,36 +5366,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_4__defaults__(CYTHON_UNUSED __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - /* "constraint/constraints.py":143 + /* "constraint/constraints.py":150 * 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, 145, __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, 145, __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, 145, __pyx_L1_error); - /* "constraint/constraints.py":138 + /* "constraint/constraints.py":145 * 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, 145, __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, 145, __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, 145, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -5647,62 +5458,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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -5718,7 +5529,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, 145, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5729,8 +5540,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, 148, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 149, __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 */ @@ -5771,19 +5582,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":182 * * # 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, 182, __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":183 * # single loop list: 0.11462 seconds, Cythonized: 0.08686 seconds * parms = list() * missing = 0 # <<<<<<<<<<<<<< @@ -5793,7 +5604,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":184 * parms = list() * missing = 0 * for x in variables: # <<<<<<<<<<<<<< @@ -5805,9 +5616,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, 184, __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, 184, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -5815,17 +5626,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, 184, __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_GetItemRefFast(__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, 184, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5836,13 +5647,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, 184, __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, 184, __pyx_L1_error) PyErr_Clear(); } break; @@ -5852,29 +5663,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":185 * 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, 185, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":179 + /* "constraint/constraints.py":186 * 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, 186, __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, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":178 + /* "constraint/constraints.py":185 * missing = 0 * for x in variables: * if x in assignments: # <<<<<<<<<<<<<< @@ -5884,7 +5695,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal goto __pyx_L5; } - /* "constraint/constraints.py":181 + /* "constraint/constraints.py":188 * parms.append(assignments[x]) * else: * parms.append(_unassigned) # <<<<<<<<<<<<<< @@ -5892,23 +5703,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, 188, __pyx_L1_error) - /* "constraint/constraints.py":182 + /* "constraint/constraints.py":189 * 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, 189, __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":184 * parms = list() * missing = 0 * for x in variables: # <<<<<<<<<<<<<< @@ -5918,19 +5729,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":192 * * # 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, 192, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":186 + /* "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 ( # <<<<<<<<<<<<<< @@ -5938,23 +5749,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, 193, __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, 193, __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, 193, __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, 193, __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, 193, __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, 193, __pyx_L1_error) if (__pyx_t_5) { __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { @@ -5965,26 +5776,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal } __pyx_L9_next_and:; - /* "constraint/constraints.py":187 + /* "constraint/constraints.py":194 * 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, 194, __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, 194, __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, 194, __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, 194, __pyx_L1_error) if (!__pyx_t_9) { __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { @@ -5998,9 +5809,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, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_INCREF(__pyx_t_8); @@ -6011,7 +5822,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":185 + /* "constraint/constraints.py":192 * * # if there are unassigned variables, do a forward check before executing the restriction function * if missing > 0: # <<<<<<<<<<<<<< @@ -6020,7 +5831,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal */ } - /* "constraint/constraints.py":189 + /* "constraint/constraints.py":196 * not forwardcheck or missing != 1 or self.forwardCheck(variables, domains, assignments) * ) * return self._func(*parms) # <<<<<<<<<<<<<< @@ -6028,11 +5839,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, 196, __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, 196, __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, 196, __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; @@ -6040,7 +5851,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/constraints.py":138 + /* "constraint/constraints.py":145 * self._assigned = assigned * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -6065,7 +5876,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal return __pyx_r; } -/* "constraint/constraints.py":194 +/* "constraint/constraints.py":201 * """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 # <<<<<<<<<<<<<< @@ -6091,7 +5902,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 @@ -6114,53 +5925,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, 201, __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, 201, __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, 201, __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, 201, __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, 201, __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, 201, __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, 201, __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, 201, __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, 201, __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, 201, __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, 201, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6171,7 +5984,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, 201, __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 */ @@ -6191,33 +6004,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":202 * * 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, 202, __pyx_L1_error) - /* "constraint/constraints.py":196 + /* "constraint/constraints.py":203 * 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, 203, __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, 203, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":194 + /* "constraint/constraints.py":201 * """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 # <<<<<<<<<<<<<< @@ -6229,6 +6046,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("constraint.constraints.CompilableFunctionConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -6237,7 +6055,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra return __pyx_r; } -/* "constraint/constraints.py":198 +/* "constraint/constraints.py":205 * self._assigned = assigned * * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 # <<<<<<<<<<<<<< @@ -6255,21 +6073,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_6__defaults__(CYTHON_UNUSED 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_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __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); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)Py_False)) != (0)) __PYX_ERR(0, 205, __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) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(0, 205, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __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); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 205, __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); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 205, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -6332,62 +6150,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, 198, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 205, __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) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 205, __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) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 205, __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) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 205, __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) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 205, __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) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 205, __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) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 205, __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 (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 205, __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) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, i); __PYX_ERR(0, 205, __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) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 205, __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) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 205, __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) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 205, __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) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 205, __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) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 205, __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) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 205, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -6403,7 +6221,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, 198, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, __pyx_nargs); __PYX_ERR(0, 205, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6429,14 +6247,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra __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":199 + /* "constraint/constraints.py":206 * * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 * raise NotImplementedError("CompilableFunctionConstraint can not be called directly") # <<<<<<<<<<<<<< @@ -6444,22 +6261,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra * */ __pyx_t_2 = 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_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_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; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __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) + __PYX_ERR(0, 206, __pyx_L1_error) - /* "constraint/constraints.py":198 + /* "constraint/constraints.py":205 * self._assigned = assigned * * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 # <<<<<<<<<<<<<< @@ -6471,7 +6285,6 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra __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); @@ -6479,7 +6292,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra return __pyx_r; } -/* "constraint/constraints.py":213 +/* "constraint/constraints.py":220 * """ * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -6498,36 +6311,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_8__defaults__(CYTHON_UNUSED __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - /* "constraint/constraints.py":218 + /* "constraint/constraints.py":225 * 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, 220, __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, 220, __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); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(0, 220, __pyx_L1_error); - /* "constraint/constraints.py":213 + /* "constraint/constraints.py":220 * """ * * 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) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __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, 220, __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, 220, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -6590,62 +6403,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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -6661,7 +6474,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, 220, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6672,8 +6485,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, 223, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 224, __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 */ @@ -6718,19 +6531,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":221 + /* "constraint/constraints.py":228 * _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, 228, __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":229 * ): * seen = {} * for variable in variables: # <<<<<<<<<<<<<< @@ -6742,9 +6555,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, 229, __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, 229, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6752,17 +6565,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, 229, __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_GetItemRefFast(__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, 229, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6773,13 +6586,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, 229, __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, 229, __pyx_L1_error) PyErr_Clear(); } break; @@ -6789,19 +6602,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":230 * 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, 230, __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":231 * for variable in variables: * value = assignments.get(variable, _unassigned) * if value is not _unassigned: # <<<<<<<<<<<<<< @@ -6811,17 +6624,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":232 * 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, 232, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":226 + /* "constraint/constraints.py":233 * if value is not _unassigned: * if value in seen: * return False # <<<<<<<<<<<<<< @@ -6834,7 +6647,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":232 * value = assignments.get(variable, _unassigned) * if value is not _unassigned: * if value in seen: # <<<<<<<<<<<<<< @@ -6843,16 +6656,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ */ } - /* "constraint/constraints.py":227 + /* "constraint/constraints.py":234 * 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, 234, __pyx_L1_error) - /* "constraint/constraints.py":224 + /* "constraint/constraints.py":231 * for variable in variables: * value = assignments.get(variable, _unassigned) * if value is not _unassigned: # <<<<<<<<<<<<<< @@ -6861,7 +6674,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ */ } - /* "constraint/constraints.py":222 + /* "constraint/constraints.py":229 * ): * seen = {} * for variable in variables: # <<<<<<<<<<<<<< @@ -6871,17 +6684,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":228 + /* "constraint/constraints.py":235 * 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, 235, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":229 + /* "constraint/constraints.py":236 * seen[value] = True * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -6893,9 +6706,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, 236, __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, 236, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6903,17 +6716,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, 236, __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_GetItemRefFast(__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, 236, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6924,13 +6737,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, 236, __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, 236, __pyx_L1_error) PyErr_Clear(); } break; @@ -6940,29 +6753,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":237 * 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, 237, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":231 + /* "constraint/constraints.py":238 * 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, 238, __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":239 * if variable not in assignments: * domain = domains[variable] * for value in seen: # <<<<<<<<<<<<<< @@ -6970,7 +6783,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, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_9; @@ -6978,22 +6791,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, 239, __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":240 * 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, 240, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":234 + /* "constraint/constraints.py":241 * for value in seen: * if value in domain: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -7005,25 +6818,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, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":235 + /* "constraint/constraints.py":242 * 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, 242, __pyx_L1_error) __pyx_t_13 = (!__pyx_t_5); if (__pyx_t_13) { - /* "constraint/constraints.py":236 + /* "constraint/constraints.py":243 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -7037,7 +6850,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":242 * if value in domain: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -7046,7 +6859,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ */ } - /* "constraint/constraints.py":233 + /* "constraint/constraints.py":240 * domain = domains[variable] * for value in seen: * if value in domain: # <<<<<<<<<<<<<< @@ -7057,7 +6870,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":230 + /* "constraint/constraints.py":237 * if forwardcheck: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -7066,7 +6879,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ */ } - /* "constraint/constraints.py":229 + /* "constraint/constraints.py":236 * seen[value] = True * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -7076,7 +6889,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":228 + /* "constraint/constraints.py":235 * return False * seen[value] = True * if forwardcheck: # <<<<<<<<<<<<<< @@ -7085,7 +6898,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ */ } - /* "constraint/constraints.py":237 + /* "constraint/constraints.py":244 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -7097,7 +6910,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":213 + /* "constraint/constraints.py":220 * """ * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -7123,7 +6936,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ return __pyx_r; } -/* "constraint/constraints.py":251 +/* "constraint/constraints.py":258 * """ * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -7142,36 +6955,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_10__defaults__(CYTHON_UNUSE __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - /* "constraint/constraints.py":256 + /* "constraint/constraints.py":263 * 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, 258, __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, 258, __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, 258, __pyx_L1_error); - /* "constraint/constraints.py":251 + /* "constraint/constraints.py":258 * """ * * 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, 258, __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, 258, __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, 258, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -7234,62 +7047,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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -7305,7 +7118,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, 258, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7316,8 +7129,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, 261, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 262, __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 */ @@ -7360,7 +7173,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":259 + /* "constraint/constraints.py":266 * _unassigned=Unassigned, * ): * singlevalue = _unassigned # <<<<<<<<<<<<<< @@ -7370,7 +7183,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":267 * ): * singlevalue = _unassigned * for variable in variables: # <<<<<<<<<<<<<< @@ -7382,9 +7195,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, 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, 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, 267, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -7392,17 +7205,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, 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_GetItemRefFast(__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, 267, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -7413,13 +7226,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, 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, 260, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 267, __pyx_L1_error) PyErr_Clear(); } break; @@ -7429,19 +7242,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":268 * 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, 268, __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":269 * for variable in variables: * value = assignments.get(variable, _unassigned) * if singlevalue is _unassigned: # <<<<<<<<<<<<<< @@ -7451,7 +7264,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":270 * value = assignments.get(variable, _unassigned) * if singlevalue is _unassigned: * singlevalue = value # <<<<<<<<<<<<<< @@ -7461,7 +7274,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":269 * for variable in variables: * value = assignments.get(variable, _unassigned) * if singlevalue is _unassigned: # <<<<<<<<<<<<<< @@ -7471,7 +7284,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call goto __pyx_L5; } - /* "constraint/constraints.py":264 + /* "constraint/constraints.py":271 * if singlevalue is _unassigned: * singlevalue = value * elif value is not _unassigned and value != singlevalue: # <<<<<<<<<<<<<< @@ -7484,14 +7297,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, 271, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 271, __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":272 * singlevalue = value * elif value is not _unassigned and value != singlevalue: * return False # <<<<<<<<<<<<<< @@ -7504,7 +7317,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":271 * if singlevalue is _unassigned: * singlevalue = value * elif value is not _unassigned and value != singlevalue: # <<<<<<<<<<<<<< @@ -7514,7 +7327,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } __pyx_L5:; - /* "constraint/constraints.py":260 + /* "constraint/constraints.py":267 * ): * singlevalue = _unassigned * for variable in variables: # <<<<<<<<<<<<<< @@ -7524,14 +7337,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":273 * 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, 273, __pyx_L1_error) if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; @@ -7542,7 +7355,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":274 * return False * if forwardcheck and singlevalue is not _unassigned: * for variable in variables: # <<<<<<<<<<<<<< @@ -7554,9 +7367,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, 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, 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, 274, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -7564,17 +7377,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, 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_GetItemRefFast(__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, 274, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -7585,13 +7398,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, 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, 267, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 274, __pyx_L1_error) PyErr_Clear(); } break; @@ -7601,39 +7414,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":275 * 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, 275, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":269 + /* "constraint/constraints.py":276 * 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, 276, __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":277 * 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, 277, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":271 + /* "constraint/constraints.py":278 * domain = domains[variable] * if singlevalue not in domain: * return False # <<<<<<<<<<<<<< @@ -7646,7 +7459,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":277 * if variable not in assignments: * domain = domains[variable] * if singlevalue not in domain: # <<<<<<<<<<<<<< @@ -7655,23 +7468,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call */ } - /* "constraint/constraints.py":272 + /* "constraint/constraints.py":279 * 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, 279, __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, 279, __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, 279, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -7680,17 +7493,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, 279, __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_GetItemRefFast(__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, 279, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -7701,13 +7514,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, 279, __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, 279, __pyx_L1_error) PyErr_Clear(); } break; @@ -7717,19 +7530,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":280 * 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, 280, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":274 + /* "constraint/constraints.py":281 * for value in domain[:]: * if value != singlevalue: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -7741,14 +7554,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, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":273 + /* "constraint/constraints.py":280 * return False * for value in domain[:]: * if value != singlevalue: # <<<<<<<<<<<<<< @@ -7757,7 +7570,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call */ } - /* "constraint/constraints.py":272 + /* "constraint/constraints.py":279 * if singlevalue not in domain: * return False * for value in domain[:]: # <<<<<<<<<<<<<< @@ -7767,7 +7580,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":275 * if forwardcheck and singlevalue is not _unassigned: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -7776,7 +7589,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call */ } - /* "constraint/constraints.py":267 + /* "constraint/constraints.py":274 * return False * if forwardcheck and singlevalue is not _unassigned: * for variable in variables: # <<<<<<<<<<<<<< @@ -7786,7 +7599,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":273 * elif value is not _unassigned and value != singlevalue: * return False * if forwardcheck and singlevalue is not _unassigned: # <<<<<<<<<<<<<< @@ -7795,7 +7608,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call */ } - /* "constraint/constraints.py":275 + /* "constraint/constraints.py":282 * if value != singlevalue: * domain.hideValue(value) * return True # <<<<<<<<<<<<<< @@ -7807,7 +7620,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":251 + /* "constraint/constraints.py":258 * """ * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -7833,7 +7646,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call return __pyx_r; } -/* "constraint/constraints.py":294 +/* "constraint/constraints.py":301 * """ * * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -7883,41 +7696,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, 294, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 301, __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, 294, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 301, __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, 294, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 301, __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, 294, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 301, __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, 294, __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, 301, __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, 294, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 301, __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, 294, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 301, __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, 294, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 301, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 294, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 301, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -7929,7 +7742,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, 294, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 301, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7959,61 +7772,61 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint___init int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":303 + /* "constraint/constraints.py":310 * 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, 303, __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, 310, __pyx_L1_error) - /* "constraint/constraints.py":304 + /* "constraint/constraints.py":311 * """ * 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, 304, __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, 311, __pyx_L1_error) - /* "constraint/constraints.py":305 + /* "constraint/constraints.py":312 * 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, 305, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __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, 305, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max, __pyx_t_1) < (0)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":306 + /* "constraint/constraints.py":313 * 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, 306, __pyx_L1_error) + __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_min, __pyx_t_1) < 0) __PYX_ERR(0, 306, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min, __pyx_t_1) < (0)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":307 + /* "constraint/constraints.py":314 * self._var_max = {} * self._var_min = {} * self._var_is_negative = {} # <<<<<<<<<<<<<< * * 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, 307, __pyx_L1_error) + __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_is_negative, __pyx_t_1) < 0) __PYX_ERR(0, 307, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_is_negative, __pyx_t_1) < (0)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":294 + /* "constraint/constraints.py":301 * """ * * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -8034,7 +7847,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint___init return __pyx_r; } -/* "constraint/constraints.py":309 +/* "constraint/constraints.py":316 * self._var_is_negative = {} * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -8085,50 +7898,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, 309, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 316, __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, 309, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 316, __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, 309, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 316, __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, 309, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 316, __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, 309, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 316, __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, 309, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 316, __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, 309, __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, 316, __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, 309, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 316, __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, 309, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 316, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 309, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 316, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 309, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 316, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 309, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 316, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 309, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 316, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -8138,7 +7951,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, 309, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 316, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -8149,9 +7962,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, 309, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 309, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 309, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 316, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 316, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 316, __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 */ @@ -8209,7 +8022,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":310 + /* "constraint/constraints.py":317 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -8217,9 +8030,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * 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, 310, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __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, 310, __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, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -8236,39 +8049,39 @@ 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, 310, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":311 + /* "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 if self._multipliers else [1] * len(variables) # <<<<<<<<<<<<<< * exactsum = self._exactsum * 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, 311, __pyx_L1_error) + __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, 318, __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, 311, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 318, __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, 311, __pyx_L1_error) + __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, 318, __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, 311, __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, 311, __pyx_L1_error) + __pyx_t_7 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 318, __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, 318, __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, 311, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 318, __pyx_L1_error); } } __pyx_t_1 = __pyx_t_4; @@ -8277,19 +8090,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":312 + /* "constraint/constraints.py":319 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * multipliers = self._multipliers if self._multipliers else [1] * len(variables) * exactsum = self._exactsum # <<<<<<<<<<<<<< * 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, 312, __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, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_exactsum = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":313 + /* "constraint/constraints.py":320 * multipliers = self._multipliers if self._multipliers else [1] * len(variables) * exactsum = self._exactsum * self._var_min = { variable: min(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 # <<<<<<<<<<<<<< @@ -8297,64 +8110,61 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * */ { /* enter inner scope */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L5_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_3 = __pyx_builtin_zip; __pyx_t_5 = 1; { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_variables, __pyx_v_multipliers}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L5_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L5_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_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L5_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, 313, __pyx_L5_error) + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 320, __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, 320, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_2))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + 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, 313, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 320, __pyx_L5_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_7); + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + 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, 313, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 320, __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_3, __pyx_t_7)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L5_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L5_error) } else { - __pyx_t_4 = __pyx_t_8(__pyx_t_3); + __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, 313, __pyx_L5_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 320, __pyx_L5_error) PyErr_Clear(); } break; @@ -8367,40 +8177,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 313, __pyx_L5_error) + __PYX_ERR(0, 320, __pyx_L5_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_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_2 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L5_error) - __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 313, __pyx_L5_error) + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __pyx_L5_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 320, __pyx_L5_error) __Pyx_XGOTREF(__pyx_t_9); } #else - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 313, __pyx_L5_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 320, __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, 313, __pyx_L5_error) + __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 320, __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_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); + 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, 313, __pyx_L5_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 320, __pyx_L5_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L9_unpacking_done; @@ -8408,35 +8218,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 313, __pyx_L5_error) + __PYX_ERR(0, 320, __pyx_L5_error) __pyx_L9_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_variable, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_variable, __pyx_t_3); + __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_multiplier, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_2 = __pyx_builtin_min; - __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_7genexpr__pyx_v_variable); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 313, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_7genexpr__pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_10}; - __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)); + 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_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); } - __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_7genexpr__pyx_v_multiplier); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_7genexpr__pyx_v_multiplier); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __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_2))) __PYX_ERR(0, 313, __pyx_L5_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_variable, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 320, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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; @@ -8446,10 +8253,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr 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, 313, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min, __pyx_t_1) < (0)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":314 + /* "constraint/constraints.py":321 * exactsum = self._exactsum * 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 # <<<<<<<<<<<<<< @@ -8457,146 +8264,140 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * # preprocess the domains to remove values that cannot contribute to the exact sum */ { /* enter inner scope */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L14_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_4 = __pyx_builtin_zip; + __pyx_t_3 = NULL; __pyx_t_5 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_variables, __pyx_v_multipliers}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __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; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L14_error) - __Pyx_GOTREF(__pyx_t_3); + 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, 321, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_2); } - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); + 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_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L14_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, 314, __pyx_L14_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __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, 321, __pyx_L14_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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, 314, __pyx_L14_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 321, __pyx_L14_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_7); + __pyx_t_2 = __Pyx_PyList_GetItemRefFast(__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, 314, __pyx_L14_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 321, __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_4, __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_4, __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, 314, __pyx_L14_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L14_error) } else { - __pyx_t_3 = __pyx_t_8(__pyx_t_4); - 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, 314, __pyx_L14_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 321, __pyx_L14_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; + __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, 314, __pyx_L14_error) + __PYX_ERR(0, 321, __pyx_L14_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_10 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_10); + __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_2 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L14_error) - __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 314, __pyx_L14_error) - __Pyx_XGOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L14_error) + __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 321, __pyx_L14_error) + __Pyx_XGOTREF(__pyx_t_9); } #else - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L14_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 314, __pyx_L14_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 321, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_9); #endif - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 314, __pyx_L14_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); - index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L17_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_10 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_10)) goto __pyx_L17_unpacking_failed; + __pyx_t_10 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 321, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 2) < 0) __PYX_ERR(0, 314, __pyx_L14_error) + __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); + 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, 321, __pyx_L14_error) __pyx_t_11 = NULL; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L18_unpacking_done; __pyx_L17_unpacking_failed:; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 314, __pyx_L14_error) + __PYX_ERR(0, 321, __pyx_L14_error) __pyx_L18_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_variable, __pyx_t_2); - __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_multiplier, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_2 = __pyx_builtin_max; - __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr1__pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 314, __pyx_L14_error) - __Pyx_GOTREF(__pyx_t_9); + __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, 321, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_9}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __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_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L14_error) - __Pyx_GOTREF(__pyx_t_3); + 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, 321, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_8genexpr1__pyx_v_multiplier); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L14_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_8genexpr1__pyx_v_variable, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 314, __pyx_L14_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_8genexpr1__pyx_v_multiplier); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __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, 321, __pyx_L14_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __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; @@ -8606,72 +8407,69 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr 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, 314, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max, __pyx_t_1) < (0)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":317 + /* "constraint/constraints.py":324 * * # 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_4 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_2 = __pyx_builtin_zip; + __pyx_t_3 = 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, 317, __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_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, 324, __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 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __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, 317, __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, 317, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __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, 324, __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))) { + 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, 317, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 324, __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_GetItemRefFast(__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, 317, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 324, __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)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_8(__pyx_t_2); + __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, 317, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 324, __pyx_L1_error) PyErr_Clear(); } break; @@ -8684,40 +8482,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 317, __pyx_L1_error) + __PYX_ERR(0, 324, __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_3 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __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, 317, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __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, 317, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 324, __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_3 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L23_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 2) < 0) __PYX_ERR(0, 317, __pyx_L1_error) + 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, 324, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L24_unpacking_done; @@ -8725,63 +8523,63 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 317, __pyx_L1_error) + __PYX_ERR(0, 324, __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_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/constraints.py":318 + /* "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) * 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, 318, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":319 + /* "constraint/constraints.py":326 * 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_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sum_other_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error) + __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, 326, __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, 319, __pyx_L1_error) + __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, 326, __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_3 = PyMethod_GET_SELF(__pyx_t_4); - assert(__pyx_t_3); + __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_3); + __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_3, __pyx_v_variables, __pyx_v_variable, __pyx_t_9}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + 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, 319, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __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":320 + /* "constraint/constraints.py":327 * 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) # <<<<<<<<<<<<<< @@ -8789,10 +8587,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * 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, 320, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_sum_other_vars); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __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, 320, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __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, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { @@ -8806,34 +8604,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_variables, __pyx_v_variable, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + 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_3); __pyx_t_3 = 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, 320, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __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":321 + /* "constraint/constraints.py":328 * 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_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, 321, __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, 328, __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, 321, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 328, __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, 321, __pyx_L1_error) + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 328, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -8842,17 +8640,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 321, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 328, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_12); + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__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, 321, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 328, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -8863,13 +8661,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __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, 321, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 328, __pyx_L1_error) PyErr_Clear(); } break; @@ -8879,44 +8677,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":322 + /* "constraint/constraints.py":329 * 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, 322, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_v_other_vars_min); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_other_vars_min); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 322, __pyx_L1_error) + __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, 329, __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, 329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "constraint/constraints.py":323 + /* "constraint/constraints.py":330 * 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_3 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_2); __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, 323, __pyx_L1_error) + 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, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":322 + /* "constraint/constraints.py":329 * other_vars_max = sum_other_vars(variables, variable, self._var_max) * for value in domain[:]: * if value * multiplier + other_vars_min > exactsum: # <<<<<<<<<<<<<< @@ -8925,44 +8723,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr */ } - /* "constraint/constraints.py":324 + /* "constraint/constraints.py":331 * 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, 324, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_v_other_vars_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_other_vars_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_exactsum, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 324, __pyx_L1_error) + __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, 331, __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, 331, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "constraint/constraints.py":325 + /* "constraint/constraints.py":332 * domain.remove(value) * if value * multiplier + other_vars_max < exactsum: * domain.remove(value) # <<<<<<<<<<<<<< * * # recalculate the min and max after pruning */ - __pyx_t_3 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_2); __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, 325, __pyx_L1_error) + 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, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":324 + /* "constraint/constraints.py":331 * if value * multiplier + other_vars_min > exactsum: * domain.remove(value) * if value * multiplier + other_vars_max < exactsum: # <<<<<<<<<<<<<< @@ -8971,7 +8769,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr */ } - /* "constraint/constraints.py":321 + /* "constraint/constraints.py":328 * 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[:]: # <<<<<<<<<<<<<< @@ -8981,7 +8779,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":317 + /* "constraint/constraints.py":324 * * # preprocess the domains to remove values that cannot contribute to the exact sum * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -8989,74 +8787,71 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * other_vars_min = sum_other_vars(variables, variable, self._var_min) */ } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":328 + /* "constraint/constraints.py":335 * * # recalculate the min and max after pruning - * self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 # <<<<<<<<<<<<<< - * 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 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_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L33_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 335, __pyx_L33_error) + __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_3 = __pyx_builtin_zip; __pyx_t_5 = 1; { PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_variables, __pyx_v_multipliers}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 328, __pyx_L33_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 335, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_9); } if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) { - __pyx_t_3 = __pyx_t_9; __Pyx_INCREF(__pyx_t_3); + __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_3 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L33_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, 328, __pyx_L33_error) + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __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, 335, __pyx_L33_error) } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; for (;;) { if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + 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, 328, __pyx_L33_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 335, __pyx_L33_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_9 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_7); + __pyx_t_9 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + 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, 328, __pyx_L33_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 335, __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_3, __pyx_t_7)); + __pyx_t_9 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7)); #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); + __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 328, __pyx_L33_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 335, __pyx_L33_error) } else { - __pyx_t_9 = __pyx_t_8(__pyx_t_3); + __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, 328, __pyx_L33_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 335, __pyx_L33_error) PyErr_Clear(); } break; @@ -9069,40 +8864,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 328, __pyx_L33_error) + __PYX_ERR(0, 335, __pyx_L33_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_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_1 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L33_error) - __Pyx_XGOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L33_error) + __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L33_error) + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L33_error) __Pyx_XGOTREF(__pyx_t_4); } #else - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L33_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L33_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L33_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __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, 328, __pyx_L33_error) + __pyx_t_10 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 335, __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_1 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_1)) goto __pyx_L36_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); + 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, 328, __pyx_L33_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 335, __pyx_L33_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L37_unpacking_done; @@ -9110,35 +8905,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 328, __pyx_L33_error) + __PYX_ERR(0, 335, __pyx_L33_error) __pyx_L37_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_variable, __pyx_t_1); - __pyx_t_1 = 0; + __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 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_1 = __pyx_builtin_max; - __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr2__pyx_v_variable); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 328, __pyx_L33_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = 1; - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_10}; - __pyx_t_9 = __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_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 328, __pyx_L33_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr2__pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __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, 335, __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, 335, __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, 335, __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, 335, __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; } - __pyx_t_1 = PyNumber_Multiply(__pyx_t_9, __pyx_8genexpr2__pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L33_error) - __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr2__pyx_v_variable, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 335, __pyx_L33_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_8genexpr2__pyx_v_variable, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 328, __pyx_L33_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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; @@ -9148,154 +8952,160 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr 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_2) < 0) __PYX_ERR(0, 328, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max, __pyx_t_3) < (0)) __PYX_ERR(0, 335, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":329 + /* "constraint/constraints.py":336 * # recalculate the min and max after pruning - * self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 - * 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 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_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L42_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_9 = __pyx_builtin_zip; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = NULL; __pyx_t_5 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_variables, __pyx_v_multipliers}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __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_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L42_error) - __Pyx_GOTREF(__pyx_t_3); + 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, 336, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_1); } - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_9 = __pyx_t_3; __Pyx_INCREF(__pyx_t_9); + 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_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 329, __pyx_L42_error) + __pyx_t_7 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 336, __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, 329, __pyx_L42_error) + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 336, __pyx_L42_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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, 329, __pyx_L42_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 336, __pyx_L42_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_7); + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__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, 329, __pyx_L42_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 336, __pyx_L42_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_9, __pyx_t_7)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_7)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_7); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_7); #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L42_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L42_error) } else { - __pyx_t_3 = __pyx_t_8(__pyx_t_9); - if (unlikely(!__pyx_t_3)) { + __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, 329, __pyx_L42_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 336, __pyx_L42_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; + __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, 329, __pyx_L42_error) + __PYX_ERR(0, 336, __pyx_L42_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_10 = PyTuple_GET_ITEM(sequence, 1); + __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_1 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L42_error) - __Pyx_XGOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 329, __pyx_L42_error) + __pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 336, __pyx_L42_error) __Pyx_XGOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L42_error) + __Pyx_XGOTREF(__pyx_t_4); } #else - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L42_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 329, __pyx_L42_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 336, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_4); #endif - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 329, __pyx_L42_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); - index = 0; __pyx_t_1 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L45_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - index = 1; __pyx_t_10 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_10)) goto __pyx_L45_unpacking_failed; + __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __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); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_4), 2) < 0) __PYX_ERR(0, 329, __pyx_L42_error) + 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, 336, __pyx_L42_error) __pyx_t_11 = NULL; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L46_unpacking_done; __pyx_L45_unpacking_failed:; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 329, __pyx_L42_error) + __PYX_ERR(0, 336, __pyx_L42_error) __pyx_L46_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_variable, __pyx_t_1); - __pyx_t_1 = 0; - __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_multiplier, __pyx_t_10); + __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_variable, __pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_1 = __pyx_builtin_min; - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr3__pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 329, __pyx_L42_error) + __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, 336, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = 1; - { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_4}; - __pyx_t_3 = __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_10); __pyx_t_10 = 0; + __pyx_t_12 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 336, __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, 336, __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, 336, __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, 336, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L42_error) - __Pyx_GOTREF(__pyx_t_3); + __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; } - __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_8genexpr3__pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L42_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_8genexpr3__pyx_v_variable, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 329, __pyx_L42_error) + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr3__pyx_v_variable, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 336, __pyx_L42_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -9308,27 +9118,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr 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_2) < 0) __PYX_ERR(0, 329, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min, __pyx_t_3) < (0)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":330 - * self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 - * self._var_min = { variable: min(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + /* "constraint/constraints.py":337 + * 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_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L51_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __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, 330, __pyx_L51_error) + __pyx_t_7 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 337, __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, 330, __pyx_L51_error) + __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_L51_error) } for (;;) { if (likely(!__pyx_t_8)) { @@ -9336,17 +9146,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 330, __pyx_L51_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 337, __pyx_L51_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_7); + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__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, 330, __pyx_L51_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 337, __pyx_L51_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -9357,13 +9167,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L51_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __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, 330, __pyx_L51_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 337, __pyx_L51_error) PyErr_Clear(); } break; @@ -9372,14 +9182,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 330, __pyx_L51_error) + __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, 337, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_8genexpr4__pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 330, __pyx_L51_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_8genexpr4__pyx_v_variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L51_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L51_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_8genexpr4__pyx_v_variable, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 330, __pyx_L51_error) + __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, 337, __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, 337, __pyx_L51_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -9390,10 +9200,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr 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_2) < 0) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_is_negative, __pyx_t_3) < (0)) __PYX_ERR(0, 337, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":309 + /* "constraint/constraints.py":316 * self._var_is_negative = {} * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -9436,7 +9246,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr return __pyx_r; } -/* "constraint/constraints.py":332 +/* "constraint/constraints.py":339 * 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 # <<<<<<<<<<<<<< @@ -9487,53 +9297,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, 332, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 339, __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, 332, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 339, __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, 332, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 339, __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, 332, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 339, __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, 332, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 339, __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, 332, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 339, __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, 332, __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, 339, __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, 332, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 339, __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, 332, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 339, __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, 332, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 339, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 332, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 339, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 332, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 339, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 332, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 339, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -9547,7 +9357,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, 332, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 339, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9558,8 +9368,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, 332, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 332, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 339, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 339, __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 */ @@ -9596,10 +9406,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 *); @@ -9611,31 +9421,31 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":333 + /* "constraint/constraints.py":340 * * 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, 333, __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, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":334 + /* "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 * 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, 334, __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, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_exactsum = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":335 + /* "constraint/constraints.py":342 * multipliers = self._multipliers * exactsum = self._exactsum * sum = 0 # <<<<<<<<<<<<<< @@ -9645,7 +9455,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":336 + /* "constraint/constraints.py":343 * exactsum = self._exactsum * sum = 0 * min_sum_missing = 0 # <<<<<<<<<<<<<< @@ -9655,7 +9465,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_min_sum_missing = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":337 + /* "constraint/constraints.py":344 * sum = 0 * min_sum_missing = 0 * max_sum_missing = 0 # <<<<<<<<<<<<<< @@ -9665,7 +9475,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_max_sum_missing = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":338 + /* "constraint/constraints.py":345 * min_sum_missing = 0 * max_sum_missing = 0 * missing = False # <<<<<<<<<<<<<< @@ -9674,7 +9484,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ __pyx_v_missing = 0; - /* "constraint/constraints.py":339 + /* "constraint/constraints.py":346 * max_sum_missing = 0 * missing = False * missing_negative = False # <<<<<<<<<<<<<< @@ -9683,17 +9493,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ __pyx_v_missing_negative = 0; - /* "constraint/constraints.py":340 + /* "constraint/constraints.py":347 * 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, 340, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 347, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":341 + /* "constraint/constraints.py":348 * missing_negative = False * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -9701,61 +9511,58 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * 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, 341, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __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, 341, __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, 341, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __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, 348, __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, 341, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 348, __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_GetItemRefFast(__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, 341, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 348, __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, 341, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __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, 341, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 348, __pyx_L1_error) PyErr_Clear(); } break; @@ -9768,40 +9575,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, 341, __pyx_L1_error) + __PYX_ERR(0, 348, __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, 341, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 348, __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, 341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 348, __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, 341, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 348, __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, 341, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 348, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; @@ -9809,43 +9616,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, 341, __pyx_L1_error) + __PYX_ERR(0, 348, __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":342 + /* "constraint/constraints.py":349 * 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, 342, __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, 349, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":343 + /* "constraint/constraints.py":350 * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< * 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, 343, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __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, 343, __pyx_L1_error) + __pyx_t_8 = PyNumber_Multiply(__pyx_t_1, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 350, __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, 343, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __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":342 + /* "constraint/constraints.py":349 * if multipliers: * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: # <<<<<<<<<<<<<< @@ -9855,7 +9662,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal goto __pyx_L8; } - /* "constraint/constraints.py":345 + /* "constraint/constraints.py":352 * sum += assignments[variable] * multiplier * else: * min_sum_missing += self._var_min[variable] # <<<<<<<<<<<<<< @@ -9863,36 +9670,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * 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, 345, __pyx_L1_error) + __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, 352, __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, 345, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 352, __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, 345, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_min_sum_missing, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __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":346 + /* "constraint/constraints.py":353 * 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, 346, __pyx_L1_error) + __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, 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, 346, __pyx_L1_error) + __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_max_sum_missing, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_max_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_max_sum_missing, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":347 + /* "constraint/constraints.py":354 * min_sum_missing += self._var_min[variable] * max_sum_missing += self._var_max[variable] * missing = True # <<<<<<<<<<<<<< @@ -9901,23 +9708,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ __pyx_v_missing = 1; - /* "constraint/constraints.py":348 + /* "constraint/constraints.py":355 * 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, 348, __pyx_L1_error) + __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, 355, __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, 348, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 355, __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, 348, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":349 + /* "constraint/constraints.py":356 * missing = True * if self._var_is_negative[variable]: * missing_negative = True # <<<<<<<<<<<<<< @@ -9926,7 +9733,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ __pyx_v_missing_negative = 1; - /* "constraint/constraints.py":348 + /* "constraint/constraints.py":355 * max_sum_missing += self._var_max[variable] * missing = True * if self._var_is_negative[variable]: # <<<<<<<<<<<<<< @@ -9937,7 +9744,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __pyx_L8:; - /* "constraint/constraints.py":341 + /* "constraint/constraints.py":348 * missing_negative = False * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -9945,9 +9752,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * 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":350 + /* "constraint/constraints.py":357 * if self._var_is_negative[variable]: * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -9957,7 +9764,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_t_2 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_2) { - /* "constraint/constraints.py":351 + /* "constraint/constraints.py":358 * missing_negative = True * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< @@ -9965,21 +9772,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * return False */ __pyx_t_8 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_1 = __pyx_builtin_round; - __pyx_t_5 = 1; + __pyx_t_4 = 1; { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_sum, __pyx_mstate_global->__pyx_int_10}; - __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_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_4)) __PYX_ERR(0, 351, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __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":350 + /* "constraint/constraints.py":357 * if self._var_is_negative[variable]: * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -9988,35 +9792,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":352 + /* "constraint/constraints.py":359 * if isinstance(sum, float): * sum = round(sum, 10) * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: # <<<<<<<<<<<<<< * return False * if forwardcheck and missing and not missing_negative: */ - __pyx_t_4 = PyNumber_Add(__pyx_v_sum, __pyx_v_min_sum_missing); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 352, __pyx_L1_error) - __Pyx_DECREF(__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, 359, __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, 359, __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, 359, __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_1 = PyNumber_Add(__pyx_v_sum, __pyx_v_max_sum_missing); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_v_exactsum, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 352, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_v_sum, __pyx_v_max_sum_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 359, __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, 359, __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, 359, __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":353 + /* "constraint/constraints.py":360 * sum = round(sum, 10) * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: * return False # <<<<<<<<<<<<<< @@ -10028,7 +9832,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":352 + /* "constraint/constraints.py":359 * if isinstance(sum, float): * sum = round(sum, 10) * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: # <<<<<<<<<<<<<< @@ -10037,14 +9841,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":354 + /* "constraint/constraints.py":361 * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: * return False * 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, 354, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 361, __pyx_L1_error) if (__pyx_t_11) { } else { __pyx_t_2 = __pyx_t_11; @@ -10060,115 +9864,112 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_L16_bool_binop_done:; if (__pyx_t_2) { - /* "constraint/constraints.py":355 + /* "constraint/constraints.py":362 * return False * 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_1 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_8 = __pyx_builtin_zip; - __pyx_t_5 = 1; + __pyx_t_8 = NULL; + __pyx_t_4 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_variables, __pyx_v_multipliers}; - __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, 355, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_variables, __pyx_v_multipliers}; + __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; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_8 = __pyx_t_4; __Pyx_INCREF(__pyx_t_8); - __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_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 362, __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(!__pyx_t_6)) { 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, 355, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 362, __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_8, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_8, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_5; } 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, 355, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 362, __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_8, __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_8, __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, 355, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_7(__pyx_t_8); - 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, 355, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 362, __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, 355, __pyx_L1_error) + __PYX_ERR(0, 362, __pyx_L1_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_3 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_7); } else { - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 362, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); } #else - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 362, __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, 355, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 362, __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_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_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 355, __pyx_L1_error) + 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, 362, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L22_unpacking_done; @@ -10176,117 +9977,117 @@ 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, 355, __pyx_L1_error) + __PYX_ERR(0, 362, __pyx_L1_error) __pyx_L22_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/constraints.py":356 + /* "constraint/constraints.py":363 * 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, 356, __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, 363, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":357 + /* "constraint/constraints.py":364 * 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, 357, __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, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":358 + /* "constraint/constraints.py":365 * 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, 358, __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, 365, __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, 358, __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, 358, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 365, __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, 365, __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, 358, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 365, __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_GetItemRefFast(__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, 358, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 365, __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, 358, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __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, 358, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 365, __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":359 + /* "constraint/constraints.py":366 * 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, 359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_Add(__pyx_v_sum, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __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, 366, __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_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L1_error) + __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, 366, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 359, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 366, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":360 + /* "constraint/constraints.py":367 * for value in domain[:]: * if sum + value * multiplier > exactsum: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -10295,17 +10096,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ __pyx_t_1 = __pyx_v_domain; __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = 0; + __pyx_t_4 = 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_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_4)) __PYX_ERR(0, 360, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 367, __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":359 + /* "constraint/constraints.py":366 * domain = domains[variable] * for value in domain[:]: * if sum + value * multiplier > exactsum: # <<<<<<<<<<<<<< @@ -10314,7 +10115,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":358 + /* "constraint/constraints.py":365 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -10322,20 +10123,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":361 + /* "constraint/constraints.py":368 * 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, 361, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 368, __pyx_L1_error) __pyx_t_11 = (!__pyx_t_2); if (__pyx_t_11) { - /* "constraint/constraints.py":362 + /* "constraint/constraints.py":369 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -10348,7 +10149,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L0; - /* "constraint/constraints.py":361 + /* "constraint/constraints.py":368 * if sum + value * multiplier > exactsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -10357,7 +10158,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":356 + /* "constraint/constraints.py":363 * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: # <<<<<<<<<<<<<< @@ -10366,7 +10167,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":355 + /* "constraint/constraints.py":362 * return False * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -10376,7 +10177,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":354 + /* "constraint/constraints.py":361 * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: * return False * if forwardcheck and missing and not missing_negative: # <<<<<<<<<<<<<< @@ -10385,7 +10186,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":340 + /* "constraint/constraints.py":347 * missing = False * missing_negative = False * if multipliers: # <<<<<<<<<<<<<< @@ -10395,7 +10196,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal goto __pyx_L3; } - /* "constraint/constraints.py":364 + /* "constraint/constraints.py":371 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -10405,82 +10206,82 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal /*else*/ { if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_8 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_8); - __pyx_t_6 = 0; - __pyx_t_7 = NULL; + __pyx_t_5 = 0; + __pyx_t_6 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 371, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_7)) { + if (likely(!__pyx_t_6)) { 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, 364, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 371, __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_8, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_8, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_5; } 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, 364, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 371, __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_8, __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_8, __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, 364, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 371, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_7(__pyx_t_8); - 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, 364, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 371, __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":365 + /* "constraint/constraints.py":372 * 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, 365, __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, 372, __pyx_L1_error) if (__pyx_t_11) { - /* "constraint/constraints.py":366 + /* "constraint/constraints.py":373 * for variable in variables: * if variable in assignments: * sum += assignments[variable] # <<<<<<<<<<<<<< * 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, 366, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 373, __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, 373, __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, 366, __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":365 + /* "constraint/constraints.py":372 * else: * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -10490,7 +10291,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal goto __pyx_L32; } - /* "constraint/constraints.py":368 + /* "constraint/constraints.py":375 * sum += assignments[variable] * else: * min_sum_missing += self._var_min[variable] # <<<<<<<<<<<<<< @@ -10498,36 +10299,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * missing = True */ /*else*/ { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __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, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_min_sum_missing, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 375, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_min_sum_missing, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_min_sum_missing, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 375, __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":369 + /* "constraint/constraints.py":376 * 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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 369, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error) + __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, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_max_sum_missing, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 369, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __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_DECREF_SET(__pyx_v_max_sum_missing, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_max_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_max_sum_missing, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":370 + /* "constraint/constraints.py":377 * min_sum_missing += self._var_min[variable] * max_sum_missing += self._var_max[variable] * missing = True # <<<<<<<<<<<<<< @@ -10536,23 +10337,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ __pyx_v_missing = 1; - /* "constraint/constraints.py":371 + /* "constraint/constraints.py":378 * max_sum_missing += self._var_max[variable] * missing = True * if self._var_is_negative[variable]: # <<<<<<<<<<<<<< * missing_negative = True * if isinstance(sum, float): */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_is_negative); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error) + __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, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 371, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 378, __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, 378, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_11) { - /* "constraint/constraints.py":372 + /* "constraint/constraints.py":379 * missing = True * if self._var_is_negative[variable]: * missing_negative = True # <<<<<<<<<<<<<< @@ -10561,7 +10362,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ __pyx_v_missing_negative = 1; - /* "constraint/constraints.py":371 + /* "constraint/constraints.py":378 * max_sum_missing += self._var_max[variable] * missing = True * if self._var_is_negative[variable]: # <<<<<<<<<<<<<< @@ -10572,7 +10373,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __pyx_L32:; - /* "constraint/constraints.py":364 + /* "constraint/constraints.py":371 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -10582,7 +10383,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":373 + /* "constraint/constraints.py":380 * if self._var_is_negative[variable]: * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -10592,29 +10393,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_t_11 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_11) { - /* "constraint/constraints.py":374 + /* "constraint/constraints.py":381 * missing_negative = True * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: * return False */ - __pyx_t_3 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_4 = __pyx_builtin_round; - __pyx_t_5 = 1; + __pyx_t_7 = NULL; + __pyx_t_4 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_sum, __pyx_mstate_global->__pyx_int_10}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_4, __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; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 374, __pyx_L1_error) + 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, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":373 + /* "constraint/constraints.py":380 * if self._var_is_negative[variable]: * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -10623,35 +10421,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":375 + /* "constraint/constraints.py":382 * if isinstance(sum, float): * sum = round(sum, 10) * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: # <<<<<<<<<<<<<< * return False * if forwardcheck and missing and not missing_negative: */ - __pyx_t_8 = PyNumber_Add(__pyx_v_sum, __pyx_v_min_sum_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_8 = PyNumber_Add(__pyx_v_sum, __pyx_v_min_sum_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __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, 375, __pyx_L1_error) + __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, 382, __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, 375, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 382, __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_4 = PyNumber_Add(__pyx_v_sum, __pyx_v_max_sum_missing); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyObject_RichCompare(__pyx_t_4, __pyx_v_exactsum, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 375, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_v_sum, __pyx_v_max_sum_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 382, __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, 382, __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, 382, __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":376 + /* "constraint/constraints.py":383 * sum = round(sum, 10) * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: * return False # <<<<<<<<<<<<<< @@ -10663,7 +10461,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":375 + /* "constraint/constraints.py":382 * if isinstance(sum, float): * sum = round(sum, 10) * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: # <<<<<<<<<<<<<< @@ -10672,14 +10470,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":377 + /* "constraint/constraints.py":384 * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: * return False * 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, 377, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 384, __pyx_L1_error) if (__pyx_t_2) { } else { __pyx_t_11 = __pyx_t_2; @@ -10695,7 +10493,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_L40_bool_binop_done:; if (__pyx_t_11) { - /* "constraint/constraints.py":378 + /* "constraint/constraints.py":385 * return False * if forwardcheck and missing and not missing_negative: * for variable in variables: # <<<<<<<<<<<<<< @@ -10704,175 +10502,175 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_8 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_8); - __pyx_t_6 = 0; - __pyx_t_7 = NULL; + __pyx_t_5 = 0; + __pyx_t_6 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 385, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_7)) { + if (likely(!__pyx_t_6)) { 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, 378, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 385, __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_8, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_8, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_5; } 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, 378, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 385, __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_8, __pyx_t_6)); + __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_5)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_8, __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_4)) __PYX_ERR(0, 378, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 385, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_7(__pyx_t_8); - if (unlikely(!__pyx_t_4)) { + __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, 378, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 385, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/constraints.py":379 + /* "constraint/constraints.py":386 * 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, 379, __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, 386, __pyx_L1_error) if (__pyx_t_11) { - /* "constraint/constraints.py":380 + /* "constraint/constraints.py":387 * for variable in variables: * if variable not in assignments: * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if sum + value > exactsum: */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 387, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/constraints.py":381 + /* "constraint/constraints.py":388 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< * if sum + value > 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, 381, __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 = __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, 388, __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_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 381, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 388, __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, 381, __pyx_L1_error) + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 388, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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, 381, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 388, __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_7 = __Pyx_PyList_GetItemRefFast(__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, 381, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 388, __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_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 388, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_13(__pyx_t_3); - if (unlikely(!__pyx_t_4)) { + __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, 381, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 388, __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_7); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/constraints.py":382 + /* "constraint/constraints.py":389 * domain = domains[variable] * for value in domain[:]: * if sum + value > exactsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ - __pyx_t_4 = PyNumber_Add(__pyx_v_sum, __pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_v_sum, __pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __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, 389, __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, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { - /* "constraint/constraints.py":383 + /* "constraint/constraints.py":390 * for value in domain[:]: * if sum + value > exactsum: * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False */ - __pyx_t_4 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_4); - __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_4, __pyx_v_value}; - __pyx_t_1 = __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_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error) + 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, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":382 + /* "constraint/constraints.py":389 * domain = domains[variable] * for value in domain[:]: * if sum + value > exactsum: # <<<<<<<<<<<<<< @@ -10881,7 +10679,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":381 + /* "constraint/constraints.py":388 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -10891,18 +10689,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":384 + /* "constraint/constraints.py":391 * 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, 384, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 391, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_11); if (__pyx_t_2) { - /* "constraint/constraints.py":385 + /* "constraint/constraints.py":392 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -10915,7 +10713,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L0; - /* "constraint/constraints.py":384 + /* "constraint/constraints.py":391 * if sum + value > exactsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -10924,7 +10722,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":379 + /* "constraint/constraints.py":386 * if forwardcheck and missing and not missing_negative: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -10933,7 +10731,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":378 + /* "constraint/constraints.py":385 * return False * if forwardcheck and missing and not missing_negative: * for variable in variables: # <<<<<<<<<<<<<< @@ -10943,7 +10741,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":377 + /* "constraint/constraints.py":384 * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: * return False * if forwardcheck and missing and not missing_negative: # <<<<<<<<<<<<<< @@ -10954,7 +10752,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __pyx_L3:; - /* "constraint/constraints.py":386 + /* "constraint/constraints.py":393 * if not domain: * return False * if missing: # <<<<<<<<<<<<<< @@ -10963,7 +10761,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ if (__pyx_v_missing) { - /* "constraint/constraints.py":387 + /* "constraint/constraints.py":394 * return False * if missing: * return sum + min_sum_missing <= exactsum and sum + max_sum_missing >= exactsum # <<<<<<<<<<<<<< @@ -10971,11 +10769,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * return sum == exactsum */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyNumber_Add(__pyx_v_sum, __pyx_v_min_sum_missing); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_v_sum, __pyx_v_min_sum_missing); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __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, 387, __pyx_L1_error) + __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, 394, __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, 387, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 394, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { @@ -10984,9 +10782,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __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, 387, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_sum, __pyx_v_max_sum_missing); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __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, 387, __pyx_L1_error) + __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, 394, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = __pyx_t_3; @@ -10996,7 +10794,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_t_8 = 0; goto __pyx_L0; - /* "constraint/constraints.py":386 + /* "constraint/constraints.py":393 * if not domain: * return False * if missing: # <<<<<<<<<<<<<< @@ -11005,7 +10803,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":389 + /* "constraint/constraints.py":396 * return sum + min_sum_missing <= exactsum and sum + max_sum_missing >= exactsum * else: * return sum == exactsum # <<<<<<<<<<<<<< @@ -11014,13 +10812,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __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, 389, __pyx_L1_error) + __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, 396, __pyx_L1_error) __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; } - /* "constraint/constraints.py":332 + /* "constraint/constraints.py":339 * 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 # <<<<<<<<<<<<<< @@ -11032,7 +10830,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); @@ -11052,7 +10850,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal return __pyx_r; } -/* "constraint/constraints.py":409 +/* "constraint/constraints.py":416 * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -11103,47 +10901,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, 409, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 416, __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, 409, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 416, __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, 409, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 416, __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, 409, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 416, __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, 409, __pyx_L3_error) + 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, "__init__", 0) < 0) __PYX_ERR(0, 409, __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, 416, __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, 409, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, i); __PYX_ERR(0, 416, __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, 409, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 416, __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, 409, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 416, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 409, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 416, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 409, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 416, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -11156,7 +10954,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, 409, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 416, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11167,7 +10965,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, 409, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 416, __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 */ @@ -11188,7 +10986,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":425 +/* "constraint/constraints.py":432 * 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." # <<<<<<<<<<<<<< @@ -11208,7 +11006,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, 425, __pyx_L1_error) + __PYX_ERR(0, 432, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -11216,7 +11014,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, 425, __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, 432, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -11254,16 +11052,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 425, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 425, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 432, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 432, __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, 425, __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, 432, __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, 425, __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, 432, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -11271,17 +11069,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, 425, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 432, __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_GetItemRefFast(__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, 425, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 432, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -11292,13 +11090,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 425, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __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, 425, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 432, __pyx_L1_error) PyErr_Clear(); } break; @@ -11356,7 +11154,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":409 +/* "constraint/constraints.py":416 * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -11378,44 +11176,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":419 + /* "constraint/constraints.py":426 * 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, 419, __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, 426, __pyx_L1_error) - /* "constraint/constraints.py":420 + /* "constraint/constraints.py":427 * """ * 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, 420, __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, 427, __pyx_L1_error) - /* "constraint/constraints.py":421 + /* "constraint/constraints.py":428 * 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, 421, __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, 428, __pyx_L1_error) - /* "constraint/constraints.py":423 + /* "constraint/constraints.py":430 * 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, 423, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 430, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/constraints.py":424 + /* "constraint/constraints.py":431 * * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." # <<<<<<<<<<<<<< @@ -11424,19 +11222,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, 424, __pyx_L1_error) - __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_v_multipliers); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 431, __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, 424, __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, 431, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 424, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 431, __pyx_L1_error) #endif - /* "constraint/constraints.py":425 + /* "constraint/constraints.py":432 * 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." # <<<<<<<<<<<<<< @@ -11445,23 +11243,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, 425, __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, 432, __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, 425, __pyx_L1_error) + __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __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, 425, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 432, __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, 425, __pyx_L1_error) + __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Multipliers_must_be_numbers, 0, 0); + __PYX_ERR(0, 432, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 425, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 432, __pyx_L1_error) #endif - /* "constraint/constraints.py":426 + /* "constraint/constraints.py":433 * 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." # <<<<<<<<<<<<<< @@ -11470,20 +11268,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, 426, __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, 433, __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, 426, __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, 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_Last_multiplier_must_be_1_as_it, 0, 0); - __PYX_ERR(0, 426, __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, 433, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 426, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 433, __pyx_L1_error) #endif - /* "constraint/constraints.py":423 + /* "constraint/constraints.py":430 * self._multipliers = multipliers * * if multipliers: # <<<<<<<<<<<<<< @@ -11492,7 +11290,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":409 + /* "constraint/constraints.py":416 * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -11515,7 +11313,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":428 +/* "constraint/constraints.py":435 * 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 # <<<<<<<<<<<<<< @@ -11566,50 +11364,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, 428, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 435, __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, 428, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 435, __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, 428, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 435, __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, 428, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 435, __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, 428, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 435, __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, 428, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 435, __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, 428, __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, 435, __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, 428, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 435, __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, 428, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 435, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 428, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 435, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 428, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 435, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 428, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 435, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 428, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 435, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -11619,7 +11417,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, 428, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 435, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11630,9 +11428,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, 428, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 428, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 428, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 435, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 435, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 435, __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 */ @@ -11653,7 +11451,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":442 +/* "constraint/constraints.py":449 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -11673,7 +11471,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, 442, __pyx_L1_error) + __PYX_ERR(0, 449, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -11684,7 +11482,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, 442, __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, 449, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -11711,8 +11509,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; @@ -11728,17 +11525,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, 442, __pyx_L1_error) + __PYX_ERR(0, 449, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 442, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 449, __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, 442, __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, 449, __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, 442, __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, 449, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -11746,17 +11543,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, 442, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 449, __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_GetItemRefFast(__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, 442, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 449, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -11767,13 +11564,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __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, 442, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 449, __pyx_L1_error) PyErr_Clear(); } break; @@ -11784,29 +11581,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, 442, __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, 442, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 442, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_var)) { __Pyx_RaiseClosureNameError("var"); __PYX_ERR(0, 449, __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, 449, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 449, __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, 442, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains)) { __Pyx_RaiseClosureNameError("domains"); __PYX_ERR(0, 449, __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, 442, __pyx_L1_error) + __PYX_ERR(0, 449, __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, 442, __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, 449, __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, 442, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = __pyx_t_4; @@ -11827,7 +11621,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, 442, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 449, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11841,7 +11635,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); @@ -11858,7 +11651,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":443 +/* "constraint/constraints.py":450 * 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) # <<<<<<<<<<<<<< @@ -11878,7 +11671,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, 443, __pyx_L1_error) + __PYX_ERR(0, 450, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -11889,7 +11682,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, 443, __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, 450, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -11916,8 +11709,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; @@ -11933,17 +11725,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, 443, __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, 443, __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, 443, __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, 443, __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)) { @@ -11951,17 +11743,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, 443, __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_GetItemRefFast(__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, 443, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 450, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -11972,13 +11764,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 443, __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, 443, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 450, __pyx_L1_error) PyErr_Clear(); } break; @@ -11989,29 +11781,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, 443, __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, 443, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 443, __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_max); - __pyx_t_7 = __pyx_builtin_max; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains)) { __Pyx_RaiseClosureNameError("domains"); __PYX_ERR(0, 443, __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, 443, __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, 443, __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_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, 443, __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; @@ -12032,7 +11821,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, 443, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 450, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -12046,7 +11835,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); @@ -12062,7 +11850,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":428 +/* "constraint/constraints.py":435 * 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 # <<<<<<<<<<<<<< @@ -12096,7 +11884,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; @@ -12105,7 +11892,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, 428, __pyx_L1_error) + __PYX_ERR(0, 435, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -12113,7 +11900,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":429 + /* "constraint/constraints.py":436 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -12121,9 +11908,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, 429, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 436, __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, 429, __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, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -12140,37 +11927,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, 429, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":431 + /* "constraint/constraints.py":438 * 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, 431, __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, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":433 + /* "constraint/constraints.py":440 * 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, 433, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 440, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/constraints.py":434 + /* "constraint/constraints.py":441 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -12178,18 +11965,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, 434, __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, 441, __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, 434, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -12197,9 +11981,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, 434, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __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, 434, __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, 441, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -12208,17 +11992,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, 434, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 441, __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_GetItemRefFast(__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, 434, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 441, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -12229,13 +12013,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __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, 434, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 441, __pyx_L1_error) PyErr_Clear(); } break; @@ -12248,40 +12032,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, 434, __pyx_L1_error) + __PYX_ERR(0, 441, __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, 434, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __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, 434, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __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, 434, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 441, __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, 434, __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, 441, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; @@ -12289,81 +12073,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, 434, __pyx_L1_error) + __PYX_ERR(0, 441, __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":435 + /* "constraint/constraints.py":442 * 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, 435, __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, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":436 + /* "constraint/constraints.py":443 * 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, 436, __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, 443, __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, 436, __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, 436, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __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, 443, __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, 436, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 443, __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_GetItemRefFast(__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, 436, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 443, __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, 436, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __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, 436, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 443, __pyx_L1_error) PyErr_Clear(); } break; @@ -12373,60 +12157,57 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":437 + /* "constraint/constraints.py":444 * 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, 437, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __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, 437, __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, 444, __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, 444, __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, 437, __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, 437, __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, 444, __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, 437, __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, 444, __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, 437, __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, 444, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_6) { - /* "constraint/constraints.py":438 + /* "constraint/constraints.py":445 * 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, 438, __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, 445, __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":437 + /* "constraint/constraints.py":444 * domain = domains[var] * for value in domain[:]: * if value * multiplier > max(domains[self.target_var]): # <<<<<<<<<<<<<< @@ -12435,7 +12216,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":436 + /* "constraint/constraints.py":443 * for var, multiplier in zip(self.sum_vars, multipliers): * domain = domains[var] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -12443,9 +12224,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":434 + /* "constraint/constraints.py":441 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -12455,7 +12236,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":433 + /* "constraint/constraints.py":440 * multipliers = self._multipliers * * if multipliers: # <<<<<<<<<<<<<< @@ -12465,7 +12246,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L3; } - /* "constraint/constraints.py":440 + /* "constraint/constraints.py":447 * domain.remove(value) * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -12473,52 +12254,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, 440, __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, 447, __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, 440, __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, 440, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __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, 447, __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, 440, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 447, __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_GetItemRefFast(__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, 440, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 447, __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, 440, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __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, 440, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 447, __pyx_L1_error) PyErr_Clear(); } break; @@ -12530,127 +12311,121 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":441 + /* "constraint/constraints.py":448 * 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, 441, __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, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":442 + /* "constraint/constraints.py":449 * 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, 442, __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, 449, __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, 449, __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, 442, __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, 442, __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, 449, __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":443 + /* "constraint/constraints.py":450 * 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, 443, __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, 443, __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, 450, __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, 450, __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, 443, __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, 450, __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":444 + /* "constraint/constraints.py":451 * 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, 444, __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, 451, __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, 444, __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, 444, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __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, 451, __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, 444, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 451, __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_GetItemRefFast(__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, 444, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 451, __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, 444, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __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, 444, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 451, __pyx_L1_error) PyErr_Clear(); } break; @@ -12660,41 +12435,38 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":445 + /* "constraint/constraints.py":452 * 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, 445, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_v_value, __pyx_v_others_min); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __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, 445, __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, 452, __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, 445, __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, 452, __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, 445, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __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, 445, __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, 452, __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, 445, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_6) { - /* "constraint/constraints.py":446 + /* "constraint/constraints.py":453 * for value in domain[:]: * if value + others_min > max(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< @@ -12706,14 +12478,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, 446, __pyx_L1_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "constraint/constraints.py":445 + /* "constraint/constraints.py":452 * 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]): # <<<<<<<<<<<<<< @@ -12722,41 +12494,38 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":447 + /* "constraint/constraints.py":454 * 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, 447, __pyx_L1_error) + __pyx_t_13 = PyNumber_Add(__pyx_v_value, __pyx_v_others_max); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 454, __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, 447, __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, 447, __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, 454, __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, 454, __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, 447, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __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, 447, __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, 454, __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, 447, __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, 454, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_6) { - /* "constraint/constraints.py":448 + /* "constraint/constraints.py":455 * domain.remove(value) * if value + others_max < min(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< @@ -12768,14 +12537,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, 448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 455, __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":447 + /* "constraint/constraints.py":454 * if value + others_min > max(domains[self.target_var]): * domain.remove(value) * if value + others_max < min(domains[self.target_var]): # <<<<<<<<<<<<<< @@ -12784,7 +12553,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":444 + /* "constraint/constraints.py":451 * 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[:]: # <<<<<<<<<<<<<< @@ -12792,9 +12561,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":440 + /* "constraint/constraints.py":447 * domain.remove(value) * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -12802,11 +12571,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":428 + /* "constraint/constraints.py":435 * 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 # <<<<<<<<<<<<<< @@ -12825,7 +12594,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:; @@ -12843,7 +12611,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":450 +/* "constraint/constraints.py":457 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -12894,53 +12662,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, 450, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 457, __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, 450, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 457, __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, 450, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 457, __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, 450, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 457, __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, 450, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 457, __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, 450, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 457, __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, 450, __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, 457, __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, 450, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 457, __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, 450, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 457, __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, 450, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 457, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 450, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 457, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 450, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 457, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 450, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 457, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -12954,7 +12722,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, 450, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 457, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -12965,8 +12733,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, 450, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 450, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 457, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 457, __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 */ @@ -13002,10 +12770,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; @@ -13016,32 +12784,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":451 + /* "constraint/constraints.py":458 * * 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, 451, __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, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":453 + /* "constraint/constraints.py":460 * 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, 453, __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, 460, __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, 453, __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, 460, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":454 + /* "constraint/constraints.py":461 * * if self.target_var not in assignments: * return True # can't evaluate without target, defer to later # <<<<<<<<<<<<<< @@ -13053,7 +12821,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":453 + /* "constraint/constraints.py":460 * multipliers = self._multipliers * * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -13062,22 +12830,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":456 + /* "constraint/constraints.py":463 * 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, 456, __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, 463, __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, 456, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __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":457 + /* "constraint/constraints.py":464 * * target_value = assignments[self.target_var] * sum_value = 0 # <<<<<<<<<<<<<< @@ -13087,7 +12855,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":458 + /* "constraint/constraints.py":465 * target_value = assignments[self.target_var] * sum_value = 0 * missing = False # <<<<<<<<<<<<<< @@ -13096,17 +12864,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ __pyx_v_missing = 0; - /* "constraint/constraints.py":460 + /* "constraint/constraints.py":467 * 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, 460, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 467, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":461 + /* "constraint/constraints.py":468 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -13114,64 +12882,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, 461, __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, 468, __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, 461, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 468, __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, 461, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 468, __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, 461, __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, 468, __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, 461, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 468, __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_GetItemRefFast(__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, 461, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 468, __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, 461, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 468, __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, 461, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 468, __pyx_L1_error) PyErr_Clear(); } break; @@ -13184,40 +12949,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, 461, __pyx_L1_error) + __PYX_ERR(0, 468, __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, 461, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 468, __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, 461, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 468, __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, 461, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 468, __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, 461, __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, 468, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; @@ -13225,43 +12990,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, 461, __pyx_L1_error) + __PYX_ERR(0, 468, __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":462 + /* "constraint/constraints.py":469 * 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, 462, __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, 469, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":463 + /* "constraint/constraints.py":470 * 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, 463, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __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, 463, __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, 470, __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, 463, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __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":462 + /* "constraint/constraints.py":469 * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: # <<<<<<<<<<<<<< @@ -13271,7 +13036,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L9; } - /* "constraint/constraints.py":465 + /* "constraint/constraints.py":472 * sum_value += assignments[var] * multiplier * else: * missing = True # <<<<<<<<<<<<<< @@ -13283,7 +13048,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __pyx_L9:; - /* "constraint/constraints.py":461 + /* "constraint/constraints.py":468 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -13293,7 +13058,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":460 + /* "constraint/constraints.py":467 * missing = False * * if multipliers: # <<<<<<<<<<<<<< @@ -13303,7 +13068,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L4; } - /* "constraint/constraints.py":467 + /* "constraint/constraints.py":474 * missing = True * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -13311,52 +13076,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, 467, __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, 474, __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, 467, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 474, __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, 467, __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, 474, __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, 467, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 474, __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_GetItemRefFast(__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, 467, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 474, __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, 467, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __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, 467, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 474, __pyx_L1_error) PyErr_Clear(); } break; @@ -13366,32 +13131,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":468 + /* "constraint/constraints.py":475 * 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, 468, __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, 475, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":469 + /* "constraint/constraints.py":476 * 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, 469, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 476, __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, 469, __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, 476, __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":468 + /* "constraint/constraints.py":475 * else: * for var in self.sum_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -13401,7 +13166,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L13; } - /* "constraint/constraints.py":471 + /* "constraint/constraints.py":478 * sum_value += assignments[var] * else: * sum_value += min(domains[var]) # use min value if not assigned # <<<<<<<<<<<<<< @@ -13410,27 +13175,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, 471, __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, 478, __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, 471, __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, 478, __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, 471, __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, 478, __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":472 + /* "constraint/constraints.py":479 * else: * sum_value += min(domains[var]) # use min value if not assigned * missing = True # <<<<<<<<<<<<<< @@ -13441,7 +13203,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __pyx_L13:; - /* "constraint/constraints.py":467 + /* "constraint/constraints.py":474 * missing = True * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -13453,7 +13215,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __pyx_L4:; - /* "constraint/constraints.py":474 + /* "constraint/constraints.py":481 * missing = True * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -13463,29 +13225,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_t_2 = PyFloat_Check(__pyx_v_sum_value); if (__pyx_t_2) { - /* "constraint/constraints.py":475 + /* "constraint/constraints.py":482 * * 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, 475, __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, 482, __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":474 + /* "constraint/constraints.py":481 * missing = True * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -13494,7 +13253,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":477 + /* "constraint/constraints.py":484 * sum_value = round(sum_value, 10) * * if missing: # <<<<<<<<<<<<<< @@ -13503,19 +13262,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ if (__pyx_v_missing) { - /* "constraint/constraints.py":479 + /* "constraint/constraints.py":486 * 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, 479, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 479, __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, 486, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":480 + /* "constraint/constraints.py":487 * # Partial assignments: only check feasibility * if sum_value > target_value: * return False # <<<<<<<<<<<<<< @@ -13527,7 +13286,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":479 + /* "constraint/constraints.py":486 * if missing: * # Partial assignments: only check feasibility * if sum_value > target_value: # <<<<<<<<<<<<<< @@ -13536,69 +13295,69 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":481 + /* "constraint/constraints.py":488 * 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, 481, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 488, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":482 + /* "constraint/constraints.py":489 * 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, 482, __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, 489, __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, 482, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __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, 482, __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, 489, __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, 482, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 489, __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_GetItemRefFast(__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, 482, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 489, __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, 482, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 489, __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, 482, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 489, __pyx_L1_error) PyErr_Clear(); } break; @@ -13608,91 +13367,91 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":483 + /* "constraint/constraints.py":490 * 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, 483, __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, 490, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":484 + /* "constraint/constraints.py":491 * 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, 484, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":485 + /* "constraint/constraints.py":492 * 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, 485, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 492, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":486 + /* "constraint/constraints.py":493 * 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, 486, __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, 493, __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, 486, __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, 486, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 493, __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, 493, __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, 486, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 493, __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_GetItemRefFast(__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, 486, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 493, __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, 486, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __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, 486, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 493, __pyx_L1_error) PyErr_Clear(); } break; @@ -13702,51 +13461,51 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":487 + /* "constraint/constraints.py":494 * 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, 487, __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, 494, __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, 487, __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, 494, __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, 487, __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, 494, __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, 487, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_value, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __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, 487, __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, 494, __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":488 + /* "constraint/constraints.py":495 * 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, 488, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 488, __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, 495, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 495, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":489 + /* "constraint/constraints.py":496 * temp_sum = sum_value + (value * multipliers[self.sum_vars.index(var)]) * if temp_sum > target_value: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -13755,17 +13514,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ __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, 489, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 496, __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":488 + /* "constraint/constraints.py":495 * for value in domain[:]: * temp_sum = sum_value + (value * multipliers[self.sum_vars.index(var)]) * if temp_sum > target_value: # <<<<<<<<<<<<<< @@ -13774,7 +13533,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":486 + /* "constraint/constraints.py":493 * domain = domains[var] * if multipliers: * for value in domain[:]: # <<<<<<<<<<<<<< @@ -13782,9 +13541,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":485 + /* "constraint/constraints.py":492 * if var not in assignments: * domain = domains[var] * if multipliers: # <<<<<<<<<<<<<< @@ -13794,7 +13553,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L22; } - /* "constraint/constraints.py":491 + /* "constraint/constraints.py":498 * domain.hideValue(value) * else: * for value in domain[:]: # <<<<<<<<<<<<<< @@ -13802,86 +13561,86 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain * if temp_sum > 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, 491, __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_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, 498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { + __pyx_t_9 = __pyx_t_8; __Pyx_INCREF(__pyx_t_9); __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, 491, __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, 491, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 498, __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, 498, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { + if (likely(PyList_CheckExact(__pyx_t_9))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + 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, 491, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 498, __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_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_9, __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_9); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 491, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 498, __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_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_11)); #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_11); #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 491, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 498, __pyx_L1_error) } else { - __pyx_t_5 = __pyx_t_12(__pyx_t_4); - if (unlikely(!__pyx_t_5)) { + __pyx_t_8 = __pyx_t_12(__pyx_t_9); + 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, 491, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 498, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_5); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_5); - __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":492 + /* "constraint/constraints.py":499 * 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, 492, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_XDECREF_SET(__pyx_v_temp_sum, __pyx_t_5); - __pyx_t_5 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_v_sum_value, __pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_temp_sum, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":493 + /* "constraint/constraints.py":500 * for value in domain[:]: * temp_sum = sum_value + value * if temp_sum > 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, 493, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 493, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_v_temp_sum, __pyx_v_target_value, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 500, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":494 + /* "constraint/constraints.py":501 * temp_sum = sum_value + value * if temp_sum > target_value: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -13890,17 +13649,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ __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_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_t_8 = __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_5)) __PYX_ERR(0, 494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":493 + /* "constraint/constraints.py":500 * for value in domain[:]: * temp_sum = sum_value + value * if temp_sum > target_value: # <<<<<<<<<<<<<< @@ -13909,7 +13668,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":491 + /* "constraint/constraints.py":498 * domain.hideValue(value) * else: * for value in domain[:]: # <<<<<<<<<<<<<< @@ -13917,22 +13676,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain * if temp_sum > target_value: */ } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_L22:; - /* "constraint/constraints.py":495 + /* "constraint/constraints.py":502 * if temp_sum > 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, 495, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 502, __pyx_L1_error) __pyx_t_13 = (!__pyx_t_2); if (__pyx_t_13) { - /* "constraint/constraints.py":496 + /* "constraint/constraints.py":503 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -13945,7 +13704,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":495 + /* "constraint/constraints.py":502 * if temp_sum > target_value: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -13954,7 +13713,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":483 + /* "constraint/constraints.py":490 * if forwardcheck: * for var in self.sum_vars: * if var not in assignments: # <<<<<<<<<<<<<< @@ -13963,7 +13722,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":482 + /* "constraint/constraints.py":489 * return False * if forwardcheck: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -13973,7 +13732,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":481 + /* "constraint/constraints.py":488 * if sum_value > target_value: * return False * if forwardcheck: # <<<<<<<<<<<<<< @@ -13982,7 +13741,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":497 + /* "constraint/constraints.py":504 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -13994,7 +13753,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":477 + /* "constraint/constraints.py":484 * sum_value = round(sum_value, 10) * * if missing: # <<<<<<<<<<<<<< @@ -14003,7 +13762,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":499 + /* "constraint/constraints.py":506 * return True * else: * return sum_value == target_value # <<<<<<<<<<<<<< @@ -14012,13 +13771,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, 499, __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, 506, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } - /* "constraint/constraints.py":450 + /* "constraint/constraints.py":457 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -14031,7 +13790,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; @@ -14049,7 +13808,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":518 +/* "constraint/constraints.py":525 * """ * * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -14099,41 +13858,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, 518, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 525, __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, 518, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 525, __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, 518, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 525, __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, 518, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 525, __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, 518, __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, 525, __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, 518, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 525, __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, 518, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 525, __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, 518, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 525, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 518, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 525, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -14145,7 +13904,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, 518, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 525, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -14175,37 +13934,37 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint___init__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":527 + /* "constraint/constraints.py":534 * 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, 527, __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, 534, __pyx_L1_error) - /* "constraint/constraints.py":528 + /* "constraint/constraints.py":535 * """ * self._minsum = minsum * self._multipliers = multipliers # <<<<<<<<<<<<<< * self._var_max = {} * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2, __pyx_v_multipliers) < 0) __PYX_ERR(0, 528, __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, 535, __pyx_L1_error) - /* "constraint/constraints.py":529 + /* "constraint/constraints.py":536 * 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, 529, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __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, 529, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max, __pyx_t_1) < (0)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":518 + /* "constraint/constraints.py":525 * """ * * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -14226,7 +13985,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint___init__ return __pyx_r; } -/* "constraint/constraints.py":531 +/* "constraint/constraints.py":538 * self._var_max = {} * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -14277,50 +14036,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, 531, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 538, __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, 531, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 538, __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, 531, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 538, __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, 531, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 538, __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, 531, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 538, __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, 531, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 538, __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, 531, __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, 538, __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, 531, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 538, __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, 531, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 538, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 531, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 538, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 531, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 538, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 531, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 538, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 531, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 538, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -14330,7 +14089,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, 531, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 538, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -14341,9 +14100,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, 531, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 531, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 531, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 538, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 538, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 538, __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 */ @@ -14394,7 +14153,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":532 + /* "constraint/constraints.py":539 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -14402,9 +14161,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc * 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, 532, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __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, 532, __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, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -14421,39 +14180,39 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_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, 532, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":533 + /* "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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 533, __pyx_L1_error) + __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, 540, __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, 533, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 540, __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, 533, __pyx_L1_error) + __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, 540, __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, 533, __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, 533, __pyx_L1_error) + __pyx_t_7 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 540, __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, 540, __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, 533, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 540, __pyx_L1_error); } } __pyx_t_1 = __pyx_t_4; @@ -14462,7 +14221,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":534 + /* "constraint/constraints.py":541 * 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 # <<<<<<<<<<<<<< @@ -14470,64 +14229,61 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc * # 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, 534, __pyx_L5_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_3 = __pyx_builtin_zip; __pyx_t_5 = 1; { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_variables, __pyx_v_multipliers}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L5_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L5_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_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 534, __pyx_L5_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, 534, __pyx_L5_error) + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __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, 541, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_2))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + 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, 534, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 541, __pyx_L5_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_7); + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + 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, 534, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 541, __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_3, __pyx_t_7)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L5_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L5_error) } else { - __pyx_t_4 = __pyx_t_8(__pyx_t_3); + __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, 534, __pyx_L5_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 541, __pyx_L5_error) PyErr_Clear(); } break; @@ -14540,40 +14296,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 534, __pyx_L5_error) + __PYX_ERR(0, 541, __pyx_L5_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_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_2 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L5_error) - __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 534, __pyx_L5_error) + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L5_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 541, __pyx_L5_error) __Pyx_XGOTREF(__pyx_t_9); } #else - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 534, __pyx_L5_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 541, __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, 534, __pyx_L5_error) + __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 541, __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_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); + 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, 534, __pyx_L5_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 541, __pyx_L5_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L9_unpacking_done; @@ -14581,35 +14337,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 534, __pyx_L5_error) + __PYX_ERR(0, 541, __pyx_L5_error) __pyx_L9_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_variable, __pyx_t_2); - __pyx_t_2 = 0; + __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_INCREF(__pyx_builtin_max); - __pyx_t_2 = __pyx_builtin_max; - __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr8__pyx_v_variable); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 534, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr8__pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_10}; - __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)); + 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_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); } - __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_8genexpr8__pyx_v_multiplier); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_8genexpr8__pyx_v_multiplier); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __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_2))) __PYX_ERR(0, 534, __pyx_L5_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_8genexpr8__pyx_v_variable, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 541, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __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; @@ -14619,26 +14372,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc 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, 534, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max, __pyx_t_1) < (0)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":537 + /* "constraint/constraints.py":544 * * # 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_3 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_2 = __pyx_builtin_zip; + __pyx_t_2 = NULL; __pyx_t_5 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __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_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error) + 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, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -14646,9 +14396,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __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, 537, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __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, 537, __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, 544, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -14657,17 +14407,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc { 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, 537, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 544, __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_GetItemRefFast(__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, 537, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 544, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -14678,13 +14428,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __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, 537, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 544, __pyx_L1_error) PyErr_Clear(); } break; @@ -14697,7 +14447,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 537, __pyx_L1_error) + __PYX_ERR(0, 544, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -14706,39 +14456,39 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_4); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 544, __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, 537, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 544, __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_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 544, __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_10); - index = 0; __pyx_t_3 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L14_unpacking_failed; + __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_10); if (unlikely(!__pyx_t_4)) goto __pyx_L14_unpacking_failed; + 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_10), 2) < 0) __PYX_ERR(0, 537, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 544, __pyx_L1_error) __pyx_t_11 = NULL; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L15_unpacking_done; __pyx_L14_unpacking_failed:; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 537, __pyx_L1_error) + __PYX_ERR(0, 544, __pyx_L1_error) __pyx_L15_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); @@ -14746,19 +14496,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":538 + /* "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) * for value in domain[:]: */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":539 + /* "constraint/constraints.py":546 * for variable, multiplier in zip(variables, multipliers): * domain = domains[variable] * others_max = sum_other_vars(variables, variable, self._var_max) # <<<<<<<<<<<<<< @@ -14766,10 +14516,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc * 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, 539, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_sum_other_vars); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 539, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __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, 546, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { @@ -14783,34 +14533,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_variables, __pyx_v_variable, __pyx_t_10}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + 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_10); __pyx_t_10 = 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, 539, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __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":540 + /* "constraint/constraints.py":547 * 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, 540, __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, 547, __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, 540, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __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, 540, __pyx_L1_error) + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 547, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -14819,17 +14569,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc { 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, 540, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 547, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12); + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__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, 540, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 547, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -14840,13 +14590,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __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, 540, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 547, __pyx_L1_error) PyErr_Clear(); } break; @@ -14856,28 +14606,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":541 + /* "constraint/constraints.py":548 * 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, 541, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyNumber_Add(__pyx_t_1, __pyx_v_others_max); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 541, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyNumber_Add(__pyx_t_1, __pyx_v_others_max); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 548, __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, 541, __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, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_10, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __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, 548, __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, 541, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "constraint/constraints.py":542 + /* "constraint/constraints.py":549 * for value in domain[:]: * if value * multiplier + others_max < self._minsum: * domain.remove(value) # <<<<<<<<<<<<<< @@ -14889,14 +14639,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __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_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, 542, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":541 + /* "constraint/constraints.py":548 * others_max = sum_other_vars(variables, variable, self._var_max) * for value in domain[:]: * if value * multiplier + others_max < self._minsum: # <<<<<<<<<<<<<< @@ -14905,7 +14655,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc */ } - /* "constraint/constraints.py":540 + /* "constraint/constraints.py":547 * domain = domains[variable] * others_max = sum_other_vars(variables, variable, self._var_max) * for value in domain[:]: # <<<<<<<<<<<<<< @@ -14915,7 +14665,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":537 + /* "constraint/constraints.py":544 * * # preprocess the domains to remove values that cannot contribute to the minimum sum * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -14925,72 +14675,69 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":545 + /* "constraint/constraints.py":552 * * # recalculate the max after pruning - * self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 # <<<<<<<<<<<<<< + * 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, 545, __pyx_L23_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 552, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_1 = __pyx_builtin_zip; __pyx_t_5 = 1; { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_variables, __pyx_v_multipliers}; - __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_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; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L23_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __pyx_L23_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 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __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, 545, __pyx_L23_error) + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __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, 552, __pyx_L23_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + 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, 545, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 552, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_7); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __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_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 545, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 552, __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_1, __pyx_t_7)); + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L23_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __pyx_L23_error) } else { - __pyx_t_3 = __pyx_t_8(__pyx_t_1); + __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, 545, __pyx_L23_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 552, __pyx_L23_error) PyErr_Clear(); } break; @@ -15003,76 +14750,85 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 545, __pyx_L23_error) + __PYX_ERR(0, 552, __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_INCREF(__pyx_t_4); - __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_10); + __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_4 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L23_error) - __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 545, __pyx_L23_error) - __Pyx_XGOTREF(__pyx_t_10); + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L23_error) + __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 552, __pyx_L23_error) + __Pyx_XGOTREF(__pyx_t_9); } #else - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 545, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 552, __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_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 545, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_L26_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - index = 1; __pyx_t_10 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_10)) goto __pyx_L26_unpacking_failed; + __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 552, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 2) < 0) __PYX_ERR(0, 545, __pyx_L23_error) + __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, 552, __pyx_L23_error) __pyx_t_11 = NULL; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L27_unpacking_done; __pyx_L26_unpacking_failed:; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 545, __pyx_L23_error) + __PYX_ERR(0, 552, __pyx_L23_error) __pyx_L27_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_variable, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_multiplier, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_4 = __pyx_builtin_max; - __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr9__pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 545, __pyx_L23_error) + __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, 552, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = 1; - { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_9}; - __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_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_12 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 552, __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, 552, __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, 552, __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, 552, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_3); + __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; } - __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_8genexpr9__pyx_v_multiplier); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_8genexpr9__pyx_v_variable, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 552, __pyx_L23_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_8genexpr9__pyx_v_variable, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 545, __pyx_L23_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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; @@ -15082,10 +14838,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc 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, 545, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max, __pyx_t_2) < (0)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":531 + /* "constraint/constraints.py":538 * self._var_max = {} * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -15121,8 +14877,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc return __pyx_r; } -/* "constraint/constraints.py":547 - * self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 +/* "constraint/constraints.py":554 + * 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 @@ -15172,53 +14928,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, 547, __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 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 547, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 554, __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, 547, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 554, __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, 547, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 554, __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, 547, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 554, __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, 547, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 554, __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, 547, __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, 554, __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, 547, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 554, __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, 547, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 554, __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, 547, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 554, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 547, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 554, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 547, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 554, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 547, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 554, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -15232,7 +14988,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, 547, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 554, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -15243,8 +14999,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, 547, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 547, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 554, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 554, __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 */ @@ -15277,10 +15033,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_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 *); @@ -15289,31 +15045,31 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":548 + /* "constraint/constraints.py":555 * * 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, 548, __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, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":549 + /* "constraint/constraints.py":556 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * multipliers = self._multipliers * minsum = self._minsum # <<<<<<<<<<<<<< * sum = 0 * 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, 549, __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, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_minsum = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":550 + /* "constraint/constraints.py":557 * multipliers = self._multipliers * minsum = self._minsum * sum = 0 # <<<<<<<<<<<<<< @@ -15323,7 +15079,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":551 + /* "constraint/constraints.py":558 * minsum = self._minsum * sum = 0 * missing = False # <<<<<<<<<<<<<< @@ -15332,7 +15088,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ */ __pyx_v_missing = 0; - /* "constraint/constraints.py":552 + /* "constraint/constraints.py":559 * sum = 0 * missing = False * max_sum_missing = 0 # <<<<<<<<<<<<<< @@ -15342,17 +15098,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_max_sum_missing = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":553 + /* "constraint/constraints.py":560 * missing = False * max_sum_missing = 0 * 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, 553, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 560, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":554 + /* "constraint/constraints.py":561 * max_sum_missing = 0 * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -15360,61 +15116,58 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ * 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, 554, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __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, 554, __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, 554, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 561, __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, 561, __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, 554, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 561, __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_GetItemRefFast(__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, 554, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 561, __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, 554, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __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, 554, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 561, __pyx_L1_error) PyErr_Clear(); } break; @@ -15427,40 +15180,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 554, __pyx_L1_error) + __PYX_ERR(0, 561, __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, 554, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 561, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 561, __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, 554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 561, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 561, __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, 554, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 561, __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, 554, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 561, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; @@ -15468,43 +15221,43 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_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, 554, __pyx_L1_error) + __PYX_ERR(0, 561, __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":555 + /* "constraint/constraints.py":562 * 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, 555, __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, 562, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":556 + /* "constraint/constraints.py":563 * 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, 556, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __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, 556, __pyx_L1_error) + __pyx_t_8 = PyNumber_Multiply(__pyx_t_1, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 563, __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, 556, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __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":555 + /* "constraint/constraints.py":562 * if multipliers: * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: # <<<<<<<<<<<<<< @@ -15514,7 +15267,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ goto __pyx_L8; } - /* "constraint/constraints.py":558 + /* "constraint/constraints.py":565 * sum += assignments[variable] * multiplier * else: * max_sum_missing += self._var_max[variable] # <<<<<<<<<<<<<< @@ -15522,18 +15275,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ * 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, 558, __pyx_L1_error) + __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, 565, __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, 558, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 565, __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, 558, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_max_sum_missing, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __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":559 + /* "constraint/constraints.py":566 * else: * max_sum_missing += self._var_max[variable] * missing = True # <<<<<<<<<<<<<< @@ -15544,7 +15297,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ } __pyx_L8:; - /* "constraint/constraints.py":554 + /* "constraint/constraints.py":561 * max_sum_missing = 0 * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -15552,9 +15305,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ * 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":553 + /* "constraint/constraints.py":560 * missing = False * max_sum_missing = 0 * if multipliers: # <<<<<<<<<<<<<< @@ -15564,7 +15317,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ goto __pyx_L3; } - /* "constraint/constraints.py":561 + /* "constraint/constraints.py":568 * missing = True * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -15573,48 +15326,48 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ */ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { - __pyx_t_4 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_4); - __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_4 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 561, __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, 561, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __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, 568, __pyx_L1_error) } 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, 561, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 568, __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_GetItemRefFast(__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, 561, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 568, __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, 561, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __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, 561, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 568, __pyx_L1_error) PyErr_Clear(); } break; @@ -15624,32 +15377,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":562 + /* "constraint/constraints.py":569 * else: * for variable in variables: * 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, 562, __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, 569, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":563 + /* "constraint/constraints.py":570 * 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, 563, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __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, 563, __pyx_L1_error) + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 570, __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":562 + /* "constraint/constraints.py":569 * else: * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -15659,7 +15412,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ goto __pyx_L12; } - /* "constraint/constraints.py":565 + /* "constraint/constraints.py":572 * sum += assignments[variable] * else: * max_sum_missing += self._var_max[variable] # <<<<<<<<<<<<<< @@ -15667,18 +15420,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ * */ /*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, 565, __pyx_L1_error) + __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, 572, __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, 565, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __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, 565, __pyx_L1_error) + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_max_sum_missing, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 572, __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":566 + /* "constraint/constraints.py":573 * else: * max_sum_missing += self._var_max[variable] * missing = True # <<<<<<<<<<<<<< @@ -15689,7 +15442,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ } __pyx_L12:; - /* "constraint/constraints.py":561 + /* "constraint/constraints.py":568 * missing = True * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -15697,11 +15450,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ * sum += assignments[variable] */ } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; - /* "constraint/constraints.py":568 + /* "constraint/constraints.py":575 * missing = True * * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -15711,7 +15464,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ __pyx_t_2 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_2) { - /* "constraint/constraints.py":569 + /* "constraint/constraints.py":576 * * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< @@ -15719,21 +15472,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ * return False */ __pyx_t_8 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_1 = __pyx_builtin_round; - __pyx_t_5 = 1; + __pyx_t_4 = 1; { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_sum, __pyx_mstate_global->__pyx_int_10}; - __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_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_4)) __PYX_ERR(0, 569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 576, __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":568 + /* "constraint/constraints.py":575 * missing = True * * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -15742,22 +15492,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ */ } - /* "constraint/constraints.py":570 + /* "constraint/constraints.py":577 * if isinstance(sum, float): * sum = round(sum, 10) * if sum + max_sum_missing < minsum: # <<<<<<<<<<<<<< * return False * return sum >= minsum or missing */ - __pyx_t_4 = PyNumber_Add(__pyx_v_sum, __pyx_v_max_sum_missing); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_minsum, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_v_sum, __pyx_v_max_sum_missing); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __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, 577, __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, 577, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":571 + /* "constraint/constraints.py":578 * sum = round(sum, 10) * if sum + max_sum_missing < minsum: * return False # <<<<<<<<<<<<<< @@ -15769,7 +15519,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":570 + /* "constraint/constraints.py":577 * if isinstance(sum, float): * sum = round(sum, 10) * if sum + max_sum_missing < minsum: # <<<<<<<<<<<<<< @@ -15778,7 +15528,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ */ } - /* "constraint/constraints.py":572 + /* "constraint/constraints.py":579 * if sum + max_sum_missing < minsum: * return False * return sum >= minsum or missing # <<<<<<<<<<<<<< @@ -15786,27 +15536,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ * class VariableMinSumConstraint(Constraint): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_sum, __pyx_v_minsum, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 572, __pyx_L1_error) + __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, 579, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 579, __pyx_L1_error) if (!__pyx_t_2) { - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __Pyx_INCREF(__pyx_t_4); - __pyx_t_1 = __pyx_t_4; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __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_4 = __Pyx_PyBool_FromLong(__pyx_v_missing); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_missing); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __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_1; - __pyx_t_1 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; goto __pyx_L0; - /* "constraint/constraints.py":547 - * self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + /* "constraint/constraints.py":554 + * 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 @@ -15817,7 +15567,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_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.MinSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -15834,7 +15584,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ return __pyx_r; } -/* "constraint/constraints.py":591 +/* "constraint/constraints.py":598 * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -15885,47 +15635,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, 591, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 598, __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, 591, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 598, __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, 591, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 598, __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, 591, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 598, __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, 591, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 598, __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, 591, __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, 598, __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, 591, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, i); __PYX_ERR(0, 598, __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, 591, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 598, __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, 591, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 598, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 591, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 598, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 591, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 598, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -15938,7 +15688,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, 591, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 598, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -15949,7 +15699,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, 591, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 598, __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 */ @@ -15970,7 +15720,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":607 +/* "constraint/constraints.py":614 * 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." # <<<<<<<<<<<<<< @@ -15990,7 +15740,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, 607, __pyx_L1_error) + __PYX_ERR(0, 614, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -15998,7 +15748,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, 607, __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, 614, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -16036,16 +15786,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 607, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 607, __pyx_L1_error) } + 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, 607, __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, 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, 607, __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, 614, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -16053,17 +15803,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, 607, __pyx_L1_error) + 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_4 = __Pyx_PyList_GetItemRefFast(__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, 607, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 614, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -16074,13 +15824,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error) + 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, 607, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 614, __pyx_L1_error) PyErr_Clear(); } break; @@ -16138,7 +15888,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":591 +/* "constraint/constraints.py":598 * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -16160,44 +15910,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":601 + /* "constraint/constraints.py":608 * 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, 601, __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, 608, __pyx_L1_error) - /* "constraint/constraints.py":602 + /* "constraint/constraints.py":609 * """ * 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, 602, __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, 609, __pyx_L1_error) - /* "constraint/constraints.py":603 + /* "constraint/constraints.py":610 * 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, 603, __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, 610, __pyx_L1_error) - /* "constraint/constraints.py":605 + /* "constraint/constraints.py":612 * 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, 605, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 612, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/constraints.py":606 + /* "constraint/constraints.py":613 * * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." # <<<<<<<<<<<<<< @@ -16206,19 +15956,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, 606, __pyx_L1_error) - __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 606, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_v_multipliers); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 613, __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, 606, __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, 613, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 606, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 613, __pyx_L1_error) #endif - /* "constraint/constraints.py":607 + /* "constraint/constraints.py":614 * 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." # <<<<<<<<<<<<<< @@ -16227,23 +15977,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, 607, __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, 614, __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, 607, __pyx_L1_error) + __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 614, __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, 607, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 614, __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, 607, __pyx_L1_error) + __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Multipliers_must_be_numbers, 0, 0); + __PYX_ERR(0, 614, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 607, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 614, __pyx_L1_error) #endif - /* "constraint/constraints.py":608 + /* "constraint/constraints.py":615 * 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." # <<<<<<<<<<<<<< @@ -16252,20 +16002,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, 608, __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, 615, __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, 608, __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, 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_Last_multiplier_must_be_1_as_it, 0, 0); - __PYX_ERR(0, 608, __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, 615, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 608, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 615, __pyx_L1_error) #endif - /* "constraint/constraints.py":605 + /* "constraint/constraints.py":612 * self._multipliers = multipliers * * if multipliers: # <<<<<<<<<<<<<< @@ -16274,7 +16024,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":591 + /* "constraint/constraints.py":598 * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -16297,7 +16047,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":610 +/* "constraint/constraints.py":617 * 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 # <<<<<<<<<<<<<< @@ -16348,50 +16098,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, 610, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 617, __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, 610, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 617, __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, 610, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 617, __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, 610, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 617, __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, 610, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 617, __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, 610, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 617, __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, 610, __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, 617, __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, 610, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 617, __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, 610, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 617, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 610, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 617, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 610, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 617, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 610, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 617, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 610, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 617, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -16401,7 +16151,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, 610, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 617, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -16412,9 +16162,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, 610, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 610, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 610, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 617, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 617, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 617, __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 */ @@ -16435,7 +16185,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":618 +/* "constraint/constraints.py":625 * for var in self.sum_vars: * domain = domains[var] * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -16455,7 +16205,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, 618, __pyx_L1_error) + __PYX_ERR(0, 625, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -16466,7 +16216,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, 618, __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, 625, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -16493,8 +16243,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; @@ -16510,17 +16259,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, 618, __pyx_L1_error) + __PYX_ERR(0, 625, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 618, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 625, __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, 618, __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, 625, __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, 618, __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, 625, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -16528,17 +16277,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, 618, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 625, __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_GetItemRefFast(__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, 618, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 625, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -16549,13 +16298,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 618, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 625, __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, 618, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 625, __pyx_L1_error) PyErr_Clear(); } break; @@ -16566,29 +16315,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, 618, __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, 618, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 618, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_var)) { __Pyx_RaiseClosureNameError("var"); __PYX_ERR(0, 625, __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, 625, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 625, __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, 618, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains)) { __Pyx_RaiseClosureNameError("domains"); __PYX_ERR(0, 625, __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, 618, __pyx_L1_error) + __PYX_ERR(0, 625, __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, 618, __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, 625, __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, 618, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = __pyx_t_4; @@ -16609,7 +16355,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, 618, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 625, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -16623,7 +16369,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); @@ -16639,7 +16384,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":610 +/* "constraint/constraints.py":617 * 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 # <<<<<<<<<<<<<< @@ -16666,11 +16411,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; @@ -16679,7 +16423,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, 610, __pyx_L1_error) + __PYX_ERR(0, 617, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -16687,7 +16431,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":611 + /* "constraint/constraints.py":618 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -16695,9 +16439,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, 611, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 618, __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, 611, __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, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -16714,54 +16458,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, 611, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":613 + /* "constraint/constraints.py":620 * 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, 613, __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, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":615 + /* "constraint/constraints.py":622 * 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, 615, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 622, __pyx_L1_error) __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { - /* "constraint/constraints.py":616 + /* "constraint/constraints.py":623 * * 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, 616, __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, 623, __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, 616, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __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, 616, __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, 623, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -16770,17 +16514,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, 616, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 623, __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_GetItemRefFast(__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, 616, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 623, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -16791,13 +16535,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __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, 616, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 623, __pyx_L1_error) PyErr_Clear(); } break; @@ -16809,19 +16553,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":617 + /* "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) * 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, 617, __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, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":618 + /* "constraint/constraints.py":625 * for var in self.sum_vars: * domain = domains[var] * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -16829,79 +16573,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, 618, __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, 625, __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, 625, __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, 618, __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, 618, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __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":619 + /* "constraint/constraints.py":626 * 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, 619, __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, 626, __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, 619, __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, 619, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 626, __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, 626, __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, 619, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 626, __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_GetItemRefFast(__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, 619, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 626, __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, 619, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __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, 619, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 626, __pyx_L1_error) PyErr_Clear(); } break; @@ -16911,60 +16652,57 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":620 + /* "constraint/constraints.py":627 * 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, 620, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_value, __pyx_v_others_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __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, 620, __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, 627, __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, 627, __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, 620, __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, 620, __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, 627, __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, 620, __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, 627, __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, 620, __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, 627, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":621 + /* "constraint/constraints.py":628 * 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, 621, __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, 628, __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":620 + /* "constraint/constraints.py":627 * 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]): # <<<<<<<<<<<<<< @@ -16973,7 +16711,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":619 + /* "constraint/constraints.py":626 * domain = domains[var] * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) * for value in domain[:]: # <<<<<<<<<<<<<< @@ -16981,9 +16719,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":616 + /* "constraint/constraints.py":623 * * if not multipliers: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -16993,7 +16731,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":615 + /* "constraint/constraints.py":622 * multipliers = self._multipliers * * if not multipliers: # <<<<<<<<<<<<<< @@ -17002,7 +16740,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":610 + /* "constraint/constraints.py":617 * 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 # <<<<<<<<<<<<<< @@ -17019,9 +16757,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:; @@ -17036,7 +16773,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":623 +/* "constraint/constraints.py":630 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -17087,53 +16824,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, 623, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 630, __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, 623, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 630, __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, 623, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 630, __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, 623, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 630, __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, 623, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 630, __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, 623, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 630, __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, 623, __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, 630, __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, 623, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 630, __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, 623, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 630, __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, 623, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 630, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 623, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 630, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 623, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 630, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 623, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 630, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -17147,7 +16884,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, 623, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 630, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -17158,8 +16895,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, 623, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 623, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 630, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 630, __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 */ @@ -17191,44 +16928,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":624 + /* "constraint/constraints.py":631 * * 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, 624, __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, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":626 + /* "constraint/constraints.py":633 * 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, 626, __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, 633, __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, 626, __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, 633, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":627 + /* "constraint/constraints.py":634 * * if self.target_var not in assignments: * return True # can't evaluate without target, defer to later # <<<<<<<<<<<<<< @@ -17240,7 +16976,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":626 + /* "constraint/constraints.py":633 * multipliers = self._multipliers * * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -17249,22 +16985,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":629 + /* "constraint/constraints.py":636 * 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, 629, __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, 636, __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, 629, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 636, __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":630 + /* "constraint/constraints.py":637 * * target_value = assignments[self.target_var] * sum_value = 0 # <<<<<<<<<<<<<< @@ -17274,17 +17010,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":632 + /* "constraint/constraints.py":639 * 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, 632, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 639, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":633 + /* "constraint/constraints.py":640 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -17292,64 +17028,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, 633, __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, 640, __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, 633, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __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, 633, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 640, __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, 633, __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, 640, __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, 633, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 640, __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_GetItemRefFast(__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, 633, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 640, __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, 633, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __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, 633, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 640, __pyx_L1_error) PyErr_Clear(); } break; @@ -17362,40 +17095,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, 633, __pyx_L1_error) + __PYX_ERR(0, 640, __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, 633, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 640, __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, 633, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 640, __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, 633, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 640, __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, 633, __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, 640, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; @@ -17403,43 +17136,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, 633, __pyx_L1_error) + __PYX_ERR(0, 640, __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":634 + /* "constraint/constraints.py":641 * 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, 634, __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, 641, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":635 + /* "constraint/constraints.py":642 * 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, 635, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 642, __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, 635, __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, 642, __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, 635, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 642, __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":634 + /* "constraint/constraints.py":641 * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: # <<<<<<<<<<<<<< @@ -17449,7 +17182,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ goto __pyx_L9; } - /* "constraint/constraints.py":637 + /* "constraint/constraints.py":644 * sum_value += assignments[var] * multiplier * else: * sum_value += max(domains[var] * multiplier) # use max value if not assigned # <<<<<<<<<<<<<< @@ -17457,33 +17190,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, 637, __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, 644, __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, 644, __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, 637, __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, 637, __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, 644, __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, 637, __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, 644, __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":633 + /* "constraint/constraints.py":640 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -17493,7 +17223,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":632 + /* "constraint/constraints.py":639 * sum_value = 0 * * if multipliers: # <<<<<<<<<<<<<< @@ -17503,7 +17233,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ goto __pyx_L4; } - /* "constraint/constraints.py":639 + /* "constraint/constraints.py":646 * sum_value += max(domains[var] * multiplier) # use max value if not assigned * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -17511,52 +17241,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, 639, __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, 646, __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, 639, __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, 639, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 646, __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, 646, __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, 639, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 646, __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_GetItemRefFast(__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, 639, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 646, __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, 639, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __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, 639, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 646, __pyx_L1_error) PyErr_Clear(); } break; @@ -17566,32 +17296,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":640 + /* "constraint/constraints.py":647 * 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, 640, __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, 647, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":641 + /* "constraint/constraints.py":648 * 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, 641, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 648, __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, 641, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __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":640 + /* "constraint/constraints.py":647 * else: * for var in self.sum_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -17601,7 +17331,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ goto __pyx_L13; } - /* "constraint/constraints.py":643 + /* "constraint/constraints.py":650 * sum_value += assignments[var] * else: * sum_value += max(domains[var]) # use max value if not assigned # <<<<<<<<<<<<<< @@ -17610,29 +17340,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, 643, __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, 650, __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, 643, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 650, __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, 643, __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, 650, __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":639 + /* "constraint/constraints.py":646 * sum_value += max(domains[var] * multiplier) # use max value if not assigned * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -17640,11 +17367,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":645 + /* "constraint/constraints.py":652 * sum_value += max(domains[var]) # use max value if not assigned * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -17654,29 +17381,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __pyx_t_2 = PyFloat_Check(__pyx_v_sum_value); if (__pyx_t_2) { - /* "constraint/constraints.py":646 + /* "constraint/constraints.py":653 * * 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, 646, __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, 653, __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":645 + /* "constraint/constraints.py":652 * sum_value += max(domains[var]) # use max value if not assigned * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -17685,7 +17409,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":648 + /* "constraint/constraints.py":655 * sum_value = round(sum_value, 10) * * return sum_value >= target_value # <<<<<<<<<<<<<< @@ -17693,12 +17417,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, 648, __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, 655, __pyx_L1_error) + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; goto __pyx_L0; - /* "constraint/constraints.py":623 + /* "constraint/constraints.py":630 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -17711,9 +17435,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:; @@ -17727,7 +17450,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":667 +/* "constraint/constraints.py":674 * """ * * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -17777,41 +17500,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, 667, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 674, __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, 667, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 674, __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, 667, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 674, __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, 667, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 674, __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, 667, __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, 674, __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, 667, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 674, __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, 667, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 674, __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, 667, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 674, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 667, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 674, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -17823,7 +17546,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, 667, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 674, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -17853,49 +17576,49 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":676 + /* "constraint/constraints.py":683 * 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, 676, __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, 683, __pyx_L1_error) - /* "constraint/constraints.py":677 + /* "constraint/constraints.py":684 * """ * 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, 677, __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, 684, __pyx_L1_error) - /* "constraint/constraints.py":678 + /* "constraint/constraints.py":685 * 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, 678, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 685, __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, 678, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min, __pyx_t_1) < (0)) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":679 + /* "constraint/constraints.py":686 * self._multipliers = multipliers * self._var_min = {} * self._var_is_negative = {} # <<<<<<<<<<<<<< * * 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, 679, __pyx_L1_error) + __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_is_negative, __pyx_t_1) < 0) __PYX_ERR(0, 679, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_is_negative, __pyx_t_1) < (0)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":667 + /* "constraint/constraints.py":674 * """ * * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -17916,7 +17639,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ return __pyx_r; } -/* "constraint/constraints.py":681 +/* "constraint/constraints.py":688 * self._var_is_negative = {} * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -17967,50 +17690,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, 681, __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 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 681, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 688, __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, 681, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 688, __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, 681, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 688, __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, 681, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 688, __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, 681, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 688, __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, 681, __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, 688, __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, 681, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 688, __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, 681, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 688, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 681, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 688, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 681, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 688, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 681, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 688, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 681, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 688, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -18020,7 +17743,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, 681, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 688, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18031,9 +17754,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, 681, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 681, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 681, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 688, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 688, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 688, __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 */ @@ -18086,7 +17809,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":682 + /* "constraint/constraints.py":689 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -18094,9 +17817,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * 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, 682, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 689, __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, 682, __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, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -18113,39 +17836,39 @@ 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, 682, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":683 + /* "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) * 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, 683, __pyx_L1_error) + __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, 690, __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, 683, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 690, __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, 683, __pyx_L1_error) + __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, 690, __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, 683, __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, 683, __pyx_L1_error) + __pyx_t_7 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 690, __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, 690, __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, 683, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 690, __pyx_L1_error); } } __pyx_t_1 = __pyx_t_4; @@ -18154,19 +17877,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":684 + /* "constraint/constraints.py":691 * 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_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __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, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_maxsum = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":685 + /* "constraint/constraints.py":692 * 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 # <<<<<<<<<<<<<< @@ -18174,64 +17897,61 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * # preprocess the domains to remove values that cannot contribute to the sum */ { /* enter inner scope */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 685, __pyx_L5_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_3 = __pyx_builtin_zip; __pyx_t_5 = 1; { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_variables, __pyx_v_multipliers}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L5_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L5_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_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L5_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, 685, __pyx_L5_error) + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __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, 692, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_2))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + 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, 685, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 692, __pyx_L5_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_7); + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + 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, 685, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 692, __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_3, __pyx_t_7)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L5_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L5_error) } else { - __pyx_t_4 = __pyx_t_8(__pyx_t_3); + __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, 685, __pyx_L5_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 692, __pyx_L5_error) PyErr_Clear(); } break; @@ -18244,40 +17964,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 685, __pyx_L5_error) + __PYX_ERR(0, 692, __pyx_L5_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_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_2 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L5_error) - __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 685, __pyx_L5_error) + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L5_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 692, __pyx_L5_error) __Pyx_XGOTREF(__pyx_t_9); } #else - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 685, __pyx_L5_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 692, __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, 685, __pyx_L5_error) + __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 692, __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_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); + 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, 685, __pyx_L5_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 692, __pyx_L5_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L9_unpacking_done; @@ -18285,35 +18005,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 685, __pyx_L5_error) + __PYX_ERR(0, 692, __pyx_L5_error) __pyx_L9_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_variable, __pyx_t_2); - __pyx_t_2 = 0; + __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_INCREF(__pyx_builtin_min); - __pyx_t_2 = __pyx_builtin_min; - __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr12__pyx_v_variable); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 685, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr12__pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_10}; - __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)); + 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_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); } - __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_9genexpr12__pyx_v_multiplier); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_9genexpr12__pyx_v_multiplier); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __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_2))) __PYX_ERR(0, 685, __pyx_L5_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_9genexpr12__pyx_v_variable, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 692, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __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; @@ -18323,26 +18040,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc 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, 685, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min, __pyx_t_1) < (0)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":688 + /* "constraint/constraints.py":695 * * # 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_t_3 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_2 = __pyx_builtin_zip; + __pyx_t_2 = NULL; __pyx_t_5 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __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_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error) + 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, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -18350,9 +18064,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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, 688, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __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, 688, __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, 695, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -18361,17 +18075,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 688, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 695, __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_GetItemRefFast(__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, 688, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 695, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -18382,13 +18096,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __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, 688, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 695, __pyx_L1_error) PyErr_Clear(); } break; @@ -18401,7 +18115,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 688, __pyx_L1_error) + __PYX_ERR(0, 695, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -18410,39 +18124,39 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_4); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 695, __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, 688, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 695, __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_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 688, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 695, __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_10); - index = 0; __pyx_t_3 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L14_unpacking_failed; + __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_10); if (unlikely(!__pyx_t_4)) goto __pyx_L14_unpacking_failed; + 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_10), 2) < 0) __PYX_ERR(0, 688, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 695, __pyx_L1_error) __pyx_t_11 = NULL; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L15_unpacking_done; __pyx_L14_unpacking_failed:; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 688, __pyx_L1_error) + __PYX_ERR(0, 695, __pyx_L1_error) __pyx_L15_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); @@ -18450,19 +18164,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":689 + /* "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) * for value in domain[:]: */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":690 + /* "constraint/constraints.py":697 * for variable, multiplier in zip(variables, multipliers): * domain = domains[variable] * other_vars_min = sum_other_vars(variables, variable, self._var_min) # <<<<<<<<<<<<<< @@ -18470,10 +18184,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if value * multiplier + other_vars_min > maxsum: */ __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, 690, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_sum_other_vars); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 690, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __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, 697, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { @@ -18487,34 +18201,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_variables, __pyx_v_variable, __pyx_t_10}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + 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_10); __pyx_t_10 = 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, 690, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __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":691 + /* "constraint/constraints.py":698 * 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_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, 691, __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, 698, __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, 691, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __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, 691, __pyx_L1_error) + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 698, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -18523,17 +18237,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 691, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 698, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12); + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__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, 691, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 698, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -18544,13 +18258,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __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, 691, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 698, __pyx_L1_error) PyErr_Clear(); } break; @@ -18560,44 +18274,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":692 + /* "constraint/constraints.py":699 * 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_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyNumber_Add(__pyx_t_1, __pyx_v_other_vars_min); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 692, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyNumber_Add(__pyx_t_1, __pyx_v_other_vars_min); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 692, __pyx_L1_error) + __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, 699, __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, 699, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "constraint/constraints.py":693 + /* "constraint/constraints.py":700 * for value in domain[:]: * if value * multiplier + other_vars_min > maxsum: * domain.remove(value) # <<<<<<<<<<<<<< * - * # recalculate the min and max after pruning + * # recalculate the min after pruning */ - __pyx_t_10 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_10); + __pyx_t_9 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_9); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __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_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error) + 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, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":692 + /* "constraint/constraints.py":699 * other_vars_min = sum_other_vars(variables, variable, self._var_min) * for value in domain[:]: * if value * multiplier + other_vars_min > maxsum: # <<<<<<<<<<<<<< @@ -18606,7 +18320,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc */ } - /* "constraint/constraints.py":691 + /* "constraint/constraints.py":698 * domain = domains[variable] * other_vars_min = sum_other_vars(variables, variable, self._var_min) * for value in domain[:]: # <<<<<<<<<<<<<< @@ -18616,7 +18330,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":688 + /* "constraint/constraints.py":695 * * # preprocess the domains to remove values that cannot contribute to the sum * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -18626,72 +18340,69 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":696 + /* "constraint/constraints.py":703 * - * # recalculate the min and max after pruning - * self._var_min = { variable: min(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 # <<<<<<<<<<<<<< + * # 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 } * */ { /* enter inner scope */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L23_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_10 = __pyx_builtin_zip; __pyx_t_5 = 1; { PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_variables, __pyx_v_multipliers}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __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_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_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L23_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_3); } if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_10 = __pyx_t_3; __Pyx_INCREF(__pyx_t_10); + __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 696, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 696, __pyx_L23_error) + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __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, 703, __pyx_L23_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_10))) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); + 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, 696, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 703, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_7); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10); + 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, 696, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 703, __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_10, __pyx_t_7)); + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_7); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L23_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __pyx_L23_error) } else { - __pyx_t_3 = __pyx_t_8(__pyx_t_10); + __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, 696, __pyx_L23_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 703, __pyx_L23_error) PyErr_Clear(); } break; @@ -18704,76 +18415,85 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 696, __pyx_L23_error) + __PYX_ERR(0, 703, __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, 0); + __Pyx_INCREF(__pyx_t_9); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_4); } else { - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L23_error) - __Pyx_XGOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L23_error) + __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 703, __pyx_L23_error) + __Pyx_XGOTREF(__pyx_t_9); + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_4); } #else - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L23_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 703, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_4); #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, 696, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 703, __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_9); - index = 0; __pyx_t_1 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L26_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - index = 1; __pyx_t_4 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L26_unpacking_failed; + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); + 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); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 2) < 0) __PYX_ERR(0, 696, __pyx_L23_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 703, __pyx_L23_error) __pyx_t_11 = NULL; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L27_unpacking_done; __pyx_L26_unpacking_failed:; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 696, __pyx_L23_error) + __PYX_ERR(0, 703, __pyx_L23_error) __pyx_L27_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_variable, __pyx_t_1); - __pyx_t_1 = 0; + __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_t_4 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_1 = __pyx_builtin_min; - __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr13__pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 696, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = 1; - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_9}; - __pyx_t_3 = __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_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr13__pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __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, 703, __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, 703, __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, 703, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); + } + __pyx_t_10 = PyNumber_Multiply(__pyx_t_4, __pyx_9genexpr13__pyx_v_multiplier); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 703, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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; } - __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_9genexpr13__pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr13__pyx_v_variable, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 703, __pyx_L23_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr13__pyx_v_variable, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 696, __pyx_L23_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __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; @@ -18783,81 +18503,81 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc 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, 696, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min, __pyx_t_2) < (0)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":697 - * # recalculate the min and max after pruning - * self._var_min = { variable: min(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + /* "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 } # <<<<<<<<<<<<<< * * 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, 697, __pyx_L32_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L32_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { - __pyx_t_10 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_10); + __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 697, __pyx_L32_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 697, __pyx_L32_error) + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __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, 704, __pyx_L32_error) } for (;;) { if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_10))) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); + 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, 697, __pyx_L32_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 704, __pyx_L32_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_7); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10); + 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, 697, __pyx_L32_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 704, __pyx_L32_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_10, __pyx_t_7)); + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_7); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L32_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L32_error) } else { - __pyx_t_1 = __pyx_t_8(__pyx_t_10); - 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, 697, __pyx_L32_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 704, __pyx_L32_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_9genexpr14__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, 697, __pyx_L32_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_9genexpr14__pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L32_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L32_error) + __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_variable, __pyx_t_3); + __pyx_t_3 = 0; + __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, 704, __pyx_L32_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_9genexpr14__pyx_v_variable); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 704, __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, 704, __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, 704, __pyx_L32_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr14__pyx_v_variable, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 697, __pyx_L32_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __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:; @@ -18865,10 +18585,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc 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, 697, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_is_negative, __pyx_t_2) < (0)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":681 + /* "constraint/constraints.py":688 * self._var_is_negative = {} * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -18906,7 +18626,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc return __pyx_r; } -/* "constraint/constraints.py":699 +/* "constraint/constraints.py":706 * 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 # <<<<<<<<<<<<<< @@ -18957,53 +18677,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, 699, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 706, __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, 699, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 706, __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, 699, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 706, __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, 699, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 706, __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, 699, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 706, __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, 699, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 706, __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, 699, __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, 706, __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, 699, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 706, __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, 699, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 706, __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, 699, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 706, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 699, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 706, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 699, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 706, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 699, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 706, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -19017,7 +18737,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, 699, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 706, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19028,8 +18748,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, 699, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 699, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 706, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 706, __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 */ @@ -19065,10 +18785,10 @@ 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 *); @@ -19080,31 +18800,31 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":700 + /* "constraint/constraints.py":707 * * 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, 700, __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, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":701 + /* "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 * 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, 701, __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, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_maxsum = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":702 + /* "constraint/constraints.py":709 * multipliers = self._multipliers * maxsum = self._maxsum * sum = 0 # <<<<<<<<<<<<<< @@ -19114,7 +18834,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":703 + /* "constraint/constraints.py":710 * maxsum = self._maxsum * sum = 0 * min_sum_missing = 0 # <<<<<<<<<<<<<< @@ -19124,7 +18844,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_min_sum_missing = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":704 + /* "constraint/constraints.py":711 * sum = 0 * min_sum_missing = 0 * missing = False # <<<<<<<<<<<<<< @@ -19133,7 +18853,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ __pyx_v_missing = 0; - /* "constraint/constraints.py":705 + /* "constraint/constraints.py":712 * min_sum_missing = 0 * missing = False * missing_negative = False # <<<<<<<<<<<<<< @@ -19142,17 +18862,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ __pyx_v_missing_negative = 0; - /* "constraint/constraints.py":706 + /* "constraint/constraints.py":713 * 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, 706, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 713, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":707 + /* "constraint/constraints.py":714 * missing_negative = False * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -19160,61 +18880,58 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * 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, 707, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __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, 707, __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, 707, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 714, __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, 714, __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, 707, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 714, __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_GetItemRefFast(__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, 707, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 714, __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, 707, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __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, 707, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 714, __pyx_L1_error) PyErr_Clear(); } break; @@ -19227,40 +18944,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, 707, __pyx_L1_error) + __PYX_ERR(0, 714, __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, 707, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 707, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 714, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 714, __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, 707, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 707, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 714, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 714, __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, 707, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 714, __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, 707, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 714, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; @@ -19268,43 +18985,43 @@ 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, 707, __pyx_L1_error) + __PYX_ERR(0, 714, __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":708 + /* "constraint/constraints.py":715 * 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, 708, __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, 715, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":709 + /* "constraint/constraints.py":716 * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< * 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, 709, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __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, 709, __pyx_L1_error) + __pyx_t_8 = PyNumber_Multiply(__pyx_t_1, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 716, __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, 709, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __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":708 + /* "constraint/constraints.py":715 * if multipliers: * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: # <<<<<<<<<<<<<< @@ -19314,7 +19031,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ goto __pyx_L8; } - /* "constraint/constraints.py":711 + /* "constraint/constraints.py":718 * sum += assignments[variable] * multiplier * else: * min_sum_missing += self._var_min[variable] # <<<<<<<<<<<<<< @@ -19322,18 +19039,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * 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, 711, __pyx_L1_error) + __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, 718, __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, 711, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 718, __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, 711, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_min_sum_missing, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 718, __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":712 + /* "constraint/constraints.py":719 * else: * min_sum_missing += self._var_min[variable] * missing = True # <<<<<<<<<<<<<< @@ -19342,23 +19059,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ __pyx_v_missing = 1; - /* "constraint/constraints.py":713 + /* "constraint/constraints.py":720 * 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, 713, __pyx_L1_error) + __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, 720, __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, 713, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 720, __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, 713, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":714 + /* "constraint/constraints.py":721 * missing = True * if self._var_is_negative[variable]: * missing_negative = True # <<<<<<<<<<<<<< @@ -19367,7 +19084,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ __pyx_v_missing_negative = 1; - /* "constraint/constraints.py":713 + /* "constraint/constraints.py":720 * min_sum_missing += self._var_min[variable] * missing = True * if self._var_is_negative[variable]: # <<<<<<<<<<<<<< @@ -19378,7 +19095,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __pyx_L8:; - /* "constraint/constraints.py":707 + /* "constraint/constraints.py":714 * missing_negative = False * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -19386,9 +19103,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * 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":715 + /* "constraint/constraints.py":722 * if self._var_is_negative[variable]: * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -19398,7 +19115,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_t_2 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_2) { - /* "constraint/constraints.py":716 + /* "constraint/constraints.py":723 * missing_negative = True * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< @@ -19406,21 +19123,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * return False */ __pyx_t_8 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_1 = __pyx_builtin_round; - __pyx_t_5 = 1; + __pyx_t_4 = 1; { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_sum, __pyx_mstate_global->__pyx_int_10}; - __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_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_4)) __PYX_ERR(0, 716, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 723, __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":715 + /* "constraint/constraints.py":722 * if self._var_is_negative[variable]: * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -19429,22 +19143,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":717 + /* "constraint/constraints.py":724 * if isinstance(sum, float): * sum = round(sum, 10) * if sum + min_sum_missing > maxsum: # <<<<<<<<<<<<<< * return False * if forwardcheck and missing and not missing_negative: */ - __pyx_t_4 = PyNumber_Add(__pyx_v_sum, __pyx_v_min_sum_missing); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 717, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 717, __pyx_L1_error) - __Pyx_DECREF(__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, 724, __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, 724, __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, 724, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":718 + /* "constraint/constraints.py":725 * sum = round(sum, 10) * if sum + min_sum_missing > maxsum: * return False # <<<<<<<<<<<<<< @@ -19456,7 +19170,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":717 + /* "constraint/constraints.py":724 * if isinstance(sum, float): * sum = round(sum, 10) * if sum + min_sum_missing > maxsum: # <<<<<<<<<<<<<< @@ -19465,14 +19179,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":719 + /* "constraint/constraints.py":726 * if sum + min_sum_missing > maxsum: * return False * 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, 719, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 726, __pyx_L1_error) if (__pyx_t_11) { } else { __pyx_t_2 = __pyx_t_11; @@ -19488,115 +19202,112 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_L14_bool_binop_done:; if (__pyx_t_2) { - /* "constraint/constraints.py":720 + /* "constraint/constraints.py":727 * return False * 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_4 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_8 = __pyx_builtin_zip; - __pyx_t_5 = 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_8, __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_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + 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, 727, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); - __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_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 720, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 720, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 727, __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, 727, __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_7)) { - if (likely(PyList_CheckExact(__pyx_t_8))) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); + 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, 720, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 727, __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_8, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_5; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); + 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, 720, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 727, __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_8, __pyx_t_6)); + __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_8, __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_1)) __PYX_ERR(0, 720, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 727, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_7(__pyx_t_8); - if (unlikely(!__pyx_t_1)) { + __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, 720, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 727, __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; + __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, 720, __pyx_L1_error) + __PYX_ERR(0, 727, __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_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_4 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 720, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 720, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 727, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); } #else - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 720, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 720, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 727, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 720, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L19_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_L19_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 720, __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, 727, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L20_unpacking_done; @@ -19604,136 +19315,136 @@ 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, 720, __pyx_L1_error) + __PYX_ERR(0, 727, __pyx_L1_error) __pyx_L20_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_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":721 + /* "constraint/constraints.py":728 * 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, 721, __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, 728, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":722 + /* "constraint/constraints.py":729 * 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_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __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, 729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":723 + /* "constraint/constraints.py":730 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< * if sum + value * multiplier > maxsum: * 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, 723, __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_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, 730, __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_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 723, __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, 723, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 730, __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, 730, __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_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, 723, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 730, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12); + __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__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, 723, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 730, __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)); + __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_12)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_12); #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 723, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 730, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_13(__pyx_t_3); - if (unlikely(!__pyx_t_1)) { + __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, 723, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 730, __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":724 + /* "constraint/constraints.py":731 * domain = domains[variable] * for value in domain[:]: * if sum + value * multiplier > maxsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ - __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 724, __pyx_L1_error) + __pyx_t_8 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 731, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyNumber_Add(__pyx_v_sum, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Add(__pyx_v_sum, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 724, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 724, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 724, __pyx_L1_error) + __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, 731, __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, 731, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":725 + /* "constraint/constraints.py":732 * for value in domain[:]: * if sum + value * multiplier > maxsum: * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False */ - __pyx_t_4 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_4); - __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_4, __pyx_v_value}; - __pyx_t_1 = __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_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + 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, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":724 + /* "constraint/constraints.py":731 * domain = domains[variable] * for value in domain[:]: * if sum + value * multiplier > maxsum: # <<<<<<<<<<<<<< @@ -19742,7 +19453,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":723 + /* "constraint/constraints.py":730 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -19750,20 +19461,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":726 + /* "constraint/constraints.py":733 * 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, 726, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 733, __pyx_L1_error) __pyx_t_11 = (!__pyx_t_2); if (__pyx_t_11) { - /* "constraint/constraints.py":727 + /* "constraint/constraints.py":734 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -19773,10 +19484,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_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "constraint/constraints.py":726 + /* "constraint/constraints.py":733 * if sum + value * multiplier > maxsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -19785,7 +19496,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":721 + /* "constraint/constraints.py":728 * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: # <<<<<<<<<<<<<< @@ -19794,7 +19505,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":720 + /* "constraint/constraints.py":727 * return False * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -19802,9 +19513,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * domain = domains[variable] */ } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":719 + /* "constraint/constraints.py":726 * if sum + min_sum_missing > maxsum: * return False * if forwardcheck and missing and not missing_negative: # <<<<<<<<<<<<<< @@ -19813,7 +19524,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":706 + /* "constraint/constraints.py":713 * missing = False * missing_negative = False * if multipliers: # <<<<<<<<<<<<<< @@ -19823,7 +19534,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ goto __pyx_L3; } - /* "constraint/constraints.py":729 + /* "constraint/constraints.py":736 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -19832,83 +19543,83 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { - __pyx_t_8 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_8); - __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_8 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 729, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 729, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 736, __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, 736, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_8))) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); + 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, 729, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 736, __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_8, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_5; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); + 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, 729, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 736, __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_8, __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_8, __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, 729, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 736, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_7(__pyx_t_8); - 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, 729, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 736, __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":730 + /* "constraint/constraints.py":737 * 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, 730, __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, 737, __pyx_L1_error) if (__pyx_t_11) { - /* "constraint/constraints.py":731 + /* "constraint/constraints.py":738 * for variable in variables: * if variable in assignments: * sum += assignments[variable] # <<<<<<<<<<<<<< * 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, 731, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 738, __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, 738, __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":730 + /* "constraint/constraints.py":737 * else: * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -19918,7 +19629,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ goto __pyx_L30; } - /* "constraint/constraints.py":733 + /* "constraint/constraints.py":740 * sum += assignments[variable] * else: * min_sum_missing += self._var_min[variable] # <<<<<<<<<<<<<< @@ -19926,18 +19637,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * 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, 733, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 733, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_min_sum_missing, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 733, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_min_sum_missing, __pyx_t_1); - __pyx_t_1 = 0; + __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, 740, __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, 740, __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, 740, __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":734 + /* "constraint/constraints.py":741 * else: * min_sum_missing += self._var_min[variable] * missing = True # <<<<<<<<<<<<<< @@ -19946,23 +19657,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ __pyx_v_missing = 1; - /* "constraint/constraints.py":735 + /* "constraint/constraints.py":742 * 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, 735, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 735, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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, 742, __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, 742, __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, 742, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_11) { - /* "constraint/constraints.py":736 + /* "constraint/constraints.py":743 * missing = True * if self._var_is_negative[variable]: * missing_negative = True # <<<<<<<<<<<<<< @@ -19971,7 +19682,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ __pyx_v_missing_negative = 1; - /* "constraint/constraints.py":735 + /* "constraint/constraints.py":742 * min_sum_missing += self._var_min[variable] * missing = True * if self._var_is_negative[variable]: # <<<<<<<<<<<<<< @@ -19982,7 +19693,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __pyx_L30:; - /* "constraint/constraints.py":729 + /* "constraint/constraints.py":736 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -19990,9 +19701,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * sum += assignments[variable] */ } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":737 + /* "constraint/constraints.py":744 * if self._var_is_negative[variable]: * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -20002,29 +19713,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_t_11 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_11) { - /* "constraint/constraints.py":738 + /* "constraint/constraints.py":745 * missing_negative = True * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< * if sum + min_sum_missing > maxsum: * return False */ - __pyx_t_3 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_1 = __pyx_builtin_round; - __pyx_t_5 = 1; + __pyx_t_7 = NULL; + __pyx_t_4 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_sum, __pyx_mstate_global->__pyx_int_10}; - __pyx_t_8 = __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_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 738, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + 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, 745, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_8); - __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":737 + /* "constraint/constraints.py":744 * if self._var_is_negative[variable]: * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -20033,22 +19741,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":739 + /* "constraint/constraints.py":746 * if isinstance(sum, float): * sum = round(sum, 10) * if sum + min_sum_missing > maxsum: # <<<<<<<<<<<<<< * return False * if forwardcheck and missing and not missing_negative: */ - __pyx_t_8 = PyNumber_Add(__pyx_v_sum, __pyx_v_min_sum_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 739, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 739, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 739, __pyx_L1_error) - __Pyx_DECREF(__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, 746, __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, 746, __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, 746, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_11) { - /* "constraint/constraints.py":740 + /* "constraint/constraints.py":747 * sum = round(sum, 10) * if sum + min_sum_missing > maxsum: * return False # <<<<<<<<<<<<<< @@ -20060,7 +19768,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":739 + /* "constraint/constraints.py":746 * if isinstance(sum, float): * sum = round(sum, 10) * if sum + min_sum_missing > maxsum: # <<<<<<<<<<<<<< @@ -20069,14 +19777,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":741 + /* "constraint/constraints.py":748 * if sum + min_sum_missing > maxsum: * return False * 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, 741, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 748, __pyx_L1_error) if (__pyx_t_2) { } else { __pyx_t_11 = __pyx_t_2; @@ -20092,7 +19800,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_L36_bool_binop_done:; if (__pyx_t_11) { - /* "constraint/constraints.py":742 + /* "constraint/constraints.py":749 * return False * if forwardcheck and missing and not missing_negative: * for variable in variables: # <<<<<<<<<<<<<< @@ -20100,176 +19808,176 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * 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, 742, __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, 742, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 749, __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, 749, __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, 742, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 749, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__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, 742, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 749, __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_8 = __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_8 = __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_8)) __PYX_ERR(0, 742, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error) } else { - __pyx_t_8 = __pyx_t_7(__pyx_t_1); - if (unlikely(!__pyx_t_8)) { + __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, 742, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 749, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_8); - __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":743 + /* "constraint/constraints.py":750 * 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, 743, __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, 750, __pyx_L1_error) if (__pyx_t_11) { - /* "constraint/constraints.py":744 + /* "constraint/constraints.py":751 * for variable in variables: * if variable not in assignments: * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if sum + value > maxsum: */ - __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 744, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_8); - __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":745 + /* "constraint/constraints.py":752 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< * if sum + value > maxsum: * domain.hideValue(value) */ - __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, 745, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - 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_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, 752, __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_3 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 745, __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, 745, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 752, __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, 752, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_8))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + 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, 745, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 752, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_8, __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_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 745, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 752, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12)); + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_12)); #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_12); #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 745, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 752, __pyx_L1_error) } else { - __pyx_t_8 = __pyx_t_13(__pyx_t_3); - if (unlikely(!__pyx_t_8)) { + __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, 745, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 752, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8); - __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":746 + /* "constraint/constraints.py":753 * domain = domains[variable] * for value in domain[:]: * if sum + value > maxsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ - __pyx_t_8 = PyNumber_Add(__pyx_v_sum, __pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __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, 746, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 746, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_v_sum, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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, 753, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 753, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { - /* "constraint/constraints.py":747 + /* "constraint/constraints.py":754 * for value in domain[:]: * if sum + value > 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_3 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_3); + __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, 747, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + PyObject *__pyx_callargs[2] = {__pyx_t_3, __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_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":746 + /* "constraint/constraints.py":753 * domain = domains[variable] * for value in domain[:]: * if sum + value > maxsum: # <<<<<<<<<<<<<< @@ -20278,7 +19986,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":745 + /* "constraint/constraints.py":752 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -20286,20 +19994,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_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":748 + /* "constraint/constraints.py":755 * if sum + value > maxsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False * return True */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 748, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 755, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_11); if (__pyx_t_2) { - /* "constraint/constraints.py":749 + /* "constraint/constraints.py":756 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -20309,10 +20017,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":748 + /* "constraint/constraints.py":755 * if sum + value > maxsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -20321,7 +20029,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":743 + /* "constraint/constraints.py":750 * if forwardcheck and missing and not missing_negative: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -20330,7 +20038,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":742 + /* "constraint/constraints.py":749 * return False * if forwardcheck and missing and not missing_negative: * for variable in variables: # <<<<<<<<<<<<<< @@ -20338,9 +20046,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * domain = domains[variable] */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":741 + /* "constraint/constraints.py":748 * if sum + min_sum_missing > maxsum: * return False * if forwardcheck and missing and not missing_negative: # <<<<<<<<<<<<<< @@ -20351,7 +20059,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __pyx_L3:; - /* "constraint/constraints.py":750 + /* "constraint/constraints.py":757 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -20363,7 +20071,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":699 + /* "constraint/constraints.py":706 * 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 # <<<<<<<<<<<<<< @@ -20375,7 +20083,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); @@ -20394,7 +20102,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ return __pyx_r; } -/* "constraint/constraints.py":770 +/* "constraint/constraints.py":777 * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -20445,47 +20153,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, 770, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 777, __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, 770, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 777, __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, 770, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 777, __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, 770, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 777, __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, 770, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 777, __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, 770, __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, 777, __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, 770, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, i); __PYX_ERR(0, 777, __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, 770, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 777, __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, 770, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 777, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 770, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 777, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 770, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 777, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -20498,7 +20206,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, 770, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 777, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20509,7 +20217,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, 770, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 777, __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 */ @@ -20530,7 +20238,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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":786 +/* "constraint/constraints.py":793 * 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." # <<<<<<<<<<<<<< @@ -20550,7 +20258,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ 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, 786, __pyx_L1_error) + __PYX_ERR(0, 793, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -20558,7 +20266,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___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, 786, __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, 793, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -20596,16 +20304,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 786, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 786, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 793, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 793, __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, 786, __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, 793, __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, 786, __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, 793, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -20613,17 +20321,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, 786, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 793, __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_GetItemRefFast(__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, 786, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 793, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -20634,13 +20342,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 786, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 793, __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, 786, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 793, __pyx_L1_error) PyErr_Clear(); } break; @@ -20698,7 +20406,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":770 +/* "constraint/constraints.py":777 * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -20720,44 +20428,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":780 + /* "constraint/constraints.py":787 * 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, 780, __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, 787, __pyx_L1_error) - /* "constraint/constraints.py":781 + /* "constraint/constraints.py":788 * """ * 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, 781, __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, 788, __pyx_L1_error) - /* "constraint/constraints.py":782 + /* "constraint/constraints.py":789 * 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, 782, __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, 789, __pyx_L1_error) - /* "constraint/constraints.py":784 + /* "constraint/constraints.py":791 * 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, 784, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 791, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/constraints.py":785 + /* "constraint/constraints.py":792 * * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." # <<<<<<<<<<<<<< @@ -20766,19 +20474,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, 785, __pyx_L1_error) - __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 785, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_v_multipliers); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 792, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 792, __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, 785, __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, 792, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 785, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 792, __pyx_L1_error) #endif - /* "constraint/constraints.py":786 + /* "constraint/constraints.py":793 * 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." # <<<<<<<<<<<<<< @@ -20787,23 +20495,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, 786, __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, 793, __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, 786, __pyx_L1_error) + __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 793, __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, 786, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 793, __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, 786, __pyx_L1_error) + __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Multipliers_must_be_numbers, 0, 0); + __PYX_ERR(0, 793, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 786, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 793, __pyx_L1_error) #endif - /* "constraint/constraints.py":787 + /* "constraint/constraints.py":794 * 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." # <<<<<<<<<<<<<< @@ -20812,20 +20520,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, 787, __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, 794, __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, 787, __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, 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_Last_multiplier_must_be_1_as_it, 0, 0); - __PYX_ERR(0, 787, __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, 794, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 787, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 794, __pyx_L1_error) #endif - /* "constraint/constraints.py":784 + /* "constraint/constraints.py":791 * self._multipliers = multipliers * * if multipliers: # <<<<<<<<<<<<<< @@ -20834,7 +20542,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":770 + /* "constraint/constraints.py":777 * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< @@ -20857,7 +20565,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":789 +/* "constraint/constraints.py":796 * 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 # <<<<<<<<<<<<<< @@ -20908,50 +20616,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, 789, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 796, __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, 789, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 796, __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, 789, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 796, __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, 789, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 796, __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, 789, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 796, __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, 789, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 796, __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, 789, __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, 796, __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, 789, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 796, __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, 789, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 796, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 789, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 796, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 789, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 796, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 789, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 796, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 789, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 796, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -20961,7 +20669,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, 789, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 796, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20972,9 +20680,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, 789, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 789, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 789, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 796, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 796, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 796, __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 */ @@ -20995,7 +20703,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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":797 +/* "constraint/constraints.py":804 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -21015,7 +20723,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 797, __pyx_L1_error) + __PYX_ERR(0, 804, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -21026,7 +20734,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_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, 797, __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, 804, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -21053,8 +20761,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; @@ -21070,17 +20777,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, 797, __pyx_L1_error) + __PYX_ERR(0, 804, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 797, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 804, __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, 797, __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, 804, __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, 797, __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, 804, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -21088,17 +20795,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, 797, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 804, __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_GetItemRefFast(__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, 797, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 804, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -21109,13 +20816,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 797, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 804, __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, 797, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 804, __pyx_L1_error) PyErr_Clear(); } break; @@ -21126,29 +20833,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, 797, __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, 797, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 797, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_var)) { __Pyx_RaiseClosureNameError("var"); __PYX_ERR(0, 804, __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, 804, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 804, __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, 797, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains)) { __Pyx_RaiseClosureNameError("domains"); __PYX_ERR(0, 804, __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, 797, __pyx_L1_error) + __PYX_ERR(0, 804, __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, 797, __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, 804, __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, 797, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = __pyx_t_4; @@ -21169,7 +20873,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, 797, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 804, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -21183,7 +20887,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); @@ -21199,7 +20902,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":789 +/* "constraint/constraints.py":796 * 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 # <<<<<<<<<<<<<< @@ -21226,11 +20929,10 @@ 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; @@ -21239,7 +20941,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 789, __pyx_L1_error) + __PYX_ERR(0, 796, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -21247,7 +20949,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":790 + /* "constraint/constraints.py":797 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -21255,9 +20957,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, 790, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 797, __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, 790, __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, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -21274,54 +20976,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, 790, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":792 + /* "constraint/constraints.py":799 * 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, 792, __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, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":794 + /* "constraint/constraints.py":801 * 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, 794, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 801, __pyx_L1_error) __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { - /* "constraint/constraints.py":795 + /* "constraint/constraints.py":802 * * 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, 795, __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, 802, __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, 795, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 802, __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, 795, __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, 802, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -21330,17 +21032,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, 795, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 802, __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_GetItemRefFast(__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, 795, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 802, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -21351,13 +21053,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 795, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 802, __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, 795, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 802, __pyx_L1_error) PyErr_Clear(); } break; @@ -21369,19 +21071,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":796 + /* "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) * 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, 796, __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, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":797 + /* "constraint/constraints.py":804 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -21389,79 +21091,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, 797, __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, 804, __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, 804, __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, 797, __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, 797, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __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":798 + /* "constraint/constraints.py":805 * 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, 798, __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, 805, __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, 798, __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, 798, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 805, __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, 805, __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, 798, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 805, __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_GetItemRefFast(__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, 798, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 805, __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, 798, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 805, __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, 798, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 805, __pyx_L1_error) PyErr_Clear(); } break; @@ -21471,60 +21170,57 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":799 + /* "constraint/constraints.py":806 * 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, 799, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_value, __pyx_v_others_min); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 806, __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, 799, __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, 806, __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, 806, __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, 799, __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, 799, __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, 806, __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, 799, __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, 806, __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, 799, __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, 806, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":800 + /* "constraint/constraints.py":807 * 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, 800, __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, 807, __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":799 + /* "constraint/constraints.py":806 * 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]): # <<<<<<<<<<<<<< @@ -21533,7 +21229,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":798 + /* "constraint/constraints.py":805 * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) * for value in domain[:]: # <<<<<<<<<<<<<< @@ -21541,9 +21237,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":795 + /* "constraint/constraints.py":802 * * if not multipliers: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -21553,7 +21249,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":794 + /* "constraint/constraints.py":801 * multipliers = self._multipliers * * if not multipliers: # <<<<<<<<<<<<<< @@ -21562,7 +21258,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":789 + /* "constraint/constraints.py":796 * 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 # <<<<<<<<<<<<<< @@ -21579,9 +21275,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:; @@ -21596,7 +21291,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":802 +/* "constraint/constraints.py":809 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -21647,53 +21342,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, 802, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 809, __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, 802, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 809, __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, 802, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 809, __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, 802, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 809, __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, 802, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 809, __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, 802, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 809, __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, 802, __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, 809, __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, 802, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 809, __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, 802, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 809, __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, 802, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 809, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 802, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 809, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 802, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 809, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 802, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 809, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -21707,7 +21402,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, 802, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 809, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -21718,8 +21413,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, 802, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 802, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 809, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 809, __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 */ @@ -21751,44 +21446,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":803 + /* "constraint/constraints.py":810 * * 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, 803, __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, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":805 + /* "constraint/constraints.py":812 * 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, 805, __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, 812, __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, 805, __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, 812, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":806 + /* "constraint/constraints.py":813 * * if self.target_var not in assignments: * return True # can't evaluate without target, defer to later # <<<<<<<<<<<<<< @@ -21800,7 +21494,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":805 + /* "constraint/constraints.py":812 * multipliers = self._multipliers * * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -21809,22 +21503,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":808 + /* "constraint/constraints.py":815 * 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, 808, __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, 815, __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, 808, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 815, __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":809 + /* "constraint/constraints.py":816 * * target_value = assignments[self.target_var] * sum_value = 0 # <<<<<<<<<<<<<< @@ -21834,17 +21528,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":811 + /* "constraint/constraints.py":818 * 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, 811, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 818, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":812 + /* "constraint/constraints.py":819 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -21852,64 +21546,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, 812, __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, 819, __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, 812, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __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, 812, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 819, __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, 812, __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, 819, __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, 812, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 819, __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_GetItemRefFast(__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, 812, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 819, __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, 812, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __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, 812, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 819, __pyx_L1_error) PyErr_Clear(); } break; @@ -21922,40 +21613,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, 812, __pyx_L1_error) + __PYX_ERR(0, 819, __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, 812, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 819, __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, 812, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 819, __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, 812, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 819, __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, 812, __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, 819, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; @@ -21963,43 +21654,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, 812, __pyx_L1_error) + __PYX_ERR(0, 819, __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":813 + /* "constraint/constraints.py":820 * 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, 813, __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, 820, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":814 + /* "constraint/constraints.py":821 * 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, 814, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 821, __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, 814, __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, 821, __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, 814, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 821, __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":813 + /* "constraint/constraints.py":820 * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: # <<<<<<<<<<<<<< @@ -22009,7 +21700,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ goto __pyx_L9; } - /* "constraint/constraints.py":816 + /* "constraint/constraints.py":823 * sum_value += assignments[var] * multiplier * else: * sum_value += min(domains[var] * multiplier) # use min value if not assigned # <<<<<<<<<<<<<< @@ -22017,33 +21708,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, 816, __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, 823, __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, 823, __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, 816, __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, 816, __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, 823, __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, 816, __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, 823, __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":812 + /* "constraint/constraints.py":819 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -22053,7 +21741,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":811 + /* "constraint/constraints.py":818 * sum_value = 0 * * if multipliers: # <<<<<<<<<<<<<< @@ -22063,7 +21751,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ goto __pyx_L4; } - /* "constraint/constraints.py":818 + /* "constraint/constraints.py":825 * sum_value += min(domains[var] * multiplier) # use min value if not assigned * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -22071,52 +21759,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, 818, __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, 825, __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, 818, __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, 818, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 825, __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, 825, __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, 818, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 825, __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_GetItemRefFast(__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, 818, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 825, __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, 818, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 825, __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, 818, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 825, __pyx_L1_error) PyErr_Clear(); } break; @@ -22126,32 +21814,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":819 + /* "constraint/constraints.py":826 * 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, 819, __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, 826, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":820 + /* "constraint/constraints.py":827 * 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, 820, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __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, 820, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __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":819 + /* "constraint/constraints.py":826 * else: * for var in self.sum_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -22161,7 +21849,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ goto __pyx_L13; } - /* "constraint/constraints.py":822 + /* "constraint/constraints.py":829 * sum_value += assignments[var] * else: * sum_value += min(domains[var]) # use min value if not assigned # <<<<<<<<<<<<<< @@ -22170,29 +21858,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, 822, __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, 829, __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, 822, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 829, __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, 822, __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, 829, __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":818 + /* "constraint/constraints.py":825 * sum_value += min(domains[var] * multiplier) # use min value if not assigned * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -22200,11 +21885,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":824 + /* "constraint/constraints.py":831 * sum_value += min(domains[var]) # use min value if not assigned * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -22214,29 +21899,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __pyx_t_2 = PyFloat_Check(__pyx_v_sum_value); if (__pyx_t_2) { - /* "constraint/constraints.py":825 + /* "constraint/constraints.py":832 * * 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, 825, __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, 832, __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":824 + /* "constraint/constraints.py":831 * sum_value += min(domains[var]) # use min value if not assigned * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -22245,7 +21927,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":827 + /* "constraint/constraints.py":834 * sum_value = round(sum_value, 10) * * return sum_value <= target_value # <<<<<<<<<<<<<< @@ -22253,12 +21935,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, 827, __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, 834, __pyx_L1_error) + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; goto __pyx_L0; - /* "constraint/constraints.py":802 + /* "constraint/constraints.py":809 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -22271,9 +21953,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:; @@ -22287,7 +21968,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":846 +/* "constraint/constraints.py":853 * """ * * def __init__(self, exactprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -22336,39 +22017,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, 846, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 853, __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, 846, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 853, __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, 846, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 853, __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, 846, __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, 853, __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, 846, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 853, __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, 846, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 853, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 846, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 853, __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, 846, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 853, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -22398,28 +22079,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint___ini int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":852 + /* "constraint/constraints.py":859 * 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, 852, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exactprod_2, __pyx_v_exactprod) < (0)) __PYX_ERR(0, 859, __pyx_L1_error) - /* "constraint/constraints.py":853 + /* "constraint/constraints.py":860 * """ * self._exactprod = exactprod * self._variable_contains_lt1: list[bool] = list() # <<<<<<<<<<<<<< * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 860, __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, 853, __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, 860, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":846 + /* "constraint/constraints.py":853 * """ * * def __init__(self, exactprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -22440,7 +22121,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint___ini return __pyx_r; } -/* "constraint/constraints.py":855 +/* "constraint/constraints.py":862 * self._variable_contains_lt1: list[bool] = list() * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -22491,50 +22172,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, 855, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 862, __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, 855, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 862, __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, 855, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 862, __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, 855, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 862, __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, 855, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 862, __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, 855, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 862, __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, 855, __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, 862, __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, 855, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 862, __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, 855, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 862, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 855, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 862, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 855, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 862, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 855, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 862, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 855, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 862, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -22544,7 +22225,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, 855, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 862, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -22555,9 +22236,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, 855, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 855, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 855, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 862, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 862, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 862, __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 */ @@ -22578,7 +22259,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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":862 +/* "constraint/constraints.py":869 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -22598,7 +22279,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_10pre if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 862, __pyx_L1_error) + __PYX_ERR(0, 869, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -22606,7 +22287,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_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, 862, __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, 869, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -22643,16 +22324,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 862, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 862, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 869, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 869, __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, 862, __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, 869, __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, 862, __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, 869, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -22660,17 +22341,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, 862, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 869, __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_GetItemRefFast(__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, 862, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 869, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -22681,13 +22362,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 869, __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, 862, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 869, __pyx_L1_error) PyErr_Clear(); } break; @@ -22698,8 +22379,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, 862, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 862, __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, 869, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 869, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_XDECREF(__pyx_r); @@ -22738,7 +22419,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre return __pyx_r; } -/* "constraint/constraints.py":855 +/* "constraint/constraints.py":862 * self._variable_contains_lt1: list[bool] = list() * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -22775,7 +22456,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":856 + /* "constraint/constraints.py":863 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -22783,9 +22464,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, 856, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 863, __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, 856, __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, 863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -22802,27 +22483,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, 856, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":859 + /* "constraint/constraints.py":866 * * # 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, 859, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __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, 859, __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, 866, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":860 + /* "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 # <<<<<<<<<<<<<< @@ -22832,7 +22513,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_INCREF(Py_None); __pyx_v_variable_with_lt1 = Py_None; - /* "constraint/constraints.py":861 + /* "constraint/constraints.py":868 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -22844,9 +22525,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, 861, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 868, __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, 861, __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, 868, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -22854,17 +22535,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, 861, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 868, __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_GetItemRefFast(__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, 861, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 868, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -22875,13 +22556,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 861, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 868, __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, 861, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 868, __pyx_L1_error) PyErr_Clear(); } break; @@ -22891,37 +22572,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":862 + /* "constraint/constraints.py":869 * 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, 862, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 869, __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, 862, __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, 869, __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, 862, __pyx_L1_error) + __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 869, __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":863 + /* "constraint/constraints.py":870 * 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, 863, __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, 870, __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, 863, __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, 870, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":861 + /* "constraint/constraints.py":868 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -22931,7 +22612,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":864 + /* "constraint/constraints.py":871 * 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): # <<<<<<<<<<<<<< @@ -22939,18 +22620,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, 864, __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, 871, __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, 864, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -22958,9 +22636,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, 864, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __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, 864, __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, 871, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -22969,17 +22647,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, 864, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 871, __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_GetItemRefFast(__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, 864, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 871, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -22990,13 +22668,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 864, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __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, 864, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 871, __pyx_L1_error) PyErr_Clear(); } break; @@ -23009,40 +22687,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, 864, __pyx_L1_error) + __PYX_ERR(0, 871, __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, 864, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 864, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __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, 864, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 864, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __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, 864, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 871, __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, 864, __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, 871, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_unpacking_done; @@ -23050,15 +22728,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, 864, __pyx_L1_error) + __PYX_ERR(0, 871, __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":865 + /* "constraint/constraints.py":872 * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: # <<<<<<<<<<<<<< @@ -23068,7 +22746,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":866 + /* "constraint/constraints.py":873 * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< @@ -23078,7 +22756,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":868 + /* "constraint/constraints.py":875 * if variable_with_lt1 is not None: * # if more than one associated variables contain less than 1, we can't prune * return # <<<<<<<<<<<<<< @@ -23090,7 +22768,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/constraints.py":866 + /* "constraint/constraints.py":873 * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< @@ -23099,7 +22777,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ } - /* "constraint/constraints.py":869 + /* "constraint/constraints.py":876 * # if more than one associated variables contain less than 1, we can't prune * return * variable_with_lt1 = variable # <<<<<<<<<<<<<< @@ -23109,7 +22787,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":865 + /* "constraint/constraints.py":872 * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: # <<<<<<<<<<<<<< @@ -23118,7 +22796,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ } - /* "constraint/constraints.py":864 + /* "constraint/constraints.py":871 * 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): # <<<<<<<<<<<<<< @@ -23128,19 +22806,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":872 + /* "constraint/constraints.py":879 * * # 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, 872, __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, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_exactprod = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/constraints.py":873 + /* "constraint/constraints.py":880 * # prune the associated variables of values > exactprod * exactprod = self._exactprod * for variable in variables: # <<<<<<<<<<<<<< @@ -23152,9 +22830,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, 873, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __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, 873, __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, 880, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -23162,17 +22840,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, 873, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 880, __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_GetItemRefFast(__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, 873, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 880, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -23183,13 +22861,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __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, 873, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 880, __pyx_L1_error) PyErr_Clear(); } break; @@ -23199,7 +22877,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":874 + /* "constraint/constraints.py":881 * exactprod = self._exactprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -23212,14 +22890,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, 874, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 874, __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, 881, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 881, __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":875 + /* "constraint/constraints.py":882 * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: * continue # <<<<<<<<<<<<<< @@ -23228,7 +22906,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ goto __pyx_L13_continue; - /* "constraint/constraints.py":874 + /* "constraint/constraints.py":881 * exactprod = self._exactprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -23237,71 +22915,71 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ } - /* "constraint/constraints.py":876 + /* "constraint/constraints.py":883 * 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, 876, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":877 + /* "constraint/constraints.py":884 * 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, 877, __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, 884, __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, 877, __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, 877, __pyx_L1_error) + __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 884, __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, 884, __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, 877, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 884, __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_GetItemRefFast(__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, 877, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 884, __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, 877, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __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, 877, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 884, __pyx_L1_error) PyErr_Clear(); } break; @@ -23311,38 +22989,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":878 + /* "constraint/constraints.py":885 * 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, 878, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 878, __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, 885, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 885, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { - /* "constraint/constraints.py":879 + /* "constraint/constraints.py":886 * 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, 879, __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, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":878 + /* "constraint/constraints.py":885 * domain = domains[variable] * for value in domain[:]: * if value > exactprod: # <<<<<<<<<<<<<< @@ -23352,44 +23030,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP goto __pyx_L20; } - /* "constraint/constraints.py":880 + /* "constraint/constraints.py":887 * 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, 880, __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, 887, __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, 880, __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, 887, __pyx_L1_error) __pyx_t_11 = __pyx_t_12; __pyx_L21_bool_binop_done:; if (__pyx_t_11) { - /* "constraint/constraints.py":881 + /* "constraint/constraints.py":888 * 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, 881, __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, 888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":880 + /* "constraint/constraints.py":887 * if value > exactprod: * domain.remove(value) * elif value == 0 and exactprod != 0: # <<<<<<<<<<<<<< @@ -23399,7 +23077,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __pyx_L20:; - /* "constraint/constraints.py":877 + /* "constraint/constraints.py":884 * continue * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -23407,9 +23085,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":873 + /* "constraint/constraints.py":880 * # prune the associated variables of values > exactprod * exactprod = self._exactprod * for variable in variables: # <<<<<<<<<<<<<< @@ -23420,7 +23098,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":855 + /* "constraint/constraints.py":862 * self._variable_contains_lt1: list[bool] = list() * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -23452,7 +23130,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP return __pyx_r; } -/* "constraint/constraints.py":883 +/* "constraint/constraints.py":890 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -23503,53 +23181,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, 883, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 890, __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, 883, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 890, __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, 883, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 890, __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, 883, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 890, __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, 883, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 890, __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, 883, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 890, __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, 883, __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, 890, __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, 883, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 890, __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, 883, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 890, __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, 883, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 890, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 883, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 890, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 883, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 890, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 883, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 890, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -23563,7 +23241,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, 883, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 890, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -23574,8 +23252,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, 883, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 883, __pyx_L1_error) + 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) __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 */ @@ -23596,7 +23274,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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":891 +/* "constraint/constraints.py":898 * 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])) # <<<<<<<<<<<<<< @@ -23616,7 +23294,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_8__ca 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, 891, __pyx_L1_error) + __PYX_ERR(0, 898, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -23624,7 +23302,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_8__ca __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, 891, __pyx_L1_error) + __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, 898, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -23661,16 +23339,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__ca return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 891, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 891, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 898, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 898, __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, 891, __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, 898, __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, 891, __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, 898, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -23678,17 +23356,17 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__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, 891, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 898, __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_GetItemRefFast(__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, 891, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 898, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -23699,13 +23377,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__ca #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 891, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 898, __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, 891, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 898, __pyx_L1_error) PyErr_Clear(); } break; @@ -23716,8 +23394,8 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__ca __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, 891, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 891, __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, 898, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_XDECREF(__pyx_r); @@ -23756,7 +23434,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__ca return __pyx_r; } -/* "constraint/constraints.py":883 +/* "constraint/constraints.py":890 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -23795,19 +23473,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":884 + /* "constraint/constraints.py":891 * * 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, 884, __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, 891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_exactprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":885 + /* "constraint/constraints.py":892 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * exactprod = self._exactprod * prod = 1 # <<<<<<<<<<<<<< @@ -23817,7 +23495,7 @@ 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":886 + /* "constraint/constraints.py":893 * exactprod = self._exactprod * prod = 1 * missing = False # <<<<<<<<<<<<<< @@ -23826,34 +23504,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ __pyx_v_missing = 0; - /* "constraint/constraints.py":887 + /* "constraint/constraints.py":894 * 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): */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 887, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_missing_lt1 = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":889 + /* "constraint/constraints.py":896 * 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, 889, __pyx_L1_error) + __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, 896, __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, 889, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 896, __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, 889, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 896, __pyx_L1_error) __pyx_t_4 = (__pyx_t_2 != __pyx_t_3); if (__pyx_t_4) { - /* "constraint/constraints.py":890 + /* "constraint/constraints.py":897 * # find out which variables contain values less than 1 if not preprocessed * if len(self._variable_contains_lt1) != len(variables): * for variable in variables: # <<<<<<<<<<<<<< @@ -23865,9 +23543,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __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, 890, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 897, __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, 890, __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, 897, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { @@ -23875,17 +23553,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__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, 890, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 897, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__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, 890, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 897, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -23896,13 +23574,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 890, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 897, __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, 890, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 897, __pyx_L1_error) PyErr_Clear(); } break; @@ -23912,28 +23590,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":891 + /* "constraint/constraints.py":898 * 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, 891, __pyx_L1_error) + __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, 898, __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, 891, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 898, __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, 891, __pyx_L1_error) + __pyx_t_8 = __pyx_pf_10constraint_11constraints_19ExactProdConstraint_8__call___genexpr(NULL, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 898, __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, 891, __pyx_L1_error) + __pyx_t_7 = __Pyx_Generator_GetInlinedResult(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 898, __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, 891, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_6, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":890 + /* "constraint/constraints.py":897 * # find out which variables contain values less than 1 if not preprocessed * if len(self._variable_contains_lt1) != len(variables): * for variable in variables: # <<<<<<<<<<<<<< @@ -23943,7 +23621,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":889 + /* "constraint/constraints.py":896 * missing_lt1 = [] * # find out which variables contain values less than 1 if not preprocessed * if len(self._variable_contains_lt1) != len(variables): # <<<<<<<<<<<<<< @@ -23952,7 +23630,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":892 + /* "constraint/constraints.py":899 * 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): # <<<<<<<<<<<<<< @@ -23960,18 +23638,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca * prod *= assignments[variable] */ __pyx_t_7 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_6 = __pyx_builtin_zip; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 892, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __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_10 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_variables, __pyx_t_8}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + 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_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -23979,9 +23654,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_t_3 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 899, __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, 892, __pyx_L1_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 899, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -23990,17 +23665,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__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, 892, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 899, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_3); + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } 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, 892, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 899, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -24011,13 +23686,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) } else { __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, 892, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 899, __pyx_L1_error) PyErr_Clear(); } break; @@ -24030,40 +23705,40 @@ 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, 892, __pyx_L1_error) + __PYX_ERR(0, 899, __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_7 = PyTuple_GET_ITEM(sequence, 1); + __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_8 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 892, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 892, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 899, __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_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); - index = 0; __pyx_t_8 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L9_unpacking_failed; - __Pyx_GOTREF(__pyx_t_8); - index = 1; __pyx_t_7 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_7)) goto __pyx_L9_unpacking_failed; + 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); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 892, __pyx_L1_error) + 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, 899, __pyx_L1_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L10_unpacking_done; @@ -24071,40 +23746,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 892, __pyx_L1_error) + __PYX_ERR(0, 899, __pyx_L1_error) __pyx_L10_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_8); - __pyx_t_8 = 0; - __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_7); + __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":893 + /* "constraint/constraints.py":900 * 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_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 893, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 900, __pyx_L1_error) if (__pyx_t_4) { - /* "constraint/constraints.py":894 + /* "constraint/constraints.py":901 * 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, 894, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 894, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __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_7); - __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":893 + /* "constraint/constraints.py":900 * 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: # <<<<<<<<<<<<<< @@ -24114,7 +23789,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca goto __pyx_L11; } - /* "constraint/constraints.py":896 + /* "constraint/constraints.py":903 * prod *= assignments[variable] * else: * missing = True # <<<<<<<<<<<<<< @@ -24124,26 +23799,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca /*else*/ { __pyx_v_missing = 1; - /* "constraint/constraints.py":897 + /* "constraint/constraints.py":904 * else: * missing = True * if contains_lt1: # <<<<<<<<<<<<<< * missing_lt1.append(variable) * if isinstance(prod, float): */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_contains_lt1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 897, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_contains_lt1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 904, __pyx_L1_error) if (__pyx_t_4) { - /* "constraint/constraints.py":898 + /* "constraint/constraints.py":905 * missing = True * if contains_lt1: * missing_lt1.append(variable) # <<<<<<<<<<<<<< * if isinstance(prod, float): * prod = round(prod, 10) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_missing_lt1, __pyx_v_variable); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 898, __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, 905, __pyx_L1_error) - /* "constraint/constraints.py":897 + /* "constraint/constraints.py":904 * else: * missing = True * if contains_lt1: # <<<<<<<<<<<<<< @@ -24154,7 +23829,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca } __pyx_L11:; - /* "constraint/constraints.py":892 + /* "constraint/constraints.py":899 * 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): # <<<<<<<<<<<<<< @@ -24164,7 +23839,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":899 + /* "constraint/constraints.py":906 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -24174,29 +23849,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_t_4 = PyFloat_Check(__pyx_v_prod); if (__pyx_t_4) { - /* "constraint/constraints.py":900 + /* "constraint/constraints.py":907 * 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_7 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_1 = __pyx_builtin_round; + __pyx_t_8 = NULL; __pyx_t_10 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_prod, __pyx_mstate_global->__pyx_int_10}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __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_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 900, __pyx_L1_error) + 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, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":899 + /* "constraint/constraints.py":906 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -24205,7 +23877,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":901 + /* "constraint/constraints.py":908 * if isinstance(prod, float): * prod = round(prod, 10) * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): # <<<<<<<<<<<<<< @@ -24217,8 +23889,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca goto __pyx_L17_next_or; } else { } - __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, 901, __pyx_L1_error) - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 901, __pyx_L1_error) + __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, 908, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_13) { } else { @@ -24226,21 +23898,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca goto __pyx_L16_bool_binop_done; } __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, 901, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 908, __pyx_L1_error) __pyx_t_13 = (__pyx_t_3 == 0); if (__pyx_t_13) { } else { __pyx_t_4 = __pyx_t_13; goto __pyx_L16_bool_binop_done; } - __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, 901, __pyx_L1_error) - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 901, __pyx_L1_error) + __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, 908, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 908, __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":902 + /* "constraint/constraints.py":909 * prod = round(prod, 10) * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): * return False # <<<<<<<<<<<<<< @@ -24252,7 +23924,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":901 + /* "constraint/constraints.py":908 * if isinstance(prod, float): * prod = round(prod, 10) * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): # <<<<<<<<<<<<<< @@ -24261,17 +23933,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":903 + /* "constraint/constraints.py":910 * 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_4 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 903, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 910, __pyx_L1_error) if (__pyx_t_4) { - /* "constraint/constraints.py":904 + /* "constraint/constraints.py":911 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -24283,9 +23955,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_t_3 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 904, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 911, __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, 904, __pyx_L1_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 911, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { @@ -24293,177 +23965,177 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__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, 904, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 911, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_3); + __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } 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, 904, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 911, __pyx_L1_error) #endif 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_6, __pyx_t_3)); + __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_3)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_3); + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_3); #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 904, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 911, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_5(__pyx_t_6); - 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, 904, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 911, __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":905 + /* "constraint/constraints.py":912 * 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_13 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 905, __pyx_L1_error) + __pyx_t_13 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) if (__pyx_t_13) { } else { __pyx_t_4 = __pyx_t_13; goto __pyx_L24_bool_binop_done; } - __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable, __pyx_v_missing_lt1, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 905, __pyx_L1_error) + __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable, __pyx_v_missing_lt1, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) if (!__pyx_t_13) { } else { __pyx_t_4 = __pyx_t_13; goto __pyx_L24_bool_binop_done; } - __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 905, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 912, __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":906 + /* "constraint/constraints.py":913 * 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, 906, __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, 913, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":907 + /* "constraint/constraints.py":914 * 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, 907, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); + __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, 914, __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_2 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 907, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 907, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __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, 914, __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_7))) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); + 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, 907, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 914, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_2); + __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); + 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, 907, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 914, __pyx_L1_error) #endif 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_7, __pyx_t_2)); + __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_2); + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 914, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_14(__pyx_t_7); - 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, 907, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 914, __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":908 + /* "constraint/constraints.py":915 * 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, 908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_v_exactprod, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 908, __pyx_L1_error) + __pyx_t_8 = PyNumber_Multiply(__pyx_v_prod, __pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 915, __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, 915, __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, 915, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_4) { - /* "constraint/constraints.py":909 + /* "constraint/constraints.py":916 * 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_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_8 = __Pyx_PyObject_FastCallMethod(__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_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 909, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + 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, 916, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":908 + /* "constraint/constraints.py":915 * domain = domains[variable] * for value in domain[:]: * if prod * value > exactprod: # <<<<<<<<<<<<<< @@ -24472,7 +24144,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":907 + /* "constraint/constraints.py":914 * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -24480,20 +24152,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca * domain.hideValue(value) */ } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":910 + /* "constraint/constraints.py":917 * if prod * value > exactprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False * return True */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 910, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 917, __pyx_L1_error) __pyx_t_13 = (!__pyx_t_4); if (__pyx_t_13) { - /* "constraint/constraints.py":911 + /* "constraint/constraints.py":918 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -24506,7 +24178,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/constraints.py":910 + /* "constraint/constraints.py":917 * if prod * value > exactprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -24515,7 +24187,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":905 + /* "constraint/constraints.py":912 * if forwardcheck: * for variable in variables: * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): # <<<<<<<<<<<<<< @@ -24524,7 +24196,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":904 + /* "constraint/constraints.py":911 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -24534,7 +24206,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":903 + /* "constraint/constraints.py":910 * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): * return False * if forwardcheck: # <<<<<<<<<<<<<< @@ -24543,7 +24215,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":912 + /* "constraint/constraints.py":919 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -24555,7 +24227,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":883 + /* "constraint/constraints.py":890 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -24586,7 +24258,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca return __pyx_r; } -/* "constraint/constraints.py":931 +/* "constraint/constraints.py":938 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # <<<<<<<<<<<<<< @@ -24636,38 +24308,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, 931, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 938, __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, 931, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 938, __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, 931, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 938, __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, 931, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 938, __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, 931, __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, 938, __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, 931, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(0, 938, __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, 931, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 938, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 931, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 938, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 931, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 938, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_target_var = ((PyObject*)values[1]); @@ -24675,7 +24347,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, 931, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 938, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -24686,7 +24358,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, 931, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 938, __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 */ @@ -24714,25 +24386,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":938 + /* "constraint/constraints.py":945 * 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, 938, __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, 945, __pyx_L1_error) - /* "constraint/constraints.py":939 + /* "constraint/constraints.py":946 * """ * 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, 939, __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, 946, __pyx_L1_error) - /* "constraint/constraints.py":931 + /* "constraint/constraints.py":938 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # <<<<<<<<<<<<<< @@ -24752,7 +24424,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":941 +/* "constraint/constraints.py":948 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -24802,41 +24474,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, 941, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 948, __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, 941, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 948, __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, 941, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 948, __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, 941, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 948, __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, 941, __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, 948, __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, 941, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, i); __PYX_ERR(0, 948, __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, 941, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 948, __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, 941, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 948, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 941, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 948, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -24848,7 +24520,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, 941, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 948, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -24890,10 +24562,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; @@ -24903,35 +24575,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_product_bounds", 0); - /* "constraint/constraints.py":943 + /* "constraint/constraints.py":950 * 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, 943, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":944 + /* "constraint/constraints.py":951 * """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, 944, __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, 951, __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, 944, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 951, __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, 944, __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, 951, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -24940,17 +24612,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, 944, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 951, __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_GetItemRefFast(__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, 944, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 951, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -24961,13 +24633,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 951, __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, 944, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 951, __pyx_L1_error) PyErr_Clear(); } break; @@ -24977,19 +24649,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":945 + /* "constraint/constraints.py":952 * 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, 945, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 945, __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, 952, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 952, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":946 + /* "constraint/constraints.py":953 * for var in self.product_vars: * if var == exclude_var: * continue # <<<<<<<<<<<<<< @@ -24998,7 +24670,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ goto __pyx_L3_continue; - /* "constraint/constraints.py":945 + /* "constraint/constraints.py":952 * bounds = [] * for var in self.product_vars: * if var == exclude_var: # <<<<<<<<<<<<<< @@ -25007,30 +24679,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":947 + /* "constraint/constraints.py":954 * 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, 947, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_domain_dict, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":948 + /* "constraint/constraints.py":955 * 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, 948, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_dom); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 955, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { - /* "constraint/constraints.py":949 + /* "constraint/constraints.py":956 * dom = domain_dict[var] * if not dom: * continue # <<<<<<<<<<<<<< @@ -25039,7 +24711,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ goto __pyx_L3_continue; - /* "constraint/constraints.py":948 + /* "constraint/constraints.py":955 * continue * dom = domain_dict[var] * if not dom: # <<<<<<<<<<<<<< @@ -25048,7 +24720,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":950 + /* "constraint/constraints.py":957 * if not dom: * continue * bounds.append((min(dom), max(dom))) # <<<<<<<<<<<<<< @@ -25056,41 +24728,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, 950, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __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, 950, __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, 957, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 950, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 957, __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, 950, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 950, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 957, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 957, __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, 950, __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, 957, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":944 + /* "constraint/constraints.py":951 * """Return min and max product of domains of product_vars (excluding `exclude_var` if given).""" * bounds = [] * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -25101,7 +24767,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":952 + /* "constraint/constraints.py":959 * bounds.append((min(dom), max(dom))) * * all_bounds = [b for b in bounds] # <<<<<<<<<<<<<< @@ -25109,27 +24775,27 @@ 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, 952, __pyx_L10_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __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, 952, __pyx_L10_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 959, __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_GetItemRefFast(__pyx_t_9, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 952, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr19__pyx_v_b, __pyx_t_8); - __pyx_t_8 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr19__pyx_v_b))) __PYX_ERR(0, 952, __pyx_L10_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 959, __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, 959, __pyx_L10_error) } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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:; @@ -25140,19 +24806,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_v_all_bounds = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":953 + /* "constraint/constraints.py":960 * * 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, 953, __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, 960, __pyx_L1_error) + __pyx_t_6 = (__pyx_temp != 0); + } + __pyx_t_5 = (!__pyx_t_6); if (__pyx_t_5) { - /* "constraint/constraints.py":954 + /* "constraint/constraints.py":961 * all_bounds = [b for b in bounds] * if not all_bounds: * return 1, 1 # <<<<<<<<<<<<<< @@ -25164,7 +24834,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = __pyx_mstate_global->__pyx_tuple[0]; goto __pyx_L0; - /* "constraint/constraints.py":953 + /* "constraint/constraints.py":960 * * all_bounds = [b for b in bounds] * if not all_bounds: # <<<<<<<<<<<<<< @@ -25173,7 +24843,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":957 + /* "constraint/constraints.py":964 * * # 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])] # <<<<<<<<<<<<<< @@ -25181,34 +24851,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, 957, __pyx_L18_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __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, 957, __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, 964, __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, 957, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 964, __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, 957, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 964, __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_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 957, __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, 964, __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, 957, __pyx_L23_error) + __PYX_ERR(0, 964, __pyx_L23_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -25217,31 +24887,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, 957, __pyx_L23_error) + __pyx_t_12 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 964, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 957, __pyx_L23_error) + __pyx_t_13 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 964, __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, 957, __pyx_L23_error) + __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 964, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 957, __pyx_L23_error) + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 964, __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, 957, __pyx_L23_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 964, __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, 957, __pyx_L23_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < (0)) __PYX_ERR(0, 964, __pyx_L23_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L27_unpacking_done; @@ -25249,23 +24919,23 @@ 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, 957, __pyx_L23_error) + __PYX_ERR(0, 964, __pyx_L23_error) __pyx_L27_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_9genexpr21__pyx_v_lo, __pyx_t_12); __pyx_t_12 = 0; __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, 957, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 964, __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_7, 0, __pyx_9genexpr21__pyx_v_lo) != (0)) __PYX_ERR(0, 957, __pyx_L23_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_9genexpr21__pyx_v_lo) != (0)) __PYX_ERR(0, 964, __pyx_L23_error); __Pyx_INCREF(__pyx_9genexpr21__pyx_v_hi); __Pyx_GIVEREF(__pyx_9genexpr21__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_9genexpr21__pyx_v_hi) != (0)) __PYX_ERR(0, 957, __pyx_L23_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 957, __pyx_L23_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_9genexpr21__pyx_v_hi) != (0)) __PYX_ERR(0, 964, __pyx_L23_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 964, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_hi); __pyx_9genexpr21__pyx_v_hi = 0; @@ -25277,66 +24947,66 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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, 957, __pyx_L18_error) + __pyx_t_1 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 964, __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, 957, __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, 964, __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, 957, __pyx_L18_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 964, __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, 957, __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, 964, __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, 957, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 964, __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_GetItemRefFast(__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, 957, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 964, __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, 957, __pyx_L18_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 964, __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, 957, __pyx_L18_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 964, __pyx_L18_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr20__pyx_v_b, __pyx_t_8); - __pyx_t_8 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr20__pyx_v_b))) __PYX_ERR(0, 957, __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, 964, __pyx_L18_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_b); __pyx_9genexpr20__pyx_v_b = 0; @@ -25349,7 +25019,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_v_candidates = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":958 + /* "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])] * products = [self._safe_product(p) for p in candidates] # <<<<<<<<<<<<<< @@ -25357,7 +25027,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, 958, __pyx_L34_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_v_candidates; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; @@ -25365,28 +25035,28 @@ 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, 958, __pyx_L34_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 965, __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_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 958, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr22__pyx_v_p, __pyx_t_8); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 965, __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_9genexpr22__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, 958, __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, 965, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_7); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 958, __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, 965, __pyx_L34_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_p); __pyx_9genexpr22__pyx_v_p = 0; @@ -25399,7 +25069,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_v_products = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":959 + /* "constraint/constraints.py":966 * 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) # <<<<<<<<<<<<<< @@ -25408,42 +25078,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, 959, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __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, 959, __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, 966, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 959, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 966, __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, 959, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 959, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 966, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 966, __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":941 + /* "constraint/constraints.py":948 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -25456,8 +25120,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); @@ -25480,7 +25144,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":961 +/* "constraint/constraints.py":968 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -25528,39 +25192,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, 961, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 968, __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, 961, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 968, __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, 961, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 968, __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, 961, __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, 968, __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, 961, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, i); __PYX_ERR(0, 968, __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, 961, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 968, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 961, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 968, __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, 961, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 968, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -25595,7 +25259,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_safe_product", 0); - /* "constraint/constraints.py":962 + /* "constraint/constraints.py":969 * * def _safe_product(self, values): * prod = 1 # <<<<<<<<<<<<<< @@ -25605,7 +25269,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":963 + /* "constraint/constraints.py":970 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -25617,9 +25281,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, 963, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 970, __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, 963, __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, 970, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -25627,17 +25291,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, 963, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 970, __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_GetItemRefFast(__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, 963, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 970, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -25648,13 +25312,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 963, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 970, __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, 963, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 970, __pyx_L1_error) PyErr_Clear(); } break; @@ -25664,19 +25328,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":964 + /* "constraint/constraints.py":971 * 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, 964, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":963 + /* "constraint/constraints.py":970 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -25686,7 +25350,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":965 + /* "constraint/constraints.py":972 * for v in values: * prod *= v * return prod # <<<<<<<<<<<<<< @@ -25698,7 +25362,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = __pyx_v_prod; goto __pyx_L0; - /* "constraint/constraints.py":961 + /* "constraint/constraints.py":968 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -25720,7 +25384,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":967 +/* "constraint/constraints.py":974 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -25771,50 +25435,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, 967, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 974, __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, 967, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 974, __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, 967, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 974, __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, 967, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 974, __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, 967, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 974, __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, 967, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 974, __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, 967, __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, 974, __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, 967, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 974, __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, 967, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 974, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 967, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 974, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 967, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 974, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 967, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 974, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 967, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 974, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -25824,7 +25488,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, 967, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 974, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -25835,9 +25499,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, 967, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 967, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 967, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 974, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 974, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 974, __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 */ @@ -25882,15 +25546,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":968 + /* "constraint/constraints.py":975 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -25898,9 +25561,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, 968, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 975, __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, 968, __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, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -25917,30 +25580,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, 968, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":970 + /* "constraint/constraints.py":977 * 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, 970, __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, 977, __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, 970, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 977, __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":971 + /* "constraint/constraints.py":978 * * target_domain = domains[self.target_var] * target_min = min(target_domain) # <<<<<<<<<<<<<< @@ -25948,59 +25611,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, 971, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_target_min = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/constraints.py":972 + /* "constraint/constraints.py":979 * 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, 972, __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, 979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_target_max = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/constraints.py":973 + /* "constraint/constraints.py":980 * 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, 973, __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, 980, __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, 973, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __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, 973, __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, 980, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -26009,17 +25666,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, 973, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 980, __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_GetItemRefFast(__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, 973, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 980, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -26030,13 +25687,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 973, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 980, __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, 973, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 980, __pyx_L1_error) PyErr_Clear(); } break; @@ -26046,7 +25703,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":974 + /* "constraint/constraints.py":981 * target_max = max(target_domain) * for var in self.product_vars: * other_min, other_max = self._get_product_bounds(domains, exclude_var=var) # <<<<<<<<<<<<<< @@ -26058,13 +25715,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, 974, __pyx_L1_error) + __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 981, __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, 974, __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, 981, __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, 974, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { @@ -26073,7 +25730,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, 974, __pyx_L1_error) + __PYX_ERR(0, 981, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -26082,23 +25739,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, 974, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __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, 974, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __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, 974, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 981, __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); @@ -26106,7 +25763,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, 974, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < (0)) __PYX_ERR(0, 981, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -26114,7 +25771,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, 974, __pyx_L1_error) + __PYX_ERR(0, 981, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_other_min, __pyx_t_3); @@ -26122,35 +25779,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":975 + /* "constraint/constraints.py":982 * 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, 975, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":976 + /* "constraint/constraints.py":983 * 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, 976, __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, 983, __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, 976, __pyx_L1_error) + __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __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, 976, __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, 983, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -26159,17 +25816,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, 976, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 983, __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_GetItemRefFast(__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, 976, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 983, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -26180,13 +25837,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_10; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 983, __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, 976, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 983, __pyx_L1_error) PyErr_Clear(); } break; @@ -26196,29 +25853,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":977 + /* "constraint/constraints.py":984 * 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, 977, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_v_value, __pyx_v_other_min); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 984, __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, 977, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_value, __pyx_v_other_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 984, __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, 977, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 984, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 977, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 984, __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":978 + /* "constraint/constraints.py":985 * for value in domain[:]: * candidates = [value * other_min, value * other_max] * minval, maxval = min(candidates), max(candidates) # <<<<<<<<<<<<<< @@ -26226,57 +25883,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, 978, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 985, __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, 978, __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, 985, __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":979 + /* "constraint/constraints.py":986 * 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, 979, __pyx_L1_error) - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 979, __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, 986, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 986, __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, 979, __pyx_L1_error) - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 979, __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, 986, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 986, __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":980 + /* "constraint/constraints.py":987 * minval, maxval = min(candidates), max(candidates) * if maxval < target_min or minval > target_max: * domain.remove(value) # <<<<<<<<<<<<<< @@ -26288,14 +25939,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, 980, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 987, __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":979 + /* "constraint/constraints.py":986 * candidates = [value * other_min, value * other_max] * minval, maxval = min(candidates), max(candidates) * if maxval < target_min or minval > target_max: # <<<<<<<<<<<<<< @@ -26304,7 +25955,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":976 + /* "constraint/constraints.py":983 * other_min, other_max = self._get_product_bounds(domains, exclude_var=var) * domain = domains[var] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -26314,7 +25965,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":973 + /* "constraint/constraints.py":980 * target_min = min(target_domain) * target_max = max(target_domain) * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -26324,7 +25975,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":967 + /* "constraint/constraints.py":974 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -26341,7 +25992,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:; @@ -26361,7 +26011,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":982 +/* "constraint/constraints.py":989 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -26412,53 +26062,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, 982, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 989, __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, 982, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 989, __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, 982, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 989, __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, 982, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 989, __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, 982, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 989, __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, 982, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 989, __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, 982, __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, 989, __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, 982, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 989, __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, 982, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 989, __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, 982, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 989, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 982, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 989, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 982, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 989, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 982, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 989, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -26472,7 +26122,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, 982, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 989, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26483,8 +26133,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, 982, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 982, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 989, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 989, __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 */ @@ -26505,7 +26155,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":1005 +/* "constraint/constraints.py":1012 * 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) # <<<<<<<<<<<<<< @@ -26525,7 +26175,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, 1005, __pyx_L1_error) + __PYX_ERR(0, 1012, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -26536,7 +26186,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, 1005, __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, 1012, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -26574,29 +26224,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, 1005, __pyx_L1_error) + __PYX_ERR(0, 1012, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1005, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1012, __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, 1005, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1012, __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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1005, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1012, __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, 1005, __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, 1005, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_assigned_product)) { __Pyx_RaiseClosureNameError("assigned_product"); __PYX_ERR(0, 1012, __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, 1012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -26614,7 +26264,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, 1005, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1012, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -26641,7 +26291,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":1006 +/* "constraint/constraints.py":1013 * 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) # <<<<<<<<<<<<<< @@ -26661,7 +26311,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, 1006, __pyx_L1_error) + __PYX_ERR(0, 1013, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -26672,7 +26322,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, 1006, __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, 1013, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -26710,29 +26360,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, 1006, __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, 1006, __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, 1006, __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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1006, __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, 1006, __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, 1006, __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; @@ -26750,7 +26400,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, 1006, __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); @@ -26776,7 +26426,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":982 +/* "constraint/constraints.py":989 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -26824,25 +26474,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, 982, __pyx_L1_error) + __PYX_ERR(0, 989, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/constraints.py":983 + /* "constraint/constraints.py":990 * * 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, 983, __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, 990, __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, 983, __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, 990, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":984 + /* "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 # <<<<<<<<<<<<<< @@ -26854,7 +26504,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":983 + /* "constraint/constraints.py":990 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -26863,22 +26513,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":986 + /* "constraint/constraints.py":993 * 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, 986, __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, 993, __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, 986, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 993, __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":987 + /* "constraint/constraints.py":994 * * target_value = assignments[self.target_var] * assigned_product = 1 # <<<<<<<<<<<<<< @@ -26889,35 +26539,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":988 + /* "constraint/constraints.py":995 * 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, 988, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_unassigned_vars = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":990 + /* "constraint/constraints.py":997 * 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, 990, __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, 997, __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, 990, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 997, __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, 990, __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, 997, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -26926,17 +26576,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, 990, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 997, __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_GetItemRefFast(__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, 990, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 997, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -26947,13 +26597,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 990, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 997, __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, 990, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 997, __pyx_L1_error) PyErr_Clear(); } break; @@ -26963,26 +26613,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":991 + /* "constraint/constraints.py":998 * * 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, 991, __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, 998, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":992 + /* "constraint/constraints.py":999 * 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, 992, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 999, __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, 992, __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, 999, __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); @@ -26990,7 +26640,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":991 + /* "constraint/constraints.py":998 * * for var in self.product_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -27000,7 +26650,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai goto __pyx_L6; } - /* "constraint/constraints.py":994 + /* "constraint/constraints.py":1001 * assigned_product *= assignments[var] * else: * unassigned_vars.append(var) # <<<<<<<<<<<<<< @@ -27008,11 +26658,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, 994, __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, 1001, __pyx_L1_error) } __pyx_L6:; - /* "constraint/constraints.py":990 + /* "constraint/constraints.py":997 * unassigned_vars = [] * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -27022,7 +26672,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":996 + /* "constraint/constraints.py":1003 * unassigned_vars.append(var) * * if isinstance(assigned_product, float): # <<<<<<<<<<<<<< @@ -27035,7 +26685,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":997 + /* "constraint/constraints.py":1004 * * if isinstance(assigned_product, float): * assigned_product = round(assigned_product, 10) # <<<<<<<<<<<<<< @@ -27043,15 +26693,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, 997, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_assigned_product); @@ -27059,7 +26706,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":996 + /* "constraint/constraints.py":1003 * unassigned_vars.append(var) * * if isinstance(assigned_product, float): # <<<<<<<<<<<<<< @@ -27068,19 +26715,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":999 + /* "constraint/constraints.py":1006 * 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, 999, __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, 1006, __pyx_L1_error) + __pyx_t_2 = (__pyx_temp != 0); + } + __pyx_t_9 = (!__pyx_t_2); if (__pyx_t_9) { - /* "constraint/constraints.py":1000 + /* "constraint/constraints.py":1007 * * if not unassigned_vars: * return assigned_product == target_value # <<<<<<<<<<<<<< @@ -27088,12 +26739,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_v_target_value, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1000, __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, 1007, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":999 + /* "constraint/constraints.py":1006 * assigned_product = round(assigned_product, 10) * * if not unassigned_vars: # <<<<<<<<<<<<<< @@ -27102,7 +26753,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":1003 + /* "constraint/constraints.py":1010 * * # Partial assignment check feasibility * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned_vars] # <<<<<<<<<<<<<< @@ -27110,66 +26761,60 @@ 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, 1003, __pyx_L12_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __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, 1003, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1010, __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_GetItemRefFast(__pyx_t_6, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1003, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr23__pyx_v_v, __pyx_t_6); - __pyx_t_6 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __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_9genexpr23__pyx_v_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1003, __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, 1010, __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, 1003, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_6); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __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_9genexpr23__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1003, __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, 1010, __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, 1003, __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, 1010, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1003, __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, 1003, __pyx_L12_error); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1010, __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, 1010, __pyx_L12_error); __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 1003, __pyx_L12_error); - __pyx_t_6 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 1010, __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, 1003, __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, 1010, __pyx_L12_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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:; @@ -27180,7 +26825,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_v_domain_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1004 + /* "constraint/constraints.py":1011 * # 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])] # <<<<<<<<<<<<<< @@ -27188,67 +26833,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, 1004, __pyx_L19_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __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, 1004, __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, 1011, __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, 1004, __pyx_L24_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1011, __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, 1004, __pyx_L24_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1011, __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_GetItemRefFast(__pyx_t_11, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1004, __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, 1011, __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, 1004, __pyx_L24_error) + __PYX_ERR(0, 1011, __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, 1004, __pyx_L24_error) + __pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1011, __pyx_L24_error) + __Pyx_XGOTREF(__pyx_t_10); + __pyx_t_13 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1011, __pyx_L24_error) __Pyx_XGOTREF(__pyx_t_13); - __pyx_t_12 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1004, __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, 1004, __pyx_L24_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1011, __pyx_L24_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1011, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1004, __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, 1004, __pyx_L24_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1011, __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, 1004, __pyx_L24_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < (0)) __PYX_ERR(0, 1011, __pyx_L24_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L28_unpacking_done; @@ -27256,23 +26901,23 @@ 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, 1004, __pyx_L24_error) + __PYX_ERR(0, 1011, __pyx_L24_error) __pyx_L28_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr25__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_9genexpr25__pyx_v_hi, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1004, __pyx_L24_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __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_6, 0, __pyx_9genexpr25__pyx_v_lo) != (0)) __PYX_ERR(0, 1004, __pyx_L24_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_9genexpr25__pyx_v_lo) != (0)) __PYX_ERR(0, 1011, __pyx_L24_error); __Pyx_INCREF(__pyx_9genexpr25__pyx_v_hi); __Pyx_GIVEREF(__pyx_9genexpr25__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_9genexpr25__pyx_v_hi) != (0)) __PYX_ERR(0, 1004, __pyx_L24_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1004, __pyx_L24_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_9genexpr25__pyx_v_hi) != (0)) __PYX_ERR(0, 1011, __pyx_L24_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_12, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1011, __pyx_L24_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_hi); __pyx_9genexpr25__pyx_v_hi = 0; @@ -27284,77 +26929,77 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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, 1004, __pyx_L19_error) + __pyx_t_11 = PySequence_Tuple(__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1011, __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, 1004, __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, 1011, __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, 1004, __pyx_L19_error) + __pyx_t_4 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1011, __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, 1004, __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, 1011, __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, 1004, __pyx_L19_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1011, __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_GetItemRefFast(__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, 1004, __pyx_L19_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1011, __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, 1004, __pyx_L19_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1011, __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, 1004, __pyx_L19_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1011, __pyx_L19_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_10); - __Pyx_XDECREF_SET(__pyx_9genexpr24__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_9genexpr24__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, 1004, __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, 1011, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_12); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1004, __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, 1011, __pyx_L19_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_p); __pyx_9genexpr24__pyx_v_p = 0; @@ -27367,7 +27012,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_v_candidates = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1005 + /* "constraint/constraints.py":1012 * 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) # <<<<<<<<<<<<<< @@ -27375,71 +27020,65 @@ 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, 1005, __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, 1012, __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, 1005, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_possible_min = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1006 + /* "constraint/constraints.py":1013 * 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, 1006, __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, 1013, __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, 1006, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_possible_max = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1008 + /* "constraint/constraints.py":1015 * 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_v_target_value, __pyx_v_possible_min, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1008, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1008, __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, 1015, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1015, __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_v_target_value, __pyx_v_possible_max, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1008, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1008, __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, 1015, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1015, __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":1009 + /* "constraint/constraints.py":1016 * * if target_value < possible_min or target_value > possible_max: * return False # <<<<<<<<<<<<<< @@ -27451,7 +27090,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1008 + /* "constraint/constraints.py":1015 * possible_max = max(assigned_product * c for c in candidates) * * if target_value < possible_min or target_value > possible_max: # <<<<<<<<<<<<<< @@ -27460,7 +27099,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":1026 + /* "constraint/constraints.py":1033 * # return False * * return True # <<<<<<<<<<<<<< @@ -27472,7 +27111,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":982 + /* "constraint/constraints.py":989 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -27512,7 +27151,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":1045 +/* "constraint/constraints.py":1052 * """ # noqa: E501 * * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -27561,39 +27200,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, 1045, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1052, __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, 1045, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1052, __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, 1045, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1052, __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, 1045, __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, 1052, __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, 1045, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1052, __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, 1045, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1052, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1045, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1052, __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, 1045, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1052, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27622,16 +27261,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1051 + /* "constraint/constraints.py":1058 * 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, 1051, __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, 1058, __pyx_L1_error) - /* "constraint/constraints.py":1045 + /* "constraint/constraints.py":1052 * """ # noqa: E501 * * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -27651,7 +27290,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ return __pyx_r; } -/* "constraint/constraints.py":1053 +/* "constraint/constraints.py":1060 * self._minprod = minprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -27702,50 +27341,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, 1053, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1060, __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, 1053, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1060, __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, 1053, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1060, __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, 1053, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1060, __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, 1053, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1060, __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, 1053, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1060, __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, 1053, __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, 1060, __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, 1053, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1060, __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, 1053, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1060, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1053, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1060, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1053, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1060, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1053, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1060, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1053, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1060, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -27755,7 +27394,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, 1053, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1060, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27766,9 +27405,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, 1053, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1053, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1053, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1060, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1060, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1060, __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 */ @@ -27811,7 +27450,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1054 + /* "constraint/constraints.py":1061 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -27819,9 +27458,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, 1054, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __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, 1054, __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, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -27838,27 +27477,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, 1054, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1057 + /* "constraint/constraints.py":1064 * * # 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, 1057, __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, 1064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_minprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1058 + /* "constraint/constraints.py":1065 * # prune the associated variables of values > minprod * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< @@ -27870,9 +27509,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, 1058, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1065, __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, 1058, __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, 1065, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -27880,17 +27519,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, 1058, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1065, __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_GetItemRefFast(__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, 1058, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1065, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -27901,13 +27540,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1058, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1065, __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, 1058, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1065, __pyx_L1_error) PyErr_Clear(); } break; @@ -27917,35 +27556,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":1059 + /* "constraint/constraints.py":1066 * 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, 1059, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1060 + /* "constraint/constraints.py":1067 * 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, 1060, __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, 1067, __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, 1060, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1067, __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, 1060, __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, 1067, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -27954,17 +27593,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, 1060, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1067, __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_GetItemRefFast(__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, 1060, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1067, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -27975,13 +27614,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1060, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1067, __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, 1060, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1067, __pyx_L1_error) PyErr_Clear(); } break; @@ -27991,27 +27630,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":1061 + /* "constraint/constraints.py":1068 * 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, 1061, __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, 1068, __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, 1061, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1061, __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, 1068, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1068, __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":1062 + /* "constraint/constraints.py":1069 * for value in domain[:]: * if value == 0 and minprod > 0: * domain.remove(value) # <<<<<<<<<<<<<< @@ -28023,14 +27662,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, 1062, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1069, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1061 + /* "constraint/constraints.py":1068 * domain = domains[variable] * for value in domain[:]: * if value == 0 and minprod > 0: # <<<<<<<<<<<<<< @@ -28039,7 +27678,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro */ } - /* "constraint/constraints.py":1060 + /* "constraint/constraints.py":1067 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -28049,7 +27688,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1058 + /* "constraint/constraints.py":1065 * # prune the associated variables of values > minprod * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< @@ -28059,7 +27698,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1053 + /* "constraint/constraints.py":1060 * self._minprod = minprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -28087,7 +27726,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro return __pyx_r; } -/* "constraint/constraints.py":1064 +/* "constraint/constraints.py":1071 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -28138,53 +27777,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, 1064, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1071, __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, 1064, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1071, __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, 1064, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1071, __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, 1064, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1071, __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, 1064, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1071, __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, 1064, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1071, __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, 1064, __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, 1071, __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, 1064, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1071, __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, 1064, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1071, __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, 1064, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1071, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1064, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1071, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1064, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1071, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1064, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1071, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -28198,7 +27837,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, 1064, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1071, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -28209,8 +27848,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, 1064, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1064, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1071, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1071, __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 */ @@ -28248,7 +27887,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1066 + /* "constraint/constraints.py":1073 * 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: # <<<<<<<<<<<<<< @@ -28260,9 +27899,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, 1066, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1073, __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, 1066, __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, 1073, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -28270,17 +27909,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, 1066, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1073, __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_GetItemRefFast(__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, 1066, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1073, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -28291,13 +27930,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1066, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1073, __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, 1066, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1073, __pyx_L1_error) PyErr_Clear(); } break; @@ -28307,17 +27946,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":1067 + /* "constraint/constraints.py":1074 * # 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, 1067, __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, 1074, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1068 + /* "constraint/constraints.py":1075 * for variable in variables: * if variable not in assignments: * return True # <<<<<<<<<<<<<< @@ -28330,7 +27969,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":1067 + /* "constraint/constraints.py":1074 * # check if each variable is in the assignments * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -28339,7 +27978,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call */ } - /* "constraint/constraints.py":1066 + /* "constraint/constraints.py":1073 * 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: # <<<<<<<<<<<<<< @@ -28349,19 +27988,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1071 + /* "constraint/constraints.py":1078 * * # 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, 1071, __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, 1078, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_minprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1072 + /* "constraint/constraints.py":1079 * # with each variable assigned, sum the values * minprod = self._minprod * prod = 1 # <<<<<<<<<<<<<< @@ -28371,7 +28010,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":1073 + /* "constraint/constraints.py":1080 * minprod = self._minprod * prod = 1 * for variable in variables: # <<<<<<<<<<<<<< @@ -28383,9 +28022,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, 1073, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1080, __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, 1073, __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, 1080, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -28393,17 +28032,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, 1073, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1080, __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_GetItemRefFast(__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, 1073, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1080, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -28414,13 +28053,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1073, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1080, __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, 1073, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1080, __pyx_L1_error) PyErr_Clear(); } break; @@ -28430,22 +28069,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":1074 + /* "constraint/constraints.py":1081 * 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, 1074, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1081, __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, 1074, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1081, __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":1073 + /* "constraint/constraints.py":1080 * minprod = self._minprod * prod = 1 * for variable in variables: # <<<<<<<<<<<<<< @@ -28455,7 +28094,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1075 + /* "constraint/constraints.py":1082 * for variable in variables: * prod *= assignments[variable] * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -28465,7 +28104,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":1076 + /* "constraint/constraints.py":1083 * prod *= assignments[variable] * if isinstance(prod, float): * prod = round(prod, 10) # <<<<<<<<<<<<<< @@ -28473,21 +28112,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, 1076, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1075 + /* "constraint/constraints.py":1082 * for variable in variables: * prod *= assignments[variable] * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -28496,7 +28132,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call */ } - /* "constraint/constraints.py":1077 + /* "constraint/constraints.py":1084 * if isinstance(prod, float): * prod = round(prod, 10) * return prod >= minprod # <<<<<<<<<<<<<< @@ -28504,12 +28140,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, 1077, __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, 1084, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1064 + /* "constraint/constraints.py":1071 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -28533,7 +28169,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call return __pyx_r; } -/* "constraint/constraints.py":1097 +/* "constraint/constraints.py":1104 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -28582,38 +28218,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, 1097, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1104, __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, 1097, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1104, __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, 1104, __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, 1104, __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, 1097, __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, 1104, __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, 1097, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(0, 1104, __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, 1097, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1104, __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, 1104, __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, 1104, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_target_var = ((PyObject*)values[1]); @@ -28621,7 +28257,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, 1097, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1104, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -28632,7 +28268,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, 1097, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 1104, __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 */ @@ -28660,25 +28296,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1098 + /* "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 * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_v_target_var) < 0) __PYX_ERR(0, 1098, __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, 1105, __pyx_L1_error) - /* "constraint/constraints.py":1099 + /* "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 # <<<<<<<<<<<<<< * * 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, 1099, __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, 1106, __pyx_L1_error) - /* "constraint/constraints.py":1097 + /* "constraint/constraints.py":1104 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -28698,7 +28334,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1101 +/* "constraint/constraints.py":1108 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -28747,41 +28383,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, 1101, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1108, __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, 1101, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1108, __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, 1101, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1108, __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, 1101, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1108, __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, 1101, __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, 1108, __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, 1101, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, i); __PYX_ERR(0, 1108, __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, 1101, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1108, __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, 1101, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1108, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1101, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1108, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -28793,7 +28429,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, 1101, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1108, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -28833,10 +28469,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; @@ -28846,35 +28482,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_product_bounds", 0); - /* "constraint/constraints.py":1102 + /* "constraint/constraints.py":1109 * * 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, 1102, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1103 + /* "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: * 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, 1103, __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, 1110, __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, 1103, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1110, __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, 1103, __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, 1110, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -28883,17 +28519,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, 1103, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1110, __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_GetItemRefFast(__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, 1103, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1110, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -28904,13 +28540,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1103, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1110, __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, 1103, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1110, __pyx_L1_error) PyErr_Clear(); } break; @@ -28920,19 +28556,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1104 + /* "constraint/constraints.py":1111 * 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, 1104, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1104, __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, 1111, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1105 + /* "constraint/constraints.py":1112 * for var in self.product_vars: * if var == exclude_var: * continue # <<<<<<<<<<<<<< @@ -28941,7 +28577,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ goto __pyx_L3_continue; - /* "constraint/constraints.py":1104 + /* "constraint/constraints.py":1111 * bounds = [] * for var in self.product_vars: * if var == exclude_var: # <<<<<<<<<<<<<< @@ -28950,30 +28586,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1106 + /* "constraint/constraints.py":1113 * 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, 1106, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_domain_dict, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1107 + /* "constraint/constraints.py":1114 * 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, 1107, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_dom); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1114, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { - /* "constraint/constraints.py":1108 + /* "constraint/constraints.py":1115 * dom = domain_dict[var] * if not dom: * continue # <<<<<<<<<<<<<< @@ -28982,7 +28618,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ goto __pyx_L3_continue; - /* "constraint/constraints.py":1107 + /* "constraint/constraints.py":1114 * continue * dom = domain_dict[var] * if not dom: # <<<<<<<<<<<<<< @@ -28991,7 +28627,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1109 + /* "constraint/constraints.py":1116 * if not dom: * continue * bounds.append((min(dom), max(dom))) # <<<<<<<<<<<<<< @@ -28999,41 +28635,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, 1109, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1116, __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, 1109, __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, 1116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1109, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1116, __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, 1109, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 1109, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1116, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 1116, __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, 1109, __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, 1116, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":1103 + /* "constraint/constraints.py":1110 * def _get_product_bounds(self, domain_dict, exclude_var=None): * bounds = [] * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -29044,19 +28674,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1111 + /* "constraint/constraints.py":1118 * 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, 1111, __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, 1118, __pyx_L1_error) + __pyx_t_6 = (__pyx_temp != 0); + } + __pyx_t_5 = (!__pyx_t_6); if (__pyx_t_5) { - /* "constraint/constraints.py":1112 + /* "constraint/constraints.py":1119 * * if not bounds: * return 1, 1 # <<<<<<<<<<<<<< @@ -29068,7 +28702,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = __pyx_mstate_global->__pyx_tuple[0]; goto __pyx_L0; - /* "constraint/constraints.py":1111 + /* "constraint/constraints.py":1118 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< @@ -29077,7 +28711,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1115 + /* "constraint/constraints.py":1122 * * # Try all corner combinations * candidates = [p for p in product(*[(lo, hi) for lo, hi in bounds])] # <<<<<<<<<<<<<< @@ -29085,34 +28719,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, 1115, __pyx_L11_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1122, __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, 1115, __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, 1122, __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, 1115, __pyx_L16_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1122, __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, 1115, __pyx_L16_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1122, __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_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1115, __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, 1122, __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, 1115, __pyx_L16_error) + __PYX_ERR(0, 1122, __pyx_L16_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -29121,31 +28755,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, 1115, __pyx_L16_error) + __pyx_t_12 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1122, __pyx_L16_error) __Pyx_XGOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1115, __pyx_L16_error) + __pyx_t_13 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1122, __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, 1115, __pyx_L16_error) + __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1122, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1115, __pyx_L16_error) + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1122, __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, 1115, __pyx_L16_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1122, __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, 1115, __pyx_L16_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < (0)) __PYX_ERR(0, 1122, __pyx_L16_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L20_unpacking_done; @@ -29153,23 +28787,23 @@ 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, 1115, __pyx_L16_error) + __PYX_ERR(0, 1122, __pyx_L16_error) __pyx_L20_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_9genexpr29__pyx_v_lo, __pyx_t_12); __pyx_t_12 = 0; __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, 1115, __pyx_L16_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1122, __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_7, 0, __pyx_9genexpr29__pyx_v_lo) != (0)) __PYX_ERR(0, 1115, __pyx_L16_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_9genexpr29__pyx_v_lo) != (0)) __PYX_ERR(0, 1122, __pyx_L16_error); __Pyx_INCREF(__pyx_9genexpr29__pyx_v_hi); __Pyx_GIVEREF(__pyx_9genexpr29__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_9genexpr29__pyx_v_hi) != (0)) __PYX_ERR(0, 1115, __pyx_L16_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1115, __pyx_L16_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_9genexpr29__pyx_v_hi) != (0)) __PYX_ERR(0, 1122, __pyx_L16_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 1122, __pyx_L16_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_hi); __pyx_9genexpr29__pyx_v_hi = 0; @@ -29181,66 +28815,66 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint 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, 1115, __pyx_L11_error) + __pyx_t_1 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __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, 1115, __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, 1122, __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, 1115, __pyx_L11_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __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, 1115, __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, 1122, __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, 1115, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1122, __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_GetItemRefFast(__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, 1115, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1122, __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, 1115, __pyx_L11_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1122, __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, 1115, __pyx_L11_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1122, __pyx_L11_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr28__pyx_v_p, __pyx_t_8); - __pyx_t_8 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr28__pyx_v_p))) __PYX_ERR(0, 1115, __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, 1122, __pyx_L11_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_p); __pyx_9genexpr28__pyx_v_p = 0; @@ -29253,7 +28887,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_v_candidates = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1116 + /* "constraint/constraints.py":1123 * # 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] # <<<<<<<<<<<<<< @@ -29261,7 +28895,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, 1116, __pyx_L27_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1123, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_v_candidates; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; @@ -29269,28 +28903,28 @@ 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, 1116, __pyx_L27_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1123, __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_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1116, __pyx_L27_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr30__pyx_v_p, __pyx_t_8); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1123, __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_9genexpr30__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, 1116, __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, 1123, __pyx_L27_error) + __Pyx_GOTREF(__pyx_t_7); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 1116, __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, 1123, __pyx_L27_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_p); __pyx_9genexpr30__pyx_v_p = 0; @@ -29303,7 +28937,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_v_products = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1117 + /* "constraint/constraints.py":1124 * 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) # <<<<<<<<<<<<<< @@ -29312,42 +28946,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, 1117, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1124, __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, 1117, __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, 1124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1124, __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, 1117, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 1117, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1124, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 1124, __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":1101 + /* "constraint/constraints.py":1108 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -29360,8 +28988,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); @@ -29382,7 +29010,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1119 +/* "constraint/constraints.py":1126 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -29430,39 +29058,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, 1119, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1126, __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, 1119, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1126, __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, 1119, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1126, __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, 1119, __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, 1126, __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, 1119, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, i); __PYX_ERR(0, 1126, __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, 1119, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1126, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1119, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1126, __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, 1119, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1126, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -29497,7 +29125,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_safe_product", 0); - /* "constraint/constraints.py":1120 + /* "constraint/constraints.py":1127 * * def _safe_product(self, values): * prod = 1 # <<<<<<<<<<<<<< @@ -29507,7 +29135,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":1121 + /* "constraint/constraints.py":1128 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -29519,9 +29147,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, 1121, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1128, __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, 1121, __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, 1128, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -29529,17 +29157,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, 1121, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1128, __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_GetItemRefFast(__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, 1121, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1128, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -29550,13 +29178,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1121, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1128, __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, 1121, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1128, __pyx_L1_error) PyErr_Clear(); } break; @@ -29566,19 +29194,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1122 + /* "constraint/constraints.py":1129 * 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, 1122, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1121 + /* "constraint/constraints.py":1128 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -29588,7 +29216,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1123 + /* "constraint/constraints.py":1130 * for v in values: * prod *= v * return prod # <<<<<<<<<<<<<< @@ -29600,7 +29228,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = __pyx_v_prod; goto __pyx_L0; - /* "constraint/constraints.py":1119 + /* "constraint/constraints.py":1126 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -29622,7 +29250,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1125 +/* "constraint/constraints.py":1132 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -29673,50 +29301,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, 1125, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1132, __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, 1132, __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, 1132, __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, 1132, __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, 1132, __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, 1132, __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, 1125, __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, 1132, __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, 1125, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1132, __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, 1125, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1132, __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, 1132, __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, 1132, __pyx_L3_error) 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, 1132, __pyx_L3_error) 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, 1132, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -29726,7 +29354,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, 1125, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1132, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -29737,9 +29365,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, 1125, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1125, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1125, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1132, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1132, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1132, __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 */ @@ -29787,7 +29415,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1126 + /* "constraint/constraints.py":1133 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -29795,9 +29423,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, 1126, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __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, 1126, __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, 1133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -29814,30 +29442,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, 1126, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1127 + /* "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) * 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, 1127, __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, 1134, __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, 1127, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1134, __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":1128 + /* "constraint/constraints.py":1135 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * target_dom = domains[self.target_var] * t_min = min(target_dom) # <<<<<<<<<<<<<< @@ -29845,73 +29473,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, 1128, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_t_min = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/constraints.py":1130 + /* "constraint/constraints.py":1137 * 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, 1130, __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, 1137, __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, 1130, __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, 1130, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1137, __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, 1137, __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, 1130, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1137, __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_GetItemRefFast(__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, 1130, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1137, __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, 1130, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1137, __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, 1130, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1137, __pyx_L1_error) PyErr_Clear(); } break; @@ -29921,25 +29546,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1131 + /* "constraint/constraints.py":1138 * * 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, 1131, __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, 1138, __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, 1131, __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, 1138, __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, 1131, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { @@ -29948,40 +29573,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, 1131, __pyx_L1_error) + __PYX_ERR(0, 1138, __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, 1131, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1138, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1131, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1138, __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, 1131, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1138, __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, 1131, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1138, __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, 1131, __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, 1138, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -29989,79 +29614,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, 1131, __pyx_L1_error) + __PYX_ERR(0, 1138, __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":1132 + /* "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[:]: * 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, 1132, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1133 + /* "constraint/constraints.py":1140 * 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, 1133, __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, 1140, __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, 1133, __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, 1133, __pyx_L1_error) + __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1140, __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, 1140, __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, 1133, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1140, __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_GetItemRefFast(__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, 1133, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1140, __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, 1133, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1140, __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, 1133, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1140, __pyx_L1_error) PyErr_Clear(); } break; @@ -30071,29 +29696,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1134 + /* "constraint/constraints.py":1141 * 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, 1134, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_v_val, __pyx_v_min_others); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1141, __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, 1134, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_val, __pyx_v_max_others); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1134, __pyx_L1_error) + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1141, __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, 1134, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 1141, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1134, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1141, __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":1135 + /* "constraint/constraints.py":1142 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if max(possible_prods) < t_min: # <<<<<<<<<<<<<< @@ -30101,24 +29726,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, 1135, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1142, __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, 1135, __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, 1142, __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, 1135, __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, 1142, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_12) { - /* "constraint/constraints.py":1136 + /* "constraint/constraints.py":1143 * possible_prods = [val * min_others, val * max_others] * if max(possible_prods) < t_min: * dom.remove(val) # <<<<<<<<<<<<<< @@ -30130,14 +29752,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, 1136, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1143, __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":1135 + /* "constraint/constraints.py":1142 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if max(possible_prods) < t_min: # <<<<<<<<<<<<<< @@ -30146,7 +29768,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1133 + /* "constraint/constraints.py":1140 * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) * dom = domains[var] * for val in dom[:]: # <<<<<<<<<<<<<< @@ -30154,9 +29776,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":1130 + /* "constraint/constraints.py":1137 * t_min = min(target_dom) * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -30164,9 +29786,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":1125 + /* "constraint/constraints.py":1132 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -30199,7 +29821,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1138 +/* "constraint/constraints.py":1145 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -30250,53 +29872,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, 1138, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1145, __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, 1138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1145, __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, 1138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1145, __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, 1138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1145, __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, 1138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1145, __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, 1138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1145, __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, 1138, __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, 1145, __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, 1138, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1145, __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, 1138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1145, __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, 1138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1145, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1145, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1145, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1145, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -30310,7 +29932,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, 1138, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1145, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -30321,8 +29943,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, 1138, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1138, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1145, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1145, __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 */ @@ -30343,7 +29965,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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":1174 +/* "constraint/constraints.py":1181 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p < target_value for p in prods): # <<<<<<<<<<<<<< @@ -30363,7 +29985,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1174, __pyx_L1_error) + __PYX_ERR(0, 1181, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -30374,7 +29996,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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___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, 1174, __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, 1181, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -30411,29 +30033,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1174, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1174, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1181, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1181, __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, 1174, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1181, __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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1181, __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, 1174, __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, 1174, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1174, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_target_value)) { __Pyx_RaiseClosureNameError("target_value"); __PYX_ERR(0, 1181, __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, 1181, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = (!__pyx_t_4); if (__pyx_t_5) { @@ -30473,7 +30095,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1138 +/* "constraint/constraints.py":1145 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -30519,8 +30141,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 *); @@ -30535,25 +30157,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__ *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1138, __pyx_L1_error) + __PYX_ERR(0, 1145, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/constraints.py":1139 + /* "constraint/constraints.py":1146 * * 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, 1139, __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, 1146, __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, 1139, __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, 1146, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":1140 + /* "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 # <<<<<<<<<<<<<< @@ -30565,7 +30187,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1139 + /* "constraint/constraints.py":1146 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -30574,23 +30196,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1142 + /* "constraint/constraints.py":1149 * 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, 1142, __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, 1149, __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, 1142, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1149, __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":1143 + /* "constraint/constraints.py":1150 * * target_value = assignments[self.target_var] * assigned_prod = 1 # <<<<<<<<<<<<<< @@ -30600,35 +30222,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":1144 + /* "constraint/constraints.py":1151 * 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, 1144, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_unassigned = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1146 + /* "constraint/constraints.py":1153 * 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, 1146, __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, 1153, __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, 1146, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1153, __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, 1146, __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, 1153, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -30637,17 +30259,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, 1146, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1153, __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_GetItemRefFast(__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, 1146, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1153, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -30658,13 +30280,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1146, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1153, __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, 1146, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1153, __pyx_L1_error) PyErr_Clear(); } break; @@ -30674,32 +30296,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1147 + /* "constraint/constraints.py":1154 * * 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, 1147, __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, 1154, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":1148 + /* "constraint/constraints.py":1155 * 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, 1148, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1155, __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, 1148, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_assigned_prod, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1155, __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":1147 + /* "constraint/constraints.py":1154 * * for var in self.product_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -30709,7 +30331,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint goto __pyx_L6; } - /* "constraint/constraints.py":1150 + /* "constraint/constraints.py":1157 * assigned_prod *= assignments[var] * else: * unassigned.append(var) # <<<<<<<<<<<<<< @@ -30717,11 +30339,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, 1150, __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, 1157, __pyx_L1_error) } __pyx_L6:; - /* "constraint/constraints.py":1146 + /* "constraint/constraints.py":1153 * unassigned = [] * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -30731,19 +30353,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1152 + /* "constraint/constraints.py":1159 * 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, 1152, __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, 1159, __pyx_L1_error) + __pyx_t_2 = (__pyx_temp != 0); + } + __pyx_t_8 = (!__pyx_t_2); if (__pyx_t_8) { - /* "constraint/constraints.py":1153 + /* "constraint/constraints.py":1160 * * if not unassigned: * return assigned_prod >= target_value # <<<<<<<<<<<<<< @@ -30751,12 +30377,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, 1153, __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, 1160, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1152 + /* "constraint/constraints.py":1159 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< @@ -30765,7 +30391,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1156 + /* "constraint/constraints.py":1163 * * # Estimate min possible value of full product * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned] # <<<<<<<<<<<<<< @@ -30773,7 +30399,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, 1156, __pyx_L11_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1163, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0; @@ -30781,56 +30407,50 @@ 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, 1156, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1163, __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_GetItemRefFast(__pyx_t_6, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1156, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1163, __pyx_L11_error) __Pyx_GOTREF(__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_9genexpr31__pyx_v_v); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1156, __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, 1163, __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, 1156, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1163, __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_9genexpr31__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1156, __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, 1163, __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, 1156, __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, 1163, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); } - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1156, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1163, __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, 1156, __pyx_L11_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1163, __pyx_L11_error); __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1156, __pyx_L11_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1163, __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, 1156, __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, 1163, __pyx_L11_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_v); __pyx_9genexpr31__pyx_v_v = 0; @@ -30843,7 +30463,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_v_domain_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1157 + /* "constraint/constraints.py":1164 * # 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])] # <<<<<<<<<<<<<< @@ -30851,26 +30471,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, 1157, __pyx_L18_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1164, __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, 1157, __pyx_L18_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1164, __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, 1157, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1164, __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, 1157, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1164, __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_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1157, __pyx_L23_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1164, __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; @@ -30878,40 +30498,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, 1157, __pyx_L23_error) + __PYX_ERR(0, 1164, __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, 1157, __pyx_L23_error) + __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1164, __pyx_L23_error) + __Pyx_XGOTREF(__pyx_t_9); + __pyx_t_13 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1164, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1157, __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, 1157, __pyx_L23_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1164, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1164, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1157, __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, 1157, __pyx_L23_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1164, __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, 1157, __pyx_L23_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < (0)) __PYX_ERR(0, 1164, __pyx_L23_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L27_unpacking_done; @@ -30919,22 +30539,22 @@ 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, 1157, __pyx_L23_error) + __PYX_ERR(0, 1164, __pyx_L23_error) __pyx_L27_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr33__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_9genexpr33__pyx_v_hi, __pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1157, __pyx_L23_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1164, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_3); __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, 1157, __pyx_L23_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_9genexpr33__pyx_v_lo) != (0)) __PYX_ERR(0, 1164, __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, 1157, __pyx_L23_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1157, __pyx_L23_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_9genexpr33__pyx_v_hi) != (0)) __PYX_ERR(0, 1164, __pyx_L23_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_12, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1164, __pyx_L23_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -30947,77 +30567,77 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint 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, 1157, __pyx_L18_error) + __pyx_t_10 = PySequence_Tuple(__pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1164, __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, 1157, __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, 1164, __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, 1157, __pyx_L18_error) + __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1164, __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, 1157, __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, 1164, __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, 1157, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1164, __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_GetItemRefFast(__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, 1157, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1164, __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, 1157, __pyx_L18_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1164, __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, 1157, __pyx_L18_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1164, __pyx_L18_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_9genexpr32__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_9genexpr32__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)); + __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, 1157, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_9); + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1164, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_12); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1157, __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, 1164, __pyx_L18_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_p); __pyx_9genexpr32__pyx_v_p = 0; @@ -31030,7 +30650,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_v_candidates = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1158 + /* "constraint/constraints.py":1165 * 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] # <<<<<<<<<<<<<< @@ -31038,7 +30658,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, 1158, __pyx_L34_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __pyx_v_candidates; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; @@ -31046,20 +30666,20 @@ 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, 1158, __pyx_L34_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1165, __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_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1158, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_9genexpr34__pyx_v_c, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Multiply(__pyx_v_assigned_prod, __pyx_9genexpr34__pyx_v_c); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1158, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_9); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1158, __pyx_L34_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1165, __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, 1165, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_12); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 1165, __pyx_L34_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_c); __pyx_9genexpr34__pyx_v_c = 0; @@ -31072,7 +30692,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_v_possible_prods = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1159 + /* "constraint/constraints.py":1166 * 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: # <<<<<<<<<<<<<< @@ -31080,24 +30700,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, 1159, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1166, __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, 1159, __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, 1166, __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, 1159, __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, 1166, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_8) { - /* "constraint/constraints.py":1160 + /* "constraint/constraints.py":1167 * possible_prods = [assigned_prod * c for c in candidates] * if max(possible_prods) < target_value: * return False # <<<<<<<<<<<<<< @@ -31109,7 +30726,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1159 + /* "constraint/constraints.py":1166 * 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: # <<<<<<<<<<<<<< @@ -31118,41 +30735,41 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1162 + /* "constraint/constraints.py":1169 * 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, 1162, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1169, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1163 + /* "constraint/constraints.py":1170 * * 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, 1163, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1170, __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_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1163, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1164 + /* "constraint/constraints.py":1171 * if forwardcheck: * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] # <<<<<<<<<<<<<< @@ -31160,32 +30777,32 @@ 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, 1164, __pyx_L45_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1171, __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, 1164, __pyx_L45_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1171, __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_GetItemRefFast(__pyx_t_12, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1164, __pyx_L45_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1171, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_9genexpr35__pyx_v_v, __pyx_t_6); __pyx_t_6 = 0; - __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, 1164, __pyx_L45_error) - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1164, __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, 1171, __pyx_L45_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1171, __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_9genexpr35__pyx_v_v))) __PYX_ERR(0, 1164, __pyx_L45_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr35__pyx_v_v))) __PYX_ERR(0, 1171, __pyx_L45_error) } } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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:; @@ -31196,18 +30813,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_other_unassigned, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1165 + /* "constraint/constraints.py":1172 * 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, 1165, __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, 1172, __pyx_L1_error) + __pyx_t_8 = (__pyx_temp != 0); + } + if (__pyx_t_8) { - /* "constraint/constraints.py":1166 + /* "constraint/constraints.py":1173 * 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] # <<<<<<<<<<<<<< @@ -31215,66 +30836,60 @@ 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, 1166, __pyx_L54_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __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, 1166, __pyx_L54_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1173, __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_GetItemRefFast(__pyx_t_12, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1166, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1173, __pyx_L54_error) __Pyx_GOTREF(__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_9genexpr36__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1166, __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, 1173, __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, 1166, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1173, __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_9genexpr36__pyx_v_v); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1166, __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, 1173, __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, 1166, __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, 1173, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_13); } - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1166, __pyx_L54_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1173, __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, 1166, __pyx_L54_error); - __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 1166, __pyx_L54_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1173, __pyx_L54_error); + __Pyx_GIVEREF(__pyx_t_13); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_13) != (0)) __PYX_ERR(0, 1173, __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, 1166, __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, 1173, __pyx_L54_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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:; @@ -31285,7 +30900,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_bounds, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1167 + /* "constraint/constraints.py":1174 * 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])] # <<<<<<<<<<<<<< @@ -31293,26 +30908,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, 1167, __pyx_L61_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1174, __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, 1167, __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, 1174, __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, 1167, __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, 1174, __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, 1167, __pyx_L66_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1174, __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_GetItemRefFast(__pyx_t_13, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1167, __pyx_L66_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1174, __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; @@ -31320,40 +30935,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, 1167, __pyx_L66_error) + __PYX_ERR(0, 1174, __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, 1167, __pyx_L66_error) + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __pyx_L66_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_14 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1174, __pyx_L66_error) __Pyx_XGOTREF(__pyx_t_14); - __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1167, __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, 1167, __pyx_L66_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __pyx_L66_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1174, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1167, __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, 1167, __pyx_L66_error) + __pyx_t_17 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1174, __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, 1167, __pyx_L66_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_17), 2) < (0)) __PYX_ERR(0, 1174, __pyx_L66_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; goto __pyx_L70_unpacking_done; @@ -31361,25 +30976,25 @@ 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, 1167, __pyx_L66_error) + __PYX_ERR(0, 1174, __pyx_L66_error) __pyx_L70_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr38__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_9genexpr38__pyx_v_hi, __pyx_t_13); - __pyx_t_13 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1167, __pyx_L66_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1174, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_6); __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, 1167, __pyx_L66_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_9genexpr38__pyx_v_lo) != (0)) __PYX_ERR(0, 1174, __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, 1167, __pyx_L66_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1167, __pyx_L66_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_9genexpr38__pyx_v_hi) != (0)) __PYX_ERR(0, 1174, __pyx_L66_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1174, __pyx_L66_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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; @@ -31389,79 +31004,79 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint 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, 1167, __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, 1167, __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, 1174, __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, 1174, __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, 1167, __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, 1167, __pyx_L61_error) + __pyx_t_16 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1174, __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, 1174, __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, 1167, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1174, __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_GetItemRefFast(__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, 1167, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1174, __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, 1167, __pyx_L61_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1174, __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, 1167, __pyx_L61_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1174, __pyx_L61_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_9genexpr37__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_9genexpr37__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, 1167, __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, 1174, __pyx_L61_error) + __Pyx_GOTREF(__pyx_t_9); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1167, __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, 1174, __pyx_L61_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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:; @@ -31472,7 +31087,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_other_products, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1165 + /* "constraint/constraints.py":1172 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< @@ -31482,7 +31097,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint goto __pyx_L51; } - /* "constraint/constraints.py":1169 + /* "constraint/constraints.py":1176 * other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in bounds])] * else: * other_products = [1] # <<<<<<<<<<<<<< @@ -31490,81 +31105,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, 1169, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1176, __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, 1169, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 1176, __pyx_L1_error); __Pyx_XDECREF_SET(__pyx_v_other_products, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; } __pyx_L51:; - /* "constraint/constraints.py":1171 + /* "constraint/constraints.py":1178 * 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, 1171, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1172 + /* "constraint/constraints.py":1179 * * 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, 1172, __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, 1179, __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, 1172, __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, 1172, __pyx_L1_error) + __pyx_t_16 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1179, __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, 1179, __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, 1172, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1179, __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_GetItemRefFast(__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, 1172, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1179, __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, 1172, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __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, 1172, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1179, __pyx_L1_error) PyErr_Clear(); } break; @@ -31574,7 +31189,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1173 + /* "constraint/constraints.py":1180 * domain = domains[var] * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] # <<<<<<<<<<<<<< @@ -31582,33 +31197,33 @@ 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, 1173, __pyx_L79_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1180, __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, 1173, __pyx_L79_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1180, __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_GetItemRefFast(__pyx_t_9, __pyx_t_18, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_18; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1173, __pyx_L79_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_XDECREF_SET(__pyx_9genexpr39__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, 1173, __pyx_L79_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = PyNumber_Multiply(__pyx_t_10, __pyx_9genexpr39__pyx_v_o); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1173, __pyx_L79_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1180, __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, 1180, __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, 1180, __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, 1173, __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, 1180, __pyx_L79_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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:; @@ -31619,23 +31234,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_prods, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1174 + /* "constraint/constraints.py":1181 * 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, 1174, __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, 1181, __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, 1174, __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, 1181, __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, 1174, __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, 1181, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_8) { - /* "constraint/constraints.py":1175 + /* "constraint/constraints.py":1182 * prods = [assigned_prod * val * o for o in other_products] * if all(p < target_value for p in prods): * domain.hideValue(val) # <<<<<<<<<<<<<< @@ -31644,17 +31259,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, 1175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1182, __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":1174 + /* "constraint/constraints.py":1181 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p < target_value for p in prods): # <<<<<<<<<<<<<< @@ -31663,7 +31278,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1172 + /* "constraint/constraints.py":1179 * * domain = domains[var] * for val in domain[:]: # <<<<<<<<<<<<<< @@ -31671,20 +31286,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":1176 + /* "constraint/constraints.py":1183 * 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, 1176, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1183, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_8); if (__pyx_t_2) { - /* "constraint/constraints.py":1177 + /* "constraint/constraints.py":1184 * domain.hideValue(val) * if not domain: * return False # <<<<<<<<<<<<<< @@ -31694,10 +31309,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":1176 + /* "constraint/constraints.py":1183 * if all(p < target_value for p in prods): * domain.hideValue(val) * if not domain: # <<<<<<<<<<<<<< @@ -31706,7 +31321,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1163 + /* "constraint/constraints.py":1170 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< @@ -31714,9 +31329,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":1162 + /* "constraint/constraints.py":1169 * return False * * if forwardcheck: # <<<<<<<<<<<<<< @@ -31725,7 +31340,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1179 + /* "constraint/constraints.py":1186 * return False * * return True # <<<<<<<<<<<<<< @@ -31737,7 +31352,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1138 + /* "constraint/constraints.py":1145 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -31752,7 +31367,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); @@ -31789,7 +31404,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1198 +/* "constraint/constraints.py":1205 * """ * * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -31838,39 +31453,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, 1198, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1205, __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, 1198, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1205, __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, 1198, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1205, __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, 1198, __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, 1205, __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, 1198, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1205, __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, 1198, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1205, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1198, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1205, __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, 1198, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1205, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -31900,28 +31515,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1204 + /* "constraint/constraints.py":1211 * 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, 1204, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxprod_2, __pyx_v_maxprod) < (0)) __PYX_ERR(0, 1211, __pyx_L1_error) - /* "constraint/constraints.py":1205 + /* "constraint/constraints.py":1212 * """ * self._maxprod = maxprod * self._variable_contains_lt1: list[bool] = list() # <<<<<<<<<<<<<< * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1205, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __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, 1205, __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, 1212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1198 + /* "constraint/constraints.py":1205 * """ * * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< @@ -31942,7 +31557,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ return __pyx_r; } -/* "constraint/constraints.py":1207 +/* "constraint/constraints.py":1214 * self._variable_contains_lt1: list[bool] = list() * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -31993,50 +31608,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, 1207, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1214, __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, 1207, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1214, __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, 1207, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1214, __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, 1207, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1214, __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, 1207, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1214, __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, 1207, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1214, __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, 1207, __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, 1214, __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, 1207, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1214, __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, 1207, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1214, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1207, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1214, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1207, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1214, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1207, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1214, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1207, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1214, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -32046,7 +31661,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, 1207, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1214, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -32057,9 +31672,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, 1207, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1207, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1207, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1214, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1214, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1214, __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 */ @@ -32080,7 +31695,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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":1214 +/* "constraint/constraints.py":1221 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -32100,7 +31715,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_10prePr if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1214, __pyx_L1_error) + __PYX_ERR(0, 1221, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -32108,7 +31723,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_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, 1214, __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, 1221, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -32145,16 +31760,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1214, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1214, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1221, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1221, __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, 1214, __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, 1221, __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, 1214, __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, 1221, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -32162,17 +31777,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, 1214, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1221, __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_GetItemRefFast(__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, 1214, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1221, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -32183,13 +31798,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1214, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1221, __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, 1214, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1221, __pyx_L1_error) PyErr_Clear(); } break; @@ -32200,8 +31815,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, 1214, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1214, __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, 1221, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_XDECREF(__pyx_r); @@ -32240,7 +31855,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr return __pyx_r; } -/* "constraint/constraints.py":1207 +/* "constraint/constraints.py":1214 * self._variable_contains_lt1: list[bool] = list() * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -32277,7 +31892,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1208 + /* "constraint/constraints.py":1215 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -32285,9 +31900,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, 1208, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1215, __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, 1208, __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, 1215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -32304,27 +31919,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, 1208, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1211 + /* "constraint/constraints.py":1218 * * # 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, 1211, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1218, __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, 1211, __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, 1218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1212 + /* "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 # <<<<<<<<<<<<<< @@ -32334,7 +31949,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_INCREF(Py_None); __pyx_v_variable_with_lt1 = Py_None; - /* "constraint/constraints.py":1213 + /* "constraint/constraints.py":1220 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -32346,9 +31961,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, 1213, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1220, __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, 1213, __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, 1220, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -32356,17 +31971,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, 1213, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1220, __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_GetItemRefFast(__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, 1213, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1220, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -32377,13 +31992,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1213, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1220, __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, 1213, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1220, __pyx_L1_error) PyErr_Clear(); } break; @@ -32393,37 +32008,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":1214 + /* "constraint/constraints.py":1221 * 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, 1214, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1221, __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, 1214, __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, 1221, __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, 1214, __pyx_L1_error) + __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1221, __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":1215 + /* "constraint/constraints.py":1222 * 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, 1215, __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, 1222, __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, 1215, __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, 1222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1213 + /* "constraint/constraints.py":1220 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -32433,7 +32048,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1216 + /* "constraint/constraints.py":1223 * 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): # <<<<<<<<<<<<<< @@ -32441,18 +32056,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, 1216, __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, 1223, __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, 1216, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -32460,9 +32072,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, 1216, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1223, __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, 1216, __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, 1223, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -32471,17 +32083,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, 1216, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1223, __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_GetItemRefFast(__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, 1216, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1223, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -32492,13 +32104,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1216, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __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, 1216, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1223, __pyx_L1_error) PyErr_Clear(); } break; @@ -32511,40 +32123,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, 1216, __pyx_L1_error) + __PYX_ERR(0, 1223, __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, 1216, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1216, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1223, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1223, __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, 1216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1216, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1223, __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, 1216, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1223, __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, 1216, __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, 1223, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_unpacking_done; @@ -32552,15 +32164,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, 1216, __pyx_L1_error) + __PYX_ERR(0, 1223, __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":1217 + /* "constraint/constraints.py":1224 * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: # <<<<<<<<<<<<<< @@ -32570,7 +32182,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":1218 + /* "constraint/constraints.py":1225 * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< @@ -32580,7 +32192,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":1220 + /* "constraint/constraints.py":1227 * if variable_with_lt1 is not None: * # if more than one associated variables contain less than 1, we can't prune * return # <<<<<<<<<<<<<< @@ -32592,7 +32204,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1218 + /* "constraint/constraints.py":1225 * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< @@ -32601,7 +32213,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":1221 + /* "constraint/constraints.py":1228 * # if more than one associated variables contain less than 1, we can't prune * return * variable_with_lt1 = variable # <<<<<<<<<<<<<< @@ -32611,7 +32223,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":1217 + /* "constraint/constraints.py":1224 * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: # <<<<<<<<<<<<<< @@ -32620,7 +32232,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":1216 + /* "constraint/constraints.py":1223 * 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): # <<<<<<<<<<<<<< @@ -32630,19 +32242,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1224 + /* "constraint/constraints.py":1231 * * # 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, 1224, __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, 1231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_maxprod = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/constraints.py":1225 + /* "constraint/constraints.py":1232 * # prune the associated variables of values > maxprod * maxprod = self._maxprod * for variable in variables: # <<<<<<<<<<<<<< @@ -32654,9 +32266,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, 1225, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1232, __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, 1225, __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, 1232, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -32664,17 +32276,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, 1225, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1232, __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_GetItemRefFast(__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, 1225, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1232, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -32685,13 +32297,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1225, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1232, __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, 1225, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1232, __pyx_L1_error) PyErr_Clear(); } break; @@ -32701,7 +32313,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":1226 + /* "constraint/constraints.py":1233 * maxprod = self._maxprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -32714,14 +32326,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, 1226, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1226, __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, 1233, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1233, __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":1227 + /* "constraint/constraints.py":1234 * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: * continue # <<<<<<<<<<<<<< @@ -32730,7 +32342,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ goto __pyx_L13_continue; - /* "constraint/constraints.py":1226 + /* "constraint/constraints.py":1233 * maxprod = self._maxprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -32739,71 +32351,71 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":1228 + /* "constraint/constraints.py":1235 * 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, 1228, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1229 + /* "constraint/constraints.py":1236 * 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, 1229, __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, 1236, __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, 1229, __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, 1229, __pyx_L1_error) + __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1236, __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, 1236, __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, 1229, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1236, __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_GetItemRefFast(__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, 1229, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1236, __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, 1229, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1236, __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, 1229, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1236, __pyx_L1_error) PyErr_Clear(); } break; @@ -32813,38 +32425,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":1230 + /* "constraint/constraints.py":1237 * 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, 1230, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1230, __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, 1237, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1237, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { - /* "constraint/constraints.py":1231 + /* "constraint/constraints.py":1238 * 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, 1231, __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, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1230 + /* "constraint/constraints.py":1237 * domain = domains[variable] * for value in domain[:]: * if value > maxprod: # <<<<<<<<<<<<<< @@ -32854,46 +32466,46 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro goto __pyx_L20; } - /* "constraint/constraints.py":1232 + /* "constraint/constraints.py":1239 * 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, 1232, __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, 1239, __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, 1232, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1232, __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, 1239, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1239, __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":1233 + /* "constraint/constraints.py":1240 * 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, 1233, __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, 1240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1232 + /* "constraint/constraints.py":1239 * if value > maxprod: * domain.remove(value) * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< @@ -32903,7 +32515,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __pyx_L20:; - /* "constraint/constraints.py":1229 + /* "constraint/constraints.py":1236 * continue * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -32911,9 +32523,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":1225 + /* "constraint/constraints.py":1232 * # prune the associated variables of values > maxprod * maxprod = self._maxprod * for variable in variables: # <<<<<<<<<<<<<< @@ -32924,7 +32536,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1207 + /* "constraint/constraints.py":1214 * self._variable_contains_lt1: list[bool] = list() * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -32956,7 +32568,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro return __pyx_r; } -/* "constraint/constraints.py":1235 +/* "constraint/constraints.py":1242 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -33007,53 +32619,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, 1235, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1242, __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, 1235, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1242, __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, 1235, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1242, __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, 1235, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1242, __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, 1235, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1242, __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, 1235, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1242, __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, 1235, __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, 1242, __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, 1235, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1242, __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, 1235, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1242, __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, 1235, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1242, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1235, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1242, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1235, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1242, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1235, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1242, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -33067,7 +32679,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, 1235, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1242, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -33078,8 +32690,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, 1235, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1235, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1242, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1242, __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 */ @@ -33100,7 +32712,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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":1243 +/* "constraint/constraints.py":1250 * 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])) # <<<<<<<<<<<<<< @@ -33120,7 +32732,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_8__call 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, 1243, __pyx_L1_error) + __PYX_ERR(0, 1250, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -33128,7 +32740,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_8__call __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, 1243, __pyx_L1_error) + __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, 1250, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -33165,16 +32777,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1243, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1243, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1250, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1250, __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, 1243, __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, 1250, __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, 1243, __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, 1250, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -33182,17 +32794,17 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__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, 1243, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1250, __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_GetItemRefFast(__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, 1243, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1250, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -33203,13 +32815,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1243, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1250, __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, 1243, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1250, __pyx_L1_error) PyErr_Clear(); } break; @@ -33220,8 +32832,8 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call __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, 1243, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1243, __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, 1250, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_XDECREF(__pyx_r); @@ -33260,7 +32872,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call return __pyx_r; } -/* "constraint/constraints.py":1235 +/* "constraint/constraints.py":1242 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -33299,19 +32911,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1236 + /* "constraint/constraints.py":1243 * * 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, 1236, __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, 1243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_maxprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1237 + /* "constraint/constraints.py":1244 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * maxprod = self._maxprod * prod = 1 # <<<<<<<<<<<<<< @@ -33321,7 +32933,7 @@ 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":1238 + /* "constraint/constraints.py":1245 * maxprod = self._maxprod * prod = 1 * missing = False # <<<<<<<<<<<<<< @@ -33330,34 +32942,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ __pyx_v_missing = 0; - /* "constraint/constraints.py":1239 + /* "constraint/constraints.py":1246 * 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): */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1239, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_missing_lt1 = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1241 + /* "constraint/constraints.py":1248 * 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, 1241, __pyx_L1_error) + __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, 1248, __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, 1241, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1248, __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, 1241, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1248, __pyx_L1_error) __pyx_t_4 = (__pyx_t_2 != __pyx_t_3); if (__pyx_t_4) { - /* "constraint/constraints.py":1242 + /* "constraint/constraints.py":1249 * # find out which variables contain values less than 1 if not preprocessed * if len(self._variable_contains_lt1) != len(variables): * for variable in variables: # <<<<<<<<<<<<<< @@ -33369,9 +32981,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __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, 1242, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1249, __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, 1242, __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, 1249, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { @@ -33379,17 +32991,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_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, 1242, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1249, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__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, 1242, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1249, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -33400,13 +33012,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1249, __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, 1242, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1249, __pyx_L1_error) PyErr_Clear(); } break; @@ -33416,28 +33028,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1243 + /* "constraint/constraints.py":1250 * 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, 1243, __pyx_L1_error) + __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, 1250, __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, 1243, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1250, __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, 1243, __pyx_L1_error) + __pyx_t_8 = __pyx_pf_10constraint_11constraints_17MaxProdConstraint_8__call___genexpr(NULL, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1250, __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, 1243, __pyx_L1_error) + __pyx_t_7 = __Pyx_Generator_GetInlinedResult(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1250, __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, 1243, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_6, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 1250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1242 + /* "constraint/constraints.py":1249 * # find out which variables contain values less than 1 if not preprocessed * if len(self._variable_contains_lt1) != len(variables): * for variable in variables: # <<<<<<<<<<<<<< @@ -33447,7 +33059,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1241 + /* "constraint/constraints.py":1248 * missing_lt1 = [] * # find out which variables contain values less than 1 if not preprocessed * if len(self._variable_contains_lt1) != len(variables): # <<<<<<<<<<<<<< @@ -33456,7 +33068,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1244 + /* "constraint/constraints.py":1251 * 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): # <<<<<<<<<<<<<< @@ -33464,18 +33076,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * prod *= assignments[variable] */ __pyx_t_7 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_6 = __pyx_builtin_zip; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __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_10 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_variables, __pyx_t_8}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + 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_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -33483,9 +33092,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_t_3 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1244, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1251, __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, 1244, __pyx_L1_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1251, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -33494,17 +33103,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 1244, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1251, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_3); + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } 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, 1244, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1251, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -33515,13 +33124,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1251, __pyx_L1_error) } else { __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, 1244, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1251, __pyx_L1_error) PyErr_Clear(); } break; @@ -33534,40 +33143,40 @@ 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, 1244, __pyx_L1_error) + __PYX_ERR(0, 1251, __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_7 = PyTuple_GET_ITEM(sequence, 1); + __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_8 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1244, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1244, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1251, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1244, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1251, __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_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1244, __pyx_L1_error) + __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); - index = 0; __pyx_t_8 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L9_unpacking_failed; - __Pyx_GOTREF(__pyx_t_8); - index = 1; __pyx_t_7 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_7)) goto __pyx_L9_unpacking_failed; + 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); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1244, __pyx_L1_error) + 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, 1251, __pyx_L1_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L10_unpacking_done; @@ -33575,40 +33184,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1244, __pyx_L1_error) + __PYX_ERR(0, 1251, __pyx_L1_error) __pyx_L10_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_8); - __pyx_t_8 = 0; - __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_7); + __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":1245 + /* "constraint/constraints.py":1252 * 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_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1245, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1252, __pyx_L1_error) if (__pyx_t_4) { - /* "constraint/constraints.py":1246 + /* "constraint/constraints.py":1253 * 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, 1246, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1246, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1253, __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_7); - __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":1245 + /* "constraint/constraints.py":1252 * 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: # <<<<<<<<<<<<<< @@ -33618,7 +33227,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call goto __pyx_L11; } - /* "constraint/constraints.py":1248 + /* "constraint/constraints.py":1255 * prod *= assignments[variable] * else: * missing = True # <<<<<<<<<<<<<< @@ -33628,26 +33237,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call /*else*/ { __pyx_v_missing = 1; - /* "constraint/constraints.py":1249 + /* "constraint/constraints.py":1256 * else: * missing = True * if contains_lt1: # <<<<<<<<<<<<<< * missing_lt1.append(variable) * if isinstance(prod, float): */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_contains_lt1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1249, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_contains_lt1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1256, __pyx_L1_error) if (__pyx_t_4) { - /* "constraint/constraints.py":1250 + /* "constraint/constraints.py":1257 * missing = True * if contains_lt1: * missing_lt1.append(variable) # <<<<<<<<<<<<<< * if isinstance(prod, float): * prod = round(prod, 10) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_missing_lt1, __pyx_v_variable); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 1250, __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, 1257, __pyx_L1_error) - /* "constraint/constraints.py":1249 + /* "constraint/constraints.py":1256 * else: * missing = True * if contains_lt1: # <<<<<<<<<<<<<< @@ -33658,7 +33267,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } __pyx_L11:; - /* "constraint/constraints.py":1244 + /* "constraint/constraints.py":1251 * 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): # <<<<<<<<<<<<<< @@ -33668,7 +33277,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1251 + /* "constraint/constraints.py":1258 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -33678,29 +33287,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_t_4 = PyFloat_Check(__pyx_v_prod); if (__pyx_t_4) { - /* "constraint/constraints.py":1252 + /* "constraint/constraints.py":1259 * 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_7 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_1 = __pyx_builtin_round; + __pyx_t_8 = NULL; __pyx_t_10 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_prod, __pyx_mstate_global->__pyx_int_10}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __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_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1252, __pyx_L1_error) + 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, 1259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1251 + /* "constraint/constraints.py":1258 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -33709,7 +33315,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1253 + /* "constraint/constraints.py":1260 * if isinstance(prod, float): * prod = round(prod, 10) * if (not missing or len(missing_lt1) == 0) and prod > maxprod: # <<<<<<<<<<<<<< @@ -33721,7 +33327,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } else { goto __pyx_L17_next_and; } - __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1253, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1260, __pyx_L1_error) __pyx_t_13 = (__pyx_t_3 == 0); if (__pyx_t_13) { } else { @@ -33729,14 +33335,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call goto __pyx_L16_bool_binop_done; } __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, 1253, __pyx_L1_error) - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1253, __pyx_L1_error) + __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, 1260, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1260, __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":1254 + /* "constraint/constraints.py":1261 * prod = round(prod, 10) * if (not missing or len(missing_lt1) == 0) and prod > maxprod: * return False # <<<<<<<<<<<<<< @@ -33748,7 +33354,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1253 + /* "constraint/constraints.py":1260 * if isinstance(prod, float): * prod = round(prod, 10) * if (not missing or len(missing_lt1) == 0) and prod > maxprod: # <<<<<<<<<<<<<< @@ -33757,17 +33363,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1255 + /* "constraint/constraints.py":1262 * 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_4 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1255, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1262, __pyx_L1_error) if (__pyx_t_4) { - /* "constraint/constraints.py":1256 + /* "constraint/constraints.py":1263 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -33779,9 +33385,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_t_3 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1256, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1263, __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, 1256, __pyx_L1_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1263, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { @@ -33789,177 +33395,177 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 1256, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1263, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_3); + __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } 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, 1256, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1263, __pyx_L1_error) #endif 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_6, __pyx_t_3)); + __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_3)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_3); + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_3); #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1256, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1263, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_5(__pyx_t_6); - 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, 1256, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1263, __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":1257 + /* "constraint/constraints.py":1264 * 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_13 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1257, __pyx_L1_error) + __pyx_t_13 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1264, __pyx_L1_error) if (__pyx_t_13) { } else { __pyx_t_4 = __pyx_t_13; goto __pyx_L23_bool_binop_done; } - __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable, __pyx_v_missing_lt1, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1257, __pyx_L1_error) + __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable, __pyx_v_missing_lt1, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1264, __pyx_L1_error) if (!__pyx_t_13) { } else { __pyx_t_4 = __pyx_t_13; goto __pyx_L23_bool_binop_done; } - __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1257, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1264, __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":1258 + /* "constraint/constraints.py":1265 * 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, 1258, __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, 1265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":1259 + /* "constraint/constraints.py":1266 * 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, 1259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); + __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, 1266, __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_2 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1259, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1266, __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, 1266, __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_7))) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); + 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, 1259, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1266, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_2); + __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); + 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, 1259, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1266, __pyx_L1_error) #endif 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_7, __pyx_t_2)); + __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_2); + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1259, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1266, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_14(__pyx_t_7); - 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, 1259, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1266, __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":1260 + /* "constraint/constraints.py":1267 * 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, 1260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_v_maxprod, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1260, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1260, __pyx_L1_error) + __pyx_t_8 = PyNumber_Multiply(__pyx_v_prod, __pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1267, __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, 1267, __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, 1267, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_4) { - /* "constraint/constraints.py":1261 + /* "constraint/constraints.py":1268 * 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_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_8 = __Pyx_PyObject_FastCallMethod(__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_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1261, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + 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, 1268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1260 + /* "constraint/constraints.py":1267 * domain = domains[variable] * for value in domain[:]: * if prod * value > maxprod: # <<<<<<<<<<<<<< @@ -33968,7 +33574,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1259 + /* "constraint/constraints.py":1266 * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -33976,20 +33582,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * domain.hideValue(value) */ } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1262 + /* "constraint/constraints.py":1269 * if prod * value > maxprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False * return True */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1262, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1269, __pyx_L1_error) __pyx_t_13 = (!__pyx_t_4); if (__pyx_t_13) { - /* "constraint/constraints.py":1263 + /* "constraint/constraints.py":1270 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -34002,7 +33608,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1262 + /* "constraint/constraints.py":1269 * if prod * value > maxprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -34011,7 +33617,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1257 + /* "constraint/constraints.py":1264 * if forwardcheck: * for variable in variables: * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): # <<<<<<<<<<<<<< @@ -34020,7 +33626,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1256 + /* "constraint/constraints.py":1263 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -34030,7 +33636,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1255 + /* "constraint/constraints.py":1262 * if (not missing or len(missing_lt1) == 0) and prod > maxprod: * return False * if forwardcheck: # <<<<<<<<<<<<<< @@ -34039,7 +33645,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1264 + /* "constraint/constraints.py":1271 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -34051,7 +33657,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1235 + /* "constraint/constraints.py":1242 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -34082,7 +33688,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call return __pyx_r; } -/* "constraint/constraints.py":1284 +/* "constraint/constraints.py":1291 * """ # noqa: E501 * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -34131,38 +33737,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, 1284, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1291, __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, 1284, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1291, __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, 1284, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1291, __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, 1284, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1291, __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, 1284, __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, 1291, __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, 1284, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(0, 1291, __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, 1284, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1291, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1284, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1291, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1284, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1291, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_target_var = ((PyObject*)values[1]); @@ -34170,7 +33776,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, 1284, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1291, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -34181,7 +33787,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, 1284, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 1291, __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 */ @@ -34209,25 +33815,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1285 + /* "constraint/constraints.py":1292 * * 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, 1285, __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, 1292, __pyx_L1_error) - /* "constraint/constraints.py":1286 + /* "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 # <<<<<<<<<<<<<< * * 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, 1286, __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, 1293, __pyx_L1_error) - /* "constraint/constraints.py":1284 + /* "constraint/constraints.py":1291 * """ # noqa: E501 * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -34247,7 +33853,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1288 +/* "constraint/constraints.py":1295 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -34296,41 +33902,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, 1288, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1295, __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, 1288, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1295, __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, 1288, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1295, __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, 1288, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1295, __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, 1288, __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, 1295, __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, 1288, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, i); __PYX_ERR(0, 1295, __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, 1288, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1295, __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, 1288, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1295, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1288, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1295, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -34342,7 +33948,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, 1288, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1295, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -34382,10 +33988,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; @@ -34395,35 +34001,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_product_bounds", 0); - /* "constraint/constraints.py":1289 + /* "constraint/constraints.py":1296 * * 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, 1289, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1290 + /* "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: * 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, 1290, __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, 1297, __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, 1290, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1297, __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, 1290, __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, 1297, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -34432,17 +34038,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, 1290, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1297, __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_GetItemRefFast(__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, 1290, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1297, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -34453,13 +34059,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1290, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1297, __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, 1290, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1297, __pyx_L1_error) PyErr_Clear(); } break; @@ -34469,19 +34075,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1291 + /* "constraint/constraints.py":1298 * 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, 1291, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1291, __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, 1298, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1292 + /* "constraint/constraints.py":1299 * for var in self.product_vars: * if var == exclude_var: * continue # <<<<<<<<<<<<<< @@ -34490,7 +34096,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ goto __pyx_L3_continue; - /* "constraint/constraints.py":1291 + /* "constraint/constraints.py":1298 * bounds = [] * for var in self.product_vars: * if var == exclude_var: # <<<<<<<<<<<<<< @@ -34499,30 +34105,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1293 + /* "constraint/constraints.py":1300 * 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, 1293, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_domain_dict, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1294 + /* "constraint/constraints.py":1301 * 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, 1294, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_dom); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1301, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { - /* "constraint/constraints.py":1295 + /* "constraint/constraints.py":1302 * dom = domain_dict[var] * if not dom: * continue # <<<<<<<<<<<<<< @@ -34531,7 +34137,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ goto __pyx_L3_continue; - /* "constraint/constraints.py":1294 + /* "constraint/constraints.py":1301 * continue * dom = domain_dict[var] * if not dom: # <<<<<<<<<<<<<< @@ -34540,7 +34146,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1296 + /* "constraint/constraints.py":1303 * if not dom: * continue * bounds.append((min(dom), max(dom))) # <<<<<<<<<<<<<< @@ -34548,41 +34154,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, 1296, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1303, __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, 1296, __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, 1303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1296, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1303, __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, 1296, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 1296, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1303, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 1303, __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, 1296, __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, 1303, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":1290 + /* "constraint/constraints.py":1297 * def _get_product_bounds(self, domain_dict, exclude_var=None): * bounds = [] * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -34593,19 +34193,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1298 + /* "constraint/constraints.py":1305 * 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, 1298, __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, 1305, __pyx_L1_error) + __pyx_t_6 = (__pyx_temp != 0); + } + __pyx_t_5 = (!__pyx_t_6); if (__pyx_t_5) { - /* "constraint/constraints.py":1299 + /* "constraint/constraints.py":1306 * * if not bounds: * return 1, 1 # <<<<<<<<<<<<<< @@ -34617,7 +34221,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = __pyx_mstate_global->__pyx_tuple[0]; goto __pyx_L0; - /* "constraint/constraints.py":1298 + /* "constraint/constraints.py":1305 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< @@ -34626,7 +34230,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1302 + /* "constraint/constraints.py":1309 * * # Try all corner combinations * candidates = [p for p in product(*[(lo, hi) for lo, hi in bounds])] # <<<<<<<<<<<<<< @@ -34634,34 +34238,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, 1302, __pyx_L11_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1309, __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, 1302, __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, 1309, __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, 1302, __pyx_L16_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1309, __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, 1302, __pyx_L16_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1309, __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_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1302, __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, 1309, __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, 1302, __pyx_L16_error) + __PYX_ERR(0, 1309, __pyx_L16_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -34670,31 +34274,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, 1302, __pyx_L16_error) + __pyx_t_12 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1309, __pyx_L16_error) __Pyx_XGOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1302, __pyx_L16_error) + __pyx_t_13 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1309, __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, 1302, __pyx_L16_error) + __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1309, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1302, __pyx_L16_error) + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1309, __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, 1302, __pyx_L16_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1309, __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, 1302, __pyx_L16_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < (0)) __PYX_ERR(0, 1309, __pyx_L16_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L20_unpacking_done; @@ -34702,23 +34306,23 @@ 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, 1302, __pyx_L16_error) + __PYX_ERR(0, 1309, __pyx_L16_error) __pyx_L20_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_9genexpr44__pyx_v_lo, __pyx_t_12); __pyx_t_12 = 0; __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, 1302, __pyx_L16_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1309, __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_7, 0, __pyx_9genexpr44__pyx_v_lo) != (0)) __PYX_ERR(0, 1302, __pyx_L16_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_9genexpr44__pyx_v_lo) != (0)) __PYX_ERR(0, 1309, __pyx_L16_error); __Pyx_INCREF(__pyx_9genexpr44__pyx_v_hi); __Pyx_GIVEREF(__pyx_9genexpr44__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_9genexpr44__pyx_v_hi) != (0)) __PYX_ERR(0, 1302, __pyx_L16_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1302, __pyx_L16_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_9genexpr44__pyx_v_hi) != (0)) __PYX_ERR(0, 1309, __pyx_L16_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 1309, __pyx_L16_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_hi); __pyx_9genexpr44__pyx_v_hi = 0; @@ -34730,66 +34334,66 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint 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, 1302, __pyx_L11_error) + __pyx_t_1 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1309, __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, 1302, __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, 1309, __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, 1302, __pyx_L11_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1309, __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, 1302, __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, 1309, __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, 1302, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1309, __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_GetItemRefFast(__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, 1302, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1309, __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, 1302, __pyx_L11_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1309, __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, 1302, __pyx_L11_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1309, __pyx_L11_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr43__pyx_v_p, __pyx_t_8); - __pyx_t_8 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr43__pyx_v_p))) __PYX_ERR(0, 1302, __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, 1309, __pyx_L11_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_p); __pyx_9genexpr43__pyx_v_p = 0; @@ -34802,7 +34406,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_v_candidates = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1303 + /* "constraint/constraints.py":1310 * # 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] # <<<<<<<<<<<<<< @@ -34810,7 +34414,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, 1303, __pyx_L27_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1310, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_v_candidates; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; @@ -34818,28 +34422,28 @@ 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, 1303, __pyx_L27_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1310, __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_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1303, __pyx_L27_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr45__pyx_v_p, __pyx_t_8); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1310, __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_9genexpr45__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, 1303, __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, 1310, __pyx_L27_error) + __Pyx_GOTREF(__pyx_t_7); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 1303, __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, 1310, __pyx_L27_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_p); __pyx_9genexpr45__pyx_v_p = 0; @@ -34852,7 +34456,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_v_products = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1304 + /* "constraint/constraints.py":1311 * 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) # <<<<<<<<<<<<<< @@ -34861,42 +34465,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, 1304, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1311, __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, 1304, __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, 1311, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1304, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1311, __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, 1304, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 1304, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1311, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 1311, __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":1288 + /* "constraint/constraints.py":1295 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -34909,8 +34507,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); @@ -34931,7 +34529,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1306 +/* "constraint/constraints.py":1313 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -34979,39 +34577,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, 1306, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1313, __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, 1306, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1313, __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, 1313, __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, 1306, __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, 1313, __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, 1306, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, i); __PYX_ERR(0, 1313, __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, 1306, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1313, __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, 1313, __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, 1306, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1313, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -35046,7 +34644,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_safe_product", 0); - /* "constraint/constraints.py":1307 + /* "constraint/constraints.py":1314 * * def _safe_product(self, values): * prod = 1 # <<<<<<<<<<<<<< @@ -35056,7 +34654,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":1308 + /* "constraint/constraints.py":1315 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -35068,9 +34666,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, 1308, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1315, __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, 1315, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -35078,17 +34676,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, 1308, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1315, __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_GetItemRefFast(__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, 1315, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -35099,13 +34697,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1308, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1315, __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, 1315, __pyx_L1_error) PyErr_Clear(); } break; @@ -35115,19 +34713,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1309 + /* "constraint/constraints.py":1316 * 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, 1309, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1308 + /* "constraint/constraints.py":1315 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -35137,7 +34735,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1310 + /* "constraint/constraints.py":1317 * for v in values: * prod *= v * return prod # <<<<<<<<<<<<<< @@ -35149,7 +34747,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = __pyx_v_prod; goto __pyx_L0; - /* "constraint/constraints.py":1306 + /* "constraint/constraints.py":1313 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -35171,7 +34769,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1312 +/* "constraint/constraints.py":1319 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -35222,50 +34820,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, 1312, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1319, __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, 1312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1319, __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, 1312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1319, __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, 1312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1319, __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, 1312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1319, __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, 1312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1319, __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, 1312, __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, 1319, __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, 1312, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1319, __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, 1312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1319, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1319, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1319, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1319, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1312, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1319, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -35275,7 +34873,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, 1312, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1319, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -35286,9 +34884,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, 1312, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1312, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1312, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1319, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1319, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1319, __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 */ @@ -35336,7 +34934,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1313 + /* "constraint/constraints.py":1320 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -35344,9 +34942,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, 1313, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1320, __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, 1313, __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, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -35363,30 +34961,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, 1313, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1314 + /* "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) * 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, 1314, __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, 1321, __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, 1314, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1321, __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":1315 + /* "constraint/constraints.py":1322 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * target_dom = domains[self.target_var] * t_max = max(target_dom) # <<<<<<<<<<<<<< @@ -35394,73 +34992,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, 1315, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_t_max = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/constraints.py":1317 + /* "constraint/constraints.py":1324 * 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, 1317, __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, 1324, __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, 1317, __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, 1317, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1324, __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, 1324, __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, 1317, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1324, __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_GetItemRefFast(__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, 1317, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1324, __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, 1317, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1324, __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, 1317, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1324, __pyx_L1_error) PyErr_Clear(); } break; @@ -35470,25 +35065,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1318 + /* "constraint/constraints.py":1325 * * 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, 1318, __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, 1325, __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, 1318, __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, 1325, __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, 1318, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { @@ -35497,40 +35092,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, 1318, __pyx_L1_error) + __PYX_ERR(0, 1325, __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, 1318, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1325, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1318, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1325, __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, 1318, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1325, __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, 1318, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1325, __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, 1318, __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, 1325, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -35538,79 +35133,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, 1318, __pyx_L1_error) + __PYX_ERR(0, 1325, __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":1319 + /* "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[:]: * 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, 1319, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1320 + /* "constraint/constraints.py":1327 * 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, 1320, __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, 1327, __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, 1320, __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, 1320, __pyx_L1_error) + __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1327, __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, 1327, __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, 1320, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1327, __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_GetItemRefFast(__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, 1320, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1327, __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, 1320, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1327, __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, 1320, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1327, __pyx_L1_error) PyErr_Clear(); } break; @@ -35620,29 +35215,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1321 + /* "constraint/constraints.py":1328 * 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, 1321, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_v_val, __pyx_v_min_others); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1328, __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, 1321, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_val, __pyx_v_max_others); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1321, __pyx_L1_error) + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1328, __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, 1321, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 1328, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1321, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1328, __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":1322 + /* "constraint/constraints.py":1329 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if min(possible_prods) > t_max: # <<<<<<<<<<<<<< @@ -35650,24 +35245,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, 1322, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1329, __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, 1322, __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, 1329, __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, 1322, __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, 1329, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_12) { - /* "constraint/constraints.py":1323 + /* "constraint/constraints.py":1330 * possible_prods = [val * min_others, val * max_others] * if min(possible_prods) > t_max: * dom.remove(val) # <<<<<<<<<<<<<< @@ -35679,14 +35271,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, 1323, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1330, __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":1322 + /* "constraint/constraints.py":1329 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if min(possible_prods) > t_max: # <<<<<<<<<<<<<< @@ -35695,7 +35287,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1320 + /* "constraint/constraints.py":1327 * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) * dom = domains[var] * for val in dom[:]: # <<<<<<<<<<<<<< @@ -35703,9 +35295,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":1317 + /* "constraint/constraints.py":1324 * t_max = max(target_dom) * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -35713,9 +35305,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":1312 + /* "constraint/constraints.py":1319 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -35748,7 +35340,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1325 +/* "constraint/constraints.py":1332 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -35799,53 +35391,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, 1325, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1332, __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, 1325, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1332, __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, 1325, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1332, __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, 1325, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1332, __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, 1325, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1332, __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, 1325, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1332, __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, 1325, __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, 1332, __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, 1325, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1332, __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, 1325, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1332, __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, 1325, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1332, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1325, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1332, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1325, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1332, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1325, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1332, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -35859,7 +35451,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, 1325, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1332, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -35870,8 +35462,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, 1325, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1325, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1332, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1332, __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 */ @@ -35892,7 +35484,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":1361 +/* "constraint/constraints.py":1368 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p > target_value for p in prods): # <<<<<<<<<<<<<< @@ -35912,7 +35504,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, 1361, __pyx_L1_error) + __PYX_ERR(0, 1368, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -35923,7 +35515,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, 1361, __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, 1368, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -35960,29 +35552,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1361, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1361, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1368, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1368, __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, 1361, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1368, __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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1361, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1368, __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, 1361, __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, 1361, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1361, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_target_value)) { __Pyx_RaiseClosureNameError("target_value"); __PYX_ERR(0, 1368, __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, 1368, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1368, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = (!__pyx_t_4); if (__pyx_t_5) { @@ -36022,7 +35614,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1325 +/* "constraint/constraints.py":1332 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -36068,8 +35660,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 *); @@ -36084,25 +35676,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, 1325, __pyx_L1_error) + __PYX_ERR(0, 1332, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/constraints.py":1326 + /* "constraint/constraints.py":1333 * * 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, 1326, __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, 1333, __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, 1326, __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, 1333, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":1327 + /* "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 # <<<<<<<<<<<<<< @@ -36114,7 +35706,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1326 + /* "constraint/constraints.py":1333 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -36123,23 +35715,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1329 + /* "constraint/constraints.py":1336 * 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, 1329, __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, 1336, __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, 1329, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1336, __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":1330 + /* "constraint/constraints.py":1337 * * target_value = assignments[self.target_var] * assigned_prod = 1 # <<<<<<<<<<<<<< @@ -36149,35 +35741,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":1331 + /* "constraint/constraints.py":1338 * 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, 1331, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_unassigned = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1333 + /* "constraint/constraints.py":1340 * 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, 1333, __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, 1340, __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, 1333, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1340, __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, 1333, __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, 1340, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -36186,17 +35778,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, 1333, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1340, __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_GetItemRefFast(__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, 1333, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1340, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -36207,13 +35799,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1333, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1340, __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, 1333, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1340, __pyx_L1_error) PyErr_Clear(); } break; @@ -36223,32 +35815,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1334 + /* "constraint/constraints.py":1341 * * 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, 1334, __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, 1341, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":1335 + /* "constraint/constraints.py":1342 * 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, 1335, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1342, __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, 1335, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_assigned_prod, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1342, __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":1334 + /* "constraint/constraints.py":1341 * * for var in self.product_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -36258,7 +35850,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint goto __pyx_L6; } - /* "constraint/constraints.py":1337 + /* "constraint/constraints.py":1344 * assigned_prod *= assignments[var] * else: * unassigned.append(var) # <<<<<<<<<<<<<< @@ -36266,11 +35858,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, 1337, __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, 1344, __pyx_L1_error) } __pyx_L6:; - /* "constraint/constraints.py":1333 + /* "constraint/constraints.py":1340 * unassigned = [] * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -36280,19 +35872,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1339 + /* "constraint/constraints.py":1346 * 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, 1339, __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, 1346, __pyx_L1_error) + __pyx_t_2 = (__pyx_temp != 0); + } + __pyx_t_8 = (!__pyx_t_2); if (__pyx_t_8) { - /* "constraint/constraints.py":1340 + /* "constraint/constraints.py":1347 * * if not unassigned: * return assigned_prod <= target_value # <<<<<<<<<<<<<< @@ -36300,12 +35896,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, 1340, __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, 1347, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1339 + /* "constraint/constraints.py":1346 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< @@ -36314,7 +35910,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1343 + /* "constraint/constraints.py":1350 * * # Estimate max possible value of full product * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned] # <<<<<<<<<<<<<< @@ -36322,7 +35918,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, 1343, __pyx_L11_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0; @@ -36330,56 +35926,50 @@ 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, 1343, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1350, __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_GetItemRefFast(__pyx_t_6, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1343, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1350, __pyx_L11_error) __Pyx_GOTREF(__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_9genexpr46__pyx_v_v); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1343, __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, 1350, __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, 1343, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1350, __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_9genexpr46__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1343, __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, 1350, __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, 1343, __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, 1350, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); } - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1343, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1350, __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, 1343, __pyx_L11_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1350, __pyx_L11_error); __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1343, __pyx_L11_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1350, __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, 1343, __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, 1350, __pyx_L11_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_v); __pyx_9genexpr46__pyx_v_v = 0; @@ -36392,7 +35982,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_v_domain_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1344 + /* "constraint/constraints.py":1351 * # 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])] # <<<<<<<<<<<<<< @@ -36400,26 +35990,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, 1344, __pyx_L18_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1351, __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, 1344, __pyx_L18_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1351, __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, 1344, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1351, __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, 1344, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1351, __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_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1344, __pyx_L23_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1351, __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; @@ -36427,40 +36017,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, 1344, __pyx_L23_error) + __PYX_ERR(0, 1351, __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, 1344, __pyx_L23_error) + __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1351, __pyx_L23_error) + __Pyx_XGOTREF(__pyx_t_9); + __pyx_t_13 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1351, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1344, __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, 1344, __pyx_L23_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1351, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1351, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1344, __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, 1344, __pyx_L23_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1351, __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, 1344, __pyx_L23_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < (0)) __PYX_ERR(0, 1351, __pyx_L23_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L27_unpacking_done; @@ -36468,22 +36058,22 @@ 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, 1344, __pyx_L23_error) + __PYX_ERR(0, 1351, __pyx_L23_error) __pyx_L27_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr48__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_9genexpr48__pyx_v_hi, __pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1344, __pyx_L23_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1351, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_3); __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, 1344, __pyx_L23_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_9genexpr48__pyx_v_lo) != (0)) __PYX_ERR(0, 1351, __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, 1344, __pyx_L23_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1344, __pyx_L23_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_9genexpr48__pyx_v_hi) != (0)) __PYX_ERR(0, 1351, __pyx_L23_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_12, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1351, __pyx_L23_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -36496,77 +36086,77 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint 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, 1344, __pyx_L18_error) + __pyx_t_10 = PySequence_Tuple(__pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1351, __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, 1344, __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, 1351, __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, 1344, __pyx_L18_error) + __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1351, __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, 1344, __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, 1351, __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, 1344, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1351, __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_GetItemRefFast(__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, 1344, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1351, __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, 1344, __pyx_L18_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1351, __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, 1344, __pyx_L18_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1351, __pyx_L18_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_9genexpr47__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_9genexpr47__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)); + __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, 1344, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_9); + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1351, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_12); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1344, __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, 1351, __pyx_L18_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_p); __pyx_9genexpr47__pyx_v_p = 0; @@ -36579,7 +36169,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_v_candidates = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1345 + /* "constraint/constraints.py":1352 * 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] # <<<<<<<<<<<<<< @@ -36587,7 +36177,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, 1345, __pyx_L34_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __pyx_v_candidates; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; @@ -36595,20 +36185,20 @@ 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, 1345, __pyx_L34_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1352, __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_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1345, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_9genexpr49__pyx_v_c, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Multiply(__pyx_v_assigned_prod, __pyx_9genexpr49__pyx_v_c); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1345, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_9); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1345, __pyx_L34_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1352, __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, 1352, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_12); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 1352, __pyx_L34_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_9genexpr49__pyx_v_c); __pyx_9genexpr49__pyx_v_c = 0; @@ -36621,7 +36211,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_v_possible_prods = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1346 + /* "constraint/constraints.py":1353 * 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: # <<<<<<<<<<<<<< @@ -36629,24 +36219,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, 1346, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __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, 1346, __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, 1353, __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, 1346, __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, 1353, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_8) { - /* "constraint/constraints.py":1347 + /* "constraint/constraints.py":1354 * possible_prods = [assigned_prod * c for c in candidates] * if min(possible_prods) > target_value: * return False # <<<<<<<<<<<<<< @@ -36658,7 +36245,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1346 + /* "constraint/constraints.py":1353 * 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: # <<<<<<<<<<<<<< @@ -36667,41 +36254,41 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1349 + /* "constraint/constraints.py":1356 * 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, 1349, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1356, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1350 + /* "constraint/constraints.py":1357 * * 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, 1350, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1357, __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_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1351 + /* "constraint/constraints.py":1358 * if forwardcheck: * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] # <<<<<<<<<<<<<< @@ -36709,32 +36296,32 @@ 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, 1351, __pyx_L45_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __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, 1351, __pyx_L45_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1358, __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_GetItemRefFast(__pyx_t_12, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1351, __pyx_L45_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1358, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_9genexpr50__pyx_v_v, __pyx_t_6); __pyx_t_6 = 0; - __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, 1351, __pyx_L45_error) - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1351, __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, 1358, __pyx_L45_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1358, __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_9genexpr50__pyx_v_v))) __PYX_ERR(0, 1351, __pyx_L45_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr50__pyx_v_v))) __PYX_ERR(0, 1358, __pyx_L45_error) } } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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:; @@ -36745,18 +36332,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_other_unassigned, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1352 + /* "constraint/constraints.py":1359 * 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, 1352, __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, 1359, __pyx_L1_error) + __pyx_t_8 = (__pyx_temp != 0); + } + if (__pyx_t_8) { - /* "constraint/constraints.py":1353 + /* "constraint/constraints.py":1360 * 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] # <<<<<<<<<<<<<< @@ -36764,66 +36355,60 @@ 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, 1353, __pyx_L54_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __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, 1353, __pyx_L54_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1360, __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_GetItemRefFast(__pyx_t_12, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1353, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1360, __pyx_L54_error) __Pyx_GOTREF(__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_9genexpr51__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1353, __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, 1360, __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, 1353, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1360, __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_9genexpr51__pyx_v_v); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1353, __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, 1360, __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, 1353, __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, 1360, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_13); } - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1353, __pyx_L54_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1360, __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, 1353, __pyx_L54_error); - __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 1353, __pyx_L54_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1360, __pyx_L54_error); + __Pyx_GIVEREF(__pyx_t_13); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_13) != (0)) __PYX_ERR(0, 1360, __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, 1353, __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, 1360, __pyx_L54_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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:; @@ -36834,7 +36419,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_bounds, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1354 + /* "constraint/constraints.py":1361 * 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])] # <<<<<<<<<<<<<< @@ -36842,26 +36427,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, 1354, __pyx_L61_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1361, __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, 1354, __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, 1361, __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, 1354, __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, 1361, __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, 1354, __pyx_L66_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1361, __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_GetItemRefFast(__pyx_t_13, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1354, __pyx_L66_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1361, __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; @@ -36869,40 +36454,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, 1354, __pyx_L66_error) + __PYX_ERR(0, 1361, __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, 1354, __pyx_L66_error) + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1361, __pyx_L66_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_14 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1361, __pyx_L66_error) __Pyx_XGOTREF(__pyx_t_14); - __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1354, __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, 1354, __pyx_L66_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1361, __pyx_L66_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1361, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1354, __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, 1354, __pyx_L66_error) + __pyx_t_17 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1361, __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, 1354, __pyx_L66_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_17), 2) < (0)) __PYX_ERR(0, 1361, __pyx_L66_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; goto __pyx_L70_unpacking_done; @@ -36910,25 +36495,25 @@ 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, 1354, __pyx_L66_error) + __PYX_ERR(0, 1361, __pyx_L66_error) __pyx_L70_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr53__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_9genexpr53__pyx_v_hi, __pyx_t_13); - __pyx_t_13 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1354, __pyx_L66_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1361, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_6); __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, 1354, __pyx_L66_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_9genexpr53__pyx_v_lo) != (0)) __PYX_ERR(0, 1361, __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, 1354, __pyx_L66_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1354, __pyx_L66_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_9genexpr53__pyx_v_hi) != (0)) __PYX_ERR(0, 1361, __pyx_L66_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1361, __pyx_L66_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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; @@ -36938,79 +36523,79 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint 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, 1354, __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, 1354, __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, 1361, __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, 1361, __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, 1354, __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, 1354, __pyx_L61_error) + __pyx_t_16 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1361, __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, 1361, __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, 1354, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1361, __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_GetItemRefFast(__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, 1354, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1361, __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, 1354, __pyx_L61_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1361, __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, 1354, __pyx_L61_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1361, __pyx_L61_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_9genexpr52__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_9genexpr52__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, 1354, __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, 1361, __pyx_L61_error) + __Pyx_GOTREF(__pyx_t_9); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1354, __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, 1361, __pyx_L61_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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:; @@ -37021,7 +36606,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_other_products, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1352 + /* "constraint/constraints.py":1359 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< @@ -37031,7 +36616,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint goto __pyx_L51; } - /* "constraint/constraints.py":1356 + /* "constraint/constraints.py":1363 * other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in bounds])] * else: * other_products = [1] # <<<<<<<<<<<<<< @@ -37039,81 +36624,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, 1356, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1363, __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, 1356, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 1363, __pyx_L1_error); __Pyx_XDECREF_SET(__pyx_v_other_products, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; } __pyx_L51:; - /* "constraint/constraints.py":1358 + /* "constraint/constraints.py":1365 * 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, 1358, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1359 + /* "constraint/constraints.py":1366 * * 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, 1359, __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, 1366, __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, 1359, __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, 1359, __pyx_L1_error) + __pyx_t_16 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1366, __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, 1366, __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, 1359, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1366, __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_GetItemRefFast(__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, 1359, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1366, __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, 1359, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __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, 1359, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1366, __pyx_L1_error) PyErr_Clear(); } break; @@ -37123,7 +36708,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1360 + /* "constraint/constraints.py":1367 * domain = domains[var] * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] # <<<<<<<<<<<<<< @@ -37131,33 +36716,33 @@ 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, 1360, __pyx_L79_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1367, __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, 1360, __pyx_L79_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1367, __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_GetItemRefFast(__pyx_t_9, __pyx_t_18, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_18; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1360, __pyx_L79_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_XDECREF_SET(__pyx_9genexpr54__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, 1360, __pyx_L79_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = PyNumber_Multiply(__pyx_t_10, __pyx_9genexpr54__pyx_v_o); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1360, __pyx_L79_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1367, __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, 1367, __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, 1367, __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, 1360, __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, 1367, __pyx_L79_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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:; @@ -37168,23 +36753,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_prods, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1361 + /* "constraint/constraints.py":1368 * 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, 1361, __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, 1368, __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, 1361, __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, 1368, __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, 1361, __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, 1368, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_8) { - /* "constraint/constraints.py":1362 + /* "constraint/constraints.py":1369 * prods = [assigned_prod * val * o for o in other_products] * if all(p > target_value for p in prods): * domain.hideValue(val) # <<<<<<<<<<<<<< @@ -37193,17 +36778,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, 1362, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1369, __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":1361 + /* "constraint/constraints.py":1368 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p > target_value for p in prods): # <<<<<<<<<<<<<< @@ -37212,7 +36797,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1359 + /* "constraint/constraints.py":1366 * * domain = domains[var] * for val in domain[:]: # <<<<<<<<<<<<<< @@ -37220,20 +36805,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":1363 + /* "constraint/constraints.py":1370 * 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, 1363, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1370, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_8); if (__pyx_t_2) { - /* "constraint/constraints.py":1364 + /* "constraint/constraints.py":1371 * domain.hideValue(val) * if not domain: * return False # <<<<<<<<<<<<<< @@ -37243,10 +36828,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":1363 + /* "constraint/constraints.py":1370 * if all(p > target_value for p in prods): * domain.hideValue(val) * if not domain: # <<<<<<<<<<<<<< @@ -37255,7 +36840,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1350 + /* "constraint/constraints.py":1357 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< @@ -37263,9 +36848,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":1349 + /* "constraint/constraints.py":1356 * return False * * if forwardcheck: # <<<<<<<<<<<<<< @@ -37274,7 +36859,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1366 + /* "constraint/constraints.py":1373 * return False * * return True # <<<<<<<<<<<<<< @@ -37286,7 +36871,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1325 + /* "constraint/constraints.py":1332 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -37301,7 +36886,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); @@ -37338,7 +36923,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1380 +/* "constraint/constraints.py":1387 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -37387,39 +36972,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, 1380, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1387, __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, 1380, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1387, __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, 1380, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1387, __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, 1380, __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, 1387, __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, 1380, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1387, __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, 1380, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1387, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1380, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1387, __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, 1380, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1387, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -37448,16 +37033,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1386 + /* "constraint/constraints.py":1393 * 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, 1386, __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, 1393, __pyx_L1_error) - /* "constraint/constraints.py":1380 + /* "constraint/constraints.py":1387 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -37477,7 +37062,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( return __pyx_r; } -/* "constraint/constraints.py":1388 +/* "constraint/constraints.py":1395 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -37528,53 +37113,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, 1388, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1395, __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, 1388, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1395, __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, 1388, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1395, __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, 1388, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1395, __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, 1388, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1395, __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, 1388, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1395, __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, 1388, __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, 1395, __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, 1388, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1395, __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, 1388, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1395, __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, 1388, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1395, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1388, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1395, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1388, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1395, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1388, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1395, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -37588,7 +37173,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, 1388, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1395, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -37614,14 +37199,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":1390 + /* "constraint/constraints.py":1397 * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 * # preProcess() will remove it. * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< @@ -37629,22 +37213,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, 1390, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __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, 1390, __pyx_L1_error) + __PYX_ERR(0, 1397, __pyx_L1_error) - /* "constraint/constraints.py":1388 + /* "constraint/constraints.py":1395 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -37656,7 +37237,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); @@ -37664,7 +37244,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ return __pyx_r; } -/* "constraint/constraints.py":1392 +/* "constraint/constraints.py":1399 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -37715,50 +37295,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, 1392, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1399, __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, 1392, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1399, __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, 1392, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1399, __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, 1392, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1399, __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, 1392, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1399, __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, 1392, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1399, __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, 1392, __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, 1399, __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, 1392, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1399, __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, 1392, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1399, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1392, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1399, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1392, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1399, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1392, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1399, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1392, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1399, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -37768,7 +37348,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, 1392, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1399, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -37779,9 +37359,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, 1392, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1392, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1392, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1399, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1399, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1399, __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 */ @@ -37824,19 +37404,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1393 + /* "constraint/constraints.py":1400 * * 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, 1393, __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, 1400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1394 + /* "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: # <<<<<<<<<<<<<< @@ -37848,9 +37428,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, 1394, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __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, 1394, __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, 1401, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -37858,17 +37438,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, 1394, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1401, __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_GetItemRefFast(__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, 1394, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1401, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -37879,13 +37459,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1394, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1401, __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, 1394, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1401, __pyx_L1_error) PyErr_Clear(); } break; @@ -37895,35 +37475,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":1395 + /* "constraint/constraints.py":1402 * 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, 1395, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1396 + /* "constraint/constraints.py":1403 * 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, 1396, __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, 1403, __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, 1396, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1403, __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, 1396, __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, 1403, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -37932,17 +37512,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, 1396, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1403, __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_GetItemRefFast(__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, 1396, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1403, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -37953,13 +37533,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1396, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1403, __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, 1396, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1403, __pyx_L1_error) PyErr_Clear(); } break; @@ -37969,17 +37549,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":1397 + /* "constraint/constraints.py":1404 * 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, 1397, __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, 1404, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1398 + /* "constraint/constraints.py":1405 * for value in domain[:]: * if value not in set: * domain.remove(value) # <<<<<<<<<<<<<< @@ -37991,14 +37571,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, 1398, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1397 + /* "constraint/constraints.py":1404 * domain = domains[variable] * for value in domain[:]: * if value not in set: # <<<<<<<<<<<<<< @@ -38007,7 +37587,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce */ } - /* "constraint/constraints.py":1396 + /* "constraint/constraints.py":1403 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -38017,38 +37597,38 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1399 + /* "constraint/constraints.py":1406 * 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, 1399, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1406, __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, 1399, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1406, __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, 1399, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1406, __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, 1399, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1406, __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, 1399, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1394 + /* "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: # <<<<<<<<<<<<<< @@ -38058,27 +37638,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1400 + /* "constraint/constraints.py":1407 * 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, 1400, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1407, __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, 1400, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 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_1, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1400, __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, 1400, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1407, __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, 1407, __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":1392 + /* "constraint/constraints.py":1399 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -38107,7 +37687,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce return __pyx_r; } -/* "constraint/constraints.py":1414 +/* "constraint/constraints.py":1421 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -38156,39 +37736,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, 1414, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1421, __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, 1414, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1421, __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, 1414, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1421, __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, 1414, __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, 1421, __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, 1414, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1421, __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, 1414, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1421, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1414, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1421, __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, 1414, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1421, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -38217,16 +37797,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1420 + /* "constraint/constraints.py":1427 * 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, 1420, __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, 1427, __pyx_L1_error) - /* "constraint/constraints.py":1414 + /* "constraint/constraints.py":1421 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -38246,7 +37826,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init return __pyx_r; } -/* "constraint/constraints.py":1422 +/* "constraint/constraints.py":1429 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -38297,53 +37877,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, 1422, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1429, __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, 1422, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1429, __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, 1422, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1429, __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, 1422, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1429, __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, 1422, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1429, __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, 1422, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1429, __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, 1422, __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, 1429, __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, 1422, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1429, __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, 1422, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1429, __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, 1422, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1429, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1422, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1429, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1422, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1429, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1422, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1429, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -38357,7 +37937,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, 1422, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1429, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -38383,14 +37963,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":1424 + /* "constraint/constraints.py":1431 * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 * # preProcess() will remove it. * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< @@ -38398,22 +37977,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, 1424, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1431, __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, 1424, __pyx_L1_error) + __PYX_ERR(0, 1431, __pyx_L1_error) - /* "constraint/constraints.py":1422 + /* "constraint/constraints.py":1429 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -38425,7 +38001,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); @@ -38433,7 +38008,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal return __pyx_r; } -/* "constraint/constraints.py":1426 +/* "constraint/constraints.py":1433 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -38484,50 +38059,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, 1426, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1433, __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, 1426, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1433, __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, 1426, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1433, __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, 1426, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1433, __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, 1426, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1433, __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, 1426, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1433, __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, 1426, __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, 1433, __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, 1426, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1433, __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, 1426, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1433, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1426, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1433, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1426, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1433, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1426, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1433, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1426, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1433, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -38537,7 +38112,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, 1426, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1433, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -38548,9 +38123,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, 1426, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1426, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1426, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1433, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1433, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1433, __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 */ @@ -38593,19 +38168,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1427 + /* "constraint/constraints.py":1434 * * 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, 1427, __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, 1434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1428 + /* "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: # <<<<<<<<<<<<<< @@ -38617,9 +38192,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, 1428, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __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, 1428, __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, 1435, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -38627,17 +38202,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, 1428, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1435, __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_GetItemRefFast(__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, 1428, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1435, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -38648,13 +38223,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1428, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1435, __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, 1428, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1435, __pyx_L1_error) PyErr_Clear(); } break; @@ -38664,35 +38239,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":1429 + /* "constraint/constraints.py":1436 * 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, 1429, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1430 + /* "constraint/constraints.py":1437 * 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, 1430, __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, 1437, __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, 1430, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1437, __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, 1430, __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, 1437, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -38701,17 +38276,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, 1430, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1437, __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_GetItemRefFast(__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, 1430, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1437, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -38722,13 +38297,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1430, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1437, __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, 1430, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1437, __pyx_L1_error) PyErr_Clear(); } break; @@ -38738,17 +38313,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":1431 + /* "constraint/constraints.py":1438 * 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, 1431, __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, 1438, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1432 + /* "constraint/constraints.py":1439 * for value in domain[:]: * if value in set: * domain.remove(value) # <<<<<<<<<<<<<< @@ -38760,14 +38335,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, 1432, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1431 + /* "constraint/constraints.py":1438 * domain = domains[variable] * for value in domain[:]: * if value in set: # <<<<<<<<<<<<<< @@ -38776,7 +38351,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr */ } - /* "constraint/constraints.py":1430 + /* "constraint/constraints.py":1437 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -38786,38 +38361,38 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1433 + /* "constraint/constraints.py":1440 * 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, 1433, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1440, __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, 1433, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1440, __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, 1433, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1440, __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, 1433, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1440, __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, 1433, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1428 + /* "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: # <<<<<<<<<<<<<< @@ -38827,27 +38402,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1434 + /* "constraint/constraints.py":1441 * 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, 1434, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1441, __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, 1434, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 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_1, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1434, __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, 1434, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1441, __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, 1441, __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":1426 + /* "constraint/constraints.py":1433 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -38876,7 +38451,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr return __pyx_r; } -/* "constraint/constraints.py":1448 +/* "constraint/constraints.py":1455 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -38927,50 +38502,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, 1448, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1455, __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, 1448, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1455, __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, 1448, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1455, __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, 1448, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1455, __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, 1448, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1455, __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, 1448, __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, 1455, __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, 1448, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, i); __PYX_ERR(0, 1455, __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, 1448, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1455, __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, 1448, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1455, __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, 1448, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1455, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1448, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1455, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -38984,7 +38559,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, 1448, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1455, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -39013,34 +38588,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1458 + /* "constraint/constraints.py":1465 * 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, 1458, __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, 1465, __pyx_L1_error) - /* "constraint/constraints.py":1459 + /* "constraint/constraints.py":1466 * """ * 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, 1459, __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, 1466, __pyx_L1_error) - /* "constraint/constraints.py":1460 + /* "constraint/constraints.py":1467 * 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, 1460, __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, 1467, __pyx_L1_error) - /* "constraint/constraints.py":1448 + /* "constraint/constraints.py":1455 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -39060,7 +38635,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini return __pyx_r; } -/* "constraint/constraints.py":1462 +/* "constraint/constraints.py":1469 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -39111,53 +38686,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, 1462, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1469, __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, 1462, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1469, __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, 1462, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1469, __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, 1462, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1469, __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, 1462, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1469, __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, 1462, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1469, __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, 1462, __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, 1469, __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, 1462, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1469, __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, 1462, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1469, __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, 1462, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1469, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1462, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1469, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1462, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1469, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1462, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1469, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -39171,7 +38746,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, 1462, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1469, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -39182,8 +38757,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, 1462, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1462, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1469, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1469, __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 */ @@ -39228,19 +38803,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1463 + /* "constraint/constraints.py":1470 * * 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, 1463, __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, 1470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1464 + /* "constraint/constraints.py":1471 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * set = self._set * missing = 0 # <<<<<<<<<<<<<< @@ -39250,7 +38825,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":1465 + /* "constraint/constraints.py":1472 * set = self._set * missing = 0 * found = 0 # <<<<<<<<<<<<<< @@ -39260,7 +38835,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":1466 + /* "constraint/constraints.py":1473 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -39272,9 +38847,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, 1466, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1473, __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, 1466, __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, 1473, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -39282,17 +38857,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, 1466, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1473, __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_GetItemRefFast(__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, 1466, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1473, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -39303,13 +38878,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1466, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1473, __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, 1466, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1473, __pyx_L1_error) PyErr_Clear(); } break; @@ -39319,36 +38894,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":1467 + /* "constraint/constraints.py":1474 * 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, 1467, __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, 1474, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1468 + /* "constraint/constraints.py":1475 * 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, 1468, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1475, __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, 1468, __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, 1475, __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, 1468, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1475, __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, 1468, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_found, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1475, __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":1467 + /* "constraint/constraints.py":1474 * found = 0 * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -39358,7 +38933,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L5; } - /* "constraint/constraints.py":1470 + /* "constraint/constraints.py":1477 * found += assignments[variable] in set * else: * missing += 1 # <<<<<<<<<<<<<< @@ -39366,14 +38941,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, 1470, __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, 1477, __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":1466 + /* "constraint/constraints.py":1473 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -39383,53 +38958,53 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1471 + /* "constraint/constraints.py":1478 * 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, 1471, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_missing); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1478, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1472 + /* "constraint/constraints.py":1479 * 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, 1472, __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, 1479, __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, 1472, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1479, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1473 + /* "constraint/constraints.py":1480 * 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, 1473, __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, 1480, __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, 1473, __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, 1480, __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, 1473, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1480, __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, 1473, __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, 1480, __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, 1473, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1480, __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":1474 + /* "constraint/constraints.py":1481 * if self._exact: * if not (found <= self._n <= missing + found): * return False # <<<<<<<<<<<<<< @@ -39441,7 +39016,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1473 + /* "constraint/constraints.py":1480 * if missing: * if self._exact: * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< @@ -39450,7 +39025,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1472 + /* "constraint/constraints.py":1479 * missing += 1 * if missing: * if self._exact: # <<<<<<<<<<<<<< @@ -39460,7 +39035,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L8; } - /* "constraint/constraints.py":1476 + /* "constraint/constraints.py":1483 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -39468,18 +39043,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, 1476, __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, 1483, __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, 1476, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1483, __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, 1476, __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, 1483, __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, 1476, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1483, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":1477 + /* "constraint/constraints.py":1484 * else: * if self._n > missing + found: * return False # <<<<<<<<<<<<<< @@ -39491,7 +39066,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1476 + /* "constraint/constraints.py":1483 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -39502,33 +39077,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __pyx_L8:; - /* "constraint/constraints.py":1478 + /* "constraint/constraints.py":1485 * 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, 1478, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1485, __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, 1478, __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, 1485, __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, 1478, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1485, __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, 1478, __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, 1485, __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, 1478, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1485, __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":1481 + /* "constraint/constraints.py":1488 * # All unassigned variables must be assigned to * # values in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -39540,9 +39115,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, 1481, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1488, __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, 1481, __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, 1488, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -39550,17 +39125,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, 1481, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1488, __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_GetItemRefFast(__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, 1481, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1488, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -39571,13 +39146,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1481, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1488, __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, 1481, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1488, __pyx_L1_error) PyErr_Clear(); } break; @@ -39587,45 +39162,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":1482 + /* "constraint/constraints.py":1489 * # 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, 1482, __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, 1489, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1483 + /* "constraint/constraints.py":1490 * 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, 1483, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1484 + /* "constraint/constraints.py":1491 * 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, 1484, __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, 1491, __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, 1484, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1491, __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, 1484, __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, 1491, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -39634,17 +39209,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, 1484, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1491, __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_GetItemRefFast(__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, 1484, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1491, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -39655,13 +39230,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1484, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1491, __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, 1484, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1491, __pyx_L1_error) PyErr_Clear(); } break; @@ -39671,17 +39246,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":1485 + /* "constraint/constraints.py":1492 * 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, 1485, __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, 1492, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1486 + /* "constraint/constraints.py":1493 * for value in domain[:]: * if value not in set: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -39693,14 +39268,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, 1486, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1485 + /* "constraint/constraints.py":1492 * domain = domains[variable] * for value in domain[:]: * if value not in set: # <<<<<<<<<<<<<< @@ -39709,7 +39284,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1484 + /* "constraint/constraints.py":1491 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -39719,18 +39294,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1487 + /* "constraint/constraints.py":1494 * 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, 1487, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1494, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_7); if (__pyx_t_5) { - /* "constraint/constraints.py":1488 + /* "constraint/constraints.py":1495 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -39743,7 +39318,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":1487 + /* "constraint/constraints.py":1494 * if value not in set: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -39752,7 +39327,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1482 + /* "constraint/constraints.py":1489 * # values in the set. * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -39761,7 +39336,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1481 + /* "constraint/constraints.py":1488 * # All unassigned variables must be assigned to * # values in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -39771,7 +39346,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1478 + /* "constraint/constraints.py":1485 * if self._n > missing + found: * return False * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< @@ -39780,7 +39355,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1471 + /* "constraint/constraints.py":1478 * else: * missing += 1 * if missing: # <<<<<<<<<<<<<< @@ -39790,7 +39365,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L7; } - /* "constraint/constraints.py":1490 + /* "constraint/constraints.py":1497 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -39798,28 +39373,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, 1490, __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, 1497, __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, 1490, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1497, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1491 + /* "constraint/constraints.py":1498 * 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, 1491, __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, 1498, __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, 1491, __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, 1498, __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, 1491, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1498, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1492 + /* "constraint/constraints.py":1499 * if self._exact: * if found != self._n: * return False # <<<<<<<<<<<<<< @@ -39831,7 +39406,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1491 + /* "constraint/constraints.py":1498 * else: * if self._exact: * if found != self._n: # <<<<<<<<<<<<<< @@ -39840,7 +39415,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1490 + /* "constraint/constraints.py":1497 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -39850,7 +39425,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L23; } - /* "constraint/constraints.py":1494 + /* "constraint/constraints.py":1501 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -39858,15 +39433,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, 1494, __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, 1501, __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, 1494, __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, 1501, __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, 1494, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1501, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1495 + /* "constraint/constraints.py":1502 * else: * if found < self._n: * return False # <<<<<<<<<<<<<< @@ -39878,7 +39453,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1494 + /* "constraint/constraints.py":1501 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -39891,7 +39466,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __pyx_L7:; - /* "constraint/constraints.py":1496 + /* "constraint/constraints.py":1503 * if found < self._n: * return False * return True # <<<<<<<<<<<<<< @@ -39903,7 +39478,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1462 + /* "constraint/constraints.py":1469 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -39931,7 +39506,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca return __pyx_r; } -/* "constraint/constraints.py":1510 +/* "constraint/constraints.py":1517 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -39982,50 +39557,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, 1510, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1517, __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, 1510, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1517, __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, 1510, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1517, __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, 1510, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1517, __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, 1510, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1517, __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, 1510, __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, 1517, __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, 1510, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, i); __PYX_ERR(0, 1517, __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, 1510, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1517, __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, 1510, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1517, __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, 1510, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1517, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1510, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1517, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -40039,7 +39614,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, 1510, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1517, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -40068,34 +39643,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1520 + /* "constraint/constraints.py":1527 * 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, 1520, __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, 1527, __pyx_L1_error) - /* "constraint/constraints.py":1521 + /* "constraint/constraints.py":1528 * """ * 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, 1521, __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, 1528, __pyx_L1_error) - /* "constraint/constraints.py":1522 + /* "constraint/constraints.py":1529 * 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, 1522, __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, 1529, __pyx_L1_error) - /* "constraint/constraints.py":1510 + /* "constraint/constraints.py":1517 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -40115,7 +39690,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ return __pyx_r; } -/* "constraint/constraints.py":1524 +/* "constraint/constraints.py":1531 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -40166,53 +39741,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, 1524, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1531, __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, 1524, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1531, __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, 1524, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1531, __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, 1524, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1531, __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, 1524, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1531, __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, 1524, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1531, __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, 1524, __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, 1531, __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, 1524, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1531, __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, 1524, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1531, __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, 1524, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1531, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1524, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1531, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1524, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1531, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1524, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1531, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -40226,7 +39801,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, 1524, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1531, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -40237,8 +39812,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, 1524, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1524, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1531, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1531, __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 */ @@ -40283,19 +39858,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1525 + /* "constraint/constraints.py":1532 * * 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, 1525, __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, 1532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1526 + /* "constraint/constraints.py":1533 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * set = self._set * missing = 0 # <<<<<<<<<<<<<< @@ -40305,7 +39880,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":1527 + /* "constraint/constraints.py":1534 * set = self._set * missing = 0 * found = 0 # <<<<<<<<<<<<<< @@ -40315,7 +39890,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":1528 + /* "constraint/constraints.py":1535 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -40327,9 +39902,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, 1528, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1535, __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, 1528, __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, 1535, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -40337,17 +39912,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, 1528, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1535, __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_GetItemRefFast(__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, 1528, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1535, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -40358,13 +39933,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1528, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1535, __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, 1528, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1535, __pyx_L1_error) PyErr_Clear(); } break; @@ -40374,36 +39949,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":1529 + /* "constraint/constraints.py":1536 * 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, 1529, __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, 1536, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1530 + /* "constraint/constraints.py":1537 * 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, 1530, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1537, __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, 1530, __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, 1537, __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, 1530, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1537, __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, 1530, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_found, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1537, __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":1529 + /* "constraint/constraints.py":1536 * found = 0 * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -40413,7 +39988,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L5; } - /* "constraint/constraints.py":1532 + /* "constraint/constraints.py":1539 * found += assignments[variable] not in set * else: * missing += 1 # <<<<<<<<<<<<<< @@ -40421,14 +39996,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, 1532, __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, 1539, __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":1528 + /* "constraint/constraints.py":1535 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -40438,53 +40013,53 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1533 + /* "constraint/constraints.py":1540 * 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, 1533, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_missing); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1540, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1534 + /* "constraint/constraints.py":1541 * 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, 1534, __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, 1541, __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, 1534, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1541, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1535 + /* "constraint/constraints.py":1542 * 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, 1535, __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, 1542, __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, 1535, __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, 1542, __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, 1535, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1542, __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, 1535, __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, 1542, __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, 1535, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1542, __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":1536 + /* "constraint/constraints.py":1543 * if self._exact: * if not (found <= self._n <= missing + found): * return False # <<<<<<<<<<<<<< @@ -40496,7 +40071,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1535 + /* "constraint/constraints.py":1542 * if missing: * if self._exact: * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< @@ -40505,7 +40080,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1534 + /* "constraint/constraints.py":1541 * missing += 1 * if missing: * if self._exact: # <<<<<<<<<<<<<< @@ -40515,7 +40090,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L8; } - /* "constraint/constraints.py":1538 + /* "constraint/constraints.py":1545 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -40523,18 +40098,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, 1538, __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, 1545, __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, 1538, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1545, __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, 1538, __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, 1545, __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, 1538, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1545, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":1539 + /* "constraint/constraints.py":1546 * else: * if self._n > missing + found: * return False # <<<<<<<<<<<<<< @@ -40546,7 +40121,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1538 + /* "constraint/constraints.py":1545 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -40557,33 +40132,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __pyx_L8:; - /* "constraint/constraints.py":1540 + /* "constraint/constraints.py":1547 * 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, 1540, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1547, __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, 1540, __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, 1547, __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, 1540, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1547, __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, 1540, __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, 1547, __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, 1540, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1547, __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":1543 + /* "constraint/constraints.py":1550 * # All unassigned variables must be assigned to * # values not in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -40595,9 +40170,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, 1543, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1550, __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, 1543, __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, 1550, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -40605,17 +40180,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, 1543, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1550, __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_GetItemRefFast(__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, 1543, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1550, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -40626,13 +40201,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1543, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1550, __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, 1543, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1550, __pyx_L1_error) PyErr_Clear(); } break; @@ -40642,45 +40217,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":1544 + /* "constraint/constraints.py":1551 * # 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, 1544, __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, 1551, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1545 + /* "constraint/constraints.py":1552 * 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, 1545, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1546 + /* "constraint/constraints.py":1553 * 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, 1546, __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, 1553, __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, 1546, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1553, __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, 1546, __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, 1553, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -40689,17 +40264,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, 1546, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1553, __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_GetItemRefFast(__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, 1546, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1553, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -40710,13 +40285,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1546, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1553, __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, 1546, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1553, __pyx_L1_error) PyErr_Clear(); } break; @@ -40726,17 +40301,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":1547 + /* "constraint/constraints.py":1554 * 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, 1547, __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, 1554, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1548 + /* "constraint/constraints.py":1555 * for value in domain[:]: * if value in set: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -40748,14 +40323,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, 1548, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1547 + /* "constraint/constraints.py":1554 * domain = domains[variable] * for value in domain[:]: * if value in set: # <<<<<<<<<<<<<< @@ -40764,7 +40339,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1546 + /* "constraint/constraints.py":1553 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -40774,18 +40349,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1549 + /* "constraint/constraints.py":1556 * 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, 1549, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1556, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_7); if (__pyx_t_5) { - /* "constraint/constraints.py":1550 + /* "constraint/constraints.py":1557 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -40798,7 +40373,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1549 + /* "constraint/constraints.py":1556 * if value in set: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -40807,7 +40382,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1544 + /* "constraint/constraints.py":1551 * # values not in the set. * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -40816,7 +40391,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1543 + /* "constraint/constraints.py":1550 * # All unassigned variables must be assigned to * # values not in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -40826,7 +40401,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1540 + /* "constraint/constraints.py":1547 * if self._n > missing + found: * return False * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< @@ -40835,7 +40410,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1533 + /* "constraint/constraints.py":1540 * else: * missing += 1 * if missing: # <<<<<<<<<<<<<< @@ -40845,7 +40420,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L7; } - /* "constraint/constraints.py":1552 + /* "constraint/constraints.py":1559 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -40853,28 +40428,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, 1552, __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, 1559, __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, 1552, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1559, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1553 + /* "constraint/constraints.py":1560 * 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, 1553, __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, 1560, __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, 1553, __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, 1560, __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, 1553, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1554 + /* "constraint/constraints.py":1561 * if self._exact: * if found != self._n: * return False # <<<<<<<<<<<<<< @@ -40886,7 +40461,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1553 + /* "constraint/constraints.py":1560 * else: * if self._exact: * if found != self._n: # <<<<<<<<<<<<<< @@ -40895,7 +40470,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1552 + /* "constraint/constraints.py":1559 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -40905,7 +40480,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L23; } - /* "constraint/constraints.py":1556 + /* "constraint/constraints.py":1563 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -40913,15 +40488,15 @@ 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, 1556, __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, 1563, __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, 1556, __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, 1563, __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, 1556, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1563, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1557 + /* "constraint/constraints.py":1564 * else: * if found < self._n: * return False # <<<<<<<<<<<<<< @@ -40933,7 +40508,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1556 + /* "constraint/constraints.py":1563 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -40946,7 +40521,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __pyx_L7:; - /* "constraint/constraints.py":1558 + /* "constraint/constraints.py":1565 * if found < self._n: * return False * return True # <<<<<<<<<<<<<< @@ -40958,7 +40533,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1524 + /* "constraint/constraints.py":1531 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -40986,7 +40561,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ return __pyx_r; } -/* "constraint/constraints.py":1563 +/* "constraint/constraints.py":1570 * # Utility functions * * def sum_other_vars(variables: Sequence, variable, values: dict): # <<<<<<<<<<<<<< @@ -41036,38 +40611,38 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { 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, 1563, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1570, __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, 1563, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1570, __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, 1563, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1570, __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, 1563, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1570, __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, 1563, __pyx_L3_error) + 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, 1570, __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, 1563, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sum_other_vars", 1, 3, 3, i); __PYX_ERR(0, 1570, __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, 1563, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1570, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1563, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1570, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1563, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1570, __pyx_L3_error) } __pyx_v_variables = values[0]; __pyx_v_variable = values[1]; @@ -41075,7 +40650,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("sum_other_vars", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1563, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("sum_other_vars", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1570, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -41086,7 +40661,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __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, 1563, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), (&PyDict_Type), 0, "values", 2))) __PYX_ERR(0, 1570, __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 */ @@ -41107,7 +40682,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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":1565 +/* "constraint/constraints.py":1572 * 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) # <<<<<<<<<<<<<< @@ -41125,7 +40700,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_14sum_other_vars_genexpr(Py 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, 1565, __pyx_L1_error) + __PYX_ERR(0, 1572, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -41136,7 +40711,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_14sum_other_vars_genexpr(Py __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, 1565, __pyx_L1_error) + __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, 1572, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -41176,17 +40751,17 @@ static PyObject *__pyx_gb_10constraint_11constraints_14sum_other_vars_2generator __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, 1565, __pyx_L1_error) + __PYX_ERR(0, 1572, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1565, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1572, __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, 1565, __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, 1572, __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, 1565, __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, 1572, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -41194,17 +40769,17 @@ static PyObject *__pyx_gb_10constraint_11constraints_14sum_other_vars_2generator { 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, 1565, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1572, __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_GetItemRefFast(__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, 1565, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1572, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -41215,13 +40790,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_14sum_other_vars_2generator #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1565, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1572, __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, 1565, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1572, __pyx_L1_error) PyErr_Clear(); } break; @@ -41232,17 +40807,17 @@ static PyObject *__pyx_gb_10constraint_11constraints_14sum_other_vars_2generator __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, 1565, __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, 1565, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1565, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_variable)) { __Pyx_RaiseClosureNameError("variable"); __PYX_ERR(0, 1572, __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, 1572, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1572, __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, 1565, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_values)) { __Pyx_RaiseClosureNameError("values"); __PYX_ERR(0, 1572, __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, 1565, __pyx_L1_error) + __PYX_ERR(0, 1572, __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, 1565, __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, 1572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; @@ -41262,7 +40837,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_14sum_other_vars_2generator __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, 1565, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1572, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -41289,7 +40864,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_14sum_other_vars_2generator return __pyx_r; } -/* "constraint/constraints.py":1563 +/* "constraint/constraints.py":1570 * # Utility functions * * def sum_other_vars(variables: Sequence, variable, values: dict): # <<<<<<<<<<<<<< @@ -41305,8 +40880,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_sum_other_vars(CYTHON_UNUSE 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; + size_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -41315,7 +40889,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_sum_other_vars(CYTHON_UNUSE 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, 1563, __pyx_L1_error) + __PYX_ERR(0, 1570, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -41326,32 +40900,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_sum_other_vars(CYTHON_UNUSE __Pyx_INCREF(__pyx_cur_scope->__pyx_v_values); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_values); - /* "constraint/constraints.py":1565 + /* "constraint/constraints.py":1572 * 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_INCREF(__pyx_builtin_sum); - __pyx_t_3 = __pyx_builtin_sum; - __pyx_t_4 = __pyx_pf_10constraint_11constraints_14sum_other_vars_genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = 1; + __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, 1572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4}; - __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_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_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1565, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1563 + /* "constraint/constraints.py":1570 * # Utility functions * * def sum_other_vars(variables: Sequence, variable, values: dict): # <<<<<<<<<<<<<< @@ -41364,7 +40935,6 @@ static PyObject *__pyx_pf_10constraint_11constraints_sum_other_vars(CYTHON_UNUSE __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("constraint.constraints.sum_other_vars", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -41378,20 +40948,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_sum_other_vars(CYTHON_UNUSE 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; } @@ -41399,14 +40964,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) { @@ -41442,7 +41011,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 @@ -41453,12 +41022,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*/ @@ -41472,7 +41036,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*/ @@ -41507,7 +41071,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 @@ -41527,30 +41091,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; } @@ -41560,19 +41127,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 } } @@ -41602,7 +41174,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 @@ -41613,12 +41185,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*/ @@ -41632,7 +41199,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*/ @@ -41667,7 +41234,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 @@ -41687,30 +41254,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; } @@ -41720,19 +41290,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 } } @@ -41775,7 +41350,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 @@ -41786,12 +41361,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*/ @@ -41805,7 +41375,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*/ @@ -41840,7 +41410,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 @@ -41860,30 +41430,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; } @@ -41895,19 +41468,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 } } @@ -41943,7 +41521,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 @@ -41954,12 +41532,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*/ @@ -41973,7 +41546,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*/ @@ -42008,7 +41581,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 @@ -42028,30 +41601,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; } @@ -42063,19 +41639,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 } } @@ -42111,7 +41692,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 @@ -42122,12 +41703,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*/ @@ -42141,7 +41717,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*/ @@ -42176,7 +41752,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 @@ -42196,30 +41772,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; } @@ -42229,19 +41808,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 } } @@ -42271,7 +41855,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 @@ -42282,12 +41866,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*/ @@ -42301,7 +41880,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*/ @@ -42336,7 +41915,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 @@ -42356,30 +41935,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; } @@ -42389,19 +41971,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 } } @@ -42444,7 +42031,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 @@ -42455,12 +42042,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*/ @@ -42474,7 +42056,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*/ @@ -42509,7 +42091,7 @@ 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 @@ -42529,30 +42111,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_p 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_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)))) { + 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 = (*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; #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_6_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -42564,19 +42149,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_6_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_6_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr)))) { + 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 - (*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 } } @@ -42612,7 +42202,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_6_ge "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|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_6_genexpr_slots, }; #else @@ -42623,12 +42213,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_6_g 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*/ - #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*/ @@ -42642,7 +42227,7 @@ 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*/ @@ -42677,7 +42262,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 @@ -42697,30 +42282,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_6_g 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_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)))) { + 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 = (*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; #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_7_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -42730,19 +42318,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_7_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_7_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr)))) { + 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 - (*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 } } @@ -42772,7 +42365,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_7_ge "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|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_7_genexpr_slots, }; #else @@ -42783,12 +42376,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_7_g 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*/ - #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*/ @@ -42802,7 +42390,7 @@ 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*/ 0, /*tp_clear*/ @@ -42837,7 +42425,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 @@ -42857,30 +42445,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_7_g 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_8_preProcess > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess)))) { + 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_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 (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; } @@ -42890,19 +42481,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_8_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_8_preProcess < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess)))) { + 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 } } @@ -42945,7 +42541,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_8_pr "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, + 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 @@ -42956,12 +42552,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_8_p sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_8_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*/ @@ -42975,7 +42566,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_8_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_8_preProcess, /*tp_traverse*/ __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_8_preProcess, /*tp_clear*/ @@ -43010,7 +42601,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_8_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 @@ -43030,30 +42621,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_8_p 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_9_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_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_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 (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; } @@ -43065,19 +42659,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_9_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_9_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr)))) { + 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 } } @@ -43113,7 +42712,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_9_ge "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, + 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 @@ -43124,12 +42723,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_9_g sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_11constraints___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*/ @@ -43143,7 +42737,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_9_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_9_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -43178,7 +42772,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_9_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 @@ -43198,30 +42792,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_9_g 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_10_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_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_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 (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; } @@ -43231,19 +42828,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_10_ge 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_10_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr)))) { + 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 } } @@ -43273,7 +42875,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_10_g "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, + 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 @@ -43284,12 +42886,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_10_ sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr), /*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 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -43303,7 +42900,7 @@ 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*/ @@ -43338,7 +42935,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 @@ -43358,30 +42955,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_10_ 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_11_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr)))) { + 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_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 (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; } @@ -43391,19 +42991,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_ge 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_11_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr)))) { + 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 } } @@ -43433,7 +43038,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_11_g "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, + 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 @@ -43444,12 +43049,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_ sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_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 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -43463,7 +43063,7 @@ 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*/ 0, /*tp_clear*/ @@ -43498,7 +43098,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 @@ -43518,30 +43118,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_ 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_12___call__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__)))) { + 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_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 (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; } @@ -43550,19 +43153,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12___ PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_assigned_product); #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__)))) { + 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 } } @@ -43599,7 +43207,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_12__ "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, + 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 @@ -43610,12 +43218,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_12_ sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__), /*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 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -43629,7 +43232,7 @@ 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*/ @@ -43664,7 +43267,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 @@ -43684,30 +43287,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_12_ 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_13_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_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_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 (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; } @@ -43719,19 +43325,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13_ge 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_13_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr)))) { + 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 } } @@ -43767,7 +43378,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_13_g "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, + 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 @@ -43778,12 +43389,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_13_ sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr), /*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 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -43797,7 +43403,7 @@ 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*/ @@ -43832,7 +43438,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 @@ -43852,30 +43458,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_13_ 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_14_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr)))) { + 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_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 (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; } @@ -43887,19 +43496,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_14_ge 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_14_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr)))) { + 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 } } @@ -43935,7 +43549,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_14_g "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, + 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 @@ -43946,12 +43560,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_14_ sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_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 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -43965,7 +43574,7 @@ 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*/ 0, /*tp_clear*/ @@ -44000,7 +43609,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 @@ -44020,30 +43629,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_14_ 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_15___call__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__)))) { + 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_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 (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; } @@ -44052,19 +43664,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_15___ PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_target_value); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_15___call__ < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__)))) { + 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 } } @@ -44101,7 +43718,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_15__ "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, + 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 @@ -44112,12 +43729,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_15_ sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_15___call__, /*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*/ @@ -44131,7 +43743,7 @@ 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___call__, /*tp_traverse*/ __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_15___call__, /*tp_clear*/ @@ -44166,7 +43778,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 @@ -44186,30 +43798,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_15_ 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_16_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_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_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 (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; } @@ -44220,19 +43835,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_16_ge Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_p); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_16_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr)))) { + 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 } } @@ -44265,7 +43885,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_16_g "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, + 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 @@ -44276,12 +43896,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_16_ sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_16_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*/ @@ -44295,7 +43910,7 @@ 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_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -44330,7 +43945,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 @@ -44350,30 +43965,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_16_ 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_17_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_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_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 (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; } @@ -44383,19 +44001,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_17_ge 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_17_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr)))) { + 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 } } @@ -44425,7 +44048,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_17_g "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, + 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 @@ -44436,12 +44059,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_17_ sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr), /*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 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -44455,7 +44073,7 @@ 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*/ @@ -44490,7 +44108,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 @@ -44510,30 +44128,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_17_ 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_18_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr)))) { + 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_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 (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; } @@ -44543,19 +44164,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_18_ge 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_18_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr)))) { + 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 } } @@ -44585,7 +44211,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_18_g "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, + 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 @@ -44596,12 +44222,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_18_ sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_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 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -44615,7 +44236,7 @@ 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*/ 0, /*tp_clear*/ @@ -44650,7 +44271,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 @@ -44670,30 +44291,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_18_ 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_19___call__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__)))) { + 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_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 (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; } @@ -44702,19 +44326,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_19___ PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_target_value); #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__)))) { + 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 } } @@ -44751,7 +44380,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_19__ "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, + 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 @@ -44762,12 +44391,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_19_ sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__), /*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 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -44781,7 +44405,7 @@ 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*/ @@ -44816,7 +44440,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 @@ -44836,30 +44460,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_19_ 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_20_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_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_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 (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; } @@ -44870,19 +44497,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_20_ge Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_p); #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)))) { + 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 } } @@ -44915,7 +44547,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_20_g "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, + 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 @@ -44926,12 +44558,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_20_ sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_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 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -44945,7 +44572,7 @@ 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*/ 0, /*tp_clear*/ @@ -44980,7 +44607,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 @@ -45000,30 +44627,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_20_ 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_21_sum_other_vars > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars)))) { + 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_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 (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; } @@ -45033,19 +44663,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_21_su 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_21_sum_other_vars < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars)))) { + 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 } } @@ -45088,7 +44723,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_21_s "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, + 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 @@ -45099,12 +44734,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_21_ 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_21_sum_other_vars, /*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*/ @@ -45118,7 +44748,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_21_ 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_21_sum_other_vars, /*tp_traverse*/ __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars, /*tp_clear*/ @@ -45153,7 +44783,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_21_ #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 @@ -45173,30 +44803,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_21_ 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_22_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_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_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 (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; } @@ -45208,19 +44841,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_22_ge 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_22_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr)))) { + 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 } } @@ -45256,7 +44894,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_22_g "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, + 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 @@ -45267,12 +44905,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_22_ sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_22_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*/ @@ -45286,7 +44919,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_22_ 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_22_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -45321,7 +44954,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_22_ #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 @@ -45394,14 +45027,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_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) + 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) #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, 64, __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)) { @@ -45409,15 +45045,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, 425, __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, 425, __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, 432, __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, 432, __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, 425, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr) < (0)) __PYX_ERR(0, 432, __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)) { @@ -45425,15 +45064,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, 428, __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, 428, __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, 435, __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, 435, __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, 428, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess) < (0)) __PYX_ERR(0, 435, __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)) { @@ -45441,15 +45083,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, 442, __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, 442, __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, 449, __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, 449, __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, 442, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_genexpr) < (0)) __PYX_ERR(0, 449, __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)) { @@ -45457,15 +45102,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, 443, __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, 443, __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, 450, __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, 450, __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, 443, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_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_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)) { @@ -45473,15 +45121,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, 607, __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, 607, __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, 614, __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, 614, __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, 607, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr) < (0)) __PYX_ERR(0, 614, __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)) { @@ -45489,15 +45140,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, 610, __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, 610, __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, 617, __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, 617, __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, 610, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess) < (0)) __PYX_ERR(0, 617, __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)) { @@ -45505,15 +45159,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, 618, __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, 618, __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, 625, __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, 625, __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, 618, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr) < (0)) __PYX_ERR(0, 625, __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)) { @@ -45521,15 +45178,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, 786, __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, 786, __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, 793, __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, 793, __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, 786, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr) < (0)) __PYX_ERR(0, 793, __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)) { @@ -45537,15 +45197,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_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, 789, __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, 789, __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, 796, __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, 796, __pyx_L1_error) #else __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_preProcess) < 0) __PYX_ERR(0, 789, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_preProcess) < (0)) __PYX_ERR(0, 796, __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_preProcess->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_preProcess->tp_getattro == PyObject_GenericGetAttr)) { @@ -45553,15 +45216,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_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, 797, __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, 797, __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, 804, __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, 804, __pyx_L1_error) #else __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_genexpr) < 0) __PYX_ERR(0, 797, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_genexpr) < (0)) __PYX_ERR(0, 804, __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_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -45569,15 +45235,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_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, 862, __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, 862, __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, 869, __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, 869, __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, 862, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr) < (0)) __PYX_ERR(0, 869, __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)) { @@ -45585,15 +45254,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, 891, __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, 891, __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, 898, __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, 898, __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, 891, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr) < (0)) __PYX_ERR(0, 898, __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)) { @@ -45601,15 +45273,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, 982, __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, 982, __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, 989, __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, 989, __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, 982, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__) < (0)) __PYX_ERR(0, 989, __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)) { @@ -45617,15 +45292,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, 1005, __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, 1005, __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, 1012, __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, 1012, __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, 1005, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr) < (0)) __PYX_ERR(0, 1012, __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)) { @@ -45633,15 +45311,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, 1006, __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, 1006, __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, 1013, __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, 1013, __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, 1006, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_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_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)) { @@ -45649,15 +45330,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_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, 1138, __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, 1138, __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, 1145, __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, 1145, __pyx_L1_error) #else __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___call__) < 0) __PYX_ERR(0, 1138, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15___call__) < (0)) __PYX_ERR(0, 1145, __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___call__->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15___call__->tp_getattro == PyObject_GenericGetAttr)) { @@ -45665,15 +45349,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_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, 1174, __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, 1174, __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, 1181, __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, 1181, __pyx_L1_error) #else __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_genexpr) < 0) __PYX_ERR(0, 1174, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr) < (0)) __PYX_ERR(0, 1181, __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_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -45681,15 +45368,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_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, 1214, __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, 1214, __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, 1221, __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, 1221, __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, 1214, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr) < (0)) __PYX_ERR(0, 1221, __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)) { @@ -45697,15 +45387,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, 1243, __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, 1243, __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, 1250, __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, 1250, __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, 1243, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr) < (0)) __PYX_ERR(0, 1250, __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)) { @@ -45713,15 +45406,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, 1325, __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, 1325, __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, 1332, __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, 1332, __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, 1325, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__) < (0)) __PYX_ERR(0, 1332, __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)) { @@ -45729,15 +45425,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_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, 1361, __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, 1361, __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, 1368, __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, 1368, __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, 1361, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr) < (0)) __PYX_ERR(0, 1368, __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)) { @@ -45745,15 +45444,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_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, 1563, __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, 1563, __pyx_L1_error) + __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, 1570, __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, 1570, __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, 1563, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars) < (0)) __PYX_ERR(0, 1570, __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)) { @@ -45761,15 +45463,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_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, 1565, __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, 1565, __pyx_L1_error) + __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, 1572, __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, 1572, __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, 1565, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_22_genexpr) < (0)) __PYX_ERR(0, 1572, __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)) { @@ -45817,7 +45522,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}, @@ -45879,7 +45584,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 @@ -45909,12 +45615,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 @@ -45986,11 +45695,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; @@ -46033,48 +45743,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) @@ -46083,10 +45773,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); @@ -46104,16 +45794,22 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); * from typing import Callable, Union, Optional * from collections.abc import Sequence */ - __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_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, 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_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, 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 * @@ -46122,23 +45818,21 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); * 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_Callable,__pyx_mstate_global->__pyx_n_u_Union,__pyx_mstate_global->__pyx_n_u_Optional}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_typing, __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); - __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_Callable,__pyx_mstate_global->__pyx_n_u_Union,__pyx_mstate_global->__pyx_n_u_Optional}; + 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; /* "constraint/constraints.py":5 @@ -46148,16 +45842,22 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); * 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) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Sequence}; + __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, 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_Sequence, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Sequence}; + __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/constraints.py":6 * from typing import Callable, Union, Optional @@ -46166,15 +45866,21 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); * * 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_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, 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_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, 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 @@ -46194,18 +45900,21 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); * """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[16])); 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, 11, __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, 11, __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, 11, __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, 11, __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, 11, __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, 11, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/constraints.py":36 * return True @@ -46214,18 +45923,21 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); * """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, 36, __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, 36, __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, 36, __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, 36, __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, 36, __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, 36, __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[17])); 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, 36, __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 * vconstraints[variable].remove((self, variables)) @@ -46234,24 +45946,27 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); * """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[18])); 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, 64, __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, 64, __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, 64, __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, 64, __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, 64, __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_2__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, 64, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 64, __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, 64, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/constraints.py":8 * from itertools import product @@ -46260,10 +45975,13 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); * """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, 8, __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, 8, __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 @@ -46275,72 +45993,84 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); */ __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_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, 105, __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, 105, __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, 105, __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, 105, __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, 105, __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":133 * """ * * 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[19])); 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, 133, __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, 133, __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, 133, __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, 133, __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, 133, __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, 133, __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, 133, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":138 + /* "constraint/constraints.py":145 * 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[20])); 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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __pyx_L1_error) - /* "constraint/constraints.py":144 + /* "constraint/constraints.py":151 * 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, 151, __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_4__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, 145, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/constraints.py":105 * @@ -46349,1813 +46079,2050 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); * """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, 105, __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, 105, __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":198 * 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, 198, __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, 198, __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, 198, __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, 198, __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, 198, __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, 198, __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":201 * """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[21])); 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, 201, __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, 201, __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, 201, __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, 201, __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, 201, __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, 201, __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, 201, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":198 + /* "constraint/constraints.py":205 * 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[22])); 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_6__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, 205, __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, 205, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 205, __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, 205, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":191 + /* "constraint/constraints.py":198 * 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_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, 198, __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_CompilableFunctionConstraint, __pyx_t_7) < (0)) __PYX_ERR(0, 198, __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":202 + /* "constraint/constraints.py":209 * * * 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_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __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_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __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_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __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_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __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, 209, __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, 209, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":213 + /* "constraint/constraints.py":220 * """ * * 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[23])); 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) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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_CyFunction_InitDefaults(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 220, __pyx_L1_error) - /* "constraint/constraints.py":219 + /* "constraint/constraints.py":226 * 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_8__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; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 226, __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_7, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < (0)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":202 + /* "constraint/constraints.py":209 * * * 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_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, 209, __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_AllDifferentConstraint, __pyx_t_4) < (0)) __PYX_ERR(0, 209, __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":240 + /* "constraint/constraints.py":247 * * * 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_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __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_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 247, __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, 240, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __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_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 247, __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, 247, __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, 247, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":251 + /* "constraint/constraints.py":258 * """ * * 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[24])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __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) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 258, __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, 258, __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, 258, __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, 258, __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_CyFunction_InitDefaults(__pyx_t_6, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 258, __pyx_L1_error) - /* "constraint/constraints.py":257 + /* "constraint/constraints.py":264 * 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_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_10__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_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 264, __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, 258, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":240 + /* "constraint/constraints.py":247 * * * 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) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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, 247, __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_AllEqualConstraint, __pyx_t_6) < (0)) __PYX_ERR(0, 247, __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":278 + /* "constraint/constraints.py":285 * * * 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, 278, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __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_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 285, __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, 278, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __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_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, 278, __pyx_L1_error) + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __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_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, 285, __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, 285, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":294 + /* "constraint/constraints.py":301 * """ * * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __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, 294, __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, 294, __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[25])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __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, 294, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 301, __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_Union_int_float) < (0)) __PYX_ERR(0, 301, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Optional_Sequence) < (0)) __PYX_ERR(0, 301, __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, 301, __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[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, 301, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":309 + /* "constraint/constraints.py":316 * 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_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __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, 309, __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, 309, __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, 309, __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, 309, __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[26])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __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, 309, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 316, __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, 316, __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, 316, __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, 316, __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, 316, __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, 316, __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, 316, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":332 + /* "constraint/constraints.py":339 * 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 */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __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, 332, __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, 332, __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, 332, __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[27])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __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_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, 332, __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, 339, __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, 339, __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, 339, __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, 339, __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, 339, __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, 339, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":278 + /* "constraint/constraints.py":285 * * * class ExactSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum exactly to a given amount. * */ - __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_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) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __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, 285, __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_ExactSumConstraint, __pyx_t_5) < (0)) __PYX_ERR(0, 285, __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":391 + /* "constraint/constraints.py":398 * return sum == exactsum * * 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, 391, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 398, __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, 391, __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, 398, __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, 391, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 398, __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, 391, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 398, __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_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, 398, __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, 391, __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, 391, __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, 398, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":409 + /* "constraint/constraints.py":416 * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __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, 409, __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, 409, __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, 409, __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[28])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 409, __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, 409, __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, 416, __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, 416, __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, 416, __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, 416, __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, 416, __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_7) < (0)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":428 + /* "constraint/constraints.py":435 * 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, 428, __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, 428, __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, 428, __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, 428, __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, 428, __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[29])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __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_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_3) < 0) __PYX_ERR(0, 428, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 435, __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, 435, __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, 435, __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, 435, __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, 435, __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, 435, __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, 435, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":450 + /* "constraint/constraints.py":457 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __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, 450, __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, 450, __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, 450, __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[30])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 450, __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, 450, __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, 457, __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, 457, __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, 457, __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, 457, __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, 457, __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, 457, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":391 + /* "constraint/constraints.py":398 * return sum == exactsum * * class VariableExactSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the sum of variables equals the value of another variable. * */ - __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, 391, __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, 391, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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, 398, __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, 398, __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":502 + /* "constraint/constraints.py":509 * * * 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, 502, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __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, 502, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 509, __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_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __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, 502, __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, 502, __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, 502, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 509, __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_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, 509, __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, 509, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":518 + /* "constraint/constraints.py":525 * """ * * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 518, __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, 518, __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, 518, __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[31])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 518, __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); - __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, 518, __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, 525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_minsum, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < (0)) __PYX_ERR(0, 525, __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, 525, __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, 525, __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[2]); + __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, 525, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":531 + /* "constraint/constraints.py":538 * 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_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 531, __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, 531, __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, 531, __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, 531, __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, 531, __pyx_L1_error) - __pyx_t_5 = __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_5)) __PYX_ERR(0, 531, __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_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 531, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __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, 538, __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, 538, __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, 538, __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, 538, __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, 538, __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, 538, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":547 - * self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + /* "constraint/constraints.py":554 + * 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 */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 547, __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, 547, __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, 547, __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, 547, __pyx_L1_error) - __pyx_t_3 = __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_3)) __PYX_ERR(0, 547, __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_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, 547, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 554, __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, 554, __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, 554, __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, 554, __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, 554, __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, 554, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":502 + /* "constraint/constraints.py":509 * * * class MinSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum at least to a given amount. * */ - __pyx_t_3 = __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_3)) __PYX_ERR(0, 502, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 502, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __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, 509, __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_MinSumConstraint, __pyx_t_4) < (0)) __PYX_ERR(0, 509, __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":574 + /* "constraint/constraints.py":581 * return sum >= minsum or missing * * 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, 574, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __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, 574, __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, 581, __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, 574, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __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, 574, __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_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_3)) __PYX_ERR(0, 574, __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, 574, __pyx_L1_error) + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 581, __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, 581, __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, 581, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":591 + /* "constraint/constraints.py":598 * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 591, __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, 591, __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, 591, __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, 591, __pyx_L1_error) - __pyx_t_5 = __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_5)) __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[3]); - __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_init, __pyx_t_5) < 0) __PYX_ERR(0, 591, __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, 598, __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, 598, __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, 598, __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, 598, __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]); + __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, 598, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":610 + /* "constraint/constraints.py":617 * 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_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 617, __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, 617, __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, 617, __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, 617, __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, 617, __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, 617, __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, 610, __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, 610, __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, 610, __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, 610, __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[35])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __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, 617, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 610, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":623 + /* "constraint/constraints.py":630 * 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, 623, __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, 623, __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, 623, __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, 623, __pyx_L1_error) - __pyx_t_5 = __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_5)) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __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_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, 623, __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, 630, __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, 630, __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, 630, __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, 630, __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, 630, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":574 + /* "constraint/constraints.py":581 * return sum >= minsum or missing * * class VariableMinSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the sum of variables sum at least to the value of another variable. * */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 574, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 574, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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, 581, __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_VariableMinSumConstraint, __pyx_t_6) < (0)) __PYX_ERR(0, 581, __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":651 + /* "constraint/constraints.py":658 * * * 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, 651, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __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, 651, __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, 658, __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, 651, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __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, 651, __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_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_5)) __PYX_ERR(0, 651, __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, 651, __pyx_L1_error) + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 658, __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_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, 658, __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, 658, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":667 + /* "constraint/constraints.py":674 * """ * * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 667, __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, 667, __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, 667, __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[37])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 667, __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, 667, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 674, __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_Union_int_float) < (0)) __PYX_ERR(0, 674, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Optional_Sequence) < (0)) __PYX_ERR(0, 674, __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, 674, __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[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, 674, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":681 + /* "constraint/constraints.py":688 * 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_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 681, __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, 681, __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, 681, __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, 681, __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, 681, __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[38])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 681, __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, 681, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 688, __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, 688, __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, 688, __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, 688, __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, 688, __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, 688, __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, 688, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":699 + /* "constraint/constraints.py":706 * 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 */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 699, __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, 699, __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, 699, __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, 699, __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[39])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __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_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, 699, __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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":651 + /* "constraint/constraints.py":658 * * * class MaxSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum up to a given amount. * */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 651, __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, 651, __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_MaxSumConstraint, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 658, __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_MaxSumConstraint, __pyx_t_5) < (0)) __PYX_ERR(0, 658, __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":753 + /* "constraint/constraints.py":760 * * * 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, 753, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __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, 753, __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, 760, __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, 753, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __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, 753, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 760, __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_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, 760, __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_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, 753, __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, 753, __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, 760, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":770 + /* "constraint/constraints.py":777 * """ # noqa: E501 * * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __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, 770, __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, 770, __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, 770, __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[40])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 770, __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, 770, __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, 777, __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, 777, __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, 777, __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, 777, __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, 777, __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_7) < (0)) __PYX_ERR(0, 777, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":789 + /* "constraint/constraints.py":796 * 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, 789, __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, 789, __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, 789, __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, 789, __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, 789, __pyx_L1_error) - __pyx_t_3 = __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_3)) __PYX_ERR(0, 789, __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_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_3) < 0) __PYX_ERR(0, 789, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 796, __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, 796, __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, 796, __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, 796, __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, 796, __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, 796, __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, 796, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":802 + /* "constraint/constraints.py":809 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __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, 802, __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, 802, __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, 802, __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[42])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 802, __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, 802, __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, 809, __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, 809, __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, 809, __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, 809, __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, 809, __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, 809, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":753 + /* "constraint/constraints.py":760 * * * class VariableMaxSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the sum of variables sum at most to the value of another variable. * */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 753, __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, 753, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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, 760, __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, 760, __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":830 + /* "constraint/constraints.py":837 * * * 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, 830, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 837, __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, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 837, __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_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 830, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 837, __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, 830, __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, 830, __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, 830, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 837, __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_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, 837, __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, 837, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":846 + /* "constraint/constraints.py":853 * """ * * def __init__(self, exactprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate an ExactProdConstraint. * */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 846, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exactprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 846, __pyx_L1_error) - __pyx_t_3 = __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_3)) __PYX_ERR(0, 846, __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_init, __pyx_t_3) < 0) __PYX_ERR(0, 846, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_exactprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < (0)) __PYX_ERR(0, 853, __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, 853, __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, 853, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":855 + /* "constraint/constraints.py":862 * 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_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __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, 855, __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, 855, __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, 855, __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, 855, __pyx_L1_error) - __pyx_t_5 = __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_5)) __PYX_ERR(0, 855, __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_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 855, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __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, 862, __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, 862, __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, 862, __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, 862, __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, 862, __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, 862, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":883 + /* "constraint/constraints.py":890 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * exactprod = self._exactprod * prod = 1 */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 883, __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, 883, __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, 883, __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, 883, __pyx_L1_error) - __pyx_t_3 = __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_3)) __PYX_ERR(0, 883, __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_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, 883, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 890, __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, 890, __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, 890, __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, 890, __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, 890, __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, 890, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":830 + /* "constraint/constraints.py":837 * * * class ExactProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product of exactly a given amount. * */ - __pyx_t_3 = __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_3)) __PYX_ERR(0, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __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, 837, __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_ExactProdConstraint, __pyx_t_4) < (0)) __PYX_ERR(0, 837, __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":914 + /* "constraint/constraints.py":921 * return True * * 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, 914, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 921, __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, 914, __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, 921, __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, 914, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 921, __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, 914, __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_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_3)) __PYX_ERR(0, 914, __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, 914, __pyx_L1_error) + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 921, __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, 921, __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, 921, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":931 + /* "constraint/constraints.py":938 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # <<<<<<<<<<<<<< * """Instantiate a VariableExactProdConstraint. * */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 931, __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, 931, __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, 931, __pyx_L1_error) - __pyx_t_5 = __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_5)) __PYX_ERR(0, 931, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __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_init, __pyx_t_5) < 0) __PYX_ERR(0, 931, __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, 938, __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, 938, __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, 938, __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, 938, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":941 + /* "constraint/constraints.py":948 * 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_5 = __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_5)) __PYX_ERR(0, 941, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[3]); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_get_product_bounds, __pyx_t_5) < 0) __PYX_ERR(0, 941, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __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, 948, __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, 948, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":961 + /* "constraint/constraints.py":968 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< * prod = 1 * for v in values: */ - __pyx_t_5 = __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_5)) __PYX_ERR(0, 961, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_safe_product, __pyx_t_5) < 0) __PYX_ERR(0, 961, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __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, 968, __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, 968, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":967 + /* "constraint/constraints.py":974 * return prod * * 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, 967, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 974, __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, 974, __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, 974, __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, 974, __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, 974, __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, 974, __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, 967, __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, 967, __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, 967, __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, 967, __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[49])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 967, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __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, 974, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 967, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":982 + /* "constraint/constraints.py":989 * 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_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 982, __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, 982, __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, 982, __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, 982, __pyx_L1_error) - __pyx_t_5 = __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_5)) __PYX_ERR(0, 982, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 989, __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_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, 982, __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, 989, __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, 989, __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, 989, __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, 989, __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, 989, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":914 + /* "constraint/constraints.py":921 * return True * * class VariableExactProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the product of variables equals the value of another variable. * */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 914, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 914, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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, 921, __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, 921, __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":1029 + /* "constraint/constraints.py":1036 * * * 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, 1029, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1036, __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, 1029, __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, 1036, __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, 1029, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1036, __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, 1029, __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_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_5)) __PYX_ERR(0, 1029, __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, 1029, __pyx_L1_error) + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1036, __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, 1036, __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, 1036, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1045 + /* "constraint/constraints.py":1052 * """ # noqa: E501 * * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MinProdConstraint. * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1045, __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, 1045, __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[51])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1045, __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_init, __pyx_t_4) < 0) __PYX_ERR(0, 1045, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1052, __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_Union_int_float) < (0)) __PYX_ERR(0, 1052, __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, 1052, __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, 1052, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1053 + /* "constraint/constraints.py":1060 * 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_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1053, __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, 1053, __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, 1053, __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, 1053, __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, 1053, __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[52])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1053, __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, 1053, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1060, __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, 1060, __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, 1060, __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, 1060, __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, 1060, __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, 1060, __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, 1060, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1064 + /* "constraint/constraints.py":1071 * 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_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1064, __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, 1064, __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, 1064, __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, 1064, __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[53])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1064, __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_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, 1064, __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, 1071, __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, 1071, __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, 1071, __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, 1071, __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, 1071, __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, 1071, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1029 + /* "constraint/constraints.py":1036 * * * class MinProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product up to at least a given amount. * */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1029, __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, 1029, __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_MinProdConstraint, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1036, __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, 1036, __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":1080 + /* "constraint/constraints.py":1087 * * * 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, 1080, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1087, __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, 1080, __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, 1087, __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, 1080, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1087, __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, 1080, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1087, __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, 1087, __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_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, 1080, __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, 1080, __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, 1087, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1097 + /* "constraint/constraints.py":1104 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< * self.target_var = target_var * self.product_vars = product_vars */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1097, __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, 1097, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_product_vars, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < 0) __PYX_ERR(0, 1097, __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[54])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1097, __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_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 1097, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1104, __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, 1104, __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, 1104, __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, 1104, __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, 1104, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1101 + /* "constraint/constraints.py":1108 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< * 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[55])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1101, __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, 1101, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __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, 1108, __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, 1108, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1119 + /* "constraint/constraints.py":1126 * 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[56])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1119, __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, 1119, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __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, 1126, __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, 1126, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1125 + /* "constraint/constraints.py":1132 * 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, 1125, __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, 1125, __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, 1125, __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, 1125, __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, 1125, __pyx_L1_error) - __pyx_t_3 = __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_3)) __PYX_ERR(0, 1125, __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_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_3) < 0) __PYX_ERR(0, 1125, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1132, __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, 1132, __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, 1132, __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, 1132, __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, 1132, __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, 1132, __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, 1132, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1138 + /* "constraint/constraints.py":1145 * 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_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1138, __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, 1138, __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, 1138, __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, 1138, __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[58])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1138, __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, 1138, __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, 1145, __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, 1145, __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, 1145, __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, 1145, __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, 1145, __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, 1145, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1080 + /* "constraint/constraints.py":1087 * * * 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_5, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __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, 1080, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __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, 1087, __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, 1087, __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":1182 + /* "constraint/constraints.py":1189 * * * 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, 1182, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1189, __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, 1182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1189, __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_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1182, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1189, __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, 1182, __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, 1182, __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, 1182, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1189, __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, 1189, __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, 1189, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1198 + /* "constraint/constraints.py":1205 * """ * * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MaxProdConstraint. * */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_maxprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 1198, __pyx_L1_error) - __pyx_t_3 = __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_3)) __PYX_ERR(0, 1198, __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_init, __pyx_t_3) < 0) __PYX_ERR(0, 1198, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1205, __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_Union_int_float) < (0)) __PYX_ERR(0, 1205, __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, 1205, __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, 1205, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1207 + /* "constraint/constraints.py":1214 * 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_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1207, __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, 1207, __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, 1207, __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, 1207, __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, 1207, __pyx_L1_error) - __pyx_t_5 = __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_5)) __PYX_ERR(0, 1207, __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_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 1207, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1214, __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, 1214, __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, 1214, __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, 1214, __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, 1214, __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, 1214, __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, 1214, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1235 + /* "constraint/constraints.py":1242 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * maxprod = self._maxprod * prod = 1 */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1235, __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, 1235, __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, 1235, __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, 1235, __pyx_L1_error) - __pyx_t_3 = __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_3)) __PYX_ERR(0, 1235, __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_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, 1235, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __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, 1242, __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, 1242, __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, 1242, __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, 1242, __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, 1242, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1182 + /* "constraint/constraints.py":1189 * * * class MaxProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product up to at most a given amount. * */ - __pyx_t_3 = __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_3)) __PYX_ERR(0, 1182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 1182, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 1189, __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, 1189, __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":1267 + /* "constraint/constraints.py":1274 * * * 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, 1267, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1274, __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, 1267, __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, 1274, __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, 1267, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1274, __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, 1267, __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_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_3)) __PYX_ERR(0, 1267, __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, 1267, __pyx_L1_error) + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1274, __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, 1274, __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, 1274, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1284 + /* "constraint/constraints.py":1291 * """ # 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, 1284, __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, 1284, __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, 1284, __pyx_L1_error) - __pyx_t_5 = __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_5)) __PYX_ERR(0, 1284, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __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_init, __pyx_t_5) < 0) __PYX_ERR(0, 1284, __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, 1291, __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, 1291, __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, 1291, __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, 1291, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1288 + /* "constraint/constraints.py":1295 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< * bounds = [] * for var in self.product_vars: */ - __pyx_t_5 = __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_5)) __PYX_ERR(0, 1288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[3]); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_get_product_bounds, __pyx_t_5) < 0) __PYX_ERR(0, 1288, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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, 1295, __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, 1295, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1306 + /* "constraint/constraints.py":1313 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< * prod = 1 * for v in values: */ - __pyx_t_5 = __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_5)) __PYX_ERR(0, 1306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_safe_product, __pyx_t_5) < 0) __PYX_ERR(0, 1306, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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, 1313, __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, 1313, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1312 + /* "constraint/constraints.py":1319 * 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_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1312, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1319, __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, 1319, __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, 1319, __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, 1319, __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, 1319, __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, 1319, __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, 1312, __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, 1312, __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, 1312, __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, 1312, __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[65])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1312, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __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, 1319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 1312, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1325 + /* "constraint/constraints.py":1332 * 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, 1325, __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, 1325, __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, 1325, __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, 1325, __pyx_L1_error) - __pyx_t_5 = __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_5)) __PYX_ERR(0, 1325, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1332, __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_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, 1325, __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, 1332, __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, 1332, __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, 1332, __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, 1332, __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, 1332, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1267 + /* "constraint/constraints.py":1274 * * * class VariableMaxProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the product of variables is at most the value of another variable. * */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 1267, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 1274, __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, 1274, __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":1369 + /* "constraint/constraints.py":1376 * * * 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, 1369, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1376, __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, 1369, __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, 1376, __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, 1369, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1376, __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, 1369, __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_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_5)) __PYX_ERR(0, 1369, __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, 1369, __pyx_L1_error) + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1376, __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, 1376, __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, 1376, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1380 + /* "constraint/constraints.py":1387 * """ * * 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[67])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1380, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 1380, __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, 1387, __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, 1387, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1388 + /* "constraint/constraints.py":1395 * 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[68])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1388, __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_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 1388, __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, 1395, __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, 1395, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1392 + /* "constraint/constraints.py":1399 * 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, 1392, __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, 1392, __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, 1392, __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, 1392, __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, 1392, __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[69])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1392, __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_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 1392, __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, 1399, __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, 1399, __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, 1399, __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, 1399, __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, 1399, __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, 1399, __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, 1399, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1369 + /* "constraint/constraints.py":1376 * * * class InSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are present in the given set. * */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1369, __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, 1369, __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_InSetConstraint, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1376, __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, 1376, __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":1403 + /* "constraint/constraints.py":1410 * * * 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, 1403, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1410, __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, 1403, __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, 1410, __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, 1403, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1410, __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, 1403, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1410, __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, 1410, __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_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, 1403, __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, 1403, __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, 1410, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1414 + /* "constraint/constraints.py":1421 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_3 = __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_3)) __PYX_ERR(0, 1414, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_3) < 0) __PYX_ERR(0, 1414, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 1421, __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, 1421, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1422 + /* "constraint/constraints.py":1429 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * # preProcess() will remove it. * raise RuntimeError("Can't happen") */ - __pyx_t_3 = __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_3)) __PYX_ERR(0, 1422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[1]); - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_3) < 0) __PYX_ERR(0, 1422, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 1429, __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, 1429, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1426 + /* "constraint/constraints.py":1433 * 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_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1426, __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, 1426, __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, 1426, __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, 1426, __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, 1426, __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[72])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1426, __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_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 1426, __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, 1433, __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, 1433, __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, 1433, __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, 1433, __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, 1433, __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, 1433, __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, 1433, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1403 + /* "constraint/constraints.py":1410 * * * class NotInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are not present in the given set. * */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1403, __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, 1403, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __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, 1410, __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, 1410, __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":1437 + /* "constraint/constraints.py":1444 * * * 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, 1437, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1444, __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, 1437, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1444, __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_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1437, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1444, __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, 1437, __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, 1437, __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, 1437, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1444, __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, 1444, __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, 1444, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1448 + /* "constraint/constraints.py":1455 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_5 = __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_5)) __PYX_ERR(0, 1448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[4]); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(0, 1448, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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, 1455, __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, 1455, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1462 + /* "constraint/constraints.py":1469 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * missing = 0 */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1462, __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, 1462, __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, 1462, __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, 1462, __pyx_L1_error) - __pyx_t_3 = __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_3)) __PYX_ERR(0, 1462, __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_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, 1462, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1469, __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, 1469, __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, 1469, __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, 1469, __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, 1469, __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, 1469, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1437 + /* "constraint/constraints.py":1444 * * * class SomeInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that at least some of the values of given variables must be present in a given set. * */ - __pyx_t_3 = __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_3)) __PYX_ERR(0, 1437, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 1437, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 1444, __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, 1444, __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":1499 + /* "constraint/constraints.py":1506 * * * 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, 1499, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1506, __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, 1499, __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, 1506, __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, 1499, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1506, __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, 1499, __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_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_3)) __PYX_ERR(0, 1499, __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, 1499, __pyx_L1_error) + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1506, __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, 1506, __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, 1506, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1510 + /* "constraint/constraints.py":1517 * """ * * 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[75])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1510, __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_3, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 1510, __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, 1517, __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, 1517, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1524 + /* "constraint/constraints.py":1531 * 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, 1524, __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, 1524, __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, 1524, __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, 1524, __pyx_L1_error) - __pyx_t_5 = __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_5)) __PYX_ERR(0, 1524, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1531, __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_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, 1524, __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, 1531, __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, 1531, __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, 1531, __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, 1531, __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, 1531, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1499 + /* "constraint/constraints.py":1506 * * * 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_5 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 1499, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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, 1506, __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, 1506, __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":1563 + /* "constraint/constraints.py":1570 * # 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) */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1563, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1563, __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, 1563, __pyx_L1_error) - __pyx_t_6 = __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_6)) __PYX_ERR(0, 1563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 1570, __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, 1570, __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, 1570, __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_6) < 0) __PYX_ERR(0, 1563, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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, 1570, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "constraint/constraints.py":1 * """Module containing the code for constraint definitions.""" # <<<<<<<<<<<<<< * * from constraint.domain import Unassigned */ - __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; + __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); @@ -48183,344 +48150,27 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); #endif } /* #### Code section: pystring_table ### */ - -typedef struct { - const char *s; -#if 1027 <= 65535 - const unsigned short n; -#elif 1027 / 2 < INT_MAX - const unsigned int n; -#elif 1027 / 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___call___loc, sizeof(__pyx_k_ExactProdConstraint___call___loc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ExactProdConstraint___call___loc */ - {__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___call___local, sizeof(__pyx_k_MaxProdConstraint___call___local), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxProdConstraint___call___local */ - {__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_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_MinSumConstraint_preProcess, sizeof(__pyx_k_MinSumConstraint_preProcess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinSumConstraint_preProcess */ - {__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_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_max_sum_missing, sizeof(__pyx_k_max_sum_missing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_max_sum_missing */ - {__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_min_sum_missing, sizeof(__pyx_k_min_sum_missing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_min_sum_missing */ - {__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_missing_negative, sizeof(__pyx_k_missing_negative), 0, 1, 1}, /* PyObject cname: __pyx_n_u_missing_negative */ - {__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_other_vars_max, sizeof(__pyx_k_other_vars_max), 0, 1, 1}, /* PyObject cname: __pyx_n_u_other_vars_max */ - {__pyx_k_other_vars_min, sizeof(__pyx_k_other_vars_min), 0, 1, 1}, /* PyObject cname: __pyx_n_u_other_vars_min */ - {__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_other_vars, sizeof(__pyx_k_sum_other_vars), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sum_other_vars */ - {__pyx_k_sum_other_vars_locals_genexpr, sizeof(__pyx_k_sum_other_vars_locals_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sum_other_vars_locals_genexpr */ - {__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_var_is_negative, sizeof(__pyx_k_var_is_negative), 0, 1, 1}, /* PyObject cname: __pyx_n_u_var_is_negative */ - {__pyx_k_var_max, sizeof(__pyx_k_var_max), 0, 1, 1}, /* PyObject cname: __pyx_n_u_var_max */ - {__pyx_k_var_min, sizeof(__pyx_k_var_min), 0, 1, 1}, /* PyObject cname: __pyx_n_u_var_min */ - {__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_with_lt1, sizeof(__pyx_k_variable_with_lt1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_with_lt1 */ - {__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, 317, __pyx_L1_error) - __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_min); if (!__pyx_builtin_min) __PYX_ERR(0, 313, __pyx_L1_error) - __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_max); if (!__pyx_builtin_max) __PYX_ERR(0, 314, __pyx_L1_error) - __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_round); if (!__pyx_builtin_round) __PYX_ERR(0, 351, __pyx_L1_error) - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 424, __pyx_L1_error) - __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 442, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 1390, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_min); if (!__pyx_builtin_min) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_max); if (!__pyx_builtin_max) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_round); if (!__pyx_builtin_round) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 449, __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; @@ -48543,14 +48193,14 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); - /* "constraint/constraints.py":954 + /* "constraint/constraints.py":961 * 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, 954, __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, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); @@ -48565,38 +48215,65 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); - /* "constraint/constraints.py":126 + /* "constraint/constraints.py":301 * """ * - * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< + * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = 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, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); - /* "constraint/constraints.py":294 + /* "constraint/constraints.py":1455 * """ * - * 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, 294, __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, 1455, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); - - /* "constraint/constraints.py":1448 - * """ - * - * 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, 1448, __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 CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + } + #else + 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 CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + } + #else + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -48607,38 +48284,133 @@ 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},{18},{13},{17},{107},{1},{8},{25},{7},{6},{2},{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},{8},{20},{8},{19},{28},{28},{22},{31},{31},{10},{5},{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},{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},{6},{11},{10},{15},{18},{1},{3},{5},{6},{3},{16},{8},{8},{8},{22},{17},{9},{12},{1},{3},{34},{42},{17},{49},{246},{395},{297},{95},{287},{347},{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},{22},{2},{2},{2},{2},{23},{25},{2},{86},{148},{161}}; + #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (4927 bytes) */ +const char* const cstring = "(\265/\375`\221a\255\231\000:\222@\037;\360\0327\314\300l\000\2222\3101B\243\303\032RX\370 \23707\205\025\365,\332f\215V\034\257C)RR\000\000 \000\000@\t\000b\327e\002\n\010\003\000i]\003\000\240\232\010\330\001\331\001\351\001CKIK\332T\365P\250\203\222\322\034\364\271\351\235\346\232Z/\267\253\252\356\034<\265V\311\341JE\376p\310\333\326A\2526E\207>\337nM\r\245Y]\212\316\366C\363C\252\254nMT\267\031M\365\251\256O-\225\214\276\225\"\344\251>\231m\006\372\200Cu\363\260\271\335(\331\242\344\316\254F\323 \332\246C\340\016\216\212t\241Q\221#D\020\004,\\I\256Xe\362\205\364\221*;l5{\273\335@|\344H\376\330&\352\264\246\246\212\376\364I\376\310`f\247\310'\023}\232*m\304\274\002K\034.\223\272\315\2325\21198\304\331r%%\271\341\n\3149\0235\rn&Mw\252f\365\357\207\236\244fs\232\346\262,m9\\.\227#\346\334\n\314\331p9\235N\247[KJJl%\246o\244$\227\303\001\207A9\340p\347Jb^\201eiR\252(\217m\2436\233\315f+m\344\010\316\266d\326\314Zk\232\354\252\346\235\346\241P\267\346\360\304\265k\317\252.\341p\276\332\0079\002R\222#\265\\\373HJ\032\246kP\253\235\210 \037\033\250[\364F\3748u\313\256\033d\251Lju\220\212\023\364\261\204#G\312$rdI\303\247A\216hd\215\244\017\242\363\3147\220\217\037\322\205\004\256///+:\r\0023\221\206D@\270\265zgRE\365\326lp\017\201(\253j)\324i\353a\232\245H\375[I\r\\7\331\356\254S\262\315O-\351\244\242\246\252\251\322\326\324,z\222\247NS\275\252\244\232MrE[S\035\326\350\324\227S4\010\\eT\035\014\346'\262\255\251Y\346\266[\025UW\223d\327\037\271wNMR\357\354#[3\263\355\366\355n\001\275\306)`G\236\337\371\212N\223\020j\301\016\0004\266b0\373\332\374\3566\227\235\037\241\370;.\"\372D?\177\306\3702\316\024_E\037\034\003\027\275\003\357\214\227y\227\277\361\323\345\271\017\0061\2578P\234\201\207o~\247|\3669\257;\257;q\036\337\340\001|\342\000\200`K\330e:\207\354\313^\224\216\277\353C\236\241\020\273\374\007\304\312Q\330s\237\342\031\260\243\353\025z\235\316\001\213\263\233s[\255\006\005\235ks\244q\n\203\270\344\025]\327i\335\312\21508\226\256L!\246u\024~\245\245\323J0\210""\263\221\300xc\362M4\276\306+\306ybE\236WG\373\264\327\347\271NZ9\255\204\327\221\006\257`|\014\200\357\352\244\213\357h\355\270\205\302W0\210\205\256\216\326\302\001\200\303\226\020\266\275\270\214\237\361\372A\264\212\370\324\242S=\251\251\225}j{A6\267-\333\3524\353\375K\265\336\254\226Z\201\232\335k0\270\0067\220\315\301\340\036n`V{\352\336\252\356\255l\232\235\264\252\346V\357\215\002w\217\270\246\273e{[E\211\364\211>\241O=\263\247\317aj\022u\257\327\333@s=M\364,\333\264\267[\340z\232\246/\337L\235\246\253\251\367\232\232Qf\366i\263\267u\233O\364T\315t]}\276\255U\264\035\256\354j\336V\324T\251v\336\255\252\201\275S\325\277\274\367\251\016W_\257wj\325\t\335;\253C?\r\324\022uOo\206H\365\303\006\211Z}\331k\332r\333[\233Q\246~\2229\331<\325\312\364zi\232\315^\357\2664l\223\332\215\246\347FM'Uo\364\244\n\336Ht\017\346\246\2569%\315\235F\231h\220e\213\226\332\274\246?r$I\r8\336\3467\346\275\231u\223\023\300\216H\025|\302\205\271g\020\320\337F\037\230\017\004\317p@&>\313s\365\035\3411\366\272^\250\356A\30648\000N\3628\\oy\206'\3528\334B\330\013:U\t'\310x\225\347\270^\336\240\317p,\243\203\021G\345\263\257\216\252\003\365\216\207\217\213\225\\\273\020\035<\346E$F*\276Jmv,\253X\270\214\216/\275\000B\326b0\210w\\\346\352A|\305B\370\002\035y\357\356\r\361!\034q\3661^\245o\220q\356\375\336\321?*\215\t\004p\320\273\342E\310X\350!\374A'-\":MB'\214p\340U\307\230\217\032\340\022QE\262#\357\2309\306\354\270{5\336!\276\363\313\342\333\\gr\007v'\016\326/\007\026\317<\347\340\312\270CW\027r\035w\226]\016W\346F\300\n\216\031\022\255\033\021\3225,b\232G\017\350&\274B\002\242\037p\211Y\314\353\273^\364\344\364\235\316\177\026\375\240\037\364\363w\212E0\316;\364-\335\206\253\014\001\375!\343\314\310\026e\212X\271\267\225u\032\376\342\006\356\214\220Cp\0277\331\361\237\033\357\022\270\004L\200S\305D|\314\233\335\003\342\347\360`\221\027\305\213\314\376\216+\274\264w{\031?\"\373\255\3261\273\020\0061\315u\230qg\r\274b&\203\342\030\0221/\303\017\260\320\213{\035^!\217\363L|v\302m\334\031""\314\325#\370\004\354\230\217N\277\377k\372MJ_\311\350\033\t}\241\237\3573\306\030\213d\260\013\276\361z\307,\246\031\207\212\263\"\r\\\3026o\371\n\274&\236\346Q6\007\342\027\263\030\026\323\212\033\006\2027`+\337\341\317\036\323\313\276\001+pa\nq\331Y\236\321\360\263\206\017\210\361\211]\227\365\027\227\326c\001\017G\223\346\356W\357\236;CY\254\231y_\021>\010\007^\3131\222\\\027`\241\031s\340M\223\351Xn6^\024I^\230\276\321\221p\206\370\005\217\363`^\247u7\247f\266e\321kd,\363#\027&\265\313:)w\370\353\225y\177\236\303\247\261\253\354s\262{\243\260\265\313:&!}$\336\217*\316\274\262\227\275\341\371x\003\316\004\027\347\246\300\216I\256\314e]\232\227\255\207Y|`\020C<\304\016\261x&;\356\262v~\327cW\331[\216O\021\3238\306<\010\306\001\000\307V\217\3513\355\374\035\225\257\342\361=^\277\3444\236\036]0\3037J\371)55\27758\n\357\335x\227`\020oT\217\271\000\342}\245\"\016\\\302,\265\257\353WnD,H\"V\024\202W0\370\304\221\321\337\361\025c\212!p\014>\010\351\001\001H\001GG\001==\001<<\0019\0019\256+\000\200-+\341\027\002?0\352G\371\276o\312\230\2159#S\003K\025\023\277(\337\004\325\315\321j\367\337O\237\350\347$\301\270\002\037\302\003v\002F\223\"\255\030C\362u^\204\342\357\202\370E\227\210w\360\013\026\276\005VR\235\210\343\034w\037\375\3441B\236=\333k\021\177\346U\360\276\316A\333\264\232P\320\277*\2420\017v\001\371B}a\347\226\256@\254\013\335\304^\323\347\364W\216W<\024sE\231\362\013\371\201\206\377\3600;v\300\260\204>\373\251^\203\375\356\3041\024\024\376\002\257\270\000S\375Db\357\211w\360\265>\301]\271\023t\037\237\242\3209\330\361\"\367\301\245\020[)\034\000xl\375\364\3279?\007\345\243p|\016\032\357a\330\312\357\311\306\337\270m\t\235\312\356\320i\261\317\n\335\016\327A\363\334\231\033s\371 \007\227\214\237H=\304\0178\035\327\246\2560\366\226\0162\tFj\276\032\035p\201\203\027],\rk1\376I\223xG\315\222\262\253\344A\300\261ma'N\210rB\261\257\264\212k\3574\367\020\363n\203-]\245\341\024\006\260\256q\332\206\200\272Ui\261A\375}\277\031\213\217\305h?(ls\023P\262'\353\372\020g\274\206\312\006\2647\367\246R\t(\210\263B\275,k\024\001Zu@.\252\031pXD\241\372N\300\016n\361\275\365\201\217P\260\316@E=\257\216\221\212.\013/\207\253\203qG\226\021\033\255\013\n\307\034\234\036\240B\207\235\263\0252`}.\363\"\304\034\223\233\245\320\212W\037\016\306\034C\271\364\016\222l\177\352V\261O\267\200D\034\341\341!\201\266\242\000\201\315\241\035&\366\265\326\226u&u\201T9\336Qw\257m\3542\340\004G\005\021\233\264\202\342\"\360\217\013\210\323\312[%\241\035^\373\256\260\003v\371=_\364\0102\013\302\203\343\r\371\010\253m\340F+\014\325K\340\260\003\372\205\006}q\354N\310zf\2636\207\326\201\332P\014\3448$/\234\305=DM\357\025O0\213\260\346\316P\202\345$\276\026\311n\247G\3020h\376j!\006\264]2\205k*\320\343\247\201e\375\n^\210 \205\235\201;\257\357\253N\005\220\346n\037|19<=G\327\177!\207Uw@\307\2609\351I\360\343\334t\310\222C\255\371\301\374\254\201\035\n[S\022\232\2506\2647lI?J\232\365\025\207\266\206w\363\377\2512\363\331\n\214\311\022\266\3420C\302\305\004a\036\210\253\376:\245\353\311\257\377\374\254\306]@\236\205\255\025\021<3\205.\rL\230\320&$\240\000\213\365\037\352u\022\364-\217\225\247\201\343\357\375lj\023\017\331\207PD_;\301\tX\327\263\033\024o\022\232\017\206S\024q\312Y!\265\334$?\211\2451\351\332\243\376\343e\001\231\265<\341P\372\177\251\373g\014C\327\231\244X\243Q\326\206\025<\3270\200C\334\035\245\207\360\377/\264\223b(\301\326{)=\270iG3[~C\362\262\016\213R\311z\016L\365\007d\022/\202\2602\273g\026\331\302'\327X\362\246\334\343=\373\201z\300p\204\245\346X\021 \372\360\014\317\272\335\372X\234\004\370M\241\243\215m\n\332\215\265{{\266\300\202\223.\370\244kv\260\020""\034\271\330\270\212?\254\314\031\0232\310\231zx\364\333\252\247\305;\235#taX\354o\377\352\017\336\343\312\373\031]\014\367(eTn\266$'7\211\306/\020v-H\002\213:\341x\250\217\234k\330\301\340\273'\207\2234\005\021\001\276k\225\021T\3032\231\206\265\367\007\312t\315g\372\305\345W\032\357y\010\232\001T\215\216\255\300\030\250\304\0354!\031\344\232+\241f\213MV\207\320^\310\326\314\273\007,\014[\207\332qz)\261\301\033T\275\366Y\0037\347\222\342ULX#\341\020\001\005\031\276\013<\206\344\304\207\266\364\250\256#3\314%\275Cb\267\324vp\212\301\025\374\224\244\264\t\261*Y\327\361\360x\221c\273\207O\306|\221\n\003\2613$i\224\016\247\375\262B>\332\251e\346^\223\210\277pXO(\234\214|Wj\303\013\251\225\t\033\014\257\rc\301)\307\330%\334;`\353\257\235\036q1\204\247\"\250R\247E_o\025\266x\272\014\026\270\324\031\277x`\027\377\201\303=S\221\221u\202\000\014\314\375\316^#\222+\257\301XC\275\373\323\311\003\241$\304\230z\223\240\262\272Z'b%\215\371\r\253d\032\032L|@\031\321R\245\317\007\215\371\204\220\257\207\207\253\250\272\215\253\n9>g\352BV\325\341\376?0\374IG\252\266\215\310p\243VA\036P\341\014\277E\220\000B\213\342\0007\031\360\034\033,\025~\035\256\216\303\311a\025\226\241T0C\312\261\033O\332\273\377\024\r\2606\204\356\032~xOtl\r\274\356O8\302\032\017Ou\310\230t\233 \317\240q\327a\022IZ\365\244m\204\236\255\202L\023\227\307\215\363}\357\014YN\221^\344]%\014\223\303\031;-\034\354#\013\2547\204e\330\203\361\020\321\031t\032;\030\353F^\261\247\337`\343\233=\276a\376_\226\256H\0232e\273\275\r\032\370\235\314\206\304\233\024\337\276*K\037\371\324,\006*\252\034H\241pv\246\237\255\363\200\260\311\244\030\024\007\310\335\347\010'z?\246\306\250~\022\032\204is\r\245\013!\312\\O\235\311\264\023\0062\202\266H\262e\030\231@\371\0215\203\3749\177\370\372\207.,\274L\026\2712\010t\363e\026\223\251\232E$\304vL/\3611\2019\316t\360\250$\330\021cY\315\016\341\004\3361\025\304<\374L\270!\271\250w{\361y\331\202O\346\205)H_\363/\373]\311O\335\001\032\010\324\243u\222\377\276\303\252`\317\013\277\r\270""\365y\026\010\253n\254\373\323I\264\375\201q\302!YX\250\223\247\203Q'\261\235\023<\203\215\267\214U\224*km\016A4\223\024\241+.\250\255\"C\341\024\333`\027q\005\260\026\357\377\321b\261:z\\\241%\311\342e\366u\230jCp>\007\301F\177>A\262[\220TQE\202\251\344\202b\340\033u\030\321\251q\036\345.lp\241\030[t.\306/\335\230\352\246\266\312q\367\270\2435\321}5\373\206#A85\361\240K\362\234l\333\263\236d\361\240i\303=\223\337h\221&p\275\331F\372\001\277Pxt,\312\034\355\200w.\000\244\261\231um\324Wh\241\266\303\000P\010,E_\341\324=?m\307>\320\233?P\220\013\227f\324\332O}\264\"\247\3227\243\266=\327\261Em2?\204\307\014\240\r\245\241}\\\346%\324\272}J[\250\033\221.k\243\245/B\310\"\270\232\277\215\261\266\233\203A\226KHp\034\254[Z\332e\3463\277t\304\031\364B\300\327\221\r%\300\316\307\351\256\220b\271^\204\006\027\324C\374\364nfOw\207\337\233M)~\325\013R\202\352\020\254\270\273-\202b6\037\216q\340\210\035 \270#(i\017\354\347,#\333X4\337\344T\353\002\031[r\n\025X\215\365\0146*zm \313\230\034\225.\246\205d\202xj0\346\330G\244;C\233\222nhR~L4\346\0342\220\217n\036p\221\360A\262\241\375t\324\275\246Q\2478/DWg\371\214\006\270\313\343YD\000\264\263\251\241\016b\006\270\232\217\244q\302\214n\215l\245\365O?k\200\020\310\214:\227B\224\330Bf\005\371#\250\342\246\344X\352\362\265\242u\260\304\n?\254\275O[2\224\"\311\022F5\334Pa,\215v\243\211\020\"\352\366&\216\324.\250|\310u\355vo\240\264\236x0A)\332\276*Jp\246u\202\340(fE\324;WN\360ca3\254\270h\326m\217W\262WB\013#\337\242\037\245E\227\\\207\374\236+\362\004G=\021[\236\"\272t\251\265\304\236U\013\242\010\232Cu`\343\273c\344\215\314\030oY\303}\223\"\335z\034\206u\237\003\\;\301\354\332\230\3154\335PHW\263W\216\321\364l| `86\371V\330\014H\005\310\337\215\t\013woRr&\252g\227\202\332\326\026\351\317%\016\341,\371\350\263\350\"\237|:e\231\021\251/\026T]\347\321_t:\224\022\0131_\323\022\217\034K\\\202\341}7#\017F7K\260\375c\242\213\300\331\330L\203\230X\204%\237\203\021\372vkAb5\202B\250\236\340\331F\025E\3540\202f\374\333M\303\016\321\235\347)""\\\2369\306\247\240\005w\371\363R\273\207U\000]\370 \354\""; + PyObject *data = __Pyx_DecompressString(cstring, 4927, 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 (5064 bytes) */ +const char* const cstring = "BZh91AY&SY\314\207\314\300\000\016\252\377\377\377\377\377\377\377\377\377\377\277\377\377\377\377\377\377\376@@@@@@@@@@@@@\000@\000`\030\236\356\371\362\366\305\035\035d\266\353\254\346\301\355\256\332t\300\326O5:[\335^\270\356/'s@\245\003#\320{oG\243\253gG\274\352\230>\025%\001F\373\226\303\004\222\022\215S2\206&\362D\323\324i\351\2504l\322\237\204\362\021'\250\3756\215M\032\230I\344\311\352\230\365\036\240M=@\302i\246Ljz\200\022D\324\301\t\r\023\"zM=A\241\352h\03224\032\000\006\200\003A\240\000\320\000\000z\207\250\000I\002)\25154=O)\2235\033S \3654\310\017S\322i\265=CL\233j2CC@\320\320\320\000\000\323L\236\243\321\221=A&\222D\232\204z\247\352\237\252m\242\232dh\320\323\324yM\r\244~\250h\000\003@\000\033P\000\000h2\000\000\021I\002T\366\022\237\351\246\212M\265<\230\244\366\205=&\203A\204d\000h\000\000\000\000\320\000\006\206\2314\004J\010\020M\0314\032\252\177\224zS\364\211\275I\251\266J~\232\241\247\244\001\240\017P\000\006\324\000\000\320\r4\000\361O\370\023]\314\030\355\231\202bL\246\303<\347\027\217'\233\t\273\270\311\352\311\020\276\021\000\272,\035`\205\260\007\\]\204-\221mD\214\r\2642\021T\022\225CJG\230\036xz\001\354\205R0\n\245J\257h,\026\013\005\202\367E\356\264O\225\371\371\325\r\254\010\252&)\210\030\206&\321\371\214\300\321\305\300\301\273\334\tc,\262G!\263a\311\014\203\347Ma\006H\311\030\242,A\001\025$X@R)\026\n\240\240\002\221`\214\210+!\271\260s\300\nC\2010\334\363\275\200\037,\177\224C\334\0038I\"S\343~\375\245\006)Z#\205\207\241\324\220\014\240Do\273\002\033\360\241\200+L\002[ha\033\010`,\202\301\025\204b\022,P\223\240\211\020P\355\231\202\232\220\316\200\325\003N\245(g\215\300\271(\021_\022\020X\300dC\0269\210h@\204D$VD\211\006A\271\221\203t\002\317I%\354\231/P\206a\250\255v\332\233\013\024\261s\003`\357\375\200fj\340\316\t\244\27403\014%\260\227|\345\016\"l\030&\200\333\027\024\354=/;\264y\334\315\035\241\000\220\241B\204X\300\n\021J<\332\307Z\032\335|\330b\3555\234\344\210\201#\030\022B\020&\302\327\326\312,c\255\324g\2707\\\370\035\023@""\334k\031\013!\024v\276\350\250\212\030!`\032P\263\r&\236B\254\322\241`uk\224\032\205)\240\350\246\305B\315\341/\214HW-e\3546\311\272gp\2711\022\221\325p\251b\314\217\256%u\225\006\243\221\2555\256\370\215\265\246d\343\220\351r5\240K;\365\363a\200\030\206\004\327\307\022\257\253\226\224\301Qr\351\240E\004\316\202h`AN\247\204\002a\002\017\261\000)\005@\373\024(\202'\211-\004R\204\001\373(\007\324o\357t\371os\220\005P$\271$\367\331q\254P\315~\003\212|\331\t\302\325\241-\004\235\350``\224\352\354\277\035\372\254\225_\017+b\242\tAlq\225y\274t\222\232\337\262\016d?\340\260\232\236\265Xl\324j\255\"9\312\007\375\332\272\026 \312A(m\253\014:%\233s\202\216*\273,\303J\245\313\252\360\303A2m\347\260\333\0040\005\032\243\212L1\211\250<\355\27762r\272\034\230\241`\206\350\304\323\257X\020\301\004\327\245B\256Ki\322g \322pni\216A\275\370\036\327\243\350\276K\344Z\241\242zOI\364\335,\006\355\325\330HF\020\204.JE\035\203\272\317#m\027\033\ra\234jY\276\306\231\306\207\223\342\220\016\330\357F\007\373\220I\005\217\372\210\034@L\335\333\372\223\230\r\215\221\2715\261\300\242V'Mg58\345\304\264\205\316Sk\350W\262\025)\2406\216P\\\313^?\226\026\346\035f\016\257.=R\010\304:\231\0024\022!D\220\241k(\321l\220)\002\260X\210#\002\222\014\226,H1\214ke\n\024\201m%)\324Br\035\000\372`\003\325&d\0000,*\272\254l\026\177/\020\030\312\302\273\252\251\273R\252D\"\232\301\220\356\240\027\211\216\001V\006\222\034\010\240T\000\201\274\217\222\255\"\257^\256_U\000\337\026\000\t\354\211\"\311%\031$\241\346'u{\305X?c|31\271\204\222](\250\212\242\"\315&\306\031\201\322\314V\346\030Q\225A\210+\026A\202b\322\304Lj\216\220\322\246,b\212k(\364\235\361\351\017#\303\3448\013\023\222\274k\215\252#\\\305\254\342\224S\030\024\230+\305\302*i\225\210\207P\022\356\373\317k\275\003\230e\001\232g\235\346p.\010s\326A%\203vk\000\234\334\322C\234\036\301P\"\001Q\350\240!H\266\200\210\363\272][n\200\221\200i1\231\006\322Mfv{\0347\t\220@\204\030HF@\nB\227\363\235\337ySC\364\303\234\362;\372\020\0174$\021\004I\205\031\t\010@G""\337\265m\247\006\261\331\346\302\333\0179\327\017ryx\250\242\211\332\372\267\213\302\260\204\276\272\004\013\356\223\335\222d\000\355U\250%\371\307\237\311\266\303\243\217H\034~#\367-\365\313\306\004 \310\260db,\"1Q\210\305\"\212\253\024\214dTT\224JM\241Y\013\020\264\342R]\354]\007\020\352\347\246G\005.\330Y<\023\316\n\246\013\016\351\250\210\333.\0168\211\036\2102lhA7\022m8\032\332\350\315\tN\004s*\024\340\227\003x\245\353N\376u\212\252DF\000\252\304Qc\026$\"\222H\205\n\tMq\006\330\030\206i\373ff\2440\r\035\014\343!$\222\004&\244\262\032\016\211\241\237\304l\017\341\320]!\240\232(h\246\201\333\241MOB9b\230\226\326\373\310\331[6~\364\372\360\231#v\351\231\201\362|\010\372\261\346\355(\346&F@~\257\241\363\017|\007\337\r\027,]\177'M\235\302]\307\333\027a\305\000\352\324m\362\261\347\025\003p\260T\r\342\240l\337\253T\356\360\364\322\236\346<\363\240\\\224\252\006\361*\326\326\2523\243m\334j\252N\3000\304\274A\277\010\"e\336\362]I\004(\252\026l`~\373\340g\246\337\210\372[m\335_\251\361\240R`\373\304$\217\277\225J\260$@\n\033\024\227YsY\231\213e\252\241\226\346f.KURr%\217\372\267V\266\325[\276\373\355\266m\230\266Z\253\340\370\036\210\016\010\360\023\207\254\337\273k\354\031\246`ff\246a\305\314\351~\r\036\223\260\341M\363\362c\354Z\224\215\313\320\264$\274\353P\3477!\263\205\346e3\231\3152\310\250\342\322H5di4\236\362\026w\3170v\315\235\235\231\235\252b\261\025\2612\347\232\201\353\206\342\025\202\306\252\342\3109\350[@\346\0132hY\212\267\232\022\3347\352\366\016&\341\366C\230\3479\357;\320\316\215Z\315\215\251\244]\231\241\323\014\231\260e\0049\0143Cn\032\026\215\234C\020\255/w\2235\336\367\006\227\307\364vy\310\300\016\020\207\211\324\351\255[ZU\266\333m\266\333m\266\332\266\333m\266\365M\317\003\232C\301\260\016\300\034\356u\366\232\333C\220\354l(L0X\252\202YQ@\326C0C\201T\235K\253\233\213\"\344\330\344<\355\347\314\361\272{\362\007R\000t<\274\331\230<\333\026\226\333Km\266\333m\266\333m\266\333m\274\307,9g/\247<\376Sn}\244\364<0\337\207\360\357\274l\254\213\254\315""\367[r\006^ 2\314\274\354\22363(y\246j\222bI\206\221\342Y\246\010\224\021&\201\345\014\3210\002\241\232\322#T\326 Z\334\001)\204\300\264\264\263\242\005\300\244\346b\322\032B\213\277\311\202'\t\356_3c\034\354 \300O\0161\020\030\244I\030\212\202(\305\214\220P\"\005\tA\001\033\335\222\256\326\\\273\031\214a\360\340\311_\\\253\342\035\334\007\036\010\210UAO\210\267\333\347\216\334*\033\027\244&\005\351 \006\244\223\230\363\364YW\267\233\271\340\033\303\355{b\271C\312\010v\265\222H\022I!\005UUb*\252\252\336\265\356\020\237\003n\327\223\266\246\320\207'&\335\rkf\223\2733Y\260}\034gT\243\324IR\261(f\360\032\226\313\003%\205m\t#^^kz\221\014\3220\275\352L\234\346\323\234\314\034\231\206O\205\242T\231\251H\206\260T$\366\203\025\030H\347V\262\030\2467\244\257F\035I\242\322\217s\177I\216\377P\222\333\0203\000.\351\207'MX\204\010\010D,\266$\210\341\364+\226%C$\020\373\254\203\2450&\010*H? h|\273\216J9}\232[\006\202\375\252\217\256\010d\344;T;\361\316\3058Pm\253Y\230|\315\303\330\256\3406\001E\212\014\024\200\004+\000\266\376\233@\346\357gl\014\363h\204\301\262\335B\0204d\241\256\365\355\215\007u\320U\270\2579\327\2549\233\302\362\001\326\230S\311h\265\016\251\307%\322b\t,Z\306\201AP2&\244\341v`\261c\006\2735\344i3\017\020@g\000$\346cn\375\357\010\341\004\213~\312\020BL&\320(\220\210\350\333\014\260~\367+l\013\023\033\220\305\376\005\243j\253\244k\267\014\316\312\216\t\205\211W;\206\204L\3273\355\210S\271\320U\211\343,q\033\304\352\2513wRR9\235n{\263\271\023Yn\t\222I\226\201\201\330\241L\201\320\241!jF\207 \344>l0$Uw\234A\351@\"!Z\000\222\215(ZI]/\230\210SMO\030e\214\360\037V\352\335\347\320\027\252)\247\016\035Whj\252\240 RN\340iB\333Y<\001\266q\003~kg4\257Q\tN\221\334P\255\237j\006<\250\005U\312\000\230\204\020 `\211\335\312ZLoxW||\202\370\324\014\034ss\322\367>Z\034,*\352\032\304\230f\375hv#r\373\251\2468e\200(\222\321\000\330:\340\007\333\343\257F\265\361W\270B\365\014\303\226\372]\372\316^\316\303`\274x\205\271\241[\024\204\276\341w\033`\224J@\0039k\364l\016(\226\311\303.""\210\023h\204@)\022@\220\335z\327'\013M\367\350\3504\245\246z\325\372\343\206\233F\243\215\366#\240N\033\002\0359\033\201\2248A\304\237\n\201|C\307\253\334:\256\372\336\223\215N\017\235N\036\215\210\354\001\216\304s\233\010\200D\240Bm\035\372\2051\r\312{{6\001\264z=\203\221\234T=Eh\241\333lf\230\300\033cX\212\344\241\233V\256\226\311TOP\3154\355JQJj\331P5z\221{\337\023\262\234\246\334\r\273\304;5\355$\016:\nj]\030ED\3748 4\223m\006\206z\205\320\210'\317\274\3043)\206)\266\371\ne\334\253\273o]\236\"\237\r\371{C\261;C\270\261o\207\2347\034\002\014\202\022!'\214\357\r\023\177\207\220\007!\010\002\316\372\r\207\023\032\210\013y\3219\312\216z\365\236\261\210\272\343\335\377B\354\353\312\350\030}\260m\334\267\270\r\320\t\327\266\036J\342\314\311\016\220p\303\231\000\007KY\322\260\316-\260\266\311QL\242\210I6H\300m[5\202Y_tB\013Be\016x\326\344-\262|\332\305\273\360\343Pt%\253J\322\203YNq6\344T\272\264\202\024E\310\202\227\230\340\360\306\243a\324\000C)EU\"%\002\"\003\304\224\002\024V\001\202\025\2138'\211:\016\311\014\346\345AD\352\240\264P\036\254\201k\247l\364 \025\305x\025\003\335\014-\241\345\014\342\251pK\305E\204D\221\022\001\346\330y\274\001\033\032\205Z:\354\355x\276\204$\213\273\331\246]|\366\245\251C\227\r|\313\250jI\326\323\257o\010\345K%\010!y\300v\341\257a\330\356\252?EC\t\273XZ(\201\323L\255Z\326\247E\306\213y\211\0143\371\214\365\356\370\334h\236`\361;\373\341\363\301y\t/,!S\n\273\260\2610M\206 &T\311\001(.!M@\3363\020\273\024\322)KIH2f\303\225m=\323\216\214\"\305^\244xt\026$$\n \003\353\367\253\200\205\013J$hl8VT\024\247\234\324\222\201U\272\304\371\\T \036J\001\004F\n\004E\266\263\317C\031$\211\033eK\212\262\324x\361\337\323\305>\235\372\252j\3157\221\220\356\206\277\nH.\333Q)\1779_\005]\352\264@0Lq\227\245\260\026\350xI\t\n\311-\22501J\233A\024\235\035\306\275\265\342\366\351\252\0268H\304\305\250\360\001VY\343\232\252\000\365*\341|K\3555(I$6\261M\251j""\327\261$\205!%\257\177O\265\314\252\246\302\376\001E9\366\371\360\251\321\273Vx\343\215\213\026\331\324u\017.I\310;|\327>\257xg\270\207\205:\3437(|P;&\003/FI\200aC\236\304\260\321Hf\320\200(\306,$\017\010\020\240\211\005\010\340H\261.\201\302\310\005J\213$$$\307\032\344)/\252\024Z\356\201\211\271\320u\351\263\255\270\361\314\263\016\271$\227\251P\001\341\337jR\272\004LA\324\341\237\014\240\303\010\256\341$\222\224\013\027\300g=p\r{,\363j\210\000\341\n\321\221\231\306\235\3329\343\343\310\003\210\234\200\344\247+\026\r\201\303\347Z\036\312\206\340*\304\017f\275\207\302C\216(q\204H\023\024\0055\304K\212\247x%\365q:\202\350\314`@+\341\274\372\007o6\202\035|\322g\365(\356\227Y\207\252\252\023\242\300_\301\007\233Nn\300\334\035\356\254\3467n\362:\037\020\300\000\366\300\016\325_\241\262\217\322U\240\021BQ \260\220\220\223v\035,\236^{[\223\357\337\200\363\256\343r\233\311\024#z\271\244X2\302\374\000\321\nE\034=B\000\213\341s\212o\277\324\007\230\204X\014\207\366\210\304\021PR\002*1|\260\363d_\326\037\231\"\303\344\301\024\201\341\t\"\320@\300\236\364H\237q\240\327'9\321\354{\002D\020?#\010\037\304\223P\302\236\264\202D\004\n\177\302 \025\204\235\341\377\277\241\177k\217\243\367\032\303\004%\027\315\023\317\037o\237*f\301\331a\037\341\244\265\364\322\206\n=\000\344\362aKrS\007 hd\335.:\3767#\344\240\377\234\247;F\335\222,\0142b+E\233?T\247\010\302%!l\031\366\342b!2N\361N\036\361N\031\020\007i\\F\002b\324\301\r2\"Q\213\230\230\252!\352p\234\021\036\tA\243p\206\255\265\351`\351\313\341\031\027&\212p9""\347\257V,b \304I\343%\305\224.m\274M08L\301\033\\\035\252\246r

#\274\313\276%'\023\030y\364|\031j\177\342\356H\247\n\022\031\220\371\230\000"; + PyObject *data = __Pyx_DecompressString(cstring, 5064, 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 (5082 bytes) */ +const char* const cstring = "x\332\345\034K{\322\332\326\326zl\217\034\205\226>|\207Zm\253\205#P\337\367x>l\365h}\\\261\276{*7@\332r\344\231\004\333\036\365\373\316\260\303\0143\3140\303\014\0312d\230!C~B\177\302]k'\204\000\t\320\207\026\357\365\323dg?\326^\357\275\326\n\321\027\212r\330\212\006\035\335\327\325\231\216\014$\272\263\351\204\275Ww\025\307\037\214\240\274V\222\272j\222\304Uc\374\252\345\270\245s\265\236\340\337\351)\330d\214\330Q\013,3\335`\225\263;\ri\272\307 \255\323\265\331\216""\307gM\343\263m\340[\215[\257\237m\263\276n\377}?<\203;=8\003?\206\374\275\301\035\034\233\301v3\374\235O\330\243\251k\321nWXzp\307\306Not\217\261\007\333\310i\326r\334\337\336\207\357W*\207e\233.\257\211\035\330\257\231\233\270\272\276\226\210\255Q\353,\235\005\306Q+\372\217\320\2518\263\222Hk\274fL?^\247\222\231\325D\254\236\211\334w\340\"\240Cp\233\242g\250\350tmC\237\317G\356,\303\347\3314\025\245\356Rt\007\354GP\260\221\261\2515\206&\306\232h\370\014L\275\215\301\024\260\3646\025\370\372\363\017G}\363\227\006\204!\323\373\306\221\2753\2040\301\036\037\203!\0333\324\246=C6(\317o\324\346\3368b!\216}1Md\027=\211\246\031 \214\323\374\240\306\304j/\214\353\006\373\004c\317T>\311'\262\311\004\303\032\237m\300|\232\243\022<\376\352\017-\225\247Y\330\263\366\312\363\251\261\244\366\251G:\237\212\302s\363X\212\346\301\025`\221\301\344K\323q\352\212\237P\246\301\366=\313@\300@<\360\334&\277\006\256\002\266\2163\311\004\300\204P\0022=\340`\"\306\003""\2220)M=\277\377\334;{s\226\000b\231\277\230\030\217u\214(\3712Fs\337\321|\002\020\001?\275\231e8\037\365h\205\332\314\344\2514\303\3041\024\311\342\0274\246\005@%q\344\204\334I:\235\316\3604\3627\002\313\301_M\352\237\310\200\277\307\325\017\350$\307\370\376\235\305\031tri\221\311\345\231t\214Y\2566\226\000\331\345Wi\030]\002\241\317P+\311\014\315/\277a\361\333\034\266\346\r\221\374l\"\366\221|\250C\010\004\317h\372\244G\343G\225\3011\362M\017\240\017CX\252\261\370\262'I#\2032i\337\357\240\210\021\240\201\251A\373\325\374\255Pv3\236\340pW&\215\327\325X\202\323Z\361d\202\343\227\370<8\340e\353\267Z\326\275\276H\004\277%\212D\232_&4\367\030\223\347\340\212\273\266\372\\\251\325X\rP\353Ip\346\3608\251\006\323\002\202\321\005bY\247\331\370\334\032\023\373h\352\206\263\037|M\214\3418\213L\326\242\313\000\335j\314\367\257d\006Z\334]0\3524\263\221e\255'k\004X\215\265\304\3124j\275Q]\351\250\271\247\236\204\306!\023R\365C\265]\233\245\321B\210-D\327\020\3304<\032\020\232\373-\227\233\020l\ng\233:\014\340\366#M\274\265\232\252a\322<\322\002\227V\342k\254\3735>\233\321\266\026\\\323\200\t\223\306\224\266\251\243\006\336bD\207\3374R\267A=\366\r\317f\3606\3307\016\324\2007\277\031n\35616\260\034\322\266\260\030\252mRu\376\221\310\363\315\r\3707\017\207S\344\031\263\301\277`V\252\307\200\305\007\206\026]\006*\326c\032.\326\237\302Y\367\326\001lA\337\2534\234}\211\3254\023'GU\213/\212Z\014\331\033A'\213Z\317\321\320l9\007B\207\210^d\210D3\371t\234k9\235\243W\230\352\374V\023kr\266\377\231\254\375\2105y\326z\334\232m\326kZLi\3411:Ze\373\033{\333\201\366\n`\277\244\325\214zR-f\330\213\336b\262\225\340[\371[\273_i\331\365[\221\264C\201\333\256\260\235\320\201\260[\254\261\375\322\311v\240\003Q\333.i5\243\201\314\346\031-D\335<\331R\324-\316\"\273\237\307\332\365[\221\264SQ\333\255\260\235\320\211\250\355\327 \272\032\337\310\377\016\020\257\372\375H\265at \337\352\036\200\211\332s\n\342}\216\3466\323\261D\306\027\313\260\031\310?\323\014\027\215f2I\rv\254\312\230\030de\2118\344""\"\034\2641\301B\001b:\213\217\260\010\210\215\340\177g\300D\351\330\307X2\303A\232\222L2$\370\343|t4VKU|\246\254\305\324\033\317\244\340^?\306C\203\213$y\177\034\217\342H<\023\303KJ\233\252]u&\350\0178Okr\344ub\204\\\311\005)\217\030-\322\200\0046Rm0\033\261d>\316D \2415'\013z;\246\265a'\314\364\"\344\242_u\221\241>7\353\364Zb-\021g^c\001\022\020f6\252J\021Ip\021\203\341\244*\000\027\226\007\276s\311\014\360\224\020\003\327\r\370\033!?N\346\260\205\010\247\022 \273\364*<\022\212\364;\334\310 \271\301\365\023\2061)\206\2475a\301\2524\374\255\202\202\226\031T\"\255\201\322\356p\323\006\361\006W\000eL$7\024H\265\231fViL\241a\007\240;\twh\261\231\010h\026\233@e\251\225\"j-\316\324\313\245#@i\232N\301R`$\260\000QDB\364FB\373qv\225\261\234\366\2247\002\035\355\031\304\306\325\026iO\372\312Z?\351\313fi6\305e3\331l\006 \200\221\021\026\032m\230Pm\343\216\\\315\342\"\320\301\300b&BF\364Q\202TU\350\270o\025\317H\0043d\2150\226Ie>1,\252D\235/\343 Y\347\230\344\nd\352q\016\224\007\377\221\213\266\014Zqf\205\006^!\257\223\214V\310\346Y\220\013J\250Fk\375S\223;\301am-i\260\034\2174\363H\254V\252A\243\252\265h\243\033g\351-\243\217\0002\332,\350n\226(S\004|\003`\317\257\261\231u\255\302b\022\222U\213`R{\254V\222>\301\006d\017\rc\350\306\211h0\206\256\3413\232\003\271\243\202j+#F\303\354:\214\316\365\004\277f\356\340>\231\234\315\306\337\211\254\332w^=\037P\274\205\334\366\340\241\201_\266\036\013\271r\277Cu\234\021Cp\337z\"\366\264\237A\036)\251G=tN=w\273\340\251\364\035\333\nn\255\na\265\317\243zf\225\247E\227\266\364\251\350j^Z\007\241o\\\035\277\246^{X\372\251D\227\373\217m\315n}\021oH\236\262cH\360W\372G\205\317\222G\232\225\000\201\323\242\277\334\177J\364T\000\300\037\302,\340\3448\261\305\013A\201.;'\244\307rN\351\2518\317\213\353\022-\345*\000\3506`32%\367\224\035\347\305\274\024R/\336PH\377\354\026\254\034R\207&\2449)\267\375\323\241\201\223b\257xA\014\213\253RXb\344\240L\313\353\n\255\344\013\363\305#\305p\271\177X\010\013q\321'\367\310C\362\274rDyS\270W\210\026\373""\212\363\245\276\322\274\372\374\265\372\372M\031\360\344\324S3r\250\326\302\255~\003\310^\211\223\275\n[p\021\212\266\307\017\r8\267r\235S=\206\254\002\024\254\250\366H\247\345\220\034\2568O\211\223\222K\362\324\250\023\356JCRh\277\210;)\272`J\257\177\251\276|\253\276\375S\375\363?\352\177V\324\225\325\n\231HW\234'\305Q\251\007Pp\272\205?\304\353\320p\203\236\211\037\344\200\374R\031T\002\312\313\302p\201\306]\303\345\261s\342_@\245\013\021A.\272A\235*\375'\232D\341\026\346\221\3430P\356\037\024<\345\376\021\201\256h\004o\361\352\320\214<'s\212G!\304:@\251\235n\325}E\276\241\\)\204Q\263\027\324\221KRLv\311W`s\027\312jS<\014\212\353\034\023\217\001WB(\253*3t]-k\272*\254\0004\340\3455\261G\034\021\321\340\266\346\205~\261O\274\017\242|,\363J\020\344\366\2658WdK\356\322+\365\0050\345\025\341}\271\312{\202\316\220pK\374C\372\227\234W\036\025\336\024\237\250\317\027\325E\224\242\372&\256\306W\325\3255d\307\033)$\205\313\3561q@\032\001\004\306N\213\327\244^\351\022\210\330S>3.]F\255*\273G\005\0360\037;\217\31042\252\242[1!\360(\314p\216\n\304\230\206\204\tPM\215\177\372\024\267\360X\314I=vt\236\330\312\013sB\243\034\006Mp\272A\016\207\305\240H\213_\311\266\023\nS\010\300>\007\306}\344F\\\324\355\335\306q\270\205\020\341\234a\232G\204\017R\020\010\345\345;\n\255\231\001\0078XzP9\026\3044XXN9V\360\343&\233\322Q4\020CE\316\210\217\244\327\260\335\231\363\"/\005\240\031\220\227\n\275\005O\231\272$\375\245\364(.\263\220+f\2434Q\227;\020\312\236\200\003\354\214\242\260%5\272\340P\272\254zr\032\216\353G\340\331\334\205\027\352\357\377.q\352\213\305\212C\327\245\006\2658\276\025\027\252\n\340\024\214\360\253\346\021O\212\247A\341\336\243;\2558k*\202\024\022\005\275&\376$\306$7\250\344C\345\036\350899\211\342\362b@|\013\034\320N\323*\321}\322<\270\262Kx\272\303\201\340\032\356\200\364O\250\3576B4\360\270\016:?\217\240\364\375\257\203o\231\025\365\275-\\d\307\204C@tp\204/B\200\272\317\204\353\216\300%\270\205\260\356\010\010\023\210#\330\225\371\353\247B{k2\235\010\0142fP\270(\344\320qi1.\253\272<\322\240\356\177\021u\014dW\355|p=\t\373\341\306vi\341\271\356qW\373M\301\336\335R\243\376m\373\364\014\347\202z\341\272Bo\037\3074\360\031\nOK\003\253\003h\217u\335\023\352\304\r\365\306\202\272\300\250\314\312\366\245C\003\016\022\354}\306\364\245\354@\0341\324w\014\013o \306\017\243\360\007H\200\246[\244_|\014\022?\205\222\320\323!\\\264.F\245\237$\032\217\317\036\361\2444)\017\312\327\025W\303f\250WW\340p]\2018{\263\360K1\214\201\354/\252\203`i\312\\\035\3470\215\202\235U\347\244\264\016\251T\316:\324\374J\344\347\204\034\363\":\266\212{\0303T\222\216\rk\351E\325\025\251'\220\345G\344\227\252\177\256\030,B\000aC\341u\022H\031\224\r\237\206p4\n\036gA\216\201@\252\375\007G\227\036\366\357\033]\017I\354\326)]\230\307\"\354\227\240 \340\353\017\013~\214\320\214\204yL\374Ez\251N\377V\010\027\022\305/\352\342KtL\223`1\036-e\305\000\014\222i\2274!Ee\2072Ol\024\220\203$[\035\235\224X\260\0107\252\022-\346:""\341p=/\254\251\036\022\357\211qi\nR\352P\307TVj\241\251U\350iJ\206\037\211\257%\342\221>A\276\375\0316A'uT\311\025\372\n!\314\204WI\372\\\213B\215\245g\301\027\367I!S\243C`\355\306\333K\020hSO]\221g\325_\357\025=\305k\245\303\020\366\207\214p\026\231\331+^\306\222\215|\224x\334@a\251\324WZP_\353\231\225\272\306\251\034\337\371Lb\013[\013B\232\314<\206\231\244!\252\263\342\007r\246\374]t\027\233\037\033\324\367\016(\315\tR\3401\324\330vD\333\264\031\301\017\245`\211.\255\223L1\252F\001\321\217\352\307\224\232\312\251\271\317\333\207\016}\351Y\350\205\333B\357S\274=\355}\206\267g\275\357\360\366\256\367}\2575\325{\007\212\025\272^HH\347\225\201\202\253p\271x\257\030\005N>Q\337\276\333\265<\367C<'\305s\244\357v\341e\321e)\217c\244\370\363\315\371\276k.\350\201\3157\320\325\266\312\371\355Tp\367\332R1'\335\271r+\307\324\241?j\277\343\030\226\255\010L8<\026!:p\231\032\306\3211*|\221f\325\311;\005\177\341Q\361O5\374\302\312\241\237%\220\357I\037\225\021\302j'\226v0\213_V.(a\255,pC\034\207\000\205\223'1(\265w\371z\322\322\362\354\030\305\230\315\210q\352\002\033\364\227\270\323\203]\202\036\022C\035\201\276\251\336|\013r\005\240\352q\217F\310\315BO\005\366H\212\036\321\257\366]R/\335Ro=Q\237|P?D\266'\016\r\234\023\303\345\246\232!D\022$\304(\273\247e\027\204\023\025\214\034\306aG\027&P\247\252\302'U:\243\\\006Q\247:q\033Nh\022\206\362\222\237\310\264\307T:\323k|\346R/\211S\245\220\034\372'T\031r\227]\203\345\341\221r\377@\331=\274}\027\243\262\220\236[8\266\356\013$\326a\205!\350tjlZ\302\250\270\342\254\362\014\223E4#\307\326M!\000v\354\300\242\36118\213\343\220\375\365*S\030=\270\205\247\240\002\017A9Ye\010B\n\320\271\342G5\374^}\277T!\211\017\211|\376\tm;\320\034\037\n\315\210\241Q\320uET\244u\001\302\"@\357\013\226#\313NL\007\\\030\232$\345\tyE\231S\364@\237\274{\350\023\237\240u7\024'\375\246\022$j\367\r\331\243U\031\315\005\311\353\250\2765\216\"\363\376\t\031U]\302\"R_$\375Mx7\026\177Mx\177B\026\232t\rE\003\274\n\t\357D\332\252\224\352o(\230\272,\260#I\212\277LMJ""\325R\351\031L\200\266\335:g\021\227\007\232p\027 \242\353\243\244\036\215\353\344U\227\371\21181\210\216!\241\001G\3510g.\320+\205\013a1\214\357\270\316\212\257po\204\370H\363\343OE\027v\277\207\024D\177\363U\033\220`\350\202\364\273\362k\361,\244G\356\032TcK\210\305+\325\372\016\004\235\302W\360\314\234\354!\245L\016\264\311\341Q=\013%R\211\274\003\341\361aP5\260\032\265\357W\214\324]\202\331a\031/\207\\\030\344\242\317\243\215\222\206K\213{\007I)\233\224\036\264R\255\376\316\010\226\241V\217@\362\036%\357\035F\365w>}\240\277}\205\007ER]\364\203\256\037\207\250\223\003\215c\024bX\234\340\001\274b\232\037\000\234*{\306i\330\300\301U\336_\004\377\013\037\367$B"; + PyObject *data = __Pyx_DecompressString(cstring, 5082, 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 (25233 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.Optional[Sequence]Sequence[str]Union[int, float]Wrapper function for picklable string constraints that must be compiled into a FunctionConstraint later on.?add_noteconstraint/constraints.pydisableenablegcisenabledlist[tuple]AllDifferentConstraintAllDifferentConstraint.__call__AllEqualConstraintAllEqualConstraint.__call__CallableCompilableFunctionConstraintCompilableFunctionConstraint.__call__CompilableFunct""ionConstraint.__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.preProcessOptional__Pyx_PyDict_NextRefSequenceSomeInSetConstraintSomeInSetConstraint.__call__SomeInSetConstraint.__init__SomeNotInSetConstraintSomeNotInSetConstraint.__call__SomeNotInSetConstraint.__init__UnassignedUnionVariableExactProdConstraintVariableExactProdConstraint.__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__Variab""leMaxProdConstraint._get_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_boundsappendassigned_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__throwtyping_unassignedunassignedunassigned_varsunassignedvariablevvalvaluevaluesvar_var_is_negative_var_max_var_minvariable_variable_contains_lt1variable_with_lt1variablesvconstraintsxzip\320\004\037\320\0372\260-\270q\360\022\000\t\r\210K\220q\330\010\014\320\014\034\230A\330\010\014\210L\230\001\320\004\037\320\0372\260-\270q\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\000\036\320\036:\270!\340\004\013\2103\210g\220Q\320\004!\320!4\260M\300\021\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\"\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 \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\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\"\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/""\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 < 295; 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 = 295; i < 351; 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 < 351; i++) { + if (unlikely(PyObject_Hash(stringtab[i]) == -1)) { + __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = stringtab + 295; + for (Py_ssize_t i=0; i<56; ++i) { + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + } + #else + 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 CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + } + #else + 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 : 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 ); @@ -48647,394 +48419,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), 425, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 432}; 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), 442, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 449}; 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), 443, 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[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), 607, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 614}; 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), 618, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 625}; 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; + __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), 786, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 793}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_m}; - __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__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_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), 797, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 804}; 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_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_A, 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_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), 862, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 869}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_value}; - __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_Q, 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_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), 891, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 898}; 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_2, 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_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), 1005, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1012}; 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; + __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), 1006, 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[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), 1174, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1181}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_p}; - __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_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_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), 1214, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1221}; 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_k_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_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), 1243, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1250}; 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_2, 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), 1361, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1368}; 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_3, 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), 1565, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1572}; 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_k_Q_4, 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_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), 11}; 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[16] = __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[16])) 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), 36}; 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[17] = __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[17])) 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), 64}; 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[18] = __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[18])) 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), 133}; 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[19] = __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[19])) 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), 145}; 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[20] = __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[20])) 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), 201}; 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[21] = __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[21])) 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), 205}; 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[22] = __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[22])) 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), 220}; 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[23] = __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[23])) 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), 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_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[24] = __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[24])) 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), 294, 49}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 301}; 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[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_4M_M_A_L_L, 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_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_4M_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, 22, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 309, 378}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 22, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 316}; 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_k_77JJeef_QfKy_Q_d_4_B_5_1A_4q_L, 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_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, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 332, 535}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 339}; 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_k_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; + __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), 409, 86}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 416}; 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[28] = __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[28])) 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), 428, 220}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 435}; 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[29] = __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[29])) 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), 450, 347}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 457}; 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[30] = __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[30])) 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), 518, 34}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 525}; 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[31] = __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_L, 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_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_2_q_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, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 531, 219}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 538}; 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_k_77JJeef_QfKy_Q_d_4_B_5_1A_L_Cq, 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_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 = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 547, 195}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 554}; 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_k_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; + __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), 591, 86}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 598}; 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[34] = __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[34])) 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), 610, 114}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 617}; 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[35] = __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[35])) 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), 623, 184}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 630}; 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[36] = __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[36])) 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), 667, 42}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 674}; 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[37] = __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_L_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[37])) 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_2_q_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, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 681, 253}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 688}; 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_k_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; + __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, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 699, 445}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 706}; 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_k_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; + __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), 770, 86}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 777}; 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[40] = __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[40])) 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), 789, 114}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 796}; 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[41] = __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[41])) 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), 802, 184}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 809}; 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[42] = __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[42])) 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), 846, 22}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 853}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exactprod}; - __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_k_N_6a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) 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), 855, 216}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 862}; 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[44] = __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[44])) 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, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 883, 297}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 890}; 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_k_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; + __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), 931, 25}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 938}; 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[46] = __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[46])) 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), 941, 161}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 948}; 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[47] = __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[47])) 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), 961, 24}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 968}; 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[48] = __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[48])) 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), 967, 167}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 974}; 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[49] = __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[49])) 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, 20, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 982, 246}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 20, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 989}; 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_k_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; + __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), 1045, 14}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1052}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_minprod}; - __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_k_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[51])) 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), 1053, 92}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1060}; 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[52] = __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[52])) 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), 1064, 95}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1071}; 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[53] = __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[53])) 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), 1097, 23}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1104}; 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[54] = __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[54])) 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), 1101, 148}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1108}; 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[55] = __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[55])) 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), 1119, 24}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1126}; 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[56] = __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[56])) 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), 1125, 138}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1132}; 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[57] = __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[57])) 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), 1138, 395}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 31, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1145}; 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[58] = __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[58])) 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), 1198, 22}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1205}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_maxprod}; - __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_k_L_6a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[59])) 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), 1207, 216}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1214}; 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[60] = __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[60])) 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, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1235, 287}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1242}; 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_k_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; + __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), 1284, 23}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1291}; 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[62] = __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[62])) 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), 1288, 148}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1295}; 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[63] = __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[63])) 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), 1306, 24}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1313}; 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[64] = __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[64])) 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), 1312, 138}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1319}; 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[65] = __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[65])) 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), 1325, 395}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 31, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1332}; 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[66] = __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[66])) 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), 1380, 11}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1387}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set}; - __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_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[67])) 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), 1388, 14}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1395}; 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[68] = __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[68])) 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), 1392, 91}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1399}; 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[69] = __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[69])) 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), 1414, 11}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1421}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set}; - __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_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[70])) 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), 1422, 14}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1429}; 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[71] = __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[71])) 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), 1426, 91}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1433}; 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[72] = __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[72])) 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), 1448, 30}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1455}; 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[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), 1462, 249}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1469}; 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_AZs_1_1_t1_5_c_WH, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[74])) 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), 1510, 30}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1517}; 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[75] = __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[75])) 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), 1524, 249}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1531}; 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[76] = __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[76])) 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), 1563, 17}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1570}; 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_k_3gQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[77])) goto bad; + __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; @@ -49047,27 +48819,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:; @@ -49108,7 +48895,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; @@ -49149,7 +48936,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 @@ -49208,7 +48995,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); @@ -49218,7 +49005,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 @@ -49257,7 +49044,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) @@ -49270,7 +49057,7 @@ __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)) { + if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) { Py_DECREF(res); return NULL; } @@ -49313,7 +49100,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) @@ -49361,7 +49148,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); @@ -49496,120 +49283,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; @@ -49629,7 +49303,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; @@ -49649,7 +49323,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; @@ -49704,38 +49378,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) { @@ -49748,7 +49400,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; @@ -49833,6 +49491,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) { @@ -49887,7 +49660,7 @@ static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObje } } -/* ParseKeywords */ +/* ParseKeywordsImpl (used by ParseKeywords) */ static int __Pyx_ValidateDuplicatePosArgs( PyObject *kwds, PyObject ** const argnames[], @@ -50043,16 +49816,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) { @@ -50066,12 +49846,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( @@ -50243,6 +50026,8 @@ static int __Pyx_ParseKeywordsTuple( #endif return -1; } + +/* ParseKeywords */ static int __Pyx_ParseKeywords( PyObject *kwds, PyObject * const *kwvalues, @@ -50288,7 +50073,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; @@ -50345,69 +50130,77 @@ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { return r; } 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_ASSUME_SAFE_SIZE Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } + if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS)) { + return __Pyx_PyList_GetItemRefFast(o, wrapped_i, unsafe_shared); + } else 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_NewRef(PyList_GET_ITEM(o, wrapped_i)); } return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(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_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } 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; + return __Pyx_NewRef(PyTuple_GET_ITEM(o, wrapped_i)); } return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(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); + if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)) { + return __Pyx_PyList_GetItemRefFast(o, n, unsafe_shared); + } else if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + return __Pyx_NewRef(PyList_GET_ITEM(o, n)); } - } - else if (PyTuple_CheckExact(o)) { + } 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 +#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)) { @@ -50426,6 +50219,8 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, return PySequence_GetItem(o, i); } #endif + (void)wraparound; + (void)boundscheck; return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); } @@ -50523,7 +50318,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); @@ -50602,98 +50397,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 @@ -50920,7 +50685,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 @@ -50935,19 +50700,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 @@ -51036,9 +50796,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)) { @@ -51051,22 +50818,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); @@ -51076,12 +50844,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(); @@ -51098,7 +50866,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))) { @@ -51217,7 +50985,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) { @@ -51268,7 +51036,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 @@ -51302,17 +51070,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_GetItemRef(iter_obj, pos); if (unlikely(!next_item)) return -1; - Py_INCREF(next_item); - #endif } else #endif { @@ -51334,7 +51093,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; @@ -51403,7 +51162,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)); @@ -51451,7 +51210,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 @@ -51650,8 +51409,8 @@ static void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } -/* 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); @@ -51659,9 +51418,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); @@ -51752,7 +51510,7 @@ 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; @@ -51797,6 +51555,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 @@ -51816,7 +51596,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; @@ -51852,7 +51632,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; @@ -51909,14 +51689,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); @@ -51931,11 +51708,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++; @@ -51967,13 +51746,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; @@ -52143,38 +51925,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; @@ -52185,14 +52050,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); @@ -52232,20 +52102,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; @@ -52254,7 +52120,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); @@ -52327,11 +52243,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); @@ -52357,26 +52275,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 }; @@ -52387,13 +52318,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; @@ -52419,15 +52351,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; @@ -52449,17 +52386,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 @@ -52474,6 +52410,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]); @@ -52502,7 +52441,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)) { @@ -52654,9 +52593,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)) @@ -52665,36 +52606,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) { @@ -52956,8 +52868,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}, @@ -52978,9 +52895,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}, @@ -53036,7 +52955,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; @@ -53090,7 +53011,13 @@ __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); @@ -53138,7 +53065,20 @@ 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); @@ -53250,7 +53190,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 @@ -53289,7 +53229,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; @@ -53311,11 +53251,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); @@ -53350,11 +53286,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); @@ -53389,11 +53321,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); @@ -53424,11 +53352,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); @@ -53453,7 +53377,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[] = { @@ -53482,9 +53411,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 }; @@ -53533,7 +53463,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 @@ -53575,7 +53505,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; @@ -53754,55 +53684,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) { @@ -53954,8 +53873,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); @@ -53964,7 +53882,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; @@ -54072,7 +53994,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 @@ -54080,10 +54002,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 } } { @@ -54166,7 +54086,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)\ @@ -54262,10 +54182,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 @@ -54334,10 +54252,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 } } { @@ -54516,10 +54432,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 @@ -54588,10 +54502,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 } } { @@ -54783,7 +54695,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) @@ -54798,7 +54743,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 @@ -54865,7 +54810,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; @@ -54919,7 +54864,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)) @@ -54942,7 +54887,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) { @@ -54996,7 +54941,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) @@ -55679,7 +55624,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); @@ -55880,7 +55827,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); @@ -55969,7 +55918,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[] = { @@ -56003,10 +55954,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 @@ -56038,36 +55990,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; @@ -56151,9 +56073,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 @@ -56165,10 +56091,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; @@ -56189,11 +56115,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); @@ -56216,11 +56143,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 @@ -56228,30 +56154,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 @@ -56473,7 +56437,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/domain.c b/constraint/domain.c index 4278eb8..5000b2f 100644 --- a/constraint/domain.c +++ b/constraint/domain.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.1.2 */ +/* Generated by Cython 3.2.4 */ /* 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_4" +#define CYTHON_HEX_VERSION 0x030204F0 #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,6 +888,22 @@ 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 +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 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) @@ -907,6 +921,12 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #else #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) #endif +#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyList_GetItemRefFast(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_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(o, i) +#endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) #elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS @@ -966,15 +986,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 +1092,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 +1140,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 +1351,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 +1387,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 +1412,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 +1422,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 +1438,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 +1454,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 +1471,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 +1487,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 +1517,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 +1601,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 +1609,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 */ @@ -1697,19 +1654,10 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #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 +1667,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 +1726,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 +1788,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 +1832,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 +1853,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 +1884,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 +1968,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 +2021,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,26 +2046,83 @@ 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); +/* 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 -/* PyDictVersioning.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) +#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) @@ -2086,7 +2133,7 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj 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);\ @@ -2125,14 +2172,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 +2222,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 +2279,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 +2350,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 +2381,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[61]; /* #### Code section: module_state_contents ### */ /* CommonTypesMetaclass.module_state_decls */ PyTypeObject *__pyx_CommonTypesMetaclassType; @@ -2418,6 +2397,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,15 +2430,15 @@ 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] @@ -2467,15 +2449,15 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_diff __pyx_string_tab[22] -#define __pyx_n_u_doc __pyx_string_tab[23] -#define __pyx_n_u_extend __pyx_string_tab[24] -#define __pyx_n_u_func __pyx_string_tab[25] -#define __pyx_n_u_hidden __pyx_string_tab[26] -#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_diff __pyx_string_tab[21] +#define __pyx_n_u_doc __pyx_string_tab[22] +#define __pyx_n_u_extend __pyx_string_tab[23] +#define __pyx_n_u_func __pyx_string_tab[24] +#define __pyx_n_u_hidden __pyx_string_tab[25] +#define __pyx_n_u_hideValue __pyx_string_tab[26] +#define __pyx_n_u_init __pyx_string_tab[27] +#define __pyx_n_u_is_coroutine __pyx_string_tab[28] +#define __pyx_n_u_items __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] @@ -2494,9 +2476,19 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_setdefault __pyx_string_tab[48] +#define __pyx_n_u_states __pyx_string_tab[49] +#define __pyx_n_u_test __pyx_string_tab[50] +#define __pyx_n_u_value __pyx_string_tab[51] +#define __pyx_n_u_values __pyx_string_tab[52] +#define __pyx_kp_b_iso88591_1_q_s_q __pyx_string_tab[53] +#define __pyx_kp_b_iso88591_A_G1D_D_D __pyx_string_tab[54] +#define __pyx_kp_b_iso88591_A_G1F_HG1A __pyx_string_tab[55] +#define __pyx_kp_b_iso88591_A_HA __pyx_string_tab[56] +#define __pyx_kp_b_iso88591_A_HG1Cq __pyx_string_tab[57] +#define __pyx_kp_b_iso88591_A_IQfA_Kq_Kq __pyx_string_tab[58] +#define __pyx_kp_b_iso88591_A_t1 __pyx_string_tab[59] +#define __pyx_kp_b_iso88591_A_t84s_Cq_1_q_HAQa_HAQa __pyx_string_tab[60] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -2508,19 +2500,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<61; ++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 +2528,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<61; ++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 ### */ @@ -2695,7 +2691,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 +2744,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 * """ @@ -2829,7 +2825,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) } } @@ -2970,7 +2966,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 +3027,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 +3043,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 +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, 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 @@ -3143,7 +3139,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 +3200,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 +3217,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 +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_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 @@ -3318,7 +3314,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) } } @@ -3462,7 +3458,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 +3562,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 +3581,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; @@ -3688,7 +3684,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 +3745,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 +3873,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 +3935,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 +3966,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 +4092,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 +4122,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 +4145,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 +4175,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 +4190,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 +4205,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 +4225,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 +4263,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 +4278,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 +4293,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 +4308,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 +4323,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 +4338,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 +4354,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 +4392,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 +4425,25 @@ 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 CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + } + #else + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -4501,33 +4454,106 @@ 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},{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 (644 bytes) */ +const char* const cstring = "(\265/\375`)\003\325\023\000Fbk2`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\013T\000Y\000T\000\357_|Q;\235=\301\366h\232>K\257\221\324n\221\337\343\323\310?\333\304\202\220\333\373\257\330j\3515\343\3611H:u\356\311:U\257S\352\373\203\032[\022\321\203\003\215\363\233SF\352]A6\321\206\237\347.'\205r~\224M\345\253k\257\324\235\241EE\274;\247\236!\256\343\310s\347\010\022\265\307\237\364\306~{\235\023\213c\367\333{J^=\377\307$\247\220vO\332\335\325t\254I#\361\361\361|\377\250\305 \315\370\354\221~\027Y}\276k|\014'W\301\314\267&\371H\311YR+\362s\315@\236\244?\351u$>\007\2112\355v#\330\036g\365=\333D\202zB\256\250\335\311\r\342\330o~\354\225\263a\345$\177\357\356:\250\377\255\307v\033\253hw\267I\267\033E\317iJ\032\177\272\361\374\205\3155|\023H\266\215\336\226\264\226\032\224\362\343\035\337Wr\312\246\221\257E\313\331\305\236\246\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.*\276\373\317\357\373\260\342(d\250Q\231\202\210!\023MRR\310t0\206(\207\314<\260\352\2064i\014HT\300\214\347\317\337\367\337\2255\202k\\o_U\023\315Q\326\005z\037\323\002N~\314\\\323\241\300n\231!\276\376z\333\247\026\320\227\201[B \201O\034p$\026,d\017\020!\022\016\"\260\264\310\373\252\001\035\313L\227\302hWoh\241\322\020\035\316\215\022\264\307\t\014\0262\320\334l\000(\257\213\334\272\355\303\0133\221\237\014\031\264\222\2371\007\3346\024E\265\267\200GtF\001\262}-\010\"\300\257\277\216p\234\230\002\210\000\207\212\313K\345\223\223\221\223\320\336S\004\205\254(\324G\212`\004\300\347\217\207\340\354 Iz\234\321vN\337}\362Tj"; + PyObject *data = __Pyx_DecompressString(cstring, 644, 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 (706 bytes) */ +const char* const cstring = "BZh91AY&SY\367R\033\343\000\000Z\177\363\347\377\320\210p\005\244@\255\351{\200\277\377\377`@@@@@@@@@\000@\000@\002|\001\240Z\032\247\252\031\006LC@\031\000\r\006F\232\000\320h\000\375P\204\320i\023\310\210z\237\2526\223L\203\023#!\201\001\210\310hy\016\032i\221\210\302i\200\206\0014\3020LL\206\231\032\032\001\246\211\240M%?FM\t=#P\311\352h\300##\010z\0034\236R\275\313\356i\257n!<\211\303\207i\035\246\334\260\207\024\344@*\034#\216\372^\017\337\242{\"\024(M\2402\205\030\206\335]A\000\270'\317\257\337z\373\3037\\;\"\354\217\366\223.\227\r.\257\253\307\342\260\230\272\202\205B\356\035\333\232\343qC!{\262\003\265&9\020\275EEO$OJ\266\252tY\032\242\200\2023TY\252E\031\247n\037UU\\\351rS&P\037\222\240W*\2321\207\331\363\253V\177\220\222\314(F2\232\301^l\271\224\341\025D\211\010\t\270\351\354\300\240\273\262\\\335\241\004\0054\361\3409$\000\374\350F\2026\274P\206\032,\202y\265\021/\327%\335\213k\357\214\212\r\226\204\024B\365\223I\r\360\323\263\232%\267N\244H\241\005S\tQ\365\317\333H\350\331\267\000\253\271\222\226\026\014\245\262\r\022\273\016\212l\343\230\221z\360\260x?\322\320\241\337,\235\032\036\016\345\260#7\276a^\3604\2307]\264e\267\236\312Q\000\220\355\312\013a\"\017~{\325\245\264\007 \211i\230 j\305(6\010\006\250\272\341|1\204\364\356|\241\246\224\020X\251=;\307\353\341V\224\222\243\024\252Q\210\251\214\0028\265\3530\3433\224\271\330\261m[\336\004\321DMQ\324k\260\200\244\306<\314\202\363ZV\204I\365e\026\256r\035.\032\250\256v\025\342\020\254\320j\244\251\001}\350\270\007\316\001\236\241\250B\243\200S \014\356\233\220\032/\t\201i\215\344*w2\302\242\rTE)H\033\276\375\311\0369\020\346\010\201\016\220\221!xO\370\013*`\204?L\374\027\236A9\307AQ\354\326Z\324E\351/\240\336\350\251362q\245,\"\264\345\007\372\000\220;\305\334\221N\024$=\324\206\370""\300"; + PyObject *data = __Pyx_DecompressString(cstring, 706, 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 (632 bytes) */ +const char* const cstring = "x\332US=o\3330\020u\2014\315\207\333\004]:ta;\007.\014t\350V\0301\032\027\005\212\246E\322\361@S\247\210\rEJ$eD[F\217\0329j\354\317\351\350\261?!?\241G\311v\\\003\246\336\335\273\257w\242>\236+\356\034\253\034&\314\033&\214\366\326(V\030\347\344\\![pU\241c\251\261\004\255\344\344s\243\243#F\277\237\031j\246\244\363\214H_\025\3040n\261\257\305\035KL\316\245vg\314gXw\014\257<\371\274\024\\\251\272\253A\375\026h}\337\234kF\361\236k\201\314\244\224\306=\023q\274Q\027;CU\240\355=\377\r\304\022L\245\226^\032\275\036\355\312I}C\005\244[\207\0230E\014\340\352\214\021I\035\270\256Y\306]\326U0\363_(\374Y\227L\254\252\222X\240P$\2009o\311 m:!\316\343\rZ\022\225\363\232\315\037\305\356,g\255\213\322(\333\277\353\3270*\352i\007\372s\004\020'\006X\233\231L\360:\256zm\027\246\370\341\271\337\232\225\313vm\213\016}\347\000\370V\337\321\177*\205\207\257x\347\277cz\245I\262\274\321\230\\\257\247\332<\267mw\034\026\013\013\300\213\002u\302]\255\2054#a\254\251\274\324\350\346\306(\221\241\270\005\231\2020y!\025&B\021E\225\200$\n\234sq\373\250w\324\353Md\232\002$F\000\320PT\032 \2554Y@R\023\324[\301\233\211@:\330\266\225\036s\007\020\013\021\0039z\336\275\307\3160I\245\260C\326\000\322}\225H\204\3469nN\332\336f\201d\220@\272|\0046K\004(+\256\372P\213\271Y\340f\013\217{\265\350+\253\035\252\224<\000\361\350\023\010\321u\343\225\362\340b \265\246\203B\272/\245\377\\\376\014^\207\361\303p\360t\377a\177px\272,W\307\257\032\027\336\254\016N\226\345\375\344\357\301py\321\214\233ix\262\"8m\016v\300\375\344\341\345\340\360y\027\360)\246\014\227\263\346\"\214\303\204\230\027\221\2315\021\036\36502\347\241lc\3360\272>7\227M\032&1\357KS\256\037\261\347\311\3227\343>\361\224\340\207\360>\270\366m{\336\226\277\251\373\361r\274\032\2366\317\2322\354\205Y;i/[\036\035{\315,L\302e\340\377\000&L\2174"; + PyObject *data = __Pyx_DecompressString(cstring, 632, 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 (1065 bytes) */ +const char* const bytes = "?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 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 constraint/domain.pyDomainDomain.__init__Domain.hideValueDomain.popStateDomain.pushStateDomain.resetState__Pyx_PyDict_NextRefUnassignedVariableVariable.__init__Variable.__repr__appendasyncio.coroutinesboolcheck_if_compiledcline_in_tracebackconstraint.domaindiff__doc__extend__func___hiddenhideValue__init___is_coroutineitems__main____metaclass____module____mro_entries__name__name__poppopState__prepare__pushState__qualname__remove__repr__resetStatereturnselfset__set_name__setdefault_states__test__valuevalues\320\000\033\2301\360\014\000\005\006\360\006\000\t\020\210q\330\013\027\220s\230!\330\010\017\210q\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\200A\360\022\000\t\r\210G\2201\220F\230!\330\010\014\210H\220G\2301\230A\200A\360\016\000\t\r\210H\220A\200A\360\n\000\t\r\210H\220G\2301\230C\230q\240\001\200A\360\014\000\t\r\210I\220Q\220f\230A\330\010\014\210K\220q\330\010\014\210K\220q\200A\340\010\017\210t\2201\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"; + 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 < 53; 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 = 53; i < 61; 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 < 61; i++) { + if (unlikely(PyObject_Hash(stringtab[i]) == -1)) { + __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = stringtab + 53; + for (Py_ssize_t i=0; i<8; ++i) { + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + } + #else + 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 +4562,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 +4612,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,216 +4678,67 @@ 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; +} +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; + __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); + return res; +} +static CYTHON_INLINE PyObject * +__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + return PyList_New(0); + } + res = PyList_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); + return res; } #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); - } - res = PyTuple_New(n); - if (unlikely(res == NULL)) return NULL; - __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); - return res; -} -static CYTHON_INLINE PyObject * -__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) -{ - PyObject *res; - if (n <= 0) { - return PyList_New(0); - } - res = PyList_New(n); - if (unlikely(res == NULL)) return NULL; - __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); - return res; -} -#endif - -/* BytesEquals */ -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) - return PyObject_RichCompareBool(s1, s2, equals); +/* 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) + return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); @@ -4895,7 +4782,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 +4917,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 +4937,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 +4957,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; @@ -5238,38 +5012,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 +5034,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 +5135,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 +5304,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 +5460,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 +5490,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 +5670,8 @@ static int __Pyx_ParseKeywordsTuple( #endif return -1; } + +/* ParseKeywords */ static int __Pyx_ParseKeywords( PyObject *kwds, PyObject * const *kwvalues, @@ -5908,19 +5803,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 +5899,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 +5910,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 +5941,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 +5967,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 +6049,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 +6103,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 +6125,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 +6160,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 +6179,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 +6217,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 +6349,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 +6381,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 +6424,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 +6450,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 +6476,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 +6511,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 +6535,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 +6566,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 +6718,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 +6731,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) { @@ -7093,8 +6993,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}, @@ -7115,9 +7020,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 +7080,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,7 +7136,13 @@ __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); @@ -7275,7 +7190,20 @@ 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); @@ -7387,7 +7315,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 +7354,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 +7376,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 +7411,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 +7446,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 +7477,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 +7502,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 +7536,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 +7588,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 +7630,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 +7835,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 +8010,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) { @@ -8153,8 +8199,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 +8208,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,7 +8343,7 @@ __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; @@ -8342,7 +8391,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 +8399,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 +8444,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 +8540,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 +8610,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 +8790,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 +8860,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 +9054,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 +9076,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 +9169,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 +9187,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 +9211,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 +9239,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 +9250,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 +9533,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 4e11fd7..8aec4a4 100644 --- a/constraint/parser.c +++ b/constraint/parser.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.1.2 */ +/* Generated by Cython 3.2.4 */ /* 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_4" +#define CYTHON_HEX_VERSION 0x030204F0 #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,6 +888,22 @@ 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 +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 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) @@ -907,6 +921,12 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #else #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) #endif +#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyList_GetItemRefFast(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_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(o, i) +#endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) #elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS @@ -966,15 +986,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 +1092,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 +1140,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 +1351,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 +1387,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 +1412,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 +1422,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 +1438,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 +1454,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 +1471,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 +1487,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 +1517,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 ### */ @@ -1816,7 +1837,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_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); @@ -1824,7 +1845,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; @@ -1842,7 +1863,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) @@ -1867,20 +1888,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 @@ -1888,13 +1909,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 */ @@ -1933,19 +1954,10 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #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)\ @@ -1955,52 +1967,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; @@ -2033,6 +2019,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); @@ -2042,15 +2081,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 @@ -2075,20 +2125,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_DefinitelyUnique) + #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) { @@ -2117,7 +2184,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) @@ -2128,7 +2195,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);\ @@ -2185,6 +2252,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); @@ -2202,29 +2274,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 @@ -2242,7 +2311,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( /* 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); @@ -2270,7 +2339,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 */ @@ -2282,10 +2351,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 */ @@ -2308,69 +2377,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); +/* 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); -/* 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 - -/* RaiseException.proto */ +/* RaiseException.export */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); -/* 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 @@ -2400,14 +2471,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; @@ -2452,7 +2524,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) @@ -2475,16 +2547,19 @@ 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); /* 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; @@ -2509,7 +2584,10 @@ static PyObject* __Pyx_Globals(void); #define __pyx_assertions_enabled() (!Py_OptimizeFlag) #endif -/* GetTopmostException.proto */ +/* 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 @@ -2525,13 +2603,32 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif -/* PyObjectGetMethod.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); + +/* 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 PyType_Ready) */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); -/* 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 @@ -2539,27 +2636,30 @@ 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); -/* 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 @@ -2590,7 +2690,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 @@ -2658,7 +2758,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); @@ -2666,19 +2775,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 @@ -2695,7 +2804,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; @@ -2763,12 +2874,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*); @@ -2826,246 +2937,10 @@ 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_compile; static PyObject *__pyx_builtin_eval; -static PyObject *__pyx_builtin_AssertionError; /* #### 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_d[] = "[+-]?\\d+"; -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[] = "\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[] = "\240!"; -static const char __pyx_k__28[] = "\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_q_2[] = "\230q"; -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_var[] = "var"; -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_expr[] = "expr"; -static const char __pyx_k_func[] = "__func__"; -static const char __pyx_k_keys[] = "keys"; -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_VERBOSE[] = "VERBOSE"; -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_matches[] = "matches"; -static const char __pyx_k_pattern[] = "pattern"; -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_Variables[] = "Variables "; -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\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"; -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_extract_operators[] = "extract_operators"; -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_not_in_tune_params[] = " not in tune_params "; -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_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_HA_4vRxq_Q_a_b_1AV3d_q[] = "\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"; -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_Ya_1_q_Q2_m5_aP_U_6_Q_q_t4uA_d[] = "\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\360P\007\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_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_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_V1_A_UUV__A_Qm1_q_9_gQm_q_1Kz_g[] = "\200\001\330\021%\240V\2501\330\005\006\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_a_3axs_C_1_avV6_a_Bhas_q_a_3a_Q[] = "\320\004+\250=\270\016\300a\360$\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\"\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\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\022\240>\3201P\320P[\320[`\320`a\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_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 @@ -3567,11 +3445,20 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { 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<21; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<214; ++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<232; ++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 ### */ @@ -3585,12 +3472,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); @@ -3624,11 +3505,20 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void 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<21; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<214; ++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<232; ++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 ### */ @@ -3697,7 +3587,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, "parse_restrictions", 0) < 0) __PYX_ERR(0, 32, __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, 32, __pyx_L3_error) } } @@ -3804,7 +3694,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, "replace_params", 0) < 0) __PYX_ERR(0, 38, __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, 38, __pyx_L3_error) } } @@ -3869,7 +3759,7 @@ 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, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -3914,7 +3804,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para __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, 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, 42, __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; @@ -4024,7 +3914,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, "replace_params_split", 0) < 0) __PYX_ERR(0, 46, __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, 46, __pyx_L3_error) } } @@ -4090,7 +3980,7 @@ 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, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -4255,7 +4145,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, "to_multiple_restrictions", 0) < 0) __PYX_ERR(0, 56, __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, 56, __pyx_L3_error) } } @@ -4325,7 +4215,6 @@ 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; @@ -4360,7 +4249,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple #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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -4468,7 +4357,7 @@ 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; @@ -4495,7 +4384,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple #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_GetItemRefFast(__pyx_t_10, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_12; } else { { @@ -4532,7 +4421,7 @@ 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, 66, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); @@ -4542,7 +4431,7 @@ 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, 66, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); @@ -4615,60 +4504,24 @@ 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, 72, __pyx_L1_error) - __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 72, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __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, 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, 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_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, 72, __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, 72, __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, 72, __pyx_L1_error) - } else { + { __pyx_t_3 = __pyx_t_13(__pyx_t_8); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); @@ -4700,23 +4553,23 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * 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, 74, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 74, __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, 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_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, 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, 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, 74, __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; @@ -4731,30 +4584,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * ) * 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, 76, __pyx_L1_error) - __pyx_t_10 = PyLong_FromSsize_t((__pyx_t_14 - 1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 76, __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, 76, __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, 76, __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, 76, __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, 76, __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, 76, __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; - } else { - __pyx_t_14 = PyObject_Length(__pyx_v_temp_copy); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 76, __pyx_L1_error) - __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 76, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __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_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; @@ -4766,16 +4619,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * 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, 78, __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; + 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); } @@ -4912,7 +4765,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, "to_numeric_constraint", 0) < 0) __PYX_ERR(0, 81, __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, 81, __pyx_L3_error) } } @@ -5050,7 +4903,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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -5206,7 +5059,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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -5344,7 +5197,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, 110, __pyx_L1_error) } if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 110, __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, 110, __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, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -5357,7 +5210,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_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -5370,7 +5223,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, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -5494,7 +5347,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, 155, __pyx_L1_error) } if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 155, __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, 155, __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, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -5507,7 +5360,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_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -5520,7 +5373,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, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -5660,7 +5513,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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -5699,7 +5552,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_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, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -5836,7 +5689,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_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -5852,7 +5705,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, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -5973,7 +5826,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_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -5989,7 +5842,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, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -6116,7 +5969,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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -6155,7 +6008,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_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, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -6293,7 +6146,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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -6462,7 +6315,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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -6501,7 +6354,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_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, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -6734,7 +6587,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; @@ -6782,7 +6635,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, 107, __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, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_comparator = __pyx_t_5; __pyx_t_5 = 0; @@ -6849,7 +6702,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_left}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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, 113, __pyx_L1_error) @@ -6882,7 +6735,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_right}; - __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_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; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 114, __pyx_L1_error) @@ -7035,7 +6888,7 @@ 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; @@ -7088,7 +6941,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, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -7473,7 +7326,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_left}; - __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_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, 156, __pyx_L1_error) @@ -7506,7 +7359,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_right}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __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_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, 157, __pyx_L1_error) @@ -7584,7 +7437,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_left}; - __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_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, 164, __pyx_L1_error) @@ -7617,7 +7470,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_right}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __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_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, 165, __pyx_L1_error) @@ -7703,7 +7556,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ #endif { 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(__pyx_t_7, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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_2)) __PYX_ERR(0, 170, __pyx_L1_error) @@ -7767,36 +7620,33 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * len(re.findall(r"[+-]?\d+", restriction)) > 0 */ __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_ValueError); - __pyx_t_5 = __pyx_builtin_ValueError; - __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_variables, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_variables, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 176, __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, 176, __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, 176, __pyx_L1_error) } - __pyx_t_11 = __Pyx_PyDict_Keys(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tune_params); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 176, __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, 176, __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, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_t_11, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __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_8; + __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_12; - __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 20 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12)); - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __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, 176, __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_11}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + 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_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } @@ -7820,29 +7670,29 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * ): # TODO adjust when we support modifiers such as multipliers (see roadmap) # noqa: E501 * # if the restriction contains numbers, return None */ - __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 178, __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_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_5); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); + 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_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_d, __pyx_v_restriction}; - __pyx_t_7 = __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_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + 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, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } @@ -7888,11 +7738,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __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, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 184, __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_2); - __pyx_t_2 = 0; + __pyx_v_variable_operators_left = ((PyObject*)__pyx_t_11); + __pyx_t_11 = 0; /* "constraint/parser.py":185 * # find all unique variable_supported_operators in the restriction, can have at most one @@ -7901,11 +7751,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * 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_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_15genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L1_error) + __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, 185, __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, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_v_variable_operators_right = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; @@ -7916,27 +7766,27 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None * if ( */ - __pyx_t_5 = PySet_New(__pyx_v_variable_operators_left); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __pyx_t_5; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_11 = PySet_New(__pyx_v_variable_operators_right); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_8 = PySet_New(__pyx_v_variable_operators_left); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 186, __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, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_11}; - __pyx_t_7 = __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_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_5 = PySequence_List(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = PySequence_List(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 186, __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_5); - __pyx_t_5 = 0; + __pyx_v_variable_unique_operators = ((PyObject*)__pyx_t_8); + __pyx_t_8 = 0; /* "constraint/parser.py":189 * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None @@ -7960,11 +7810,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * and (len(unique_operators_left) == 0 or len(unique_operators_right) == 0) * ): # noqa: E501 */ - __pyx_t_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_18genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_variables); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 190, __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, 190, __pyx_L1_error) + __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, 190, __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, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __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, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { @@ -8028,7 +7878,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_1 = __pyx_t_6; goto __pyx_L30_bool_binop_done; } - __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_variable_unique_operators, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 194, __pyx_L1_error) + __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, 194, __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, 194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -8072,37 +7922,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if variables_on_left * else VariableExactSumConstraint(variables[0], variables[1:]) */ - __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __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, 197, __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, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __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, 197, __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_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[3] = {__pyx_t_11, __pyx_t_12, __pyx_t_8}; - __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_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_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_7 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } else { /* "constraint/parser.py":199 @@ -8112,37 +7962,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * ) # noqa: E501 * elif comparator == "<=": */ - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 199, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __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, 199, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __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, 199, __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, 199, __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_12))) { + __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_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_12, __pyx_t_11}; - __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_XDECREF(__pyx_t_2); __pyx_t_2 = 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; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 199, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_7 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; @@ -8193,37 +8043,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if variables_on_left * else VariableMinSumConstraint(variables[0], variables[1:]) */ - __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __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, 204, __pyx_L1_error) + __pyx_t_12 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __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, 204, __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, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __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); + 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_2); + __Pyx_INCREF(__pyx_t_12); __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[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_2}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__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_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + 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; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_7 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } else { /* "constraint/parser.py":206 @@ -8233,37 +8083,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * ) # noqa: E501 * elif comparator == ">=": */ - __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __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, 206, __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, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __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, 206, __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_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[3] = {__pyx_t_11, __pyx_t_12, __pyx_t_8}; - __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_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_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_7 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; @@ -8314,37 +8164,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if variables_on_left * else VariableMaxSumConstraint(variables[0], variables[1:]) */ - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __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, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __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, 211, __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, 211, __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_12))) { + __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_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_12, __pyx_t_11}; - __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_XDECREF(__pyx_t_2); __pyx_t_2 = 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; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_7 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } else { /* "constraint/parser.py":213 @@ -8354,37 +8204,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * ) # noqa: E501 * elif variable_unique_operators[0] == "*": */ - __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __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, 213, __pyx_L1_error) + __pyx_t_12 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __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, 213, __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, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __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); + 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_2); + __Pyx_INCREF(__pyx_t_12); __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[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_2}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__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_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + 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; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_7 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; @@ -8416,7 +8266,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if comparator == "==": * return ( */ - __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_variable_unique_operators, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 215, __pyx_L1_error) + __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, 215, __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, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -8458,37 +8308,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if variables_on_left * else VariableExactProdConstraint(variables[0], variables[1:]) */ - __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __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, 218, __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, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __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, 218, __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_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[3] = {__pyx_t_11, __pyx_t_12, __pyx_t_8}; - __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_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_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_7 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } else { /* "constraint/parser.py":220 @@ -8498,37 +8348,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * ) # noqa: E501 * elif comparator == "<=": */ - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 220, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __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, 220, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __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, 220, __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, 220, __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_12))) { + __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_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_12, __pyx_t_11}; - __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_XDECREF(__pyx_t_2); __pyx_t_2 = 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; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 220, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_7 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; @@ -8579,37 +8429,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if variables_on_left * else VariableMinProdConstraint(variables[0], variables[1:]) */ - __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 225, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 225, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __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, 225, __pyx_L1_error) + __pyx_t_12 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __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, 225, __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, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __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); + 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_2); + __Pyx_INCREF(__pyx_t_12); __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[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_2}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__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_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + 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; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_7 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } else { /* "constraint/parser.py":227 @@ -8619,37 +8469,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * ) # noqa: E501 * elif comparator == ">=": */ - __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __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, 227, __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, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __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, 227, __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_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[3] = {__pyx_t_11, __pyx_t_12, __pyx_t_8}; - __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_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_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 227, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_7 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; @@ -8700,37 +8550,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if variables_on_left * else VariableMaxProdConstraint(variables[0], variables[1:]) */ - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __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, 232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __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, 232, __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, 232, __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_12))) { + __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_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_12, __pyx_t_11}; - __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_XDECREF(__pyx_t_2); __pyx_t_2 = 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; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_7 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } else { /* "constraint/parser.py":234 @@ -8740,37 +8590,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * ) # noqa: E501 * */ - __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __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, 234, __pyx_L1_error) + __pyx_t_12 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __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, 234, __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, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __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); + 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_2); + __Pyx_INCREF(__pyx_t_12); __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[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_2}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__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_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + 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; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_7 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; @@ -8833,53 +8683,53 @@ 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_11 = __pyx_v_right; - __Pyx_INCREF(__pyx_t_11); + __pyx_t_2 = __pyx_v_right; + __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_11, 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_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + 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, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __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_11, 0, __pyx_v_left_num) != (0)) __PYX_ERR(0, 242, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 242, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_left_num) != (0)) __PYX_ERR(0, 242, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 242, __pyx_L1_error); __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, Py_False) != (0)) __PYX_ERR(0, 242, __pyx_L1_error); - __pyx_t_5 = 0; - __pyx_t_7 = __pyx_t_11; - __pyx_t_11 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_False) != (0)) __PYX_ERR(0, 242, __pyx_L1_error); + __pyx_t_8 = 0; + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; } else { - __pyx_t_5 = __pyx_v_left; - __Pyx_INCREF(__pyx_t_5); + __pyx_t_8 = __pyx_v_left; + __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; - __pyx_t_11 = __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_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + 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, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __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_5, 0, __pyx_v_right_num) != (0)) __PYX_ERR(0, 242, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 242, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_right_num) != (0)) __PYX_ERR(0, 242, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 242, __pyx_L1_error); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, Py_True) != (0)) __PYX_ERR(0, 242, __pyx_L1_error); - __pyx_t_11 = 0; - __pyx_t_7 = __pyx_t_5; - __pyx_t_5 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, Py_True) != (0)) __PYX_ERR(0, 242, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } if (likely(__pyx_t_7 != Py_None)) { PyObject* sequence = __pyx_t_7; @@ -8890,19 +8740,19 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __PYX_ERR(0, 241, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_5); - __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_11); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_8); + __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_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 241, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 241, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); #endif __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { @@ -8916,12 +8766,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * (left_num, right.strip(), False) if left_num is not None else (right_num, left.strip(), True) * ) */ - __pyx_v_number = __pyx_t_5; - __pyx_t_5 = 0; - __pyx_v_variables = __pyx_t_11; - __pyx_t_11 = 0; - __Pyx_XDECREF_SET(__pyx_v_variables_on_left, __pyx_t_2); + __pyx_v_number = __pyx_t_8; + __pyx_t_8 = 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":246 * @@ -8961,11 +8811,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __pyx_t_7 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = PyNumber_InPlaceSubtract(__pyx_v_number, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = PyNumber_InPlaceSubtract(__pyx_v_number, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 250, __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_2); - __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_11); + __pyx_t_11 = 0; /* "constraint/parser.py":248 * offset = 1e-12 @@ -8985,11 +8835,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if variables_on_left: */ /*else*/ { - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_number, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_11 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 253, __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, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_7); __pyx_t_7 = 0; } @@ -9034,11 +8884,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __pyx_t_7 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_number, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_number, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 257, __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_2); - __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_11); + __pyx_t_11 = 0; /* "constraint/parser.py":255 * number += offset @@ -9058,11 +8908,11 @@ 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_2 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyNumber_InPlaceSubtract(__pyx_v_number, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 260, __pyx_L1_error) + __pyx_t_11 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 260, __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, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_7); __pyx_t_7 = 0; } @@ -9106,32 +8956,32 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if len(operators_found) == 0: * # no operators found, return only based on comparator */ - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 264, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_operators); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 264, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 264, __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, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 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); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_2); + 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_5, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_11, __pyx_v_variables}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_5, __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_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } @@ -9209,26 +9059,26 @@ 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_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __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_5 = PyMethod_GET_SELF(__pyx_t_11); - assert(__pyx_t_5); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_5); + 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_11, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_number}; - __pyx_t_7 = __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_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + 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, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } @@ -9273,57 +9123,57 @@ 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, 275, __pyx_L1_error) if (__pyx_t_1) { - __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 275, __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_5 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_5); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); + 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_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + 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, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_7 = __pyx_t_11; - __pyx_t_11 = 0; + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; } else { - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 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); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_2); + 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_5, __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_5, __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_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + 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, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_7 = __pyx_t_11; - __pyx_t_11 = 0; + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; @@ -9366,57 +9216,57 @@ 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, 277, __pyx_L1_error) if (__pyx_t_1) { - __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 277, __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_5 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_5); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); + 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_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __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_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 277, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + 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, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_7 = __pyx_t_11; - __pyx_t_11 = 0; + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; } else { - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 277, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 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); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_2); + 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_5, __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_5, __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_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 277, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + 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, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_7 = __pyx_t_11; - __pyx_t_11 = 0; + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; @@ -9438,21 +9288,18 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * * # check which operator is applied on the variables */ - __pyx_t_11 = NULL; - __Pyx_INCREF(__pyx_builtin_ValueError); - __pyx_t_5 = __pyx_builtin_ValueError; - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_comparator, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __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, 278, __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, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_12}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_5, __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_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } @@ -9476,7 +9323,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * 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_7 = __Pyx_GetItemInt(__pyx_v_operators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __pyx_L1_error) + __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, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_v_operator = __pyx_t_7; @@ -9491,11 +9338,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __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, 282, __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, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 282, __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_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 282, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 282, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_6 = (!__pyx_t_1); if (__pyx_t_6) { @@ -9531,13 +9378,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_operator}; - __pyx_t_5 = __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_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_5)) __PYX_ERR(0, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); } - __pyx_v_splitted = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_splitted = __pyx_t_11; + __pyx_t_11 = 0; /* "constraint/parser.py":289 * splitted = variables.split(operator) @@ -9547,21 +9394,21 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if operator == "**": */ __pyx_t_3 = PyObject_Length(__pyx_v_splitted); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 289, __pyx_L1_error) - __pyx_t_5 = __pyx_cur_scope->__pyx_v_params; - __Pyx_INCREF(__pyx_t_5); - __pyx_t_13 = __Pyx_PyList_GET_SIZE(__pyx_t_5); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 289, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __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, 289, __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_L47_bool_binop_done; } - __pyx_t_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_24genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_splitted); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __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, 289, __pyx_L1_error) + __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, 289, __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, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __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, 289, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_6 = __pyx_t_1; @@ -9626,26 +9473,26 @@ 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_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 296, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __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_5 = PyMethod_GET_SELF(__pyx_t_12); - assert(__pyx_t_5); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_5); + 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_12, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_number}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_12, __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_12); __pyx_t_12 = 0; + 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, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } @@ -9690,57 +9537,57 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 298, __pyx_L1_error) if (__pyx_t_6) { - __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 298, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11); - assert(__pyx_t_5); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_5); + 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_11, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_number}; - __pyx_t_12 = __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_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 298, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + 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, 298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_7 = __pyx_t_12; - __pyx_t_12 = 0; + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; } else { - __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 298, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); - assert(__pyx_t_11); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_11); + 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_5, __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_12 = __Pyx_PyObject_FastCall(__pyx_t_5, __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_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 298, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + 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, 298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_7 = __pyx_t_12; - __pyx_t_12 = 0; + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; @@ -9783,57 +9630,57 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 300, __pyx_L1_error) if (__pyx_t_6) { - __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11); - assert(__pyx_t_5); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_5); + 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_11, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_number}; - __pyx_t_12 = __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_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + 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, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_7 = __pyx_t_12; - __pyx_t_12 = 0; + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; } else { - __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); - assert(__pyx_t_11); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_11); + 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_5, __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_12 = __Pyx_PyObject_FastCall(__pyx_t_5, __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_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + 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, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_7 = __pyx_t_12; - __pyx_t_12 = 0; + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; @@ -9886,26 +9733,26 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # raise ValueError(restriction, comparator) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 303, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5); - assert(__pyx_t_12); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_12); + 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_5, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_number}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__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; + 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, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } @@ -9950,57 +9797,57 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 306, __pyx_L1_error) if (__pyx_t_6) { - __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); - assert(__pyx_t_12); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_12); + 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); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __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_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + 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_11)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_7 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_7 = __pyx_t_11; + __pyx_t_11 = 0; } else { - __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __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_11 = PyMethod_GET_SELF(__pyx_t_12); - assert(__pyx_t_11); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__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_2); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __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_12, __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_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_number}; + __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_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_7 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_7 = __pyx_t_11; + __pyx_t_11 = 0; } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; @@ -10043,57 +9890,57 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 308, __pyx_L1_error) if (__pyx_t_6) { - __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); - assert(__pyx_t_12); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_12); + 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); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __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_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + 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_11)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_7 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_7 = __pyx_t_11; + __pyx_t_11 = 0; } else { - __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __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_11 = PyMethod_GET_SELF(__pyx_t_12); - assert(__pyx_t_11); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__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_2); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __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_12, __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_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_number}; + __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_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_7 = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_7 = __pyx_t_11; + __pyx_t_11 = 0; } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; @@ -10126,21 +9973,18 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * */ /*else*/ { - __pyx_t_5 = NULL; - __Pyx_INCREF(__pyx_builtin_ValueError); - __pyx_t_12 = __pyx_builtin_ValueError; - __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 310, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_operator, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __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, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __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, 310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_12, __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_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + 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, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } @@ -10295,7 +10139,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, "to_equality_constraint", 0) < 0) __PYX_ERR(0, 313, __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, 313, __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, 313, __pyx_L3_error) } } @@ -10427,7 +10271,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit #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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -10440,7 +10284,7 @@ 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, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -10513,7 +10357,6 @@ 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; @@ -10603,7 +10446,7 @@ 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, 322, __pyx_L1_error) @@ -10639,7 +10482,7 @@ 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, 323, __pyx_L1_error) @@ -10702,12 +10545,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __pyx_t_3 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 327, __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, 327, __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, 327, __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, 327, __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, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __pyx_t_6; __pyx_t_6 = 0; @@ -10722,7 +10565,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * # 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, 330, __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, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_splitted = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; @@ -10791,7 +10634,7 @@ 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, 335, __pyx_L1_error) @@ -10845,7 +10688,7 @@ 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, 337, __pyx_L1_error) @@ -10873,20 +10716,17 @@ 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, 338, __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, 338, __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, 338, __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, 338, __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; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } @@ -10928,7 +10768,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:; @@ -11021,7 +10860,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator1 #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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -11182,8 +11021,8 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ __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, 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) + 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); @@ -11200,9 +11039,9 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ __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, 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_Optional_Union_MinSumConstraint) < 0) __PYX_ERR(0, 81, __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_Optional_Union_MinSumConstraint) < (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); @@ -11219,9 +11058,9 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __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, 313, __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, 313, __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, 313, __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, 313, __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, 313, __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, 313, __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, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_1); @@ -11265,7 +11104,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED #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_GetItemRefFast(__pyx_t_2, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 344, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); @@ -11302,7 +11141,7 @@ 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, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -11333,7 +11172,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED #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_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 347, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); @@ -11375,7 +11214,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED #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_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_6); @@ -11452,7 +11291,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED #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_GetItemRefFast(__pyx_t_2, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -11500,7 +11339,7 @@ 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, 356, __pyx_L1_error) @@ -11511,7 +11350,7 @@ 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, 356, __pyx_L1_error) @@ -11576,7 +11415,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * 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, 362, __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, 362, __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, 362, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11593,7 +11432,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * 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, 363, __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, 363, __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, 363, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11655,11 +11494,14 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * 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, 369, __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, 369, __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, 369, __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, 369, __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":370 * # check if we can turn this into the built-in numeric comparison constraint @@ -11678,9 +11520,12 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * 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, 372, __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, 372, __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, 372, __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, 372, __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; @@ -11898,7 +11743,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_constraints", 0) < 0) __PYX_ERR(0, 381, __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, 381, __pyx_L3_error) /* "constraint/parser.py":382 * @@ -11996,7 +11841,6 @@ 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; @@ -12026,7 +11870,7 @@ 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, 394, __pyx_L1_error) @@ -12073,7 +11917,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN #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_GetItemRefFast(__pyx_t_1, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -12118,10 +11962,10 @@ 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); + __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); } @@ -12142,7 +11986,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, 396, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < (0)) __PYX_ERR(0, 396, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -12202,7 +12046,7 @@ 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, 400, __pyx_L1_error) @@ -12230,14 +12074,11 @@ 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, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } @@ -12251,35 +12092,35 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * 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, 403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 403, __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, 403, __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, 403, __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, 403, __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, 403, __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; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } @@ -12293,25 +12134,25 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * compiled_constraints.append((constraint, params_used, restriction)) * elif isinstance(restriction, Constraint): */ - __pyx_t_2 = NULL; + __pyx_t_7 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 404, __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, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -12405,27 +12246,24 @@ 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, 410, __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, 410, __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, 410, __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, 410, __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, 410, __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, 410, __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, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -12474,7 +12312,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:; @@ -12549,7 +12386,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_or_evals_to_number", 0) < 0) __PYX_ERR(0, 419, __pyx_L3_error) + 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, 419, __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, 419, __pyx_L3_error) } } @@ -12605,11 +12442,10 @@ static PyObject *__pyx_pf_10constraint_6parser_4is_or_evals_to_number(CYTHON_UNU 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; + size_t __pyx_t_8; + int __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; @@ -12639,26 +12475,23 @@ static PyObject *__pyx_pf_10constraint_6parser_4is_or_evals_to_number(CYTHON_UNU * 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, 423, __pyx_L3_error) + __pyx_t_6 = __Pyx_Globals(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 423, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 423, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 423, __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, 423, __pyx_L3_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_number, __pyx_v_number) < (0)) __PYX_ERR(0, 423, __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, 423, __pyx_L3_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_s, __pyx_v_s) < (0)) __PYX_ERR(0, 423, __pyx_L3_error) } - __pyx_t_9 = 1; + __pyx_t_8 = 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)); + 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_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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, 423, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); } @@ -12674,17 +12507,17 @@ static PyObject *__pyx_pf_10constraint_6parser_4is_or_evals_to_number(CYTHON_UNU */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_11 = PyLong_Check(__pyx_v_number); - if (!__pyx_t_11) { + __pyx_t_10 = PyLong_Check(__pyx_v_number); + if (!__pyx_t_10) { } else { - __pyx_t_10 = __pyx_t_11; + __pyx_t_9 = __pyx_t_10; goto __pyx_L9_bool_binop_done; } - __pyx_t_11 = PyFloat_Check(__pyx_v_number); - __pyx_t_10 = __pyx_t_11; + __pyx_t_10 = PyFloat_Check(__pyx_v_number); + __pyx_t_9 = __pyx_t_10; __pyx_L9_bool_binop_done:; - if (unlikely(!__pyx_t_10)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + if (unlikely(!__pyx_t_9)) { + __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0); __PYX_ERR(0, 424, __pyx_L3_error) } } @@ -12717,7 +12550,6 @@ static PyObject *__pyx_pf_10constraint_6parser_4is_or_evals_to_number(CYTHON_UNU __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":426 * assert isinstance(number, (int, float)) @@ -12726,8 +12558,8 @@ static PyObject *__pyx_pf_10constraint_6parser_4is_or_evals_to_number(CYTHON_UNU * # 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_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); + if (__pyx_t_11) { __Pyx_ErrRestore(0,0,0); /* "constraint/parser.py":428 @@ -12784,7 +12616,6 @@ static PyObject *__pyx_pf_10constraint_6parser_4is_or_evals_to_number(CYTHON_UNU __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("constraint.parser.is_or_evals_to_number", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -12853,7 +12684,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, "extract_operators", 0) < 0) __PYX_ERR(0, 431, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "extract_operators", 0) < (0)) __PYX_ERR(0, 431, __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, 431, __pyx_L3_error) } } @@ -12927,7 +12758,7 @@ static PyObject *__pyx_pf_10constraint_6parser_6extract_operators(CYTHON_UNUSED */ __pyx_t_1 = __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyUnicode_Type__strip, __pyx_v_expr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __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, -1L); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) + __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, 437, __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)); @@ -12974,7 +12805,7 @@ static PyObject *__pyx_pf_10constraint_6parser_6extract_operators(CYTHON_UNUSED #endif { PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_v_pattern, __pyx_v_expr, __pyx_t_5}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (4-__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, (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; @@ -13012,7 +12843,7 @@ static PyObject *__pyx_pf_10constraint_6parser_6extract_operators(CYTHON_UNUSED #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_7); + __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { @@ -13049,7 +12880,7 @@ static PyObject *__pyx_pf_10constraint_6parser_6extract_operators(CYTHON_UNUSED __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; - __pyx_t_5 = __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_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, 446, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); @@ -13099,30 +12930,33 @@ static PyObject *__pyx_pf_10constraint_6parser_6extract_operators(CYTHON_UNUSED 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)))) { + 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 = (*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__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 (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; } @@ -13134,19 +12968,24 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct__parse_rest 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)))) { + 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 - (*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 } } @@ -13189,7 +13028,7 @@ static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct__parse_res "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, + 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 @@ -13200,12 +13039,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct__parse_re 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*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -13219,7 +13053,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*/ @@ -13254,7 +13088,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 @@ -13274,30 +13108,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; } @@ -13309,19 +13146,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 } } @@ -13376,7 +13218,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 @@ -13387,12 +13229,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*/ @@ -13406,7 +13243,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*/ @@ -13441,7 +13278,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 @@ -13461,30 +13298,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; } @@ -13496,19 +13336,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 } } @@ -13544,7 +13389,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 @@ -13555,12 +13400,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*/ @@ -13574,7 +13414,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*/ @@ -13609,7 +13449,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 @@ -13629,30 +13469,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; } @@ -13662,19 +13505,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 } } @@ -13704,7 +13552,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 @@ -13715,12 +13563,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*/ @@ -13734,7 +13577,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*/ @@ -13769,7 +13612,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 @@ -13789,30 +13632,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; } @@ -13824,19 +13670,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 } } @@ -13869,7 +13720,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 @@ -13880,12 +13731,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*/ @@ -13899,7 +13745,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*/ @@ -13934,7 +13780,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 @@ -13954,30 +13800,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; } @@ -13989,19 +13838,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 } } @@ -14034,7 +13888,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 @@ -14045,12 +13899,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*/ @@ -14064,7 +13913,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*/ @@ -14099,7 +13948,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 @@ -14119,30 +13968,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; } @@ -14153,19 +14005,24 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_genexpr(P Py_CLEAR(p->__pyx_genexpr_arg_0); 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 } } @@ -14198,7 +14055,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 @@ -14209,12 +14066,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*/ @@ -14228,7 +14080,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*/ @@ -14263,7 +14115,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 @@ -14283,30 +14135,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; } @@ -14317,19 +14172,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 } } @@ -14362,7 +14222,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 @@ -14373,12 +14233,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*/ @@ -14392,7 +14247,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*/ @@ -14427,7 +14282,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 @@ -14447,30 +14302,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; } @@ -14481,19 +14339,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 } } @@ -14526,7 +14389,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 @@ -14537,12 +14400,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*/ @@ -14556,7 +14414,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*/ @@ -14591,7 +14449,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 @@ -14611,30 +14469,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; } @@ -14645,19 +14506,24 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_9_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_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 } } @@ -14690,7 +14556,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 @@ -14701,12 +14567,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*/ @@ -14720,7 +14581,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*/ @@ -14755,7 +14616,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 @@ -14775,30 +14636,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; } @@ -14809,19 +14673,24 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_genexpr( Py_CLEAR(p->__pyx_genexpr_arg_0); 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 } } @@ -14854,7 +14723,7 @@ static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr "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|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_10_genexpr_slots, }; #else @@ -14865,12 +14734,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexp 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*/ - #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*/ @@ -14884,7 +14748,7 @@ 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*/ 0, /*tp_clear*/ @@ -14919,7 +14783,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 @@ -14939,30 +14803,33 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexp 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_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_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr)))) { + 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 = (*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_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((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_11_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -14973,19 +14840,24 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_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_11_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr)))) { + 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 - (*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 } } @@ -15018,7 +14890,7 @@ static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr "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, + 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 @@ -15029,12 +14901,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexp sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_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*/ @@ -15048,7 +14915,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_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_11_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -15083,7 +14950,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_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 @@ -15103,30 +14970,33 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexp 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_12_to_equality_constraint > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_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_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 (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; } @@ -15136,19 +15006,24 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_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_12_to_equality_constraint < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint)))) { + 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 } } @@ -15191,7 +15066,7 @@ static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equa "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, + 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 @@ -15202,12 +15077,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equ 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_12_to_equality_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*/ @@ -15221,7 +15091,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_12_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_12_to_equality_constraint, /*tp_traverse*/ __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint, /*tp_clear*/ @@ -15256,7 +15126,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_12_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 @@ -15276,30 +15146,33 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equ 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_13_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_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_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 (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; } @@ -15310,19 +15183,24 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_13_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_13_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr)))) { + 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 } } @@ -15355,7 +15233,7 @@ static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr "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, + 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 @@ -15366,12 +15244,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexp sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_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 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -15385,7 +15258,7 @@ 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*/ 0, /*tp_clear*/ @@ -15420,7 +15293,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 @@ -15440,30 +15313,33 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexp 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_14_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_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_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 (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; } @@ -15473,19 +15349,24 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_14_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_14_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr)))) { + 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 } } @@ -15515,7 +15396,7 @@ static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_14_genexpr "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, + 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 @@ -15526,12 +15407,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_14_genexp sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_14_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*/ @@ -15545,7 +15421,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_14_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_14_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -15580,7 +15456,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_14_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 @@ -15653,14 +15529,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_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) + 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, 32, __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)) { @@ -15669,14 +15548,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_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) + 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, 81, __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)) { @@ -15685,14 +15567,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, 99, __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, 99, __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, 99, __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, 99, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr) < (0)) __PYX_ERR(0, 99, __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)) { @@ -15701,14 +15586,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, 99, __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, 99, __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, 99, __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, 99, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr) < (0)) __PYX_ERR(0, 99, __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)) { @@ -15717,14 +15605,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, 110, __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, 110, __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, 110, __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, 110, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr) < (0)) __PYX_ERR(0, 110, __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)) { @@ -15733,14 +15624,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, 155, __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, 155, __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, 155, __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, 155, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr) < (0)) __PYX_ERR(0, 155, __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)) { @@ -15749,14 +15643,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_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, 175, __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, 175, __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, 175, __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, 175, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_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_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)) { @@ -15765,14 +15662,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, 184, __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, 184, __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, 184, __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, 184, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr) < (0)) __PYX_ERR(0, 184, __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)) { @@ -15781,14 +15681,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_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, 185, __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, 185, __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, 185, __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, 185, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr) < (0)) __PYX_ERR(0, 185, __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)) { @@ -15797,14 +15700,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_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, 190, __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, 190, __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, 190, __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, 190, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr) < (0)) __PYX_ERR(0, 190, __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)) { @@ -15813,14 +15719,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_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, 282, __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, 282, __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, 282, __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, 282, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr) < (0)) __PYX_ERR(0, 282, __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)) { @@ -15829,14 +15738,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_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, 289, __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, 289, __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, 289, __pyx_L1_error) #else __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_genexpr) < 0) __PYX_ERR(0, 289, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_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_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_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -15845,14 +15757,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_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, 313, __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, 313, __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, 313, __pyx_L1_error) #else __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_to_equality_constraint) < 0) __PYX_ERR(0, 313, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint) < (0)) __PYX_ERR(0, 313, __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_to_equality_constraint->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint->tp_getattro == PyObject_GenericGetAttr)) { @@ -15861,14 +15776,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_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, 332, __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, 332, __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, 332, __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, 332, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr) < (0)) __PYX_ERR(0, 332, __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)) { @@ -15877,14 +15795,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_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, 342, __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, 342, __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, 342, __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, 342, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_14_genexpr) < (0)) __PYX_ERR(0, 342, __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)) { @@ -15932,7 +15853,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}, @@ -15994,7 +15915,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 @@ -16024,12 +15946,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 @@ -16101,7 +16026,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; @@ -16144,48 +16070,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) @@ -16194,10 +16100,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); @@ -16215,9 +16121,10 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); * 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, 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_re, __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; /* "constraint/parser.py":4 @@ -16227,16 +16134,22 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); * 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, 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/parser.py":5 * import re @@ -16245,31 +16158,23 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); * 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, 5, __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, 5, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Union,__pyx_mstate_global->__pyx_n_u_Optional}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_typing, __pyx_imported_names, 2, 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_Union); 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_Union, __pyx_t_3) < 0) __PYX_ERR(0, 5, __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, 5, __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, 5, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Union,__pyx_mstate_global->__pyx_n_u_Optional}; + 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, 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/parser.py":7 - * 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, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - /* "constraint/parser.py":6 * from types import FunctionType * from typing import Union, Optional @@ -16277,78 +16182,22 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); * 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, 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_AllDifferentConstraint); 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_AllDifferentConstraint, __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_AllEqualConstraint); 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_AllEqualConstraint, __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_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, 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_ExactSumConstraint); 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_ExactSumConstraint, __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_MinSumConstraint); 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_MinSumConstraint, __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_MaxSumConstraint); 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_MaxSumConstraint, __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_ExactProdConstraint); 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_ExactProdConstraint, __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_MinProdConstraint); 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_MinProdConstraint, __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_MaxProdConstraint); 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_MaxProdConstraint, __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_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, 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_CompilableFunctionConstraint); 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_CompilableFunctionConstraint, __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_VariableExactSumConstraint); 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_VariableExactSumConstraint, __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_VariableMinSumConstraint); 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_VariableMinSumConstraint, __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_VariableMaxSumConstraint); 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_VariableMaxSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 20, __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, 6, __pyx_L1_error) - __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, 21, __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_VariableMinProdConstraint); 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_VariableMinProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 22, __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_VariableMaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __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_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}; + __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_VariableMaxProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 23, __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_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}; + 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/parser.py":32 * @@ -16357,17 +16206,20 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); * """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_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __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, 32, __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, 32, __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, 32, __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, 32, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __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, 32, __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_Union_Constraint_str) < (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; + 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":381 * @@ -16376,18 +16228,21 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); * constraints: list[str], domains: dict, picklable=False * ) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __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, 381, __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, 381, __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_U) < (0)) __PYX_ERR(0, 381, __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, 381, __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, 381, __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, 381, __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, 381, __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, 381, __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_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, 381, __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, 381, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/parser.py":419 * @@ -16396,16 +16251,19 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); * """Check if the string is a number or can be evaluated to a number.""" * try: */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_s, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 419, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_Union_int_float) < 0) __PYX_ERR(0, 419, __pyx_L1_error) - __pyx_t_2 = __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_2)) __PYX_ERR(0, 419, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 419, __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_is_or_evals_to_number, __pyx_t_2) < 0) __PYX_ERR(0, 419, __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, 419, __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, 419, __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, 419, __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, 419, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/parser.py":431 * @@ -16414,33 +16272,36 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); * """Extracts all operators from an expression string.""" * # Regex for all supported binary operators: */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 431, __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, 431, __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, 431, __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, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_expr, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 431, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_str) < 0) __PYX_ERR(0, 431, __pyx_L1_error) - __pyx_t_3 = __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_3)) __PYX_ERR(0, 431, __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_extract_operators, __pyx_t_2) < (0)) __PYX_ERR(0, 431, __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_extract_operators, __pyx_t_3) < 0) __PYX_ERR(0, 431, __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 */ - __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); @@ -16468,260 +16329,28 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); #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_VERBOSE, sizeof(__pyx_k_VERBOSE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VERBOSE */ - {__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_Variables, sizeof(__pyx_k_Variables), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Variables */ - {__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_d, sizeof(__pyx_k_d), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_d */ - {__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_expr, sizeof(__pyx_k_expr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_expr */ - {__pyx_k_extract_operators, sizeof(__pyx_k_extract_operators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_extract_operators */ - {__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_keys, sizeof(__pyx_k_keys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_keys */ - {__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_but_not_w_d_binary_preced, sizeof(__pyx_k_match_but_not_w_d_binary_preced), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_match_but_not_w_d_binary_preced */ - {__pyx_k_match_object, sizeof(__pyx_k_match_object), 0, 1, 1}, /* PyObject cname: __pyx_n_u_match_object */ - {__pyx_k_matches, sizeof(__pyx_k_matches), 0, 1, 1}, /* PyObject cname: __pyx_n_u_matches */ - {__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_not_in_tune_params, sizeof(__pyx_k_not_in_tune_params), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_not_in_tune_params */ - {__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_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_pattern, sizeof(__pyx_k_pattern), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pattern */ - {__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_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_var, sizeof(__pyx_k_var), 0, 1, 1}, /* PyObject cname: __pyx_n_u_var */ - {__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: 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, 72, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 176, __pyx_L1_error) __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_compile); if (!__pyx_builtin_compile) __PYX_ERR(0, 402, __pyx_L1_error) __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_eval); if (!__pyx_builtin_eval) __PYX_ERR(0, 423, __pyx_L1_error) - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 424, __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; @@ -16820,6 +16449,44 @@ 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, 381, __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 CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + } + #else + 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 CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + } + #else + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -16830,42 +16497,133 @@ 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_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__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; - 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},{19},{17},{52},{179},{59},{293},{27},{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},{35},{9},{9},{52},{46},{176},{20},{4},{21},{10},{8},{22},{18},{28},{10},{19},{18},{18},{12},{17},{16},{17},{16},{8},{20},{5},{7},{27},{26},{25},{24},{25},{24},{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},{6},{5},{16},{21},{22},{1},{5},{6},{3},{23},{24},{28},{25},{9},{17},{2},{2},{223},{50},{50},{69},{2},{2},{251},{177},{45},{392},{2},{2},{2},{2},{1757},{2},{2}}; + #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (3196 bytes) */ +const char* const cstring = "(\265/\375`\206\030\225c\000\n\201\320\033;\360\0327\314\300l\000\2222\3101\342\246\001+\244\220\224A>anJ|\310\265;\331\254\355.\321:\235\"e\202$\304EH\022@\t\000\000\001@\021\202K\002QfRT\021B\004\250\001\234\001\265\001*\253\232%*j\246B\256s\214\206l\212r\222x\273\250\rn\241\022'($*\313Ux\224\002uz\350\r\215\314\230\262\300v\263#L\215\226\013\3563E\313\334\310}\345N\201&\343H\3108\"2\352LB\234Dr5\256\366L\023\03705au\325(\334\347^G\030\222Q\310\352\024\335\2218\325t\247S\315\312)7\023\322\252\351\330\206\204\214Rf\253}#GV-\304\211\224\251\001\031\021t\272\235\216\214#\271\335[\201\255.\327r\264wj\251\026\335\251\031\225n\216\236 \354\310\333\247\310\351T\243#\021\311\t\327\022vs\0233-\317S\353j!\272\027\222\223\216\262\211\344vE\242s \"$33Y24345%\010\3438R\233\221\001\031g\310\220\020\021\247\020\223\221\357\"\255\366x\247\312\022\005uPk\352`\216FY\235\344\003\032\245h\220N\327\246\233\335<\036\2123\216\264)\252S\365\246\247\201\277\234^\357\226K\221r=\275\016\225l\336\323:\273\ne\321s\244E\245h\231\252h\253[5Mu\273\371\230n\256\327Qm\307s\357t\004\252\302\221\3273\226\360\275\n\3331E\333\036\n\334\215\362\326\334S\233\035\317T\217*.*$D9Dc\312\356\326D\331\226\217\302\336\336\241\275}\246\252T+\274\031[-\325\216\233\243\343\010m\206\244\215\264\231\031\332\270w\343\331\003\252R\034f\367v(\347\352:\266\252\320^\325\221U[\315\352\325\247\232\343\211\366tU\332\243\323\321\002A\267\310\255\212\275\000b]7\317\323/\000\376\255\333z\353J\024\2138\030\005Nz\370\001\375\347\336\270\263\330L\272|\2502\313|\200\377\350\275\341\002\327o\310\000\233\223\220>\322\321?\312\370\270\016\203{I.d\263\354\255I|\211\206\031k\310\020+\2221\014\310\207\371_\277\351\017\375\n\347o\236\327c\334Y\371\364\237t_\367\363w\344\r\331\346\344\377\336\033\017\210\017\001\233\213p\237%\016\305|2\346\260\206;`\001\330\350EyE(~@7ro.\201\2732L\200\025\365[\360\376|\260\027u\014\330|{y\036\347\227:J\277\260\271\017\261Yw\\\347\350\334\r\016\3650e\030;\000(\350B8\230I\277\0011\337""\270l\260\315\247j\311\252\353\n\344|\003\253\200V*+\325\226\245p]}\351N\325\022\345\225\373D\371\272\003\362\265e\317\335j\336>\333\315\313R\312d\365\346|\003\177h\n,\317\235\352\335\246\272*\270\2436\273Y\266,\253Vu\2452\3215m\317\335[\321\266\007\364\tW^\232\272\267n\266\204\306T{2%\234-\313ss`\311\327V*\ne\333\315y\225\345\261\275\236>\257R\224\307\203\301m\356\340\336\033m\321\315}\352\331\226\224\234m\271\267\211\236)P\345\225|\247\226\373TM^\252\346\2462\365n\233\245o\267h\273\243\312\262\344\033\030\264\206\033\337\301\360q\304\240\227\037\020\273p|\216x \376\301-\260\003\t\313`\233\3067\3508\256~Sv\376c\366g\r\246OQ\210\025\003`\211\243>\3534\267eV\351\026\2609G\364\211`>L\307\267y\016\230\201\356\031\004\305\333L\006\347\274\004\257Q\014\202x$s\3102\231%\216\241}]\224\305\001\261\360Uy\311\367\364\0371\020V\201\333\327c\342\3275\334\210\027\000\013HGr\r\210\026b\030\274\362\372\272\306\013\000\245+\303o\274\000f\000\r]\004\263\255_h\231)\236\361\370\036\000\277\030K\230\003\336\025_\353\262\231+\203\025_\004E\214\235\376\032\352C\345~n\344\333\336\247~\353!\256\203\354\2031\024$\024fR\326\301\027/\353\r\374\210\223\243\342\216\253\367\307\333|\226\033\313\300\276\250\236\321 \213_0>\206\367\2718\027\346\346KWa\010#\210u\357\355\035\251\370\026/\200\210\256\202\327\354!\233\0034\261\2008\025\373\3006\270&\025\365\315o:}\247\246\337\224\363o\362\203\314\306\0211\013L\356h\263Y\211\210BL\222_\362.N\211\311X \336\301\005\360\3575\271\370\267~\341I\317\273\356\020\375\300m(\202<\3749\212\367yK\177I\351+\025}N\324D&\031E\336qG|\3028x\006\007\3008\257\355M\332\360\033/\320Gx\226N\366\212XQ\326 {i~\243a\266\275\003\257\2047{\007\303\3160F\306[\257\t\301\307\2718\370\327=\372\351\246\270I\303\333\3206L \230\311W\340\375\360\024=\240\303\334\035B\227\0362\274p\376\025\277\376\3638\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\300\002b8\300\354zJwa\210I\340\007&\367\346B\014\364\t\205\231\354\026\262n\2721\256\303>\377\231\364c\210\t\262D|\000O\371\016\257\323\201n\323\320\326\023\\\331L\201\342&\277\304\346\014]y!\266\362-\226\021\312*\262\003\216C\034\020qd\233\\\303\021}#b\217L\300\004\337`\025\212\032\361\224qrOl\213c\310y\324\340DT\356\220\005d!\313\305L1\201\345J\314`>\207\213`\016\030E\342\313j@~CQ\346\033\r\300'\020\3745\231\375\"\321\377\021#\210=\266\037p\003\211\3156\330\005\344\025\371\271\023\262[\274\021\013\275ZR\256\215;/\375\034\361F\004*\371\270\367b\312\2150\0338\276@\237\210\025\315\335\337\341\376\021\361E\224\220\017b\034\230W\361\352\251\301`]6\035XE\343k\304\002<\336\214\237\361\352\267$6{t\020\367AA)\351W\305\310\244l\343\3613<9\303\275\034G$\025\014\322\354\025|\031\3748\273\331*\356C\313B\3741\371&\305\221\"\016\346\203\300(\260R\214\022\307\374`}b\361\037\315R\234\007C\266\367cU\222\001Z\001\277\207A\305\230\202#z\000\025|\364\257d\r}\024-\347\372\245\356\352Y\343\026\213\\\013\200\024\205p\216\203\336D\300(\345\177\3200\257nV[\2555\005\255\316d}+\272$\207!\027\365H\003\201\372\224?[u.\2331\353b\006k \352A\021\241\342J\256\224\335\362\336H\337,\304\224\242\354\212 \243\233\215\305\371\311BU\264\213\016m\306\025\253\365\376\220\n\223\320\3623\242R#\314E'=\2445\373\017\303\361@!:\255\364\321q\204\255\220\n\31530\364\255\223?m>\342\234\322\302*\231\027\326\326\rNmx\265m`u\n\034\251\230S\251\000H\007\231C\265\222\245\276\3323\226\353\007\262\253^5;7R #\312\254\263\310\022\005e\365\214'\203\327\314)\355\227\261\024c\215\337%\346\017\365\217`\251\202\021\022\365l`\334A~V\255\276\030\263pR\310g\r\222\336\255Co\330\305\355\323\265[\245A\241\340\205\265j\t-)\306\312\313\263;\224nS\032^\271\213\021\341\240\337C\260\331W*I\237\231\200y\374\233\241=\345\267\014\353\222jQ\220|\345n$y\247\234\0225d,\323H\2026-p \364>I\362I""\272\317}\021\020T\200C\315X\257o\246w\236D\205W[ \344p\201\245\263re\344X\230\257\372x\252\003;\264?\316\271a\337\323\224$x\357\201x\321\021\373\323Od\260wV!\325\316bIw\205gc\333%A\303<%\207\177\036\001p\371L\357\323\373VTh\371\347\315\023\022~$\266\202\371g-\221\336\221\004K\177lp;\373\300\373_` 9\3714\2471=\342\323\271({\372\237]s\333\3562+\373\226H\014L\244]\225\327\004M\230\024gX\020C\233(a\224\004\0029\325`\362\343r\302\340\273*NJ\002\005\241\3029\376\213#\006\350\302\264\307\r\267\020\272\022V-\"\252\271\\W#\265\004zaXp\203\034\225B}uW\007\326@\322eCnlSi\004\022\314\343\325\203|B\016\003\373\301\344\177\323\234\300\005\202C\307\263U\262Y\214p_\236\372A@\353\235;Z\000\246\025K\036'\037\244qE}\031\234\375K\233y\370\253\030\370\031s\244\204./\3177\320^\230\210G\362\366\221\230\257\310Yz\301*8k\341\201u\366i3\266\214\365K\220\326\206\201\031\005.\356\026\370\222.\241TN\220\231\241x\342\351In\255)\000\241\246\236q\321\215\360\260\034\023p\023\341\215\335\253O\342l\335\273\320\317\340\375\275\037\376n\241\027\354\327b'\2012\\ \r\350\021\302\022\224\001\306\330\032iA]\013q{\305\300K\374\202\261\022\023Z~\222H\022C\334\034\001"; + PyObject *data = __Pyx_DecompressString(cstring, 3196, 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 (3276 bytes) */ +const char* const cstring = "BZh91AY&SY\003\337\334\362\000\002\003\377\377\377\377\377\377\377\377\377\377\277\377\377\377\377\377\377\377@@@@@@@@@@@@@\000@\000`\014]\337\014\363\275\256\303qs\235z\363\316.\207\263\222\344\2673\254\333\255\227\200\000\033\325\tBD\321\014\232\243\332L\230\023OF\206\206\231G\202j4O\006\210m5O\324\3041L\217OT4\365\031\244\304<\223\324\364\323#S54\022\204\215L\310\000\246\232O@C)\344\324\323CM=#M\006\203M\006 \r\000\032\032h\000\031= 4\323@%\020\304 \241\225?M\024\364\206\324\365\006\2154\036\2404\000\000\000\000\000\000\000\000\000\003 Jh\204\322h\3212bS\362BmO\0244\310\003@z\200\0004\000\000\000\000\000\r\000\304\365\002\014\000\023\000\001\030\000\004`\000\215\030\232`\t\200\000&\021\204`&LF `H\24250\247\222h\306\223*~\202\236\247\351F\230\236\240\006C\324\3204\000\003 z\200\000\0314\311\241\211\240\3654\031fJ\342XW/K\365\332w\341\262&I\204\231\270[\327\336\376\177\240\3477?\241\"Q\022\211\022#\371\222=)1\377\312\020\200\310\214\307,\345\242\213S\002R\345Aspe\020\303\014+\t\177\371\316\270\221Q\"m\205\277\327\250\254\241`-M\215\200\332ll\033@\330\330\335e\372\357\023\027\301M5\362\302\237\033\354\336\336\303\270ic\215\363*\025\267B\342\312\rT\306\323M\246\30666&16\306\233.\254r1v\270\224\207\331\344\236\nE\327\032\202\250\256tI\003y\006[\244\222\265\264\304\306\t\t&\027M+\340B\n\327\026@//\r\206\304eS\242\222\2056su\325\211\335]\203\tI\327`/\235\251&d\311\027\026\027Y<\230\314\211\206\300\343\261\n\021\344J\350\246#\355}\261B6\013NG\276\025\3518\262,\362\333\237\021%\271\341v\260\323F{dB\260\264\342O\t\311B\204\262\243\214#\214\220+\201=\316z$\203\033[BJ\231\211G\253Bi\266\206\260r v\305\3077eT\246\"2cb\234\205\336\004\373\025\023\037\005S\251\320g\276r\252r\377'\177\203\207\232+|\232'\275\242Bc\226\263\316\005\205\t\310\212\350\364\177>v\376.=e\207>5-\033\356q\003\263\222E\232k\361\262\354\224\3273T\372o\337\244\222\3709\242C \264\266\277\276\277\241T\034d\032\302I\303\022\366\357\307H\235\024\213hR\307\014\224\030j!DV\304\341$\342\202s\266DM=\002M1\034\236Ve""\200\314\2140\3271m\257\234\307\002\200\262/J\212\302y;\377\010\235\026y)\253\234\021\205d`\023\226\303\217QGz\361\351e\352\245;\\\\z\315S\227\262\331\246\363ND\022\271\214\222\r\352\370{\220\264\363\215\014sGb\355\206\336\35540\300\206\231\313~\372\223\262\265\027\251!\314T\270\327\360].}\025\342\370\335\014\331\272$\\\343ON\313x\342j`\310\231\325\226\312\n{\213\365<\236\221\241\360\245{\311\r^\016\365j\267+\001\314\267\223'+\340A\240`<\026\271q\310\2358\010px|2\3602\253\226\222c4\214j\3132h\354\264\014\321\320\246\322!\300\257\220\325\224\350JR\231\023\242\321E\205\223\273;\n\322nK\272i\346\366lE\370s2\003\020\303,J\372\3340\220DG\235\254\321\236v\204!\315\031\335\251\\\366\034\264z\021\3371\260\327\307\275m\241\365h\0333>\010\352,\233%\361\304\300\346}!b \034\035\270v\314\275\233\255\365PLL[L\233\306\232\272-\027Z\007\243\275\1771\004\2027n\3369\036\225\313\276i\032\3437+\247\001\205z\211p\032[\215\254\327J\021G\363\035\3517\207\262p\236s\373m\262[Gc\213\037;\271\347\244$\222YI\313\230\363\234;\244\222J\023\322\342\346lL\031\003\231\200\231\006L\247\007\347\370\361*r)\261\206f\2029\234TG5\016\037\246\262e\351\274\240\233\342\032\376mF\274k\005\255\206f33u'9\357I\272\207VR\027\220\352\362M\357\2423!\257\220\355\263332\324t\245\003CX\342kM)D7Y\251M\352\312\0162\2638\302\326S\0067\305-:Jd\366p@\257\007\300\233\247\271\327D\353\316\211\2040Ufffh%Ii\033\213o\3422\242D\t\354)0\2529;\207|\352aJ=\355\260\315\202\263\223\322E\372\024\263\022\255K\257Z\315vf\313\273\255\370\001Bb\3255\346\332\3311z\240\261\240\260\344+\301q\243V\330\336\211\326\276\365\"\321\225{7\261\2276p\257\276\257C\247;\273i;/\274\351\327\311\314MkY\033wD\262\256D\304\220\252\304\311z]\246\361\004\3046\265\365\001r\317\004\206\335\300\310\310\272\023#\232\317\222\312\235\304\312V\271\263\267\223\202J\312\3679&q\367Y02\210l\252\246\375]\266\311\351cK\017\241-\357=\237\304\321\312>:\221l\355{\tx\351\241\312I\360\341\252,s\013\000e\223\366\031\2739\330F9c\010\352\330=\033\275\271&$\254\343\014\304;X\231\2250{\224\317\272:\223\264\365\265?o\247\302\031\"E\314\212&\236\313\211\274\323\256\223\250ha\337}o\206\301\202\372\341\251\016)~\204\033\232\002\357\201Z\261\322]\230\366ODL\177\253&9\264Z\226\366k\027p\340\213\266\365\267LzQ\357\036\357mV\265\265\207o\246z\365\211'|\217\247\305WH\253\337\"\322\331\364\212\\(\266\332J\203\371\373\214\207\250\374\3234\244\372`y\375\2020{\212\346\362~\3478d&\305\325[%g\343\342\342\252\342\3115\305g:\361_z\0100r\035\013B \347\333\034\356\222I\346f\241b3\260\213UVh\345\326hF\227S \264\245\017r\251C\336\231\324\372\210\260\302\322ki-\005U\213Np\354\332\3321|4]\220\231\2010\236\345\254\327y\260\"\225\226\341\367\t$\325Md\220\035\366\363e\224\257\013dI\312\245s\326\014\341\\g\271\262\311KO\347\337\225\013)\241As\342i\325\234lr\255s\212\271\250\373\315\262\304\224\362\337\033\276\336\250\352io\374]\311\024\341B@\017\177s\310"; + PyObject *data = __Pyx_DecompressString(cstring, 3276, 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 (3177 bytes) */ +const char* const cstring = "x\332\305WK{\323H\026M \001\003N'&\016\341\021@\316\203\274\023\034B\200<\3403\001\272i\246!NBx8n\265l\225\023\201-\331\222\234\216\351\236\371f\351\245\226Zj\251\245\226Zj\351e-\275\364O\340'\314\275%\333q^\014\314f\302g\251TU\367\326\255{\3179U\214&\223/\345=!+\211\\Z\311\345\005U\320\025\225kt)y\342w\274Vt.\257h\232\224\312\222\305\326\231\332\256R\314\212\\\212p\243++\243\034\364\214FVF\2478IC\033\302\351\273\202\316\255\226\364]E\306>\221d\245\024\372$\331\022\247\351\252\224\326\211\212\223dn\355\371\332\364\374\303yN\220EN%\237HZ\3278\255\230Jg\005M#\032\247d\270TQ\312\352\222\314\351\245<\321f\270\227\031\256\244\0249\231\020\221\323\025.\017\363Z\r\364]\"s\032\321\261\301\215\n\262\254\350\202.)2\017\346\222\2743\312\211\222\n\213H{\004\255_\010Y\215\314\274\311\343\014!\233x+\303;\021\313f\237\027\212BvU\221!VA\222\365)\016\372\236I\231\014Q\211\254\037\364'\223GL\177\223\344\215b\256\325pKP%\001\322w|\344\371\276\220\326O\231}\322\330o\302\376i\276\217\215\300jk\252\"\236\022\310\321!\266\332i\363O\034\204\025O\365\177t\350X\222\330\364LV\021`h\235\370p\200\376\246\007\215\233\235\330\366\377MNLDV\270\261\345\225\361)\216\2738\363\344\361\312\343\345\277WV\246'\307\022\302\364\227\330\364G~\370\356\364\243\344\304\370\301w\362\310\210 \212\274\214\230D\204\245\233Q\315\002\2245\242\316\344K\211\311\351\344\223mqR$\031N\035\023%\rc 2>w\322\210^\231H\000&\225\023\030t\345\035\204\373\301\366`\206?Y\314J\232\236\200\336$k\350\305|\226$Z3\324\034\237\342\374D@{\n\370\"\223d\262\325\306\037l\265\364\215\232\366\311\344E\256\3767\366d9\262=1\216\311\362;\376\206\337\020\227\023\364\364.71\001\344\3219\330=4'ZmV\022\333\177\216o\213\311\361\355\351\246MJ\222\005\265\304M/ry`\010\021\201_\251\022\267'\250\263r1\007\354\235Mg\025\r\267?\336\364\224\230\334\236\230Mr\207\377\032\253ONq\023S\334\254?\031c@\016\027e\302\243\210\3444\016\323\3507\023\376\213\227d\221\354'F\307\027A\t\364\242*s\313~\302\037\237\314\276\343<]\005\205\222\262X\214\027E\231\201\252u\254""\321:\001\321\307\371v\334A\243g\023t\350\030\310\217R\360\030\313\216\362\277\301\t\236_+\355\303\357\031\220\200\177M\366\365u\222a\000\330z\276\376\364\315\306\363o\320\360t\2618\225\213\247)\306\251\342p\232|\tZINK\312LZQ\225\"\2503\321x\236I0\277CtI'9\374\204n\250)\017\026i\222\022\322\237\021@$\255\360\214\205ZZ\021\t\257\244P\362\017N\226\203\226\326\322\3443JQ\026[;\000*R\232\2609R\226\324_\274^\367\315Bl\014\212\207\373\032\315\203\326\314\211\3433\276@\264\214\301\212\272\250\344\240\r\214\027\tBO\322%R\217\216\300\331I\366\2018\373@\237}\334\263\3167\016R-\003\334\312J_\016\305\002}\242\220\315\342\013\022\246fT%\367\231\224 \217\031\000\232\377\334!2\272\333\201\034\347%\306\016H\351\221uyI\343\233U\200\266\242\362\030\212\206\311\360\211\213\345\320\3005z\317\222\214\216?\034bo\225\340\206D\242\262/\355O!\017\245\303.|\002\215\353\025bm,rN\021\213\220i\370\223\205\034\274!@\035\177\274\246+y\177=E\311d\340\004nl\276\231\204f\303\017\374\340\023\227>\370R\245\235]=\317$\301\327\205\272:\0245\"\2664y\224CV#\330C\363\020\321\216\367\314,g\2254$\344\361L=\235\337\232\242\222|\026\320\3127W\376\316\231\274\226\207\242|k>\224\243^\272R\013\010~(\270\223]\374\027\213\\\021nOp\254|w\226|\334\000l\322\337\212\363G\003\377\016\227?\354\201\031\210\255\026\307{`\253:\260K\316K\351\317\354d\310+y \350\036\303+\317c:} \253*\034/;d\277\016\373\275\272\360\235\324\207\034cQ\010\262^\207\301a4\234\204\r\210\251%\254\326\010[\333\240\232D\220\211xR\037_\224\245B\221\034\032\362\273\032r\350\037\233\214@\354\2019\363\033M\232\373\237\310s\270.\013jz\027\265\214\347\201\257uBC\013nB\002\240\206\205\315\036\207\022\312zt\"\302\366U\035\272q$\0177p\364\231\207(5\tt=#A?\217\n\014\327\033\031\246\347\362\360\225/\361\274\016\256\340\271\253*\177\236\214\347\3230{\"\004Z.\024\354\377\007\376-\277\210\007h=5Ma9\372\315d\347X'\313\317\036\010h\221\260\207\006E?\250\373!\333\023\272}\353F\277V\314\347\025\025Ru0\2439vt\341\306\300A\203\207\377\264\3402V\324\211\376;V\355\033\264""\"\325\013\027\277\236k\273\020,\337+\013\345}C3\207\314\270)T\203\275F\024\373\007\3149\363\275\025\2672v\254\032\270i\256\233\373V\301>g\013\265\300\245\362}\243\303\210\031\033f;\2756i\317\331\033\316\031g\330\021\034\315\215\320\2457\025\225\306\327\231\233j\240\217\366\2150\037\253v\201\336}\352\rz?\323WI\232\374\235\376\316\343\"ac\311\314X1+\216^1\216/f\257\271j\026\254\000\035[t#\265`w\371/\214\253\332\323O\373\307\355P54\200\303\354s\332\216\343*\213f\234\336\332\244\233o\351\333\255j\240\273\\\200\355\005~*g\315;V\273\025\252\202\337\371\262fD\252\301\260\261j\024\314v\260\241\275\030\365\2263\347\304k\030\347\277c\265o[\364\033\272\0315clS\314\202\266\r\230\277X\261\257\301\266\316 \314\3363\326\215}\210\272\323\212\303\256:\273\313\302\327\213\370J\031\001\263\335\274f\335\261\317\330\221j\307\245r\264\034+o\031\367\014\321\0341\013N\334\210\323\216Y\373_.l?\202+\007\313?\343\002\335\254\034\303f\332\352\267\317\332\321j\317\2405j\207\300CO\250\026\274nF\314\005\353\212U\204\272\004\007\255A\310\336\226\035\265\2379\355N\330\211;\242;\354\022o\316\373P\021*\032]\177G\337\275\247\35734\263S\005\267\260+\332;\206>k\207|\366\030\027\314>S05+b\301r\003\260\325\236\001:0k\027\234sN\312=\343F\334{n\312\353\364\266*s\225w\220k\260\252\206G\031 RP\374\210\263\340^qU\257\327\213\321\347\037\351\307m\272\235\246i\\\225\356\3546\226\032w\242\316\257\356\247\312\271\212\340\327\251\275\032\032\301\330\253\235\347\276^i\353\274A\257O\3311;\351B\246X1;\002\345.\203\267bX\221E#n\344,\226\033\250\376Mz\363\221\033\002|\364\3342w\000_9g\331EP\030\177[Q\353\225\375\005\306\206\335\035/\316f\342.\240\206\234u\336R\355\001'\351E\252]\375P\327.@]\275\367\246\223\363\300\367ec\302\214\231\277\333Q:\225\240\t\330\304\037\364\017\201\n)\254i\260\014E\277\211\214\250ut\326\002!#\014\021\261\215|1C\346\270u\337ng\273\252^\n\326\360M\333F\350\310\212\373\301\023\320z\300\214V; _`\373\265\247\r\366\033n\353\034\264na\351\277\316\265u\3366s\366}'\340\376\004\263\327\316\30380\307xk""\216\371$]h\353\274b\000Dn\003\302\332\255\253\220\312\021[w\346\235\242\013\251\271c\211v\304\236\267Kn\273\033\252\301\247@G\227\334\005/\344\ry\233\225>\3145n6\0100\331\260;\354\347N\010\343\t#\005\242v\254\326q\013(\017\211>\017\221\007\206\240\370\214\352 \023tx\221.\256\3215`\026\0244Q\r\3340\347q\375*\206\201\025y`\214\232as\023\342\351w\332k\301.Di\304\272g\245\201\245=a\032\276c\245\000h\367l\001\276\214g\346yz;\352\204\234H\313\327e\007`\010Yz\340\024\334\263.\344\177\210\016=t\333\351\243\337*\300\354n\332=l\255B\312zF\351\350\212\033\247\217\327\351\372\006\254L/q\326Y\204\302\220\365\220\001\277\323\211\323\005\034\244\033\233\030\347\003k\020\242\007t \341\354\210\023\261\" L\035\223\366\nK\360p\253\346\r\202\234\374\005,`\314\016\\1\004c\317\334\262\026\354>\210;0`>5w-\301\322 \341\005\347'W\250\253\024\355\036\264\206\254\370\201\306A\326\255\002\352Ywy\327 \346C\213)\350uzm\002j\003S\256\323\353,\335\325\206\375mS\265.[\363\3409B'\227\335\247\340\332w\306\266\206\220\217X\275\250\213\260\037z\343.\260Pp\nMk6\206\210>\213uZr\347\\\210\005%\355\235\003\304\235s\306\350b\0344\270\2069\234B\351\255\0015\3401Kg_U\026`\004\023\tL\322A\211\240<\275\306<\214B\301\010\304\270\312\330\022\346\254n{\037\352\322\t\256\303\276\312\274\205\275,\202\302|\006lE`\177\260\353M\300\342\220\035\207\\\205#\200\346\303\006t\344\251\027\361\226@\207\366\200\315t\353\335\377aI\260\351\3525\306@m\341\364\252\006A\rfl\301\206\326-z\253\256\013\014d@\336\340\010\020\244\035\300\033\274Mo\317;/@\363\242_\003pD\241bb\177\000@=\316$\023t\372%\234~\235\200\376\353\200\360\214\363\314\275\340\365W:+\2334\016\302\221\242\251t-\210\005\007\266\325\202W\3153\310d:\004\222\205\361\364\240\014\303\271\227\006\305\307\272\300\202x\242]1>\001\273\007\3548\235\371G%VI\320\367xNV\221X\200\014\343\251\261\013\002\375O\373\265;\350\306\300M\350\252\201\210\353\232\264\307\200T\260\332C'Z\r\216\001\305cp\036\267\323\350\313\312\225J\201\256!)@\260ku?4L\371?NZ\343\330\244\232/\0254\202\034\210\263K\207U0\013\377\001]{(_"; + PyObject *data = __Pyx_DecompressString(cstring, 3177, 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 (6534 bytes) */ +const char* const bytes = "']]Invalid comparator Invalid operator Not 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.Optional[Union[AllEqualConstraint, AllDifferentConstraint]]Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, VariableMinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint, VariableMaxProdConstraint]]Optional[Union[int, float]]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(disableenablegc is neither a string or Constraint isenabledlist[str]list[tuple[Constraint, list[str], Union[str, None]]]list[tuple[Union[Constraint, str], list[str]]]\n (?AllDifferentConstraintAllEqualConstraintCompilableFunctionConstraintConstraintExactProdConstraintExactSumConstraintFunctionConstraintFunctionTypeMaxProdConstraintMaxSumConstraintMinProdConstraintMinSumConstraintOptional__Pyx_PyDict_NextRefUnionVERBOSEVariableExactProdConstraintVariableExactSumConstraintVariableMaxProdConstraintVariableMaxSumConstraintVariableMinProdConstraintVariableMinSumConstraintasyncio.coroutines__class_getitem__cline_in_tracebackcloseco_constscode_objectcomparatorcomparatorscomparators_foundcomparators_indicescompilecompile_to_constraintscompiled_constraintsconstraintconstraint.constraintsconstraint.parserconstraintsdictdomainsendequalities_foundevalexecexprextract_operatorsfinalized_constraintfindallfinditerfromkeys__func__funcgenexprgroupiindexinequa""lities_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_paramstypestypingunionunique_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\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\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\360P\007\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$\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 < 213; 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 = 213; i < 232; 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 < 232; i++) { + if (unlikely(PyObject_Hash(stringtab[i]) == -1)) { + __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = stringtab + 213; + for (Py_ssize_t i=0; i<19; ++i) { + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + } + #else + 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 CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + } + #else + 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 ); @@ -16874,109 +16632,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), 99, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 99}; 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), 99, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 99}; 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), 110, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 110}; 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), 155, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 155}; 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), 175, 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_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_k_q_2, 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_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), 184, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 184}; 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__26, 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_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), 185, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 185}; 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_1_2, 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_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), 190, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 190}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; - __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__27, 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_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), 282, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 282}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_o}; - __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_Q_2, 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_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), 289, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 289}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; - __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_k__28, 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), 332, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 332}; 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__28, 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), 342, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 342}; 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_2, 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), 38, 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), 46, 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), 56, 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, 41, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 81, 1732}; + 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_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; + __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), 313, 222}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 313}; 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), 32, 389}; + 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_m5_aP_U_6_Q_q_t4uA_d, 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_aP_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), 381, 175}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 381}; 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_V1_A_UUV__A_Qm1_q_9_gQm_q_1Kz_g, 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_UUV__A_Qm1_q_9_gQm_q_1Kz_g, 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), 419, 45}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 419}; 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_k_XQ_Qa_z_5_q_q, 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_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), 431, 69}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 431}; 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_k_HA_4vRxq_Q_a_b_1AV3d_q, 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_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; @@ -16989,27 +16747,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) + /* 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) /* 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:; @@ -17050,7 +16823,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; @@ -17091,7 +16864,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 @@ -17150,7 +16923,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); @@ -17160,7 +16933,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 @@ -17199,7 +16972,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) @@ -17212,7 +16985,7 @@ __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)) { + if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) { Py_DECREF(res); return NULL; } @@ -17255,7 +17028,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) @@ -17303,7 +17076,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); @@ -17438,120 +17211,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; @@ -17571,7 +17231,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; @@ -17591,7 +17251,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; @@ -17646,38 +17306,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) { @@ -17690,7 +17328,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; @@ -17766,14 +17410,129 @@ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { result = unbound_method; } } -#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - if (unlikely(target->method)) { - Py_DECREF(result); - } else +#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if (unlikely(target->method)) { + Py_DECREF(result); + } else +#endif + target->method = result; + 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 - target->method = result; + 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 @@ -17829,7 +17588,7 @@ static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObje } } -/* ParseKeywords */ +/* ParseKeywordsImpl (used by ParseKeywords) */ static int __Pyx_ValidateDuplicatePosArgs( PyObject *kwds, PyObject ** const argnames[], @@ -17985,16 +17744,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) { @@ -18008,12 +17774,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( @@ -18185,6 +17954,8 @@ static int __Pyx_ParseKeywordsTuple( #endif return -1; } + +/* ParseKeywords */ static int __Pyx_ParseKeywords( PyObject *kwds, PyObject * const *kwvalues, @@ -18230,7 +18001,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; @@ -18299,17 +18070,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 @@ -18336,7 +18111,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_le return NULL; } new_len = left_len + right_len; - if (__Pyx_unicode_modifiable(left) + if (__Pyx_unicode_modifiable(left, unsafe_shared) && PyUnicode_CheckExact(right) && PyUnicode_KIND(right) <= PyUnicode_KIND(left) && !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) { @@ -18360,7 +18135,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; @@ -18432,98 +18207,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 + if (!is_positive) lla *= -1; + goto calculate_long_long; } - 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 - } - 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 @@ -18561,98 +18306,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 + 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 + if (!is_positive) lla *= -1; + goto calculate_long_long; } - 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 - } - 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 @@ -18689,69 +18404,77 @@ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { return r; } 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_ASSUME_SAFE_SIZE Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } + if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS)) { + return __Pyx_PyList_GetItemRefFast(o, wrapped_i, unsafe_shared); + } else 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_NewRef(PyList_GET_ITEM(o, wrapped_i)); } return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(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_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } 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; + return __Pyx_NewRef(PyTuple_GET_ITEM(o, wrapped_i)); } return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(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); + if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)) { + return __Pyx_PyList_GetItemRefFast(o, n, unsafe_shared); + } else if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + return __Pyx_NewRef(PyList_GET_ITEM(o, n)); } - } - else if (PyTuple_CheckExact(o)) { + } 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 +#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)) { @@ -18770,15 +18493,11 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, return PySequence_GetItem(o, i); } #endif + (void)wraparound; + (void)boundscheck; 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); -} - /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { @@ -18786,7 +18505,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)); @@ -18896,7 +18615,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 @@ -19061,7 +18780,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); @@ -19120,13 +18839,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; @@ -19269,47 +18988,6 @@ static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, #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; -} - /* py_dict_keys */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) { return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_keys, d); @@ -19428,7 +19106,25 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } -/* 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; @@ -19464,7 +19160,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; @@ -19486,7 +19182,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); @@ -19521,14 +19217,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); @@ -19543,11 +19236,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++; @@ -19579,35 +19274,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); @@ -19680,11 +19406,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); @@ -19710,26 +19438,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 }; @@ -19740,13 +19481,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) { @@ -19765,7 +19507,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; @@ -19791,15 +19533,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; @@ -19821,17 +19568,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 @@ -19846,6 +19592,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]); @@ -19874,7 +19623,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)) { @@ -20026,47 +19775,20 @@ __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void __Pyx_END_CRITICAL_SECTION(); return 0; } -static PyObject * -__Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op) -{ - if (unlikely(op->func_dict == NULL)) { - op->func_dict = PyDict_New(); - if (unlikely(op->func_dict == NULL)) - return NULL; - } - Py_INCREF(op->func_dict); - return op->func_dict; -} +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 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; + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; } - Py_INCREF(value); - __Pyx_BEGIN_CRITICAL_SECTION(op); - __Pyx_Py_XDECREF_SET(op->func_dict, value); - __Pyx_END_CRITICAL_SECTION(); - return 0; + Py_INCREF(op->func_dict); + return op->func_dict; } +#endif static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { @@ -20328,8 +20050,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}, @@ -20350,9 +20077,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}, @@ -20408,7 +20137,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; @@ -20462,7 +20193,13 @@ __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); @@ -20510,7 +20247,20 @@ 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); @@ -20622,7 +20372,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 @@ -20661,7 +20411,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; @@ -20683,11 +20433,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); @@ -20722,11 +20468,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); @@ -20761,11 +20503,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); @@ -20796,11 +20534,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); @@ -20825,7 +20559,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[] = { @@ -20854,9 +20593,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 }; @@ -20941,7 +20681,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))) @@ -20955,7 +20695,7 @@ static PyObject* __Pyx_Globals(void) { return __Pyx_NewRef(__pyx_mstate_global->__pyx_d); } -/* GetTopmostException */ +/* GetTopmostException (used by SaveResetException) */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) @@ -21037,7 +20777,30 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject } #endif -/* PyObjectGetMethod */ +/* 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 (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 @@ -21126,9 +20889,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)) { @@ -21141,9 +20911,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; @@ -21313,19 +21084,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; @@ -21336,145 +21209,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 */ @@ -21516,55 +21261,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) { @@ -21716,8 +21450,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); @@ -21726,7 +21459,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; @@ -21818,7 +21555,7 @@ 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; @@ -21866,7 +21603,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 @@ -21874,10 +21611,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 } } { @@ -21960,7 +21695,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)\ @@ -22056,10 +21791,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 @@ -22128,10 +21861,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 } } { @@ -22310,10 +22041,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 @@ -22382,10 +22111,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 } } { @@ -22577,7 +22304,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; @@ -22631,7 +22391,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)) @@ -22654,8 +22414,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); @@ -22663,9 +22423,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); @@ -22682,7 +22441,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) { @@ -22736,7 +22495,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) @@ -23419,7 +23178,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); @@ -23620,7 +23381,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); @@ -23709,7 +23472,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[] = { @@ -23743,10 +23508,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 @@ -23778,36 +23544,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; @@ -23891,9 +23627,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 @@ -23905,10 +23645,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; @@ -23929,11 +23669,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); @@ -23956,11 +23697,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 @@ -23968,30 +23708,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 @@ -24213,7 +23991,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.c b/constraint/problem.c index 7a74fe0..bb0e06b 100644 --- a/constraint/problem.c +++ b/constraint/problem.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.1.2 */ +/* Generated by Cython 3.2.4 */ /* 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_4" +#define CYTHON_HEX_VERSION 0x030204F0 #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,6 +888,22 @@ 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 +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 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) @@ -907,6 +921,12 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #else #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) #endif +#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyList_GetItemRefFast(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_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(o, i) +#endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) #elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS @@ -966,15 +986,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 +1092,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 +1140,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 +1351,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 +1387,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 +1412,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 +1422,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 +1438,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 +1454,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 +1471,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 +1487,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 +1517,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 ### */ @@ -1656,7 +1677,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 +1685,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 +1703,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 +1728,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 +1749,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 */ @@ -1773,19 +1794,10 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #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 +1807,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 +1859,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 +1921,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 +1945,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 +1981,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 +1998,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 +2028,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 +2048,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 +2079,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 +2089,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 +2106,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 +2127,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 +2148,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 +2185,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,6 +2220,11 @@ static void __Pyx_RaiseClosureNameError(const char *varname); /* RaiseUnexpectedTypeError.proto */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); +/* PyRange_Check.proto */ +#if CYTHON_COMPILING_IN_PYPY && !defined(PyRange_Check) + #define PyRange_Check(obj) __Pyx_TypeCheck((obj), &PyRange_Type) +#endif + /* DictGetItem.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); @@ -2179,19 +2245,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( @@ -2205,6 +2271,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 @@ -2212,19 +2295,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 @@ -2232,20 +2315,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 @@ -2261,28 +2340,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 @@ -2312,14 +2402,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; @@ -2364,7 +2455,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) @@ -2389,10 +2480,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) @@ -2408,14 +2499,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 @@ -2458,7 +2549,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 @@ -2496,7 +2587,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); @@ -2504,16 +2604,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 @@ -2530,7 +2630,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; @@ -2598,12 +2700,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*); @@ -2661,210 +2763,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[] = "?"; -static const char __pyx_k__5[] = "\240\021"; -static const char __pyx_k__6[] = "\240\001"; -static const char __pyx_k__7[] = "_"; -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_count[] = "count"; -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_unique[] = " unique."; -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_Constraints[] = "Constraints: "; -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_Duplicate_configs[] = "Duplicate configs: "; -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_180[] = "Problem.getSolution (line 180)"; -static const char __pyx_k_Problem_addVariables_line_118[] = "Problem.addVariables (line 118)"; -static const char __pyx_k_Problem_getSolutions_line_199[] = "Problem.getSolutions (line 199)"; -static const char __pyx_k_Union_Constraint_Callable_str[] = "Union[Constraint, Callable, str]"; -static const char __pyx_k_Problem_addConstraint_line_141[] = "Problem.addConstraint (line 141)"; -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_9Ct1_D_AQ_4z_V7_4t7_8ST_T_Qha[] = "\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\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"; -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\320&\\\320\\]\330\024\026\320\026-\250T\260\021\260#\260Q\260a\260r\270\024\270U\300/\320QT\320Tb\320bh\320hi\320il\320ln\320no\330\024\026\320\026'\240t\320+<\270D\300\001\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 out of "; -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, set, 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_218[] = "Problem.getSolutionIter (line 218)"; -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 */ @@ -2880,7 +2781,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*/ @@ -2908,24 +2809,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; @@ -2936,12 +2819,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[179]; - PyObject *__pyx_int_1; + PyObject *__pyx_string_tab[192]; + PyObject *__pyx_number_tab[1]; /* #### Code section: module_state_contents ### */ #if CYTHON_USE_FREELISTS @@ -2976,6 +2861,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; @@ -2984,6 +2872,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; @@ -3013,128 +2904,128 @@ 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 __pyx_string_tab[10] -#define __pyx_kp_u_Constraints_must_be_instances_of __pyx_string_tab[11] -#define __pyx_n_u_Domain __pyx_string_tab[12] -#define __pyx_kp_u_Domain_is_empty __pyx_string_tab[13] -#define __pyx_kp_u_Domains_must_be_instances_of_sub __pyx_string_tab[14] -#define __pyx_kp_u_Duplicate_configs __pyx_string_tab[15] -#define __pyx_kp_u_Expected_constraints_to_be_strin __pyx_string_tab[16] -#define __pyx_kp_u_Find_and_return_a_solution_to_th __pyx_string_tab[17] -#define __pyx_kp_u_Find_and_return_all_solutions_to __pyx_string_tab[18] -#define __pyx_n_u_FunctionConstraint __pyx_string_tab[19] -#define __pyx_n_u_Hashable __pyx_string_tab[20] -#define __pyx_n_u_ImportError __pyx_string_tab[21] -#define __pyx_kp_u_None __pyx_string_tab[22] -#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[23] -#define __pyx_kp_u_Obtain_the_problem_solver_curren __pyx_string_tab[24] -#define __pyx_n_u_OptimizedBacktrackingSolver __pyx_string_tab[25] -#define __pyx_n_u_Optional __pyx_string_tab[26] -#define __pyx_kp_u_Optional_Sequence __pyx_string_tab[27] -#define __pyx_n_u_ParallelSolver __pyx_string_tab[28] -#define __pyx_kp_u_ParallelSolver_is_currently_expe __pyx_string_tab[29] -#define __pyx_n_u_Problem __pyx_string_tab[30] -#define __pyx_n_u_Problem___init __pyx_string_tab[31] -#define __pyx_n_u_Problem__getArgs __pyx_string_tab[32] -#define __pyx_n_u_Problem__getArgs_locals_genexpr __pyx_string_tab[33] -#define __pyx_n_u_Problem_addConstraint __pyx_string_tab[34] -#define __pyx_kp_u_Problem_addConstraint_line_141 __pyx_string_tab[35] -#define __pyx_n_u_Problem_addConstraint_locals_gen __pyx_string_tab[36] -#define __pyx_n_u_Problem_addVariable __pyx_string_tab[37] -#define __pyx_kp_u_Problem_addVariable_line_86 __pyx_string_tab[38] -#define __pyx_n_u_Problem_addVariables __pyx_string_tab[39] -#define __pyx_kp_u_Problem_addVariables_line_118 __pyx_string_tab[40] -#define __pyx_n_u_Problem_getSolution __pyx_string_tab[41] -#define __pyx_n_u_Problem_getSolutionIter __pyx_string_tab[42] -#define __pyx_kp_u_Problem_getSolutionIter_line_218 __pyx_string_tab[43] -#define __pyx_kp_u_Problem_getSolution_line_180 __pyx_string_tab[44] -#define __pyx_n_u_Problem_getSolutions __pyx_string_tab[45] -#define __pyx_n_u_Problem_getSolutionsAsListDict __pyx_string_tab[46] -#define __pyx_n_u_Problem_getSolutionsOrderedList __pyx_string_tab[47] -#define __pyx_n_u_Problem_getSolutionsOrderedList_2 __pyx_string_tab[48] -#define __pyx_kp_u_Problem_getSolutions_line_199 __pyx_string_tab[49] -#define __pyx_n_u_Problem_getSolver __pyx_string_tab[50] -#define __pyx_kp_u_Problem_getSolver_line_72 __pyx_string_tab[51] -#define __pyx_n_u_Problem_reset __pyx_string_tab[52] -#define __pyx_kp_u_Problem_reset_line_44 __pyx_string_tab[53] -#define __pyx_n_u_Problem_setSolver __pyx_string_tab[54] -#define __pyx_kp_u_Problem_setSolver_line_57 __pyx_string_tab[55] -#define __pyx_kp_u_Reset_the_current_problem_defini __pyx_string_tab[56] -#define __pyx_kp_u_Return_an_iterator_to_the_soluti __pyx_string_tab[57] -#define __pyx_n_u_Sequence __pyx_string_tab[58] -#define __pyx_n_u_Solver __pyx_string_tab[59] -#define __pyx_kp_u_Tried_to_insert_duplicated_varia __pyx_string_tab[60] -#define __pyx_n_u_TypeError __pyx_string_tab[61] -#define __pyx_n_u_Union __pyx_string_tab[62] -#define __pyx_kp_u_Union_Constraint_Callable_str __pyx_string_tab[63] -#define __pyx_kp_u_Using_the_ParallelSolver_in_Thre __pyx_string_tab[64] -#define __pyx_n_u_ValueError __pyx_string_tab[65] -#define __pyx_kp_u_You_have_used_FunctionConstraint __pyx_string_tab[66] -#define __pyx_kp_u__2 __pyx_string_tab[67] -#define __pyx_kp_u__3 __pyx_string_tab[68] -#define __pyx_kp_u__4 __pyx_string_tab[69] -#define __pyx_n_u__7 __pyx_string_tab[70] -#define __pyx_n_u_addConstraint __pyx_string_tab[71] -#define __pyx_n_u_addVariable __pyx_string_tab[72] -#define __pyx_n_u_addVariables __pyx_string_tab[73] -#define __pyx_kp_u_add_note __pyx_string_tab[74] -#define __pyx_n_u_allvariables __pyx_string_tab[75] -#define __pyx_n_u_append __pyx_string_tab[76] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[77] -#define __pyx_n_u_bool __pyx_string_tab[78] -#define __pyx_n_u_c __pyx_string_tab[79] -#define __pyx_n_u_clear __pyx_string_tab[80] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[81] -#define __pyx_n_u_close __pyx_string_tab[82] -#define __pyx_n_u_collections_abc __pyx_string_tab[83] -#define __pyx_n_u_compile_to_constraints __pyx_string_tab[84] -#define __pyx_n_u_constraint __pyx_string_tab[85] -#define __pyx_n_u_constraint_constraints __pyx_string_tab[86] -#define __pyx_n_u_constraint_domain __pyx_string_tab[87] -#define __pyx_n_u_constraint_parser __pyx_string_tab[88] -#define __pyx_n_u_constraint_problem __pyx_string_tab[89] -#define __pyx_kp_u_constraint_problem_py __pyx_string_tab[90] -#define __pyx_n_u_constraint_solvers __pyx_string_tab[91] -#define __pyx_n_u_constraints __pyx_string_tab[92] -#define __pyx_n_u_constraints_2 __pyx_string_tab[93] -#define __pyx_n_u_copy __pyx_string_tab[94] -#define __pyx_n_u_count __pyx_string_tab[95] -#define __pyx_n_u_deepcopy __pyx_string_tab[96] -#define __pyx_kp_u_disable __pyx_string_tab[97] -#define __pyx_n_u_doc __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_duplicate_parameter_configurati __pyx_string_tab[101] -#define __pyx_kp_u_enable __pyx_string_tab[102] -#define __pyx_n_u_extend __pyx_string_tab[103] -#define __pyx_n_u_freethreading __pyx_string_tab[104] -#define __pyx_n_u_func __pyx_string_tab[105] -#define __pyx_kp_u_gc __pyx_string_tab[106] -#define __pyx_n_u_genexpr __pyx_string_tab[107] -#define __pyx_n_u_getArgs __pyx_string_tab[108] -#define __pyx_n_u_getSolution __pyx_string_tab[109] -#define __pyx_n_u_getSolutionIter __pyx_string_tab[110] -#define __pyx_n_u_getSolutions __pyx_string_tab[111] -#define __pyx_n_u_getSolutionsAsListDict __pyx_string_tab[112] -#define __pyx_n_u_getSolutionsOrderedList __pyx_string_tab[113] -#define __pyx_n_u_getSolver __pyx_string_tab[114] -#define __pyx_n_u_get_in_order __pyx_string_tab[115] -#define __pyx_n_u_getitem __pyx_string_tab[116] -#define __pyx_n_u_init __pyx_string_tab[117] -#define __pyx_n_u_initializing __pyx_string_tab[118] -#define __pyx_n_u_is_coroutine __pyx_string_tab[119] -#define __pyx_n_u_is_gil_enabled __pyx_string_tab[120] -#define __pyx_kp_u_isenabled __pyx_string_tab[121] -#define __pyx_n_u_itemgetter __pyx_string_tab[122] -#define __pyx_n_u_keys __pyx_string_tab[123] -#define __pyx_kp_u_list_str __pyx_string_tab[124] -#define __pyx_kp_u_list_tuple __pyx_string_tab[125] +#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_Constraints __pyx_string_tab[6] +#define __pyx_kp_u_Constraints_must_be_instances_of __pyx_string_tab[7] +#define __pyx_kp_u_Domain_is_empty __pyx_string_tab[8] +#define __pyx_kp_u_Domains_must_be_instances_of_sub __pyx_string_tab[9] +#define __pyx_kp_u_Duplicate_configs __pyx_string_tab[10] +#define __pyx_kp_u_Expected_constraints_to_be_strin __pyx_string_tab[11] +#define __pyx_kp_u_Find_and_return_a_solution_to_th __pyx_string_tab[12] +#define __pyx_kp_u_Find_and_return_all_solutions_to __pyx_string_tab[13] +#define __pyx_kp_u_None __pyx_string_tab[14] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[15] +#define __pyx_kp_u_Obtain_the_problem_solver_curren __pyx_string_tab[16] +#define __pyx_kp_u_Optional_Sequence __pyx_string_tab[17] +#define __pyx_kp_u_ParallelSolver_is_currently_expe __pyx_string_tab[18] +#define __pyx_kp_u_Problem_addConstraint_line_141 __pyx_string_tab[19] +#define __pyx_kp_u_Problem_addVariable_line_86 __pyx_string_tab[20] +#define __pyx_kp_u_Problem_addVariables_line_118 __pyx_string_tab[21] +#define __pyx_kp_u_Problem_getSolutionIter_line_218 __pyx_string_tab[22] +#define __pyx_kp_u_Problem_getSolution_line_180 __pyx_string_tab[23] +#define __pyx_kp_u_Problem_getSolutions_line_199 __pyx_string_tab[24] +#define __pyx_kp_u_Problem_getSolver_line_72 __pyx_string_tab[25] +#define __pyx_kp_u_Problem_reset_line_44 __pyx_string_tab[26] +#define __pyx_kp_u_Problem_setSolver_line_57 __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_Tried_to_insert_duplicated_varia __pyx_string_tab[30] +#define __pyx_kp_u_Union_Constraint_Callable_str __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_Optional __pyx_string_tab[56] +#define __pyx_n_u_ParallelSolver __pyx_string_tab[57] +#define __pyx_n_u_Problem __pyx_string_tab[58] +#define __pyx_n_u_Problem___init __pyx_string_tab[59] +#define __pyx_n_u_Problem__getArgs __pyx_string_tab[60] +#define __pyx_n_u_Problem__getArgs_locals_genexpr __pyx_string_tab[61] +#define __pyx_n_u_Problem_addConstraint __pyx_string_tab[62] +#define __pyx_n_u_Problem_addConstraint_locals_gen __pyx_string_tab[63] +#define __pyx_n_u_Problem_addVariable __pyx_string_tab[64] +#define __pyx_n_u_Problem_addVariables __pyx_string_tab[65] +#define __pyx_n_u_Problem_getSolution __pyx_string_tab[66] +#define __pyx_n_u_Problem_getSolutionIter __pyx_string_tab[67] +#define __pyx_n_u_Problem_getSolutions __pyx_string_tab[68] +#define __pyx_n_u_Problem_getSolutionsAsListDict __pyx_string_tab[69] +#define __pyx_n_u_Problem_getSolutionsOrderedList __pyx_string_tab[70] +#define __pyx_n_u_Problem_getSolutionsOrderedList_2 __pyx_string_tab[71] +#define __pyx_n_u_Problem_getSolver __pyx_string_tab[72] +#define __pyx_n_u_Problem_reset __pyx_string_tab[73] +#define __pyx_n_u_Problem_setSolver __pyx_string_tab[74] +#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[75] +#define __pyx_n_u_Sequence __pyx_string_tab[76] +#define __pyx_n_u_Solver __pyx_string_tab[77] +#define __pyx_n_u_Union __pyx_string_tab[78] +#define __pyx_n_u__7 __pyx_string_tab[79] +#define __pyx_n_u_addConstraint __pyx_string_tab[80] +#define __pyx_n_u_addVariable __pyx_string_tab[81] +#define __pyx_n_u_addVariables __pyx_string_tab[82] +#define __pyx_n_u_allvariables __pyx_string_tab[83] +#define __pyx_n_u_append __pyx_string_tab[84] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[85] +#define __pyx_n_u_bool __pyx_string_tab[86] +#define __pyx_n_u_c __pyx_string_tab[87] +#define __pyx_n_u_clear __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_collections_abc __pyx_string_tab[91] +#define __pyx_n_u_compile_to_constraints __pyx_string_tab[92] +#define __pyx_n_u_constraint __pyx_string_tab[93] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[94] +#define __pyx_n_u_constraint_domain __pyx_string_tab[95] +#define __pyx_n_u_constraint_parser __pyx_string_tab[96] +#define __pyx_n_u_constraint_problem __pyx_string_tab[97] +#define __pyx_n_u_constraint_solvers __pyx_string_tab[98] +#define __pyx_n_u_constraints __pyx_string_tab[99] +#define __pyx_n_u_constraints_2 __pyx_string_tab[100] +#define __pyx_n_u_copy __pyx_string_tab[101] +#define __pyx_n_u_count __pyx_string_tab[102] +#define __pyx_n_u_deepcopy __pyx_string_tab[103] +#define __pyx_n_u_doc __pyx_string_tab[104] +#define __pyx_n_u_domain __pyx_string_tab[105] +#define __pyx_n_u_domains __pyx_string_tab[106] +#define __pyx_n_u_extend __pyx_string_tab[107] +#define __pyx_n_u_freethreading __pyx_string_tab[108] +#define __pyx_n_u_func __pyx_string_tab[109] +#define __pyx_n_u_genexpr __pyx_string_tab[110] +#define __pyx_n_u_getArgs __pyx_string_tab[111] +#define __pyx_n_u_getSolution __pyx_string_tab[112] +#define __pyx_n_u_getSolutionIter __pyx_string_tab[113] +#define __pyx_n_u_getSolutions __pyx_string_tab[114] +#define __pyx_n_u_getSolutionsAsListDict __pyx_string_tab[115] +#define __pyx_n_u_getSolutionsOrderedList __pyx_string_tab[116] +#define __pyx_n_u_getSolver __pyx_string_tab[117] +#define __pyx_n_u_get_in_order __pyx_string_tab[118] +#define __pyx_n_u_getitem __pyx_string_tab[119] +#define __pyx_n_u_init __pyx_string_tab[120] +#define __pyx_n_u_is_coroutine __pyx_string_tab[121] +#define __pyx_n_u_is_gil_enabled __pyx_string_tab[122] +#define __pyx_n_u_itemgetter __pyx_string_tab[123] +#define __pyx_n_u_items __pyx_string_tab[124] +#define __pyx_n_u_keys __pyx_string_tab[125] #define __pyx_n_u_main __pyx_string_tab[126] #define __pyx_n_u_metaclass __pyx_string_tab[127] #define __pyx_n_u_module __pyx_string_tab[128] @@ -3151,15 +3042,15 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_prepare __pyx_string_tab[139] #define __pyx_n_u_process_mode __pyx_string_tab[140] #define __pyx_n_u_qualname __pyx_string_tab[141] -#define __pyx_n_u_range __pyx_string_tab[142] -#define __pyx_n_u_requires_pickling __pyx_string_tab[143] -#define __pyx_n_u_reset __pyx_string_tab[144] -#define __pyx_n_u_resetState __pyx_string_tab[145] -#define __pyx_n_u_return __pyx_string_tab[146] -#define __pyx_n_u_self __pyx_string_tab[147] -#define __pyx_n_u_send __pyx_string_tab[148] -#define __pyx_n_u_setSolver __pyx_string_tab[149] -#define __pyx_n_u_set_name __pyx_string_tab[150] +#define __pyx_n_u_requires_pickling __pyx_string_tab[142] +#define __pyx_n_u_reset __pyx_string_tab[143] +#define __pyx_n_u_resetState __pyx_string_tab[144] +#define __pyx_n_u_return __pyx_string_tab[145] +#define __pyx_n_u_self __pyx_string_tab[146] +#define __pyx_n_u_send __pyx_string_tab[147] +#define __pyx_n_u_setSolver __pyx_string_tab[148] +#define __pyx_n_u_set_name __pyx_string_tab[149] +#define __pyx_n_u_setdefault __pyx_string_tab[150] #define __pyx_n_u_size_dict __pyx_string_tab[151] #define __pyx_n_u_size_list __pyx_string_tab[152] #define __pyx_n_u_solution __pyx_string_tab[153] @@ -3168,26 +3059,40 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_solutions_list __pyx_string_tab[156] #define __pyx_n_u_solver __pyx_string_tab[157] #define __pyx_n_u_solver_2 __pyx_string_tab[158] -#define __pyx_kp_u_solver_is_not_instance_of_Solve __pyx_string_tab[159] -#define __pyx_n_u_spec __pyx_string_tab[160] -#define __pyx_n_u_str_constraints __pyx_string_tab[161] -#define __pyx_n_u_sys __pyx_string_tab[162] -#define __pyx_n_u_test __pyx_string_tab[163] -#define __pyx_n_u_throw __pyx_string_tab[164] -#define __pyx_kp_u_tuple_list_tuple_dict_tuple_int __pyx_string_tab[165] -#define __pyx_n_u_typing __pyx_string_tab[166] -#define __pyx_kp_u_unique __pyx_string_tab[167] -#define __pyx_n_u_v __pyx_string_tab[168] -#define __pyx_n_u_validate __pyx_string_tab[169] -#define __pyx_n_u_value __pyx_string_tab[170] -#define __pyx_n_u_values __pyx_string_tab[171] -#define __pyx_n_u_variable __pyx_string_tab[172] -#define __pyx_n_u_variables __pyx_string_tab[173] -#define __pyx_n_u_variables_2 __pyx_string_tab[174] -#define __pyx_n_u_vconstraints __pyx_string_tab[175] -#define __pyx_n_u_warn __pyx_string_tab[176] -#define __pyx_n_u_warnings __pyx_string_tab[177] -#define __pyx_n_u_zip __pyx_string_tab[178] +#define __pyx_n_u_str_constraints __pyx_string_tab[159] +#define __pyx_n_u_sys __pyx_string_tab[160] +#define __pyx_n_u_test __pyx_string_tab[161] +#define __pyx_n_u_throw __pyx_string_tab[162] +#define __pyx_n_u_typing __pyx_string_tab[163] +#define __pyx_n_u_v __pyx_string_tab[164] +#define __pyx_n_u_validate __pyx_string_tab[165] +#define __pyx_n_u_value __pyx_string_tab[166] +#define __pyx_n_u_values __pyx_string_tab[167] +#define __pyx_n_u_variable __pyx_string_tab[168] +#define __pyx_n_u_variables __pyx_string_tab[169] +#define __pyx_n_u_variables_2 __pyx_string_tab[170] +#define __pyx_n_u_vconstraints __pyx_string_tab[171] +#define __pyx_n_u_warn __pyx_string_tab[172] +#define __pyx_n_u_warnings __pyx_string_tab[173] +#define __pyx_n_u_zip __pyx_string_tab[174] +#define __pyx_kp_b_iso88591_A_9Ct1_8_Qa_AQ_4z_V7_4t7_8ST_T __pyx_string_tab[175] +#define __pyx_kp_b_iso88591_A_D_Q_KvQ __pyx_string_tab[176] +#define __pyx_kp_b_iso88591_A_Kq __pyx_string_tab[177] +#define __pyx_kp_b_iso88591_A_oT_T_QR_4q_1_t8_q __pyx_string_tab[178] +#define __pyx_kp_b_iso88591_A_oT_T_QR_4q_1_t8_q_a __pyx_string_tab[179] +#define __pyx_kp_b_iso88591_A_oT_T_QR_4q_4q_t8_1I __pyx_string_tab[180] +#define __pyx_kp_b_iso88591_A_t1 __pyx_string_tab[181] +#define __pyx_kp_b_iso88591_A_z_5Qa_Cq_t1Cq_8_Qa_1_1A_z_A_j __pyx_string_tab[182] +#define __pyx_kp_b_iso88591_J_UV_Ql_q_A_jjkkl_4z_a_xq_q_1L __pyx_string_tab[183] +#define __pyx_kp_b_iso88591_Q __pyx_string_tab[184] +#define __pyx_kp_b_iso88591_Q_2 __pyx_string_tab[185] +#define __pyx_kp_b_iso88591__5 __pyx_string_tab[186] +#define __pyx_kp_b_iso88591__6 __pyx_string_tab[187] +#define __pyx_kp_b_iso88591_a_L_AZq __pyx_string_tab[188] +#define __pyx_kp_b_iso88591_g_B_M_6_E_Cq_s_vQ_z_1 __pyx_string_tab[189] +#define __pyx_kp_b_iso88591_q_k_a_we1_5Q_3at_b_d_q_izQR_Cs __pyx_string_tab[190] +#define __pyx_kp_b_iso88591_xq_Kwc_A_1_2_z_j_1_aaeeffjjk_Qd __pyx_string_tab[191] +#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) { @@ -3199,12 +3104,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 @@ -3219,11 +3118,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<179; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } - Py_CLEAR(clear_module_state->__pyx_int_1); - return 0; + for (int i=0; i<192; ++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 ### */ @@ -3237,12 +3147,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); @@ -3254,11 +3158,22 @@ 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<179; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1); - return 0; + for (int i=0; i<192; ++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 ### */ @@ -3327,7 +3242,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, 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, 24, __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) } @@ -3420,7 +3335,7 @@ 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) @@ -3430,7 +3345,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED __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, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/problem.py":31 @@ -3442,7 +3357,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED */ __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_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, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/problem.py":32 @@ -3454,7 +3369,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED */ __pyx_t_1 = PyList_New(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_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, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/problem.py":33 @@ -3466,7 +3381,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __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, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/problem.py":36 @@ -3498,7 +3413,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __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) } @@ -3547,7 +3462,7 @@ 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) @@ -3608,7 +3523,7 @@ 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) @@ -3717,7 +3632,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, "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, 44, __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) } } @@ -3773,7 +3688,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_2reset(CYTHON_UNUSED Py */ __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_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, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/problem.py":55 @@ -3790,7 +3705,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_2reset(CYTHON_UNUSED Py __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) @@ -3885,7 +3800,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, "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, 57, __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) } } @@ -3938,7 +3853,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_4setSolver(CYTHON_UNUSE * * 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, 70, __pyx_L1_error) /* "constraint/problem.py":57 * self._variables.clear() @@ -4019,7 +3934,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, "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, 72, __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) } } @@ -4165,7 +4080,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, "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, 86, __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) } } @@ -4213,10 +4128,10 @@ 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; + size_t __pyx_t_4; + int __pyx_t_5; int __pyx_t_6; - int __pyx_t_7; + PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; @@ -4263,14 +4178,11 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * 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) __Pyx_GOTREF(__pyx_t_1); } @@ -4296,31 +4208,31 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU */ __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_GOTREF(__pyx_t_1); - __pyx_t_7 = PyList_Check(__pyx_v_variable); - if (!__pyx_t_7) { + __pyx_t_6 = PyList_Check(__pyx_v_variable); + if (!__pyx_t_6) { } else { - __pyx_t_6 = __pyx_t_7; + __pyx_t_5 = __pyx_t_6; goto __pyx_L7_bool_binop_done; } - __pyx_t_7 = PyTuple_Check(__pyx_v_variable); - if (!__pyx_t_7) { + __pyx_t_6 = PyTuple_Check(__pyx_v_variable); + if (!__pyx_t_6) { } else { - __pyx_t_6 = __pyx_t_7; + __pyx_t_5 = __pyx_t_6; goto __pyx_L7_bool_binop_done; } - __pyx_t_7 = PyObject_IsInstance(__pyx_v_variable, __pyx_t_1); - __pyx_t_6 = __pyx_t_7; + __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_7 = (!__pyx_t_6); - if (__pyx_t_7) { + __pyx_t_6 = (!__pyx_t_5); + if (__pyx_t_6) { } else { - __pyx_t_2 = __pyx_t_7; + __pyx_t_2 = __pyx_t_6; goto __pyx_L5_bool_binop_done; } - __pyx_t_7 = __Pyx_HasAttr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_getitem); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 105, __pyx_L1_error) - __pyx_t_6 = (!__pyx_t_7); - __pyx_t_2 = __pyx_t_6; + __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, 105, __pyx_L1_error) + __pyx_t_5 = (!__pyx_t_6); + __pyx_t_2 = __pyx_t_5; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { @@ -4365,28 +4277,28 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * elif hasattr(domain, "__getitem__"): * domain = Domain(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, 108, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_deepcopy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_3 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 108, __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, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = 1; + __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_4 = PyMethod_GET_SELF(__pyx_t_8); - assert(__pyx_t_4); + __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_4); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); - __pyx_t_5 = 0; + __pyx_t_4 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_domain}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __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; + 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, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -4422,25 +4334,25 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * msg = "Domains must be instances of subclasses of the Domain class" */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Domain); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = 1; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __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_8 = PyMethod_GET_SELF(__pyx_t_4); + 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_4); + 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_8, __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_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_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } @@ -4475,15 +4387,12 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * if not domain: * raise ValueError("Domain is empty") */ - __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_builtin_TypeError); - __pyx_t_8 = __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_8, __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_8); __pyx_t_8 = 0; + 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, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } @@ -4501,8 +4410,8 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * self._variables[variable] = domain */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 114, __pyx_L1_error) - __pyx_t_6 = (!__pyx_t_2); - if (unlikely(__pyx_t_6)) { + __pyx_t_5 = (!__pyx_t_2); + if (unlikely(__pyx_t_5)) { /* "constraint/problem.py":115 * raise TypeError(msg) @@ -4511,15 +4420,12 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * self._variables[variable] = domain * */ - __pyx_t_8 = 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_8, __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_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + 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, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } @@ -4562,7 +4468,7 @@ 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_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("constraint.problem.Problem.addVariable", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; @@ -4643,7 +4549,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, "addVariables", 0) < 0) __PYX_ERR(0, 118, __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, 118, __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, 118, __pyx_L3_error) } } @@ -4725,7 +4631,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U #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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -4770,7 +4676,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U __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, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -4880,7 +4786,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, "addConstraint", 0) < 0) __PYX_ERR(0, 141, __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, 141, __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, 141, __pyx_L3_error) } @@ -5016,7 +4922,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2genera #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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -5189,7 +5095,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ __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, 164, __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, 164, __pyx_L1_error) } @@ -5212,7 +5118,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ __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, 165, __pyx_L1_error) @@ -5288,7 +5194,7 @@ 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, 172, __pyx_L1_error) @@ -5341,7 +5247,7 @@ 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, 174, __pyx_L1_error) @@ -5379,14 +5285,11 @@ 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, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } @@ -5414,17 +5317,17 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_constraints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __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, 178, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 178, __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, 178, __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, 178, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 178, __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, 178, __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":141 * self.addVariable(variable, domain) @@ -5511,7 +5414,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, 180, __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, 180, __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, 180, __pyx_L3_error) } } @@ -5585,8 +5488,8 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN 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, 194, __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, 194, __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, 194, __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; @@ -5610,13 +5513,13 @@ 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); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 2); + __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); } @@ -5641,7 +5544,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, 194, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < (0)) __PYX_ERR(0, 194, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_unpacking_done; @@ -5705,7 +5608,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN __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, 197, __pyx_L1_error) @@ -5800,7 +5703,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, 199, __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, 199, __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, 199, __pyx_L3_error) } } @@ -5874,8 +5777,8 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U 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, 213, __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, 213, __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, 213, __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; @@ -5899,13 +5802,13 @@ 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); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 2); + __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); } @@ -5930,7 +5833,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, 213, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < (0)) __PYX_ERR(0, 213, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_unpacking_done; @@ -5997,7 +5900,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U __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, 216, __pyx_L1_error) @@ -6092,7 +5995,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, 218, __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, 218, __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, 218, __pyx_L3_error) } } @@ -6166,8 +6069,8 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO 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, 234, __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, 234, __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, 234, __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; @@ -6191,13 +6094,13 @@ 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); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 2); + __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); } @@ -6222,7 +6125,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, 234, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < (0)) __PYX_ERR(0, 234, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_unpacking_done; @@ -6289,7 +6192,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO __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, 237, __pyx_L1_error) @@ -6389,7 +6292,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, "getSolutionsOrderedList", 0) < 0) __PYX_ERR(0, 239, __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, 239, __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, 239, __pyx_L3_error) } @@ -6528,7 +6431,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi #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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -6541,7 +6444,7 @@ 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, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -6665,7 +6568,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi #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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -6691,7 +6594,7 @@ 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, 245, __pyx_L1_error) @@ -6773,7 +6676,7 @@ 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, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -6919,7 +6822,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 @@ -6961,7 +6864,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, "getSolutionsAsListDict", 0) < 0) __PYX_ERR(0, 247, __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, 247, __pyx_L3_error) /* "constraint/problem.py":248 * @@ -6971,7 +6874,6 @@ 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, 247, __pyx_L3_error) } } @@ -6992,11 +6894,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds 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, 248, __pyx_L3_error) + } else { + __pyx_v_validate = ((int)((int)1)); + } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; @@ -7039,7 +6944,7 @@ 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; @@ -7055,12 +6960,10 @@ 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; - PyObject *__pyx_t_13[4]; - PyObject *(*__pyx_t_14)(PyObject *); + 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; @@ -7078,7 +6981,7 @@ 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, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -7107,39 +7010,30 @@ 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, 253, __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, 253, __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, 253, __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, 253, __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, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -7154,8 +7048,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * # 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, 254, __pyx_L1_error) - if (__pyx_t_12) { + if (__pyx_v_validate) { /* "constraint/problem.py":256 * if validate: @@ -7178,9 +7071,9 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * 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, 257, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 257, __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":258 * size_dict = len(solutions_dict) @@ -7190,8 +7083,6 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * 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":259 * if size_list != size_dict: @@ -7202,19 +7093,19 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic */ __pyx_t_2 = PyNumber_Subtract(__pyx_v_size_list, __pyx_v_size_dict); 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, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __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_PyObject_FormatSimple(__pyx_v_size_dict, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_13[0] = __pyx_t_8; - __pyx_t_13[1] = __pyx_mstate_global->__pyx_kp_u_duplicate_parameter_configurati; - __pyx_t_13[2] = __pyx_t_2; - __pyx_t_13[3] = __pyx_mstate_global->__pyx_kp_u_unique; - __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_13, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 43 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 8, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2)); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __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, 259, __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":260 @@ -7228,45 +7119,45 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_v_solutions_list)) || PyTuple_CheckExact(__pyx_v_solutions_list)) { - __pyx_t_8 = __pyx_v_solutions_list; __Pyx_INCREF(__pyx_t_8); + __pyx_t_7 = __pyx_v_solutions_list; __Pyx_INCREF(__pyx_t_7); __pyx_t_4 = 0; - __pyx_t_14 = NULL; + __pyx_t_11 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_solutions_list); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 260, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 260, __pyx_L7_error) + __pyx_t_4 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_solutions_list); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 260, __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, 260, __pyx_L7_error) } for (;;) { - if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_8))) { + if (likely(!__pyx_t_11)) { + if (likely(PyList_CheckExact(__pyx_t_7))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); + 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, 260, __pyx_L7_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_4); + __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_7, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); + 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, 260, __pyx_L7_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_4)); + __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_4)); #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_4); + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_4); #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 260, __pyx_L7_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 260, __pyx_L7_error) } else { - __pyx_t_7 = __pyx_t_14(__pyx_t_8); - if (unlikely(!__pyx_t_7)) { + __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, 260, __pyx_L7_error) @@ -7275,28 +7166,28 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic break; } } - __Pyx_GOTREF(__pyx_t_7); - __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_c, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_11 = __pyx_v_solutions_list; - __Pyx_INCREF(__pyx_t_11); + __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_11, __pyx_8genexpr3__pyx_v_c}; - __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__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_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 260, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_7); + 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, 260, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_11 = PyObject_RichCompare(__pyx_t_7, __pyx_mstate_global->__pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 260, __pyx_L7_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 260, __pyx_L7_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__pyx_t_12) { + __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, 260, __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, 260, __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, 260, __pyx_L7_error) } } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __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:; @@ -7304,18 +7195,18 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic goto __pyx_L1_error; __pyx_L12_exit_scope:; } /* exit inner scope */ - __pyx_t_8 = PySet_New(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PySet_New(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PySequence_List(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) + __pyx_t_2 = PySequence_List(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __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_7 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Duplicate_configs, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __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, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "constraint/problem.py":261 * f"{size_list - size_dict} duplicate parameter configurations out of {size_dict} unique.", @@ -7324,34 +7215,33 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * ) * return ( */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_constraints); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __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, 261, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_str_constraints); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_constraints); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_Constraints; - __pyx_t_13[1] = __pyx_t_11; - __pyx_t_13[2] = __pyx_mstate_global->__pyx_kp_u__2; - __pyx_t_13[3] = __pyx_t_7; - __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_13, 4, 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 2 + __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_8)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 261, __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, 261, __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, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __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, 261, __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[4] = {__pyx_t_5, __pyx_t_9, __pyx_t_2, __pyx_t_8}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_3, (4-__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_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __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, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } @@ -7424,9 +7314,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:; @@ -7503,7 +7391,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, "_getArgs", 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, "_getArgs", 0) < (0)) __PYX_ERR(0, 269, __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, 269, __pyx_L3_error) } @@ -7629,7 +7517,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ #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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -7648,10 +7536,10 @@ 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); + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_5); } @@ -7672,7 +7560,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, 290, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < (0)) __PYX_ERR(0, 290, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; @@ -7796,7 +7684,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __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, 270, __pyx_L1_error) @@ -7817,7 +7705,7 @@ 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, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -7880,7 +7768,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #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_GetItemRefFast(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -7944,8 +7832,8 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE 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, 278, __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, 278, __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, 278, __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; @@ -7982,7 +7870,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #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_GetItemRefFast(__pyx_t_1, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_11; } else { { @@ -8029,13 +7917,13 @@ 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); + __pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 2); + __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); } @@ -8060,7 +7948,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, 279, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 3) < (0)) __PYX_ERR(0, 279, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L9_unpacking_done; @@ -8090,7 +7978,7 @@ 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, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -8155,7 +8043,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #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_GetItemRefFast(__pyx_t_1, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -8200,10 +8088,10 @@ 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); + __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); } @@ -8224,7 +8112,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, 283, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 283, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L15_unpacking_done; @@ -8328,7 +8216,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __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_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_You_have_used_FunctionConstraint, 0, 0); __PYX_ERR(0, 290, __pyx_L1_error) } } @@ -8383,7 +8271,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #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_GetItemRefFast(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -8455,7 +8343,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #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_GetItemRefFast(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -8474,10 +8362,10 @@ 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); + __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } @@ -8498,7 +8386,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, 295, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 295, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L25_unpacking_done; @@ -8540,7 +8428,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #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_GetItemRefFast(__pyx_t_1, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_11; } else { { @@ -8634,7 +8522,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #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_GetItemRefFast(__pyx_t_1, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -8653,10 +8541,10 @@ 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); + __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } @@ -8677,7 +8565,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, 298, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 298, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L33_unpacking_done; @@ -8705,7 +8593,7 @@ 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, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -8759,7 +8647,7 @@ 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, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -8863,30 +8751,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; } @@ -8896,19 +8787,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 } } @@ -8938,7 +8834,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 @@ -8949,12 +8845,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*/ @@ -8968,7 +8859,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*/ @@ -9003,7 +8894,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 @@ -9023,30 +8914,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; } @@ -9055,19 +8949,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 } } @@ -9104,7 +9003,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 @@ -9115,12 +9014,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*/ @@ -9134,7 +9028,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*/ @@ -9169,7 +9063,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 @@ -9189,30 +9083,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; } @@ -9222,19 +9119,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 } } @@ -9264,7 +9166,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 @@ -9275,12 +9177,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*/ @@ -9294,7 +9191,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*/ @@ -9329,7 +9226,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 @@ -9349,30 +9246,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; } @@ -9383,19 +9283,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 } } @@ -9428,7 +9333,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 @@ -9439,12 +9344,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*/ @@ -9458,7 +9358,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*/ @@ -9493,7 +9393,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 @@ -9513,30 +9413,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; } @@ -9547,19 +9450,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 } } @@ -9592,7 +9500,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 @@ -9603,12 +9511,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*/ @@ -9622,7 +9525,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*/ @@ -9657,7 +9560,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 @@ -9730,14 +9633,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_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, 164, __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, 164, __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, 164, __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, 164, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr) < (0)) __PYX_ERR(0, 164, __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)) { @@ -9746,14 +9652,17 @@ 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, 239, __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, 239, __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, 239, __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, 239, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList) < (0)) __PYX_ERR(0, 239, __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)) { @@ -9762,14 +9671,17 @@ 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, 243, __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, 243, __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, 243, __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, 243, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr) < (0)) __PYX_ERR(0, 243, __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)) { @@ -9778,14 +9690,17 @@ 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, 245, __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, 245, __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, 245, __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, 245, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr) < (0)) __PYX_ERR(0, 245, __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)) { @@ -9794,14 +9709,17 @@ 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, 290, __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, 290, __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, 290, __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, 290, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr) < (0)) __PYX_ERR(0, 290, __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)) { @@ -9849,7 +9767,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}, @@ -9911,7 +9829,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 @@ -9941,12 +9860,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 @@ -10018,12 +9940,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; @@ -10066,48 +9991,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) @@ -10116,10 +10021,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); @@ -10137,9 +10042,10 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * from warnings import warn * 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 @@ -10149,16 +10055,22 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * from operator import itemgetter * from typing import Callable, Optional, Union */ - __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_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, 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_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, 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 @@ -10167,15 +10079,21 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * 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) + { + 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); - __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; + { + 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; /* "constraint/problem.py":6 @@ -10185,24 +10103,22 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * 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_Callable,__pyx_mstate_global->__pyx_n_u_Optional,__pyx_mstate_global->__pyx_n_u_Union}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_typing, __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_Union, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Callable,__pyx_mstate_global->__pyx_n_u_Optional,__pyx_mstate_global->__pyx_n_u_Union}; + 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/problem.py":7 * from operator import itemgetter @@ -10211,19 +10127,21 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * * from constraint.constraints import Constraint, FunctionConstraint, CompilableFunctionConstraint */ - __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_Sequence,__pyx_mstate_global->__pyx_n_u_Hashable}; + __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, 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_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_Sequence,__pyx_mstate_global->__pyx_n_u_Hashable}; + 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, 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/problem.py":9 @@ -10233,24 +10151,22 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * from constraint.domain import Domain * from constraint.solvers import Solver, OptimizedBacktrackingSolver, ParallelSolver */ - __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_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, 9, __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_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, 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; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/problem.py":10 * @@ -10259,15 +10175,21 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * from constraint.solvers import Solver, OptimizedBacktrackingSolver, ParallelSolver * from constraint.parser import compile_to_constraints */ - __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, 10, __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, 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; /* "constraint/problem.py":11 @@ -10277,24 +10199,22 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * from constraint.parser import compile_to_constraints * */ - __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_Solver,__pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver,__pyx_mstate_global->__pyx_n_u_ParallelSolver}; + __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); - 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_Solver,__pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver,__pyx_mstate_global->__pyx_n_u_ParallelSolver}; + 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; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/problem.py":12 * from constraint.domain import Domain @@ -10303,15 +10223,21 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * * 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_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, 12, __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_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, 12, __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, 12, __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 @@ -10324,10 +10250,10 @@ __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 @@ -10337,16 +10263,22 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * 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, 15, __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, 15, __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, 15, __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 * try: @@ -10355,20 +10287,20 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * 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, 16, __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, 16, __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, 16, __pyx_L2_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/problem.py":14 * from constraint.parser import compile_to_constraints @@ -10379,13 +10311,13 @@ __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 * from sys import _is_gil_enabled @@ -10394,13 +10326,13 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * 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, 17, __pyx_L4_except_error) __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_4); /* "constraint/problem.py":18 * freethreading = _is_gil_enabled() @@ -10409,10 +10341,10 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * * */ - 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, 18, __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; @@ -10426,15 +10358,15 @@ __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:; } @@ -10445,8 +10377,8 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * """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, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); /* "constraint/problem.py":24 * """Class used to define a problem and retrieve solutions.""" @@ -10455,16 +10387,19 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * """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, 24, __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, 24, __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, 24, __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, 24, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/problem.py":44 * warn("Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance.") @@ -10473,10 +10408,13 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * """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, 44, __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, 44, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/problem.py":57 * self._variables.clear() @@ -10485,10 +10423,13 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * """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, 57, __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, 57, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/problem.py":72 * self._solver = solver @@ -10497,10 +10438,13 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * """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, 72, __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, 72, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/problem.py":86 * return self._solver @@ -10509,15 +10453,18 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * """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, 86, __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, 86, __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, 86, __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, 86, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "constraint/problem.py":118 * self._variables[variable] = domain @@ -10526,15 +10473,18 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * """Add one or more variables to the problem. * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 118, __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, 118, __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, 118, __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, 118, __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, 118, __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, 118, __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, 118, __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, 118, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/problem.py":141 * self.addVariable(variable, domain) @@ -10543,17 +10493,20 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * """Add a constraint to the problem. * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __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, 141, __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, 141, __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, 141, __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, 141, __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, 141, __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_Union_Constraint_Callable_str) < (0)) __PYX_ERR(0, 141, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables_2, __pyx_mstate_global->__pyx_kp_u_Optional_Sequence) < (0)) __PYX_ERR(0, 141, __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, 141, __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, 141, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "constraint/problem.py":180 * self._constraints.append((constraint, variables)) @@ -10562,10 +10515,13 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * """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, 180, __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, 180, __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, 180, __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, 180, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "constraint/problem.py":199 * return self._solver.getSolution(domains, constraints, vconstraints) @@ -10574,10 +10530,13 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * """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, 199, __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, 199, __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, 199, __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, 199, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "constraint/problem.py":218 * return self._solver.getSolutions(domains, constraints, vconstraints) @@ -10586,10 +10545,13 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * """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, 218, __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, 218, __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, 218, __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, 218, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "constraint/problem.py":239 * return self._solver.getSolutionIter(domains, constraints, vconstraints) @@ -10598,17 +10560,30 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * """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, 239, __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, 239, __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, 239, __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, 239, __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, 239, __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, 239, __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, 239, __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, 239, __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, 239, __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, 239, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/problem.py":248 + * + * 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, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); /* "constraint/problem.py":247 * return list(get_in_order(params) for params in solutions) @@ -10617,18 +10592,25 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * 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, 247, __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, 247, __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, 247, __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, 247, __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, 247, __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, 247, __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, 247, __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, 247, __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, 247, __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, 247, __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, 247, __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, 247, __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, 247, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "constraint/problem.py":269 * ) @@ -10637,11 +10619,14 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * 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, 269, __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, 269, __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, 269, __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, 269, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "constraint/problem.py":21 * @@ -10650,38 +10635,42 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * """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, 21, __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, 21, __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_118, __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_141, __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_180, __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_199, __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_218, __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_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_4, __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_4, __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_4, __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_4, __pyx_mstate_global->__pyx_kp_u_Problem_addVariables_line_118, __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_141, __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_180, __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_199, __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_218, __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); @@ -10709,226 +10698,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, sizeof(__pyx_k_Constraints), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraints */ - {__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_Duplicate_configs, sizeof(__pyx_k_Duplicate_configs), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Duplicate_configs */ - {__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_141, sizeof(__pyx_k_Problem_addConstraint_line_141), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_addConstraint_line_141 */ - {__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_118, sizeof(__pyx_k_Problem_addVariables_line_118), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_addVariables_line_118 */ - {__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_218, sizeof(__pyx_k_Problem_getSolutionIter_line_218), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_getSolutionIter_line_218 */ - {__pyx_k_Problem_getSolution_line_180, sizeof(__pyx_k_Problem_getSolution_line_180), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_getSolution_line_180 */ - {__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_199, sizeof(__pyx_k_Problem_getSolutions_line_199), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_getSolutions_line_199 */ - {__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__4, sizeof(__pyx_k__4), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__4 */ - {__pyx_k__7, sizeof(__pyx_k__7), 0, 1, 1}, /* PyObject cname: __pyx_n_u__7 */ - {__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_count, sizeof(__pyx_k_count), 0, 1, 1}, /* PyObject cname: __pyx_n_u_count */ - {__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_unique, sizeof(__pyx_k_unique), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_unique */ - {__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, 113, __pyx_L1_error) __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 253, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(0, 253, __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; @@ -10973,17 +10755,6 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); - /* "constraint/problem.py":247 - * 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, 247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); - /* "constraint/problem.py":269 * ) * @@ -10991,9 +10762,47 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { * 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, 269, __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, 269, __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 CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + } + #else + 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 CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + } + #else + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -11004,32 +10813,133 @@ 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); - __pyx_mstate->__pyx_int_1 = PyLong_FromLong(1); if (unlikely(!__pyx_mstate->__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + { + const struct { const unsigned int length: 10; } index[] = {{2},{1010},{514},{677},{335},{54},{13},{67},{15},{59},{19},{40},{373},{393},{4},{179},{327},{18},{127},{32},{29},{31},{34},{30},{31},{27},{23},{27},{235},{453},{36},{32},{94},{227},{2},{1},{1},{8},{21},{7},{43},{6},{2},{9},{9},{11},{45},{41},{8},{8},{28},{10},{6},{18},{8},{27},{8},{14},{7},{16},{16},{33},{21},{38},{19},{20},{19},{23},{20},{30},{48},{31},{17},{13},{17},{20},{8},{6},{5},{1},{13},{11},{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},{6},{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 (2995 bytes) */ +const char* const cstring = "(\265/\375`\006 M]\000\252p\014\027G\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\254jD\344\252\353Z\225M\260\302\2155\252\301\034\272\213\221\220\004\013X(\335y[\001>\001B\001`\001\033\274\247-\305G\035B\204\356[\377\214\273\277\370\273\357\276\253\256\364W\255\361\255\272\373]\367\303\320\270\354\327>z\353}\333G[W;;L\347\276\377\331al\356ql,=Y\241\377r\314\216\025\037\355 \271)e\246\344\010\211B\241}\347\316\330\353\300\331y~\232\361{\340\276\230\336\367\336\3053\373M\325Sp\243\277\271W\251\246\323\230D\377\265~\277\016\271+\263\266\332\370\236\237\235\256\327p1k\203/\242\220O\317\365\357D9}\372Y\356V\221\326\2373F\001nN\337\363f\266\361\337\270\373\251|DCc\322zZ\316\004z&Wa\177\356\316\032\322\253|\202\331\277j\361\272?\213\265\347wa\317\257\372\021}\235\247\347\240\265\223\253x\177\323G{v\031\253|u\253\333\271\357w5\277w\363^\301\335E(+\3362\3027z\247\243\250Loi\361\315M\233\217\246O\272u\323\206P3\035|\264\342#\222\214\217fP6\024\037\241L\024\231\220\2365\317\031\224\316L\024z\361\026\0371b\204\351\255\327\315\233\023~\340@\326\275\335p\366\374Y\333\361\366}\353\314[_\314\371tJO\231(\277\361\325(\235$2\037\211@\226\315t\315aZ\301v\233\365\033p\315\266o\225y\0336\230\264\2677\313_\324\242i\375\234~\327d\371\207md\371=\317X\177\223\333\377Y\345\373\303\254]m\374)\356\334b\374B\347gV\214_-cf\204\222\2712(\365\235\277\036\360\360\206\311\262l\353i\237\373\354[\343.\344\333s3\264o\376z!\025\316xW\277\323?\206\010\204\007]*\255\200p\205\010\301\201eE\005\013I\177`y\021\221J$\377\373\222\351\377\264\376\354\257\347\333\027\317\364T\325T{\277\221\256\366\255\235y\276\314\300\310\330\rF\366\332N\024\271RO\001\26767\276w\246\274\366\253\247\367\327?\014\272J\205g\372\326m\353\267\225XJ\032^N\274\370\235\240\375=\363o\325>E\375\306/N\372\353\214\314\214\214\265n\362\274\3319\230'Wi\214\035+\245\322_\374\302\365\364\233?z+\n\337x\345#\275yU\265'W\301\355u\357\333\247\365o\276\365\327\271\233t\366\256""\257y\177~\274\235\242l\376\305\324\325a\362\256\341\246\t\3728\265\253\333\203\341-\257?\320\356\3739\177\277\272\223\205\322>g*\021JO\311'l\302+\204l\215\"`\032^'\244\207l\021Y\302\235\243\000$F\nKb\244\312\007>btL0\020\354\344\025CbqB\270 \004\200\004\010)\321%\022\272\344\210\204\0000\371q\352q\032?b+d\221\363i\211@;'\221$\316\250\021\236B\023\221\030i\004\215'Sd\205\251\320\004\212\t\031|b10%\213\017\220\017\020:\033V\202\211^ \310\031\243\212H\"\342\344\224r\020\200\304R\342I\314\020NX\nf\002\363\300X\026\224\013>1\222\270CT\030\"\347\023\002\300\177\234F\013\003J\257\342\350\233\247\215\246\367\244\325N\227\313\006g\326\326\277u\336\232\246\367\265\312~\376=7\214\246?\327l\347\327z\355\345\263\347a\257\206\253\036\325\036\356\346\325o?\212\347\376N\3234\3705Z\263u\245iM\353~\327\215\357\247\3224\315a\252i\336?\335\367\303\034\350\351L3\ro\3559n\233\334[\213\271\327\330r[\343\362|\313q\026\343M\377\305\031s\031\256\334\005\365\244\367=\317\245\251>\306\276\371\027\332\rH\077\077\3150\\\266\256-\364\351\216\320\330\212\3104M\323RT\257\303\250\254\336\317g\366h$\023r]5\315\214\014\325\225[\335\377f\376\362\357\357<\327\225\202^\251\360\024\232\274,\274(\311\243\024zNc\006\221\316r\322\2244\2442\204\304!Z\030y\255\200`\246Oy\202\211\000\225\334\347GK\274\001wH\343\214\224\250r\032i\210\253p\205N\367\262A\252\324\204\r^2$\230\0162\006\271\032m\210\247\324(A\364|@vj\320(i\\(/\224\224\244\023\371\031\267\217\213(a$F\212\031E\346\230@|`\022k\211\027D=\202\243SO\312\223\021*&\330\361\220\333\210\241\244\33493\247\303\2136sd0\326\204\026\302\005 \261\226\260dt\340\n\035\220z40\266D\324\211\260$\374@\362r1\016\030\035d\007\244cBC\271j\2157>\241Gl\021\3721G\014\003J\317H2\246\306\2248\311\321\030`t \272 \031\347\016\010F\002\013\021\363\220-\"\220\304<\257\026\271aB9ad\347f\216\243\002?p\2248J\224%@%\310\201\010\211\203\0214R\216\214\026\303\217\0312J\025\037+Beh@)\362\211\205\200\354\270T0\211\331\232\262\246\226UU\252\276|\255\324R%\347\203\007\354\002\214\276L\274H/""\320K\223\223\264@\222\220\"\223\330\r\033\245\215\032e\215\n\345\202\021'\234a\003\223\230g\304\0216\030)Q\360\021 >\370\354\220\010\300XBekD\215\244q\213\024P\241\tHl\276R/\017\023J\023\361\004d\347@H\214\344\2053\2460(\031$\210\235z\220FB\000<\000\351\314\274T\220$2\202\232\250r\233\026\204\016!\022\031\021I\222$\215\001R\020\010\010\244\211\034i\263=R\231<\213\201 \245\0142\206(\"#\"\023\211\210\210\024\024$)\024:\006\202Z\231 \\\270Gs)\221\242\025*\300\020C{\265f.\026\376\3028\310(j%\361\213u2j^\272\265\331=\310\030!\026r'\266W\200\016\260UX\004\237\375 \000\242\267+w\034\374\333o\031\324\355L\316\257w\331\027\336\025\0173K\362\270\375!!\3710\341\236\2448>\\@-B\344}\364\203\350\246\266\265s\351\220\324\232\330d\007\350\"]&\215A\322O\205x6\223J8\004J\247\270.fC\n\006%\255]i\346\027k\005\306\202\364\270\222f(z\032\277U\202\316#q\272\307\275\336\312\n\253\212\330\330\274E^H\236{\373\237\350:@\003\256\224}\225\341\255#A\233\227\244\360\035\242q\371\317_l^\342s\362M}\007\323\217f@\317\327\255\227\357\274\3163\337Z\335\325_\030\2145\341\356\266\337\350\005\206\305\007\316D \311\250c\224\307`\323\373\347:\030`\270\241C\230\372\240\210\255\244\250\323~\n9CP\206\251\\\345\202\255\316dE\025bc\023\331\004\320\026t\322\226J$\2026J\035u\332\356 k\206\303$c\252~\327\212\025\220\271\220y\310X5p\356q\206:\311j\214>\323*\2337\236\212\316bL16\246C:M\251\025\323\025y\302\201a@\262*G\237\000\ny\272\320\2777\306\025+\0226\016\010V\014\366u\210\036\357[\001\036\372\321\0160\277\017i\324\242\035g\231\202\006]\333\006\034\002"; + PyObject *data = __Pyx_DecompressString(cstring, 2995, 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 (3079 bytes) */ +const char* const cstring = "BZh91AY&SY\272\020\200\237\000\003)\177\377\377\377\377\376\377\377\377\367\377\177\377\372\377\377\377\376\300@@@@@@@@@@@@\000@\000`\014n\370\344\212;J\335\330\235:]\200\255P\001Dl\324\200\003\262\037^\r\t\010\204\363*z\003j`\223\303S\323\"\214\322yM=\010\304\320\323OQ\223\t\24024h\3044\336\244\0065\032i\351=A\240 &\201\024\324~\244\315C\t\246M\3514\324\362\232\003\020\000h4\000\000\000\000\000\014\201\352 \311\200\023\000\0010\004i\204`\000\000\000\2314\304\320`\004`\000\000\000\004\232\222S\325=OS\325?)\352z\217T\364\217Pzz\223\321\r\006\236\246\2314\323 \320\014\201\2404\000\323\023@\000\321\202yA\241\332&\t\200\32110\00110\004\320\300\002i\200&L\000\010\300\010`\230\t\2024\301\"@\204\320L\023Bz\232d\365\006\212=\023L#dC\3224\032\000\320\000\000\000\321\210\320\031\014\203\005,\347\337Hi\305\344\034\261\017\312\\\226\177C\366\\\277\300\240\261(\326E\"\220\355\002\206@\022\230\266J\354\366a\005\212*\351\022H\356@6\247o\350t\247\026\006\315s\355[\300}\250A\354\022\264\227\263\341\025\357\324I\201T\320\177G#\346\344\226GH\306\316v)8EfA\355\372\337\332\313\327\320\275\376\22096\241nc`\r\363r1\244TUK\256o:\322V(\212P8\"r\224\225\023ne\354M\336X\230\245P\270\341l\365\352jUY\314\247S\001\214\330!+\314-\252\006\346\334R\3023\221S\233\311\2114\347\264\254j\2479\013\234K|\253\030\343\221Vp\335@\242\014Y\024\003\t@i \010\020pH\005\276=4\373\021\326\201\364\357#\265\022\223'3\332\354T\225\250\035'\253\"L\220\306\240=\225\303\327'\220\340\201\340g=\205C\016\346K\347\242s\227\365\236\212O\007\234\320K\361\200b\002\370\026G\030\330\001\000\342\013NL\016+\020w\376\r\201\364\374\3751\025\317>\002\266I:9\304~\2103\223_\234\re\232\233\236qK9R\365\265\336T#q\301\372X\\\036\370,h\340\345\373\250\325^\327\033\211\361qE\027TM\3546\024N\303u\341\245D\341Gsa\236\244V\2674\245\211\014p\207\233*\311*J(\325\263d\222\243=\275\232r\240\214(@)\002\324FAl\311r\224)j\252Hc39\005\033\00288\234SD\262\006\341\220R\3160\2331A\204B42 \207&\214\215_\002vf9\031\\\r\233v)\023\006\346&\031\2616\270_h""\321\247\000\365\307\211\331\r\3768\332\344n\026\276g-_\227\264\223e\226\275\371\n$e\304Y@\310\351\200\323x\261Y\251\022$%\242\347\324\204\207!\246\201\177A24!\311\022\345\364>\347i0\233%6\311\256%$^*\246\t\316\025*Fj\361\235\246\206\031\003\006g\010 7\324\023N\222\201;\032\03302\312\301\345\030\251\351\331\036\214\271\365\266gO\234\202tbD\325y\347\333-\214\033\260\031\027\251(0\014\224\361\305U\376\002`\334\260\213\343 P\231\031\250'\312.>\321\014//\361t\3176\216\021NI\330\355\322\371\271\304\\\241\200K\315~Z\222H\212>\201@\217 \366a&\277\221\335\214:\240#Bl\324\021\3149$\t\"\254\232\325\224\300\\1m\024\r%\254\313\000ff\014\370hM\223_\2218\036\334\001PY\264wT\207\270\370\345qY\252=_\030\257\017\026\276\014X\365`h\223zrdiD\023z\201\277\223$\230&\236y\276\232\237\177\273d\217\0304\263k\255\022A\212\244$\203RH/\350\302<\362\247n\001\222\034J\212\220\274\324\267\320\266P\202\236\330\034~-\326;\014\340\272Pq\2256\2624\346\2422M2,pYj4\320\224\014\272\243\035\274H\t\320\302cj\265\306\240uO\201w\024\300\313\000a\010`xO\246w\336\231\231&\343P\276g\201\357\0378\305\214\200\336\215c\242\274c;\030\321\024t\241(p\342)k\336\336\3025B\323\033\371\311I67\022\303&\260\343\364C\017O\257\230\271\264\t\233W\244H\210\"8\240\3363\205^-.\336\243Vu\344/\347\242\376=\373\300QN\347\002\353\363p\255\264_\277\306\251\2145\310\226Z\240@\310\246\266\201\266\300\217\033\263$-_35\0008E\323|\315\360\355\251\277u\204N\027V\216\252]\340\367;\216\376\\.\265\\J\n9]\177\216Ttu6\365\240\300\254R\373Hd\241\214\223\351\302r\025FVc\357R\212e\216L\230u\270\272\223\023&p\265\325\330\260g\025\356\234a\262\273I\3023uqZ]<\362\261\206\331\007%\024\223-J\005\210\212\024\223Owq\236\372\252Nn\260D\345L\005\2723\214\342\034\304]%\030\265\307\007\033E\2232_y\203 \3034P\"\202*\346\\\305Y\301I\204\035\366\327\016=\234\346pc#\010\335\327\344\341\320\220\177\236,\031\310\312^@o(q3\227\217'rv.\004g\210\340\252\r\0049\2616jx0\210\246\347;\225\212#[\"\037\017|_\202g\302\313|\201\264\222\377\215d\224y\327\342\000h\300\241\013\260p\324\352\340'%\264\215\234\3662\033\354`\031w\014cn\032\203h\310~\021\344A\213\251\225\355\274#D\214\245\036\360\213Z\224\276\363\037\331\022\312\366\302\357\304) Li.\034z\003C\023i\030\214\000\356\306\215W\245\206bxO\210?\3304\331q\205hiw\217g;\343\272\3503\234\341\347l\352\013\3371\274\341\356WY\331\311\002\260\302\307\276\243\330\273l\353<\360fC\254\323\354F\335\27184\224a\244\003\2416\201\203[\360\221_@\302I\241\202\021sI\031K\226^L\250/\315\321|\315\376\237\245\320h2ylZ\232\017qe\200\327W\022b\240\220j`\203\260\021\250|\232I\002\021Db\305\323\244pG\230\360+\211\013)\334\211\3102\327\002\261\257\002\344\026\271Y\312\246\275\345\362\341\305*\2545W\332\204D(\240X\024\310\250\244(-\235\301\215ED\332g\231bb\224\r\023P\351\002\030\314\034\202\013L\230\"\221\t_\363\213\244\235-\311u\310\253\021r`8!4\014\0045{m+4\202R\"\350D$R\2334\010&<\002\200\210i\343\225+\271\013\244\r\261\237\\\3362\n\301\004H\212DDD\004dc\033\317\002\010\270M[\361N\022n\331*$\017\023\023\244ZB%\361""\0300\031\021Q\223F\215\030F\343\0042&\261\245Zz48x\211\r&\037\225\301\030\237\215\303\226\213\354\014\371E\212\257\t\006\256b,\373\374B\311\330?\007f\222\342g:\222\006+^J\016p\303\000\272w\330\231$\220t\261}\347\226U\335\350\013\037A,K^s\334\361\027\223\324-\276o\204d\217\030L\250\214\215\003\033PF0\231\242\033q\215Q8\226\204\206\352N\025\307j\226v\206\346%\323\353.>+.\311]t\236\364NKe\245\265g\216\226U\\\035\344\262\200\025\323\0211\203\220\313.A\300@\326\200\310\2021\021\202 \243\020`\212\250*]2\337|\033\302\352p\001khu\007U\262&\216\226\243,\334JH\202R\035&\241\315\226\245)@\242\033#D9C\206\232\211DO+K\264\252A\240\205Z\304\372[\331\204\333\231BM`\032\014[fM\021{gF\027\356\302{\n\327\020\245)\003{N\314n\031m\232cB\300\357\263I\\\211b\3472\335S<\246\025)\217\217>\030\211fL5\220c\252e\372\311U\315\240\255PJX\374\034h\002$)\215\032\025\226\027KOg\201\332\337\221_vm\330\024#D\347\025T\225\244X\345\242\207.\351\025+\005)2Ch!8\032\234J\215\000D\23124\022\2311\276\373R\003'\203\031\225\300\225]\344\213\321\207\237\026\265fLc\254i\327*V\272\322I\363\203\274\264X\350\016-&{RFA\242\320\020)X\221$\244\322\206\221H\250vr\0100\251\305\242\363>u_( \004b\333FC\021\215\243<\022$O/&d\311%\236F\035\336\362\\\275\356\374\267\031\375\354\271\321.P&($\303\232]\275\245\016\342\360\207\021\223p\274\253\216\231%\310\212\340\321\331.\014\302A3\321\344\2503\253\252KD\242CE\271hW\246\366P\014\030%\233\225W\257v\002\265\027g\325\021d.i\230\3623\020\311\312\340\233\346|\351x7Bi\245\001\021X\313\206\004[\260K\240\014\207t\251t\006\000\236\365\201\240fn8\254Mk\024D\231\274fpT_\265Q\021O_\342\016\227T\233D\253\025S\301z}\037\232\006\217\260E\007\242\037Ef\363g\327+\254n\266Z\233\025\375\356;\376E\266%\212\250\245\316~\246\241\355\r\030\254\242V~\250\030\377+KH\373\n\231\2507yv\240\302\340\026\205\227\272br\");\261\346\212j\333\336L\365\306w\204q\036\037\t9\276\355\243\332\253\301)Of?c\251\254\340|&P\177\301F'3\233\331\0327\017\273F\004\224\350\341\274u\343\024N~G\0370\366\236\347;\274\370\260P""\030yT\034w\035\321\\\353\212\027\342d\251=_9/\036e\275\301}\004mC\313\305\273.k\313\315LK8\324\357\254\215\332W\274Ts\213E\221tZ8L\333\232\321R\267\246;]\020\177\215'\271z\256\272\004\013\007\30090\024\335d\255\006H\331h\023\302<\365$\340\372\023&\202\336\007\244\31425\230+\3178\005\303H1\177\255O\341\007^\300\337\0242\307\210/\257\330*\025dWPl\321e\221\203\0160\220\304%\225\t\300\332\005\314BB-?4\336\220\242\021\353h\3123IF\251\033\215\032(\220*W\310\253\354\177s\224\335Uav.*\344^\025\277\361w$S\205\t\013\241\010\t\360"; + PyObject *data = __Pyx_DecompressString(cstring, 3079, 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 (2997 bytes) */ +const char* const cstring = "x\332\335Y\315s\333\306\025\267Z\267\225\\*\221,\371\253\211\247K\177\304dD\323\245\242\304\262&r\303\310\311\324ibK\226\374\025\215\006Z\002K\t\026\010@XP2\335f\222\243\2168\342\210#\217<\362\350\243\2178\362\250?\301\177B\337\333\005@\360C\262\223i\234N=\266\264\330\335\367\375{\357\355\256\363\305\262\246\021JT\313\344\256Cu\323%\256E\334mFl\307\252\030\254Vn\303fb\316r4\360b\2156\204\317k\266\345\000\026\334\256}2\343c1\357.\337s\"3E\236\037\223\233\251\004\310\345\021)\271\177]\243\327\026H\351\207\002\221\243\331\037z\251\327\234:;.1\022Ks\333\224o\313\304\254<\203\360@\364\356\213\001q\030\002\005\222\034QCc]\006\234\036s\352Y\320\000C\250\246\241s\200\253[\007\227\025\000-\256@\346\021\211xG\320l\202\002\253\210\256*\321]V\343\003\362\000\031\272\211*\211\000Y\200dT\036Q\016\300\024\210\306\205-}\217\231]+!\360\003\214@h\275\306z\020`\231\210\024R\263\034\226B\373\377^\361\377\371E\222\030\314\314%d\275\313\267\0066KL}R \327*\002e\010\271\204\370\027\341L\324\214n""\261\350\003\035\326\214\262\331\210\276\006\"\005\t\355R\031t\332Ss\"\352\030\252\002\251o\302)\1773P\177\023\214\016r\301j\325\007\322\245mjn\2614\0341.\242\243\326\035\007r\025z.\230S\347\354m`\032\221.\222\373\266\253\327\364\027L\373\222\252;P:\325\035P~U\254\036\215\334\024\272%\2437\325/\301\215\350<\222\373\263p\024\251\332\323\304i:2\222?F\346\036\333?\022\004}\222\227\220\026\275\245a\222\213\250\261n\251\023G\037\207A\333d{\254\213\377b\267\023\363\205T[\346\244V\347\256\354\351RI\216Z\362zE\250(\2770r\2513\200X\221\240B\307\260\232\3556\344\347[s\213\250%'\300/tnW\364\300\252\016N\204\340\333\242\351\246\272\"\217\216\036\362@\300\013d\313r\311\327:\236\363\244\301u\307\304D\213\014\376\225\353__o\343\344\036T\341Al\274u\371\304\3129\367\326\315\264g\227,{s\263?tM| \274\321\007FM\027'.\3524 Gm\033\023\275\247[\310D\207\032\021{\020\016\307i\027&\314\006\234\016G\235nm\177g~\207~\201\247\375\365\215w\344\366\376\376\264\2368~\343\r\236\3072\215\300O\"\240\203\307\217\215A\271\307\245G\005\0021w\317r\231,\316K\342\350\214X\324\230\241W\340\342\3422(\254\230/\220J\310\001\316\346\313_-_\237\233\237\213\302'\373PovV\352\272\341\342\261\036\016\241\274H\356VI\303\252\023\223\311jcc\351I\021\200Z&\036\221\204~\327\250iZ.E\245\025 \007\353\256\201\315\016\010\201\236\201\324_S\003j\374\375\n\366\305\377\373v0\024\no\352\004\211oE\036\016\363I\302\016\355\0050\031\353\253\321\331bc\231:\220\213\314\210(A\311.q\372\366[\020\341\257\233\206\276\203\010\221u\265Jy\202\222c\\Y$\313\006\243\234\341\351\005\256#\300\t\024\203v\017XY\036v'\307C\n\264\247\322\\)\277<\230\205\321\352\374g\303\026yL[\232O\226S\371x\027\325\225;f\207\357\210\351\347\3776l5a\177\353V\337\362^\302\370\346l\262$\216j\321\364\334\\2\315\373(>\275\231\177\300\342\204\210\334\237\200M\236\260P\370o~9\023\346\344~I\277\301\307\213^\214\003\010\360H\t\005\007\013\225\254\377\335\352\025u\374\377rC\300\232\232\263\207\243\"\227\377\025;\003\032:\374\002#E\017\020\230\354\271\233C\252\243\332\366[""\022\254A\036\262\n\344\"\311\325,\2167]\025\261\205O\036\004*\206;\344\335\246X\354}\013Yu-\373\256\010\024\250{\252\313X\227\305\035\212\023\203\224\326\342\363\230\326\275\212>4\201b=\375\232\263\024\275\345\024\260\303l<\344\361\305\241\277\010\231dm\333aT[\266,\003\356\250\032#\373:4\252\272K\252\016c\256XCZ\361\242\243R\250pp\367\000\034A\271\022\257sP\330\212O\241\003mS\350!\342\320;\370\222\305\005\317>\321\210\0168\177r\005\205.b\364\363I\361B)\321\313R\372\204\211\325\031\324\301[\037#\333\256k\363\205\0337l\371$\325\335W\334\002a\365JQ\267\006\327n\210'C\254\306\305m\267f\\NQ\3659F\263T\016\027%\364\373\376v#_ \305\277\003\010\025h\240,\305.\206\231\335\320t.\"\221D\007\337\276h\215!\034\345\271\271.\343\n\031W\027\307\rf\"\301\226\252s9\3220g\3261Zb \256\215\033\233\342Z\255(X}\025%\371\206\344\305K[\377w\361s\303\202\264\342\267!\273M|y\034\332\331\206N\036G\032\027\230a\255nH\177:\242\345\r\353d\303\346\312\374[\210\323\035\010\317\260\325\373\370\262\3104\334r\244\312G\354\037\350\225=\035r\240/\202\273\033\317\341\037j\242\334\203\322\366\200U\343\023\213\334!j\213\322\343\306\224k\322^\202\320&\307e|\34365\312\033\246\252[E\325r\000\365\320\200y\005\352\214\252\002\235\243bC\206\220+n\\9U\303\342\220]\000\020U^\212iEU\0054\231\342ZJ\252\024t\207\251\014\036\272^\224\2171\251\t\361&\355\244'\244OR32\351\370p\2110\264\033\252U7]\2151\033?\024\005\252\005\376@I\362'\007O\202\375=5TQ\360Y]Q\2428\306pN\305\261\017K\351\010\017\307\316\021\030Hb\017\003\364\260x\250F\301.>-)J\234i\212\2166F\241\301\217-\335P\242j\204;\201\000\324\020\317Q;\254\301\025\005MCr\250kT\324\035\361aiu\210\220R\343`\242\t5\017~\202\371\226-\217\034B\270(\206\\\376w\200\255\253;\242\330\330\226m;\230o\242\017(0\206\r@\255\244[\203\242\354\326\251!\331:\000L\270\260pE\260\000\227\nL\213\037\253p\261a\362\306\313""\231Q\205\232\252\2450\016\303H3\030E\377\r\300\241T)X\037\305\000\253fr(\212\177'\003\271/\371\2126#\353\370\227\353\244\321\302\321Y.\343\340c\010\277\265/\257[{p\177\3245\320S\334#\345e2N\030%\311\234\356 \305p\237:&\376\303\267\225\027\272\035\236\274\022\224_\223\023c\231\203[\336\222\347\372\245N\346txz\276=\322\236n\257\264)|y\037\373e\177\2453\372\347\203\271\203\027\376\244?\023\353Q\357Ep:\274\374$|\3624|\372}g:\337\234l^i\322&oe[\245\326\227-\255}\265\375\343+5\\QB\205\205\254\032V\365P\337\tw\214\316\364e\020v\007E\211\330\037\216\216u2\343\362ox2\027\346\276y5\023>|\364\372#\304\n\206\330\010 \200\023\341D68\007N\235\304\235\343\347d\320:\231l\230\375\"\374\342Y\370L\260\356\335\366\372\217\310B\202\251\020P\264\3429\032|8q1\274x\243\271\333\032\351L~\000\366}\333\034\351\340\324\255\366d;{\010&\322\310\316`\022\201\360\235\177.\370]PhR\177%X\t&\203\221\360\344G\001}\235C\\|\013\356\313Lx\031\000\323\367\340>X\330\n\257\177\3712{8J\202\223\301w\340tp\344g\336\224\367\025\270o\311\337\r\376\024\360&\230s\016\301\325\031=\207N\004\330\216Ny\213\310\027\314\352\214\236\366\256x;\301\031P\030\326\367}\206\353\0201i\315'\007\364\300\r\247>\n*\315\221C\220\374\236\257\201{&.\204\027\204A\000\035\375\345\013D\311""\004F\227\373W\375\335\316\364y\377\275\200\242`\344\201J\217\007k\350!\004N\2513\361\241\177G\330\232Aq\225 \323,KY\220\242S\341\324\325\360\352\343\360\361\223\303Q\241\\F\232|\336\037\361?\014V\344\3678\014\244\023\220W\331\177\032l5\0374\377\335.\305\313\353\340\351\314Y0j2\230i>m\325^\212\225o\274-\3771\306\360\2647\203\031\033i\203\256y\024\224\016\001\326\rd\215^y\356\357\276\316\310<\334\367\3250\373y\033R9\023f\026\332Y\361\033\240/~\317\266\204\211\023\"\344W\374g\315\261\260\264\031n\322\220J\010\"N\244m\010,\315\377\030\305Ox#^\344\2149\220\364cSk]\201\364\230\300R\262\362\037\371\313\032I"; + PyObject *data = __Pyx_DecompressString(cstring, 2997, 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 (8454 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.Constraints: 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 = OptimizedBacktrackingSolver()\n >>> proble""m = 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 Optional[Sequence]ParallelSolver is currently experimental, and unlikely to be faster than OptimizedBacktrackingSolver. Please report any issues.Problem.addConstraint (line 141)Problem.addVariable (line 86)Problem.addVariables (line 118)Problem.getSolutionIter (line 218)Problem.getSolution (line 180)Problem.getSolutions (line 199)Problem.getSolver (line 72)Problem.reset (line 44)Problem.setSolver (line 57)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 Tried to insert duplicated variable Union[Constraint, Callable, str]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.CallableCompilableFunctionConstraintConstraintDomainFunctionConstraintHashableOp""timizedBacktrackingSolverOptionalParallelSolverProblemProblem.__init__Problem._getArgsProblem._getArgs..genexprProblem.addConstraintProblem.addConstraint..genexprProblem.addVariableProblem.addVariablesProblem.getSolutionProblem.getSolutionIterProblem.getSolutionsProblem.getSolutionsAsListDictProblem.getSolutionsOrderedList..genexprProblem.getSolutionsOrderedListProblem.getSolverProblem.resetProblem.setSolver__Pyx_PyDict_NextRefSequenceSolverUnion_addConstraintaddVariableaddVariablesallvariablesappendasyncio.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__throwtypingvvalidatevaluevaluesvariable_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(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!@\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 < 175; 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 = 175; i < 192; 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 < 192; i++) { + if (unlikely(PyObject_Hash(stringtab[i]) == -1)) { + __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = stringtab + 175; + for (Py_ssize_t i=0; i<17; ++i) { + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + } + #else + 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 CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + } + #else + 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 ); @@ -11038,89 +10948,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), 164, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 164}; 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__5, 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), 243, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 243}; 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), 245, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 245}; 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__6, 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), 290, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 290}; 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_k_Q_2, 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_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), 24}; 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), 44}; 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), 57}; 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), 72}; 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, 161}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 86}; 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_4z_V7_4t7_8ST_T_Qha, 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), 118, 25}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 118}; 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), 141, 157}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 141}; 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_J_UV_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), 180, 55}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 180}; 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), 199, 55}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 199}; 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), 218, 60}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 218}; 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), 239, 63}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 239}; 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, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 247, 173}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 247}; 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_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; + __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), 269, 278}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 269}; 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_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; + __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; @@ -11133,27 +11043,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:; @@ -11194,7 +11119,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; @@ -11235,7 +11160,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 @@ -11294,7 +11219,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); @@ -11304,7 +11229,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 @@ -11343,7 +11268,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) @@ -11356,7 +11281,7 @@ __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)) { + if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) { Py_DECREF(res); return NULL; } @@ -11399,7 +11324,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) @@ -11447,7 +11372,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); @@ -11582,120 +11507,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; @@ -11715,7 +11527,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; @@ -11735,7 +11547,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; @@ -11790,38 +11602,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) { @@ -11834,7 +11624,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; @@ -11919,6 +11715,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) { @@ -11973,7 +11884,7 @@ static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObje } } -/* ParseKeywords */ +/* ParseKeywordsImpl (used by ParseKeywords) */ static int __Pyx_ValidateDuplicatePosArgs( PyObject *kwds, PyObject ** const argnames[], @@ -12129,16 +12040,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) { @@ -12152,12 +12070,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( @@ -12329,6 +12250,8 @@ static int __Pyx_ParseKeywordsTuple( #endif return -1; } + +/* ParseKeywords */ static int __Pyx_ParseKeywords( PyObject *kwds, PyObject * const *kwvalues, @@ -12374,7 +12297,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; @@ -12739,7 +12662,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 @@ -12872,19 +12795,14 @@ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { PyErr_SetObject(PyExc_RuntimeError, 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 @@ -12973,9 +12891,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); @@ -12983,9 +12902,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); @@ -13015,7 +12933,7 @@ 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; @@ -13098,7 +13016,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; @@ -13223,14 +13141,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)) { @@ -13243,14 +13167,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(); @@ -13267,7 +13192,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))) { @@ -13386,7 +13311,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) { @@ -13437,7 +13362,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 @@ -13471,17 +13396,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_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); - if (unlikely(!next_item)) return -1; - Py_INCREF(next_item); - #endif } else #endif { @@ -13503,6 +13419,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 @@ -13522,7 +13460,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; @@ -13558,7 +13496,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; @@ -13615,14 +13553,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); @@ -13637,11 +13572,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++; @@ -13673,13 +13610,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; @@ -13849,168 +13789,123 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { #endif } -/* Import */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *module = 0; - PyObject *empty_dict = 0; - PyObject *empty_list = 0; - empty_dict = PyDict_New(); - if (unlikely(!empty_dict)) - goto bad; - if (level == -1) { - const char* package_sep = strchr(__Pyx_MODULE_NAME, '.'); - if (package_sep != (0)) { - module = PyImport_ImportModuleLevelObject( - name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, 1); - if (unlikely(!module)) { - if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) - goto bad; - PyErr_Clear(); - } +/* 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; } - level = 0; - } - if (!module) { - module = PyImport_ImportModuleLevelObject( - name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, level); - } -bad: - 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); + return 0; } - PyErr_Format( - PyExc_ModuleNotFoundError, - "No module named '%U'", partial_name); -bad: - Py_XDECREF(sep); - Py_XDECREF(slice); - Py_XDECREF(partial_name); - return NULL; + *module = imported_module; + return 1; } -static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { +static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) { 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); + 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 - part = __Pyx_PySequence_ITEM(parts_tuple, i); - if (!part) return NULL; + int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name); + if (unlikely(has_imported_attribute == -1)) goto error; #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 (!has_imported_attribute) { + goto not_found; + } + } + *module = imported_module; + return 1; } - if (unlikely(!module)) { - return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); + dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1); + if (dot_index == -1) { + *module = imported_module; + return 1; } - return module; + 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__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { - PyObject *imported_module; - PyObject *module = __Pyx_Import(name, NULL, 0); - if (!parts_tuple || unlikely(!module)) +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 *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; - imported_module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(imported_module)) { - Py_DECREF(module); - return imported_module; + } else if (unlikely(module_found == -1)) { + return NULL; } - PyErr_Clear(); - return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); -} -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { + empty_dict = PyDict_New(); + if (unlikely(!empty_dict)) + goto bad; + if (imported_names) { #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); + 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, level); } /* ImportFrom */ @@ -14052,7 +13947,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) @@ -14134,20 +14029,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; @@ -14156,7 +14047,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); @@ -14229,11 +14170,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); @@ -14259,26 +14202,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 }; @@ -14289,13 +14245,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; @@ -14321,15 +14278,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; @@ -14351,17 +14313,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 @@ -14376,6 +14337,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]); @@ -14404,7 +14368,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)) { @@ -14556,9 +14520,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)) @@ -14567,36 +14533,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) { @@ -14858,8 +14795,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}, @@ -14880,9 +14822,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}, @@ -14938,7 +14882,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; @@ -14992,7 +14938,13 @@ __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); @@ -15040,7 +14992,20 @@ 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); @@ -15152,7 +15117,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 @@ -15191,7 +15156,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; @@ -15213,11 +15178,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); @@ -15252,11 +15213,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); @@ -15291,11 +15248,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); @@ -15326,11 +15279,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); @@ -15355,7 +15304,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[] = { @@ -15384,9 +15338,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 }; @@ -15435,7 +15390,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 @@ -15477,7 +15432,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; @@ -15553,55 +15508,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; - } + 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) { @@ -15753,8 +15697,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); @@ -15763,7 +15706,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; @@ -15910,7 +15857,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 @@ -15918,10 +15865,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 } } { @@ -15965,7 +15910,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)\ @@ -16061,10 +16006,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 @@ -16133,10 +16076,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 } } { @@ -16315,10 +16256,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 @@ -16387,10 +16326,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 } } { @@ -16582,7 +16519,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; @@ -16636,7 +16606,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)) @@ -16659,7 +16629,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) { @@ -16713,7 +16683,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) @@ -17396,7 +17366,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); @@ -17597,7 +17569,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); @@ -17686,7 +17660,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[] = { @@ -17720,10 +17696,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 @@ -17755,36 +17732,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; @@ -17868,9 +17815,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 @@ -17882,10 +17833,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; @@ -17906,11 +17857,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); @@ -17933,11 +17885,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 @@ -17945,30 +17896,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 @@ -18190,7 +18179,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/solvers.c b/constraint/solvers.c index 140573f..f9b549a 100644 --- a/constraint/solvers.c +++ b/constraint/solvers.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.1.2 */ +/* Generated by Cython 3.2.4 */ /* 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_4" +#define CYTHON_HEX_VERSION 0x030204F0 #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,6 +888,22 @@ 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 +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 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) @@ -907,6 +921,12 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #else #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) #endif +#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyList_GetItemRefFast(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_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(o, i) +#endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) #elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS @@ -966,15 +986,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 +1092,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 +1140,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 +1351,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 +1387,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 +1412,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 +1422,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 +1438,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 +1454,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 +1471,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 +1487,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 +1517,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 +1745,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 +1753,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 +1771,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 +1796,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 +1817,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 */ @@ -1841,19 +1862,10 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #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 +1875,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 +1927,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 +1989,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 +2022,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 +2043,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 +2085,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 +2139,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_DefinitelyUnique) + #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 +2193,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 +2240,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 +2315,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 +2368,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 +2382,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 +2418,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 +2432,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 +2442,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 +2458,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 +2478,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 +2514,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 +2593,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 +2624,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 +2651,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 +2666,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 +2754,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 +2771,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 +2791,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 +2861,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 +2924,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 +2994,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 +3009,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[244]; + PyObject *__pyx_number_tab[3]; /* #### Code section: module_state_contents ### */ /* CommonTypesMetaclass.module_state_decls */ PyTypeObject *__pyx_CommonTypesMetaclassType; @@ -3189,6 +3029,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 +3075,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,161 +3105,161 @@ 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_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_append __pyx_string_tab[73] +#define __pyx_n_u_arcconstraints __pyx_string_tab[74] +#define __pyx_n_u_arcs __pyx_string_tab[75] +#define __pyx_n_u_arcsvariable __pyx_string_tab[76] +#define __pyx_n_u_args __pyx_string_tab[77] +#define __pyx_n_u_assignment __pyx_string_tab[78] +#define __pyx_n_u_assignments __pyx_string_tab[79] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[80] +#define __pyx_n_u_bool __pyx_string_tab[81] +#define __pyx_n_u_c __pyx_string_tab[82] +#define __pyx_n_u_check __pyx_string_tab[83] +#define __pyx_n_u_choice __pyx_string_tab[84] +#define __pyx_n_u_chunksize __pyx_string_tab[85] +#define __pyx_n_u_class __pyx_string_tab[86] +#define __pyx_n_u_class_getitem __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_co_consts __pyx_string_tab[90] +#define __pyx_n_u_code_object __pyx_string_tab[91] +#define __pyx_n_u_collections_abc __pyx_string_tab[92] +#define __pyx_n_u_compile __pyx_string_tab[93] +#define __pyx_n_u_compile_to_function __pyx_string_tab[94] +#define __pyx_n_u_concurrent_futures __pyx_string_tab[95] +#define __pyx_n_u_conflicted __pyx_string_tab[96] +#define __pyx_n_u_constraint __pyx_string_tab[97] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[98] +#define __pyx_n_u_constraint_domain __pyx_string_tab[99] +#define __pyx_n_u_constraint_lookup __pyx_string_tab[100] +#define __pyx_n_u_constraint_solvers __pyx_string_tab[101] +#define __pyx_n_u_constraints __pyx_string_tab[102] +#define __pyx_n_u_constraints_lookup __pyx_string_tab[103] +#define __pyx_n_u_copy __pyx_string_tab[104] +#define __pyx_n_u_count __pyx_string_tab[105] +#define __pyx_n_u_dict __pyx_string_tab[106] +#define __pyx_n_u_doArc8 __pyx_string_tab[107] +#define __pyx_n_u_doc __pyx_string_tab[108] +#define __pyx_n_u_domain __pyx_string_tab[109] +#define __pyx_n_u_domains __pyx_string_tab[110] +#define __pyx_n_u_enter __pyx_string_tab[111] +#define __pyx_n_u_exec __pyx_string_tab[112] +#define __pyx_n_u_executor __pyx_string_tab[113] +#define __pyx_n_u_exit __pyx_string_tab[114] +#define __pyx_n_u_first_value __pyx_string_tab[115] +#define __pyx_n_u_first_var __pyx_string_tab[116] +#define __pyx_n_u_forwardcheck __pyx_string_tab[117] +#define __pyx_n_u_forwardcheck_2 __pyx_string_tab[118] +#define __pyx_n_u_fromkeys __pyx_string_tab[119] +#define __pyx_n_u_func __pyx_string_tab[120] +#define __pyx_n_u_func_2 __pyx_string_tab[121] +#define __pyx_n_u_func_3 __pyx_string_tab[122] +#define __pyx_n_u_func_string __pyx_string_tab[123] +#define __pyx_n_u_genexpr __pyx_string_tab[124] +#define __pyx_n_u_get __pyx_string_tab[125] +#define __pyx_n_u_getArcs __pyx_string_tab[126] +#define __pyx_n_u_getSolution __pyx_string_tab[127] +#define __pyx_n_u_getSolutionIter __pyx_string_tab[128] +#define __pyx_n_u_getSolutions __pyx_string_tab[129] +#define __pyx_n_u_getSolutionsList __pyx_string_tab[130] +#define __pyx_n_u_getSortedVariables __pyx_string_tab[131] +#define __pyx_n_u_hideValue __pyx_string_tab[132] +#define __pyx_n_u_init __pyx_string_tab[133] +#define __pyx_n_u_is_coroutine __pyx_string_tab[134] +#define __pyx_n_u_is_valid __pyx_string_tab[135] +#define __pyx_n_u_is_valid_locals_genexpr __pyx_string_tab[136] +#define __pyx_n_u_is_valid_locals_genexpr_locals_g __pyx_string_tab[137] +#define __pyx_n_u_item __pyx_string_tab[138] +#define __pyx_n_u_items __pyx_string_tab[139] +#define __pyx_n_u_iter __pyx_string_tab[140] +#define __pyx_n_u_key __pyx_string_tab[141] +#define __pyx_n_u_keys __pyx_string_tab[142] +#define __pyx_n_u_lambda __pyx_string_tab[143] +#define __pyx_n_u_list __pyx_string_tab[144] +#define __pyx_n_u_local_assignment __pyx_string_tab[145] +#define __pyx_n_u_lst __pyx_string_tab[146] +#define __pyx_n_u_main __pyx_string_tab[147] +#define __pyx_n_u_map __pyx_string_tab[148] +#define __pyx_n_u_metaclass __pyx_string_tab[149] +#define __pyx_n_u_mincount __pyx_string_tab[150] +#define __pyx_n_u_minvalues __pyx_string_tab[151] +#define __pyx_n_u_module __pyx_string_tab[152] +#define __pyx_n_u_mro_entries __pyx_string_tab[153] +#define __pyx_n_u_msg __pyx_string_tab[154] +#define __pyx_n_u_name __pyx_string_tab[155] +#define __pyx_n_u_next __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] @@ -3425,57 +3271,85 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_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] -#define __pyx_n_u_queue __pyx_string_tab[172] -#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_pushState __pyx_string_tab[168] +#define __pyx_n_u_pushdomains __pyx_string_tab[169] +#define __pyx_n_u_qualname __pyx_string_tab[170] +#define __pyx_n_u_queue __pyx_string_tab[171] +#define __pyx_n_u_rand __pyx_string_tab[172] +#define __pyx_n_u_rand_2 __pyx_string_tab[173] +#define __pyx_n_u_random __pyx_string_tab[174] +#define __pyx_n_u_recursiveBacktracking __pyx_string_tab[175] +#define __pyx_n_u_remaining_vars __pyx_string_tab[176] +#define __pyx_n_u_requires_pickling __pyx_string_tab[177] +#define __pyx_n_u_result __pyx_string_tab[178] +#define __pyx_n_u_results __pyx_string_tab[179] +#define __pyx_n_u_return __pyx_string_tab[180] +#define __pyx_n_u_self __pyx_string_tab[181] +#define __pyx_n_u_send __pyx_string_tab[182] +#define __pyx_n_u_sequential_optimized_backtrack __pyx_string_tab[183] +#define __pyx_n_u_sequential_recursive_backtrack __pyx_string_tab[184] +#define __pyx_n_u_set_name __pyx_string_tab[185] +#define __pyx_n_u_setdefault __pyx_string_tab[186] +#define __pyx_n_u_shuffle __pyx_string_tab[187] +#define __pyx_n_u_single __pyx_string_tab[188] +#define __pyx_n_u_solutions __pyx_string_tab[189] +#define __pyx_n_u_sort __pyx_string_tab[190] +#define __pyx_n_u_sorted __pyx_string_tab[191] +#define __pyx_n_u_sorted_variables __pyx_string_tab[192] +#define __pyx_n_u_sorted_vars __pyx_string_tab[193] +#define __pyx_n_u_steps __pyx_string_tab[194] +#define __pyx_n_u_steps_2 __pyx_string_tab[195] +#define __pyx_n_u_super __pyx_string_tab[196] +#define __pyx_n_u_test __pyx_string_tab[197] +#define __pyx_n_u_throw __pyx_string_tab[198] +#define __pyx_n_u_types __pyx_string_tab[199] +#define __pyx_n_u_unassigned_vars __pyx_string_tab[200] +#define __pyx_n_u_v __pyx_string_tab[201] +#define __pyx_n_u_val __pyx_string_tab[202] +#define __pyx_n_u_vals __pyx_string_tab[203] +#define __pyx_n_u_value __pyx_string_tab[204] +#define __pyx_n_u_values __pyx_string_tab[205] +#define __pyx_n_u_var __pyx_string_tab[206] +#define __pyx_n_u_variable __pyx_string_tab[207] +#define __pyx_n_u_variable1 __pyx_string_tab[208] +#define __pyx_n_u_variable2 __pyx_string_tab[209] +#define __pyx_n_u_variables __pyx_string_tab[210] +#define __pyx_n_u_vars_involved __pyx_string_tab[211] +#define __pyx_n_u_vconstraints __pyx_string_tab[212] +#define __pyx_n_u_x __pyx_string_tab[213] +#define __pyx_kp_b_iso88591_1_Ja_IQ __pyx_string_tab[214] +#define __pyx_kp_b_iso88591_39A_D_1_e81_9G5_9Cq_t1A_Q_S_a_1 __pyx_string_tab[215] +#define __pyx_kp_b_iso88591_3awVWWX __pyx_string_tab[216] +#define __pyx_kp_b_iso88591_66QQR_D_at9N_a_z_Yas_Q __pyx_string_tab[217] +#define __pyx_kp_b_iso88591_66QQR_V_d_fL_G7_F_a_L_q_F_7_1_E __pyx_string_tab[218] +#define __pyx_kp_b_iso88591_66QQR_b_Zq __pyx_string_tab[219] +#define __pyx_kp_b_iso88591_66QQR_t_1I_4q_1 __pyx_string_tab[220] +#define __pyx_kp_b_iso88591_77RRS_4q_4q_AYm1_t_AYa __pyx_string_tab[221] +#define __pyx_kp_b_iso88591_77RRS_b_Zq __pyx_string_tab[222] +#define __pyx_kp_b_iso88591_77RRS_t1D_q __pyx_string_tab[223] +#define __pyx_kp_b_iso88591_77RRS_t_AYa __pyx_string_tab[224] +#define __pyx_kp_b_iso88591_77RRS_t_i_T __pyx_string_tab[225] +#define __pyx_kp_b_iso88591_8_1_Q_L_3a_Q_1_1Ks_Qk_G1A_1Ks_Q __pyx_string_tab[226] +#define __pyx_kp_b_iso88591_AQd_1A __pyx_string_tab[227] +#define __pyx_kp_b_iso88591_A_b_A_c_jPTT_a_5_Q_HA_t2S_q_WA_Q __pyx_string_tab[228] +#define __pyx_kp_b_iso88591_BBn_o_J_J_K __pyx_string_tab[229] +#define __pyx_kp_b_iso88591_EQ_A_1_q_Qd_Qa __pyx_string_tab[230] +#define __pyx_kp_b_iso88591_N_O_E_E_F_A_Q_A_4_2_9A_A_9G1_WA __pyx_string_tab[231] +#define __pyx_kp_b_iso88591_N_O_E_E_F_P_qPUUaaeeffkkoosszz __pyx_string_tab[232] +#define __pyx_kp_b_iso88591_UUV __pyx_string_tab[233] +#define __pyx_kp_b_iso88591_UUV_b_Zq __pyx_string_tab[234] +#define __pyx_kp_b_iso88591_UUn_o_Z_Z_P_P_Q_q_L_y_q_WA_Q_t1 __pyx_string_tab[235] +#define __pyx_kp_b_iso88591_UUn_o_Z_Z_P_P_Q_t1_q_q_1__Cq_1 __pyx_string_tab[236] +#define __pyx_kp_b_iso88591_U_U_V_k_FWWX_1_q_E_1_q_QgQe1A_P __pyx_string_tab[237] +#define __pyx_kp_b_iso88591__3 __pyx_string_tab[238] +#define __pyx_kp_b_iso88591__4 __pyx_string_tab[239] +#define __pyx_kp_b_iso88591_aq __pyx_string_tab[240] +#define __pyx_kp_b_iso88591_iq_b_A_c_jPTT_a_5_Q_q_c_E __pyx_string_tab[241] +#define __pyx_kp_b_iso88591_q_Q __pyx_string_tab[242] +#define __pyx_kp_b_iso88591_q_Ry_Q __pyx_string_tab[243] +#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 +3361,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 +3381,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<244; ++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 +3408,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 +3425,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<244; ++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 ### */ @@ -3627,7 +3507,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 +3610,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_GetItemRefFast(__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 +3639,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_GetItemRefFast(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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); } @@ -3781,7 +3661,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 +3710,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_GetItemRefFast(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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); } @@ -3852,7 +3732,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 +3757,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 +3767,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 +3786,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 +3796,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; @@ -4055,7 +3935,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 +4040,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 +4071,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 +4091,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_GetItemRefFast(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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_5); } @@ -4235,7 +4115,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 +4217,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_GetItemRefFast(__pyx_t_1, __pyx_t_9, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_9; } else { { @@ -4473,7 +4353,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_GetItemRefFast(__pyx_t_5, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_11; } else { { @@ -4551,7 +4431,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_GetItemRefFast(__pyx_t_2, __pyx_t_13, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_13; } else { { @@ -4619,7 +4499,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_GetItemRefFast(__pyx_t_6, __pyx_t_15, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_15; } else { { @@ -4664,10 +4544,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_GetItemRefFast(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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_19); } @@ -4688,7 +4568,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 +4608,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 +4692,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); @@ -5036,7 +4916,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 +4978,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 +4999,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 +5013,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 +5037,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); @@ -5244,7 +5119,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 +5181,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 +5202,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 +5216,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 +5240,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); @@ -5452,7 +5322,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 +5384,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 +5405,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 +5419,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 +5443,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); @@ -5650,7 +5515,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 +5575,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 * """ @@ -5806,7 +5671,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) } } @@ -5920,7 +5785,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 +5831,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 +6073,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 +6100,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_GetItemRefFast(__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 +6116,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 +6129,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 +6299,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 +6354,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_GetItemRefFast(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_GetItemRefFast(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_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); } @@ -6516,7 +6385,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 +6445,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_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -6623,7 +6492,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 +6557,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 +6591,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_GetItemRefFast(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_GetItemRefFast(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_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_10); } @@ -6749,7 +6622,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 +6682,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_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -6856,7 +6729,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 +6864,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_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -7038,7 +6911,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 +6966,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_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -7138,10 +7011,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_GetItemRefFast(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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); } @@ -7162,7 +7035,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 +7079,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 +7171,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_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -7345,7 +7218,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 +7276,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); } @@ -7522,7 +7392,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 +7476,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 +7533,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); @@ -7801,7 +7671,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 +7751,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); @@ -7977,7 +7847,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 +7907,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 * """ @@ -8133,7 +8003,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 +8180,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 +8237,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_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -8575,8 +8445,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 +8500,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_GetItemRefFast(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_GetItemRefFast(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_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_11); } @@ -8657,7 +8531,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 +8591,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_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -8764,7 +8638,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 +8703,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 +8737,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_GetItemRefFast(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_GetItemRefFast(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_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); } @@ -8890,7 +8768,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 +8828,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_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -8997,7 +8875,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 +9010,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_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -9179,7 +9057,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 +9112,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_GetItemRefFast(__pyx_t_7, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -9279,10 +9157,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_GetItemRefFast(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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_11); } @@ -9303,7 +9181,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 +9225,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 +9317,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_GetItemRefFast(__pyx_t_7, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -9486,7 +9364,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 +9422,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); } @@ -9659,7 +9534,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 +9662,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 +9705,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_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -9941,8 +9816,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 +9870,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_GetItemRefFast(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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); } @@ -10015,7 +9894,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 +9949,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 +9981,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_GetItemRefFast(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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); } @@ -10122,7 +10005,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 +10124,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_GetItemRefFast(__pyx_t_7, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -10286,10 +10169,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_GetItemRefFast(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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_10); } @@ -10310,7 +10193,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 +10233,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) @@ -10533,7 +10416,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 +10510,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 +10544,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); @@ -10763,7 +10646,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 +10730,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 +10787,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); @@ -11038,7 +10921,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) } } @@ -11148,7 +11031,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 +11077,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 +11216,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 +11247,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_GetItemRefFast(__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 +11268,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_GetItemRefFast(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_GetItemRefFast(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_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 426, __pyx_L11_error) __Pyx_XGOTREF(__pyx_t_12); } @@ -11416,7 +11299,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; @@ -11542,7 +11425,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 +11485,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 * """ @@ -11708,7 +11591,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) } } @@ -11816,7 +11699,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 +11745,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 +11845,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_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { @@ -12047,8 +11930,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 +11957,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_GetItemRefFast(__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 +11971,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 +12023,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 +12052,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 +12117,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_GetItemRefFast(__pyx_t_7, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { @@ -12337,7 +12220,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_GetItemRefFast(__pyx_t_7, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { @@ -12386,8 +12269,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 +12300,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_GetItemRefFast(__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 +12319,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 +12374,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_GetItemRefFast(__pyx_t_8, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -12530,10 +12419,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_GetItemRefFast(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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_5); } @@ -12554,7 +12443,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 +12483,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 +12540,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,8 +12596,14 @@ 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_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 @@ -12732,7 +12627,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_GetItemRefFast(__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 +12646,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); @@ -12916,7 +12811,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 +12898,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 +12921,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) { @@ -13141,7 +13036,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 +13122,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; @@ -13329,7 +13224,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 +13291,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 +13300,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 * """ @@ -13500,7 +13395,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 +13479,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 +13614,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 +13634,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 +13683,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 +13698,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 +13728,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_GetItemRefFast(__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 +13752,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_GetItemRefFast(__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 +13803,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 +13816,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_GetItemRefFast(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_GetItemRefFast(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 +13866,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 +13948,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 +13977,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_GetItemRefFast(__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 +14059,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_GetItemRefFast(__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 +14117,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_GetItemRefFast(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_GetItemRefFast(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 +14169,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 +14247,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 +14288,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 +14297,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 +14317,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 +14343,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 +14370,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 +14440,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:; @@ -14669,7 +14527,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 +14580,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 +14594,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 +14626,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 +14635,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 +14654,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:; @@ -14883,7 +14736,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 +14798,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 +14819,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 +14833,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 +14857,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); @@ -15086,7 +14934,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) } } @@ -15196,7 +15044,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 +15214,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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -15504,18 +15352,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 +15433,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 +15466,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 +15498,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 +15511,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 +15525,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 +15551,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 +15619,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 +15647,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_GetItemRefFast(__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 +15705,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 +15715,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 +15725,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 +15794,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 +15825,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:; @@ -16075,7 +15917,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 +15997,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); @@ -16253,7 +16095,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 +16240,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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -16571,7 +16413,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_GetItemRefFast(__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 +16432,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_GetItemRefFast(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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_5); } @@ -16614,7 +16456,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 +16518,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) @@ -16914,7 +16756,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 +16799,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 +16828,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 +16846,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 +16889,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 +16928,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); @@ -17177,7 +17016,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 +17103,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 +17147,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 +17205,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_GetItemRefFast(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -17430,7 +17273,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 +17308,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) @@ -17615,7 +17458,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 +17613,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_GetItemRefFast(__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 +17698,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 +17752,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_GetItemRefFast(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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); } @@ -17929,7 +17776,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 +17831,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 +17863,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_GetItemRefFast(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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_5); } @@ -18036,7 +17887,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 +18006,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_GetItemRefFast(__pyx_t_5, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -18200,10 +18051,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_GetItemRefFast(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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } @@ -18224,7 +18075,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 +18115,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) @@ -18433,7 +18284,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 +18426,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 +18497,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_GetItemRefFast(__pyx_t_5, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_12; } else { { @@ -18691,10 +18542,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_GetItemRefFast(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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_XGOTREF(__pyx_t_1); } @@ -18715,7 +18566,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 +18603,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 +18679,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 +18715,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 +18787,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 +18838,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 +18930,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 +18941,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 +18955,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 +18990,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 +19010,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 +19059,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 +19145,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 +19156,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 +19170,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 +19205,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 +19225,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 +19264,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 +19342,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 +19353,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 +19367,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 +19402,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 +19422,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 +19460,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 +19513,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 +19524,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 +19538,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 +19573,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 +19593,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 +19629,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 +19689,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 +19700,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 +19714,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 +19749,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 +19769,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 +19808,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 +19864,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 +19875,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 +19889,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 +19924,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 +19944,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 +19981,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 +20031,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 +20042,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 +20056,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 +20091,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 +20164,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 +20183,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 +20202,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 +20221,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 +20240,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 +20259,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 +20278,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 +20336,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 +20398,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 +20429,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 +20509,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 +20557,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 +20587,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 +20608,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 +20621,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 +20645,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 +20669,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 +20693,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 +20717,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 +20741,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 +20763,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 +20786,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 +20796,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 +20805,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 +20827,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 +20849,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 +20871,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 +20887,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 +20910,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 +20926,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 +20948,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 +20970,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 +20992,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 +21010,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 +21033,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 +21049,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 +21071,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 +21093,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 +21115,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 +21137,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 +21159,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 +21177,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 +21200,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 +21216,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 +21231,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 +21253,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 +21275,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 +21293,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 +21316,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 +21332,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 +21354,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 +21372,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 +21397,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 +21414,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 +21436,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 +21458,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 +21480,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 +21500,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 +21523,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 +21544,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 +21568,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 +21592,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 +21653,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 +21741,44 @@ 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 CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + } + #else + 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 CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + } + #else + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -21984,42 +21789,134 @@ 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},{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 (3656 bytes) */ +const char* const cstring = "(\265/\375`3)\365q\000\372\210\000\035G\340\316\272\0010\314\3634\204\3015\234\347i\010\003a \014\204\301\265\020\006k\240\2168\314\224\311\246d\031\304c9z\016df\316\230y\036\220\371\254p\364\220\027R]\342n\2458ag\032\331\271\333\031\323\233Z\215\364\267\225\001\233\001\336\001\331Z\032n\306/'Q]Yo\274\223o\247i~\267\345\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_vj\035\363\3241\264;\265\366\331;\323*j\377j\353\256\260m-\343b]P\333@{wm\246n]C\255c\234\337oU\303\273\255\210R\371\355\343w{\256\305\225_\r\306\334\220W\233A\274S[\266\336\373%_[L\013\253s\033\3260\264_\355\371~\235k\333\252\352|vv?{\307=\223q\345\266\333\261k\005\336\276Y+\231~sF\226K\235\325\226Ym\331j\301\231\315\206\253\2361\316\353\246\266pHf$\265EbInV\334\342mi@\320\272X\254\225L\206\214A\254\304\014\034\007*\325\345r\265pX\016f\252Um\261^\265\245\262\252\325\315M\255P{8r\027\027\227\026~C\321f{^jF\206\013\267uH\313\372\253\266\321\2063\266e]A\333\rgz\307\\\227\207\026\346\356\340\215\301\252\312\311\330\313\032w\333u\316VU\373\3455_n\305\252{\005\357\315u\324\270J\213\251.~E\\\257\031\367\020\217\263J\323\225\337\331\310+\357\337Uqw\005\263\255+\021VPb/\261\232\367\355\037\256\270\360v\273\357\014\207\027\254\034\327\254k\035\227\241v[\353\365v\035\"_Q\264\265\332U\331fp\361}wB\315\353\326\264\312\271\r\277z\271\235\325\376\331\335\371\014\346\n\244\206\234F\000P\306\017\014\225p\252\324\257\200<\201\276\214\214\311\225H\251%;\34440@\033?\257\262\005\3511\372=;\036w\360\342;y\344\321\273\326\371\355\342\310=\3169\367\370\ri\264\261\306\373\345\236\347a\016\346\313i\341\345y\343\361v7\277\333\003\263\335w\274\241\035o5>\212[\274\335v\031Q\213[\363\210\236\3566\233=/\207\343\255w8\202:c\233\355W\344\241\2679\210=NsA\\\343\236\347q\334\325\261\351M\363@\257\363\215iw\337O\203\236\027\341\3330\r\366<\352\017'rq\324\321:\364\\\340\345w\217}\244m\232\247\273\367\315l\030\352o\246\275\013\352\217{\372\273\\\207_\3672\366<\317\363""\270N\036k\337\375\260\256}:\337\255}\037\277Yo\375\2714\3762.\207\347l\373m\013nN\273#z\317\r\341i\350\301m\375\262\305\236\233;\307\037\370\355\373\212\270\231\014\334\305\205Spy^\307\031{\236\253\266B\255g.\024pp@\216m\315_N\276\034\007\247\266n\306~\3239\016q\331\342h\250\255\032\267\034n\372\207A\234x\273\316\236\005\261\336\235\021\340\r/\250m\020XR\302pD\021S\\\2631'%\245\205\213\275\327*\317\3054\256>\323\370\273\"\027q\277lm\373\212w\177\031\333\320^\216k\013\003\277\270\343\020\317\254h?\336\2221\tI\014\177\255P\347\303\"\310\243+\377\362\010\023b\321\246E\333\345\265k\260U/\037+x\342\355\026\367)~\212\231?\023\373*t-\325g\266N\2200\222#\344\007\366\"\205\300\303|^>\033t\034:\235S\306_\236@\211g\221\2639\225\020)\225\345\002\344H\243\364\225+\205\320\010\253\277\352\370\035\240\177\362\231\321\2718\261i\302\272\241('\310\312\2326&/\235\355\264i\211\374\321-\267\"3\342\217`\371,&\337d\364M\006n\344\n\006\212c\306\224\034?U\236\312T\201_\300\233 Qd\210\234\345\014\334\014\230\254)\340\025S\362\221\236\312\355\025\200\244'3dz\224\251\217\235\005\"6g\203\025~\305#\370H-*CEN\020\037(Y\t+kDL/\263\205\212G`\332u\240v \037 \247NK\n=\241'L\215\362\003\314\227HS)\205\221/\222\243\274\236\247\004RJ-\331A\276\274\316\324\311\002S\226|)\r\371\017;K\036\360\201\321\235\240,\347\006sd~\360\264\220\017\003]\006\352q\252L\260\234\340iH\224\314,1yiK\033\217\362+r\006|L|Bt\323\232\256\217\257\201D\221\322\021\262/\203\360!\224\374\222\321/Q\363kh>\217\217\365Q\361\t\321\275r\004F\246\364E\366\234I#\344!\r\231\267\322\303Nf\302\314\223\262d\204$\005\022\360\263\300$\235\221\3716\235\r\332\340<\235+\312\225\262\244\202\250\"\351\t\225\260\372\267R%\022\302\213|\2447\322\003\225\302\314Ry\363\nP4>\206D\231v7[\312\312\234\335\313L\231,\274\365\tLi\250\224\361.r\006Ji\312<\231'R\231\037)}\230\177\371Nz\220\322\223\017y\017\362DJ5J\351\315\314`J(\001\224\017\374\006RB\216\000)\202\277\244\t\271AJS\271\214Q\372*Y\376\3441\002\2472\025\032\221\3230\375\374S\371\3429\374':\360s\323a""\324\345\344\237\214\276-M\312\233\023i\302\346\333\304~\354\302\277\340B1\360u\037\316\327\251B\362IL=/H\001xD;;\242\234E\263\231\010\005\nQM\215\310\203\207P-\347\346\233\210}\005\272\220\356\002\312\277\347\001\005\273\333(\205\371#\250\216\351B\360Y\"\032\021\t\022\010B@\177V\342\227\340\360?\240/t\302\310\357@\031\274\352\217\300B\246\310\r\014\263A\231\241\364\310\216\321\206OY\320_\014\030\355B\245\n\022\003Y\223+\200\361BSh\013\353\333\217]\n\022:5\230c\211}\002\362\200IC9zL\002\301\205\312:\032\245)\222#\000\000\031\200\030\200\230\310\204\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+\376\n\376\271\376Z\347\353\320>\355\376k\277%\361I\304\376\315'\024\303\020m\354n:\2244%\362\261KGD>R\3309:\037\230\254\222\004F`\267\323(\355`\017L\267\323\371b\"(C\245\207\0179\201H\351H\271\301K\330a\220v\251\323\201\202_\232\220F0@\037?\"\030\321\313KHD\010O\340\203\246\314l)\tPx\235-J\024\325\t\2711\332\311t/\240\317\261\221\006\030\355D\036D\035D\035B\032\004\372\311\030>\006\220\017\002\362\200\232\361-7&>\216\217\013\024\237\023NP\277\343\324`\205)\265\"&\210\362\304\207\240R\353;\334d1\273\227n\003J\202\362\263\307\\\240R\246J\026\237\362!\273M\332\311\314\000\346\215\207\371\032\362\300\311\017\3602\244\003\016\262\0076\203+\250\"\303\030\205\314\320\214\310H\222$\205\306B\030\014\022\n\303HX\325\354\022\262\240\243 b\306\030B\210\220\210\210\0042\"A$))H)\215\001S\0017J\370\364\001\244)r\373\264\3439\314\200\332\274[\225J\226l\223k\034\210Y/\203\332\"\304Be<\343\345&nO\241\272\0305\006\002|- \223N\027\017\251v\244k\313\021D\001\244\243\260i:9&\027\372\300\263\357: '\252\023\"Na\n$\264\220\342\242\314o\364\247\370\031\022\317\005Eg\\\263\204\374\221\270\013l\211\2170\206l\225\315\255\343$\222>t\022\320;#\004-\341\025\031\207\364==\253x\032\217`\257\240J\241l&\246A\201Ce\020\032\257\224\302B\001\2075\030\n\353\346\214\002\031\252\315\017\006\266\003\210\t.\024\320\200\300\210=\2234\230\275\014\024\230%\372\240q/\272\335\207`>c\3374\177\2553\001H\301\n\211T;yZ\020;c2\254/\205R\007PS\022`x\216?\002t\023\005;\340\r\0306\307\262\276E\245:\212\033\307\212\311F$Q\225l\031\264<\032\365\214\303\035\353\303\342\322m.\242XF\222\n\253\r\014\226;\036R\0277~\022\265.p\353\252a\025\376b\215\210\231\026R\255vZK\371Xo\017f\357\023&\305\224K\t\021J\330&\032\322B,a\211z\037\205W\252\376\225\033\303}\377A\024nS\316\351\007\306KF@\226^\357$R\212\304\267\206U\021\255\302\342o\375\0251\010\223XW\314-cT$.{\016/\336\t\2774\232\234\t\002\n\3668S\331F\327\347^[7\370\236<\230;\334\214\032\237m+\222\245\036\340\3437^u\304\366\261`\221\024\0232\t\000%}""\301\223`\030r_eO\004\354Y\304\260\201\354\251\006\264^\304\220\273\317?m\354X\276\310P\324\325\327=R@\201\325T\213\2272\237\340\252\222\n\020\314\215\204Q\244\243\371\016\035\272\310\371\217\262\210B\027gOES\311a,\330\241\177b\246\nAZmj\"\033\244\234\023\037q\360\326\021\027\210\260\343\016\014C\032\277\320\177\254\325\344T\366\0253\034a\036\214\360\214\246\334\356\305\340\361\027M(H*\010\243\013\235P\037g\354\002\323\327\325o&\226\317B\207\231\356\021\\\205j\3411SX\004^7\363\2768X\261\273_w\270\332\323Vx9p\355\250\330\211r\270\0033\204<\272\020\3336K?\250\342\021aks\t\355\002tuZa\r\305\322\022R\200\3023`\022\340!\256\270\r\r\271\214NA/E$3\262\006F\256\030\324ne\365\365\377X\022\241-\221U\202Nf\263\275\222\215#\273\217\254\262h_\231\016-\274\276&\353I=q{\210,\272\245\365aQ'\246\360\237\003\300$\235\030\275\323\001b\250\301^\241\226 \032\364\020\243*\n\032\377\224\235\372\365\026\270\301H\366a\372=Z\202\257|\nY\021\202\350\313\007\332a\206\220\332\322\026\253q\327\343\273\354\262\236\344P\000\007\361h\"\025M\226\235\234\266n\307|\222\232\225E\311\313\001\\q\207yma:r\270\n\267\261\023\223p\244\304\026X\336\336o\342\314\013\272\205x\305\022\247\266\337\266\020\036\001_\033\301q\036w\336\007n\330O\202CG\267\216%\257\334\316J\370|@\023J\375\027\363i\255k~\0160\301\217s(\345\256\362r\23438\235\213\272O\306=\241h\031T\322h\245\344\025\370\321\350FX\002J\262\252*\336\255\326\206\346\265\203\256\321L\320\355\347\016'\021\363\315\0360\355LnH\3219\246\270\264\346\230E\322\352\274\027\204V/\203\221\026\232\026\201#\206<\242i\037\000(\362\217Nv\345\233\304\264\320\326\010\1778?\007\357\317\004*\306\355\337\227\030\242\212\214\032=\277\010=\254][\345\275\345op\006\317\322\364h\006n%\204\236P\253L\022O@\360\311\226y\303t\333g\034\304\334\030\002yU\222\017\226\000\246\212\327q\t\357c\002\345\022K$\004\261?\350\013\276\033\t\200\023Q\213Z\002.C\010\275/\2778\"\356u\245\260\251\034\236\\\362\007.\201*\032\017\003;\343\317b\227X\202\336\336.\276\241\263\020{\201\215\230\206\036\260""\214\317\242\252\220\225?T\236\r\305\255\010\004\026s\215\277\177\375\211\271>7\300\265\032\201\302L:\210\376zK\007\310`\235\016O\335\201\331W\026\347SrY\320S|\323\371\267hq\343im\224x\tXj(d/\016\013\226m\262/\242f\002\253\007\240\346e0@OD\0270\220\345S\330\330\330\234\341\001\n\315\357\313\354\035\030\245\2111\235\030_\266L\020\207\021\320\304TL\302\221\r\336\334\324\027LT#\036\217=2%g\355,\237qAgJ\245\342\203\235G\215J\010\276\\`,\344\247\336C'K\221'q\034\021\253\025"; + PyObject *data = __Pyx_DecompressString(cstring, 3656, 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 (3833 bytes) */ +const char* const cstring = "BZh91AY&SY\350\350\211_\000\005\035\177\377\377\377\377\377\377\377\277\377\377\377\377\377\377\377\377\375@@@@@@@@@@@@@\000@\000`\017\237{`8H\275\335\322\247lT\256\316\272:\000\031\n(\000t\003@\\\362\000\0368J!\010\230\231\r)\352x5#\364\206\247\345O\312xF\001\"lSi\205=M6\246\321\251\345=O\024\364\324\365=F\207\2116L\223\324\362\230\322?T\022I\003M4\002j\236\215OQ\246D\323i\r\014\232~\224\017SL\020\000\000\r4\030\200\000\003&\203 \006\200\232\022\231\021\240\000\006\200\006b\200\000\000\000\000\000\003A\240\000\000\000\032i\"\200h\000\000\000\000\000h\000\000\000\000h\000\000\320h\006\200\320\365\004\0310\002`\023\023&L\000\t\2010\023\023\004\300\000\000\000\t\221\200\230\020\302\000H\220!4\000C@)\344\014\247\245O\364\004\321\242\232=&h\023L@\003@\036\240\000\006\231=C\3244mO\241\010\266C\rz\247\307\3035%\275\205Zo\377\203\010!{\222\032\03060$\240\331$\240\313\017x\310l'\272'\300\371\002\002~i\261\205\240\323\214c\2046\300\341\014QU\332\207\233x\334\327\335\340\364r\377w\261\340\337\212ElH\221H\261b\305\351\374\013\362\363y\202\334\013\210\255&3\2354\304\243x\200\\\007\016\356`\372&w\035\211(,\"EI\254/\030\r\215\214i\264\233Bl\033G\226\205\342W\362x\025\307\333\027\371\037e\257\356C\341\377\230&\024\321N\361:7?\332H\373\242(\221a\r\022C\010\t\226h\224\221\363\253\003`1Jz\014\307\213\206A\241'3pF\335\315\r\211\261\r\211\272\246\367Y\005\202\301\306\244\270\021j\373'B>\002\365\023U\224\221$M6\014\033o\207!Q\260m6\330\233cN\276\332\245\361dX^F\\\244\300\344\\\241\244=\331\305\002\256\223+B#\336\362\263H_\205\326\\\306e^\001\232i\230 9\202\342x\234\234\202\2613$\314\314\240\367\211\230x\237|\326U\\\373\271r\221\206\004k\244\311\211 \305\003\211\207)d\202\261d>\027\027\262f\031\202\345]D\032Yd\252\262\272\262\211}\332\225\270B\306\265\321l\237kK)K9\326`[x>4=\341u\325Qv\355\312\310:\r\227:RW\261\036ns\035\221$\227(\301$\2270(\023\020\t\210\352\021\267\246\022_7\314\210\021\224bI\377\272:\321\342\016\364E\017\177\360\300bv\026g\360\242\014\262\367~{\010\252;'Q\035P\246""\205\327k\031\376\364\\\244\"\016\016Z\266\213:\373\311\021R\203\263IM\321\222yOfX)UN\214\204)\234\351`'J\377\006\252\037\200\265\010ti:\363k\314\030\265\370\242\370\253&%U;\261\007hue\014\247\357\336\346\252z(hb\210=\3024\003\005\0030\313\2605\225\315$FJ\210\262\0364\336J\231*\026\024fT\277\205\024\235B\310\220p\207Y\265\264\264\241\345a\207\277\210\234\025\"1\347{G\251\302\0274\374r\322\213\267\000\270(\264!2\025\273P\0209\344V\256\"!6X\207@\206\325\021\013\270y:\360\220\272\326\325\202\024l\000\344\0054r\t-\366\367\005\354\017\026~!.F\217\032H*\003I\007rH=\010\362\377'\203_6S\273\311\247q\255n\024\223\210\367 \223s\360N%2\203\210\343\360\304\347/\243q\315\337\034\361\037~\\\223'\305\0041\236\270\205\267?\332\333\311x\254\217uF\346sj\331\351\244\316\212S\023\220\375\363V\325h\225\034\202\223{N\236/\276o-\317\213\260\300\177\003\030\307cvb9\312\230+s\230k\235\225\033\010\316\"fS.}{\250P\226\251\316j\241\302\211\022\t-q\253!\317\315\317\251\366o\035-\350\276HR^\232\024[\261\214\264\234\247\231\216\205\371\320\304_\026\214jv\221\220\333\021T\245KY\003\351\351\025\206\006H\313Ye\2554\247\232\022H\332\034J2\241o\244u(\321\237F\355\033v\356\373\033s\372\221\372\301\226bA\335wX\334(m\303F\016R\214\\\014""\314\314\346D\215#\023-\216\307\227\2379\325DL\305OH^u\224otm\235m\034\310\242\034\301\373f;\3231\300\207}w\2666\010\010\230\260\004\0066\356\314\033\236\265c\370\351\002L\300\276\216P!\021\224\377\343\225\035\210\363#\371\304I\034+\254\010DE\354/\320\177\021\004h=\202\371\021\353G\306\"RG\\I\031!\247\357\315\304\207o\207o?\2403\263\361\260\200\357pv\327v\311\302\337\263\300\222F\304\204\321\2601$W%a\251\364\316\263;\313\250\260n&\204\206S0\222\244\205\016\350\200i\250u\235\250\346I\223\224\023\315\0052\223V-\213.\343\345?bP\3304\210o\031$\300H\214\331\224w\022\354\021p\235h\310O\216B\3615}\204I\260\001\243\375R\023\331\"\324\014\302?\005\362\256\364\233E\222\027\016'\362\250F\0011'\373\324\2340=5=LZ\320j]\010\331\203\3749d\262\256,\362S\312\255\315\304w\210g\037\031\374\005Y|:i\334\303Z\033L\r\344\275\344-\265T/\342]\3368L\327F0o\337\"1\030\277\002\002\3162Q,\023\311\3527\333\225\357 ~\010-\255\305>\021\371\374\375\334\301\337\002<\t/$\303p\270\340\033>\364\317\022\r\362W\260C@\206\205\360r\310\371\247\027\034H\227\243\227\246\255\325\r\003]=t\245\205\216\204\\\003\2313\307\330\3754)A@\333I+\014@d\327\034\030\223\235\326\323\327\346\226W\215.\254x\276\361Z\347\265n\276;1\301\317\331yv\265\244\324\226V\250\210P\224\245!\0077I\nM1\244N\204 \316\206\211(D\003\234-h\"\342TH\250m\006\3145\262$\020c\277\331'X\244\256\224\364B4FIc\332\302\322\306)\325\340Z\216\201\"\376\n\267\311\"\016\032n\t\315\216t+\242V\"\324Gk \337i\022\262Dori\025\273\247\006[U\213j\306\312C1\023G\2321\314\263V\266\374r\224?\256\330\r^\023\321\346\317y\267\001\024@\300l\320\354\353,4\032\275V\246\254\322\022\306\330I\002\0318\024ki\032uZ\370#\255\033\021k\330\270\263\020C\313\204\361\256\\\251\274\204\264\"\316c\206\24144\320\223ci\231b\356\211\205)\007UT\313\257)\020<\021\314\235\315,%\223K\231\310\0176\220#$\310\nd\246\030\010C_[\244\261\2379D\326a]n\265\035\226\301pw\373\376\016M\374\351\213\027E\3328\365\2018\214I\354\3062^1\265}\325\324$\031\231\323\0311\241\222R\262(\3046\031Y8\276\237U\256""\000d\367\036\017\035\301\235\217 \224\032\310\201\261I4\276\244\242M|I\321\316z\260\000\231'\263g9\314/\235\316\315\007Ht0\213\224\375\230\205\341\324\272z,\205\243sH\"\177\370&\033\337]#-Kt,\331\347'\226\262\243@\253\031\224\247\205\346A0\310\304)Kf@E\314BZ\263\346\331 \261jl\243\200\320\354\205\2513^-\2731\247dF\025\2046\305_\006*X0*\0064\216N\236\337W\253\227&Uo\3178\320i;\361\220\200\354{\232\000\352;\014\371\316\\\324\330\206\272\034)D6\310\021!\267\344\371\003\376\321\221-h\266\316!\244r\003C\352\276\263\214\\\020$\320\"\202`43-\241bH\014\253'Y\r\2368\341\275\n\325\010,\265\311\006\305\027\201\302#\205\024\275\003\332\220\t\0319)\240\001\260\022\340*3D4Q\202\t\261\205\354\206\034r\260,n*&L\226\023\301\n\351\252\003\236\324D\303\362\221[\321.\353\010\271\323\205sS\337\260\027^8I\330At\210lr\352\010B$&\233\0216(\007\006\032^\225ftV\312H\211\205\247\004\021\307\236(\346\213\244\004\222@\332J\320\212\253Yj\265\252\233\0203\\\031e\t\013\004@\r\215\200\336\020\005\354\207 l\033\222\372\177\021\245m\336\325c\203\031\372\363I\002 \321]b&\007P\\\324\302\233{u\002\253\220/\320CHh\00646\220\327s\2040i a;w\246,>9\251h\022\303$1\242\016\030\020\024l\250\242\201hI\022\002bi\215\245\230\370\321\340i\370B\343]c\302\233K\004m[;\247SP\215i\246\344q\3273\027f\243\336Co#\257NA\345\021{\362o\347\r?\005\366r\351/\323\264\244\351A\355\324\022\311DI\"v\266\\Ky\214-\n\020\004\014\r6?\005F\201\373\362#\321\"\323\033\370LB+\244.\022\213\246\023l\344\344w\2350\360\3243\023\307AU\315%%U\267`\006Fp8\001\21070J\020\305\rCm\374\010\326$\224\267\t>\315P\217\2451\265\014\263Gj\3518\221\223\2668\216\\\222\364s[\242\355UIWM3\346wB\002h\203<\335\330\315\035\240\332\030\204\320\327\217\034\250\26104\337\177\310\2101r\022\202\341\330A\265$P\224\203\203\207\305K4\343D{\244\265Nt\237\024\021)\321\315\317X\206\022K\302\341\255P\341\032\2744\002\200N\344E\302p\351\023%|\256\254*]@\236\376\010\243l\266\275O\035R1\303v\217\037\237A\277\214{5a\233\024*F\2357\204\311i\225\360\205-\237\373\243a\260H\331\325\020Pz\031\016\274\322\256\373\222[\333~G\260>\260;\363\034e3\242L\336\222\3402\0213:\000!_\335\327\355\370\267\253a\033\271\3703\373i/\226u\265>YNI\360\341\326$\322\005{Z\200h\223\357\354\236\0059SX\242\347\356p\371(\200\314\314\006\326\315\227\033,+\356;\327\032HpH*\336\243\213o\220\273F\002\"Pd\222T\250\316o\201\341\217:\215\253>#u8N \341\222\3008\332\"\252r3\217W\365\020\261\276\300\343P\241\353\200@|Q\204\034U\027%}\003lHj\020\307\345\352\301\005B5\237\315\214\337a\336gJ4P\222B\224*03;\033b\265|\216\201\032\013\330\325\364\313\315Vkx\255\264\351\305c8\252\260\377X\311\212LVc\3268y\3479\252\242|;Y\3568'\007\256\367\233\273\024ZTZ\217\032\312<5\361;\234\354\271\367rd\216\311\200g\273\277\315T\332\374^r\324N\203\225=\372CO%{\006\375\204\342\265`\264l7\255\332\n9\304\320\261X\377\217\016\316S\317\212Y\252\233\313\3111\201\\g>\222\334\257Y\347\354=\031\320u?j\312\350\214\264\312\314\256p~\356\032\277\315E\256Omu\013\256\214\202\265\306h)B\240\335\366\264\310\310\365d\036\252'\231i\322\252)J]:\t\354\241\245\351\354\321\323\347\340y\320\r\031\334\247F\343c\2516.\207[I\307\371\365P\246\327P\251/x\240\222\r\342\225\317e3!oGRs\324h\353*\324\237;\007X\233\230\332\234\304\354\275\311\263\021V}\231\263>\205o\227\267\336\263#W\031%wT\226\233{\375\355\034\356\376Q\210\2318\222\245R\351\3051l\332\226\341\327\362\242\231\370L\302\362\341\341\341\377Up\372\3634\360""\010\331\273]\023\024\3136I[6\213\310$H\355\307\225\234\371\265xD\241n\372\316\014\275\030R_\371_~{[\355\205\t\314\206.\246cn\274y\271\311\373'\242\035\220\3402\312\006\236U\335\271\272\3459:A\210%\223RB\226\247\305\305\360\222z\302\312\031EO\323vN\311\037\227\342\214\037\302\025\351\235Hy\363\311\3267|\033\036\342\201\261\261\231\325\243\251Y\"K\370\306\330k&\336<\363][\317\034s\214&\361\265\373\247\241\242\271\315\205\206lsv\327Yc#Q\225\252\031kV\243\204\224 s\017\013\347\214jP\325\r\302\241\255!\347L\231\300\2109\022\0333ua\032B\232\305\016+5ZI\241\335\360\236\221\023\0228T\316cD\273\264j#\330\224\265b\331X\213\360\213\260\226\t\254\222\035\206\0006tK\351\363l\016yp\341t\333\254\230\255\355ONXY4]?\201\321\214\363Qm\017\347ot\313\031\377\361w$S\205\t\016\216\210\225\360"; + PyObject *data = __Pyx_DecompressString(cstring, 3833, 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 (3663 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[@\363\357R\212d\310\035\207\201x\342\377\3219\260d\254\232\264\214\254\362\223\323v\t\225[\232\254\352x\3112t\314\2401\223\222\270,\347\230\274&\347tUfr\256\254\255\321q\264(\362\245H\024\243\002\364\242\315\003=b \234$Z\321\022/\347u\023+\254\310U2e]a\242\236\241\317_\262\016\032\311\341\033\237\224\221\233\007\241\315\233h\351b\266\231\3260\022\370\031t\316\233-[e\354L\242oTLi\033\332.%;\254\357\250\rO\307\333\025b^\327\327\312\305\216\036\315\305\177\337\341f\253{qK\326\313\232Ek\230\242\317\031\362MQTt\231.$\277yp/\212\264G\001\365\351+\001k\005\002\333$\366fU\303\264D~t\037\025\351\325yC2\024\216\266\330\371\2205\364\302\032\333\202D\302C\014o\321\277\030.\272\315X\206\027\360\203Jf\007Ov\021\251\223A\273cwo\236\312a\301\177NzF\201'\252\246\330\"\010\3120BU\242\373\236\344\362\306\206\275=\301\036\276\375\244M\020\314%\213\243\320\242\265\236w\027\333l\315\0035\221\220\246k\021\027\274\34079Y '\303A\270s\210\251JW\312\340\024\376\n\206N\2361T^m\256\212\242&\025\320\002%,\235\276]\204\376\343E>\272Y\n\361\210>[\210EDF\353aC\207\306FQ/\342\367\324\222,\206{\030\rE\203\2060*\264\2773\354x(\226\315\\8\006\205\026wJe)\037\352U*\2632v\205\232\"\322\205\376\365\302\276\351\304`\205\360,\205\310d\032\254TV\021(b\364\251 \334\316\207W\264\"\2124\223\345\263&}tA_:\346\001\276\255\217=b\353}\261\243\2655o\273U\024Mf5!D\251\371\241\305\314\225\263Y\260\207o\020[\033Hz\333\010\3378\302\253\330\3722\325~6M a\212\374j\226\213\024@\026#W[9C\337\340\037\306\313Z\310\202\346\200ux\t?\223;+\3647\252#\321\321=\025\025\256\266&\245\301 \365:\377\364\265\336\021\350\233~\317Y\373W7\365\372dW\357\361\3127\266\024\304\373*\017\354\264\337\225\260/\372\302\265\352\255\332\334\353\243]G\216W\356\332\275N\302\231tSA\317\321\312H\020?i\217\331\314\271\211\347\370\261\312-\373\276\363\211\373\236{\313\273\343\225\202\276\343A\365?M\373\351'A|\300\276\353\017&=\311\263\000\316\343\355\261m`v\242\362\312\031p^\270\222kz\227\274\364\316\001\t{\300~\356|\346*\336x\365l\355h\375\343\355X\010_\326y\344\365x\367\2537j\227\353\367\266\201\351\031[j\000\377GN,\350\203*N\237{\017\260\334\250\216TS\344\227y\373\264-\021\234A\337\020\240\355#\031\222\275\3410@\324w\312N\331sA_\277\335\347\314\021r\217\334\343\336\017\265Dm\204@\263\234Y\300\272V\035\302\343\340Pc\340t\243\377\274s\r\260\377\352\245\000k\3770\034\304\321^r\347\334t\007\336\32400\010E\276\255\016\327\3225)\030<\357\\w^\301\201W\252/\3608\374\021u?k\257sO\016\216\270g\275\230\227\010\206.:\206\233\010\006/A3\340\375\000\235\2426\2329\005\303\337\007\202\245\240\237S\342D\033}@Y\352\204\217\210y\242\222\261c\000\361\245\203\366\017\375\017G\334\204;\262\023cH\360Oa6\367\201\267\002\033\343\275\004\310u@\030\013N\364sp\374\2361\177\354\206\177\343\211\377\344)Q\366z\245\024\365\351\361\207\247@\215\027\325B=\325\0245\006\034^xR\347\240\0034\351\224\314m!\212L\300\332\241\352t\255\264\247}_\361\315\226I@;\346\251\325\337\352\213\333\t\277\353\264\177z\302\237\270Y\213Q\020\366U\020|\361\312\221J\232X\370\010\200\303\216k\025\251\362\213s\211`\344\221L\0248\006\204\037\202\212W\252\351\352Z\375T\375\376vj{\356\315\r\304x\347\367\372\\d\355){\316\376\001vNy2\"k\034\224\232\252\377\354/,\372\213?\371?I\244\302'\034\2234Q\364k\342 Ap\325~\352|\340 \206\023\024^g\354%g\316Y\366\216xi\356\214F\234\2207(?\020oaJ#L\024$\016&\234sF""\234\033\356\210{\r\n}\344mV\315\332h\355~=\325\240\206\006\317P$/\035E\t\237\263D\014\376\306\221\202\201s\316e\267\031\n\337z\3030U\n\372i\276W\260\342J\350f\204\000\364J\234\366\007.\303\342\317\252j\355\267\355\025\377\3452u\234u\026\301\335\201\363\024g;\305R\366\303\354\0179\2578S\273\206\374\241\257\374\257\264\327]]z\354\233n\334\276\351~\330\335\3509\022\234<\345w\301\273\363\365t\243\347\244}\031q\204\3338R\350\264\373+\302\031\230\177\0161\307\334Y/\355)\004+\252\374c\010\007\007\264\200\317\037C\326w\261y\0229\337}\257\373\365`W\357\005J\243\0240q\360'\210#\022\375\213W\221\034\220\243\033\361\336F\030\373d\301-\347\276\013\023/\360p\006\317\002X\033\357J\234s\316\2721\367\2747_M\204\200\224B+\373\311\262O\220\212\346\032}\307\033aK\003Q\177\014\3614Gv#i\214\272\223\336'\325\236\352\034e\200T0|!\210\362hc\020\331\202\300\034n\306\265R\035\t\336\234\200\246\353\245\006OA\304\213\223X%\272\311[\373\232\374~W\357Bl\273\344/<\363\237I\276\304|\226\365\263k\376\232\356\353\246o\276\362_\375B]\306\335,\202w\251:_\033\250-\326\211n\275\247\303\304\036\304\207BZS\335I\033d\233\361H\323\336!\177p\306\263\374k\367\353\245\340\3709\347c\320\257\357\214\235s\024\004\363\245\353\325{\310\307\234?Gay\377\020G-\321\0103\323\270?>\353\317B\241\347\235\3457\347\206\256\031\177\006=B\202\274$\323^v/\274\207\333\302{\351\367\340\224#\247\354\221\240\207\257;\224\323{\004\350\322s\244\265\n\234\250l\205a\024j1\204u\017\021\025\337\025Q\035\371\023v\250N\331\275\013\277\020%xK#Z\351\202~\2540\301\300\277\034\325-{w\253\261\346z:\024D\316n\020\037\3101\203\315\325g\014\344\t\003\311\237\234\255\215\324R\373ER\030\344\275\037V\226\354\257\354\237\335\330\301F7z>\370\335\252\360D[\002\302\037\301:\354(f\234\223\240U\317i[t\357\270\250\271\342\361\\\327\033m#N\332#\366\r\270\003\371\341&e\014_H!\033}\\\003F\247\t\n\377\302g\265T\355\221\377\365\367\376\367\340J\206\342\024\333\231\346z\356w\235\303\354\347\237\221*\317\272\237wSHN\372\347\223\336Z\355\202\177\217\326\370\240""\207C@\312\225\032|\255\275HS\234\251\226h\307\222\346\333\022F\251\321\237\376\262\036\253_\364\027^\"]\370\313\253\220\230\213=$\301\017\273\227\350\266\324\375#\335~\354\316\320-\323\255\321M\353^\247\333z\367\006\321\372H\374\367M\220\251\177\324\037\275VMU\037\325)\233\370'\246\261sH~\351\177\271\340/\274\360_\274\344\232\333\t\030\276L\004t\307\260\275@\274\371=\227\375\313\267kj\275\364\372\314\177\221\243\t\365nl\034d\347\2243\357&h\377Wz\335\217\335\037\337\236\361\307F\374x\345\t\210\027km\332\350\016>\377\007\252\014\233\203"; + PyObject *data = __Pyx_DecompressString(cstring, 3663, 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 (10803 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_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_modepushStatepushdomains__qual""name__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 < 214; 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 = 214; i < 244; 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 < 244; i++) { + if (unlikely(PyObject_Hash(stringtab[i]) == -1)) { + __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = stringtab + 214; + for (Py_ssize_t i=0; i<30; ++i) { + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + } + #else + 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 CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + } + #else + 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 +21925,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 +22120,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 +22191,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 +22232,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 +22291,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 +22301,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 +22340,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,7 +22353,7 @@ __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)) { + if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) { Py_DECREF(res); return NULL; } @@ -22484,7 +22396,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 +22444,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 +22579,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 +22599,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 +22619,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; @@ -22875,38 +22674,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 +22696,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; @@ -22973,36 +22756,151 @@ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { #else if (PyCFunction_Check(method)) #endif - { - PyObject *self; - int self_found; -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - self = PyObject_GetAttrString(method, "__self__"); - if (!self) { - PyErr_Clear(); - } -#else - self = PyCFunction_GET_SELF(method); + { + PyObject *self; + int self_found; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + self = PyObject_GetAttrString(method, "__self__"); + if (!self) { + PyErr_Clear(); + } +#else + self = PyCFunction_GET_SELF(method); +#endif + self_found = (self && self != Py_None); +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + Py_XDECREF(self); +#endif + if (self_found) { + PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); + if (unlikely(!unbound_method)) return -1; + Py_DECREF(method); + result = unbound_method; + } + } +#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if (unlikely(target->method)) { + Py_DECREF(result); + } else +#endif + target->method = result; + 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 - self_found = (self && self != Py_None); -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - Py_XDECREF(self); + PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self); + __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); + return result; +} #endif - if (self_found) { - PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); - if (unlikely(!unbound_method)) return -1; - Py_DECREF(method); - result = unbound_method; +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; } -#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - if (unlikely(target->method)) { - Py_DECREF(result); - } else + 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 - target->method = result; + 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 @@ -23058,7 +22956,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 +23112,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 +23142,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 +23322,8 @@ static int __Pyx_ParseKeywordsTuple( #endif return -1; } + +/* ParseKeywords */ static int __Pyx_ParseKeywords( PyObject *kwds, PyObject * const *kwvalues, @@ -23459,7 +23369,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 +23455,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 +23551,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 +23562,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 +23594,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; @@ -23746,69 +23652,77 @@ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { return r; } 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_ASSUME_SAFE_SIZE Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } + if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS)) { + return __Pyx_PyList_GetItemRefFast(o, wrapped_i, unsafe_shared); + } else 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_NewRef(PyList_GET_ITEM(o, wrapped_i)); } return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(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_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } 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; + return __Pyx_NewRef(PyTuple_GET_ITEM(o, wrapped_i)); } return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(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); + if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)) { + return __Pyx_PyList_GetItemRefFast(o, n, unsafe_shared); + } else if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + return __Pyx_NewRef(PyList_GET_ITEM(o, n)); } - } - else if (PyTuple_CheckExact(o)) { + } 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 +#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,6 +23741,8 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, return PySequence_GetItem(o, i); } #endif + (void)wraparound; + (void)boundscheck; return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); } @@ -23837,7 +23753,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)); @@ -23945,17 +23861,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 +23902,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_le return NULL; } new_len = left_len + right_len; - if (__Pyx_unicode_modifiable(left) + if (__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 +24044,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 +24070,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 +24095,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))) { @@ -24287,7 +24214,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 +24265,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 +24299,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_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); - if (unlikely(!next_item)) return -1; - Py_INCREF(next_item); - #endif } else #endif { @@ -24404,7 +24322,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 +24358,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 +24380,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 +24415,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 +24434,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 +24472,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 +24604,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 +24636,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 +24679,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 +24705,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 +24731,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 +24766,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 +24790,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 +24821,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 +24973,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 +24986,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) { @@ -25287,8 +25248,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}, @@ -25309,9 +25275,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 +25335,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,7 +25391,13 @@ __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); @@ -25469,7 +25445,20 @@ 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); @@ -25581,7 +25570,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 +25609,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 +25631,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 +25666,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 +25701,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 +25732,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 +25757,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 +25791,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,7 +25843,7 @@ 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; @@ -25909,47 +25888,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 +25905,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 @@ -26100,7 +26038,7 @@ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { PyErr_SetObject(PyExc_RuntimeError, 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 +26062,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 +26114,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 +26197,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 +26274,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 @@ -26694,7 +26592,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 +26606,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 +26798,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 +26923,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 +26975,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 +27199,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; - } + 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) { @@ -27505,8 +27388,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 +27397,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 +27509,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 +27517,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 +27601,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 +27697,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 +27767,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 +27947,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 +28017,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 +28210,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 +28297,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 +28351,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) @@ -29125,7 +29034,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); @@ -29326,7 +29237,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); @@ -29415,7 +29328,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 +29364,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 +29400,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 +29483,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 +29501,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 +29525,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 +29553,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 +29564,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 +29847,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); From 2cd19d767df27db369ecc6b35a60c25bd5957fb3 Mon Sep 17 00:00:00 2001 From: fjwillemsen Date: Thu, 8 Jan 2026 13:48:39 +0100 Subject: [PATCH 74/87] Skips benchmark test if there are no C-extensions --- .github/workflows/publish-package.yml | 2 +- tests/test_util_benchmark.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 4b3f812..9310699 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -96,7 +96,7 @@ jobs: exit 1; fi - EXPECTED_WHEELS_COUNT=20 + EXPECTED_WHEELS_COUNT=24 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/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): From 6408e06f9f13d70bec8db487467fc88a9799c945 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Thu, 8 Jan 2026 14:13:27 +0100 Subject: [PATCH 75/87] Update README.rst From c2aee9780938c060e04ff156c274bdc6db01dd04 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Fri, 9 Jan 2026 09:10:19 +0100 Subject: [PATCH 76/87] Update README with conda installation instructions and badges --- README.rst | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 9cab614..08c5571 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -|License| |Build Status| |Docs| |Python Versions| |Downloads| |Status| |Code Coverage| +|License| |Build Status| |Docs| |Python Versions| |Downloads| |CondaDownloads| |Status| |Code Coverage| .. image:: https://github.com/python-constraint/python-constraint/raw/main/docs/assets/logo/N-Queens_problem_Python.svg :align: center @@ -7,8 +7,9 @@ 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 version](https://github.com/conda-forge/python-constraint2-feedstock) is also available: ``conda install python-constraint2``. + | For an overview of recent changes, visit the `Changelog `_. | The complete documentation can be found `here `_. @@ -208,6 +209,9 @@ But it's probably better to `open an issue Date: Fri, 9 Jan 2026 09:19:28 +0100 Subject: [PATCH 77/87] Revise README with updated installation details Updated installation instructions for Conda and Mamba, and clarified the importance of using python-constraint2. --- README.rst | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 08c5571..a5a673a 100644 --- a/README.rst +++ b/README.rst @@ -8,21 +8,21 @@ python-constraint ================= | ⚠️ IMPORTANT: this software must be installed with ``pip install python-constraint2``, as the original pip release will not be updated. -| A [Conda Forge version](https://github.com/conda-forge/python-constraint2-feedstock) is also available: ``conda install python-constraint2``. - +| 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. | 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. - +| .. contents:: :local: :depth: 1 - +| Introduction ------------ The :code:`python-constraint` module offers efficient solvers for `Constraint Satisfaction Problems (CSPs) `_ over finite domains in an accessible Python package. @@ -156,6 +156,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 ------- From 486fa62f321b1945cea5d57ed8a54662cdce7745 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Fri, 9 Jan 2026 09:22:29 +0100 Subject: [PATCH 78/87] Rearrange badges in README.rst --- README.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index a5a673a..1b24119 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,6 @@ -|License| |Build Status| |Docs| |Python Versions| |Downloads| |CondaDownloads| |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 From 9a1574db6fe1958e2f30e0277a3be4e67ce20c28 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Mon, 29 Jun 2026 12:02:26 +0200 Subject: [PATCH 79/87] Improved syntax, updated dependencies, recythonized, dropped Python 3.9 and 3.10 --- .github/workflows/publish-package.yml | 4 +- CHANGELOG.md | 9 + constraint/constraints.c | 11492 ++++++++++++------------ constraint/constraints.py | 25 +- constraint/domain.c | 91 +- constraint/parser.c | 2810 +++--- constraint/parser.py | 47 +- constraint/problem.c | 2172 ++--- constraint/problem.py | 11 +- constraint/solvers.c | 217 +- docs/requirements.txt | 64 +- noxfile.py | 5 +- pyproject.toml | 12 +- 13 files changed, 8556 insertions(+), 8403 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 9310699..3198fd7 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -24,7 +24,7 @@ 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", "3.14"] + 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 @@ -96,7 +96,7 @@ jobs: exit 1; fi - EXPECTED_WHEELS_COUNT=24 + EXPECTED_WHEELS_COUNT=16 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 d10936c..8c9caa4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ 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.6.0 +- Released: 2026-06-29 +- Issues / Enhancements: + - Improved type specification. + - Resolved issue #108 relating to pruning. + - 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: diff --git a/constraint/constraints.c b/constraint/constraints.c index 8fe8d0b..2148cc5 100644 --- a/constraint/constraints.c +++ b/constraint/constraints.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.2.4 */ +/* Generated by Cython 3.2.6 */ /* BEGIN: Cython Metadata { @@ -37,8 +37,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x03080000 #error Cython requires Python 3.8+. #else -#define __PYX_ABI_VERSION "3_2_4" -#define CYTHON_HEX_VERSION 0x030204F0 +#define __PYX_ABI_VERSION "3_2_6" +#define CYTHON_HEX_VERSION 0x030206F0 #define CYTHON_FUTURE_DIVISION 1 /* CModulePreamble */ #include @@ -1550,7 +1550,7 @@ 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): # <<<<<<<<<<<<<< @@ -1563,7 +1563,7 @@ struct __pyx_defaults { }; -/* "constraint/constraints.py":432 +/* "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." # <<<<<<<<<<<<<< @@ -1577,7 +1577,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr { }; -/* "constraint/constraints.py":435 +/* "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 # <<<<<<<<<<<<<< @@ -1591,7 +1591,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess { }; -/* "constraint/constraints.py":449 +/* "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) # <<<<<<<<<<<<<< @@ -1609,7 +1609,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr { }; -/* "constraint/constraints.py":450 +/* "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) # <<<<<<<<<<<<<< @@ -1627,7 +1627,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr { }; -/* "constraint/constraints.py":614 +/* "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." # <<<<<<<<<<<<<< @@ -1641,7 +1641,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr { }; -/* "constraint/constraints.py":617 +/* "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 # <<<<<<<<<<<<<< @@ -1655,7 +1655,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess { }; -/* "constraint/constraints.py":625 +/* "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) # <<<<<<<<<<<<<< @@ -1673,7 +1673,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr { }; -/* "constraint/constraints.py":793 +/* "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." # <<<<<<<<<<<<<< @@ -1687,7 +1687,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr { }; -/* "constraint/constraints.py":796 +/* "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 # <<<<<<<<<<<<<< @@ -1701,7 +1701,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess { }; -/* "constraint/constraints.py":804 +/* "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) # <<<<<<<<<<<<<< @@ -1719,7 +1719,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr { }; -/* "constraint/constraints.py":869 +/* "constraint/constraints.py":870 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -1733,7 +1733,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr { }; -/* "constraint/constraints.py":898 +/* "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])) # <<<<<<<<<<<<<< @@ -1747,7 +1747,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr { }; -/* "constraint/constraints.py":989 +/* "constraint/constraints.py":990 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -1760,7 +1760,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ { }; -/* "constraint/constraints.py":1012 +/* "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) # <<<<<<<<<<<<<< @@ -1777,7 +1777,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr { }; -/* "constraint/constraints.py":1013 +/* "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) # <<<<<<<<<<<<<< @@ -1794,7 +1794,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr { }; -/* "constraint/constraints.py":1145 +/* "constraint/constraints.py":1146 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -1807,7 +1807,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__ { }; -/* "constraint/constraints.py":1181 +/* "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): # <<<<<<<<<<<<<< @@ -1822,7 +1822,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr { }; -/* "constraint/constraints.py":1221 +/* "constraint/constraints.py":1222 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -1836,7 +1836,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr { }; -/* "constraint/constraints.py":1250 +/* "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])) # <<<<<<<<<<<<<< @@ -1850,7 +1850,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr { }; -/* "constraint/constraints.py":1332 +/* "constraint/constraints.py":1333 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -1863,7 +1863,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ { }; -/* "constraint/constraints.py":1368 +/* "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): # <<<<<<<<<<<<<< @@ -1878,7 +1878,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr { }; -/* "constraint/constraints.py":1570 +/* "constraint/constraints.py":1571 * # Utility functions * * def sum_other_vars(variables: Sequence, variable, values: dict): # <<<<<<<<<<<<<< @@ -1892,7 +1892,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars }; -/* "constraint/constraints.py":1572 +/* "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) # <<<<<<<<<<<<<< @@ -3274,7 +3274,7 @@ typedef struct { PyObject *__pyx_slice[1]; PyObject *__pyx_tuple[4]; PyObject *__pyx_codeobj_tab[78]; - PyObject *__pyx_string_tab[351]; + PyObject *__pyx_string_tab[348]; PyObject *__pyx_number_tab[3]; /* #### Code section: module_state_contents ### */ @@ -3466,16 +3466,16 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_Optional_Sequence __pyx_string_tab[27] +#define __pyx_kp_u_Sequence_None __pyx_string_tab[27] #define __pyx_kp_u_Sequence_str __pyx_string_tab[28] -#define __pyx_kp_u_Union_int_float __pyx_string_tab[29] -#define __pyx_kp_u_Wrapper_function_for_picklable_s __pyx_string_tab[30] -#define __pyx_kp_u__2 __pyx_string_tab[31] -#define __pyx_kp_u_add_note __pyx_string_tab[32] -#define __pyx_kp_u_constraint_constraints_py __pyx_string_tab[33] -#define __pyx_kp_u_disable __pyx_string_tab[34] -#define __pyx_kp_u_enable __pyx_string_tab[35] -#define __pyx_kp_u_gc __pyx_string_tab[36] +#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] @@ -3529,267 +3529,264 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_Optional __pyx_string_tab[90] -#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[91] -#define __pyx_n_u_Sequence __pyx_string_tab[92] -#define __pyx_n_u_SomeInSetConstraint __pyx_string_tab[93] -#define __pyx_n_u_SomeInSetConstraint___call __pyx_string_tab[94] -#define __pyx_n_u_SomeInSetConstraint___init __pyx_string_tab[95] -#define __pyx_n_u_SomeNotInSetConstraint __pyx_string_tab[96] -#define __pyx_n_u_SomeNotInSetConstraint___call __pyx_string_tab[97] -#define __pyx_n_u_SomeNotInSetConstraint___init __pyx_string_tab[98] -#define __pyx_n_u_Unassigned __pyx_string_tab[99] -#define __pyx_n_u_Union __pyx_string_tab[100] -#define __pyx_n_u_VariableExactProdConstraint __pyx_string_tab[101] -#define __pyx_n_u_VariableExactProdConstraint___ca __pyx_string_tab[102] -#define __pyx_n_u_VariableExactProdConstraint___ca_2 __pyx_string_tab[103] -#define __pyx_n_u_VariableExactProdConstraint___in __pyx_string_tab[104] -#define __pyx_n_u_VariableExactProdConstraint__get __pyx_string_tab[105] -#define __pyx_n_u_VariableExactProdConstraint__saf __pyx_string_tab[106] -#define __pyx_n_u_VariableExactProdConstraint_preP __pyx_string_tab[107] -#define __pyx_n_u_VariableExactSumConstraint __pyx_string_tab[108] -#define __pyx_n_u_VariableExactSumConstraint___cal __pyx_string_tab[109] -#define __pyx_n_u_VariableExactSumConstraint___ini __pyx_string_tab[110] -#define __pyx_n_u_VariableExactSumConstraint___ini_2 __pyx_string_tab[111] -#define __pyx_n_u_VariableExactSumConstraint_prePr __pyx_string_tab[112] -#define __pyx_n_u_VariableExactSumConstraint_prePr_2 __pyx_string_tab[113] -#define __pyx_n_u_VariableMaxProdConstraint __pyx_string_tab[114] -#define __pyx_n_u_VariableMaxProdConstraint___call __pyx_string_tab[115] -#define __pyx_n_u_VariableMaxProdConstraint___call_2 __pyx_string_tab[116] -#define __pyx_n_u_VariableMaxProdConstraint___init __pyx_string_tab[117] -#define __pyx_n_u_VariableMaxProdConstraint__get_p __pyx_string_tab[118] -#define __pyx_n_u_VariableMaxProdConstraint__safe __pyx_string_tab[119] -#define __pyx_n_u_VariableMaxProdConstraint_prePro __pyx_string_tab[120] -#define __pyx_n_u_VariableMaxSumConstraint __pyx_string_tab[121] -#define __pyx_n_u_VariableMaxSumConstraint___call __pyx_string_tab[122] -#define __pyx_n_u_VariableMaxSumConstraint___init __pyx_string_tab[123] -#define __pyx_n_u_VariableMaxSumConstraint___init_2 __pyx_string_tab[124] -#define __pyx_n_u_VariableMaxSumConstraint_preProc __pyx_string_tab[125] -#define __pyx_n_u_VariableMaxSumConstraint_preProc_2 __pyx_string_tab[126] -#define __pyx_n_u_VariableMinProdConstraint __pyx_string_tab[127] -#define __pyx_n_u_VariableMinProdConstraint___call __pyx_string_tab[128] -#define __pyx_n_u_VariableMinProdConstraint___call_2 __pyx_string_tab[129] -#define __pyx_n_u_VariableMinProdConstraint___init __pyx_string_tab[130] -#define __pyx_n_u_VariableMinProdConstraint__get_p __pyx_string_tab[131] -#define __pyx_n_u_VariableMinProdConstraint__safe __pyx_string_tab[132] -#define __pyx_n_u_VariableMinProdConstraint_prePro __pyx_string_tab[133] -#define __pyx_n_u_VariableMinSumConstraint __pyx_string_tab[134] -#define __pyx_n_u_VariableMinSumConstraint___call __pyx_string_tab[135] -#define __pyx_n_u_VariableMinSumConstraint___init __pyx_string_tab[136] -#define __pyx_n_u_VariableMinSumConstraint___init_2 __pyx_string_tab[137] -#define __pyx_n_u_VariableMinSumConstraint_preProc __pyx_string_tab[138] -#define __pyx_n_u_VariableMinSumConstraint_preProc_2 __pyx_string_tab[139] -#define __pyx_n_u_all_bounds __pyx_string_tab[140] -#define __pyx_n_u_append __pyx_string_tab[141] -#define __pyx_n_u_assigned __pyx_string_tab[142] -#define __pyx_n_u_assigned_2 __pyx_string_tab[143] -#define __pyx_n_u_assigned_prod __pyx_string_tab[144] -#define __pyx_n_u_assigned_product __pyx_string_tab[145] -#define __pyx_n_u_assignments __pyx_string_tab[146] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[147] -#define __pyx_n_u_b __pyx_string_tab[148] -#define __pyx_n_u_bool __pyx_string_tab[149] -#define __pyx_n_u_bounds __pyx_string_tab[150] -#define __pyx_n_u_c __pyx_string_tab[151] -#define __pyx_n_u_call __pyx_string_tab[152] -#define __pyx_n_u_candidates __pyx_string_tab[153] -#define __pyx_n_u_class_getitem __pyx_string_tab[154] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[155] -#define __pyx_n_u_close __pyx_string_tab[156] -#define __pyx_n_u_collections_abc __pyx_string_tab[157] -#define __pyx_n_u_constraint_constraints __pyx_string_tab[158] -#define __pyx_n_u_constraint_domain __pyx_string_tab[159] -#define __pyx_n_u_constraints __pyx_string_tab[160] -#define __pyx_n_u_contains_lt1 __pyx_string_tab[161] -#define __pyx_n_u_dict __pyx_string_tab[162] -#define __pyx_n_u_doc __pyx_string_tab[163] -#define __pyx_n_u_dom __pyx_string_tab[164] -#define __pyx_n_u_domain __pyx_string_tab[165] -#define __pyx_n_u_domain_bounds __pyx_string_tab[166] -#define __pyx_n_u_domain_dict __pyx_string_tab[167] -#define __pyx_n_u_domains __pyx_string_tab[168] -#define __pyx_n_u_exact __pyx_string_tab[169] -#define __pyx_n_u_exact_2 __pyx_string_tab[170] -#define __pyx_n_u_exactprod __pyx_string_tab[171] -#define __pyx_n_u_exactprod_2 __pyx_string_tab[172] -#define __pyx_n_u_exactsum __pyx_string_tab[173] -#define __pyx_n_u_exactsum_2 __pyx_string_tab[174] -#define __pyx_n_u_exclude_var __pyx_string_tab[175] -#define __pyx_n_u_forwardCheck __pyx_string_tab[176] -#define __pyx_n_u_forwardcheck __pyx_string_tab[177] -#define __pyx_n_u_found __pyx_string_tab[178] -#define __pyx_n_u_func __pyx_string_tab[179] -#define __pyx_n_u_func_2 __pyx_string_tab[180] -#define __pyx_n_u_func_3 __pyx_string_tab[181] -#define __pyx_n_u_genexpr __pyx_string_tab[182] -#define __pyx_n_u_get __pyx_string_tab[183] -#define __pyx_n_u_get_product_bounds __pyx_string_tab[184] -#define __pyx_n_u_hi __pyx_string_tab[185] -#define __pyx_n_u_hideValue __pyx_string_tab[186] -#define __pyx_n_u_index __pyx_string_tab[187] -#define __pyx_n_u_init __pyx_string_tab[188] -#define __pyx_n_u_is_coroutine __pyx_string_tab[189] -#define __pyx_n_u_items __pyx_string_tab[190] -#define __pyx_n_u_itertools __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_max_sum_missing __pyx_string_tab[197] -#define __pyx_n_u_maxprod __pyx_string_tab[198] -#define __pyx_n_u_maxprod_2 __pyx_string_tab[199] -#define __pyx_n_u_maxsum __pyx_string_tab[200] -#define __pyx_n_u_maxsum_2 __pyx_string_tab[201] -#define __pyx_n_u_maxval __pyx_string_tab[202] -#define __pyx_n_u_metaclass __pyx_string_tab[203] -#define __pyx_n_u_min __pyx_string_tab[204] -#define __pyx_n_u_min_others __pyx_string_tab[205] -#define __pyx_n_u_min_sum_missing __pyx_string_tab[206] -#define __pyx_n_u_minprod __pyx_string_tab[207] -#define __pyx_n_u_minprod_2 __pyx_string_tab[208] -#define __pyx_n_u_minsum __pyx_string_tab[209] -#define __pyx_n_u_minsum_2 __pyx_string_tab[210] -#define __pyx_n_u_minval __pyx_string_tab[211] -#define __pyx_n_u_missing __pyx_string_tab[212] -#define __pyx_n_u_missing_lt1 __pyx_string_tab[213] -#define __pyx_n_u_missing_negative __pyx_string_tab[214] -#define __pyx_n_u_module __pyx_string_tab[215] -#define __pyx_n_u_mro_entries __pyx_string_tab[216] -#define __pyx_n_u_multiplier __pyx_string_tab[217] -#define __pyx_n_u_multipliers __pyx_string_tab[218] -#define __pyx_n_u_multipliers_2 __pyx_string_tab[219] -#define __pyx_n_u_n __pyx_string_tab[220] -#define __pyx_n_u_n_2 __pyx_string_tab[221] -#define __pyx_n_u_name __pyx_string_tab[222] -#define __pyx_n_u_next __pyx_string_tab[223] -#define __pyx_n_u_o __pyx_string_tab[224] -#define __pyx_n_u_other_max __pyx_string_tab[225] -#define __pyx_n_u_other_min __pyx_string_tab[226] -#define __pyx_n_u_other_products __pyx_string_tab[227] -#define __pyx_n_u_other_unassigned __pyx_string_tab[228] -#define __pyx_n_u_other_vars_max __pyx_string_tab[229] -#define __pyx_n_u_other_vars_min __pyx_string_tab[230] -#define __pyx_n_u_others_max __pyx_string_tab[231] -#define __pyx_n_u_others_min __pyx_string_tab[232] -#define __pyx_n_u_p __pyx_string_tab[233] -#define __pyx_n_u_parms __pyx_string_tab[234] -#define __pyx_n_u_pop __pyx_string_tab[235] -#define __pyx_n_u_possible_max __pyx_string_tab[236] -#define __pyx_n_u_possible_min __pyx_string_tab[237] -#define __pyx_n_u_possible_prods __pyx_string_tab[238] -#define __pyx_n_u_preProcess __pyx_string_tab[239] -#define __pyx_n_u_prepare __pyx_string_tab[240] -#define __pyx_n_u_prod __pyx_string_tab[241] -#define __pyx_n_u_prods __pyx_string_tab[242] -#define __pyx_n_u_product __pyx_string_tab[243] -#define __pyx_n_u_product_vars __pyx_string_tab[244] -#define __pyx_n_u_products __pyx_string_tab[245] -#define __pyx_n_u_qualname __pyx_string_tab[246] -#define __pyx_n_u_remove __pyx_string_tab[247] -#define __pyx_n_u_round __pyx_string_tab[248] -#define __pyx_n_u_safe_product __pyx_string_tab[249] -#define __pyx_n_u_seen __pyx_string_tab[250] -#define __pyx_n_u_self __pyx_string_tab[251] -#define __pyx_n_u_send __pyx_string_tab[252] -#define __pyx_n_u_set __pyx_string_tab[253] -#define __pyx_n_u_set_2 __pyx_string_tab[254] -#define __pyx_n_u_set_name __pyx_string_tab[255] -#define __pyx_n_u_setdefault __pyx_string_tab[256] -#define __pyx_n_u_singlevalue __pyx_string_tab[257] -#define __pyx_n_u_str __pyx_string_tab[258] -#define __pyx_n_u_sum __pyx_string_tab[259] -#define __pyx_n_u_sum_other_vars __pyx_string_tab[260] -#define __pyx_n_u_sum_other_vars_locals_genexpr __pyx_string_tab[261] -#define __pyx_n_u_sum_value __pyx_string_tab[262] -#define __pyx_n_u_sum_vars __pyx_string_tab[263] -#define __pyx_n_u_t_max __pyx_string_tab[264] -#define __pyx_n_u_t_min __pyx_string_tab[265] -#define __pyx_n_u_target_dom __pyx_string_tab[266] -#define __pyx_n_u_target_domain __pyx_string_tab[267] -#define __pyx_n_u_target_max __pyx_string_tab[268] -#define __pyx_n_u_target_min __pyx_string_tab[269] -#define __pyx_n_u_target_value __pyx_string_tab[270] -#define __pyx_n_u_target_var __pyx_string_tab[271] -#define __pyx_n_u_temp_sum __pyx_string_tab[272] -#define __pyx_n_u_test __pyx_string_tab[273] -#define __pyx_n_u_throw __pyx_string_tab[274] -#define __pyx_n_u_typing __pyx_string_tab[275] -#define __pyx_n_u_unassigned __pyx_string_tab[276] -#define __pyx_n_u_unassigned_2 __pyx_string_tab[277] -#define __pyx_n_u_unassigned_vars __pyx_string_tab[278] -#define __pyx_n_u_unassignedvariable __pyx_string_tab[279] -#define __pyx_n_u_v __pyx_string_tab[280] -#define __pyx_n_u_val __pyx_string_tab[281] -#define __pyx_n_u_value __pyx_string_tab[282] -#define __pyx_n_u_values __pyx_string_tab[283] -#define __pyx_n_u_var __pyx_string_tab[284] -#define __pyx_n_u_var_is_negative __pyx_string_tab[285] -#define __pyx_n_u_var_max __pyx_string_tab[286] -#define __pyx_n_u_var_min __pyx_string_tab[287] -#define __pyx_n_u_variable __pyx_string_tab[288] -#define __pyx_n_u_variable_contains_lt1 __pyx_string_tab[289] -#define __pyx_n_u_variable_with_lt1 __pyx_string_tab[290] -#define __pyx_n_u_variables __pyx_string_tab[291] -#define __pyx_n_u_vconstraints __pyx_string_tab[292] -#define __pyx_n_u_x __pyx_string_tab[293] -#define __pyx_n_u_zip __pyx_string_tab[294] -#define __pyx_kp_b_iso88591_2_q_Kq_A_L __pyx_string_tab[295] -#define __pyx_kp_b_iso88591_2_q_Kq_A_L_2 __pyx_string_tab[296] -#define __pyx_kp_b_iso88591_3gQ __pyx_string_tab[297] -#define __pyx_kp_b_iso88591_4M_M_A_L_L __pyx_string_tab[298] -#define __pyx_kp_b_iso88591_55H_a_4_7_1_4q_1_G4q_t3a_Kq_waq __pyx_string_tab[299] -#define __pyx_kp_b_iso88591_55H_a_4_7_1_4q_Q_G4q_t3a_AQ_4q __pyx_string_tab[300] -#define __pyx_kp_b_iso88591_55H_a_D_q_a_3at_Cs_1_A_7_Q_J_c __pyx_string_tab[301] -#define __pyx_kp_b_iso88591_55H_a_L_y_q_q_a_q_L_Kq_QfA_5_q __pyx_string_tab[302] -#define __pyx_kp_b_iso88591_55H_a_a_q_a_3at_Cs_1_A_7_Q_J_c __pyx_string_tab[303] -#define __pyx_kp_b_iso88591_55H_a_d_4_7_1_4q_A_1_3at_a_4s_A __pyx_string_tab[304] -#define __pyx_kp_b_iso88591_55H_a_d_4_7_1_4q_A_1_3at_a_4s_A_2 __pyx_string_tab[305] -#define __pyx_kp_b_iso88591_55H_a_d_4q_a_1_1_1Kq_9Cq_az_1_t __pyx_string_tab[306] -#define __pyx_kp_b_iso88591_55H_a_d_L_y_1_AZs_1_1_t1_5_c_WH __pyx_string_tab[307] -#define __pyx_kp_b_iso88591_55H_a_d_L_y_1_AZwa_1_1_t1_5_c_W __pyx_string_tab[308] -#define __pyx_kp_b_iso88591_55H_a_d_Q_a_1_1Kq_9Cq_az_1_t9AQ __pyx_string_tab[309] -#define __pyx_kp_b_iso88591_55H_a_d_Q_a_1_1_1Kq_9Cq_az_1_t9 __pyx_string_tab[310] -#define __pyx_kp_b_iso88591_55H_a_q __pyx_string_tab[311] -#define __pyx_kp_b_iso88591_6a_N_A __pyx_string_tab[312] -#define __pyx_kp_b_iso88591_6a_N_A_2 __pyx_string_tab[313] -#define __pyx_kp_b_iso88591_77JJeef_3a_Q_y_WAQ_q_4t1Kz_1_wb __pyx_string_tab[314] -#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_6a_A_L_gQ_waq_J __pyx_string_tab[315] -#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_6a_A_L_gQ_waq_J_2 __pyx_string_tab[316] -#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_WAT_1A_G4q_T_Qi __pyx_string_tab[317] -#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_a_L_WAQ_q_6_Bd_A __pyx_string_tab[318] -#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_1_3at_a_IV1_vR __pyx_string_tab[319] -#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4_B_5_1A_4q_L __pyx_string_tab[320] -#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4_B_5_1A_L_Cq __pyx_string_tab[321] -#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4_B_5_1A_Q_L_C __pyx_string_tab[322] -#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4q_t1_S_A_IV1 __pyx_string_tab[323] -#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_q_A_S_S_G4q_4_1I __pyx_string_tab[324] -#define __pyx_kp_b_iso88591_77JJeef_d_L_WAQ_q_6_6_7_F __pyx_string_tab[325] -#define __pyx_kp_b_iso88591_77JJeef_d_L_WAQ_q_6_A_6_7_F __pyx_string_tab[326] -#define __pyx_kp_b_iso88591_88XXY __pyx_string_tab[327] -#define __pyx_kp_b_iso88591_8_l_1 __pyx_string_tab[328] -#define __pyx_kp_b_iso88591_99LL___Q_L_y_q_c_1_q_1_4t1Ky_AQ __pyx_string_tab[329] -#define __pyx_kp_b_iso88591_A __pyx_string_tab[330] -#define __pyx_kp_b_iso88591_A_2 __pyx_string_tab[331] -#define __pyx_kp_b_iso88591_A_A_E_r_A_WA_WAQ_1_82Q_D_3d_M_HC __pyx_string_tab[332] -#define __pyx_kp_b_iso88591_A_HA __pyx_string_tab[333] -#define __pyx_kp_b_iso88591_A_a_L_Kt1Ja_3a_a_wl_fCq_q_L_q_A __pyx_string_tab[334] -#define __pyx_kp_b_iso88591_A_q_E_A_q __pyx_string_tab[335] -#define __pyx_kp_b_iso88591_A_q_L_Kt1Ja_vWA_6_A_1_AYa_1_A_9G __pyx_string_tab[336] -#define __pyx_kp_b_iso88591_E_HA_F_Ja __pyx_string_tab[337] -#define __pyx_kp_b_iso88591_L __pyx_string_tab[338] -#define __pyx_kp_b_iso88591_L_6a __pyx_string_tab[339] -#define __pyx_kp_b_iso88591_N_6a __pyx_string_tab[340] -#define __pyx_kp_b_iso88591_Q __pyx_string_tab[341] -#define __pyx_kp_b_iso88591_Q_2 __pyx_string_tab[342] -#define __pyx_kp_b_iso88591_Q_3 __pyx_string_tab[343] -#define __pyx_kp_b_iso88591_Q_4 __pyx_string_tab[344] -#define __pyx_kp_b_iso88591_U_A_IQ_M __pyx_string_tab[345] -#define __pyx_kp_b_iso88591_Zz_IQ_M __pyx_string_tab[346] -#define __pyx_kp_b_iso88591__3 __pyx_string_tab[347] -#define __pyx_kp_b_iso88591_a_N_L_A_1_3a_Cs_Rs_J_b_3c __pyx_string_tab[348] -#define __pyx_kp_b_iso88591_q_G4q_t3a_Qa_t1_3avS_4q_3a_Qb_E __pyx_string_tab[349] -#define __pyx_kp_b_iso88591_q_G4q_t3a_Qa_t1_3avS_Qb_E_4q_3a __pyx_string_tab[350] +#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_append __pyx_string_tab[139] +#define __pyx_n_u_assigned __pyx_string_tab[140] +#define __pyx_n_u_assigned_2 __pyx_string_tab[141] +#define __pyx_n_u_assigned_prod __pyx_string_tab[142] +#define __pyx_n_u_assigned_product __pyx_string_tab[143] +#define __pyx_n_u_assignments __pyx_string_tab[144] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[145] +#define __pyx_n_u_b __pyx_string_tab[146] +#define __pyx_n_u_bool __pyx_string_tab[147] +#define __pyx_n_u_bounds __pyx_string_tab[148] +#define __pyx_n_u_c __pyx_string_tab[149] +#define __pyx_n_u_call __pyx_string_tab[150] +#define __pyx_n_u_candidates __pyx_string_tab[151] +#define __pyx_n_u_class_getitem __pyx_string_tab[152] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[153] +#define __pyx_n_u_close __pyx_string_tab[154] +#define __pyx_n_u_collections_abc __pyx_string_tab[155] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[156] +#define __pyx_n_u_constraint_domain __pyx_string_tab[157] +#define __pyx_n_u_constraints __pyx_string_tab[158] +#define __pyx_n_u_contains_lt1 __pyx_string_tab[159] +#define __pyx_n_u_dict __pyx_string_tab[160] +#define __pyx_n_u_doc __pyx_string_tab[161] +#define __pyx_n_u_dom __pyx_string_tab[162] +#define __pyx_n_u_domain __pyx_string_tab[163] +#define __pyx_n_u_domain_bounds __pyx_string_tab[164] +#define __pyx_n_u_domain_dict __pyx_string_tab[165] +#define __pyx_n_u_domains __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_n_u_genexpr __pyx_string_tab[180] +#define __pyx_n_u_get __pyx_string_tab[181] +#define __pyx_n_u_get_product_bounds __pyx_string_tab[182] +#define __pyx_n_u_hi __pyx_string_tab[183] +#define __pyx_n_u_hideValue __pyx_string_tab[184] +#define __pyx_n_u_index __pyx_string_tab[185] +#define __pyx_n_u_init __pyx_string_tab[186] +#define __pyx_n_u_is_coroutine __pyx_string_tab[187] +#define __pyx_n_u_items __pyx_string_tab[188] +#define __pyx_n_u_itertools __pyx_string_tab[189] +#define __pyx_n_u_lo __pyx_string_tab[190] +#define __pyx_n_u_m __pyx_string_tab[191] +#define __pyx_n_u_main __pyx_string_tab[192] +#define __pyx_n_u_max __pyx_string_tab[193] +#define __pyx_n_u_max_others __pyx_string_tab[194] +#define __pyx_n_u_max_sum_missing __pyx_string_tab[195] +#define __pyx_n_u_maxprod __pyx_string_tab[196] +#define __pyx_n_u_maxprod_2 __pyx_string_tab[197] +#define __pyx_n_u_maxsum __pyx_string_tab[198] +#define __pyx_n_u_maxsum_2 __pyx_string_tab[199] +#define __pyx_n_u_maxval __pyx_string_tab[200] +#define __pyx_n_u_metaclass __pyx_string_tab[201] +#define __pyx_n_u_min __pyx_string_tab[202] +#define __pyx_n_u_min_others __pyx_string_tab[203] +#define __pyx_n_u_min_sum_missing __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_missing_negative __pyx_string_tab[212] +#define __pyx_n_u_module __pyx_string_tab[213] +#define __pyx_n_u_mro_entries __pyx_string_tab[214] +#define __pyx_n_u_multiplier __pyx_string_tab[215] +#define __pyx_n_u_multipliers __pyx_string_tab[216] +#define __pyx_n_u_multipliers_2 __pyx_string_tab[217] +#define __pyx_n_u_n __pyx_string_tab[218] +#define __pyx_n_u_n_2 __pyx_string_tab[219] +#define __pyx_n_u_name __pyx_string_tab[220] +#define __pyx_n_u_next __pyx_string_tab[221] +#define __pyx_n_u_o __pyx_string_tab[222] +#define __pyx_n_u_other_max __pyx_string_tab[223] +#define __pyx_n_u_other_min __pyx_string_tab[224] +#define __pyx_n_u_other_products __pyx_string_tab[225] +#define __pyx_n_u_other_unassigned __pyx_string_tab[226] +#define __pyx_n_u_other_vars_max __pyx_string_tab[227] +#define __pyx_n_u_other_vars_min __pyx_string_tab[228] +#define __pyx_n_u_others_max __pyx_string_tab[229] +#define __pyx_n_u_others_min __pyx_string_tab[230] +#define __pyx_n_u_p __pyx_string_tab[231] +#define __pyx_n_u_parms __pyx_string_tab[232] +#define __pyx_n_u_pop __pyx_string_tab[233] +#define __pyx_n_u_possible_max __pyx_string_tab[234] +#define __pyx_n_u_possible_min __pyx_string_tab[235] +#define __pyx_n_u_possible_prods __pyx_string_tab[236] +#define __pyx_n_u_preProcess __pyx_string_tab[237] +#define __pyx_n_u_prepare __pyx_string_tab[238] +#define __pyx_n_u_prod __pyx_string_tab[239] +#define __pyx_n_u_prods __pyx_string_tab[240] +#define __pyx_n_u_product __pyx_string_tab[241] +#define __pyx_n_u_product_vars __pyx_string_tab[242] +#define __pyx_n_u_products __pyx_string_tab[243] +#define __pyx_n_u_qualname __pyx_string_tab[244] +#define __pyx_n_u_remove __pyx_string_tab[245] +#define __pyx_n_u_round __pyx_string_tab[246] +#define __pyx_n_u_safe_product __pyx_string_tab[247] +#define __pyx_n_u_seen __pyx_string_tab[248] +#define __pyx_n_u_self __pyx_string_tab[249] +#define __pyx_n_u_send __pyx_string_tab[250] +#define __pyx_n_u_set __pyx_string_tab[251] +#define __pyx_n_u_set_2 __pyx_string_tab[252] +#define __pyx_n_u_set_name __pyx_string_tab[253] +#define __pyx_n_u_setdefault __pyx_string_tab[254] +#define __pyx_n_u_singlevalue __pyx_string_tab[255] +#define __pyx_n_u_str __pyx_string_tab[256] +#define __pyx_n_u_sum __pyx_string_tab[257] +#define __pyx_n_u_sum_other_vars __pyx_string_tab[258] +#define __pyx_n_u_sum_other_vars_locals_genexpr __pyx_string_tab[259] +#define __pyx_n_u_sum_value __pyx_string_tab[260] +#define __pyx_n_u_sum_vars __pyx_string_tab[261] +#define __pyx_n_u_t_max __pyx_string_tab[262] +#define __pyx_n_u_t_min __pyx_string_tab[263] +#define __pyx_n_u_target_dom __pyx_string_tab[264] +#define __pyx_n_u_target_domain __pyx_string_tab[265] +#define __pyx_n_u_target_max __pyx_string_tab[266] +#define __pyx_n_u_target_min __pyx_string_tab[267] +#define __pyx_n_u_target_value __pyx_string_tab[268] +#define __pyx_n_u_target_var __pyx_string_tab[269] +#define __pyx_n_u_temp_sum __pyx_string_tab[270] +#define __pyx_n_u_test __pyx_string_tab[271] +#define __pyx_n_u_throw __pyx_string_tab[272] +#define __pyx_n_u_unassigned __pyx_string_tab[273] +#define __pyx_n_u_unassigned_2 __pyx_string_tab[274] +#define __pyx_n_u_unassigned_vars __pyx_string_tab[275] +#define __pyx_n_u_unassignedvariable __pyx_string_tab[276] +#define __pyx_n_u_v __pyx_string_tab[277] +#define __pyx_n_u_val __pyx_string_tab[278] +#define __pyx_n_u_value __pyx_string_tab[279] +#define __pyx_n_u_values __pyx_string_tab[280] +#define __pyx_n_u_var __pyx_string_tab[281] +#define __pyx_n_u_var_is_negative __pyx_string_tab[282] +#define __pyx_n_u_var_max __pyx_string_tab[283] +#define __pyx_n_u_var_min __pyx_string_tab[284] +#define __pyx_n_u_variable __pyx_string_tab[285] +#define __pyx_n_u_variable_contains_lt1 __pyx_string_tab[286] +#define __pyx_n_u_variable_with_lt1 __pyx_string_tab[287] +#define __pyx_n_u_variables __pyx_string_tab[288] +#define __pyx_n_u_vconstraints __pyx_string_tab[289] +#define __pyx_n_u_x __pyx_string_tab[290] +#define __pyx_n_u_zip __pyx_string_tab[291] +#define __pyx_kp_b_iso88591_3gQ __pyx_string_tab[292] +#define __pyx_kp_b_iso88591_55H_a_4_7_1_4q_1_G4q_t3a_Kq_waq __pyx_string_tab[293] +#define __pyx_kp_b_iso88591_55H_a_4_7_1_4q_Q_G4q_t3a_AQ_4q __pyx_string_tab[294] +#define __pyx_kp_b_iso88591_55H_a_D_q_a_3at_Cs_1_A_7_Q_J_c __pyx_string_tab[295] +#define __pyx_kp_b_iso88591_55H_a_L_y_q_q_a_q_L_Kq_QfA_5_q __pyx_string_tab[296] +#define __pyx_kp_b_iso88591_55H_a_a_q_a_3at_Cs_1_A_7_Q_J_c __pyx_string_tab[297] +#define __pyx_kp_b_iso88591_55H_a_d_4_7_1_4q_A_1_3at_a_4s_A __pyx_string_tab[298] +#define __pyx_kp_b_iso88591_55H_a_d_4_7_1_4q_A_1_3at_a_4s_A_2 __pyx_string_tab[299] +#define __pyx_kp_b_iso88591_55H_a_d_4q_a_1_1_1Kq_9Cq_az_1_t __pyx_string_tab[300] +#define __pyx_kp_b_iso88591_55H_a_d_L_y_1_AZs_1_1_t1_5_c_WH __pyx_string_tab[301] +#define __pyx_kp_b_iso88591_55H_a_d_L_y_1_AZwa_1_1_t1_5_c_W __pyx_string_tab[302] +#define __pyx_kp_b_iso88591_55H_a_d_Q_a_1_1Kq_9Cq_az_1_t9AQ __pyx_string_tab[303] +#define __pyx_kp_b_iso88591_55H_a_d_Q_a_1_1_1Kq_9Cq_az_1_t9 __pyx_string_tab[304] +#define __pyx_kp_b_iso88591_55H_a_q __pyx_string_tab[305] +#define __pyx_kp_b_iso88591_6a_N_A __pyx_string_tab[306] +#define __pyx_kp_b_iso88591_6a_N_A_2 __pyx_string_tab[307] +#define __pyx_kp_b_iso88591_77JJeef_3a_Q_y_WAQ_q_4t1Kz_1_wb __pyx_string_tab[308] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_6a_A_L_gQ_waq_J __pyx_string_tab[309] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_6a_A_L_gQ_waq_J_2 __pyx_string_tab[310] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_WAT_1A_G4q_T_Qi __pyx_string_tab[311] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_a_L_WAQ_q_6_Bd_A __pyx_string_tab[312] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_1_3at_a_IV1_vR __pyx_string_tab[313] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4_B_5_1A_4q_L __pyx_string_tab[314] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4_B_5_1A_L_Cq __pyx_string_tab[315] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4_B_5_1A_Q_L_C __pyx_string_tab[316] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4q_t1_S_A_IV1 __pyx_string_tab[317] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_q_A_S_S_G4q_4_1I __pyx_string_tab[318] +#define __pyx_kp_b_iso88591_77JJeef_d_L_WAQ_q_6_6_7_F __pyx_string_tab[319] +#define __pyx_kp_b_iso88591_77JJeef_d_L_WAQ_q_6_A_6_7_F __pyx_string_tab[320] +#define __pyx_kp_b_iso88591_88XXY __pyx_string_tab[321] +#define __pyx_kp_b_iso88591_8_l_1 __pyx_string_tab[322] +#define __pyx_kp_b_iso88591_99LL___Q_L_y_q_c_1_q_1_4t1Ky_AQ __pyx_string_tab[323] +#define __pyx_kp_b_iso88591_A __pyx_string_tab[324] +#define __pyx_kp_b_iso88591_A_2 __pyx_string_tab[325] +#define __pyx_kp_b_iso88591_A_A_E_r_A_WA_WAQ_1_82Q_D_3d_M_HC __pyx_string_tab[326] +#define __pyx_kp_b_iso88591_A_HA __pyx_string_tab[327] +#define __pyx_kp_b_iso88591_A_a_L_Kt1Ja_3a_a_wl_fCq_q_L_q_A __pyx_string_tab[328] +#define __pyx_kp_b_iso88591_A_q_E_A_q __pyx_string_tab[329] +#define __pyx_kp_b_iso88591_A_q_L_Kt1Ja_vWA_6_A_1_AYa_1_A_9G __pyx_string_tab[330] +#define __pyx_kp_b_iso88591_E_HA_F_Ja __pyx_string_tab[331] +#define __pyx_kp_b_iso88591_L __pyx_string_tab[332] +#define __pyx_kp_b_iso88591_L_6a __pyx_string_tab[333] +#define __pyx_kp_b_iso88591_M_Kq_A_L __pyx_string_tab[334] +#define __pyx_kp_b_iso88591_M_Kq_A_L_2 __pyx_string_tab[335] +#define __pyx_kp_b_iso88591_N_6a __pyx_string_tab[336] +#define __pyx_kp_b_iso88591_Q __pyx_string_tab[337] +#define __pyx_kp_b_iso88591_Q_2 __pyx_string_tab[338] +#define __pyx_kp_b_iso88591_Q_3 __pyx_string_tab[339] +#define __pyx_kp_b_iso88591_Q_4 __pyx_string_tab[340] +#define __pyx_kp_b_iso88591_U_A_IQ_M __pyx_string_tab[341] +#define __pyx_kp_b_iso88591_Zz_IQ_M __pyx_string_tab[342] +#define __pyx_kp_b_iso88591__3 __pyx_string_tab[343] +#define __pyx_kp_b_iso88591_a_N_L_A_1_3a_Cs_Rs_J_b_3c __pyx_string_tab[344] +#define __pyx_kp_b_iso88591_m1_M_A_L_L __pyx_string_tab[345] +#define __pyx_kp_b_iso88591_q_G4q_t3a_Qa_t1_3avS_4q_3a_Qb_E __pyx_string_tab[346] +#define __pyx_kp_b_iso88591_q_G4q_t3a_Qa_t1_3avS_Qb_E_4q_3a __pyx_string_tab[347] #define __pyx_int_0 __pyx_number_tab[0] #define __pyx_int_1 __pyx_number_tab[1] #define __pyx_int_10 __pyx_number_tab[2] @@ -3858,7 +3855,7 @@ 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<78; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<351; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<348; ++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 */ @@ -3936,7 +3933,7 @@ 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<78; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<351; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<348; ++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 */ @@ -3954,7 +3951,7 @@ 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): # <<<<<<<<<<<<<< @@ -4006,53 +4003,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; } @@ -4066,7 +4063,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:; @@ -4077,8 +4074,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 */ @@ -4103,7 +4100,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 # <<<<<<<<<<<<<< @@ -4115,7 +4112,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): # <<<<<<<<<<<<<< @@ -4130,7 +4127,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): # <<<<<<<<<<<<<< @@ -4182,50 +4179,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]; @@ -4235,7 +4232,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:; @@ -4246,9 +4243,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 */ @@ -4289,58 +4286,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, __Pyx_ReferenceSharing_FunctionArgument); 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 (;;) { @@ -4349,7 +4346,7 @@ 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; } @@ -4359,7 +4356,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY { 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; } @@ -4370,13 +4367,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; @@ -4386,7 +4383,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}): # <<<<<<<<<<<<<< @@ -4396,9 +4393,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))) { @@ -4417,15 +4414,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY __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) # <<<<<<<<<<<<<< @@ -4439,12 +4436,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_value}; __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}): # <<<<<<<<<<<<<< @@ -4453,7 +4450,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[:]: # <<<<<<<<<<<<<< @@ -4463,45 +4460,45 @@ 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}; @@ -4509,12 +4506,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY __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: # <<<<<<<<<<<<<< @@ -4523,7 +4520,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): # <<<<<<<<<<<<<< @@ -4551,7 +4548,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): # <<<<<<<<<<<<<< @@ -4569,18 +4566,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_2__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; @@ -4643,53 +4640,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; } @@ -4703,7 +4700,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:; @@ -4714,8 +4711,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 */ @@ -4756,7 +4753,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 # <<<<<<<<<<<<<< @@ -4766,7 +4763,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: # <<<<<<<<<<<<<< @@ -4778,9 +4775,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)) { @@ -4788,7 +4785,7 @@ 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; } @@ -4798,7 +4795,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( { 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; } @@ -4809,13 +4806,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; @@ -4825,17 +4822,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: # <<<<<<<<<<<<<< @@ -4845,7 +4842,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 # <<<<<<<<<<<<<< @@ -4855,7 +4852,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: # <<<<<<<<<<<<<< @@ -4865,7 +4862,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( goto __pyx_L6; } - /* "constraint/constraints.py":88 + /* "constraint/constraints.py":89 * unassignedvariable = variable * else: * break # <<<<<<<<<<<<<< @@ -4877,7 +4874,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: # <<<<<<<<<<<<<< @@ -4886,7 +4883,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( */ } - /* "constraint/constraints.py":83 + /* "constraint/constraints.py":84 * """ * unassignedvariable = _unassigned * for variable in variables: # <<<<<<<<<<<<<< @@ -4902,7 +4899,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: # <<<<<<<<<<<<<< @@ -4912,45 +4909,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 (;;) { @@ -4959,7 +4956,7 @@ 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; } @@ -4969,7 +4966,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( { 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; } @@ -4980,13 +4977,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; @@ -4996,16 +4993,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): # <<<<<<<<<<<<<< @@ -5032,15 +5029,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( __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) # <<<<<<<<<<<<<< @@ -5054,12 +5051,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( 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_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): # <<<<<<<<<<<<<< @@ -5068,7 +5065,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[:]: # <<<<<<<<<<<<<< @@ -5078,16 +5075,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: # <<<<<<<<<<<<<< @@ -5096,18 +5093,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 # <<<<<<<<<<<<<< @@ -5119,7 +5116,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: # <<<<<<<<<<<<<< @@ -5128,7 +5125,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( */ } - /* "constraint/constraints.py":90 + /* "constraint/constraints.py":91 * break * else: * if unassignedvariable is not _unassigned: # <<<<<<<<<<<<<< @@ -5139,7 +5136,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 # <<<<<<<<<<<<<< @@ -5151,7 +5148,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): # <<<<<<<<<<<<<< @@ -5177,7 +5174,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( return __pyx_r; } -/* "constraint/constraints.py":133 +/* "constraint/constraints.py":134 * """ * * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< @@ -5227,40 +5224,40 @@ 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, 133, __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, 133, __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, 133, __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, 133, __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, 133, __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, 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, 133, __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, 133, __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, 133, __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, 133, __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; } @@ -5268,14 +5265,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_self = values[0]; __pyx_v_func = values[1]; if (values[2]) { - __pyx_v_assigned = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_assigned == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error) + __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, 133, __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:; @@ -5305,28 +5302,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":142 + /* "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, 142, __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":143 + /* "constraint/constraints.py":144 * """ * self._func = func * self._assigned = assigned # <<<<<<<<<<<<<< * * def __call__( # noqa: D102 */ - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_assigned); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __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, 143, __pyx_L1_error) + 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":133 + /* "constraint/constraints.py":134 * """ * * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< @@ -5347,7 +5344,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init return __pyx_r; } -/* "constraint/constraints.py":145 +/* "constraint/constraints.py":146 * self._assigned = assigned * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -5366,36 +5363,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_4__defaults__(CYTHON_UNUSED __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - /* "constraint/constraints.py":150 + /* "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, 145, __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, 145, __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, 145, __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":145 + /* "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, 145, __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, 145, __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, 145, __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; @@ -5458,62 +5455,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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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, 145, __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; } @@ -5529,7 +5526,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, 145, __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:; @@ -5540,8 +5537,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, 148, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 149, __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 */ @@ -5582,19 +5579,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":182 + /* "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, 182, __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":183 + /* "constraint/constraints.py":184 * # single loop list: 0.11462 seconds, Cythonized: 0.08686 seconds * parms = list() * missing = 0 # <<<<<<<<<<<<<< @@ -5604,7 +5601,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":184 + /* "constraint/constraints.py":185 * parms = list() * missing = 0 * for x in variables: # <<<<<<<<<<<<<< @@ -5616,9 +5613,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, 184, __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, 184, __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)) { @@ -5626,7 +5623,7 @@ 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, 184, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 185, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5636,7 +5633,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal { 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, 184, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 185, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5647,13 +5644,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __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, 184, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 185, __pyx_L1_error) PyErr_Clear(); } break; @@ -5663,29 +5660,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":185 + /* "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, 185, __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":186 + /* "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, 186, __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, 186, __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":185 + /* "constraint/constraints.py":186 * missing = 0 * for x in variables: * if x in assignments: # <<<<<<<<<<<<<< @@ -5695,7 +5692,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal goto __pyx_L5; } - /* "constraint/constraints.py":188 + /* "constraint/constraints.py":189 * parms.append(assignments[x]) * else: * parms.append(_unassigned) # <<<<<<<<<<<<<< @@ -5703,23 +5700,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, 188, __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":189 + /* "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, 189, __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":184 + /* "constraint/constraints.py":185 * parms = list() * missing = 0 * for x in variables: # <<<<<<<<<<<<<< @@ -5729,19 +5726,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":192 + /* "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, 192, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 192, __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":193 + /* "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 ( # <<<<<<<<<<<<<< @@ -5749,23 +5746,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, 193, __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, 193, __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, 193, __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, 193, __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, 193, __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, 193, __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 { @@ -5776,26 +5773,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal } __pyx_L9_next_and:; - /* "constraint/constraints.py":194 + /* "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, 194, __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, 194, __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, 194, __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, 194, __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 { @@ -5811,7 +5808,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments}; __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, 194, __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); @@ -5822,7 +5819,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":192 + /* "constraint/constraints.py":193 * * # if there are unassigned variables, do a forward check before executing the restriction function * if missing > 0: # <<<<<<<<<<<<<< @@ -5831,7 +5828,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal */ } - /* "constraint/constraints.py":196 + /* "constraint/constraints.py":197 * not forwardcheck or missing != 1 or self.forwardCheck(variables, domains, assignments) * ) * return self._func(*parms) # <<<<<<<<<<<<<< @@ -5839,11 +5836,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, 196, __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, 196, __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, 196, __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; @@ -5851,7 +5848,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/constraints.py":145 + /* "constraint/constraints.py":146 * self._assigned = assigned * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -5876,7 +5873,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal return __pyx_r; } -/* "constraint/constraints.py":201 +/* "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 # <<<<<<<<<<<<<< @@ -5925,40 +5922,40 @@ 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, 201, __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, 201, __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, 201, __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, 201, __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, 201, __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, 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, 201, __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, 201, __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, 201, __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, 201, __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; } @@ -5966,14 +5963,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_self = values[0]; __pyx_v_func = ((PyObject*)values[1]); if (values[2]) { - __pyx_v_assigned = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_assigned == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 201, __pyx_L3_error) + __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, 201, __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:; @@ -5984,7 +5981,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, 201, __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 */ @@ -6013,28 +6010,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":202 + /* "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, 202, __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":203 + /* "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 */ - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_assigned); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __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, 203, __pyx_L1_error) + 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":201 + /* "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 # <<<<<<<<<<<<<< @@ -6055,7 +6052,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra return __pyx_r; } -/* "constraint/constraints.py":205 +/* "constraint/constraints.py":206 * self._assigned = assigned * * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 # <<<<<<<<<<<<<< @@ -6073,21 +6070,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_6__defaults__(CYTHON_UNUSED 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, 205, __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, 205, __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, 205, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __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, 205, __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, 205, __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; @@ -6150,62 +6147,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, 205, __pyx_L3_error) + 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, 205, __pyx_L3_error) + 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, 205, __pyx_L3_error) + 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, 205, __pyx_L3_error) + 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, 205, __pyx_L3_error) + 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, 205, __pyx_L3_error) + 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, 205, __pyx_L3_error) + 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, 205, __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, 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, 205, __pyx_L3_error) } + 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, 205, __pyx_L3_error) + 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, 205, __pyx_L3_error) + 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, 205, __pyx_L3_error) + 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, 205, __pyx_L3_error) + 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, 205, __pyx_L3_error) + 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, 205, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 206, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -6221,7 +6218,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, 205, __pyx_L3_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:; @@ -6253,7 +6250,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":206 + /* "constraint/constraints.py":207 * * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 * raise NotImplementedError("CompilableFunctionConstraint can not be called directly") # <<<<<<<<<<<<<< @@ -6266,14 +6263,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra 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, 206, __pyx_L1_error) + 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, 206, __pyx_L1_error) + __PYX_ERR(0, 207, __pyx_L1_error) - /* "constraint/constraints.py":205 + /* "constraint/constraints.py":206 * self._assigned = assigned * * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 # <<<<<<<<<<<<<< @@ -6292,7 +6289,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra return __pyx_r; } -/* "constraint/constraints.py":220 +/* "constraint/constraints.py":221 * """ * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -6311,36 +6308,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_8__defaults__(CYTHON_UNUSED __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - /* "constraint/constraints.py":225 + /* "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, 220, __pyx_L1_error) + __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, 220, __pyx_L1_error); + 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, 220, __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, 221, __pyx_L1_error); - /* "constraint/constraints.py":220 + /* "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, 220, __pyx_L1_error) + __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, 220, __pyx_L1_error); + 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, 220, __pyx_L1_error); + 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; @@ -6403,62 +6400,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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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, 220, __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; } @@ -6474,7 +6471,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, 220, __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:; @@ -6485,8 +6482,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, 223, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 224, __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 */ @@ -6531,19 +6528,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":228 + /* "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, 228, __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":229 + /* "constraint/constraints.py":230 * ): * seen = {} * for variable in variables: # <<<<<<<<<<<<<< @@ -6555,9 +6552,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, 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, 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, 230, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6565,7 +6562,7 @@ 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, 230, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6575,7 +6572,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ { 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, 230, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6586,13 +6583,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, 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, 229, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 230, __pyx_L1_error) PyErr_Clear(); } break; @@ -6602,19 +6599,19 @@ 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":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, 230, __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":231 + /* "constraint/constraints.py":232 * for variable in variables: * value = assignments.get(variable, _unassigned) * if value is not _unassigned: # <<<<<<<<<<<<<< @@ -6624,17 +6621,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __pyx_t_5 = (__pyx_v_value != __pyx_v__unassigned); if (__pyx_t_5) { - /* "constraint/constraints.py":232 + /* "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, 232, __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":233 + /* "constraint/constraints.py":234 * if value is not _unassigned: * if value in seen: * return False # <<<<<<<<<<<<<< @@ -6647,7 +6644,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":232 + /* "constraint/constraints.py":233 * value = assignments.get(variable, _unassigned) * if value is not _unassigned: * if value in seen: # <<<<<<<<<<<<<< @@ -6656,16 +6653,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ */ } - /* "constraint/constraints.py":234 + /* "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, 234, __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":231 + /* "constraint/constraints.py":232 * for variable in variables: * value = assignments.get(variable, _unassigned) * if value is not _unassigned: # <<<<<<<<<<<<<< @@ -6674,7 +6671,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ */ } - /* "constraint/constraints.py":229 + /* "constraint/constraints.py":230 * ): * seen = {} * for variable in variables: # <<<<<<<<<<<<<< @@ -6684,17 +6681,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":235 + /* "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, 235, __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":236 + /* "constraint/constraints.py":237 * seen[value] = True * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -6706,9 +6703,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, 236, __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, 236, __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)) { @@ -6716,7 +6713,7 @@ 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, 236, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 237, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6726,7 +6723,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ { 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, 236, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 237, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6737,13 +6734,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __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, 236, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 237, __pyx_L1_error) PyErr_Clear(); } break; @@ -6753,29 +6750,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":237 + /* "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, 237, __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":238 + /* "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, 238, __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":239 + /* "constraint/constraints.py":240 * if variable not in assignments: * domain = domains[variable] * for value in seen: # <<<<<<<<<<<<<< @@ -6783,7 +6780,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, 239, __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; @@ -6791,22 +6788,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, 239, __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":240 + /* "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, 240, __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":241 + /* "constraint/constraints.py":242 * for value in seen: * if value in domain: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -6820,23 +6817,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_value}; __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, 241, __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":242 + /* "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, 242, __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":243 + /* "constraint/constraints.py":244 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -6850,7 +6847,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "constraint/constraints.py":242 + /* "constraint/constraints.py":243 * if value in domain: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -6859,7 +6856,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ */ } - /* "constraint/constraints.py":240 + /* "constraint/constraints.py":241 * domain = domains[variable] * for value in seen: * if value in domain: # <<<<<<<<<<<<<< @@ -6870,7 +6867,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":237 + /* "constraint/constraints.py":238 * if forwardcheck: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -6879,7 +6876,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ */ } - /* "constraint/constraints.py":236 + /* "constraint/constraints.py":237 * seen[value] = True * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -6889,7 +6886,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":235 + /* "constraint/constraints.py":236 * return False * seen[value] = True * if forwardcheck: # <<<<<<<<<<<<<< @@ -6898,7 +6895,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ */ } - /* "constraint/constraints.py":244 + /* "constraint/constraints.py":245 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -6910,7 +6907,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":220 + /* "constraint/constraints.py":221 * """ * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -6936,7 +6933,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ return __pyx_r; } -/* "constraint/constraints.py":258 +/* "constraint/constraints.py":259 * """ * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -6955,36 +6952,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_10__defaults__(CYTHON_UNUSE __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - /* "constraint/constraints.py":263 + /* "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, 258, __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, 258, __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, 258, __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":258 + /* "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, 258, __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, 258, __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, 258, __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; @@ -7047,62 +7044,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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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; } @@ -7118,7 +7115,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, 258, __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:; @@ -7129,8 +7126,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, 261, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 262, __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 */ @@ -7173,7 +7170,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":266 + /* "constraint/constraints.py":267 * _unassigned=Unassigned, * ): * singlevalue = _unassigned # <<<<<<<<<<<<<< @@ -7183,7 +7180,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __Pyx_INCREF(__pyx_v__unassigned); __pyx_v_singlevalue = __pyx_v__unassigned; - /* "constraint/constraints.py":267 + /* "constraint/constraints.py":268 * ): * singlevalue = _unassigned * for variable in variables: # <<<<<<<<<<<<<< @@ -7195,9 +7192,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, 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, 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, 268, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -7205,7 +7202,7 @@ 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, 268, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -7215,7 +7212,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call { 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, 268, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -7226,13 +7223,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, 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, 267, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 268, __pyx_L1_error) PyErr_Clear(); } break; @@ -7242,19 +7239,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":268 + /* "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, 268, __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":269 + /* "constraint/constraints.py":270 * for variable in variables: * value = assignments.get(variable, _unassigned) * if singlevalue is _unassigned: # <<<<<<<<<<<<<< @@ -7264,7 +7261,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":270 + /* "constraint/constraints.py":271 * value = assignments.get(variable, _unassigned) * if singlevalue is _unassigned: * singlevalue = value # <<<<<<<<<<<<<< @@ -7274,7 +7271,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":269 + /* "constraint/constraints.py":270 * for variable in variables: * value = assignments.get(variable, _unassigned) * if singlevalue is _unassigned: # <<<<<<<<<<<<<< @@ -7284,7 +7281,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call goto __pyx_L5; } - /* "constraint/constraints.py":271 + /* "constraint/constraints.py":272 * if singlevalue is _unassigned: * singlevalue = value * elif value is not _unassigned and value != singlevalue: # <<<<<<<<<<<<<< @@ -7297,14 +7294,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, 271, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 271, __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":272 + /* "constraint/constraints.py":273 * singlevalue = value * elif value is not _unassigned and value != singlevalue: * return False # <<<<<<<<<<<<<< @@ -7317,7 +7314,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":271 + /* "constraint/constraints.py":272 * if singlevalue is _unassigned: * singlevalue = value * elif value is not _unassigned and value != singlevalue: # <<<<<<<<<<<<<< @@ -7327,7 +7324,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } __pyx_L5:; - /* "constraint/constraints.py":267 + /* "constraint/constraints.py":268 * ): * singlevalue = _unassigned * for variable in variables: # <<<<<<<<<<<<<< @@ -7337,14 +7334,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":273 + /* "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, 273, __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; @@ -7355,7 +7352,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __pyx_L10_bool_binop_done:; if (__pyx_t_5) { - /* "constraint/constraints.py":274 + /* "constraint/constraints.py":275 * return False * if forwardcheck and singlevalue is not _unassigned: * for variable in variables: # <<<<<<<<<<<<<< @@ -7367,9 +7364,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, 274, __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, 274, __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)) { @@ -7377,7 +7374,7 @@ 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, 274, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 275, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -7387,7 +7384,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call { 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, 274, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 275, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -7398,13 +7395,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __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, 274, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 275, __pyx_L1_error) PyErr_Clear(); } break; @@ -7414,39 +7411,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":275 + /* "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, 275, __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":276 + /* "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, 276, __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":277 + /* "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, 277, __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":278 + /* "constraint/constraints.py":279 * domain = domains[variable] * if singlevalue not in domain: * return False # <<<<<<<<<<<<<< @@ -7459,7 +7456,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":277 + /* "constraint/constraints.py":278 * if variable not in assignments: * domain = domains[variable] * if singlevalue not in domain: # <<<<<<<<<<<<<< @@ -7468,23 +7465,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call */ } - /* "constraint/constraints.py":279 + /* "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, 279, __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, 279, __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, 279, __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 (;;) { @@ -7493,7 +7490,7 @@ 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, 279, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 280, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -7503,7 +7500,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call { 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, 279, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 280, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -7514,13 +7511,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __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, 279, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 280, __pyx_L1_error) PyErr_Clear(); } break; @@ -7530,19 +7527,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":280 + /* "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, 280, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 280, __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":281 + /* "constraint/constraints.py":282 * for value in domain[:]: * if value != singlevalue: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -7556,12 +7553,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_value}; __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, 281, __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":280 + /* "constraint/constraints.py":281 * return False * for value in domain[:]: * if value != singlevalue: # <<<<<<<<<<<<<< @@ -7570,7 +7567,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call */ } - /* "constraint/constraints.py":279 + /* "constraint/constraints.py":280 * if singlevalue not in domain: * return False * for value in domain[:]: # <<<<<<<<<<<<<< @@ -7580,7 +7577,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":275 + /* "constraint/constraints.py":276 * if forwardcheck and singlevalue is not _unassigned: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -7589,7 +7586,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call */ } - /* "constraint/constraints.py":274 + /* "constraint/constraints.py":275 * return False * if forwardcheck and singlevalue is not _unassigned: * for variable in variables: # <<<<<<<<<<<<<< @@ -7599,7 +7596,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":273 + /* "constraint/constraints.py":274 * elif value is not _unassigned and value != singlevalue: * return False * if forwardcheck and singlevalue is not _unassigned: # <<<<<<<<<<<<<< @@ -7608,7 +7605,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call */ } - /* "constraint/constraints.py":282 + /* "constraint/constraints.py":283 * if value != singlevalue: * domain.hideValue(value) * return True # <<<<<<<<<<<<<< @@ -7620,7 +7617,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":258 + /* "constraint/constraints.py":259 * """ * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -7646,10 +7643,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call return __pyx_r; } -/* "constraint/constraints.py":301 +/* "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. * */ @@ -7696,41 +7693,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, 301, __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, 301, __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, 301, __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, 301, __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, 301, __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, 301, __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, 301, __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, 301, __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, 301, __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; } @@ -7742,7 +7739,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, 301, __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:; @@ -7772,64 +7769,64 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint___init int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":310 + /* "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, 310, __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":311 + /* "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, 311, __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, 312, __pyx_L1_error) - /* "constraint/constraints.py":312 + /* "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, 312, __pyx_L1_error) + __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, 312, __pyx_L1_error) + 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":313 + /* "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, 313, __pyx_L1_error) + __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, 313, __pyx_L1_error) + 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":314 + /* "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 */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __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, 314, __pyx_L1_error) + 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":301 + /* "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. * */ @@ -7847,7 +7844,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint___init return __pyx_r; } -/* "constraint/constraints.py":316 +/* "constraint/constraints.py":317 * self._var_is_negative = {} * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -7898,50 +7895,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, 316, __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, 316, __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, 316, __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, 316, __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, 316, __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, 316, __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, 316, __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, 316, __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, 316, __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, 316, __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, 316, __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, 316, __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, 316, __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]; @@ -7951,7 +7948,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, 316, __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:; @@ -7962,9 +7959,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, 316, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 316, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 316, __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 */ @@ -8022,7 +8019,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":317 + /* "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) # <<<<<<<<<<<<<< @@ -8030,9 +8027,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * 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, 317, __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, 317, __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; @@ -8052,36 +8049,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 317, __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":318 + /* "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 if self._multipliers else [1] * len(variables) # <<<<<<<<<<<<<< * exactsum = self._exactsum * 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, 318, __pyx_L1_error) + __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, 318, __pyx_L1_error) + __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, 318, __pyx_L1_error) + __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, 318, __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, 318, __pyx_L1_error) + __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, 318, __pyx_L1_error); + 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; @@ -8090,19 +8087,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":319 + /* "constraint/constraints.py":320 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * multipliers = self._multipliers if self._multipliers else [1] * len(variables) * exactsum = self._exactsum # <<<<<<<<<<<<<< * 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, 319, __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":320 + /* "constraint/constraints.py":321 * multipliers = self._multipliers if self._multipliers else [1] * len(variables) * exactsum = self._exactsum * self._var_min = { variable: min(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 # <<<<<<<<<<<<<< @@ -8110,7 +8107,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * */ { /* enter inner scope */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L5_error) + __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; @@ -8118,7 +8115,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr 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, 320, __pyx_L5_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); } if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { @@ -8126,9 +8123,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 320, __pyx_L5_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, 320, __pyx_L5_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_4); __pyx_t_4 = 0; for (;;) { @@ -8137,7 +8134,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 320, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 321, __pyx_L5_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -8147,7 +8144,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 320, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 321, __pyx_L5_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -8158,13 +8155,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L5_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __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, 320, __pyx_L5_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 321, __pyx_L5_error) PyErr_Clear(); } break; @@ -8177,7 +8174,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 320, __pyx_L5_error) + __PYX_ERR(0, 321, __pyx_L5_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8187,22 +8184,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __pyx_L5_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L5_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 320, __pyx_L5_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 321, __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, 320, __pyx_L5_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, 320, __pyx_L5_error) + __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_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, 320, __pyx_L5_error) + __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); @@ -8210,7 +8207,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 320, __pyx_L5_error) + 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; @@ -8218,7 +8215,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 320, __pyx_L5_error) + __PYX_ERR(0, 321, __pyx_L5_error) __pyx_L9_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_variable, __pyx_t_3); @@ -8226,7 +8223,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 320, __pyx_L5_error) + __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; { @@ -8234,13 +8231,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 320, __pyx_L5_error) + 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, 320, __pyx_L5_error) + __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, 320, __pyx_L5_error) + 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; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -8253,10 +8250,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr 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, 320, __pyx_L1_error) + 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":321 + /* "constraint/constraints.py":322 * exactsum = self._exactsum * 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 # <<<<<<<<<<<<<< @@ -8264,7 +8261,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * # preprocess the domains to remove values that cannot contribute to the exact sum */ { /* enter inner scope */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L14_error) + __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; @@ -8272,7 +8269,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr 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, 321, __pyx_L14_error) + 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)) { @@ -8280,9 +8277,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L14_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, 321, __pyx_L14_error) + __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 (;;) { @@ -8291,7 +8288,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 321, __pyx_L14_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 322, __pyx_L14_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -8301,7 +8298,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 321, __pyx_L14_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 322, __pyx_L14_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -8312,13 +8309,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L14_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L14_error) } else { __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, 321, __pyx_L14_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 322, __pyx_L14_error) PyErr_Clear(); } break; @@ -8331,7 +8328,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 321, __pyx_L14_error) + __PYX_ERR(0, 322, __pyx_L14_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8341,22 +8338,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L14_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L14_error) __Pyx_XGOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 321, __pyx_L14_error) + 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, 321, __pyx_L14_error) + __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, 321, __pyx_L14_error) + __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 { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 321, __pyx_L14_error) + __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); @@ -8364,7 +8361,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_GOTREF(__pyx_t_4); 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, 321, __pyx_L14_error) + 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; @@ -8372,7 +8369,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 321, __pyx_L14_error) + __PYX_ERR(0, 322, __pyx_L14_error) __pyx_L18_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_variable, __pyx_t_4); @@ -8380,7 +8377,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 321, __pyx_L14_error) + __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; { @@ -8388,13 +8385,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 321, __pyx_L14_error) + 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, 321, __pyx_L14_error) + __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, 321, __pyx_L14_error) + 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; @@ -8407,10 +8404,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr 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, 321, __pyx_L1_error) + 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":324 + /* "constraint/constraints.py":325 * * # preprocess the domains to remove values that cannot contribute to the exact sum * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -8423,7 +8420,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr 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, 324, __pyx_L1_error) + 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)) { @@ -8431,9 +8428,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 324, __pyx_L1_error) + __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, 324, __pyx_L1_error) + __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 (;;) { @@ -8442,7 +8439,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 325, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -8452,7 +8449,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 325, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -8463,13 +8460,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) + 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, 324, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 325, __pyx_L1_error) PyErr_Clear(); } break; @@ -8482,7 +8479,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr 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, 325, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8492,22 +8489,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error) + 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, 324, __pyx_L1_error) + __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, 324, __pyx_L1_error) + __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, 324, __pyx_L1_error) + __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); @@ -8515,7 +8512,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 324, __pyx_L1_error) + 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; @@ -8523,7 +8520,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 324, __pyx_L1_error) + __PYX_ERR(0, 325, __pyx_L1_error) __pyx_L24_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); @@ -8531,19 +8528,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":325 + /* "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, 325, __pyx_L1_error) + __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":326 + /* "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) # <<<<<<<<<<<<<< @@ -8551,9 +8548,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * 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, 326, __pyx_L1_error) + __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, 326, __pyx_L1_error) + __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 @@ -8573,13 +8570,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 326, __pyx_L1_error) + 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":327 + /* "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) # <<<<<<<<<<<<<< @@ -8587,9 +8584,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * 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, 327, __pyx_L1_error) + __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, 327, __pyx_L1_error) + __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 @@ -8609,29 +8606,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 327, __pyx_L1_error) + 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":328 + /* "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_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, 328, __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, 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, 328, __pyx_L1_error) + __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, 328, __pyx_L1_error) + __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 (;;) { @@ -8640,7 +8637,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 328, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 329, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -8650,7 +8647,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 328, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 329, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -8661,13 +8658,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) + 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, 328, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 329, __pyx_L1_error) PyErr_Clear(); } break; @@ -8677,25 +8674,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":329 + /* "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, 329, __pyx_L1_error) + __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, 329, __pyx_L1_error) + __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, 329, __pyx_L1_error) + __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, 329, __pyx_L1_error) + __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":330 + /* "constraint/constraints.py":331 * for value in domain[:]: * if value * multiplier + other_vars_min > exactsum: * domain.remove(value) # <<<<<<<<<<<<<< @@ -8709,12 +8706,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr 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, 330, __pyx_L1_error) + 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":329 + /* "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: # <<<<<<<<<<<<<< @@ -8723,25 +8720,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr */ } - /* "constraint/constraints.py":331 + /* "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, 331, __pyx_L1_error) + __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, 331, __pyx_L1_error) + __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, 331, __pyx_L1_error) + __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, 331, __pyx_L1_error) + __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":332 + /* "constraint/constraints.py":333 * domain.remove(value) * if value * multiplier + other_vars_max < exactsum: * domain.remove(value) # <<<<<<<<<<<<<< @@ -8755,12 +8752,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr 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, 332, __pyx_L1_error) + 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":331 + /* "constraint/constraints.py":332 * if value * multiplier + other_vars_min > exactsum: * domain.remove(value) * if value * multiplier + other_vars_max < exactsum: # <<<<<<<<<<<<<< @@ -8769,7 +8766,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr */ } - /* "constraint/constraints.py":328 + /* "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[:]: # <<<<<<<<<<<<<< @@ -8779,7 +8776,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":324 + /* "constraint/constraints.py":325 * * # preprocess the domains to remove values that cannot contribute to the exact sum * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -8789,7 +8786,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":335 + /* "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 # <<<<<<<<<<<<<< @@ -8797,7 +8794,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * 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, 335, __pyx_L33_error) + __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; @@ -8805,7 +8802,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr 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, 335, __pyx_L33_error) + 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)) { @@ -8813,9 +8810,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 335, __pyx_L33_error) + __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, 335, __pyx_L33_error) + __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 (;;) { @@ -8824,7 +8821,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 335, __pyx_L33_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 336, __pyx_L33_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -8834,7 +8831,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 335, __pyx_L33_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 336, __pyx_L33_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -8845,13 +8842,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 335, __pyx_L33_error) + 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, 335, __pyx_L33_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 336, __pyx_L33_error) PyErr_Clear(); } break; @@ -8864,7 +8861,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 335, __pyx_L33_error) + __PYX_ERR(0, 336, __pyx_L33_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8874,22 +8871,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L33_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L33_error) __Pyx_XGOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L33_error) + 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, 335, __pyx_L33_error) + __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, 335, __pyx_L33_error) + __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, 335, __pyx_L33_error) + __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); @@ -8897,7 +8894,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 335, __pyx_L33_error) + 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; @@ -8905,21 +8902,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 335, __pyx_L33_error) + __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, 335, __pyx_L33_error) + __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, 335, __pyx_L33_error) + __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, 335, __pyx_L33_error) + __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; { @@ -8927,10 +8924,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 335, __pyx_L33_error) + 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, 335, __pyx_L33_error) + __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; @@ -8939,7 +8936,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 335, __pyx_L33_error) + 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; @@ -8952,10 +8949,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr 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, 335, __pyx_L1_error) + 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":336 + /* "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 # <<<<<<<<<<<<<< @@ -8963,7 +8960,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * */ { /* enter inner scope */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L42_error) + __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; @@ -8971,7 +8968,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr 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, 336, __pyx_L42_error) + 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)) { @@ -8979,9 +8976,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 336, __pyx_L42_error) + __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, 336, __pyx_L42_error) + __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 (;;) { @@ -8990,7 +8987,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 336, __pyx_L42_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 337, __pyx_L42_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -9000,7 +8997,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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, 336, __pyx_L42_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 337, __pyx_L42_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -9011,13 +9008,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L42_error) + 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, 336, __pyx_L42_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 337, __pyx_L42_error) PyErr_Clear(); } break; @@ -9030,7 +9027,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 336, __pyx_L42_error) + __PYX_ERR(0, 337, __pyx_L42_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -9040,22 +9037,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 336, __pyx_L42_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 337, __pyx_L42_error) __Pyx_XGOTREF(__pyx_t_10); __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L42_error) + 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, 336, __pyx_L42_error) + __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, 336, __pyx_L42_error) + __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, 336, __pyx_L42_error) + __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); @@ -9063,7 +9060,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 336, __pyx_L42_error) + 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; @@ -9071,21 +9068,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 336, __pyx_L42_error) + __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, 336, __pyx_L42_error) + __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, 336, __pyx_L42_error) + __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, 336, __pyx_L42_error) + __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; { @@ -9093,10 +9090,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 336, __pyx_L42_error) + 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, 336, __pyx_L42_error) + __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; @@ -9105,7 +9102,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 336, __pyx_L42_error) + 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; @@ -9118,10 +9115,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr 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, 336, __pyx_L1_error) + 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":337 + /* "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 } # <<<<<<<<<<<<<< @@ -9129,16 +9126,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * 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, 337, __pyx_L51_error) + __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, 337, __pyx_L51_error) + __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, 337, __pyx_L51_error) + __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)) { @@ -9146,7 +9143,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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_L51_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 338, __pyx_L51_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -9156,7 +9153,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr { 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_L51_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 338, __pyx_L51_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -9167,13 +9164,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L51_error) + 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, 337, __pyx_L51_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 338, __pyx_L51_error) PyErr_Clear(); } break; @@ -9182,14 +9179,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __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, 337, __pyx_L51_error) + __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, 337, __pyx_L51_error) + __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, 337, __pyx_L51_error) + __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, 337, __pyx_L51_error) + 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; @@ -9200,10 +9197,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr 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, 337, __pyx_L1_error) + 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":316 + /* "constraint/constraints.py":317 * self._var_is_negative = {} * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -9246,7 +9243,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr return __pyx_r; } -/* "constraint/constraints.py":339 +/* "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 # <<<<<<<<<<<<<< @@ -9297,53 +9294,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, 339, __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, 339, __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, 339, __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, 339, __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, 339, __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, 339, __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, 339, __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, 339, __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, 339, __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, 339, __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, 339, __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, 339, __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, 339, __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; } @@ -9357,7 +9354,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, 339, __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:; @@ -9368,8 +9365,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, 339, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 339, __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 */ @@ -9421,31 +9418,31 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":340 + /* "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, 340, __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":341 + /* "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 * 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, 341, __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":342 + /* "constraint/constraints.py":343 * multipliers = self._multipliers * exactsum = self._exactsum * sum = 0 # <<<<<<<<<<<<<< @@ -9455,7 +9452,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":343 + /* "constraint/constraints.py":344 * exactsum = self._exactsum * sum = 0 * min_sum_missing = 0 # <<<<<<<<<<<<<< @@ -9465,7 +9462,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_min_sum_missing = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":344 + /* "constraint/constraints.py":345 * sum = 0 * min_sum_missing = 0 * max_sum_missing = 0 # <<<<<<<<<<<<<< @@ -9475,7 +9472,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_max_sum_missing = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":345 + /* "constraint/constraints.py":346 * min_sum_missing = 0 * max_sum_missing = 0 * missing = False # <<<<<<<<<<<<<< @@ -9484,7 +9481,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ __pyx_v_missing = 0; - /* "constraint/constraints.py":346 + /* "constraint/constraints.py":347 * max_sum_missing = 0 * missing = False * missing_negative = False # <<<<<<<<<<<<<< @@ -9493,17 +9490,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ __pyx_v_missing_negative = 0; - /* "constraint/constraints.py":347 + /* "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, 347, __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":348 + /* "constraint/constraints.py":349 * missing_negative = False * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -9516,7 +9513,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal 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, 348, __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)) { @@ -9524,9 +9521,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __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, 348, __pyx_L1_error) + __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 (;;) { @@ -9535,7 +9532,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 348, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 349, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -9545,7 +9542,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 348, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 349, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -9556,13 +9553,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) } else { __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, 348, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 349, __pyx_L1_error) PyErr_Clear(); } break; @@ -9575,7 +9572,7 @@ 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, 348, __pyx_L1_error) + __PYX_ERR(0, 349, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -9585,22 +9582,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 348, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 348, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 348, __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, 348, __pyx_L1_error) + __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, 348, __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); @@ -9608,7 +9605,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __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, 348, __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; @@ -9616,7 +9613,7 @@ 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, 348, __pyx_L1_error) + __PYX_ERR(0, 349, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_7); @@ -9624,35 +9621,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":349 + /* "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, 349, __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":350 + /* "constraint/constraints.py":351 * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< * 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, 350, __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, 350, __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, 350, __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":349 + /* "constraint/constraints.py":350 * if multipliers: * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: # <<<<<<<<<<<<<< @@ -9662,7 +9659,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal goto __pyx_L8; } - /* "constraint/constraints.py":352 + /* "constraint/constraints.py":353 * sum += assignments[variable] * multiplier * else: * min_sum_missing += self._var_min[variable] # <<<<<<<<<<<<<< @@ -9670,36 +9667,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * 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, 352, __pyx_L1_error) + __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, 352, __pyx_L1_error) + __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, 352, __pyx_L1_error) + __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":353 + /* "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, 353, __pyx_L1_error) + __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, 353, __pyx_L1_error) + __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, 353, __pyx_L1_error) + __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":354 + /* "constraint/constraints.py":355 * min_sum_missing += self._var_min[variable] * max_sum_missing += self._var_max[variable] * missing = True # <<<<<<<<<<<<<< @@ -9708,23 +9705,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ __pyx_v_missing = 1; - /* "constraint/constraints.py":355 + /* "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, 355, __pyx_L1_error) + __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, 355, __pyx_L1_error) + __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, 355, __pyx_L1_error) + __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":356 + /* "constraint/constraints.py":357 * missing = True * if self._var_is_negative[variable]: * missing_negative = True # <<<<<<<<<<<<<< @@ -9733,7 +9730,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ __pyx_v_missing_negative = 1; - /* "constraint/constraints.py":355 + /* "constraint/constraints.py":356 * max_sum_missing += self._var_max[variable] * missing = True * if self._var_is_negative[variable]: # <<<<<<<<<<<<<< @@ -9744,7 +9741,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __pyx_L8:; - /* "constraint/constraints.py":348 + /* "constraint/constraints.py":349 * missing_negative = False * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -9754,7 +9751,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":357 + /* "constraint/constraints.py":358 * if self._var_is_negative[variable]: * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -9764,7 +9761,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_t_2 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_2) { - /* "constraint/constraints.py":358 + /* "constraint/constraints.py":359 * missing_negative = True * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< @@ -9777,13 +9774,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal 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, 358, __pyx_L1_error) + 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_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":357 + /* "constraint/constraints.py":358 * if self._var_is_negative[variable]: * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -9792,35 +9789,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":359 + /* "constraint/constraints.py":360 * if isinstance(sum, float): * sum = round(sum, 10) * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: # <<<<<<<<<<<<<< * return False * if forwardcheck and missing and not missing_negative: */ - __pyx_t_3 = PyNumber_Add(__pyx_v_sum, __pyx_v_min_sum_missing); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __pyx_L1_error) + __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, 359, __pyx_L1_error) + __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, 359, __pyx_L1_error) + __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, 359, __pyx_L1_error) + __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, 359, __pyx_L1_error) + __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, 359, __pyx_L1_error) + __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":360 + /* "constraint/constraints.py":361 * sum = round(sum, 10) * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: * return False # <<<<<<<<<<<<<< @@ -9832,7 +9829,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":359 + /* "constraint/constraints.py":360 * if isinstance(sum, float): * sum = round(sum, 10) * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: # <<<<<<<<<<<<<< @@ -9841,14 +9838,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":361 + /* "constraint/constraints.py":362 * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: * return False * 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, 361, __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; @@ -9864,7 +9861,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_L16_bool_binop_done:; if (__pyx_t_2) { - /* "constraint/constraints.py":362 + /* "constraint/constraints.py":363 * return False * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -9877,7 +9874,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_variables, __pyx_v_multipliers}; __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; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { @@ -9885,9 +9882,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 362, __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, 362, __pyx_L1_error) + __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_3); __pyx_t_3 = 0; for (;;) { @@ -9896,7 +9893,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 362, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 363, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -9906,7 +9903,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 362, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 363, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -9917,13 +9914,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L1_error) } else { __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, 362, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 363, __pyx_L1_error) PyErr_Clear(); } break; @@ -9936,7 +9933,7 @@ 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, 362, __pyx_L1_error) + __PYX_ERR(0, 363, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -9946,22 +9943,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_INCREF(__pyx_t_7); } else { __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 362, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); } #else - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) + __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, 362, __pyx_L1_error) + __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_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, 362, __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_3); __pyx_t_3 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); @@ -9969,7 +9966,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __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, 362, __pyx_L1_error) + 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_L22_unpacking_done; @@ -9977,7 +9974,7 @@ 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, 362, __pyx_L1_error) + __PYX_ERR(0, 363, __pyx_L1_error) __pyx_L22_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); @@ -9985,45 +9982,45 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":363 + /* "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, 363, __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":364 + /* "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_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error) + __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":365 + /* "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_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, 365, __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, 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_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 365, __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, 365, __pyx_L1_error) + __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_3); __pyx_t_3 = 0; for (;;) { @@ -10032,7 +10029,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 365, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 366, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -10042,7 +10039,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 365, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 366, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -10053,13 +10050,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L1_error) } else { __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, 365, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 366, __pyx_L1_error) PyErr_Clear(); } break; @@ -10069,25 +10066,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":366 + /* "constraint/constraints.py":367 * domain = domains[variable] * for value in domain[:]: * if sum + value * multiplier > exactsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ - __pyx_t_3 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L1_error) + __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, 366, __pyx_L1_error) + __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, 366, __pyx_L1_error) + __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, 366, __pyx_L1_error) + __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":367 + /* "constraint/constraints.py":368 * for value in domain[:]: * if sum + value * multiplier > exactsum: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -10101,12 +10098,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal 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, 367, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":366 + /* "constraint/constraints.py":367 * domain = domains[variable] * for value in domain[:]: * if sum + value * multiplier > exactsum: # <<<<<<<<<<<<<< @@ -10115,7 +10112,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":365 + /* "constraint/constraints.py":366 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -10125,18 +10122,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":368 + /* "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, 368, __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":369 + /* "constraint/constraints.py":370 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -10149,7 +10146,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L0; - /* "constraint/constraints.py":368 + /* "constraint/constraints.py":369 * if sum + value * multiplier > exactsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -10158,7 +10155,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":363 + /* "constraint/constraints.py":364 * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: # <<<<<<<<<<<<<< @@ -10167,7 +10164,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":362 + /* "constraint/constraints.py":363 * return False * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -10177,7 +10174,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":361 + /* "constraint/constraints.py":362 * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: * return False * if forwardcheck and missing and not missing_negative: # <<<<<<<<<<<<<< @@ -10186,7 +10183,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":347 + /* "constraint/constraints.py":348 * missing = False * missing_negative = False * if multipliers: # <<<<<<<<<<<<<< @@ -10196,7 +10193,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal goto __pyx_L3; } - /* "constraint/constraints.py":371 + /* "constraint/constraints.py":372 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -10209,9 +10206,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 371, __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, 371, __pyx_L1_error) + __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_6)) { @@ -10219,7 +10216,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 371, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 372, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -10229,7 +10226,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 371, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 372, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -10240,13 +10237,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 371, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 372, __pyx_L1_error) } else { __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, 371, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 372, __pyx_L1_error) PyErr_Clear(); } break; @@ -10256,32 +10253,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":372 + /* "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, 372, __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":373 + /* "constraint/constraints.py":374 * for variable in variables: * if variable in assignments: * sum += assignments[variable] # <<<<<<<<<<<<<< * else: * min_sum_missing += self._var_min[variable] */ - __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 373, __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, 373, __pyx_L1_error) + __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_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":372 + /* "constraint/constraints.py":373 * else: * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -10291,7 +10288,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal goto __pyx_L32; } - /* "constraint/constraints.py":375 + /* "constraint/constraints.py":376 * sum += assignments[variable] * else: * min_sum_missing += self._var_min[variable] # <<<<<<<<<<<<<< @@ -10299,36 +10296,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * 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, 375, __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, 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, 375, __pyx_L1_error) + __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, 375, __pyx_L1_error) + __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":376 + /* "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, 376, __pyx_L1_error) + __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, 376, __pyx_L1_error) + __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, 376, __pyx_L1_error) + __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":377 + /* "constraint/constraints.py":378 * min_sum_missing += self._var_min[variable] * max_sum_missing += self._var_max[variable] * missing = True # <<<<<<<<<<<<<< @@ -10337,23 +10334,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ __pyx_v_missing = 1; - /* "constraint/constraints.py":378 + /* "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, 378, __pyx_L1_error) + __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, 378, __pyx_L1_error) + __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, 378, __pyx_L1_error) + __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":379 + /* "constraint/constraints.py":380 * missing = True * if self._var_is_negative[variable]: * missing_negative = True # <<<<<<<<<<<<<< @@ -10362,7 +10359,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ __pyx_v_missing_negative = 1; - /* "constraint/constraints.py":378 + /* "constraint/constraints.py":379 * max_sum_missing += self._var_max[variable] * missing = True * if self._var_is_negative[variable]: # <<<<<<<<<<<<<< @@ -10373,7 +10370,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __pyx_L32:; - /* "constraint/constraints.py":371 + /* "constraint/constraints.py":372 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -10383,7 +10380,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":380 + /* "constraint/constraints.py":381 * if self._var_is_negative[variable]: * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -10393,7 +10390,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_t_11 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_11) { - /* "constraint/constraints.py":381 + /* "constraint/constraints.py":382 * missing_negative = True * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< @@ -10406,13 +10403,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal 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, 381, __pyx_L1_error) + 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_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":380 + /* "constraint/constraints.py":381 * if self._var_is_negative[variable]: * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -10421,35 +10418,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":382 + /* "constraint/constraints.py":383 * if isinstance(sum, float): * sum = round(sum, 10) * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: # <<<<<<<<<<<<<< * return False * if forwardcheck and missing and not missing_negative: */ - __pyx_t_8 = PyNumber_Add(__pyx_v_sum, __pyx_v_min_sum_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 382, __pyx_L1_error) + __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, 382, __pyx_L1_error) + __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, 382, __pyx_L1_error) + __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, 382, __pyx_L1_error) + __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, 382, __pyx_L1_error) + __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, 382, __pyx_L1_error) + __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":383 + /* "constraint/constraints.py":384 * sum = round(sum, 10) * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: * return False # <<<<<<<<<<<<<< @@ -10461,7 +10458,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":382 + /* "constraint/constraints.py":383 * if isinstance(sum, float): * sum = round(sum, 10) * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: # <<<<<<<<<<<<<< @@ -10470,14 +10467,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":384 + /* "constraint/constraints.py":385 * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: * return False * 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, 384, __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; @@ -10493,7 +10490,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_L40_bool_binop_done:; if (__pyx_t_11) { - /* "constraint/constraints.py":385 + /* "constraint/constraints.py":386 * return False * if forwardcheck and missing and not missing_negative: * for variable in variables: # <<<<<<<<<<<<<< @@ -10505,9 +10502,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 385, __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, 385, __pyx_L1_error) + __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_6)) { @@ -10515,7 +10512,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 385, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 386, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -10525,7 +10522,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 385, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 386, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -10536,13 +10533,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 385, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 386, __pyx_L1_error) } else { __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, 385, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 386, __pyx_L1_error) PyErr_Clear(); } break; @@ -10552,45 +10549,45 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":386 + /* "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, 386, __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":387 + /* "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_7 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 387, __pyx_L1_error) + __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":388 + /* "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_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, 388, __pyx_L1_error) + __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_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 388, __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, 388, __pyx_L1_error) + __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_7); __pyx_t_7 = 0; for (;;) { @@ -10599,7 +10596,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 388, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 389, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -10609,7 +10606,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal { 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, 388, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 389, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -10620,13 +10617,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 388, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __pyx_L1_error) } else { __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, 388, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 389, __pyx_L1_error) PyErr_Clear(); } break; @@ -10636,22 +10633,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":389 + /* "constraint/constraints.py":390 * domain = domains[variable] * for value in domain[:]: * if sum + value > exactsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ - __pyx_t_7 = PyNumber_Add(__pyx_v_sum, __pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __pyx_L1_error) + __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, 389, __pyx_L1_error) + __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, 389, __pyx_L1_error) + __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":390 + /* "constraint/constraints.py":391 * for value in domain[:]: * if sum + value > exactsum: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -10665,12 +10662,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal 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, 390, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":389 + /* "constraint/constraints.py":390 * domain = domains[variable] * for value in domain[:]: * if sum + value > exactsum: # <<<<<<<<<<<<<< @@ -10679,7 +10676,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":388 + /* "constraint/constraints.py":389 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -10689,18 +10686,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":391 + /* "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, 391, __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":392 + /* "constraint/constraints.py":393 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -10713,7 +10710,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L0; - /* "constraint/constraints.py":391 + /* "constraint/constraints.py":392 * if sum + value > exactsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -10722,7 +10719,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":386 + /* "constraint/constraints.py":387 * if forwardcheck and missing and not missing_negative: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -10731,7 +10728,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":385 + /* "constraint/constraints.py":386 * return False * if forwardcheck and missing and not missing_negative: * for variable in variables: # <<<<<<<<<<<<<< @@ -10741,7 +10738,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":384 + /* "constraint/constraints.py":385 * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: * return False * if forwardcheck and missing and not missing_negative: # <<<<<<<<<<<<<< @@ -10752,7 +10749,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __pyx_L3:; - /* "constraint/constraints.py":393 + /* "constraint/constraints.py":394 * if not domain: * return False * if missing: # <<<<<<<<<<<<<< @@ -10761,7 +10758,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ if (__pyx_v_missing) { - /* "constraint/constraints.py":394 + /* "constraint/constraints.py":395 * return False * if missing: * return sum + min_sum_missing <= exactsum and sum + max_sum_missing >= exactsum # <<<<<<<<<<<<<< @@ -10769,11 +10766,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * return sum == exactsum */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyNumber_Add(__pyx_v_sum, __pyx_v_min_sum_missing); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error) + __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, 394, __pyx_L1_error) + __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, 394, __pyx_L1_error) + __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 { @@ -10782,9 +10779,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __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, 394, __pyx_L1_error) + __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, 394, __pyx_L1_error) + __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; @@ -10794,7 +10791,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_t_8 = 0; goto __pyx_L0; - /* "constraint/constraints.py":393 + /* "constraint/constraints.py":394 * if not domain: * return False * if missing: # <<<<<<<<<<<<<< @@ -10803,7 +10800,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":396 + /* "constraint/constraints.py":397 * return sum + min_sum_missing <= exactsum and sum + max_sum_missing >= exactsum * else: * return sum == exactsum # <<<<<<<<<<<<<< @@ -10812,13 +10809,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __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, 396, __pyx_L1_error) + __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":339 + /* "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 # <<<<<<<<<<<<<< @@ -10850,10 +10847,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal return __pyx_r; } -/* "constraint/constraints.py":416 +/* "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. * */ @@ -10901,47 +10898,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, 416, __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, 416, __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, 416, __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, 416, __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, 416, __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, 416, __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, 416, __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, 416, __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, 416, __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, 416, __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, 416, __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; } @@ -10954,7 +10951,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, 416, __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:; @@ -10965,7 +10962,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, 416, __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 */ @@ -10986,7 +10983,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":432 +/* "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." # <<<<<<<<<<<<<< @@ -11006,7 +11003,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, 432, __pyx_L1_error) + __PYX_ERR(0, 433, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -11014,7 +11011,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, 432, __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; @@ -11052,16 +11049,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 432, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 432, __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, 432, __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, 432, __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)) { @@ -11069,7 +11066,7 @@ 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, 432, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 433, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -11079,7 +11076,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain { 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, 432, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 433, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -11090,13 +11087,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __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, 432, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 433, __pyx_L1_error) PyErr_Clear(); } break; @@ -11154,10 +11151,10 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":416 +/* "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. * */ @@ -11176,44 +11173,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":426 + /* "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, 426, __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":427 + /* "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, 427, __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":428 + /* "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, 428, __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":430 + /* "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, 430, __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":431 + /* "constraint/constraints.py":432 * * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." # <<<<<<<<<<<<<< @@ -11222,19 +11219,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, 431, __pyx_L1_error) - __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 431, __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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Multipliers_must_match_sum_varia, 0, 0); - __PYX_ERR(0, 431, __pyx_L1_error) + __PYX_ERR(0, 432, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 431, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 432, __pyx_L1_error) #endif - /* "constraint/constraints.py":432 + /* "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." # <<<<<<<<<<<<<< @@ -11243,23 +11240,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, 432, __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, 432, __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, 432, __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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Multipliers_must_be_numbers, 0, 0); - __PYX_ERR(0, 432, __pyx_L1_error) + __PYX_ERR(0, 433, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 432, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 433, __pyx_L1_error) #endif - /* "constraint/constraints.py":433 + /* "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." # <<<<<<<<<<<<<< @@ -11268,20 +11265,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, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 433, __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, 433, __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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Last_multiplier_must_be_1_as_it, 0, 0); - __PYX_ERR(0, 433, __pyx_L1_error) + __PYX_ERR(0, 434, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 433, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 434, __pyx_L1_error) #endif - /* "constraint/constraints.py":430 + /* "constraint/constraints.py":431 * self._multipliers = multipliers * * if multipliers: # <<<<<<<<<<<<<< @@ -11290,10 +11287,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":416 + /* "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. * */ @@ -11313,7 +11310,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":435 +/* "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 # <<<<<<<<<<<<<< @@ -11364,50 +11361,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, 435, __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, 435, __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, 435, __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, 435, __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, 435, __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, 435, __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, 435, __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, 435, __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, 435, __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, 435, __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, 435, __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, 435, __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, 435, __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]; @@ -11417,7 +11414,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, 435, __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:; @@ -11428,9 +11425,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, 435, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 435, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 435, __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 */ @@ -11451,7 +11448,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":449 +/* "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) # <<<<<<<<<<<<<< @@ -11471,7 +11468,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, 449, __pyx_L1_error) + __PYX_ERR(0, 450, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -11482,7 +11479,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, 449, __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; @@ -11525,17 +11522,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, 449, __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, 449, __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, 449, __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, 449, __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)) { @@ -11543,7 +11540,7 @@ 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, 449, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 450, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -11553,7 +11550,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain { 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, 449, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 450, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -11564,13 +11561,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __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, 449, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 450, __pyx_L1_error) PyErr_Clear(); } break; @@ -11581,18 +11578,18 @@ 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, 449, __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, 449, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 449, __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; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains)) { __Pyx_RaiseClosureNameError("domains"); __PYX_ERR(0, 449, __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, 449, __pyx_L1_error) + __PYX_ERR(0, 450, __pyx_L1_error) } - __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, 449, __pyx_L1_error) + __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; { @@ -11600,7 +11597,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain __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_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __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; @@ -11621,7 +11618,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, 449, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 450, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11651,7 +11648,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":450 +/* "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) # <<<<<<<<<<<<<< @@ -11671,7 +11668,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, 450, __pyx_L1_error) + __PYX_ERR(0, 451, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -11682,7 +11679,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, 450, __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; @@ -11725,17 +11722,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, 450, __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, 450, __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, 450, __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, 450, __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)) { @@ -11743,7 +11740,7 @@ 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, 450, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 451, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -11753,7 +11750,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain { 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, 451, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -11764,13 +11761,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __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, 450, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 451, __pyx_L1_error) PyErr_Clear(); } break; @@ -11781,18 +11778,18 @@ 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, 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) + 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; - 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)) { __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, 450, __pyx_L1_error) + __PYX_ERR(0, 451, __pyx_L1_error) } - __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_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; { @@ -11800,7 +11797,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain __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_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __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; @@ -11821,7 +11818,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, 450, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 451, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11850,7 +11847,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":435 +/* "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 # <<<<<<<<<<<<<< @@ -11892,7 +11889,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, 435, __pyx_L1_error) + __PYX_ERR(0, 436, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -11900,7 +11897,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":436 + /* "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) # <<<<<<<<<<<<<< @@ -11908,9 +11905,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, 436, __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, 436, __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; @@ -11930,34 +11927,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 436, __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":438 + /* "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, 438, __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":440 + /* "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, 440, __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":441 + /* "constraint/constraints.py":442 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -11965,7 +11962,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain * for value in domain[:]: */ __pyx_t_4 = NULL; - __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, 441, __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, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = 1; { @@ -11973,7 +11970,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __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)) { @@ -11981,9 +11978,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, 441, __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, 441, __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 (;;) { @@ -11992,7 +11989,7 @@ 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, 441, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 442, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -12002,7 +11999,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 441, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 442, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -12013,13 +12010,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __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, 441, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 442, __pyx_L1_error) PyErr_Clear(); } break; @@ -12032,7 +12029,7 @@ 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, 441, __pyx_L1_error) + __PYX_ERR(0, 442, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -12042,22 +12039,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 441, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __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, 441, __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, 441, __pyx_L1_error) + __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, 441, __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); @@ -12065,7 +12062,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 441, __pyx_L1_error) + 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; @@ -12073,7 +12070,7 @@ 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, 441, __pyx_L1_error) + __PYX_ERR(0, 442, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_var); @@ -12083,35 +12080,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":442 + /* "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, 442, __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":443 + /* "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, 443, __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_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, 443, __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, 443, __pyx_L1_error) + __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 (;;) { @@ -12120,7 +12117,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 443, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 444, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -12130,7 +12127,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 443, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 444, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -12141,13 +12138,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __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, 443, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 444, __pyx_L1_error) PyErr_Clear(); } break; @@ -12157,19 +12154,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":444 + /* "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, 444, __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_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 444, __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, 444, __pyx_L1_error) + __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_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_5 = 1; @@ -12178,17 +12175,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 444, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } - __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, 444, __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_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 444, __pyx_L1_error) + __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":445 + /* "constraint/constraints.py":446 * for value in domain[:]: * if value * multiplier > max(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< @@ -12202,12 +12199,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain 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, 445, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "constraint/constraints.py":444 + /* "constraint/constraints.py":445 * domain = domains[var] * for value in domain[:]: * if value * multiplier > max(domains[self.target_var]): # <<<<<<<<<<<<<< @@ -12216,7 +12213,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":443 + /* "constraint/constraints.py":444 * for var, multiplier in zip(self.sum_vars, multipliers): * domain = domains[var] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -12226,7 +12223,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":441 + /* "constraint/constraints.py":442 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -12236,7 +12233,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":440 + /* "constraint/constraints.py":441 * multipliers = self._multipliers * * if multipliers: # <<<<<<<<<<<<<< @@ -12246,7 +12243,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L3; } - /* "constraint/constraints.py":447 + /* "constraint/constraints.py":448 * domain.remove(value) * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -12254,16 +12251,16 @@ 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, 447, __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_3 = __pyx_t_2; __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_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __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, 447, __pyx_L1_error) + __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 (;;) { @@ -12272,7 +12269,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 447, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 448, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -12282,7 +12279,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 447, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 448, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -12293,13 +12290,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error) } else { __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, 447, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 448, __pyx_L1_error) PyErr_Clear(); } break; @@ -12311,19 +12308,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":448 + /* "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, 448, __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":449 + /* "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) # <<<<<<<<<<<<<< @@ -12331,9 +12328,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain * for value in domain[:]: */ __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, 449, __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, 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, 449, __pyx_L1_error) + __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_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = 1; @@ -12342,13 +12339,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 449, __pyx_L1_error) + 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":450 + /* "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) # <<<<<<<<<<<<<< @@ -12356,9 +12353,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain * if value + others_min > max(domains[self.target_var]): */ __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, 450, __pyx_L1_error) + __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, 450, __pyx_L1_error) + __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; @@ -12367,29 +12364,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 450, __pyx_L1_error) + 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":451 + /* "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, 451, __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_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __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, 451, __pyx_L1_error) + __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 (;;) { @@ -12398,7 +12395,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 451, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 452, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -12408,7 +12405,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 451, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 452, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -12419,13 +12416,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) } else { __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, 451, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 452, __pyx_L1_error) PyErr_Clear(); } break; @@ -12435,19 +12432,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":452 + /* "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, 452, __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_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, 452, __pyx_L1_error) + __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_13 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 452, __pyx_L1_error) + __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; @@ -12456,17 +12453,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 452, __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, 452, __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, 452, __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":453 + /* "constraint/constraints.py":454 * for value in domain[:]: * if value + others_min > max(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< @@ -12480,12 +12477,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_value}; __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, 453, __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":452 + /* "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]): # <<<<<<<<<<<<<< @@ -12494,19 +12491,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":454 + /* "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, 454, __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_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 454, __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, 454, __pyx_L1_error) + __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_14); __pyx_t_14 = 0; __pyx_t_5 = 1; @@ -12515,17 +12512,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __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, 454, __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_9); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 454, __pyx_L1_error) + __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":455 + /* "constraint/constraints.py":456 * domain.remove(value) * if value + others_max < min(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< @@ -12539,12 +12536,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_value}; __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_9)) __PYX_ERR(0, 455, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":454 + /* "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]): # <<<<<<<<<<<<<< @@ -12553,7 +12550,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":451 + /* "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[:]: # <<<<<<<<<<<<<< @@ -12563,7 +12560,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":447 + /* "constraint/constraints.py":448 * domain.remove(value) * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -12575,7 +12572,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __pyx_L3:; - /* "constraint/constraints.py":435 + /* "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 # <<<<<<<<<<<<<< @@ -12611,7 +12608,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":457 +/* "constraint/constraints.py":458 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -12662,53 +12659,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, 457, __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, 457, __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, 457, __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, 457, __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, 457, __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, 457, __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, 457, __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, 457, __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, 457, __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, 457, __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, 457, __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, 457, __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, 457, __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; } @@ -12722,7 +12719,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, 457, __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:; @@ -12733,8 +12730,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, 457, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 457, __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 */ @@ -12784,32 +12781,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":458 + /* "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, 458, __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":460 + /* "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, 460, __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, 460, __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":461 + /* "constraint/constraints.py":462 * * if self.target_var not in assignments: * return True # can't evaluate without target, defer to later # <<<<<<<<<<<<<< @@ -12821,7 +12818,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":460 + /* "constraint/constraints.py":461 * multipliers = self._multipliers * * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -12830,22 +12827,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":463 + /* "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, 463, __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, 463, __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":464 + /* "constraint/constraints.py":465 * * target_value = assignments[self.target_var] * sum_value = 0 # <<<<<<<<<<<<<< @@ -12855,7 +12852,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":465 + /* "constraint/constraints.py":466 * target_value = assignments[self.target_var] * sum_value = 0 * missing = False # <<<<<<<<<<<<<< @@ -12864,17 +12861,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ __pyx_v_missing = 0; - /* "constraint/constraints.py":467 + /* "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, 467, __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":468 + /* "constraint/constraints.py":469 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -12882,7 +12879,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain * sum_value += assignments[var] * multiplier */ __pyx_t_1 = 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, 468, __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, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; { @@ -12890,7 +12887,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 468, __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)) { @@ -12898,9 +12895,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 468, __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_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 468, __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 (;;) { @@ -12909,7 +12906,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 468, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 469, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -12919,7 +12916,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 468, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 469, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -12930,13 +12927,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error) } else { __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, 468, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 469, __pyx_L1_error) PyErr_Clear(); } break; @@ -12949,7 +12946,7 @@ 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, 468, __pyx_L1_error) + __PYX_ERR(0, 469, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -12959,22 +12956,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __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, 468, __pyx_L1_error) + __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, 468, __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); @@ -12982,7 +12979,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_GOTREF(__pyx_t_1); 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, 468, __pyx_L1_error) + 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; @@ -12990,7 +12987,7 @@ 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, 468, __pyx_L1_error) + __PYX_ERR(0, 469, __pyx_L1_error) __pyx_L8_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); @@ -12998,35 +12995,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":469 + /* "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, 469, __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":470 + /* "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, 470, __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_8 = PyNumber_Multiply(__pyx_t_3, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 470, __pyx_L1_error) + __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_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __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_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":469 + /* "constraint/constraints.py":470 * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: # <<<<<<<<<<<<<< @@ -13036,7 +13033,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L9; } - /* "constraint/constraints.py":472 + /* "constraint/constraints.py":473 * sum_value += assignments[var] * multiplier * else: * missing = True # <<<<<<<<<<<<<< @@ -13048,7 +13045,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __pyx_L9:; - /* "constraint/constraints.py":468 + /* "constraint/constraints.py":469 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -13058,7 +13055,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":467 + /* "constraint/constraints.py":468 * missing = False * * if multipliers: # <<<<<<<<<<<<<< @@ -13068,7 +13065,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L4; } - /* "constraint/constraints.py":474 + /* "constraint/constraints.py":475 * missing = True * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -13076,16 +13073,16 @@ 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, 474, __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_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 474, __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_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 474, __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 (;;) { @@ -13094,7 +13091,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 474, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 475, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -13104,7 +13101,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 474, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 475, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -13115,13 +13112,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L1_error) } else { __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, 474, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 475, __pyx_L1_error) PyErr_Clear(); } break; @@ -13131,32 +13128,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":475 + /* "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, 475, __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":476 + /* "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, 476, __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_8 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 476, __pyx_L1_error) + __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_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":475 + /* "constraint/constraints.py":476 * else: * for var in self.sum_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -13166,7 +13163,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L13; } - /* "constraint/constraints.py":478 + /* "constraint/constraints.py":479 * sum_value += assignments[var] * else: * sum_value += min(domains[var]) # use min value if not assigned # <<<<<<<<<<<<<< @@ -13175,7 +13172,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ /*else*/ { __pyx_t_4 = NULL; - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L1_error) + __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; { @@ -13183,16 +13180,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 478, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L1_error) + __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":479 + /* "constraint/constraints.py":480 * else: * sum_value += min(domains[var]) # use min value if not assigned * missing = True # <<<<<<<<<<<<<< @@ -13203,7 +13200,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __pyx_L13:; - /* "constraint/constraints.py":474 + /* "constraint/constraints.py":475 * missing = True * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -13215,7 +13212,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __pyx_L4:; - /* "constraint/constraints.py":481 + /* "constraint/constraints.py":482 * missing = True * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -13225,7 +13222,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_t_2 = PyFloat_Check(__pyx_v_sum_value); if (__pyx_t_2) { - /* "constraint/constraints.py":482 + /* "constraint/constraints.py":483 * * if isinstance(sum_value, float): * sum_value = round(sum_value, 10) # <<<<<<<<<<<<<< @@ -13238,13 +13235,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain 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, 482, __pyx_L1_error) + 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":481 + /* "constraint/constraints.py":482 * missing = True * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -13253,7 +13250,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":484 + /* "constraint/constraints.py":485 * sum_value = round(sum_value, 10) * * if missing: # <<<<<<<<<<<<<< @@ -13262,19 +13259,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ if (__pyx_v_missing) { - /* "constraint/constraints.py":486 + /* "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, 486, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 486, __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":487 + /* "constraint/constraints.py":488 * # Partial assignments: only check feasibility * if sum_value > target_value: * return False # <<<<<<<<<<<<<< @@ -13286,7 +13283,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":486 + /* "constraint/constraints.py":487 * if missing: * # Partial assignments: only check feasibility * if sum_value > target_value: # <<<<<<<<<<<<<< @@ -13295,33 +13292,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":488 + /* "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, 488, __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":489 + /* "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, 489, __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_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __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_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 489, __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 (;;) { @@ -13330,7 +13327,7 @@ static PyObject *__pyx_pf_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, 489, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 490, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -13340,7 +13337,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 489, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 490, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -13351,13 +13348,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 489, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 490, __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, 489, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 490, __pyx_L1_error) PyErr_Clear(); } break; @@ -13367,55 +13364,55 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":490 + /* "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, 490, __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":491 + /* "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, 491, __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":492 + /* "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, 492, __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":493 + /* "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, 493, __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_8 = __pyx_t_3; __Pyx_INCREF(__pyx_t_8); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 493, __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, 493, __pyx_L1_error) + __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 (;;) { @@ -13424,7 +13421,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 493, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 494, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -13434,7 +13431,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 493, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 494, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -13445,13 +13442,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error) } else { __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, 493, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 494, __pyx_L1_error) PyErr_Clear(); } break; @@ -13461,14 +13458,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":494 + /* "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_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 494, __pyx_L1_error) + __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); @@ -13478,34 +13475,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __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, 494, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_multipliers, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 494, __pyx_L1_error) + __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_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __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_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, 494, __pyx_L1_error) + __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_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":495 + /* "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_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, 495, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 495, __pyx_L1_error) + __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":496 + /* "constraint/constraints.py":497 * temp_sum = sum_value + (value * multipliers[self.sum_vars.index(var)]) * if temp_sum > target_value: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -13519,12 +13516,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __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_9)) __PYX_ERR(0, 496, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":495 + /* "constraint/constraints.py":496 * for value in domain[:]: * temp_sum = sum_value + (value * multipliers[self.sum_vars.index(var)]) * if temp_sum > target_value: # <<<<<<<<<<<<<< @@ -13533,7 +13530,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":493 + /* "constraint/constraints.py":494 * domain = domains[var] * if multipliers: * for value in domain[:]: # <<<<<<<<<<<<<< @@ -13543,7 +13540,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":492 + /* "constraint/constraints.py":493 * if var not in assignments: * domain = domains[var] * if multipliers: # <<<<<<<<<<<<<< @@ -13553,7 +13550,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L22; } - /* "constraint/constraints.py":498 + /* "constraint/constraints.py":499 * domain.hideValue(value) * else: * for value in domain[:]: # <<<<<<<<<<<<<< @@ -13561,16 +13558,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain * if temp_sum > target_value: */ /*else*/ { - __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, 498, __pyx_L1_error) + __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, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { __pyx_t_9 = __pyx_t_8; __Pyx_INCREF(__pyx_t_9); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 498, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 499, __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, 498, __pyx_L1_error) + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 499, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -13579,7 +13576,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 498, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 499, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -13589,7 +13586,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { 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, 498, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 499, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -13600,13 +13597,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 498, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 499, __pyx_L1_error) } else { __pyx_t_8 = __pyx_t_12(__pyx_t_9); 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, 498, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 499, __pyx_L1_error) PyErr_Clear(); } break; @@ -13616,31 +13613,31 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":499 + /* "constraint/constraints.py":500 * else: * for value in domain[:]: * temp_sum = sum_value + value # <<<<<<<<<<<<<< * if temp_sum > target_value: * domain.hideValue(value) */ - __pyx_t_8 = PyNumber_Add(__pyx_v_sum_value, __pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_8 = PyNumber_Add(__pyx_v_sum_value, __pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_temp_sum, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":500 + /* "constraint/constraints.py":501 * for value in domain[:]: * temp_sum = sum_value + value * if temp_sum > target_value: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ - __pyx_t_8 = PyObject_RichCompare(__pyx_v_temp_sum, __pyx_v_target_value, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 500, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_v_temp_sum, __pyx_v_target_value, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":501 + /* "constraint/constraints.py":502 * temp_sum = sum_value + value * if temp_sum > target_value: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -13654,12 +13651,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; __pyx_t_8 = __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_8)) __PYX_ERR(0, 501, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":500 + /* "constraint/constraints.py":501 * for value in domain[:]: * temp_sum = sum_value + value * if temp_sum > target_value: # <<<<<<<<<<<<<< @@ -13668,7 +13665,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":498 + /* "constraint/constraints.py":499 * domain.hideValue(value) * else: * for value in domain[:]: # <<<<<<<<<<<<<< @@ -13680,18 +13677,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __pyx_L22:; - /* "constraint/constraints.py":502 + /* "constraint/constraints.py":503 * if temp_sum > 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, 502, __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":503 + /* "constraint/constraints.py":504 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -13704,7 +13701,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":502 + /* "constraint/constraints.py":503 * if temp_sum > target_value: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -13713,7 +13710,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":490 + /* "constraint/constraints.py":491 * if forwardcheck: * for var in self.sum_vars: * if var not in assignments: # <<<<<<<<<<<<<< @@ -13722,7 +13719,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":489 + /* "constraint/constraints.py":490 * return False * if forwardcheck: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -13732,7 +13729,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":488 + /* "constraint/constraints.py":489 * if sum_value > target_value: * return False * if forwardcheck: # <<<<<<<<<<<<<< @@ -13741,7 +13738,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":504 + /* "constraint/constraints.py":505 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -13753,7 +13750,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":484 + /* "constraint/constraints.py":485 * sum_value = round(sum_value, 10) * * if missing: # <<<<<<<<<<<<<< @@ -13762,7 +13759,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":506 + /* "constraint/constraints.py":507 * return True * else: * return sum_value == target_value # <<<<<<<<<<<<<< @@ -13771,13 +13768,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, 506, __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":457 + /* "constraint/constraints.py":458 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -13808,10 +13805,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":525 +/* "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. * */ @@ -13858,41 +13855,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, 525, __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, 525, __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, 525, __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, 525, __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, 525, __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, 525, __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, 525, __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, 525, __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, 525, __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; } @@ -13904,7 +13901,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, 525, __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:; @@ -13934,40 +13931,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint___init__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":534 + /* "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, 534, __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":535 + /* "constraint/constraints.py":536 * """ * self._minsum = minsum * self._multipliers = multipliers # <<<<<<<<<<<<<< * self._var_max = {} * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2, __pyx_v_multipliers) < (0)) __PYX_ERR(0, 535, __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":536 + /* "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, 536, __pyx_L1_error) + __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, 536, __pyx_L1_error) + 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":525 + /* "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. * */ @@ -13985,7 +13982,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint___init__ return __pyx_r; } -/* "constraint/constraints.py":538 +/* "constraint/constraints.py":539 * self._var_max = {} * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -14036,50 +14033,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, 538, __pyx_L3_error) + 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, 538, __pyx_L3_error) + 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, 538, __pyx_L3_error) + 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, 538, __pyx_L3_error) + 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, 538, __pyx_L3_error) + 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, 538, __pyx_L3_error) + 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, 538, __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, 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, 538, __pyx_L3_error) } + 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, 538, __pyx_L3_error) + 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, 538, __pyx_L3_error) + 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, 538, __pyx_L3_error) + 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, 538, __pyx_L3_error) + 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, 538, __pyx_L3_error) + 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]; @@ -14089,7 +14086,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, 538, __pyx_L3_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:; @@ -14100,9 +14097,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, 538, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 538, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 538, __pyx_L1_error) + 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 */ @@ -14153,7 +14150,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":539 + /* "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) # <<<<<<<<<<<<<< @@ -14161,9 +14158,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc * 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, 539, __pyx_L1_error) + __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, 539, __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, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -14183,36 +14180,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __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, 539, __pyx_L1_error) + 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":540 + /* "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, 540, __pyx_L1_error) + __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, 540, __pyx_L1_error) + __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, 540, __pyx_L1_error) + __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, 540, __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, 540, __pyx_L1_error) + __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, 540, __pyx_L1_error); + 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; @@ -14221,7 +14218,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":541 + /* "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 # <<<<<<<<<<<<<< @@ -14229,7 +14226,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc * # 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, 541, __pyx_L5_error) + __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; @@ -14237,7 +14234,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc 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, 541, __pyx_L5_error) + 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)) { @@ -14245,9 +14242,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __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, 541, __pyx_L5_error) + __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, 541, __pyx_L5_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, 542, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -14256,7 +14253,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc { 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, 541, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 542, __pyx_L5_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -14266,7 +14263,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc { 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, 541, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 542, __pyx_L5_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -14277,13 +14274,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L5_error) + 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, 541, __pyx_L5_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 542, __pyx_L5_error) PyErr_Clear(); } break; @@ -14296,7 +14293,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 541, __pyx_L5_error) + __PYX_ERR(0, 542, __pyx_L5_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -14306,22 +14303,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L5_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L5_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 541, __pyx_L5_error) + 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, 541, __pyx_L5_error) + __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, 541, __pyx_L5_error) + __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, 541, __pyx_L5_error) + __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); @@ -14329,7 +14326,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __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, 541, __pyx_L5_error) + 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; @@ -14337,7 +14334,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 541, __pyx_L5_error) + __PYX_ERR(0, 542, __pyx_L5_error) __pyx_L9_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_variable, __pyx_t_3); @@ -14345,7 +14342,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __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, 541, __pyx_L5_error) + __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; { @@ -14353,13 +14350,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __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, 541, __pyx_L5_error) + 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, 541, __pyx_L5_error) + __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, 541, __pyx_L5_error) + 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; @@ -14372,10 +14369,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc 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, 541, __pyx_L1_error) + 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":544 + /* "constraint/constraints.py":545 * * # preprocess the domains to remove values that cannot contribute to the minimum sum * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -14388,7 +14385,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc 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, 544, __pyx_L1_error) + 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)) { @@ -14396,9 +14393,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __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, 544, __pyx_L1_error) + __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, 544, __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, 545, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -14407,7 +14404,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc { 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, 544, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 545, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -14417,7 +14414,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc { 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, 544, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 545, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -14428,13 +14425,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) + 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, 544, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 545, __pyx_L1_error) PyErr_Clear(); } break; @@ -14447,7 +14444,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 544, __pyx_L1_error) + __PYX_ERR(0, 545, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -14457,22 +14454,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 544, __pyx_L1_error) + 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, 544, __pyx_L1_error) + __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, 544, __pyx_L1_error) + __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, 544, __pyx_L1_error) + __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); @@ -14480,7 +14477,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __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, 544, __pyx_L1_error) + 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; @@ -14488,7 +14485,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 544, __pyx_L1_error) + __PYX_ERR(0, 545, __pyx_L1_error) __pyx_L15_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); @@ -14496,19 +14493,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":545 + /* "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, 545, __pyx_L1_error) + __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":546 + /* "constraint/constraints.py":547 * for variable, multiplier in zip(variables, multipliers): * domain = domains[variable] * others_max = sum_other_vars(variables, variable, self._var_max) # <<<<<<<<<<<<<< @@ -14516,9 +14513,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc * 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, 546, __pyx_L1_error) + __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, 546, __pyx_L1_error) + __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 @@ -14538,29 +14535,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __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, 546, __pyx_L1_error) + 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":547 + /* "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, 547, __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, 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, 547, __pyx_L1_error) + __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, 547, __pyx_L1_error) + __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 (;;) { @@ -14569,7 +14566,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc { 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, 547, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 548, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -14579,7 +14576,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc { 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, 547, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 548, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -14590,13 +14587,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error) + 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, 547, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 548, __pyx_L1_error) PyErr_Clear(); } break; @@ -14606,28 +14603,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":548 + /* "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, 548, __pyx_L1_error) + __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, 548, __pyx_L1_error) + __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, 548, __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, 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, 548, __pyx_L1_error) + __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, 548, __pyx_L1_error) + __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":549 + /* "constraint/constraints.py":550 * for value in domain[:]: * if value * multiplier + others_max < self._minsum: * domain.remove(value) # <<<<<<<<<<<<<< @@ -14641,12 +14638,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc 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, 549, __pyx_L1_error) + 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":548 + /* "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: # <<<<<<<<<<<<<< @@ -14655,7 +14652,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc */ } - /* "constraint/constraints.py":547 + /* "constraint/constraints.py":548 * domain = domains[variable] * others_max = sum_other_vars(variables, variable, self._var_max) * for value in domain[:]: # <<<<<<<<<<<<<< @@ -14665,7 +14662,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":544 + /* "constraint/constraints.py":545 * * # preprocess the domains to remove values that cannot contribute to the minimum sum * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -14675,7 +14672,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":552 + /* "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 # <<<<<<<<<<<<<< @@ -14683,7 +14680,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc * 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, 552, __pyx_L23_error) + __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; @@ -14691,7 +14688,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc 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, 552, __pyx_L23_error) + 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)) { @@ -14699,9 +14696,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __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, 552, __pyx_L23_error) + __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, 552, __pyx_L23_error) + __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 (;;) { @@ -14710,7 +14707,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc { 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, 552, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 553, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -14720,7 +14717,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc { 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, 552, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 553, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -14731,13 +14728,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __pyx_L23_error) + 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, 552, __pyx_L23_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 553, __pyx_L23_error) PyErr_Clear(); } break; @@ -14750,7 +14747,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 552, __pyx_L23_error) + __PYX_ERR(0, 553, __pyx_L23_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -14760,22 +14757,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L23_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 552, __pyx_L23_error) + 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, 552, __pyx_L23_error) + __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, 552, __pyx_L23_error) + __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, 552, __pyx_L23_error) + __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); @@ -14783,7 +14780,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __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, 552, __pyx_L23_error) + 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; @@ -14791,21 +14788,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 552, __pyx_L23_error) + __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, 552, __pyx_L23_error) + __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, 552, __pyx_L23_error) + __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, 552, __pyx_L23_error) + __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; { @@ -14813,10 +14810,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __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, 552, __pyx_L23_error) + 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, 552, __pyx_L23_error) + __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; @@ -14825,7 +14822,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __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, 552, __pyx_L23_error) + 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; @@ -14838,10 +14835,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc 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, 552, __pyx_L1_error) + 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":538 + /* "constraint/constraints.py":539 * self._var_max = {} * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -14877,7 +14874,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc return __pyx_r; } -/* "constraint/constraints.py":554 +/* "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 # <<<<<<<<<<<<<< @@ -14928,53 +14925,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, 554, __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, 554, __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, 554, __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, 554, __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, 554, __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, 554, __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, 554, __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, 554, __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, 554, __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, 554, __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, 554, __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, 554, __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, 554, __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; } @@ -14988,7 +14985,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, 554, __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:; @@ -14999,8 +14996,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, 554, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 554, __pyx_L1_error) + 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 */ @@ -15045,31 +15042,31 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":555 + /* "constraint/constraints.py":556 * * 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, 555, __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":556 + /* "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 * 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, 556, __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":557 + /* "constraint/constraints.py":558 * multipliers = self._multipliers * minsum = self._minsum * sum = 0 # <<<<<<<<<<<<<< @@ -15079,7 +15076,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":558 + /* "constraint/constraints.py":559 * minsum = self._minsum * sum = 0 * missing = False # <<<<<<<<<<<<<< @@ -15088,7 +15085,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ */ __pyx_v_missing = 0; - /* "constraint/constraints.py":559 + /* "constraint/constraints.py":560 * sum = 0 * missing = False * max_sum_missing = 0 # <<<<<<<<<<<<<< @@ -15098,17 +15095,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_max_sum_missing = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":560 + /* "constraint/constraints.py":561 * missing = False * max_sum_missing = 0 * 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, 560, __pyx_L1_error) + __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":561 + /* "constraint/constraints.py":562 * max_sum_missing = 0 * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -15121,7 +15118,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ 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, 561, __pyx_L1_error) + 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)) { @@ -15129,9 +15126,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 561, __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, 561, __pyx_L1_error) + __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 (;;) { @@ -15140,7 +15137,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ { 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, 561, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 562, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -15150,7 +15147,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ { 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, 561, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 562, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -15161,13 +15158,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error) } else { __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, 561, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 562, __pyx_L1_error) PyErr_Clear(); } break; @@ -15180,7 +15177,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 561, __pyx_L1_error) + __PYX_ERR(0, 562, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -15190,22 +15187,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 561, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 561, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 561, __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, 561, __pyx_L1_error) + __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, 561, __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); @@ -15213,7 +15210,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ __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, 561, __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_L7_unpacking_done; @@ -15221,7 +15218,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_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, 561, __pyx_L1_error) + __PYX_ERR(0, 562, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_7); @@ -15229,35 +15226,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":562 + /* "constraint/constraints.py":563 * 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, 562, __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, 563, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":563 + /* "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, 563, __pyx_L1_error) + __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, 563, __pyx_L1_error) + __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, 563, __pyx_L1_error) + __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":562 + /* "constraint/constraints.py":563 * if multipliers: * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: # <<<<<<<<<<<<<< @@ -15267,7 +15264,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ goto __pyx_L8; } - /* "constraint/constraints.py":565 + /* "constraint/constraints.py":566 * sum += assignments[variable] * multiplier * else: * max_sum_missing += self._var_max[variable] # <<<<<<<<<<<<<< @@ -15275,18 +15272,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ * 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, 565, __pyx_L1_error) + __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, 565, __pyx_L1_error) + __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, 565, __pyx_L1_error) + __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":566 + /* "constraint/constraints.py":567 * else: * max_sum_missing += self._var_max[variable] * missing = True # <<<<<<<<<<<<<< @@ -15297,7 +15294,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ } __pyx_L8:; - /* "constraint/constraints.py":561 + /* "constraint/constraints.py":562 * max_sum_missing = 0 * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -15307,7 +15304,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":560 + /* "constraint/constraints.py":561 * missing = False * max_sum_missing = 0 * if multipliers: # <<<<<<<<<<<<<< @@ -15317,7 +15314,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ goto __pyx_L3; } - /* "constraint/constraints.py":568 + /* "constraint/constraints.py":569 * missing = True * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -15330,9 +15327,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __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, 568, __pyx_L1_error) + __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_6)) { @@ -15340,7 +15337,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ { 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, 568, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 569, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -15350,7 +15347,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ { 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, 568, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 569, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -15361,13 +15358,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) } else { __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, 568, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 569, __pyx_L1_error) PyErr_Clear(); } break; @@ -15377,32 +15374,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":569 + /* "constraint/constraints.py":570 * else: * for variable in variables: * 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, 569, __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, 570, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":570 + /* "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, 570, __pyx_L1_error) + __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, 570, __pyx_L1_error) + __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":569 + /* "constraint/constraints.py":570 * else: * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -15412,7 +15409,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ goto __pyx_L12; } - /* "constraint/constraints.py":572 + /* "constraint/constraints.py":573 * sum += assignments[variable] * else: * max_sum_missing += self._var_max[variable] # <<<<<<<<<<<<<< @@ -15420,18 +15417,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ * */ /*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, 572, __pyx_L1_error) + __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, 572, __pyx_L1_error) + __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, 572, __pyx_L1_error) + __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":573 + /* "constraint/constraints.py":574 * else: * max_sum_missing += self._var_max[variable] * missing = True # <<<<<<<<<<<<<< @@ -15442,7 +15439,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ } __pyx_L12:; - /* "constraint/constraints.py":568 + /* "constraint/constraints.py":569 * missing = True * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -15454,7 +15451,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ } __pyx_L3:; - /* "constraint/constraints.py":575 + /* "constraint/constraints.py":576 * missing = True * * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -15464,7 +15461,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ __pyx_t_2 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_2) { - /* "constraint/constraints.py":576 + /* "constraint/constraints.py":577 * * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< @@ -15477,13 +15474,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ 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, 576, __pyx_L1_error) + 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_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":575 + /* "constraint/constraints.py":576 * missing = True * * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -15492,22 +15489,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ */ } - /* "constraint/constraints.py":577 + /* "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, 577, __pyx_L1_error) + __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, 577, __pyx_L1_error) + __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, 577, __pyx_L1_error) + __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":578 + /* "constraint/constraints.py":579 * sum = round(sum, 10) * if sum + max_sum_missing < minsum: * return False # <<<<<<<<<<<<<< @@ -15519,7 +15516,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":577 + /* "constraint/constraints.py":578 * if isinstance(sum, float): * sum = round(sum, 10) * if sum + max_sum_missing < minsum: # <<<<<<<<<<<<<< @@ -15528,7 +15525,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ */ } - /* "constraint/constraints.py":579 + /* "constraint/constraints.py":580 * if sum + max_sum_missing < minsum: * return False * return sum >= minsum or missing # <<<<<<<<<<<<<< @@ -15536,8 +15533,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ * class VariableMinSumConstraint(Constraint): */ __Pyx_XDECREF(__pyx_r); - __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, 579, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 579, __pyx_L1_error) + __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 { @@ -15546,7 +15543,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ __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, 579, __pyx_L1_error) + __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; @@ -15555,7 +15552,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ __pyx_t_8 = 0; goto __pyx_L0; - /* "constraint/constraints.py":554 + /* "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 # <<<<<<<<<<<<<< @@ -15584,10 +15581,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ return __pyx_r; } -/* "constraint/constraints.py":598 +/* "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. * */ @@ -15635,47 +15632,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, 598, __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, 598, __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, 598, __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, 598, __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, 598, __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, 598, __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, 598, __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, 598, __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, 598, __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, 598, __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, 598, __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; } @@ -15688,7 +15685,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, 598, __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:; @@ -15699,7 +15696,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, 598, __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 */ @@ -15720,7 +15717,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":614 +/* "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." # <<<<<<<<<<<<<< @@ -15740,7 +15737,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, 614, __pyx_L1_error) + __PYX_ERR(0, 615, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -15748,7 +15745,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, 614, __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; @@ -15786,16 +15783,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ 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 (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, 614, __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, 614, __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)) { @@ -15803,7 +15800,7 @@ 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, 614, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 615, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -15813,7 +15810,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ { 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) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 615, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -15824,13 +15821,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 614, __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, 614, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 615, __pyx_L1_error) PyErr_Clear(); } break; @@ -15888,10 +15885,10 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":598 +/* "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. * */ @@ -15910,44 +15907,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":608 + /* "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, 608, __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":609 + /* "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, 609, __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":610 + /* "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, 610, __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":612 + /* "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, 612, __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":613 + /* "constraint/constraints.py":614 * * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." # <<<<<<<<<<<<<< @@ -15956,19 +15953,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, 613, __pyx_L1_error) - __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 613, __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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Multipliers_must_match_sum_varia, 0, 0); - __PYX_ERR(0, 613, __pyx_L1_error) + __PYX_ERR(0, 614, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 613, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 614, __pyx_L1_error) #endif - /* "constraint/constraints.py":614 + /* "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." # <<<<<<<<<<<<<< @@ -15977,23 +15974,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, 614, __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, 614, __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, 614, __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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Multipliers_must_be_numbers, 0, 0); - __PYX_ERR(0, 614, __pyx_L1_error) + __PYX_ERR(0, 615, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 614, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 615, __pyx_L1_error) #endif - /* "constraint/constraints.py":615 + /* "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." # <<<<<<<<<<<<<< @@ -16002,20 +15999,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, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __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, 615, __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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Last_multiplier_must_be_1_as_it, 0, 0); - __PYX_ERR(0, 615, __pyx_L1_error) + __PYX_ERR(0, 616, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 615, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 616, __pyx_L1_error) #endif - /* "constraint/constraints.py":612 + /* "constraint/constraints.py":613 * self._multipliers = multipliers * * if multipliers: # <<<<<<<<<<<<<< @@ -16024,10 +16021,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":598 + /* "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. * */ @@ -16047,7 +16044,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":617 +/* "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 # <<<<<<<<<<<<<< @@ -16098,50 +16095,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, 617, __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, 617, __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, 617, __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, 617, __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, 617, __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, 617, __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, 617, __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, 617, __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, 617, __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, 617, __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, 617, __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, 617, __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, 617, __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]; @@ -16151,7 +16148,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, 617, __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:; @@ -16162,9 +16159,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, 617, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 617, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 617, __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 */ @@ -16185,7 +16182,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":625 +/* "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) # <<<<<<<<<<<<<< @@ -16205,7 +16202,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, 625, __pyx_L1_error) + __PYX_ERR(0, 626, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -16216,7 +16213,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, 625, __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; @@ -16259,17 +16256,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, 625, __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, 625, __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, 625, __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, 625, __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)) { @@ -16277,7 +16274,7 @@ 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, 625, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 626, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -16287,7 +16284,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 625, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 626, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -16298,13 +16295,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 625, __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, 625, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 626, __pyx_L1_error) PyErr_Clear(); } break; @@ -16315,18 +16312,18 @@ 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, 625, __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, 625, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 625, __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; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains)) { __Pyx_RaiseClosureNameError("domains"); __PYX_ERR(0, 625, __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, 625, __pyx_L1_error) + __PYX_ERR(0, 626, __pyx_L1_error) } - __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, 625, __pyx_L1_error) + __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; { @@ -16334,7 +16331,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ __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_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 625, __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; @@ -16355,7 +16352,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, 625, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 626, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -16384,7 +16381,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":617 +/* "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 # <<<<<<<<<<<<<< @@ -16423,7 +16420,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, 617, __pyx_L1_error) + __PYX_ERR(0, 618, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -16431,7 +16428,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":618 + /* "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) # <<<<<<<<<<<<<< @@ -16439,9 +16436,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, 618, __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, 618, __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; @@ -16461,51 +16458,51 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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, 618, __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":620 + /* "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, 620, __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":622 + /* "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, 622, __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":623 + /* "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, 623, __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, 623, __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, 623, __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 (;;) { @@ -16514,7 +16511,7 @@ 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, 623, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 624, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -16524,7 +16521,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 623, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 624, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -16535,13 +16532,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __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, 623, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 624, __pyx_L1_error) PyErr_Clear(); } break; @@ -16553,19 +16550,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":624 + /* "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, 624, __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":625 + /* "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) # <<<<<<<<<<<<<< @@ -16573,9 +16570,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ * if value + others_max < min(domains[self.target_var]): */ __pyx_t_2 = NULL; - __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, 625, __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, 625, __pyx_L1_error) + __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -16584,29 +16581,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __pyx_L1_error) + 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":626 + /* "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, 626, __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_10 = __pyx_t_1; __Pyx_INCREF(__pyx_t_10); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 626, __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, 626, __pyx_L1_error) + __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 (;;) { @@ -16615,7 +16612,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 626, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 627, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -16625,7 +16622,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 626, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 627, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -16636,13 +16633,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error) } else { __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, 626, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 627, __pyx_L1_error) PyErr_Clear(); } break; @@ -16652,19 +16649,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":627 + /* "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, 627, __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_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, 627, __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, 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, 627, __pyx_L1_error) + __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_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_5 = 1; @@ -16673,17 +16670,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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, 627, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __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, 627, __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_2); __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 627, __pyx_L1_error) + __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":628 + /* "constraint/constraints.py":629 * for value in domain[:]: * if value + others_max < min(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< @@ -16697,12 +16694,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ 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, 628, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "constraint/constraints.py":627 + /* "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]): # <<<<<<<<<<<<<< @@ -16711,7 +16708,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":626 + /* "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[:]: # <<<<<<<<<<<<<< @@ -16721,7 +16718,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "constraint/constraints.py":623 + /* "constraint/constraints.py":624 * * if not multipliers: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -16731,7 +16728,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":622 + /* "constraint/constraints.py":623 * multipliers = self._multipliers * * if not multipliers: # <<<<<<<<<<<<<< @@ -16740,7 +16737,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":617 + /* "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 # <<<<<<<<<<<<<< @@ -16773,7 +16770,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":630 +/* "constraint/constraints.py":631 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -16824,53 +16821,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, 630, __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, 630, __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, 630, __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, 630, __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, 630, __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, 630, __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, 630, __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, 630, __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, 630, __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, 630, __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, 630, __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, 630, __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, 630, __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; } @@ -16884,7 +16881,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, 630, __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:; @@ -16895,8 +16892,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, 630, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 630, __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 */ @@ -16939,32 +16936,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":631 + /* "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, 631, __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":633 + /* "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, 633, __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, 633, __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":634 + /* "constraint/constraints.py":635 * * if self.target_var not in assignments: * return True # can't evaluate without target, defer to later # <<<<<<<<<<<<<< @@ -16976,7 +16973,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":633 + /* "constraint/constraints.py":634 * multipliers = self._multipliers * * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -16985,22 +16982,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":636 + /* "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, 636, __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, 636, __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":637 + /* "constraint/constraints.py":638 * * target_value = assignments[self.target_var] * sum_value = 0 # <<<<<<<<<<<<<< @@ -17010,17 +17007,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":639 + /* "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, 639, __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":640 + /* "constraint/constraints.py":641 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -17028,7 +17025,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ * sum_value += assignments[var] * multiplier */ __pyx_t_1 = 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, 640, __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, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; { @@ -17036,7 +17033,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __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)) { @@ -17044,9 +17041,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 640, __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_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 640, __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 (;;) { @@ -17055,7 +17052,7 @@ 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, 640, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 641, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -17065,7 +17062,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 640, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 641, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -17076,13 +17073,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) } else { __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, 640, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 641, __pyx_L1_error) PyErr_Clear(); } break; @@ -17095,7 +17092,7 @@ 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, 640, __pyx_L1_error) + __PYX_ERR(0, 641, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -17105,22 +17102,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 640, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __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, 640, __pyx_L1_error) + __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, 640, __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); @@ -17128,7 +17125,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_GOTREF(__pyx_t_1); 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, 640, __pyx_L1_error) + 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; @@ -17136,7 +17133,7 @@ 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, 640, __pyx_L1_error) + __PYX_ERR(0, 641, __pyx_L1_error) __pyx_L8_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); @@ -17144,35 +17141,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":641 + /* "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, 641, __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":642 + /* "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, 642, __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_8 = PyNumber_Multiply(__pyx_t_3, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 642, __pyx_L1_error) + __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_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 642, __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_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":641 + /* "constraint/constraints.py":642 * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: # <<<<<<<<<<<<<< @@ -17182,7 +17179,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ goto __pyx_L9; } - /* "constraint/constraints.py":644 + /* "constraint/constraints.py":645 * sum_value += assignments[var] * multiplier * else: * sum_value += max(domains[var] * multiplier) # use max value if not assigned # <<<<<<<<<<<<<< @@ -17191,9 +17188,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ /*else*/ { __pyx_t_8 = NULL; - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 644, __pyx_L1_error) + __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, 644, __pyx_L1_error) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = 1; @@ -17202,10 +17199,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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, 644, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 644, __pyx_L1_error) + __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_9); @@ -17213,7 +17210,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __pyx_L9:; - /* "constraint/constraints.py":640 + /* "constraint/constraints.py":641 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -17223,7 +17220,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":639 + /* "constraint/constraints.py":640 * sum_value = 0 * * if multipliers: # <<<<<<<<<<<<<< @@ -17233,7 +17230,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ goto __pyx_L4; } - /* "constraint/constraints.py":646 + /* "constraint/constraints.py":647 * sum_value += max(domains[var] * multiplier) # use max value if not assigned * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -17241,16 +17238,16 @@ 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, 646, __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_9 = __pyx_t_4; __Pyx_INCREF(__pyx_t_9); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 646, __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, 646, __pyx_L1_error) + __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 (;;) { @@ -17259,7 +17256,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 646, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 647, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -17269,7 +17266,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ { 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, 646, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 647, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -17280,13 +17277,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error) } else { __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, 646, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 647, __pyx_L1_error) PyErr_Clear(); } break; @@ -17296,32 +17293,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":647 + /* "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, 647, __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":648 + /* "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, 648, __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, 648, __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":647 + /* "constraint/constraints.py":648 * else: * for var in self.sum_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -17331,7 +17328,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ goto __pyx_L13; } - /* "constraint/constraints.py":650 + /* "constraint/constraints.py":651 * sum_value += assignments[var] * else: * sum_value += max(domains[var]) # use max value if not assigned # <<<<<<<<<<<<<< @@ -17340,7 +17337,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ /*else*/ { __pyx_t_4 = NULL; - __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 650, __pyx_L1_error) + __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; { @@ -17348,10 +17345,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __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_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 650, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 650, __pyx_L1_error) + __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_8); @@ -17359,7 +17356,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __pyx_L13:; - /* "constraint/constraints.py":646 + /* "constraint/constraints.py":647 * sum_value += max(domains[var] * multiplier) # use max value if not assigned * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -17371,7 +17368,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __pyx_L4:; - /* "constraint/constraints.py":652 + /* "constraint/constraints.py":653 * sum_value += max(domains[var]) # use max value if not assigned * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -17381,7 +17378,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __pyx_t_2 = PyFloat_Check(__pyx_v_sum_value); if (__pyx_t_2) { - /* "constraint/constraints.py":653 + /* "constraint/constraints.py":654 * * if isinstance(sum_value, float): * sum_value = round(sum_value, 10) # <<<<<<<<<<<<<< @@ -17394,13 +17391,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ 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, 653, __pyx_L1_error) + 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_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":652 + /* "constraint/constraints.py":653 * sum_value += max(domains[var]) # use max value if not assigned * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -17409,7 +17406,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":655 + /* "constraint/constraints.py":656 * sum_value = round(sum_value, 10) * * return sum_value >= target_value # <<<<<<<<<<<<<< @@ -17417,12 +17414,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ * */ __Pyx_XDECREF(__pyx_r); - __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, 655, __pyx_L1_error) + __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":630 + /* "constraint/constraints.py":631 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -17450,10 +17447,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":674 +/* "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. * */ @@ -17500,41 +17497,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, 674, __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, 674, __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, 674, __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, 674, __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, 674, __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, 674, __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, 674, __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, 674, __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, 674, __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; } @@ -17546,7 +17543,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, 674, __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:; @@ -17576,52 +17573,52 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":683 + /* "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, 683, __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":684 + /* "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, 684, __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, 685, __pyx_L1_error) - /* "constraint/constraints.py":685 + /* "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, 685, __pyx_L1_error) + __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, 685, __pyx_L1_error) + 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":686 + /* "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 */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __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, 686, __pyx_L1_error) + 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":674 + /* "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. * */ @@ -17639,7 +17636,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ return __pyx_r; } -/* "constraint/constraints.py":688 +/* "constraint/constraints.py":689 * self._var_is_negative = {} * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -17690,50 +17687,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, 688, __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, 688, __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, 688, __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, 688, __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, 688, __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, 688, __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, 688, __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, 688, __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, 688, __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, 688, __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, 688, __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, 688, __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, 688, __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]; @@ -17743,7 +17740,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, 688, __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:; @@ -17754,9 +17751,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, 688, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 688, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 688, __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 */ @@ -17809,7 +17806,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":689 + /* "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) # <<<<<<<<<<<<<< @@ -17817,9 +17814,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * 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, 689, __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, 689, __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; @@ -17839,36 +17836,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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, 689, __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":690 + /* "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, 690, __pyx_L1_error) + __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, 690, __pyx_L1_error) + __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, 690, __pyx_L1_error) + __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, 690, __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, 690, __pyx_L1_error) + __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, 690, __pyx_L1_error); + 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; @@ -17877,19 +17874,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":691 + /* "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 * */ - __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, 691, __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_maxsum = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":692 + /* "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 # <<<<<<<<<<<<<< @@ -17897,7 +17894,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * # preprocess the domains to remove values that cannot contribute to the sum */ { /* enter inner scope */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L5_error) + __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; @@ -17905,7 +17902,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc 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, 692, __pyx_L5_error) + 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)) { @@ -17913,9 +17910,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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, 692, __pyx_L5_error) + __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, 692, __pyx_L5_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, 693, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -17924,7 +17921,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 692, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 693, __pyx_L5_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -17934,7 +17931,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 692, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 693, __pyx_L5_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -17945,13 +17942,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L5_error) + 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, 692, __pyx_L5_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 693, __pyx_L5_error) PyErr_Clear(); } break; @@ -17964,7 +17961,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 692, __pyx_L5_error) + __PYX_ERR(0, 693, __pyx_L5_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -17974,22 +17971,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L5_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L5_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 692, __pyx_L5_error) + 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, 692, __pyx_L5_error) + __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, 692, __pyx_L5_error) + __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, 692, __pyx_L5_error) + __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); @@ -17997,7 +17994,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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, 692, __pyx_L5_error) + 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; @@ -18005,7 +18002,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 692, __pyx_L5_error) + __PYX_ERR(0, 693, __pyx_L5_error) __pyx_L9_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_variable, __pyx_t_3); @@ -18013,7 +18010,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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, 692, __pyx_L5_error) + __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; { @@ -18021,13 +18018,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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, 692, __pyx_L5_error) + 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, 692, __pyx_L5_error) + __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, 692, __pyx_L5_error) + 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; @@ -18040,10 +18037,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc 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, 692, __pyx_L1_error) + 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":695 + /* "constraint/constraints.py":696 * * # preprocess the domains to remove values that cannot contribute to the sum * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -18056,7 +18053,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc 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, 695, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -18064,9 +18061,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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, 695, __pyx_L1_error) + __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, 695, __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, 696, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -18075,7 +18072,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 695, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 696, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -18085,7 +18082,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 695, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 696, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -18096,13 +18093,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error) + 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, 695, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 696, __pyx_L1_error) PyErr_Clear(); } break; @@ -18115,7 +18112,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 695, __pyx_L1_error) + __PYX_ERR(0, 696, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -18125,22 +18122,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 695, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 695, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __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, 695, __pyx_L1_error) + __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, 695, __pyx_L1_error) + __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 { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 695, __pyx_L1_error) + __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); @@ -18148,7 +18145,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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, 695, __pyx_L1_error) + 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; @@ -18156,7 +18153,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 695, __pyx_L1_error) + __PYX_ERR(0, 696, __pyx_L1_error) __pyx_L15_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); @@ -18164,19 +18161,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":696 + /* "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_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error) + __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":697 + /* "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) # <<<<<<<<<<<<<< @@ -18184,9 +18181,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if value * multiplier + other_vars_min > maxsum: */ __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, 697, __pyx_L1_error) + __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, 697, __pyx_L1_error) + __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 @@ -18206,29 +18203,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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, 697, __pyx_L1_error) + 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":698 + /* "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_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, 698, __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, 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, 698, __pyx_L1_error) + __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, 698, __pyx_L1_error) + __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 (;;) { @@ -18237,7 +18234,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 698, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 699, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -18247,7 +18244,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 698, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 699, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -18258,13 +18255,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error) + 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, 698, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 699, __pyx_L1_error) PyErr_Clear(); } break; @@ -18274,25 +18271,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":699 + /* "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_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error) + __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, 699, __pyx_L1_error) + __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, 699, __pyx_L1_error) + __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, 699, __pyx_L1_error) + __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":700 + /* "constraint/constraints.py":701 * for value in domain[:]: * if value * multiplier + other_vars_min > maxsum: * domain.remove(value) # <<<<<<<<<<<<<< @@ -18306,12 +18303,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc 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, 700, __pyx_L1_error) + 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":699 + /* "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: # <<<<<<<<<<<<<< @@ -18320,7 +18317,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc */ } - /* "constraint/constraints.py":698 + /* "constraint/constraints.py":699 * domain = domains[variable] * other_vars_min = sum_other_vars(variables, variable, self._var_min) * for value in domain[:]: # <<<<<<<<<<<<<< @@ -18330,7 +18327,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":695 + /* "constraint/constraints.py":696 * * # preprocess the domains to remove values that cannot contribute to the sum * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -18340,7 +18337,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":703 + /* "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 # <<<<<<<<<<<<<< @@ -18348,7 +18345,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * */ { /* enter inner scope */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L23_error) + __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; @@ -18356,7 +18353,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc 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, 703, __pyx_L23_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_3); } if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { @@ -18364,9 +18361,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L23_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, 703, __pyx_L23_error) + __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_3); __pyx_t_3 = 0; for (;;) { @@ -18375,7 +18372,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 703, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 704, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -18385,7 +18382,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 703, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 704, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -18396,13 +18393,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __pyx_L23_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L23_error) } else { __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, 703, __pyx_L23_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 704, __pyx_L23_error) PyErr_Clear(); } break; @@ -18415,7 +18412,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 703, __pyx_L23_error) + __PYX_ERR(0, 704, __pyx_L23_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -18425,22 +18422,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 703, __pyx_L23_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 704, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_9); __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L23_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_4); } #else - __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 703, __pyx_L23_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, 703, __pyx_L23_error) + __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); #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, 703, __pyx_L23_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_3); __pyx_t_3 = 0; __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); @@ -18448,7 +18445,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 703, __pyx_L23_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_L27_unpacking_done; @@ -18456,21 +18453,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 703, __pyx_L23_error) + __PYX_ERR(0, 704, __pyx_L23_error) __pyx_L27_unpacking_done:; } __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_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr13__pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L23_error) + __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, 703, __pyx_L23_error) + __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, 703, __pyx_L23_error) + __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; { @@ -18478,10 +18475,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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, 703, __pyx_L23_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_4); } - __pyx_t_10 = PyNumber_Multiply(__pyx_t_4, __pyx_9genexpr13__pyx_v_multiplier); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 703, __pyx_L23_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; __pyx_t_3 = __pyx_t_10; @@ -18490,7 +18487,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __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, 703, __pyx_L23_error) + 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; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -18503,10 +18500,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc 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, 703, __pyx_L1_error) + 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":704 + /* "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 } # <<<<<<<<<<<<<< @@ -18514,16 +18511,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * 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, 704, __pyx_L32_error) + __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_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L32_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, 704, __pyx_L32_error) + __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_8)) { @@ -18531,7 +18528,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 704, __pyx_L32_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 705, __pyx_L32_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -18541,7 +18538,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc { 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, 704, __pyx_L32_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 705, __pyx_L32_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -18552,13 +18549,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L32_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L32_error) } else { __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, 704, __pyx_L32_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 705, __pyx_L32_error) PyErr_Clear(); } break; @@ -18567,14 +18564,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_variable, __pyx_t_3); __pyx_t_3 = 0; - __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, 704, __pyx_L32_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); - __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_9genexpr14__pyx_v_variable); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 704, __pyx_L32_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, 704, __pyx_L32_error) + __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, 704, __pyx_L32_error) + 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; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -18585,10 +18582,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc 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, 704, __pyx_L1_error) + 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":688 + /* "constraint/constraints.py":689 * self._var_is_negative = {} * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -18626,7 +18623,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc return __pyx_r; } -/* "constraint/constraints.py":706 +/* "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 # <<<<<<<<<<<<<< @@ -18677,53 +18674,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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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, 706, __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; } @@ -18737,7 +18734,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, 706, __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:; @@ -18748,8 +18745,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, 706, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 706, __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 */ @@ -18800,31 +18797,31 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":707 + /* "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, 707, __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":708 + /* "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 * 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, 708, __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":709 + /* "constraint/constraints.py":710 * multipliers = self._multipliers * maxsum = self._maxsum * sum = 0 # <<<<<<<<<<<<<< @@ -18834,7 +18831,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":710 + /* "constraint/constraints.py":711 * maxsum = self._maxsum * sum = 0 * min_sum_missing = 0 # <<<<<<<<<<<<<< @@ -18844,7 +18841,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_min_sum_missing = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":711 + /* "constraint/constraints.py":712 * sum = 0 * min_sum_missing = 0 * missing = False # <<<<<<<<<<<<<< @@ -18853,7 +18850,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ __pyx_v_missing = 0; - /* "constraint/constraints.py":712 + /* "constraint/constraints.py":713 * min_sum_missing = 0 * missing = False * missing_negative = False # <<<<<<<<<<<<<< @@ -18862,17 +18859,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ __pyx_v_missing_negative = 0; - /* "constraint/constraints.py":713 + /* "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, 713, __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":714 + /* "constraint/constraints.py":715 * missing_negative = False * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -18885,7 +18882,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ 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, 714, __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)) { @@ -18893,9 +18890,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 714, __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, 714, __pyx_L1_error) + __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 (;;) { @@ -18904,7 +18901,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 714, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 715, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -18914,7 +18911,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 714, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 715, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -18925,13 +18922,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error) } else { __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, 714, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 715, __pyx_L1_error) PyErr_Clear(); } break; @@ -18944,7 +18941,7 @@ 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, 714, __pyx_L1_error) + __PYX_ERR(0, 715, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -18954,22 +18951,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 714, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 714, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 714, __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, 714, __pyx_L1_error) + __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, 714, __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); @@ -18977,7 +18974,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __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, 714, __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; @@ -18985,7 +18982,7 @@ 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, 714, __pyx_L1_error) + __PYX_ERR(0, 715, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_7); @@ -18993,35 +18990,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":715 + /* "constraint/constraints.py":716 * 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, 715, __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":716 + /* "constraint/constraints.py":717 * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< * 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, 716, __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, 716, __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, 716, __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":715 + /* "constraint/constraints.py":716 * if multipliers: * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: # <<<<<<<<<<<<<< @@ -19031,7 +19028,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ goto __pyx_L8; } - /* "constraint/constraints.py":718 + /* "constraint/constraints.py":719 * sum += assignments[variable] * multiplier * else: * min_sum_missing += self._var_min[variable] # <<<<<<<<<<<<<< @@ -19039,18 +19036,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * 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, 718, __pyx_L1_error) + __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, 718, __pyx_L1_error) + __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, 718, __pyx_L1_error) + __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":719 + /* "constraint/constraints.py":720 * else: * min_sum_missing += self._var_min[variable] * missing = True # <<<<<<<<<<<<<< @@ -19059,23 +19056,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ __pyx_v_missing = 1; - /* "constraint/constraints.py":720 + /* "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, 720, __pyx_L1_error) + __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, 720, __pyx_L1_error) + __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, 720, __pyx_L1_error) + __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":721 + /* "constraint/constraints.py":722 * missing = True * if self._var_is_negative[variable]: * missing_negative = True # <<<<<<<<<<<<<< @@ -19084,7 +19081,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ __pyx_v_missing_negative = 1; - /* "constraint/constraints.py":720 + /* "constraint/constraints.py":721 * min_sum_missing += self._var_min[variable] * missing = True * if self._var_is_negative[variable]: # <<<<<<<<<<<<<< @@ -19095,7 +19092,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __pyx_L8:; - /* "constraint/constraints.py":714 + /* "constraint/constraints.py":715 * missing_negative = False * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -19105,7 +19102,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":722 + /* "constraint/constraints.py":723 * if self._var_is_negative[variable]: * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -19115,7 +19112,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_t_2 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_2) { - /* "constraint/constraints.py":723 + /* "constraint/constraints.py":724 * missing_negative = True * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< @@ -19128,13 +19125,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ 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, 723, __pyx_L1_error) + 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_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":722 + /* "constraint/constraints.py":723 * if self._var_is_negative[variable]: * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -19143,22 +19140,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":724 + /* "constraint/constraints.py":725 * if isinstance(sum, float): * sum = round(sum, 10) * if sum + min_sum_missing > maxsum: # <<<<<<<<<<<<<< * return False * if forwardcheck and missing and not missing_negative: */ - __pyx_t_3 = PyNumber_Add(__pyx_v_sum, __pyx_v_min_sum_missing); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 724, __pyx_L1_error) + __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, 724, __pyx_L1_error) + __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, 724, __pyx_L1_error) + __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":725 + /* "constraint/constraints.py":726 * sum = round(sum, 10) * if sum + min_sum_missing > maxsum: * return False # <<<<<<<<<<<<<< @@ -19170,7 +19167,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":724 + /* "constraint/constraints.py":725 * if isinstance(sum, float): * sum = round(sum, 10) * if sum + min_sum_missing > maxsum: # <<<<<<<<<<<<<< @@ -19179,14 +19176,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":726 + /* "constraint/constraints.py":727 * if sum + min_sum_missing > maxsum: * return False * 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, 726, __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; @@ -19202,7 +19199,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_L14_bool_binop_done:; if (__pyx_t_2) { - /* "constraint/constraints.py":727 + /* "constraint/constraints.py":728 * return False * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -19215,7 +19212,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ 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, 727, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { @@ -19223,9 +19220,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 727, __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, 727, __pyx_L1_error) + __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_8); __pyx_t_8 = 0; for (;;) { @@ -19234,7 +19231,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 727, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 728, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -19244,7 +19241,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 727, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 728, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -19255,13 +19252,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 727, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 728, __pyx_L1_error) } else { __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, 727, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 728, __pyx_L1_error) PyErr_Clear(); } break; @@ -19274,7 +19271,7 @@ 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, 727, __pyx_L1_error) + __PYX_ERR(0, 728, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -19284,22 +19281,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_INCREF(__pyx_t_7); } else { __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 727, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); } #else - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error) + __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, 727, __pyx_L1_error) + __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_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 727, __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_8); __pyx_t_8 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); @@ -19307,7 +19304,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __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, 727, __pyx_L1_error) + 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_L20_unpacking_done; @@ -19315,7 +19312,7 @@ 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, 727, __pyx_L1_error) + __PYX_ERR(0, 728, __pyx_L1_error) __pyx_L20_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); @@ -19323,45 +19320,45 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":728 + /* "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, 728, __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":729 + /* "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_8 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 729, __pyx_L1_error) + __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":730 + /* "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_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, 730, __pyx_L1_error) + __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_12 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 730, __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, 730, __pyx_L1_error) + __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_8); __pyx_t_8 = 0; for (;;) { @@ -19370,7 +19367,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__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, 730, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 731, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -19380,7 +19377,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 730, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 731, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -19391,13 +19388,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 730, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 731, __pyx_L1_error) } else { __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, 730, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 731, __pyx_L1_error) PyErr_Clear(); } break; @@ -19407,25 +19404,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":731 + /* "constraint/constraints.py":732 * domain = domains[variable] * for value in domain[:]: * if sum + value * multiplier > maxsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ - __pyx_t_8 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 731, __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_t_1 = PyNumber_Add(__pyx_v_sum, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __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, 731, __pyx_L1_error) + __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, 731, __pyx_L1_error) + __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; if (__pyx_t_2) { - /* "constraint/constraints.py":732 + /* "constraint/constraints.py":733 * for value in domain[:]: * if sum + value * multiplier > maxsum: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -19439,12 +19436,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ 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, 732, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":731 + /* "constraint/constraints.py":732 * domain = domains[variable] * for value in domain[:]: * if sum + value * multiplier > maxsum: # <<<<<<<<<<<<<< @@ -19453,7 +19450,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":730 + /* "constraint/constraints.py":731 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -19463,18 +19460,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":733 + /* "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, 733, __pyx_L1_error) + __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":734 + /* "constraint/constraints.py":735 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -19487,7 +19484,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "constraint/constraints.py":733 + /* "constraint/constraints.py":734 * if sum + value * multiplier > maxsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -19496,7 +19493,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":728 + /* "constraint/constraints.py":729 * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: # <<<<<<<<<<<<<< @@ -19505,7 +19502,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":727 + /* "constraint/constraints.py":728 * return False * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< @@ -19515,7 +19512,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":726 + /* "constraint/constraints.py":727 * if sum + min_sum_missing > maxsum: * return False * if forwardcheck and missing and not missing_negative: # <<<<<<<<<<<<<< @@ -19524,7 +19521,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":713 + /* "constraint/constraints.py":714 * missing = False * missing_negative = False * if multipliers: # <<<<<<<<<<<<<< @@ -19534,7 +19531,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ goto __pyx_L3; } - /* "constraint/constraints.py":736 + /* "constraint/constraints.py":737 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -19547,9 +19544,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 736, __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, 736, __pyx_L1_error) + __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_6)) { @@ -19557,7 +19554,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 736, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 737, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -19567,7 +19564,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 736, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 737, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -19578,13 +19575,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 736, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 737, __pyx_L1_error) } else { __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, 736, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 737, __pyx_L1_error) PyErr_Clear(); } break; @@ -19594,32 +19591,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":737 + /* "constraint/constraints.py":738 * 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, 737, __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, 738, __pyx_L1_error) if (__pyx_t_11) { - /* "constraint/constraints.py":738 + /* "constraint/constraints.py":739 * for variable in variables: * if variable in assignments: * sum += assignments[variable] # <<<<<<<<<<<<<< * else: * min_sum_missing += self._var_min[variable] */ - __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 738, __pyx_L1_error) + __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, 738, __pyx_L1_error) + __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":737 + /* "constraint/constraints.py":738 * else: * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -19629,7 +19626,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ goto __pyx_L30; } - /* "constraint/constraints.py":740 + /* "constraint/constraints.py":741 * sum += assignments[variable] * else: * min_sum_missing += self._var_min[variable] # <<<<<<<<<<<<<< @@ -19637,18 +19634,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * 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, 740, __pyx_L1_error) + __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, 740, __pyx_L1_error) + __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, 740, __pyx_L1_error) + __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":741 + /* "constraint/constraints.py":742 * else: * min_sum_missing += self._var_min[variable] * missing = True # <<<<<<<<<<<<<< @@ -19657,23 +19654,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ __pyx_v_missing = 1; - /* "constraint/constraints.py":742 + /* "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, 742, __pyx_L1_error) + __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, 742, __pyx_L1_error) + __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, 742, __pyx_L1_error) + __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":743 + /* "constraint/constraints.py":744 * missing = True * if self._var_is_negative[variable]: * missing_negative = True # <<<<<<<<<<<<<< @@ -19682,7 +19679,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ __pyx_v_missing_negative = 1; - /* "constraint/constraints.py":742 + /* "constraint/constraints.py":743 * min_sum_missing += self._var_min[variable] * missing = True * if self._var_is_negative[variable]: # <<<<<<<<<<<<<< @@ -19693,7 +19690,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __pyx_L30:; - /* "constraint/constraints.py":736 + /* "constraint/constraints.py":737 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -19703,7 +19700,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":744 + /* "constraint/constraints.py":745 * if self._var_is_negative[variable]: * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -19713,7 +19710,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_t_11 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_11) { - /* "constraint/constraints.py":745 + /* "constraint/constraints.py":746 * missing_negative = True * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< @@ -19726,13 +19723,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ 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, 745, __pyx_L1_error) + 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_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":744 + /* "constraint/constraints.py":745 * if self._var_is_negative[variable]: * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< @@ -19741,22 +19738,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":746 + /* "constraint/constraints.py":747 * if isinstance(sum, float): * sum = round(sum, 10) * if sum + min_sum_missing > maxsum: # <<<<<<<<<<<<<< * return False * if forwardcheck and missing and not missing_negative: */ - __pyx_t_3 = PyNumber_Add(__pyx_v_sum, __pyx_v_min_sum_missing); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error) + __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, 746, __pyx_L1_error) + __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, 746, __pyx_L1_error) + __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":747 + /* "constraint/constraints.py":748 * sum = round(sum, 10) * if sum + min_sum_missing > maxsum: * return False # <<<<<<<<<<<<<< @@ -19768,7 +19765,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":746 + /* "constraint/constraints.py":747 * if isinstance(sum, float): * sum = round(sum, 10) * if sum + min_sum_missing > maxsum: # <<<<<<<<<<<<<< @@ -19777,14 +19774,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":748 + /* "constraint/constraints.py":749 * if sum + min_sum_missing > maxsum: * return False * 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, 748, __pyx_L1_error) + __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; @@ -19800,7 +19797,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_L36_bool_binop_done:; if (__pyx_t_11) { - /* "constraint/constraints.py":749 + /* "constraint/constraints.py":750 * return False * if forwardcheck and missing and not missing_negative: * for variable in variables: # <<<<<<<<<<<<<< @@ -19812,9 +19809,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 749, __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, 749, __pyx_L1_error) + __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_6)) { @@ -19822,7 +19819,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__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, 749, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 750, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -19832,7 +19829,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 749, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 750, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -19843,13 +19840,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 750, __pyx_L1_error) } else { __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, 749, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 750, __pyx_L1_error) PyErr_Clear(); } break; @@ -19859,45 +19856,45 @@ 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":750 + /* "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_11 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 750, __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, 751, __pyx_L1_error) if (__pyx_t_11) { - /* "constraint/constraints.py":751 + /* "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, 751, __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":752 + /* "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, 752, __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_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, 752, __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, 752, __pyx_L1_error) + __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 (;;) { @@ -19906,7 +19903,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 752, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 753, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -19916,7 +19913,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ { 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, 752, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 753, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -19927,13 +19924,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 752, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __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, 752, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 753, __pyx_L1_error) PyErr_Clear(); } break; @@ -19943,22 +19940,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":753 + /* "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, 753, __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_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __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_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 753, __pyx_L1_error) + __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":754 + /* "constraint/constraints.py":755 * for value in domain[:]: * if sum + value > maxsum: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -19972,12 +19969,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ PyObject *__pyx_callargs[2] = {__pyx_t_3, __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":753 + /* "constraint/constraints.py":754 * domain = domains[variable] * for value in domain[:]: * if sum + value > maxsum: # <<<<<<<<<<<<<< @@ -19986,7 +19983,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":752 + /* "constraint/constraints.py":753 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -19996,18 +19993,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":755 + /* "constraint/constraints.py":756 * if sum + value > maxsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False * return True */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 755, __pyx_L1_error) + __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":756 + /* "constraint/constraints.py":757 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -20020,7 +20017,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/constraints.py":755 + /* "constraint/constraints.py":756 * if sum + value > maxsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -20029,7 +20026,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":750 + /* "constraint/constraints.py":751 * if forwardcheck and missing and not missing_negative: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -20038,7 +20035,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":749 + /* "constraint/constraints.py":750 * return False * if forwardcheck and missing and not missing_negative: * for variable in variables: # <<<<<<<<<<<<<< @@ -20048,7 +20045,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":748 + /* "constraint/constraints.py":749 * if sum + min_sum_missing > maxsum: * return False * if forwardcheck and missing and not missing_negative: # <<<<<<<<<<<<<< @@ -20059,7 +20056,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __pyx_L3:; - /* "constraint/constraints.py":757 + /* "constraint/constraints.py":758 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -20071,7 +20068,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":706 + /* "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 # <<<<<<<<<<<<<< @@ -20102,10 +20099,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ return __pyx_r; } -/* "constraint/constraints.py":777 +/* "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. * */ @@ -20153,47 +20150,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, 777, __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, 777, __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, 777, __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, 777, __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, 777, __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, 777, __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, 777, __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, 777, __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, 777, __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, 777, __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, 777, __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; } @@ -20206,7 +20203,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, 777, __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:; @@ -20217,7 +20214,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, 777, __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 */ @@ -20238,7 +20235,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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":793 +/* "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." # <<<<<<<<<<<<<< @@ -20258,7 +20255,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ 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, 793, __pyx_L1_error) + __PYX_ERR(0, 794, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -20266,7 +20263,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___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, 793, __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; @@ -20304,16 +20301,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 793, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 793, __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, 793, __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, 793, __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)) { @@ -20321,7 +20318,7 @@ 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, 793, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 794, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -20331,7 +20328,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 793, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 794, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -20342,13 +20339,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 793, __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, 793, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 794, __pyx_L1_error) PyErr_Clear(); } break; @@ -20406,10 +20403,10 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":777 +/* "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. * */ @@ -20428,44 +20425,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":787 + /* "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, 787, __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":788 + /* "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, 788, __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":789 + /* "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, 789, __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":791 + /* "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, 791, __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":792 + /* "constraint/constraints.py":793 * * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." # <<<<<<<<<<<<<< @@ -20474,19 +20471,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, 792, __pyx_L1_error) - __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 792, __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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Multipliers_must_match_sum_varia, 0, 0); - __PYX_ERR(0, 792, __pyx_L1_error) + __PYX_ERR(0, 793, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 792, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 793, __pyx_L1_error) #endif - /* "constraint/constraints.py":793 + /* "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." # <<<<<<<<<<<<<< @@ -20495,23 +20492,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, 793, __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, 793, __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, 793, __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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Multipliers_must_be_numbers, 0, 0); - __PYX_ERR(0, 793, __pyx_L1_error) + __PYX_ERR(0, 794, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 793, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 794, __pyx_L1_error) #endif - /* "constraint/constraints.py":794 + /* "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." # <<<<<<<<<<<<<< @@ -20520,20 +20517,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, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 794, __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, 794, __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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Last_multiplier_must_be_1_as_it, 0, 0); - __PYX_ERR(0, 794, __pyx_L1_error) + __PYX_ERR(0, 795, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 794, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 795, __pyx_L1_error) #endif - /* "constraint/constraints.py":791 + /* "constraint/constraints.py":792 * self._multipliers = multipliers * * if multipliers: # <<<<<<<<<<<<<< @@ -20542,10 +20539,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":777 + /* "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. * */ @@ -20565,7 +20562,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":796 +/* "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 # <<<<<<<<<<<<<< @@ -20616,50 +20613,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, 796, __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, 796, __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, 796, __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, 796, __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, 796, __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, 796, __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, 796, __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, 796, __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, 796, __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, 796, __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, 796, __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, 796, __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, 796, __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]; @@ -20669,7 +20666,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, 796, __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:; @@ -20680,9 +20677,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, 796, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 796, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 796, __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 */ @@ -20703,7 +20700,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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":804 +/* "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) # <<<<<<<<<<<<<< @@ -20723,7 +20720,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 804, __pyx_L1_error) + __PYX_ERR(0, 805, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -20734,7 +20731,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_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, 804, __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; @@ -20777,17 +20774,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, 804, __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, 804, __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, 804, __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, 804, __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)) { @@ -20795,7 +20792,7 @@ 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, 804, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 805, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -20805,7 +20802,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 804, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 805, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -20816,13 +20813,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 804, __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, 804, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 805, __pyx_L1_error) PyErr_Clear(); } break; @@ -20833,18 +20830,18 @@ 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, 804, __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, 804, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 804, __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; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains)) { __Pyx_RaiseClosureNameError("domains"); __PYX_ERR(0, 804, __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, 804, __pyx_L1_error) + __PYX_ERR(0, 805, __pyx_L1_error) } - __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, 804, __pyx_L1_error) + __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; { @@ -20852,7 +20849,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ __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_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 804, __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; @@ -20873,7 +20870,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, 804, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 805, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -20902,7 +20899,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":796 +/* "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 # <<<<<<<<<<<<<< @@ -20941,7 +20938,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 796, __pyx_L1_error) + __PYX_ERR(0, 797, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -20949,7 +20946,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":797 + /* "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) # <<<<<<<<<<<<<< @@ -20957,9 +20954,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, 797, __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, 797, __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; @@ -20979,51 +20976,51 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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, 797, __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":799 + /* "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, 799, __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":801 + /* "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, 801, __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":802 + /* "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, 802, __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, 802, __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, 802, __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 (;;) { @@ -21032,7 +21029,7 @@ 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, 802, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 803, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -21042,7 +21039,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 802, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 803, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -21053,13 +21050,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 802, __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, 802, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 803, __pyx_L1_error) PyErr_Clear(); } break; @@ -21071,19 +21068,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":803 + /* "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, 803, __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":804 + /* "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) # <<<<<<<<<<<<<< @@ -21091,9 +21088,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ * if value + others_min > max(domains[self.target_var]): */ __pyx_t_2 = NULL; - __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, 804, __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, 804, __pyx_L1_error) + __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -21102,29 +21099,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error) + 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":805 + /* "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, 805, __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_10 = __pyx_t_1; __Pyx_INCREF(__pyx_t_10); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 805, __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, 805, __pyx_L1_error) + __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 (;;) { @@ -21133,7 +21130,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 805, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 806, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -21143,7 +21140,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 805, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 806, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -21154,13 +21151,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 805, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 806, __pyx_L1_error) } else { __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, 805, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 806, __pyx_L1_error) PyErr_Clear(); } break; @@ -21170,19 +21167,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":806 + /* "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, 806, __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_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, 806, __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, 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, 806, __pyx_L1_error) + __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_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_5 = 1; @@ -21191,17 +21188,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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, 806, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __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, 806, __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_2); __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 806, __pyx_L1_error) + __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":807 + /* "constraint/constraints.py":808 * for value in domain[:]: * if value + others_min > max(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< @@ -21215,12 +21212,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ 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, 807, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "constraint/constraints.py":806 + /* "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]): # <<<<<<<<<<<<<< @@ -21229,7 +21226,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":805 + /* "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[:]: # <<<<<<<<<<<<<< @@ -21239,7 +21236,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "constraint/constraints.py":802 + /* "constraint/constraints.py":803 * * if not multipliers: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -21249,7 +21246,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":801 + /* "constraint/constraints.py":802 * multipliers = self._multipliers * * if not multipliers: # <<<<<<<<<<<<<< @@ -21258,7 +21255,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":796 + /* "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 # <<<<<<<<<<<<<< @@ -21291,7 +21288,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":809 +/* "constraint/constraints.py":810 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -21342,53 +21339,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, 809, __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, 809, __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, 809, __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, 809, __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, 809, __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, 809, __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, 809, __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, 809, __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, 809, __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, 809, __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, 809, __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, 809, __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, 809, __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; } @@ -21402,7 +21399,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, 809, __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:; @@ -21413,8 +21410,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, 809, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 809, __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 */ @@ -21457,32 +21454,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":810 + /* "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, 810, __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":812 + /* "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, 812, __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, 812, __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":813 + /* "constraint/constraints.py":814 * * if self.target_var not in assignments: * return True # can't evaluate without target, defer to later # <<<<<<<<<<<<<< @@ -21494,7 +21491,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":812 + /* "constraint/constraints.py":813 * multipliers = self._multipliers * * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -21503,22 +21500,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":815 + /* "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, 815, __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, 815, __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":816 + /* "constraint/constraints.py":817 * * target_value = assignments[self.target_var] * sum_value = 0 # <<<<<<<<<<<<<< @@ -21528,17 +21525,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":818 + /* "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, 818, __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":819 + /* "constraint/constraints.py":820 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -21546,7 +21543,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ * sum_value += assignments[var] * multiplier */ __pyx_t_1 = 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, 819, __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, 820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; { @@ -21554,7 +21551,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __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)) { @@ -21562,9 +21559,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 819, __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_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 819, __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 (;;) { @@ -21573,7 +21570,7 @@ 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, 819, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 820, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -21583,7 +21580,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 819, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 820, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -21594,13 +21591,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 820, __pyx_L1_error) } else { __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, 819, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 820, __pyx_L1_error) PyErr_Clear(); } break; @@ -21613,7 +21610,7 @@ 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, 819, __pyx_L1_error) + __PYX_ERR(0, 820, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -21623,22 +21620,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 819, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __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, 819, __pyx_L1_error) + __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, 819, __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); @@ -21646,7 +21643,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_GOTREF(__pyx_t_1); 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, 819, __pyx_L1_error) + 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; @@ -21654,7 +21651,7 @@ 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, 819, __pyx_L1_error) + __PYX_ERR(0, 820, __pyx_L1_error) __pyx_L8_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); @@ -21662,35 +21659,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":820 + /* "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, 820, __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":821 + /* "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, 821, __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_8 = PyNumber_Multiply(__pyx_t_3, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 821, __pyx_L1_error) + __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_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 821, __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_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":820 + /* "constraint/constraints.py":821 * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: # <<<<<<<<<<<<<< @@ -21700,7 +21697,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ goto __pyx_L9; } - /* "constraint/constraints.py":823 + /* "constraint/constraints.py":824 * sum_value += assignments[var] * multiplier * else: * sum_value += min(domains[var] * multiplier) # use min value if not assigned # <<<<<<<<<<<<<< @@ -21709,9 +21706,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ /*else*/ { __pyx_t_8 = NULL; - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 823, __pyx_L1_error) + __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, 823, __pyx_L1_error) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = 1; @@ -21720,10 +21717,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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, 823, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 823, __pyx_L1_error) + __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_9); @@ -21731,7 +21728,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __pyx_L9:; - /* "constraint/constraints.py":819 + /* "constraint/constraints.py":820 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -21741,7 +21738,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":818 + /* "constraint/constraints.py":819 * sum_value = 0 * * if multipliers: # <<<<<<<<<<<<<< @@ -21751,7 +21748,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ goto __pyx_L4; } - /* "constraint/constraints.py":825 + /* "constraint/constraints.py":826 * sum_value += min(domains[var] * multiplier) # use min value if not assigned * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -21759,16 +21756,16 @@ 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, 825, __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_9 = __pyx_t_4; __Pyx_INCREF(__pyx_t_9); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 825, __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, 825, __pyx_L1_error) + __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 (;;) { @@ -21777,7 +21774,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 825, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 826, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -21787,7 +21784,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ { 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, 825, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 826, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -21798,13 +21795,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 825, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error) } else { __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, 825, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 826, __pyx_L1_error) PyErr_Clear(); } break; @@ -21814,32 +21811,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":826 + /* "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, 826, __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":827 + /* "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, 827, __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, 827, __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":826 + /* "constraint/constraints.py":827 * else: * for var in self.sum_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -21849,7 +21846,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ goto __pyx_L13; } - /* "constraint/constraints.py":829 + /* "constraint/constraints.py":830 * sum_value += assignments[var] * else: * sum_value += min(domains[var]) # use min value if not assigned # <<<<<<<<<<<<<< @@ -21858,7 +21855,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ /*else*/ { __pyx_t_4 = NULL; - __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 829, __pyx_L1_error) + __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; { @@ -21866,10 +21863,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __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_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 829, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 829, __pyx_L1_error) + __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_8); @@ -21877,7 +21874,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __pyx_L13:; - /* "constraint/constraints.py":825 + /* "constraint/constraints.py":826 * sum_value += min(domains[var] * multiplier) # use min value if not assigned * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -21889,7 +21886,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __pyx_L4:; - /* "constraint/constraints.py":831 + /* "constraint/constraints.py":832 * sum_value += min(domains[var]) # use min value if not assigned * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -21899,7 +21896,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __pyx_t_2 = PyFloat_Check(__pyx_v_sum_value); if (__pyx_t_2) { - /* "constraint/constraints.py":832 + /* "constraint/constraints.py":833 * * if isinstance(sum_value, float): * sum_value = round(sum_value, 10) # <<<<<<<<<<<<<< @@ -21912,13 +21909,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ 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, 832, __pyx_L1_error) + 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_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":831 + /* "constraint/constraints.py":832 * sum_value += min(domains[var]) # use min value if not assigned * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -21927,7 +21924,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":834 + /* "constraint/constraints.py":835 * sum_value = round(sum_value, 10) * * return sum_value <= target_value # <<<<<<<<<<<<<< @@ -21935,12 +21932,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ * */ __Pyx_XDECREF(__pyx_r); - __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, 834, __pyx_L1_error) + __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":809 + /* "constraint/constraints.py":810 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -21968,10 +21965,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":853 +/* "constraint/constraints.py":854 * """ * - * def __init__(self, exactprod: Union[int, float]): # <<<<<<<<<<<<<< + * def __init__(self, exactprod: int | float): # <<<<<<<<<<<<<< * """Instantiate an ExactProdConstraint. * */ @@ -22017,39 +22014,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, 853, __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, 853, __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, 853, __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, 853, __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, 853, __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, 853, __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, 853, __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, 853, __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:; @@ -22079,31 +22076,31 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint___ini int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":859 + /* "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, 859, __pyx_L1_error) + 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":860 + /* "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 */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 860, __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, 860, __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, 861, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":853 + /* "constraint/constraints.py":854 * """ * - * def __init__(self, exactprod: Union[int, float]): # <<<<<<<<<<<<<< + * def __init__(self, exactprod: int | float): # <<<<<<<<<<<<<< * """Instantiate an ExactProdConstraint. * */ @@ -22121,7 +22118,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint___ini return __pyx_r; } -/* "constraint/constraints.py":862 +/* "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 # <<<<<<<<<<<<<< @@ -22172,50 +22169,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, 862, __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, 862, __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, 862, __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, 862, __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, 862, __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, 862, __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, 862, __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, 862, __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, 862, __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, 862, __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, 862, __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, 862, __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, 862, __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]; @@ -22225,7 +22222,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, 862, __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:; @@ -22236,9 +22233,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, 862, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 862, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 862, __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 */ @@ -22259,7 +22256,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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":869 +/* "constraint/constraints.py":870 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -22279,7 +22276,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_10pre if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 869, __pyx_L1_error) + __PYX_ERR(0, 870, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -22287,7 +22284,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_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, 869, __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; @@ -22324,16 +22321,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 869, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 869, __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, 869, __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, 869, __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)) { @@ -22341,7 +22338,7 @@ 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, 869, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 870, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -22351,7 +22348,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre { 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, 869, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 870, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -22362,13 +22359,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 869, __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, 869, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 870, __pyx_L1_error) PyErr_Clear(); } break; @@ -22379,8 +22376,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, 869, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 869, __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); @@ -22419,7 +22416,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre return __pyx_r; } -/* "constraint/constraints.py":862 +/* "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 # <<<<<<<<<<<<<< @@ -22456,7 +22453,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":863 + /* "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) # <<<<<<<<<<<<<< @@ -22464,9 +22461,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, 863, __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, 863, __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; @@ -22486,24 +22483,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __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, 863, __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":866 + /* "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, 866, __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, 866, __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":867 + /* "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 # <<<<<<<<<<<<<< @@ -22513,7 +22510,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_INCREF(Py_None); __pyx_v_variable_with_lt1 = Py_None; - /* "constraint/constraints.py":868 + /* "constraint/constraints.py":869 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -22525,9 +22522,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, 868, __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, 868, __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)) { @@ -22535,7 +22532,7 @@ 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, 868, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 869, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -22545,7 +22542,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { 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, 868, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 869, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -22556,13 +22553,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 868, __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, 868, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 869, __pyx_L1_error) PyErr_Clear(); } break; @@ -22572,37 +22569,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":869 + /* "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, 869, __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, 869, __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, 869, __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":870 + /* "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, 870, __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, 870, __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":868 + /* "constraint/constraints.py":869 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -22612,7 +22609,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":871 + /* "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): # <<<<<<<<<<<<<< @@ -22620,7 +22617,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP * if variable_with_lt1 is not None: */ __pyx_t_4 = NULL; - __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, 871, __pyx_L1_error) + __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; { @@ -22628,7 +22625,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __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_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __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)) { @@ -22636,9 +22633,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, 871, __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, 871, __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 (;;) { @@ -22647,7 +22644,7 @@ 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, 871, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 872, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -22657,7 +22654,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { 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, 871, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 872, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -22668,13 +22665,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __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, 871, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 872, __pyx_L1_error) PyErr_Clear(); } break; @@ -22687,7 +22684,7 @@ 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, 871, __pyx_L1_error) + __PYX_ERR(0, 872, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -22697,22 +22694,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 871, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 872, __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, 871, __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, 871, __pyx_L1_error) + __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, 871, __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); @@ -22720,7 +22717,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_GOTREF(__pyx_t_4); 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, 871, __pyx_L1_error) + 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; @@ -22728,7 +22725,7 @@ 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, 871, __pyx_L1_error) + __PYX_ERR(0, 872, __pyx_L1_error) __pyx_L9_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); @@ -22736,7 +22733,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":872 + /* "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: # <<<<<<<<<<<<<< @@ -22746,7 +22743,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":873 + /* "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: # <<<<<<<<<<<<<< @@ -22756,7 +22753,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":875 + /* "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 # <<<<<<<<<<<<<< @@ -22768,7 +22765,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/constraints.py":873 + /* "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: # <<<<<<<<<<<<<< @@ -22777,7 +22774,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ } - /* "constraint/constraints.py":876 + /* "constraint/constraints.py":877 * # if more than one associated variables contain less than 1, we can't prune * return * variable_with_lt1 = variable # <<<<<<<<<<<<<< @@ -22787,7 +22784,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":872 + /* "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: # <<<<<<<<<<<<<< @@ -22796,7 +22793,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ } - /* "constraint/constraints.py":871 + /* "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): # <<<<<<<<<<<<<< @@ -22806,19 +22803,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":879 + /* "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, 879, __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":880 + /* "constraint/constraints.py":881 * # prune the associated variables of values > exactprod * exactprod = self._exactprod * for variable in variables: # <<<<<<<<<<<<<< @@ -22830,9 +22827,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, 880, __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, 880, __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)) { @@ -22840,7 +22837,7 @@ 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, 880, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 881, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -22850,7 +22847,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { 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, 880, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 881, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -22861,13 +22858,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __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, 880, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 881, __pyx_L1_error) PyErr_Clear(); } break; @@ -22877,7 +22874,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":881 + /* "constraint/constraints.py":882 * exactprod = self._exactprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -22890,14 +22887,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, 881, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 881, __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":882 + /* "constraint/constraints.py":883 * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: * continue # <<<<<<<<<<<<<< @@ -22906,7 +22903,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ goto __pyx_L13_continue; - /* "constraint/constraints.py":881 + /* "constraint/constraints.py":882 * exactprod = self._exactprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -22915,35 +22912,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ } - /* "constraint/constraints.py":883 + /* "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, 883, __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":884 + /* "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, 884, __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_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, 884, __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, 884, __pyx_L1_error) + __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 (;;) { @@ -22952,7 +22949,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { 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, 884, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 885, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -22962,7 +22959,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { 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, 884, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 885, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -22973,13 +22970,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif ++__pyx_t_13; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 885, __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, 884, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 885, __pyx_L1_error) PyErr_Clear(); } break; @@ -22989,19 +22986,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":885 + /* "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, 885, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 885, __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":886 + /* "constraint/constraints.py":887 * for value in domain[:]: * if value > exactprod: * domain.remove(value) # <<<<<<<<<<<<<< @@ -23015,12 +23012,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP 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, 886, __pyx_L1_error) + 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":885 + /* "constraint/constraints.py":886 * domain = domains[variable] * for value in domain[:]: * if value > exactprod: # <<<<<<<<<<<<<< @@ -23030,25 +23027,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP goto __pyx_L20; } - /* "constraint/constraints.py":887 + /* "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, 887, __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, 887, __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":888 + /* "constraint/constraints.py":889 * domain.remove(value) * elif value == 0 and exactprod != 0: * domain.remove(value) # <<<<<<<<<<<<<< @@ -23062,12 +23059,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP 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, 888, __pyx_L1_error) + 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":887 + /* "constraint/constraints.py":888 * if value > exactprod: * domain.remove(value) * elif value == 0 and exactprod != 0: # <<<<<<<<<<<<<< @@ -23077,7 +23074,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __pyx_L20:; - /* "constraint/constraints.py":884 + /* "constraint/constraints.py":885 * continue * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -23087,7 +23084,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":880 + /* "constraint/constraints.py":881 * # prune the associated variables of values > exactprod * exactprod = self._exactprod * for variable in variables: # <<<<<<<<<<<<<< @@ -23098,7 +23095,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":862 + /* "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 # <<<<<<<<<<<<<< @@ -23130,7 +23127,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP return __pyx_r; } -/* "constraint/constraints.py":890 +/* "constraint/constraints.py":891 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -23181,53 +23178,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, 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, 890, __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, 890, __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, 890, __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, 890, __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, 890, __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, 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, 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, 890, __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, 890, __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, 890, __pyx_L3_error) + 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, 890, __pyx_L3_error) + 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, 890, __pyx_L3_error) + 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, 890, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 891, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -23241,7 +23238,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, 891, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -23252,8 +23249,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, 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 */ @@ -23274,7 +23271,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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":898 +/* "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])) # <<<<<<<<<<<<<< @@ -23294,7 +23291,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_8__ca 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, 898, __pyx_L1_error) + __PYX_ERR(0, 899, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -23302,7 +23299,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_8__ca __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, 898, __pyx_L1_error) + __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; @@ -23339,16 +23336,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__ca return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 898, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 898, __pyx_L1_error) } + 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, 898, __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, 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, 898, __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, 899, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -23356,7 +23353,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__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, 898, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 899, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -23366,7 +23363,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__ca { 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, 899, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -23377,13 +23374,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__ca #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 898, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 899, __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, 898, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 899, __pyx_L1_error) PyErr_Clear(); } break; @@ -23394,8 +23391,8 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__ca __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, 898, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 898, __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, 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); @@ -23434,7 +23431,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__ca return __pyx_r; } -/* "constraint/constraints.py":890 +/* "constraint/constraints.py":891 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -23473,19 +23470,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":891 + /* "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, 891, __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":892 + /* "constraint/constraints.py":893 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * exactprod = self._exactprod * prod = 1 # <<<<<<<<<<<<<< @@ -23495,7 +23492,7 @@ 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":893 + /* "constraint/constraints.py":894 * exactprod = self._exactprod * prod = 1 * missing = False # <<<<<<<<<<<<<< @@ -23504,34 +23501,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ __pyx_v_missing = 0; - /* "constraint/constraints.py":894 + /* "constraint/constraints.py":895 * 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): */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 894, __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":896 + /* "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, 896, __pyx_L1_error) + __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, 896, __pyx_L1_error) + __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, 896, __pyx_L1_error) + __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":897 + /* "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: # <<<<<<<<<<<<<< @@ -23543,9 +23540,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __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, 897, __pyx_L1_error) + __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, 897, __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, 898, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { @@ -23553,7 +23550,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__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, 897, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 898, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -23563,7 +23560,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca { 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, 897, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 898, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -23574,13 +23571,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 897, __pyx_L1_error) + 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, 897, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 898, __pyx_L1_error) PyErr_Clear(); } break; @@ -23590,28 +23587,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":898 + /* "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, 898, __pyx_L1_error) + __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, 898, __pyx_L1_error) + __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, 898, __pyx_L1_error) + __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, 898, __pyx_L1_error) + __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, 898, __pyx_L1_error) + __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":897 + /* "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: # <<<<<<<<<<<<<< @@ -23621,7 +23618,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":896 + /* "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): # <<<<<<<<<<<<<< @@ -23630,7 +23627,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":899 + /* "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): # <<<<<<<<<<<<<< @@ -23638,7 +23635,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca * prod *= assignments[variable] */ __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, 899, __pyx_L1_error) + __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; { @@ -23646,7 +23643,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __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, 899, __pyx_L1_error) + 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)) { @@ -23654,9 +23651,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_t_3 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 899, __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, 899, __pyx_L1_error) + __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 (;;) { @@ -23665,7 +23662,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__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, 899, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 900, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -23675,7 +23672,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca { 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, 899, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 900, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -23686,13 +23683,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error) } else { __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, 899, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 900, __pyx_L1_error) PyErr_Clear(); } break; @@ -23705,7 +23702,7 @@ 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, 899, __pyx_L1_error) + __PYX_ERR(0, 900, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -23715,22 +23712,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 899, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 899, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 899, __pyx_L1_error) + __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, 899, __pyx_L1_error) + __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_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 899, __pyx_L1_error) + __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_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); @@ -23738,7 +23735,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __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, 899, __pyx_L1_error) + 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; @@ -23746,7 +23743,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 899, __pyx_L1_error) + __PYX_ERR(0, 900, __pyx_L1_error) __pyx_L10_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_7); @@ -23754,32 +23751,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":900 + /* "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_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 900, __pyx_L1_error) + __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":901 + /* "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, 901, __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_8 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error) + __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_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":900 + /* "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: # <<<<<<<<<<<<<< @@ -23789,7 +23786,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca goto __pyx_L11; } - /* "constraint/constraints.py":903 + /* "constraint/constraints.py":904 * prod *= assignments[variable] * else: * missing = True # <<<<<<<<<<<<<< @@ -23799,26 +23796,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca /*else*/ { __pyx_v_missing = 1; - /* "constraint/constraints.py":904 + /* "constraint/constraints.py":905 * else: * missing = True * if contains_lt1: # <<<<<<<<<<<<<< * missing_lt1.append(variable) * if isinstance(prod, float): */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_contains_lt1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 904, __pyx_L1_error) + __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":905 + /* "constraint/constraints.py":906 * missing = True * if contains_lt1: * missing_lt1.append(variable) # <<<<<<<<<<<<<< * if isinstance(prod, float): * prod = round(prod, 10) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_missing_lt1, __pyx_v_variable); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 905, __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":904 + /* "constraint/constraints.py":905 * else: * missing = True * if contains_lt1: # <<<<<<<<<<<<<< @@ -23829,7 +23826,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca } __pyx_L11:; - /* "constraint/constraints.py":899 + /* "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): # <<<<<<<<<<<<<< @@ -23839,7 +23836,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":906 + /* "constraint/constraints.py":907 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -23849,7 +23846,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_t_4 = PyFloat_Check(__pyx_v_prod); if (__pyx_t_4) { - /* "constraint/constraints.py":907 + /* "constraint/constraints.py":908 * missing_lt1.append(variable) * if isinstance(prod, float): * prod = round(prod, 10) # <<<<<<<<<<<<<< @@ -23862,13 +23859,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca 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, 907, __pyx_L1_error) + 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_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":906 + /* "constraint/constraints.py":907 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -23877,7 +23874,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":908 + /* "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): # <<<<<<<<<<<<<< @@ -23889,8 +23886,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca goto __pyx_L17_next_or; } else { } - __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, 908, __pyx_L1_error) - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 908, __pyx_L1_error) + __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 { @@ -23898,21 +23895,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca goto __pyx_L16_bool_binop_done; } __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, 908, __pyx_L1_error) + __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_4 = __pyx_t_13; goto __pyx_L16_bool_binop_done; } - __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, 908, __pyx_L1_error) - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 908, __pyx_L1_error) + __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":909 + /* "constraint/constraints.py":910 * prod = round(prod, 10) * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): * return False # <<<<<<<<<<<<<< @@ -23924,7 +23921,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":908 + /* "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): # <<<<<<<<<<<<<< @@ -23933,17 +23930,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":910 + /* "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_4 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 910, __pyx_L1_error) + __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":911 + /* "constraint/constraints.py":912 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -23955,9 +23952,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_t_3 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 911, __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, 911, __pyx_L1_error) + __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_5)) { @@ -23965,7 +23962,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__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, 911, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 912, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -23975,7 +23972,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca { 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, 911, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 912, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -23986,13 +23983,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 911, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 912, __pyx_L1_error) } else { __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, 911, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 912, __pyx_L1_error) PyErr_Clear(); } break; @@ -24002,60 +23999,60 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":912 + /* "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_13 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) + __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_4 = __pyx_t_13; goto __pyx_L24_bool_binop_done; } - __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable, __pyx_v_missing_lt1, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 912, __pyx_L1_error) + __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_4 = __pyx_t_13; goto __pyx_L24_bool_binop_done; } - __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 912, __pyx_L1_error) + __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":913 + /* "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_8 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 913, __pyx_L1_error) + __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":914 + /* "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_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, 914, __pyx_L1_error) + __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_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __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, 914, __pyx_L1_error) + __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_8); __pyx_t_8 = 0; for (;;) { @@ -24064,7 +24061,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__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, 914, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 915, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -24074,7 +24071,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca { 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, 914, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 915, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -24085,13 +24082,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 914, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 915, __pyx_L1_error) } else { __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, 914, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 915, __pyx_L1_error) PyErr_Clear(); } break; @@ -24101,22 +24098,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":915 + /* "constraint/constraints.py":916 * domain = domains[variable] * for value in domain[:]: * if prod * value > exactprod: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ - __pyx_t_8 = PyNumber_Multiply(__pyx_v_prod, __pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 915, __pyx_L1_error) + __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, 915, __pyx_L1_error) + __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, 915, __pyx_L1_error) + __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":916 + /* "constraint/constraints.py":917 * for value in domain[:]: * if prod * value > exactprod: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -24130,12 +24127,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca 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, 916, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":915 + /* "constraint/constraints.py":916 * domain = domains[variable] * for value in domain[:]: * if prod * value > exactprod: # <<<<<<<<<<<<<< @@ -24144,7 +24141,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":914 + /* "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[:]: # <<<<<<<<<<<<<< @@ -24154,18 +24151,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":917 + /* "constraint/constraints.py":918 * if prod * value > exactprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False * return True */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 917, __pyx_L1_error) + __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":918 + /* "constraint/constraints.py":919 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -24178,7 +24175,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/constraints.py":917 + /* "constraint/constraints.py":918 * if prod * value > exactprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -24187,7 +24184,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":912 + /* "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): # <<<<<<<<<<<<<< @@ -24196,7 +24193,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":911 + /* "constraint/constraints.py":912 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -24206,7 +24203,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":910 + /* "constraint/constraints.py":911 * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): * return False * if forwardcheck: # <<<<<<<<<<<<<< @@ -24215,7 +24212,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":919 + /* "constraint/constraints.py":920 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -24227,7 +24224,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":890 + /* "constraint/constraints.py":891 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -24258,7 +24255,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca return __pyx_r; } -/* "constraint/constraints.py":938 +/* "constraint/constraints.py":939 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # <<<<<<<<<<<<<< @@ -24308,38 +24305,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, 938, __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, 938, __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, 938, __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, 938, __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, 938, __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, 938, __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, 938, __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, 938, __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, 938, __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]); @@ -24347,7 +24344,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, 938, __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:; @@ -24358,7 +24355,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, 938, __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 */ @@ -24386,25 +24383,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":945 + /* "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, 945, __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":946 + /* "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, 946, __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":938 + /* "constraint/constraints.py":939 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # <<<<<<<<<<<<<< @@ -24424,7 +24421,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":948 +/* "constraint/constraints.py":949 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -24474,41 +24471,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, 948, __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, 948, __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, 948, __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, 948, __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, 948, __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, 948, __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, 948, __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, 948, __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, 948, __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; } @@ -24520,7 +24517,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, 948, __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:; @@ -24575,35 +24572,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_product_bounds", 0); - /* "constraint/constraints.py":950 + /* "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, 950, __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":951 + /* "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, 951, __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, 951, __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, 951, __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 (;;) { @@ -24612,7 +24609,7 @@ 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, 951, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 952, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -24622,7 +24619,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 951, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 952, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -24633,13 +24630,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 951, __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, 951, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 952, __pyx_L1_error) PyErr_Clear(); } break; @@ -24649,19 +24646,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":952 + /* "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, 952, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 952, __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":953 + /* "constraint/constraints.py":954 * for var in self.product_vars: * if var == exclude_var: * continue # <<<<<<<<<<<<<< @@ -24670,7 +24667,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ goto __pyx_L3_continue; - /* "constraint/constraints.py":952 + /* "constraint/constraints.py":953 * bounds = [] * for var in self.product_vars: * if var == exclude_var: # <<<<<<<<<<<<<< @@ -24679,30 +24676,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":954 + /* "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, 954, __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":955 + /* "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, 955, __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":956 + /* "constraint/constraints.py":957 * dom = domain_dict[var] * if not dom: * continue # <<<<<<<<<<<<<< @@ -24711,7 +24708,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ goto __pyx_L3_continue; - /* "constraint/constraints.py":955 + /* "constraint/constraints.py":956 * continue * dom = domain_dict[var] * if not dom: # <<<<<<<<<<<<<< @@ -24720,7 +24717,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":957 + /* "constraint/constraints.py":958 * if not dom: * continue * bounds.append((min(dom), max(dom))) # <<<<<<<<<<<<<< @@ -24733,7 +24730,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_dom}; __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; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_9 = NULL; @@ -24742,21 +24739,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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, 957, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 957, __pyx_L1_error) + __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_9, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 957, __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, 957, __pyx_L1_error); + 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_7 = 0; - __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_bounds, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 957, __pyx_L1_error) + __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":951 + /* "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: # <<<<<<<<<<<<<< @@ -24767,7 +24764,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":959 + /* "constraint/constraints.py":960 * bounds.append((min(dom), max(dom))) * * all_bounds = [b for b in bounds] # <<<<<<<<<<<<<< @@ -24775,7 +24772,7 @@ 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, 959, __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_9 = __pyx_v_bounds; __Pyx_INCREF(__pyx_t_9); __pyx_t_3 = 0; @@ -24783,17 +24780,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 959, __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_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_9, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 959, __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, 959, __pyx_L10_error) + 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_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_b); __pyx_9genexpr19__pyx_v_b = 0; @@ -24806,7 +24803,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_v_all_bounds = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":960 + /* "constraint/constraints.py":961 * * all_bounds = [b for b in bounds] * if not all_bounds: # <<<<<<<<<<<<<< @@ -24815,14 +24812,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ { 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, 960, __pyx_L1_error) + 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":961 + /* "constraint/constraints.py":962 * all_bounds = [b for b in bounds] * if not all_bounds: * return 1, 1 # <<<<<<<<<<<<<< @@ -24834,7 +24831,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = __pyx_mstate_global->__pyx_tuple[0]; goto __pyx_L0; - /* "constraint/constraints.py":960 + /* "constraint/constraints.py":961 * * all_bounds = [b for b in bounds] * if not all_bounds: # <<<<<<<<<<<<<< @@ -24843,7 +24840,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":964 + /* "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])] # <<<<<<<<<<<<<< @@ -24851,12 +24848,12 @@ 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, 964, __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_9, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 964, __pyx_L18_error) + __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_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 964, __pyx_L23_error) + __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; @@ -24864,13 +24861,13 @@ 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, 964, __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_11 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 964, __pyx_L23_error) + 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; @@ -24878,7 +24875,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, 964, __pyx_L23_error) + __PYX_ERR(0, 965, __pyx_L23_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -24888,22 +24885,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_INCREF(__pyx_t_13); } else { __pyx_t_12 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 964, __pyx_L23_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 965, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 964, __pyx_L23_error) + 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, 964, __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, 964, __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_11); __pyx_t_11 = 0; } else { Py_ssize_t index = -1; - __pyx_t_14 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 964, __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_11); __pyx_t_11 = 0; __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); @@ -24911,7 +24908,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 964, __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; @@ -24919,22 +24916,22 @@ 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, 964, __pyx_L23_error) + __PYX_ERR(0, 965, __pyx_L23_error) __pyx_L27_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_9genexpr21__pyx_v_lo, __pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_9genexpr21__pyx_v_hi, __pyx_t_13); __pyx_t_13 = 0; - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 964, __pyx_L23_error) + __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, 964, __pyx_L23_error); + 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, 964, __pyx_L23_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 964, __pyx_L23_error) + 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; @@ -24947,10 +24944,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai goto __pyx_L18_error; __pyx_L29_exit_scope:; } /* exit inner scope */ - __pyx_t_1 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 964, __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_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, 964, __pyx_L18_error) + __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; @@ -24959,9 +24956,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 964, __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, 964, __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_7); __pyx_t_7 = 0; for (;;) { @@ -24970,7 +24967,7 @@ 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, 964, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 965, __pyx_L18_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -24980,7 +24977,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 964, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 965, __pyx_L18_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -24991,13 +24988,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 964, __pyx_L18_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 965, __pyx_L18_error) } else { __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, 964, __pyx_L18_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 965, __pyx_L18_error) PyErr_Clear(); } break; @@ -25006,7 +25003,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 964, __pyx_L18_error) + 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_9genexpr20__pyx_v_b); __pyx_9genexpr20__pyx_v_b = 0; @@ -25019,7 +25016,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_v_candidates = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":965 + /* "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] # <<<<<<<<<<<<<< @@ -25027,7 +25024,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, 965, __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; @@ -25035,13 +25032,13 @@ 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, 965, __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_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 965, __pyx_L34_error) + 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; @@ -25052,10 +25049,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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, 965, __pyx_L34_error) + 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_7))) __PYX_ERR(0, 965, __pyx_L34_error) + 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; @@ -25069,7 +25066,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_v_products = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":966 + /* "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) # <<<<<<<<<<<<<< @@ -25083,7 +25080,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_products}; __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; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_7 = NULL; @@ -25092,22 +25089,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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, 966, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 966, __pyx_L1_error) + __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_7, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 966, __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, 966, __pyx_L1_error); + 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_1 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/constraints.py":948 + /* "constraint/constraints.py":949 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -25144,7 +25141,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":968 +/* "constraint/constraints.py":969 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -25192,39 +25189,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, 968, __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, 968, __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, 968, __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, 968, __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, 968, __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, 968, __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, 968, __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, 968, __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:; @@ -25259,7 +25256,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_safe_product", 0); - /* "constraint/constraints.py":969 + /* "constraint/constraints.py":970 * * def _safe_product(self, values): * prod = 1 # <<<<<<<<<<<<<< @@ -25269,7 +25266,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":970 + /* "constraint/constraints.py":971 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -25281,9 +25278,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, 970, __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, 970, __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)) { @@ -25291,7 +25288,7 @@ 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, 970, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 971, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -25301,7 +25298,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 970, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 971, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -25312,13 +25309,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 970, __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, 970, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 971, __pyx_L1_error) PyErr_Clear(); } break; @@ -25328,19 +25325,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":971 + /* "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, 971, __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":970 + /* "constraint/constraints.py":971 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -25350,7 +25347,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":972 + /* "constraint/constraints.py":973 * for v in values: * prod *= v * return prod # <<<<<<<<<<<<<< @@ -25362,7 +25359,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = __pyx_v_prod; goto __pyx_L0; - /* "constraint/constraints.py":968 + /* "constraint/constraints.py":969 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -25384,7 +25381,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":974 +/* "constraint/constraints.py":975 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -25435,50 +25432,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, 974, __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, 974, __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, 974, __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, 974, __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, 974, __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, 974, __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, 974, __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, 974, __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, 974, __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, 974, __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, 974, __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, 974, __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, 974, __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]; @@ -25488,7 +25485,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, 974, __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:; @@ -25499,9 +25496,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, 974, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 974, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 974, __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 */ @@ -25553,7 +25550,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":975 + /* "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) # <<<<<<<<<<<<<< @@ -25561,9 +25558,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, 975, __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, 975, __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; @@ -25583,27 +25580,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 975, __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":977 + /* "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, 977, __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, 977, __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":978 + /* "constraint/constraints.py":979 * * target_domain = domains[self.target_var] * target_min = min(target_domain) # <<<<<<<<<<<<<< @@ -25616,13 +25613,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_target_domain}; __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; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 978, __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":979 + /* "constraint/constraints.py":980 * target_domain = domains[self.target_var] * target_min = min(target_domain) * target_max = max(target_domain) # <<<<<<<<<<<<<< @@ -25635,29 +25632,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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, 979, __pyx_L1_error) + 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":980 + /* "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, 980, __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, 980, __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, 980, __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 (;;) { @@ -25666,7 +25663,7 @@ 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, 980, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 981, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -25676,7 +25673,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 980, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 981, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -25687,13 +25684,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 980, __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, 980, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 981, __pyx_L1_error) PyErr_Clear(); } break; @@ -25703,7 +25700,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":981 + /* "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) # <<<<<<<<<<<<<< @@ -25715,13 +25712,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, 981, __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, 981, __pyx_L1_error) + 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, 981, __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))) { @@ -25730,7 +25727,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, 981, __pyx_L1_error) + __PYX_ERR(0, 982, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -25740,22 +25737,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 981, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error) + 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, 981, __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, 981, __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, 981, __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); @@ -25763,7 +25760,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, 981, __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; @@ -25771,7 +25768,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, 981, __pyx_L1_error) + __PYX_ERR(0, 982, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_other_min, __pyx_t_3); @@ -25779,35 +25776,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":982 + /* "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, 982, __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":983 + /* "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, 983, __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, 983, __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, 983, __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 (;;) { @@ -25816,7 +25813,7 @@ 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, 983, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 984, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -25826,7 +25823,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 983, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 984, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -25837,13 +25834,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_10; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 983, __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, 983, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 984, __pyx_L1_error) PyErr_Clear(); } break; @@ -25853,29 +25850,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":984 + /* "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, 984, __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, 984, __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, 984, __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, 984, __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, 984, __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":985 + /* "constraint/constraints.py":986 * for value in domain[:]: * candidates = [value * other_min, value * other_max] * minval, maxval = min(candidates), max(candidates) # <<<<<<<<<<<<<< @@ -25888,7 +25885,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_candidates}; __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; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 985, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_4 = NULL; @@ -25897,7 +25894,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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, 985, __pyx_L1_error) + 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); @@ -25905,29 +25902,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_maxval, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":986 + /* "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_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, 986, __pyx_L1_error) - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 986, __pyx_L1_error) + __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_12 = __pyx_t_13; goto __pyx_L10_bool_binop_done; } - __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, 986, __pyx_L1_error) - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 986, __pyx_L1_error) + __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_12) { - /* "constraint/constraints.py":987 + /* "constraint/constraints.py":988 * minval, maxval = min(candidates), max(candidates) * if maxval < target_min or minval > target_max: * domain.remove(value) # <<<<<<<<<<<<<< @@ -25941,12 +25938,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_value}; __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_3)) __PYX_ERR(0, 987, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":986 + /* "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: # <<<<<<<<<<<<<< @@ -25955,7 +25952,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":983 + /* "constraint/constraints.py":984 * other_min, other_max = self._get_product_bounds(domains, exclude_var=var) * domain = domains[var] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -25965,7 +25962,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":980 + /* "constraint/constraints.py":981 * target_min = min(target_domain) * target_max = max(target_domain) * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -25975,7 +25972,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":974 + /* "constraint/constraints.py":975 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -26011,7 +26008,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":989 +/* "constraint/constraints.py":990 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -26062,53 +26059,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, 989, __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, 989, __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, 989, __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, 989, __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, 989, __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, 989, __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, 989, __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, 989, __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, 989, __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, 989, __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, 989, __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, 989, __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, 989, __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; } @@ -26122,7 +26119,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, 989, __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:; @@ -26133,8 +26130,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, 989, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 989, __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 */ @@ -26155,7 +26152,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":1012 +/* "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) # <<<<<<<<<<<<<< @@ -26175,7 +26172,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, 1012, __pyx_L1_error) + __PYX_ERR(0, 1013, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -26186,7 +26183,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, 1012, __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; @@ -26224,29 +26221,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, 1012, __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, 1012, __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, 1012, __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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1012, __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, 1012, __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, 1012, __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; @@ -26264,7 +26261,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, 1012, __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); @@ -26291,7 +26288,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":1013 +/* "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) # <<<<<<<<<<<<<< @@ -26311,7 +26308,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, 1013, __pyx_L1_error) + __PYX_ERR(0, 1014, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -26322,7 +26319,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, 1013, __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; @@ -26360,29 +26357,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, 1013, __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, 1013, __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, 1013, __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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1013, __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, 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) + 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; @@ -26400,7 +26397,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, 1013, __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); @@ -26426,7 +26423,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":989 +/* "constraint/constraints.py":990 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -26474,25 +26471,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, 989, __pyx_L1_error) + __PYX_ERR(0, 990, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/constraints.py":990 + /* "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, 990, __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, 990, __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":991 + /* "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 # <<<<<<<<<<<<<< @@ -26504,7 +26501,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":990 + /* "constraint/constraints.py":991 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -26513,22 +26510,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":993 + /* "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, 993, __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, 993, __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_v_target_value = __pyx_t_3; __pyx_t_3 = 0; - /* "constraint/constraints.py":994 + /* "constraint/constraints.py":995 * * target_value = assignments[self.target_var] * assigned_product = 1 # <<<<<<<<<<<<<< @@ -26539,35 +26536,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":995 + /* "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, 995, __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":997 + /* "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, 997, __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, 997, __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, 997, __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 (;;) { @@ -26576,7 +26573,7 @@ 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, 997, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 998, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -26586,7 +26583,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 997, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 998, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -26597,13 +26594,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 997, __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, 997, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 998, __pyx_L1_error) PyErr_Clear(); } break; @@ -26613,26 +26610,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":998 + /* "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, 998, __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":999 + /* "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, 999, __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, 999, __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); @@ -26640,7 +26637,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":998 + /* "constraint/constraints.py":999 * * for var in self.product_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -26650,7 +26647,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai goto __pyx_L6; } - /* "constraint/constraints.py":1001 + /* "constraint/constraints.py":1002 * assigned_product *= assignments[var] * else: * unassigned_vars.append(var) # <<<<<<<<<<<<<< @@ -26658,11 +26655,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, 1001, __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":997 + /* "constraint/constraints.py":998 * unassigned_vars = [] * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -26672,7 +26669,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1003 + /* "constraint/constraints.py":1004 * unassigned_vars.append(var) * * if isinstance(assigned_product, float): # <<<<<<<<<<<<<< @@ -26685,7 +26682,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":1004 + /* "constraint/constraints.py":1005 * * if isinstance(assigned_product, float): * assigned_product = round(assigned_product, 10) # <<<<<<<<<<<<<< @@ -26698,7 +26695,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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((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; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1004, __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); @@ -26706,7 +26703,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1003 + /* "constraint/constraints.py":1004 * unassigned_vars.append(var) * * if isinstance(assigned_product, float): # <<<<<<<<<<<<<< @@ -26715,7 +26712,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":1006 + /* "constraint/constraints.py":1007 * assigned_product = round(assigned_product, 10) * * if not unassigned_vars: # <<<<<<<<<<<<<< @@ -26724,14 +26721,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ { 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, 1006, __pyx_L1_error) + 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":1007 + /* "constraint/constraints.py":1008 * * if not unassigned_vars: * return assigned_product == target_value # <<<<<<<<<<<<<< @@ -26739,12 +26736,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_v_target_value, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1007, __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":1006 + /* "constraint/constraints.py":1007 * assigned_product = round(assigned_product, 10) * * if not unassigned_vars: # <<<<<<<<<<<<<< @@ -26753,7 +26750,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":1010 + /* "constraint/constraints.py":1011 * * # Partial assignment check feasibility * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned_vars] # <<<<<<<<<<<<<< @@ -26761,7 +26758,7 @@ 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, 1010, __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_6 = __pyx_v_unassigned_vars; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0; @@ -26769,18 +26766,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 1010, __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_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __pyx_L12_error) + 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_t_11 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr23__pyx_v_v); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1010, __pyx_L12_error) + __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; { @@ -26788,11 +26785,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __pyx_L12_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_3); } __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, 1010, __pyx_L12_error) + __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; { @@ -26800,18 +26797,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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, 1010, __pyx_L12_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1011, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1010, __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, 1010, __pyx_L12_error); + 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_12, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 1010, __pyx_L12_error); + 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_12))) __PYX_ERR(0, 1010, __pyx_L12_error) + 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_6); __pyx_t_6 = 0; @@ -26825,7 +26822,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_v_domain_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1011 + /* "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])] # <<<<<<<<<<<<<< @@ -26833,12 +26830,12 @@ 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, 1011, __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_6, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1011, __pyx_L19_error) + __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_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1011, __pyx_L24_error) + __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; @@ -26846,13 +26843,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 1011, __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_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_11, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L24_error) + 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; @@ -26860,7 +26857,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, 1011, __pyx_L24_error) + __PYX_ERR(0, 1012, __pyx_L24_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -26870,22 +26867,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_INCREF(__pyx_t_13); } else { __pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1011, __pyx_L24_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1012, __pyx_L24_error) __Pyx_XGOTREF(__pyx_t_10); __pyx_t_13 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1011, __pyx_L24_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1012, __pyx_L24_error) __Pyx_XGOTREF(__pyx_t_13); } #else - __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1011, __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, 1011, __pyx_L24_error) + __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); #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, 1011, __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_3); __pyx_t_3 = 0; __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); @@ -26893,7 +26890,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < (0)) __PYX_ERR(0, 1011, __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; @@ -26901,22 +26898,22 @@ 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, 1011, __pyx_L24_error) + __PYX_ERR(0, 1012, __pyx_L24_error) __pyx_L28_unpacking_done:; } __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_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L24_error) + __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, 1011, __pyx_L24_error); + 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, 1011, __pyx_L24_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_12, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1011, __pyx_L24_error) + 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; @@ -26929,10 +26926,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai goto __pyx_L19_error; __pyx_L30_exit_scope:; } /* exit inner scope */ - __pyx_t_11 = PySequence_Tuple(__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1011, __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_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, 1011, __pyx_L19_error) + __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; @@ -26941,9 +26938,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1011, __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, 1011, __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_12); __pyx_t_12 = 0; for (;;) { @@ -26952,7 +26949,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 1011, __pyx_L19_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1012, __pyx_L19_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -26962,7 +26959,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { 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, 1011, __pyx_L19_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1012, __pyx_L19_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -26973,13 +26970,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1011, __pyx_L19_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1012, __pyx_L19_error) } else { __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, 1011, __pyx_L19_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1012, __pyx_L19_error) PyErr_Clear(); } break; @@ -26995,10 +26992,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai 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, 1011, __pyx_L19_error) + 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_12))) __PYX_ERR(0, 1011, __pyx_L19_error) + 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; @@ -27012,7 +27009,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_v_candidates = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1012 + /* "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) # <<<<<<<<<<<<<< @@ -27020,7 +27017,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * */ __pyx_t_11 = NULL; - __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, 1012, __pyx_L1_error) + __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; { @@ -27028,13 +27025,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __pyx_L1_error) + 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":1013 + /* "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) # <<<<<<<<<<<<<< @@ -27042,7 +27039,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * if target_value < possible_min or target_value > possible_max: */ __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, 1013, __pyx_L1_error) + __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; { @@ -27050,35 +27047,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __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; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __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":1015 + /* "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_v_target_value, __pyx_v_possible_min, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1015, __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_v_target_value, __pyx_v_possible_max, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1015, __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":1016 + /* "constraint/constraints.py":1017 * * if target_value < possible_min or target_value > possible_max: * return False # <<<<<<<<<<<<<< @@ -27090,7 +27087,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1015 + /* "constraint/constraints.py":1016 * possible_max = max(assigned_product * c for c in candidates) * * if target_value < possible_min or target_value > possible_max: # <<<<<<<<<<<<<< @@ -27099,7 +27096,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":1033 + /* "constraint/constraints.py":1034 * # return False * * return True # <<<<<<<<<<<<<< @@ -27111,7 +27108,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":989 + /* "constraint/constraints.py":990 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -27151,10 +27148,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":1052 +/* "constraint/constraints.py":1053 * """ # noqa: E501 * - * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< + * def __init__(self, minprod: int | float): # <<<<<<<<<<<<<< * """Instantiate a MinProdConstraint. * */ @@ -27200,39 +27197,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, 1052, __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, 1052, __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, 1052, __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, 1052, __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, 1052, __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, 1052, __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, 1052, __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, 1052, __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:; @@ -27261,19 +27258,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1058 + /* "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, 1058, __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":1052 + /* "constraint/constraints.py":1053 * """ # noqa: E501 * - * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< + * def __init__(self, minprod: int | float): # <<<<<<<<<<<<<< * """Instantiate a MinProdConstraint. * */ @@ -27290,7 +27287,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ return __pyx_r; } -/* "constraint/constraints.py":1060 +/* "constraint/constraints.py":1061 * self._minprod = minprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -27341,50 +27338,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, 1060, __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, 1060, __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, 1060, __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, 1060, __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, 1060, __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, 1060, __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, 1060, __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, 1060, __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, 1060, __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, 1060, __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, 1060, __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, 1060, __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, 1060, __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]; @@ -27394,7 +27391,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, 1060, __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:; @@ -27405,9 +27402,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, 1060, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1060, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1060, __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 */ @@ -27450,7 +27447,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1061 + /* "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) # <<<<<<<<<<<<<< @@ -27458,9 +27455,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, 1061, __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, 1061, __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; @@ -27480,24 +27477,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro __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, 1061, __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":1064 + /* "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, 1064, __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":1065 + /* "constraint/constraints.py":1066 * # prune the associated variables of values > minprod * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< @@ -27509,9 +27506,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, 1065, __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, 1065, __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)) { @@ -27519,7 +27516,7 @@ 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, 1065, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -27529,7 +27526,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro { 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, 1065, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -27540,13 +27537,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1065, __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, 1065, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1066, __pyx_L1_error) PyErr_Clear(); } break; @@ -27556,35 +27553,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":1066 + /* "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, 1066, __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":1067 + /* "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, 1067, __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, 1067, __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, 1067, __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 (;;) { @@ -27593,7 +27590,7 @@ 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, 1067, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1068, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -27603,7 +27600,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro { 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, 1067, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1068, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -27614,13 +27611,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1067, __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, 1067, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1068, __pyx_L1_error) PyErr_Clear(); } break; @@ -27630,27 +27627,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":1068 + /* "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, 1068, __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, 1068, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1068, __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":1069 + /* "constraint/constraints.py":1070 * for value in domain[:]: * if value == 0 and minprod > 0: * domain.remove(value) # <<<<<<<<<<<<<< @@ -27664,12 +27661,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro PyObject *__pyx_callargs[2] = {__pyx_t_3, __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1069, __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":1068 + /* "constraint/constraints.py":1069 * domain = domains[variable] * for value in domain[:]: * if value == 0 and minprod > 0: # <<<<<<<<<<<<<< @@ -27678,7 +27675,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro */ } - /* "constraint/constraints.py":1067 + /* "constraint/constraints.py":1068 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -27688,7 +27685,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1065 + /* "constraint/constraints.py":1066 * # prune the associated variables of values > minprod * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< @@ -27698,7 +27695,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1060 + /* "constraint/constraints.py":1061 * self._minprod = minprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -27726,7 +27723,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro return __pyx_r; } -/* "constraint/constraints.py":1071 +/* "constraint/constraints.py":1072 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -27777,53 +27774,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, 1071, __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, 1071, __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, 1071, __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, 1071, __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, 1071, __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, 1071, __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, 1071, __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, 1071, __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, 1071, __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, 1071, __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, 1071, __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, 1071, __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, 1071, __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; } @@ -27837,7 +27834,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, 1071, __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:; @@ -27848,8 +27845,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, 1071, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1071, __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 */ @@ -27887,7 +27884,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1073 + /* "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: # <<<<<<<<<<<<<< @@ -27899,9 +27896,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, 1073, __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, 1073, __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)) { @@ -27909,7 +27906,7 @@ 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, 1073, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1074, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -27919,7 +27916,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call { 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, 1073, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1074, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -27930,13 +27927,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1073, __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, 1073, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1074, __pyx_L1_error) PyErr_Clear(); } break; @@ -27946,17 +27943,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":1074 + /* "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, 1074, __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":1075 + /* "constraint/constraints.py":1076 * for variable in variables: * if variable not in assignments: * return True # <<<<<<<<<<<<<< @@ -27969,7 +27966,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":1074 + /* "constraint/constraints.py":1075 * # check if each variable is in the assignments * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -27978,7 +27975,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call */ } - /* "constraint/constraints.py":1073 + /* "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: # <<<<<<<<<<<<<< @@ -27988,19 +27985,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1078 + /* "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, 1078, __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":1079 + /* "constraint/constraints.py":1080 * # with each variable assigned, sum the values * minprod = self._minprod * prod = 1 # <<<<<<<<<<<<<< @@ -28010,7 +28007,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":1080 + /* "constraint/constraints.py":1081 * minprod = self._minprod * prod = 1 * for variable in variables: # <<<<<<<<<<<<<< @@ -28022,9 +28019,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, 1080, __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, 1080, __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)) { @@ -28032,7 +28029,7 @@ 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, 1080, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1081, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -28042,7 +28039,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call { 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, 1080, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1081, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -28053,13 +28050,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1080, __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, 1080, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1081, __pyx_L1_error) PyErr_Clear(); } break; @@ -28069,22 +28066,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":1081 + /* "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, 1081, __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, 1081, __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":1080 + /* "constraint/constraints.py":1081 * minprod = self._minprod * prod = 1 * for variable in variables: # <<<<<<<<<<<<<< @@ -28094,7 +28091,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1082 + /* "constraint/constraints.py":1083 * for variable in variables: * prod *= assignments[variable] * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -28104,7 +28101,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":1083 + /* "constraint/constraints.py":1084 * prod *= assignments[variable] * if isinstance(prod, float): * prod = round(prod, 10) # <<<<<<<<<<<<<< @@ -28117,13 +28114,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_prod, __pyx_mstate_global->__pyx_int_10}; __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; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1083, __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":1082 + /* "constraint/constraints.py":1083 * for variable in variables: * prod *= assignments[variable] * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -28132,7 +28129,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call */ } - /* "constraint/constraints.py":1084 + /* "constraint/constraints.py":1085 * if isinstance(prod, float): * prod = round(prod, 10) * return prod >= minprod # <<<<<<<<<<<<<< @@ -28140,12 +28137,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, 1084, __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":1071 + /* "constraint/constraints.py":1072 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -28169,7 +28166,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call return __pyx_r; } -/* "constraint/constraints.py":1104 +/* "constraint/constraints.py":1105 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -28218,38 +28215,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, 1104, __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, 1104, __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, 1104, __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, 1104, __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, 1104, __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, 1104, __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, 1104, __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, 1104, __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, 1104, __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]); @@ -28257,7 +28254,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, 1104, __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:; @@ -28268,7 +28265,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, 1104, __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 */ @@ -28296,25 +28293,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1105 + /* "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, 1105, __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":1106 + /* "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, 1106, __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":1104 + /* "constraint/constraints.py":1105 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -28334,7 +28331,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1108 +/* "constraint/constraints.py":1109 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -28383,41 +28380,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, 1108, __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, 1108, __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, 1108, __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, 1108, __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, 1108, __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, 1108, __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, 1108, __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, 1108, __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, 1108, __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; } @@ -28429,7 +28426,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, 1108, __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:; @@ -28482,35 +28479,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_product_bounds", 0); - /* "constraint/constraints.py":1109 + /* "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, 1109, __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":1110 + /* "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, 1110, __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, 1110, __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, 1110, __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 (;;) { @@ -28519,7 +28516,7 @@ 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, 1110, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1111, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -28529,7 +28526,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1110, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1111, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -28540,13 +28537,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1110, __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, 1110, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1111, __pyx_L1_error) PyErr_Clear(); } break; @@ -28556,19 +28553,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1111 + /* "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, 1111, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1111, __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":1112 + /* "constraint/constraints.py":1113 * for var in self.product_vars: * if var == exclude_var: * continue # <<<<<<<<<<<<<< @@ -28577,7 +28574,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ goto __pyx_L3_continue; - /* "constraint/constraints.py":1111 + /* "constraint/constraints.py":1112 * bounds = [] * for var in self.product_vars: * if var == exclude_var: # <<<<<<<<<<<<<< @@ -28586,30 +28583,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1113 + /* "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, 1113, __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":1114 + /* "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, 1114, __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":1115 + /* "constraint/constraints.py":1116 * dom = domain_dict[var] * if not dom: * continue # <<<<<<<<<<<<<< @@ -28618,7 +28615,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ goto __pyx_L3_continue; - /* "constraint/constraints.py":1114 + /* "constraint/constraints.py":1115 * continue * dom = domain_dict[var] * if not dom: # <<<<<<<<<<<<<< @@ -28627,7 +28624,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1116 + /* "constraint/constraints.py":1117 * if not dom: * continue * bounds.append((min(dom), max(dom))) # <<<<<<<<<<<<<< @@ -28640,7 +28637,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_dom}; __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; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1116, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_9 = NULL; @@ -28649,21 +28646,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint 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, 1116, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1116, __pyx_L1_error) + __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_9, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1116, __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, 1116, __pyx_L1_error); + 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_7 = 0; - __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_bounds, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1116, __pyx_L1_error) + __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":1110 + /* "constraint/constraints.py":1111 * def _get_product_bounds(self, domain_dict, exclude_var=None): * bounds = [] * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -28674,7 +28671,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1118 + /* "constraint/constraints.py":1119 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< @@ -28683,14 +28680,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_bounds); - if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1118, __pyx_L1_error) + 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":1119 + /* "constraint/constraints.py":1120 * * if not bounds: * return 1, 1 # <<<<<<<<<<<<<< @@ -28702,7 +28699,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = __pyx_mstate_global->__pyx_tuple[0]; goto __pyx_L0; - /* "constraint/constraints.py":1118 + /* "constraint/constraints.py":1119 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< @@ -28711,7 +28708,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1122 + /* "constraint/constraints.py":1123 * * # Try all corner combinations * candidates = [p for p in product(*[(lo, hi) for lo, hi in bounds])] # <<<<<<<<<<<<<< @@ -28719,12 +28716,12 @@ 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, 1122, __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_9, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1122, __pyx_L11_error) + __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_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1122, __pyx_L16_error) + __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; @@ -28732,13 +28729,13 @@ 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, 1122, __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_11 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1122, __pyx_L16_error) + 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; @@ -28746,7 +28743,7 @@ 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, 1122, __pyx_L16_error) + __PYX_ERR(0, 1123, __pyx_L16_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -28756,22 +28753,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_INCREF(__pyx_t_13); } else { __pyx_t_12 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1122, __pyx_L16_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1123, __pyx_L16_error) __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1122, __pyx_L16_error) + 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, 1122, __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, 1122, __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_11); __pyx_t_11 = 0; } else { Py_ssize_t index = -1; - __pyx_t_14 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1122, __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_11); __pyx_t_11 = 0; __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); @@ -28779,7 +28776,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1122, __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; @@ -28787,22 +28784,22 @@ 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, 1122, __pyx_L16_error) + __PYX_ERR(0, 1123, __pyx_L16_error) __pyx_L20_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_9genexpr29__pyx_v_lo, __pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_9genexpr29__pyx_v_hi, __pyx_t_13); __pyx_t_13 = 0; - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1122, __pyx_L16_error) + __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, 1122, __pyx_L16_error); + 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, 1122, __pyx_L16_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 1122, __pyx_L16_error) + 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; @@ -28815,10 +28812,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint goto __pyx_L11_error; __pyx_L22_exit_scope:; } /* exit inner scope */ - __pyx_t_1 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __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_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, 1122, __pyx_L11_error) + __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; @@ -28827,9 +28824,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __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, 1122, __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_7); __pyx_t_7 = 0; for (;;) { @@ -28838,7 +28835,7 @@ 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, 1122, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1123, __pyx_L11_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -28848,7 +28845,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1122, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1123, __pyx_L11_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -28859,13 +28856,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1122, __pyx_L11_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1123, __pyx_L11_error) } else { __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, 1122, __pyx_L11_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1123, __pyx_L11_error) PyErr_Clear(); } break; @@ -28874,7 +28871,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1122, __pyx_L11_error) + 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_9genexpr28__pyx_v_p); __pyx_9genexpr28__pyx_v_p = 0; @@ -28887,7 +28884,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_v_candidates = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1123 + /* "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] # <<<<<<<<<<<<<< @@ -28895,7 +28892,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, 1123, __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; @@ -28903,13 +28900,13 @@ 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, 1123, __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_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1123, __pyx_L27_error) + 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; @@ -28920,10 +28917,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint 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, 1123, __pyx_L27_error) + 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_7))) __PYX_ERR(0, 1123, __pyx_L27_error) + 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; @@ -28937,7 +28934,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_v_products = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1124 + /* "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) # <<<<<<<<<<<<<< @@ -28951,7 +28948,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_products}; __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; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_7 = NULL; @@ -28960,22 +28957,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint 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, 1124, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1124, __pyx_L1_error) + __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_7, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1124, __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, 1124, __pyx_L1_error); + 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_1 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1108 + /* "constraint/constraints.py":1109 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -29010,7 +29007,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1126 +/* "constraint/constraints.py":1127 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -29058,39 +29055,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, 1126, __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, 1126, __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, 1126, __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, 1126, __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, 1126, __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, 1126, __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, 1126, __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, 1126, __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:; @@ -29125,7 +29122,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_safe_product", 0); - /* "constraint/constraints.py":1127 + /* "constraint/constraints.py":1128 * * def _safe_product(self, values): * prod = 1 # <<<<<<<<<<<<<< @@ -29135,7 +29132,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":1128 + /* "constraint/constraints.py":1129 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -29147,9 +29144,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, 1128, __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, 1128, __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)) { @@ -29157,7 +29154,7 @@ 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, 1128, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1129, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -29167,7 +29164,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1128, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1129, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -29178,13 +29175,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1128, __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, 1128, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1129, __pyx_L1_error) PyErr_Clear(); } break; @@ -29194,19 +29191,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1129 + /* "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, 1129, __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":1128 + /* "constraint/constraints.py":1129 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -29216,7 +29213,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1130 + /* "constraint/constraints.py":1131 * for v in values: * prod *= v * return prod # <<<<<<<<<<<<<< @@ -29228,7 +29225,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = __pyx_v_prod; goto __pyx_L0; - /* "constraint/constraints.py":1126 + /* "constraint/constraints.py":1127 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -29250,7 +29247,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1132 +/* "constraint/constraints.py":1133 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -29301,50 +29298,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, 1132, __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, 1132, __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, 1132, __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, 1132, __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, 1132, __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, 1132, __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, 1132, __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, 1132, __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, 1132, __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, 1132, __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, 1132, __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, 1132, __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, 1132, __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]; @@ -29354,7 +29351,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, 1132, __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:; @@ -29365,9 +29362,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, 1132, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1132, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1132, __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 */ @@ -29415,7 +29412,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1133 + /* "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) # <<<<<<<<<<<<<< @@ -29423,9 +29420,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, 1133, __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, 1133, __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; @@ -29445,27 +29442,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1133, __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":1134 + /* "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, 1134, __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, 1134, __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":1135 + /* "constraint/constraints.py":1136 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * target_dom = domains[self.target_var] * t_min = min(target_dom) # <<<<<<<<<<<<<< @@ -29478,29 +29475,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_target_dom}; __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; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1135, __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":1137 + /* "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, 1137, __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_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, 1137, __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, 1137, __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, 1138, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -29509,7 +29506,7 @@ 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, 1137, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1138, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -29519,7 +29516,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1137, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1138, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -29530,13 +29527,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1137, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1138, __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, 1137, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1138, __pyx_L1_error) PyErr_Clear(); } break; @@ -29546,7 +29543,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1138 + /* "constraint/constraints.py":1139 * * for var in self.product_vars: * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) # <<<<<<<<<<<<<< @@ -29558,13 +29555,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1138, __pyx_L1_error) + __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, 1138, __pyx_L1_error) + 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, 1138, __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))) { @@ -29573,7 +29570,7 @@ 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, 1138, __pyx_L1_error) + __PYX_ERR(0, 1139, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -29583,22 +29580,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1138, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1139, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1138, __pyx_L1_error) + 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, 1138, __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_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1138, __pyx_L1_error) + __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, 1138, __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); @@ -29606,7 +29603,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1138, __pyx_L1_error) + 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; @@ -29614,7 +29611,7 @@ 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, 1138, __pyx_L1_error) + __PYX_ERR(0, 1139, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_min_others, __pyx_t_3); @@ -29622,35 +29619,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_max_others, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1139 + /* "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, 1139, __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":1140 + /* "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, 1140, __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_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, 1140, __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, 1140, __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, 1141, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -29659,7 +29656,7 @@ 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, 1140, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1141, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -29669,7 +29666,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1140, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1141, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -29680,13 +29677,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_10; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1140, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1141, __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, 1140, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1141, __pyx_L1_error) PyErr_Clear(); } break; @@ -29696,29 +29693,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1141 + /* "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, 1141, __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, 1141, __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, 1141, __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, 1141, __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, 1141, __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":1142 + /* "constraint/constraints.py":1143 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if max(possible_prods) < t_min: # <<<<<<<<<<<<<< @@ -29731,16 +29728,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_possible_prods}; __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; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1142, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __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, 1142, __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_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1142, __pyx_L1_error) + __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":1143 + /* "constraint/constraints.py":1144 * possible_prods = [val * min_others, val * max_others] * if max(possible_prods) < t_min: * dom.remove(val) # <<<<<<<<<<<<<< @@ -29754,12 +29751,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_val}; __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_3)) __PYX_ERR(0, 1143, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1142 + /* "constraint/constraints.py":1143 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if max(possible_prods) < t_min: # <<<<<<<<<<<<<< @@ -29768,7 +29765,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1140 + /* "constraint/constraints.py":1141 * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) * dom = domains[var] * for val in dom[:]: # <<<<<<<<<<<<<< @@ -29778,7 +29775,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1137 + /* "constraint/constraints.py":1138 * t_min = min(target_dom) * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -29788,7 +29785,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1132 + /* "constraint/constraints.py":1133 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -29821,7 +29818,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1145 +/* "constraint/constraints.py":1146 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -29872,53 +29869,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, 1145, __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, 1145, __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, 1145, __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, 1145, __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, 1145, __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, 1145, __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, 1145, __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, 1145, __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, 1145, __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, 1145, __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, 1145, __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, 1145, __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, 1145, __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; } @@ -29932,7 +29929,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, 1145, __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:; @@ -29943,8 +29940,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, 1145, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1145, __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 */ @@ -29965,7 +29962,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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":1181 +/* "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): # <<<<<<<<<<<<<< @@ -29985,7 +29982,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1181, __pyx_L1_error) + __PYX_ERR(0, 1182, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -29996,7 +29993,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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___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, 1181, __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; @@ -30033,29 +30030,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1181, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1181, __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, 1181, __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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1181, __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, 1181, __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, 1181, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1181, __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) { @@ -30095,7 +30092,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1145 +/* "constraint/constraints.py":1146 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -30157,25 +30154,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__ *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1145, __pyx_L1_error) + __PYX_ERR(0, 1146, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/constraints.py":1146 + /* "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, 1146, __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, 1146, __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":1147 + /* "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 # <<<<<<<<<<<<<< @@ -30187,7 +30184,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1146 + /* "constraint/constraints.py":1147 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -30196,23 +30193,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1149 + /* "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, 1149, __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, 1149, __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":1150 + /* "constraint/constraints.py":1151 * * target_value = assignments[self.target_var] * assigned_prod = 1 # <<<<<<<<<<<<<< @@ -30222,35 +30219,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":1151 + /* "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, 1151, __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":1153 + /* "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, 1153, __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, 1153, __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, 1153, __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 (;;) { @@ -30259,7 +30256,7 @@ 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, 1153, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1154, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -30269,7 +30266,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1153, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1154, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -30280,13 +30277,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1153, __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, 1153, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1154, __pyx_L1_error) PyErr_Clear(); } break; @@ -30296,32 +30293,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1154 + /* "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, 1154, __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":1155 + /* "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, 1155, __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, 1155, __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":1154 + /* "constraint/constraints.py":1155 * * for var in self.product_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -30331,7 +30328,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint goto __pyx_L6; } - /* "constraint/constraints.py":1157 + /* "constraint/constraints.py":1158 * assigned_prod *= assignments[var] * else: * unassigned.append(var) # <<<<<<<<<<<<<< @@ -30339,11 +30336,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, 1157, __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":1153 + /* "constraint/constraints.py":1154 * unassigned = [] * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -30353,7 +30350,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1159 + /* "constraint/constraints.py":1160 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< @@ -30362,14 +30359,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_unassigned); - if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1159, __pyx_L1_error) + 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":1160 + /* "constraint/constraints.py":1161 * * if not unassigned: * return assigned_prod >= target_value # <<<<<<<<<<<<<< @@ -30377,12 +30374,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, 1160, __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":1159 + /* "constraint/constraints.py":1160 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< @@ -30391,7 +30388,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1163 + /* "constraint/constraints.py":1164 * * # Estimate min possible value of full product * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned] # <<<<<<<<<<<<<< @@ -30399,7 +30396,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, 1163, __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; @@ -30407,18 +30404,18 @@ 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, 1163, __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_GetItemRefFast(__pyx_t_6, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1163, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1164, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_9genexpr31__pyx_v_v, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = NULL; - __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr31__pyx_v_v); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1163, __pyx_L11_error) + __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; { @@ -30426,11 +30423,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1163, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1164, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); } __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, 1163, __pyx_L11_error) + __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; { @@ -30438,18 +30435,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1163, __pyx_L11_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1164, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); } - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1163, __pyx_L11_error) + __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_12, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1163, __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_12, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1163, __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_12))) __PYX_ERR(0, 1163, __pyx_L11_error) + 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; @@ -30463,7 +30460,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_v_domain_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1164 + /* "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])] # <<<<<<<<<<<<<< @@ -30471,12 +30468,12 @@ 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, 1164, __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, 1164, __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_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1164, __pyx_L23_error) + __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; @@ -30484,13 +30481,13 @@ 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, 1164, __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_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1164, __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; @@ -30498,7 +30495,7 @@ 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, 1164, __pyx_L23_error) + __PYX_ERR(0, 1165, __pyx_L23_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -30508,22 +30505,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_INCREF(__pyx_t_13); } else { __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1164, __pyx_L23_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1165, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_9); __pyx_t_13 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1164, __pyx_L23_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1165, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_13); } #else - __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1164, __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, 1164, __pyx_L23_error) + __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); #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, 1164, __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); @@ -30531,7 +30528,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < (0)) __PYX_ERR(0, 1164, __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; @@ -30539,22 +30536,22 @@ 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, 1164, __pyx_L23_error) + __PYX_ERR(0, 1165, __pyx_L23_error) __pyx_L27_unpacking_done:; } __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_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1164, __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_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, 1164, __pyx_L23_error); + 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, 1164, __pyx_L23_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_12, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1164, __pyx_L23_error) + 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; @@ -30567,10 +30564,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint goto __pyx_L18_error; __pyx_L29_exit_scope:; } /* exit inner scope */ - __pyx_t_10 = PySequence_Tuple(__pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1164, __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_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, 1164, __pyx_L18_error) + __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; @@ -30579,9 +30576,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1164, __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, 1164, __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_12); __pyx_t_12 = 0; for (;;) { @@ -30590,7 +30587,7 @@ 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, 1164, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1165, __pyx_L18_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -30600,7 +30597,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1164, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1165, __pyx_L18_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -30611,13 +30608,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1164, __pyx_L18_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1165, __pyx_L18_error) } else { __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, 1164, __pyx_L18_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1165, __pyx_L18_error) PyErr_Clear(); } break; @@ -30633,10 +30630,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint 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_12)) __PYX_ERR(0, 1164, __pyx_L18_error) + 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_12))) __PYX_ERR(0, 1164, __pyx_L18_error) + 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; @@ -30650,7 +30647,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_v_candidates = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1165 + /* "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] # <<<<<<<<<<<<<< @@ -30658,7 +30655,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, 1165, __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; @@ -30666,19 +30663,19 @@ 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, 1165, __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_12 = __Pyx_PyList_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1165, __pyx_L34_error) + 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, 1165, __pyx_L34_error) + __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, 1165, __pyx_L34_error) + 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; @@ -30692,7 +30689,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_v_possible_prods = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1166 + /* "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: # <<<<<<<<<<<<<< @@ -30705,16 +30702,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_possible_prods}; __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; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1166, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __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, 1166, __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_10); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1166, __pyx_L1_error) + __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":1167 + /* "constraint/constraints.py":1168 * possible_prods = [assigned_prod * c for c in candidates] * if max(possible_prods) < target_value: * return False # <<<<<<<<<<<<<< @@ -30726,7 +30723,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1166 + /* "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: # <<<<<<<<<<<<<< @@ -30735,17 +30732,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1169 + /* "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, 1169, __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":1170 + /* "constraint/constraints.py":1171 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< @@ -30758,18 +30755,18 @@ 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, 1170, __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_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __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":1171 + /* "constraint/constraints.py":1172 * if forwardcheck: * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] # <<<<<<<<<<<<<< @@ -30777,7 +30774,7 @@ 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, 1171, __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_12 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_12); __pyx_t_16 = 0; @@ -30785,21 +30782,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1171, __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_GetItemRefFast(__pyx_t_12, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1171, __pyx_L45_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1172, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_9genexpr35__pyx_v_v, __pyx_t_6); __pyx_t_6 = 0; - __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, 1171, __pyx_L45_error) - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1171, __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_9genexpr35__pyx_v_v))) __PYX_ERR(0, 1171, __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_12); __pyx_t_12 = 0; @@ -30813,7 +30810,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_other_unassigned, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1172 + /* "constraint/constraints.py":1173 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< @@ -30822,13 +30819,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ { 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, 1172, __pyx_L1_error) + 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":1173 + /* "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] # <<<<<<<<<<<<<< @@ -30836,7 +30833,7 @@ 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, 1173, __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_12 = __pyx_v_other_unassigned; __Pyx_INCREF(__pyx_t_12); __pyx_t_16 = 0; @@ -30844,18 +30841,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1173, __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_GetItemRefFast(__pyx_t_12, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1173, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1174, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_9genexpr36__pyx_v_v, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = NULL; - __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr36__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1173, __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_11 = 1; { @@ -30863,11 +30860,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1173, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1174, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_6); } __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, 1173, __pyx_L54_error) + __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; { @@ -30875,18 +30872,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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, 1173, __pyx_L54_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1174, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_13); } - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1173, __pyx_L54_error) + __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_9, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1173, __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, 1173, __pyx_L54_error); + 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_13 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1173, __pyx_L54_error) + 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_12); __pyx_t_12 = 0; @@ -30900,7 +30897,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_bounds, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1174 + /* "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])] # <<<<<<<<<<<<<< @@ -30908,12 +30905,12 @@ 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, 1174, __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_12, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1174, __pyx_L61_error) + __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_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1174, __pyx_L66_error) + __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; @@ -30921,13 +30918,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1174, __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_GetItemRefFast(__pyx_t_13, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1174, __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; @@ -30935,7 +30932,7 @@ 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, 1174, __pyx_L66_error) + __PYX_ERR(0, 1175, __pyx_L66_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -30945,22 +30942,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_INCREF(__pyx_t_14); } else { __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __pyx_L66_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1175, __pyx_L66_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_14 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1174, __pyx_L66_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1175, __pyx_L66_error) __Pyx_XGOTREF(__pyx_t_14); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __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, 1174, __pyx_L66_error) + __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); #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, 1174, __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); @@ -30968,7 +30965,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __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); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_17), 2) < (0)) __PYX_ERR(0, 1174, __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; @@ -30976,22 +30973,22 @@ 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, 1174, __pyx_L66_error) + __PYX_ERR(0, 1175, __pyx_L66_error) __pyx_L70_unpacking_done:; } __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_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1174, __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_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, 1174, __pyx_L66_error); + 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, 1174, __pyx_L66_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1174, __pyx_L66_error) + 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_13); __pyx_t_13 = 0; @@ -31004,10 +31001,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint goto __pyx_L61_error; __pyx_L72_exit_scope:; } /* exit inner scope */ - __pyx_t_13 = PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1174, __pyx_L61_error) + __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, 1174, __pyx_L61_error) + __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; @@ -31016,9 +31013,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_t_16 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_16 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1174, __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, 1174, __pyx_L61_error) + __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_9); __pyx_t_9 = 0; for (;;) { @@ -31027,7 +31024,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1174, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1175, __pyx_L61_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -31037,7 +31034,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1174, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1175, __pyx_L61_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -31048,13 +31045,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1174, __pyx_L61_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1175, __pyx_L61_error) } else { __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, 1174, __pyx_L61_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1175, __pyx_L61_error) PyErr_Clear(); } break; @@ -31070,10 +31067,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint 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, 1174, __pyx_L61_error) + 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_9))) __PYX_ERR(0, 1174, __pyx_L61_error) + 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_13); __pyx_t_13 = 0; @@ -31087,7 +31084,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_other_products, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1172 + /* "constraint/constraints.py":1173 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< @@ -31097,7 +31094,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint goto __pyx_L51; } - /* "constraint/constraints.py":1176 + /* "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] # <<<<<<<<<<<<<< @@ -31105,45 +31102,45 @@ 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, 1176, __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, 1176, __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":1178 + /* "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, 1178, __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":1179 + /* "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, 1179, __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_13 = __pyx_t_1; __Pyx_INCREF(__pyx_t_13); __pyx_t_16 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_16 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1179, __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, 1179, __pyx_L1_error) + __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 (;;) { @@ -31152,7 +31149,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1179, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1180, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -31162,7 +31159,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1179, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1180, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -31173,13 +31170,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1180, __pyx_L1_error) } else { __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, 1179, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1180, __pyx_L1_error) PyErr_Clear(); } break; @@ -31189,7 +31186,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1180 + /* "constraint/constraints.py":1181 * domain = domains[var] * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] # <<<<<<<<<<<<<< @@ -31197,7 +31194,7 @@ 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, 1180, __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_9 = __pyx_v_other_products; __Pyx_INCREF(__pyx_t_9); __pyx_t_18 = 0; @@ -31205,22 +31202,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { 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, 1180, __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_12 = __Pyx_PyList_GetItemRefFast(__pyx_t_9, __pyx_t_18, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_18; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1180, __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, 1180, __pyx_L79_error) + __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, 1180, __pyx_L79_error) + __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_12); __pyx_t_12 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1180, __pyx_L79_error) + 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_9); __pyx_t_9 = 0; @@ -31234,23 +31231,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_prods, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1181 + /* "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, 1181, __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_9 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1181, __pyx_L1_error) + __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_9); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1181, __pyx_L1_error) + __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":1182 + /* "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) # <<<<<<<<<<<<<< @@ -31264,12 +31261,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_val}; __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_9)) __PYX_ERR(0, 1182, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":1181 + /* "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): # <<<<<<<<<<<<<< @@ -31278,7 +31275,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1179 + /* "constraint/constraints.py":1180 * * domain = domains[var] * for val in domain[:]: # <<<<<<<<<<<<<< @@ -31288,18 +31285,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "constraint/constraints.py":1183 + /* "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, 1183, __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":1184 + /* "constraint/constraints.py":1185 * domain.hideValue(val) * if not domain: * return False # <<<<<<<<<<<<<< @@ -31312,7 +31309,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1183 + /* "constraint/constraints.py":1184 * if all(p < target_value for p in prods): * domain.hideValue(val) * if not domain: # <<<<<<<<<<<<<< @@ -31321,7 +31318,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1170 + /* "constraint/constraints.py":1171 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< @@ -31331,7 +31328,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "constraint/constraints.py":1169 + /* "constraint/constraints.py":1170 * return False * * if forwardcheck: # <<<<<<<<<<<<<< @@ -31340,7 +31337,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1186 + /* "constraint/constraints.py":1187 * return False * * return True # <<<<<<<<<<<<<< @@ -31352,7 +31349,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1145 + /* "constraint/constraints.py":1146 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -31404,10 +31401,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1205 +/* "constraint/constraints.py":1206 * """ * - * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< + * def __init__(self, maxprod: int | float): # <<<<<<<<<<<<<< * """Instantiate a MaxProdConstraint. * */ @@ -31453,39 +31450,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, 1205, __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, 1205, __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, 1205, __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, 1205, __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, 1205, __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, 1205, __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, 1205, __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, 1205, __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:; @@ -31515,31 +31512,31 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1211 + /* "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, 1211, __pyx_L1_error) + 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":1212 + /* "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 */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __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, 1212, __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, 1213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1205 + /* "constraint/constraints.py":1206 * """ * - * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< + * def __init__(self, maxprod: int | float): # <<<<<<<<<<<<<< * """Instantiate a MaxProdConstraint. * */ @@ -31557,7 +31554,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ return __pyx_r; } -/* "constraint/constraints.py":1214 +/* "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 # <<<<<<<<<<<<<< @@ -31608,50 +31605,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, 1214, __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, 1214, __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, 1214, __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, 1214, __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, 1214, __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, 1214, __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, 1214, __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, 1214, __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, 1214, __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, 1214, __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, 1214, __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, 1214, __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, 1214, __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]; @@ -31661,7 +31658,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, 1214, __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:; @@ -31672,9 +31669,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, 1214, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1214, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1214, __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 */ @@ -31695,7 +31692,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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":1221 +/* "constraint/constraints.py":1222 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -31715,7 +31712,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_10prePr if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1221, __pyx_L1_error) + __PYX_ERR(0, 1222, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -31723,7 +31720,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_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, 1221, __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; @@ -31760,16 +31757,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1221, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1221, __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, 1221, __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, 1221, __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)) { @@ -31777,7 +31774,7 @@ 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, 1221, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1222, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -31787,7 +31784,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr { 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, 1221, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1222, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -31798,13 +31795,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1221, __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, 1221, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1222, __pyx_L1_error) PyErr_Clear(); } break; @@ -31815,8 +31812,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, 1221, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1221, __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); @@ -31855,7 +31852,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr return __pyx_r; } -/* "constraint/constraints.py":1214 +/* "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 # <<<<<<<<<<<<<< @@ -31892,7 +31889,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1215 + /* "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) # <<<<<<<<<<<<<< @@ -31900,9 +31897,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, 1215, __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, 1215, __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; @@ -31922,24 +31919,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __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, 1215, __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":1218 + /* "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, 1218, __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, 1218, __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":1219 + /* "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 # <<<<<<<<<<<<<< @@ -31949,7 +31946,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_INCREF(Py_None); __pyx_v_variable_with_lt1 = Py_None; - /* "constraint/constraints.py":1220 + /* "constraint/constraints.py":1221 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -31961,9 +31958,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, 1220, __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, 1220, __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)) { @@ -31971,7 +31968,7 @@ 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, 1220, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1221, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -31981,7 +31978,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 1220, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1221, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -31992,13 +31989,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1220, __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, 1220, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1221, __pyx_L1_error) PyErr_Clear(); } break; @@ -32008,37 +32005,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":1221 + /* "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, 1221, __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, 1221, __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, 1221, __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":1222 + /* "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, 1222, __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, 1222, __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":1220 + /* "constraint/constraints.py":1221 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -32048,7 +32045,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1223 + /* "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): # <<<<<<<<<<<<<< @@ -32056,7 +32053,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * if variable_with_lt1 is not None: */ __pyx_t_4 = NULL; - __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, 1223, __pyx_L1_error) + __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; { @@ -32064,7 +32061,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __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_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __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)) { @@ -32072,9 +32069,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, 1223, __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, 1223, __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 (;;) { @@ -32083,7 +32080,7 @@ 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, 1223, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1224, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -32093,7 +32090,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 1223, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1224, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -32104,13 +32101,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __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, 1223, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1224, __pyx_L1_error) PyErr_Clear(); } break; @@ -32123,7 +32120,7 @@ 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, 1223, __pyx_L1_error) + __PYX_ERR(0, 1224, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -32133,22 +32130,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1223, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1223, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1224, __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, 1223, __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, 1223, __pyx_L1_error) + __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, 1223, __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); @@ -32156,7 +32153,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_GOTREF(__pyx_t_4); 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, 1223, __pyx_L1_error) + 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; @@ -32164,7 +32161,7 @@ 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, 1223, __pyx_L1_error) + __PYX_ERR(0, 1224, __pyx_L1_error) __pyx_L9_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); @@ -32172,7 +32169,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1224 + /* "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: # <<<<<<<<<<<<<< @@ -32182,7 +32179,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":1225 + /* "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: # <<<<<<<<<<<<<< @@ -32192,7 +32189,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":1227 + /* "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 # <<<<<<<<<<<<<< @@ -32204,7 +32201,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1225 + /* "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: # <<<<<<<<<<<<<< @@ -32213,7 +32210,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":1228 + /* "constraint/constraints.py":1229 * # if more than one associated variables contain less than 1, we can't prune * return * variable_with_lt1 = variable # <<<<<<<<<<<<<< @@ -32223,7 +32220,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":1224 + /* "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: # <<<<<<<<<<<<<< @@ -32232,7 +32229,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":1223 + /* "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): # <<<<<<<<<<<<<< @@ -32242,19 +32239,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1231 + /* "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, 1231, __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":1232 + /* "constraint/constraints.py":1233 * # prune the associated variables of values > maxprod * maxprod = self._maxprod * for variable in variables: # <<<<<<<<<<<<<< @@ -32266,9 +32263,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, 1232, __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, 1232, __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)) { @@ -32276,7 +32273,7 @@ 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, 1232, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1233, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -32286,7 +32283,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 1232, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1233, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -32297,13 +32294,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1232, __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, 1232, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1233, __pyx_L1_error) PyErr_Clear(); } break; @@ -32313,7 +32310,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":1233 + /* "constraint/constraints.py":1234 * maxprod = self._maxprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -32326,14 +32323,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, 1233, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1233, __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":1234 + /* "constraint/constraints.py":1235 * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: * continue # <<<<<<<<<<<<<< @@ -32342,7 +32339,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ goto __pyx_L13_continue; - /* "constraint/constraints.py":1233 + /* "constraint/constraints.py":1234 * maxprod = self._maxprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -32351,35 +32348,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":1235 + /* "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, 1235, __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":1236 + /* "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, 1236, __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_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, 1236, __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, 1236, __pyx_L1_error) + __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 (;;) { @@ -32388,7 +32385,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 1236, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1237, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -32398,7 +32395,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { 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, 1236, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1237, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -32409,13 +32406,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_13; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1236, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1237, __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, 1236, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1237, __pyx_L1_error) PyErr_Clear(); } break; @@ -32425,19 +32422,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1237 + /* "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, 1237, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1237, __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":1238 + /* "constraint/constraints.py":1239 * for value in domain[:]: * if value > maxprod: * domain.remove(value) # <<<<<<<<<<<<<< @@ -32451,12 +32448,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro 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, 1238, __pyx_L1_error) + 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":1237 + /* "constraint/constraints.py":1238 * domain = domains[variable] * for value in domain[:]: * if value > maxprod: # <<<<<<<<<<<<<< @@ -32466,27 +32463,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro goto __pyx_L20; } - /* "constraint/constraints.py":1239 + /* "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, 1239, __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, 1239, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1239, __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":1240 + /* "constraint/constraints.py":1241 * domain.remove(value) * elif value == 0 and maxprod < 0: * domain.remove(value) # <<<<<<<<<<<<<< @@ -32500,12 +32497,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro 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, 1240, __pyx_L1_error) + 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":1239 + /* "constraint/constraints.py":1240 * if value > maxprod: * domain.remove(value) * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< @@ -32515,7 +32512,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __pyx_L20:; - /* "constraint/constraints.py":1236 + /* "constraint/constraints.py":1237 * continue * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -32525,7 +32522,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1232 + /* "constraint/constraints.py":1233 * # prune the associated variables of values > maxprod * maxprod = self._maxprod * for variable in variables: # <<<<<<<<<<<<<< @@ -32536,7 +32533,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1214 + /* "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 # <<<<<<<<<<<<<< @@ -32568,7 +32565,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro return __pyx_r; } -/* "constraint/constraints.py":1242 +/* "constraint/constraints.py":1243 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -32619,53 +32616,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, 1242, __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, 1242, __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, 1242, __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, 1242, __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, 1242, __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, 1242, __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, 1242, __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, 1242, __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, 1242, __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, 1242, __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, 1242, __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, 1242, __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, 1242, __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; } @@ -32679,7 +32676,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, 1242, __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:; @@ -32690,8 +32687,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, 1242, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1242, __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 */ @@ -32712,7 +32709,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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":1250 +/* "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])) # <<<<<<<<<<<<<< @@ -32732,7 +32729,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_8__call 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, 1250, __pyx_L1_error) + __PYX_ERR(0, 1251, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -32740,7 +32737,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_8__call __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, 1250, __pyx_L1_error) + __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; @@ -32777,16 +32774,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1250, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1250, __pyx_L1_error) } + 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, 1250, __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, 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, 1250, __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, 1251, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -32794,7 +32791,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__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, 1250, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1251, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -32804,7 +32801,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call { 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) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1251, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -32815,13 +32812,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1250, __pyx_L1_error) + 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, 1250, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1251, __pyx_L1_error) PyErr_Clear(); } break; @@ -32832,8 +32829,8 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call __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, 1250, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1250, __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, 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); @@ -32872,7 +32869,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call return __pyx_r; } -/* "constraint/constraints.py":1242 +/* "constraint/constraints.py":1243 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -32911,19 +32908,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1243 + /* "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, 1243, __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":1244 + /* "constraint/constraints.py":1245 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * maxprod = self._maxprod * prod = 1 # <<<<<<<<<<<<<< @@ -32933,7 +32930,7 @@ 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":1245 + /* "constraint/constraints.py":1246 * maxprod = self._maxprod * prod = 1 * missing = False # <<<<<<<<<<<<<< @@ -32942,34 +32939,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ __pyx_v_missing = 0; - /* "constraint/constraints.py":1246 + /* "constraint/constraints.py":1247 * 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): */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1246, __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":1248 + /* "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, 1248, __pyx_L1_error) + __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, 1248, __pyx_L1_error) + __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, 1248, __pyx_L1_error) + __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":1249 + /* "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: # <<<<<<<<<<<<<< @@ -32981,9 +32978,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __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, 1249, __pyx_L1_error) + __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, 1249, __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, 1250, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { @@ -32991,7 +32988,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_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, 1249, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1250, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -33001,7 +32998,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 1249, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1250, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -33012,13 +33009,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1249, __pyx_L1_error) + 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, 1249, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1250, __pyx_L1_error) PyErr_Clear(); } break; @@ -33028,28 +33025,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1250 + /* "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, 1250, __pyx_L1_error) + __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, 1250, __pyx_L1_error) + __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, 1250, __pyx_L1_error) + __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, 1250, __pyx_L1_error) + __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, 1250, __pyx_L1_error) + __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":1249 + /* "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: # <<<<<<<<<<<<<< @@ -33059,7 +33056,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1248 + /* "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): # <<<<<<<<<<<<<< @@ -33068,7 +33065,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1251 + /* "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): # <<<<<<<<<<<<<< @@ -33076,7 +33073,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * prod *= assignments[variable] */ __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, 1251, __pyx_L1_error) + __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; { @@ -33084,7 +33081,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __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, 1251, __pyx_L1_error) + 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)) { @@ -33092,9 +33089,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_t_3 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1251, __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, 1251, __pyx_L1_error) + __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 (;;) { @@ -33103,7 +33100,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 1251, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1252, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -33113,7 +33110,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 1251, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1252, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -33124,13 +33121,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1251, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1252, __pyx_L1_error) } else { __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, 1251, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1252, __pyx_L1_error) PyErr_Clear(); } break; @@ -33143,7 +33140,7 @@ 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, 1251, __pyx_L1_error) + __PYX_ERR(0, 1252, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -33153,22 +33150,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1251, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1252, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1251, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1252, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1251, __pyx_L1_error) + __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, 1251, __pyx_L1_error) + __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_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1251, __pyx_L1_error) + __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_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); @@ -33176,7 +33173,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __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, 1251, __pyx_L1_error) + 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; @@ -33184,7 +33181,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1251, __pyx_L1_error) + __PYX_ERR(0, 1252, __pyx_L1_error) __pyx_L10_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_7); @@ -33192,32 +33189,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":1252 + /* "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_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1252, __pyx_L1_error) + __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":1253 + /* "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, 1253, __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_8 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1253, __pyx_L1_error) + __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_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":1252 + /* "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: # <<<<<<<<<<<<<< @@ -33227,7 +33224,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call goto __pyx_L11; } - /* "constraint/constraints.py":1255 + /* "constraint/constraints.py":1256 * prod *= assignments[variable] * else: * missing = True # <<<<<<<<<<<<<< @@ -33237,26 +33234,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call /*else*/ { __pyx_v_missing = 1; - /* "constraint/constraints.py":1256 + /* "constraint/constraints.py":1257 * else: * missing = True * if contains_lt1: # <<<<<<<<<<<<<< * missing_lt1.append(variable) * if isinstance(prod, float): */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_contains_lt1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1256, __pyx_L1_error) + __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":1257 + /* "constraint/constraints.py":1258 * missing = True * if contains_lt1: * missing_lt1.append(variable) # <<<<<<<<<<<<<< * if isinstance(prod, float): * prod = round(prod, 10) */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_missing_lt1, __pyx_v_variable); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 1257, __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":1256 + /* "constraint/constraints.py":1257 * else: * missing = True * if contains_lt1: # <<<<<<<<<<<<<< @@ -33267,7 +33264,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } __pyx_L11:; - /* "constraint/constraints.py":1251 + /* "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): # <<<<<<<<<<<<<< @@ -33277,7 +33274,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1258 + /* "constraint/constraints.py":1259 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -33287,7 +33284,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_t_4 = PyFloat_Check(__pyx_v_prod); if (__pyx_t_4) { - /* "constraint/constraints.py":1259 + /* "constraint/constraints.py":1260 * missing_lt1.append(variable) * if isinstance(prod, float): * prod = round(prod, 10) # <<<<<<<<<<<<<< @@ -33300,13 +33297,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call 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, 1259, __pyx_L1_error) + 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_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1258 + /* "constraint/constraints.py":1259 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -33315,7 +33312,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1260 + /* "constraint/constraints.py":1261 * if isinstance(prod, float): * prod = round(prod, 10) * if (not missing or len(missing_lt1) == 0) and prod > maxprod: # <<<<<<<<<<<<<< @@ -33327,7 +33324,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } else { goto __pyx_L17_next_and; } - __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1260, __pyx_L1_error) + __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 { @@ -33335,14 +33332,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call goto __pyx_L16_bool_binop_done; } __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, 1260, __pyx_L1_error) - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1260, __pyx_L1_error) + __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":1261 + /* "constraint/constraints.py":1262 * prod = round(prod, 10) * if (not missing or len(missing_lt1) == 0) and prod > maxprod: * return False # <<<<<<<<<<<<<< @@ -33354,7 +33351,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1260 + /* "constraint/constraints.py":1261 * if isinstance(prod, float): * prod = round(prod, 10) * if (not missing or len(missing_lt1) == 0) and prod > maxprod: # <<<<<<<<<<<<<< @@ -33363,17 +33360,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1262 + /* "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_4 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1262, __pyx_L1_error) + __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":1263 + /* "constraint/constraints.py":1264 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -33385,9 +33382,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_t_3 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1263, __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, 1263, __pyx_L1_error) + __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_5)) { @@ -33395,7 +33392,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 1263, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1264, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -33405,7 +33402,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 1263, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1264, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -33416,13 +33413,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1263, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1264, __pyx_L1_error) } else { __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, 1263, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1264, __pyx_L1_error) PyErr_Clear(); } break; @@ -33432,60 +33429,60 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":1264 + /* "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_13 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1264, __pyx_L1_error) + __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_4 = __pyx_t_13; goto __pyx_L23_bool_binop_done; } - __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable, __pyx_v_missing_lt1, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1264, __pyx_L1_error) + __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_4 = __pyx_t_13; goto __pyx_L23_bool_binop_done; } - __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1264, __pyx_L1_error) + __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":1265 + /* "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_8 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1265, __pyx_L1_error) + __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":1266 + /* "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_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, 1266, __pyx_L1_error) + __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_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1266, __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, 1266, __pyx_L1_error) + __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_8); __pyx_t_8 = 0; for (;;) { @@ -33494,7 +33491,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_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, 1266, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1267, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -33504,7 +33501,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call { 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, 1266, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1267, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -33515,13 +33512,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1266, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1267, __pyx_L1_error) } else { __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, 1266, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1267, __pyx_L1_error) PyErr_Clear(); } break; @@ -33531,22 +33528,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":1267 + /* "constraint/constraints.py":1268 * domain = domains[variable] * for value in domain[:]: * if prod * value > maxprod: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ - __pyx_t_8 = PyNumber_Multiply(__pyx_v_prod, __pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1267, __pyx_L1_error) + __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, 1267, __pyx_L1_error) + __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, 1267, __pyx_L1_error) + __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":1268 + /* "constraint/constraints.py":1269 * for value in domain[:]: * if prod * value > maxprod: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -33560,12 +33557,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call 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, 1268, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1267 + /* "constraint/constraints.py":1268 * domain = domains[variable] * for value in domain[:]: * if prod * value > maxprod: # <<<<<<<<<<<<<< @@ -33574,7 +33571,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1266 + /* "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[:]: # <<<<<<<<<<<<<< @@ -33584,18 +33581,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1269 + /* "constraint/constraints.py":1270 * if prod * value > maxprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False * return True */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1269, __pyx_L1_error) + __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":1270 + /* "constraint/constraints.py":1271 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -33608,7 +33605,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1269 + /* "constraint/constraints.py":1270 * if prod * value > maxprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -33617,7 +33614,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1264 + /* "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): # <<<<<<<<<<<<<< @@ -33626,7 +33623,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1263 + /* "constraint/constraints.py":1264 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -33636,7 +33633,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1262 + /* "constraint/constraints.py":1263 * if (not missing or len(missing_lt1) == 0) and prod > maxprod: * return False * if forwardcheck: # <<<<<<<<<<<<<< @@ -33645,7 +33642,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1271 + /* "constraint/constraints.py":1272 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -33657,7 +33654,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1242 + /* "constraint/constraints.py":1243 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -33688,7 +33685,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call return __pyx_r; } -/* "constraint/constraints.py":1291 +/* "constraint/constraints.py":1292 * """ # noqa: E501 * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -33737,38 +33734,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, 1291, __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, 1291, __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, 1291, __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, 1291, __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, 1291, __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, 1291, __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, 1291, __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, 1291, __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, 1291, __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]); @@ -33776,7 +33773,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, 1291, __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:; @@ -33787,7 +33784,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, 1291, __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 */ @@ -33815,25 +33812,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1292 + /* "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, 1292, __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":1293 + /* "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, 1293, __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":1291 + /* "constraint/constraints.py":1292 * """ # noqa: E501 * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -33853,7 +33850,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1295 +/* "constraint/constraints.py":1296 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -33902,41 +33899,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, 1295, __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, 1295, __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, 1295, __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, 1295, __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, 1295, __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, 1295, __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, 1295, __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, 1295, __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, 1295, __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; } @@ -33948,7 +33945,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, 1295, __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:; @@ -34001,35 +33998,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_product_bounds", 0); - /* "constraint/constraints.py":1296 + /* "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, 1296, __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":1297 + /* "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, 1297, __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, 1297, __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, 1297, __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 (;;) { @@ -34038,7 +34035,7 @@ 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, 1297, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1298, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -34048,7 +34045,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1297, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1298, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -34059,13 +34056,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1297, __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, 1297, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1298, __pyx_L1_error) PyErr_Clear(); } break; @@ -34075,19 +34072,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1298 + /* "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, 1298, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1298, __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":1299 + /* "constraint/constraints.py":1300 * for var in self.product_vars: * if var == exclude_var: * continue # <<<<<<<<<<<<<< @@ -34096,7 +34093,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ goto __pyx_L3_continue; - /* "constraint/constraints.py":1298 + /* "constraint/constraints.py":1299 * bounds = [] * for var in self.product_vars: * if var == exclude_var: # <<<<<<<<<<<<<< @@ -34105,30 +34102,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1300 + /* "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, 1300, __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":1301 + /* "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, 1301, __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":1302 + /* "constraint/constraints.py":1303 * dom = domain_dict[var] * if not dom: * continue # <<<<<<<<<<<<<< @@ -34137,7 +34134,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ goto __pyx_L3_continue; - /* "constraint/constraints.py":1301 + /* "constraint/constraints.py":1302 * continue * dom = domain_dict[var] * if not dom: # <<<<<<<<<<<<<< @@ -34146,7 +34143,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1303 + /* "constraint/constraints.py":1304 * if not dom: * continue * bounds.append((min(dom), max(dom))) # <<<<<<<<<<<<<< @@ -34159,7 +34156,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_dom}; __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; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1303, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_9 = NULL; @@ -34168,21 +34165,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint 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, 1303, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1303, __pyx_L1_error) + __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_9, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1303, __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, 1303, __pyx_L1_error); + 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_7 = 0; - __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_bounds, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1303, __pyx_L1_error) + __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":1297 + /* "constraint/constraints.py":1298 * def _get_product_bounds(self, domain_dict, exclude_var=None): * bounds = [] * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -34193,7 +34190,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1305 + /* "constraint/constraints.py":1306 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< @@ -34202,14 +34199,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_bounds); - if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1305, __pyx_L1_error) + 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":1306 + /* "constraint/constraints.py":1307 * * if not bounds: * return 1, 1 # <<<<<<<<<<<<<< @@ -34221,7 +34218,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = __pyx_mstate_global->__pyx_tuple[0]; goto __pyx_L0; - /* "constraint/constraints.py":1305 + /* "constraint/constraints.py":1306 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< @@ -34230,7 +34227,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1309 + /* "constraint/constraints.py":1310 * * # Try all corner combinations * candidates = [p for p in product(*[(lo, hi) for lo, hi in bounds])] # <<<<<<<<<<<<<< @@ -34238,12 +34235,12 @@ 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, 1309, __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_9, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1309, __pyx_L11_error) + __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_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1309, __pyx_L16_error) + __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; @@ -34251,13 +34248,13 @@ 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, 1309, __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_11 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1309, __pyx_L16_error) + 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; @@ -34265,7 +34262,7 @@ 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, 1309, __pyx_L16_error) + __PYX_ERR(0, 1310, __pyx_L16_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -34275,22 +34272,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_INCREF(__pyx_t_13); } else { __pyx_t_12 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1309, __pyx_L16_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1310, __pyx_L16_error) __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1309, __pyx_L16_error) + 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, 1309, __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, 1309, __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_11); __pyx_t_11 = 0; } else { Py_ssize_t index = -1; - __pyx_t_14 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1309, __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_11); __pyx_t_11 = 0; __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); @@ -34298,7 +34295,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1309, __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; @@ -34306,22 +34303,22 @@ 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, 1309, __pyx_L16_error) + __PYX_ERR(0, 1310, __pyx_L16_error) __pyx_L20_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_9genexpr44__pyx_v_lo, __pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_9genexpr44__pyx_v_hi, __pyx_t_13); __pyx_t_13 = 0; - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1309, __pyx_L16_error) + __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, 1309, __pyx_L16_error); + 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, 1309, __pyx_L16_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 1309, __pyx_L16_error) + 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; @@ -34334,10 +34331,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint goto __pyx_L11_error; __pyx_L22_exit_scope:; } /* exit inner scope */ - __pyx_t_1 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1309, __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_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, 1309, __pyx_L11_error) + __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; @@ -34346,9 +34343,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1309, __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, 1309, __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_7); __pyx_t_7 = 0; for (;;) { @@ -34357,7 +34354,7 @@ 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, 1309, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1310, __pyx_L11_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -34367,7 +34364,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1309, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1310, __pyx_L11_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -34378,13 +34375,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1309, __pyx_L11_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1310, __pyx_L11_error) } else { __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, 1309, __pyx_L11_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1310, __pyx_L11_error) PyErr_Clear(); } break; @@ -34393,7 +34390,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1309, __pyx_L11_error) + 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_9genexpr43__pyx_v_p); __pyx_9genexpr43__pyx_v_p = 0; @@ -34406,7 +34403,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_v_candidates = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1310 + /* "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] # <<<<<<<<<<<<<< @@ -34414,7 +34411,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, 1310, __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; @@ -34422,13 +34419,13 @@ 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, 1310, __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_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1310, __pyx_L27_error) + 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; @@ -34439,10 +34436,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint 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, 1310, __pyx_L27_error) + 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_7))) __PYX_ERR(0, 1310, __pyx_L27_error) + 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; @@ -34456,7 +34453,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_v_products = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1311 + /* "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) # <<<<<<<<<<<<<< @@ -34470,7 +34467,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_products}; __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; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1311, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_7 = NULL; @@ -34479,22 +34476,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint 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, 1311, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1311, __pyx_L1_error) + __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_7, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1311, __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, 1311, __pyx_L1_error); + 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_1 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1295 + /* "constraint/constraints.py":1296 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -34529,7 +34526,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1313 +/* "constraint/constraints.py":1314 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -34577,39 +34574,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, 1313, __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, 1313, __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, 1313, __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, 1313, __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, 1313, __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, 1313, __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, 1313, __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, 1313, __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:; @@ -34644,7 +34641,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_safe_product", 0); - /* "constraint/constraints.py":1314 + /* "constraint/constraints.py":1315 * * def _safe_product(self, values): * prod = 1 # <<<<<<<<<<<<<< @@ -34654,7 +34651,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":1315 + /* "constraint/constraints.py":1316 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -34666,9 +34663,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, 1315, __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, 1315, __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)) { @@ -34676,7 +34673,7 @@ 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, 1315, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1316, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -34686,7 +34683,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1315, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1316, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -34697,13 +34694,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1315, __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, 1315, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1316, __pyx_L1_error) PyErr_Clear(); } break; @@ -34713,19 +34710,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1316 + /* "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, 1316, __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":1315 + /* "constraint/constraints.py":1316 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -34735,7 +34732,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1317 + /* "constraint/constraints.py":1318 * for v in values: * prod *= v * return prod # <<<<<<<<<<<<<< @@ -34747,7 +34744,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = __pyx_v_prod; goto __pyx_L0; - /* "constraint/constraints.py":1313 + /* "constraint/constraints.py":1314 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -34769,7 +34766,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1319 +/* "constraint/constraints.py":1320 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -34820,50 +34817,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, 1319, __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, 1319, __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, 1319, __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, 1319, __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, 1319, __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, 1319, __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, 1319, __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, 1319, __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, 1319, __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, 1319, __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, 1319, __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, 1319, __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, 1319, __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]; @@ -34873,7 +34870,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, 1319, __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:; @@ -34884,9 +34881,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, 1319, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1319, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1319, __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 */ @@ -34934,7 +34931,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1320 + /* "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) # <<<<<<<<<<<<<< @@ -34942,9 +34939,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, 1320, __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, 1320, __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; @@ -34964,27 +34961,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1320, __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":1321 + /* "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, 1321, __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, 1321, __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":1322 + /* "constraint/constraints.py":1323 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * target_dom = domains[self.target_var] * t_max = max(target_dom) # <<<<<<<<<<<<<< @@ -34997,29 +34994,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_target_dom}; __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, 1322, __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":1324 + /* "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, 1324, __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_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, 1324, __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, 1324, __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, 1325, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -35028,7 +35025,7 @@ 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, 1324, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1325, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -35038,7 +35035,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1324, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1325, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -35049,13 +35046,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1324, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1325, __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, 1324, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1325, __pyx_L1_error) PyErr_Clear(); } break; @@ -35065,7 +35062,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1325 + /* "constraint/constraints.py":1326 * * for var in self.product_vars: * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) # <<<<<<<<<<<<<< @@ -35077,13 +35074,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1325, __pyx_L1_error) + __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, 1325, __pyx_L1_error) + 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, 1325, __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))) { @@ -35092,7 +35089,7 @@ 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, 1325, __pyx_L1_error) + __PYX_ERR(0, 1326, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -35102,22 +35099,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1325, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1326, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1325, __pyx_L1_error) + 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, 1325, __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_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1325, __pyx_L1_error) + __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, 1325, __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); @@ -35125,7 +35122,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1325, __pyx_L1_error) + 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; @@ -35133,7 +35130,7 @@ 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, 1325, __pyx_L1_error) + __PYX_ERR(0, 1326, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_min_others, __pyx_t_3); @@ -35141,35 +35138,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_max_others, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1326 + /* "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, 1326, __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":1327 + /* "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, 1327, __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_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, 1327, __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, 1327, __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, 1328, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -35178,7 +35175,7 @@ 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, 1327, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1328, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -35188,7 +35185,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1327, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1328, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -35199,13 +35196,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_10; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1327, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1328, __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, 1327, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1328, __pyx_L1_error) PyErr_Clear(); } break; @@ -35215,29 +35212,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1328 + /* "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, 1328, __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, 1328, __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, 1328, __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, 1328, __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, 1328, __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":1329 + /* "constraint/constraints.py":1330 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if min(possible_prods) > t_max: # <<<<<<<<<<<<<< @@ -35250,16 +35247,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_possible_prods}; __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; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1329, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __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, 1329, __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_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1329, __pyx_L1_error) + __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":1330 + /* "constraint/constraints.py":1331 * possible_prods = [val * min_others, val * max_others] * if min(possible_prods) > t_max: * dom.remove(val) # <<<<<<<<<<<<<< @@ -35273,12 +35270,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_val}; __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_3)) __PYX_ERR(0, 1330, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1329 + /* "constraint/constraints.py":1330 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if min(possible_prods) > t_max: # <<<<<<<<<<<<<< @@ -35287,7 +35284,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1327 + /* "constraint/constraints.py":1328 * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) * dom = domains[var] * for val in dom[:]: # <<<<<<<<<<<<<< @@ -35297,7 +35294,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1324 + /* "constraint/constraints.py":1325 * t_max = max(target_dom) * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -35307,7 +35304,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1319 + /* "constraint/constraints.py":1320 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -35340,7 +35337,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1332 +/* "constraint/constraints.py":1333 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -35391,53 +35388,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, 1332, __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, 1332, __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, 1332, __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, 1332, __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, 1332, __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, 1332, __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, 1332, __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, 1332, __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, 1332, __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, 1332, __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, 1332, __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, 1332, __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, 1332, __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; } @@ -35451,7 +35448,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, 1332, __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:; @@ -35462,8 +35459,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, 1332, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1332, __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 */ @@ -35484,7 +35481,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":1368 +/* "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): # <<<<<<<<<<<<<< @@ -35504,7 +35501,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, 1368, __pyx_L1_error) + __PYX_ERR(0, 1369, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -35515,7 +35512,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, 1368, __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; @@ -35552,29 +35549,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1368, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1368, __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, 1368, __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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1368, __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, 1368, __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, 1368, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1368, __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) { @@ -35614,7 +35611,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1332 +/* "constraint/constraints.py":1333 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -35676,25 +35673,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, 1332, __pyx_L1_error) + __PYX_ERR(0, 1333, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/constraints.py":1333 + /* "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, 1333, __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, 1333, __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":1334 + /* "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 # <<<<<<<<<<<<<< @@ -35706,7 +35703,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1333 + /* "constraint/constraints.py":1334 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -35715,23 +35712,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1336 + /* "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, 1336, __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, 1336, __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":1337 + /* "constraint/constraints.py":1338 * * target_value = assignments[self.target_var] * assigned_prod = 1 # <<<<<<<<<<<<<< @@ -35741,35 +35738,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":1338 + /* "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, 1338, __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":1340 + /* "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, 1340, __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, 1340, __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, 1340, __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 (;;) { @@ -35778,7 +35775,7 @@ 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, 1340, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1341, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -35788,7 +35785,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1340, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1341, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -35799,13 +35796,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1340, __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, 1340, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1341, __pyx_L1_error) PyErr_Clear(); } break; @@ -35815,32 +35812,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1341 + /* "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, 1341, __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":1342 + /* "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, 1342, __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, 1342, __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":1341 + /* "constraint/constraints.py":1342 * * for var in self.product_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -35850,7 +35847,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint goto __pyx_L6; } - /* "constraint/constraints.py":1344 + /* "constraint/constraints.py":1345 * assigned_prod *= assignments[var] * else: * unassigned.append(var) # <<<<<<<<<<<<<< @@ -35858,11 +35855,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, 1344, __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":1340 + /* "constraint/constraints.py":1341 * unassigned = [] * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -35872,7 +35869,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1346 + /* "constraint/constraints.py":1347 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< @@ -35881,14 +35878,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_unassigned); - if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1346, __pyx_L1_error) + 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":1347 + /* "constraint/constraints.py":1348 * * if not unassigned: * return assigned_prod <= target_value # <<<<<<<<<<<<<< @@ -35896,12 +35893,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, 1347, __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":1346 + /* "constraint/constraints.py":1347 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< @@ -35910,7 +35907,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1350 + /* "constraint/constraints.py":1351 * * # Estimate max possible value of full product * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned] # <<<<<<<<<<<<<< @@ -35918,7 +35915,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, 1350, __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; @@ -35926,18 +35923,18 @@ 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, 1350, __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_GetItemRefFast(__pyx_t_6, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1350, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1351, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_9genexpr46__pyx_v_v, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = NULL; - __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr46__pyx_v_v); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1350, __pyx_L11_error) + __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; { @@ -35945,11 +35942,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1350, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1351, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); } __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, 1350, __pyx_L11_error) + __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; { @@ -35957,18 +35954,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1350, __pyx_L11_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1351, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); } - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1350, __pyx_L11_error) + __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_12, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1350, __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_12, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1350, __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_12))) __PYX_ERR(0, 1350, __pyx_L11_error) + 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; @@ -35982,7 +35979,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_v_domain_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1351 + /* "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])] # <<<<<<<<<<<<<< @@ -35990,12 +35987,12 @@ 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, 1351, __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, 1351, __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_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1351, __pyx_L23_error) + __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; @@ -36003,13 +36000,13 @@ 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, 1351, __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_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1351, __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; @@ -36017,7 +36014,7 @@ 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, 1351, __pyx_L23_error) + __PYX_ERR(0, 1352, __pyx_L23_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -36027,22 +36024,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_INCREF(__pyx_t_13); } else { __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1351, __pyx_L23_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1352, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_9); __pyx_t_13 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1351, __pyx_L23_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1352, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_13); } #else - __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1351, __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, 1351, __pyx_L23_error) + __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); #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, 1351, __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); @@ -36050,7 +36047,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < (0)) __PYX_ERR(0, 1351, __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; @@ -36058,22 +36055,22 @@ 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, 1351, __pyx_L23_error) + __PYX_ERR(0, 1352, __pyx_L23_error) __pyx_L27_unpacking_done:; } __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_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1351, __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_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, 1351, __pyx_L23_error); + 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, 1351, __pyx_L23_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_12, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1351, __pyx_L23_error) + 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; @@ -36086,10 +36083,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint goto __pyx_L18_error; __pyx_L29_exit_scope:; } /* exit inner scope */ - __pyx_t_10 = PySequence_Tuple(__pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1351, __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_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, 1351, __pyx_L18_error) + __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; @@ -36098,9 +36095,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1351, __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, 1351, __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_12); __pyx_t_12 = 0; for (;;) { @@ -36109,7 +36106,7 @@ 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, 1351, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1352, __pyx_L18_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -36119,7 +36116,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1351, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1352, __pyx_L18_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -36130,13 +36127,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1351, __pyx_L18_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1352, __pyx_L18_error) } else { __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, 1351, __pyx_L18_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1352, __pyx_L18_error) PyErr_Clear(); } break; @@ -36152,10 +36149,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint 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_12)) __PYX_ERR(0, 1351, __pyx_L18_error) + 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_12))) __PYX_ERR(0, 1351, __pyx_L18_error) + 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; @@ -36169,7 +36166,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_v_candidates = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1352 + /* "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] # <<<<<<<<<<<<<< @@ -36177,7 +36174,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, 1352, __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; @@ -36185,19 +36182,19 @@ 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, 1352, __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_12 = __Pyx_PyList_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1352, __pyx_L34_error) + 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, 1352, __pyx_L34_error) + __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, 1352, __pyx_L34_error) + 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; @@ -36211,7 +36208,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_v_possible_prods = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1353 + /* "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: # <<<<<<<<<<<<<< @@ -36224,16 +36221,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_possible_prods}; __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; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __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, 1353, __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_10); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1353, __pyx_L1_error) + __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":1354 + /* "constraint/constraints.py":1355 * possible_prods = [assigned_prod * c for c in candidates] * if min(possible_prods) > target_value: * return False # <<<<<<<<<<<<<< @@ -36245,7 +36242,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1353 + /* "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: # <<<<<<<<<<<<<< @@ -36254,17 +36251,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1356 + /* "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, 1356, __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":1357 + /* "constraint/constraints.py":1358 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< @@ -36277,18 +36274,18 @@ 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, 1357, __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_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __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":1358 + /* "constraint/constraints.py":1359 * if forwardcheck: * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] # <<<<<<<<<<<<<< @@ -36296,7 +36293,7 @@ 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, 1358, __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_12 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_12); __pyx_t_16 = 0; @@ -36304,21 +36301,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1358, __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_GetItemRefFast(__pyx_t_12, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1358, __pyx_L45_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1359, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_9genexpr50__pyx_v_v, __pyx_t_6); __pyx_t_6 = 0; - __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, 1358, __pyx_L45_error) - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1358, __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_9genexpr50__pyx_v_v))) __PYX_ERR(0, 1358, __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_12); __pyx_t_12 = 0; @@ -36332,7 +36329,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_other_unassigned, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1359 + /* "constraint/constraints.py":1360 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< @@ -36341,13 +36338,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ { 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, 1359, __pyx_L1_error) + 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":1360 + /* "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] # <<<<<<<<<<<<<< @@ -36355,7 +36352,7 @@ 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, 1360, __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_12 = __pyx_v_other_unassigned; __Pyx_INCREF(__pyx_t_12); __pyx_t_16 = 0; @@ -36363,18 +36360,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1360, __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_GetItemRefFast(__pyx_t_12, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1360, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1361, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_9genexpr51__pyx_v_v, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = NULL; - __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr51__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1360, __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_11 = 1; { @@ -36382,11 +36379,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1360, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1361, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_6); } __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, 1360, __pyx_L54_error) + __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; { @@ -36394,18 +36391,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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, 1360, __pyx_L54_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1361, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_13); } - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1360, __pyx_L54_error) + __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_9, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1360, __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, 1360, __pyx_L54_error); + 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_13 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1360, __pyx_L54_error) + 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_12); __pyx_t_12 = 0; @@ -36419,7 +36416,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_bounds, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1361 + /* "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])] # <<<<<<<<<<<<<< @@ -36427,12 +36424,12 @@ 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, 1361, __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_12, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1361, __pyx_L61_error) + __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_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1361, __pyx_L66_error) + __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; @@ -36440,13 +36437,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1361, __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_GetItemRefFast(__pyx_t_13, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1361, __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; @@ -36454,7 +36451,7 @@ 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, 1361, __pyx_L66_error) + __PYX_ERR(0, 1362, __pyx_L66_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -36464,22 +36461,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_INCREF(__pyx_t_14); } else { __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1361, __pyx_L66_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1362, __pyx_L66_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_14 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1361, __pyx_L66_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1362, __pyx_L66_error) __Pyx_XGOTREF(__pyx_t_14); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1361, __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, 1361, __pyx_L66_error) + __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); #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, 1361, __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); @@ -36487,7 +36484,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __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); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_17), 2) < (0)) __PYX_ERR(0, 1361, __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; @@ -36495,22 +36492,22 @@ 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, 1361, __pyx_L66_error) + __PYX_ERR(0, 1362, __pyx_L66_error) __pyx_L70_unpacking_done:; } __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_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1361, __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_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, 1361, __pyx_L66_error); + 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, 1361, __pyx_L66_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1361, __pyx_L66_error) + 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_13); __pyx_t_13 = 0; @@ -36523,10 +36520,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint goto __pyx_L61_error; __pyx_L72_exit_scope:; } /* exit inner scope */ - __pyx_t_13 = PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1361, __pyx_L61_error) + __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, 1361, __pyx_L61_error) + __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; @@ -36535,9 +36532,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_t_16 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_16 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1361, __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, 1361, __pyx_L61_error) + __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_9); __pyx_t_9 = 0; for (;;) { @@ -36546,7 +36543,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1361, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1362, __pyx_L61_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -36556,7 +36553,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1361, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1362, __pyx_L61_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -36567,13 +36564,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1361, __pyx_L61_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1362, __pyx_L61_error) } else { __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, 1361, __pyx_L61_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1362, __pyx_L61_error) PyErr_Clear(); } break; @@ -36589,10 +36586,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint 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, 1361, __pyx_L61_error) + 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_9))) __PYX_ERR(0, 1361, __pyx_L61_error) + 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_13); __pyx_t_13 = 0; @@ -36606,7 +36603,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_other_products, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1359 + /* "constraint/constraints.py":1360 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< @@ -36616,7 +36613,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint goto __pyx_L51; } - /* "constraint/constraints.py":1363 + /* "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] # <<<<<<<<<<<<<< @@ -36624,45 +36621,45 @@ 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, 1363, __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, 1363, __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":1365 + /* "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, 1365, __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":1366 + /* "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, 1366, __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_13 = __pyx_t_1; __Pyx_INCREF(__pyx_t_13); __pyx_t_16 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_16 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1366, __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, 1366, __pyx_L1_error) + __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 (;;) { @@ -36671,7 +36668,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1366, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1367, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -36681,7 +36678,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1366, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1367, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } @@ -36692,13 +36689,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1367, __pyx_L1_error) } else { __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, 1366, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1367, __pyx_L1_error) PyErr_Clear(); } break; @@ -36708,7 +36705,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1367 + /* "constraint/constraints.py":1368 * domain = domains[var] * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] # <<<<<<<<<<<<<< @@ -36716,7 +36713,7 @@ 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, 1367, __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_9 = __pyx_v_other_products; __Pyx_INCREF(__pyx_t_9); __pyx_t_18 = 0; @@ -36724,22 +36721,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { 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, 1367, __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_12 = __Pyx_PyList_GetItemRefFast(__pyx_t_9, __pyx_t_18, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_18; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1367, __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, 1367, __pyx_L79_error) + __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, 1367, __pyx_L79_error) + __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_12); __pyx_t_12 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1367, __pyx_L79_error) + 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_9); __pyx_t_9 = 0; @@ -36753,23 +36750,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_prods, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1368 + /* "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, 1368, __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_9 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1368, __pyx_L1_error) + __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_9); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1368, __pyx_L1_error) + __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":1369 + /* "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) # <<<<<<<<<<<<<< @@ -36783,12 +36780,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_val}; __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_9)) __PYX_ERR(0, 1369, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":1368 + /* "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): # <<<<<<<<<<<<<< @@ -36797,7 +36794,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1366 + /* "constraint/constraints.py":1367 * * domain = domains[var] * for val in domain[:]: # <<<<<<<<<<<<<< @@ -36807,18 +36804,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "constraint/constraints.py":1370 + /* "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, 1370, __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":1371 + /* "constraint/constraints.py":1372 * domain.hideValue(val) * if not domain: * return False # <<<<<<<<<<<<<< @@ -36831,7 +36828,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1370 + /* "constraint/constraints.py":1371 * if all(p > target_value for p in prods): * domain.hideValue(val) * if not domain: # <<<<<<<<<<<<<< @@ -36840,7 +36837,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1357 + /* "constraint/constraints.py":1358 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< @@ -36850,7 +36847,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "constraint/constraints.py":1356 + /* "constraint/constraints.py":1357 * return False * * if forwardcheck: # <<<<<<<<<<<<<< @@ -36859,7 +36856,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1373 + /* "constraint/constraints.py":1374 * return False * * return True # <<<<<<<<<<<<<< @@ -36871,7 +36868,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1332 + /* "constraint/constraints.py":1333 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -36923,7 +36920,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1387 +/* "constraint/constraints.py":1388 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -36972,39 +36969,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, 1387, __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, 1387, __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, 1387, __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, 1387, __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, 1387, __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, 1387, __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, 1387, __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, 1387, __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:; @@ -37033,16 +37030,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1393 + /* "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, 1393, __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":1387 + /* "constraint/constraints.py":1388 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -37062,7 +37059,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( return __pyx_r; } -/* "constraint/constraints.py":1395 +/* "constraint/constraints.py":1396 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -37113,53 +37110,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, 1395, __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, 1395, __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, 1395, __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, 1395, __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, 1395, __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, 1395, __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, 1395, __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, 1395, __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, 1395, __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, 1395, __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, 1395, __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, 1395, __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, 1395, __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; } @@ -37173,7 +37170,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, 1395, __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:; @@ -37205,7 +37202,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1397 + /* "constraint/constraints.py":1398 * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 * # preProcess() will remove it. * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< @@ -37218,14 +37215,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Can_t_happen}; __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; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __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, 1397, __pyx_L1_error) + __PYX_ERR(0, 1398, __pyx_L1_error) - /* "constraint/constraints.py":1395 + /* "constraint/constraints.py":1396 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -37244,7 +37241,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ return __pyx_r; } -/* "constraint/constraints.py":1399 +/* "constraint/constraints.py":1400 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -37295,50 +37292,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, 1399, __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, 1399, __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, 1399, __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, 1399, __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, 1399, __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, 1399, __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, 1399, __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, 1399, __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, 1399, __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, 1399, __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, 1399, __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, 1399, __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, 1399, __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]; @@ -37348,7 +37345,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, 1399, __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:; @@ -37359,9 +37356,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, 1399, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1399, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1399, __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 */ @@ -37404,19 +37401,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1400 + /* "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, 1400, __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":1401 + /* "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: # <<<<<<<<<<<<<< @@ -37428,9 +37425,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, 1401, __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, 1401, __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)) { @@ -37438,7 +37435,7 @@ 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, 1401, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1402, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -37448,7 +37445,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce { 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, 1401, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1402, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -37459,13 +37456,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1401, __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, 1401, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1402, __pyx_L1_error) PyErr_Clear(); } break; @@ -37475,35 +37472,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":1402 + /* "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, 1402, __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":1403 + /* "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, 1403, __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, 1403, __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, 1403, __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 (;;) { @@ -37512,7 +37509,7 @@ 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, 1403, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1404, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -37522,7 +37519,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce { 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, 1403, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1404, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -37533,13 +37530,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1403, __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, 1403, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1404, __pyx_L1_error) PyErr_Clear(); } break; @@ -37549,17 +37546,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":1404 + /* "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, 1404, __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":1405 + /* "constraint/constraints.py":1406 * for value in domain[:]: * if value not in set: * domain.remove(value) # <<<<<<<<<<<<<< @@ -37573,12 +37570,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_value}; __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, 1405, __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":1404 + /* "constraint/constraints.py":1405 * domain = domains[variable] * for value in domain[:]: * if value not in set: # <<<<<<<<<<<<<< @@ -37587,7 +37584,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce */ } - /* "constraint/constraints.py":1403 + /* "constraint/constraints.py":1404 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -37597,25 +37594,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1406 + /* "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, 1406, __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, 1406, __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, 1406, __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, 1406, __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}; @@ -37623,12 +37620,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce __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, 1406, __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":1401 + /* "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: # <<<<<<<<<<<<<< @@ -37638,27 +37635,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1407 + /* "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, 1407, __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, 1407, __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, 1407, __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, 1407, __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":1399 + /* "constraint/constraints.py":1400 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -37687,7 +37684,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce return __pyx_r; } -/* "constraint/constraints.py":1421 +/* "constraint/constraints.py":1422 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -37736,39 +37733,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, 1421, __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, 1421, __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, 1421, __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, 1421, __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, 1421, __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, 1421, __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, 1421, __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, 1421, __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:; @@ -37797,16 +37794,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1427 + /* "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, 1427, __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":1421 + /* "constraint/constraints.py":1422 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -37826,7 +37823,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init return __pyx_r; } -/* "constraint/constraints.py":1429 +/* "constraint/constraints.py":1430 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -37877,53 +37874,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, 1429, __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, 1429, __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, 1429, __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, 1429, __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, 1429, __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, 1429, __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, 1429, __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, 1429, __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, 1429, __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, 1429, __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, 1429, __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, 1429, __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, 1429, __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; } @@ -37937,7 +37934,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, 1429, __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:; @@ -37969,7 +37966,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1431 + /* "constraint/constraints.py":1432 * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 * # preProcess() will remove it. * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< @@ -37982,14 +37979,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Can_t_happen}; __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; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1431, __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, 1431, __pyx_L1_error) + __PYX_ERR(0, 1432, __pyx_L1_error) - /* "constraint/constraints.py":1429 + /* "constraint/constraints.py":1430 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -38008,7 +38005,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal return __pyx_r; } -/* "constraint/constraints.py":1433 +/* "constraint/constraints.py":1434 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -38059,50 +38056,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, 1433, __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, 1433, __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, 1433, __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, 1433, __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, 1433, __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, 1433, __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, 1433, __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, 1433, __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, 1433, __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, 1433, __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, 1433, __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, 1433, __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, 1433, __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]; @@ -38112,7 +38109,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, 1433, __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:; @@ -38123,9 +38120,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, 1433, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1433, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1433, __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 */ @@ -38168,19 +38165,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1434 + /* "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, 1434, __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":1435 + /* "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: # <<<<<<<<<<<<<< @@ -38192,9 +38189,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, 1435, __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, 1435, __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)) { @@ -38202,7 +38199,7 @@ 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, 1435, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1436, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -38212,7 +38209,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr { 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, 1435, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1436, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -38223,13 +38220,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1435, __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, 1435, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1436, __pyx_L1_error) PyErr_Clear(); } break; @@ -38239,35 +38236,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":1436 + /* "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, 1436, __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":1437 + /* "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, 1437, __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, 1437, __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, 1437, __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 (;;) { @@ -38276,7 +38273,7 @@ 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, 1437, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1438, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -38286,7 +38283,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr { 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, 1437, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1438, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -38297,13 +38294,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1437, __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, 1437, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1438, __pyx_L1_error) PyErr_Clear(); } break; @@ -38313,17 +38310,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":1438 + /* "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, 1438, __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":1439 + /* "constraint/constraints.py":1440 * for value in domain[:]: * if value in set: * domain.remove(value) # <<<<<<<<<<<<<< @@ -38337,12 +38334,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_value}; __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, 1439, __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":1438 + /* "constraint/constraints.py":1439 * domain = domains[variable] * for value in domain[:]: * if value in set: # <<<<<<<<<<<<<< @@ -38351,7 +38348,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr */ } - /* "constraint/constraints.py":1437 + /* "constraint/constraints.py":1438 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -38361,25 +38358,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1440 + /* "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, 1440, __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, 1440, __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, 1440, __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, 1440, __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}; @@ -38387,12 +38384,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr __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, 1440, __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":1435 + /* "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: # <<<<<<<<<<<<<< @@ -38402,27 +38399,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1441 + /* "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, 1441, __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, 1441, __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, 1441, __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, 1441, __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":1433 + /* "constraint/constraints.py":1434 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -38451,7 +38448,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr return __pyx_r; } -/* "constraint/constraints.py":1455 +/* "constraint/constraints.py":1456 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -38502,50 +38499,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, 1455, __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, 1455, __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, 1455, __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, 1455, __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, 1455, __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, 1455, __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, 1455, __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, 1455, __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, 1455, __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, 1455, __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, 1455, __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; } @@ -38559,7 +38556,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, 1455, __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:; @@ -38588,34 +38585,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1465 + /* "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, 1465, __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":1466 + /* "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, 1466, __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":1467 + /* "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, 1467, __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":1455 + /* "constraint/constraints.py":1456 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -38635,7 +38632,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini return __pyx_r; } -/* "constraint/constraints.py":1469 +/* "constraint/constraints.py":1470 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -38686,53 +38683,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, 1469, __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, 1469, __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, 1469, __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, 1469, __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, 1469, __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, 1469, __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, 1469, __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, 1469, __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, 1469, __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, 1469, __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, 1469, __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, 1469, __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, 1469, __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; } @@ -38746,7 +38743,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, 1469, __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:; @@ -38757,8 +38754,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, 1469, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1469, __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 */ @@ -38803,19 +38800,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1470 + /* "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, 1470, __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":1471 + /* "constraint/constraints.py":1472 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * set = self._set * missing = 0 # <<<<<<<<<<<<<< @@ -38825,7 +38822,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":1472 + /* "constraint/constraints.py":1473 * set = self._set * missing = 0 * found = 0 # <<<<<<<<<<<<<< @@ -38835,7 +38832,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":1473 + /* "constraint/constraints.py":1474 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -38847,9 +38844,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, 1473, __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, 1473, __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)) { @@ -38857,7 +38854,7 @@ 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, 1473, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1474, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -38867,7 +38864,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { 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, 1473, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1474, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -38878,13 +38875,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1473, __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, 1473, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1474, __pyx_L1_error) PyErr_Clear(); } break; @@ -38894,36 +38891,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":1474 + /* "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, 1474, __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":1475 + /* "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, 1475, __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, 1475, __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, 1475, __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, 1475, __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":1474 + /* "constraint/constraints.py":1475 * found = 0 * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -38933,7 +38930,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L5; } - /* "constraint/constraints.py":1477 + /* "constraint/constraints.py":1478 * found += assignments[variable] in set * else: * missing += 1 # <<<<<<<<<<<<<< @@ -38941,14 +38938,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, 1477, __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":1473 + /* "constraint/constraints.py":1474 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -38958,53 +38955,53 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1478 + /* "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, 1478, __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":1479 + /* "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, 1479, __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, 1479, __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":1480 + /* "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, 1480, __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, 1480, __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, 1480, __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, 1480, __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, 1480, __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":1481 + /* "constraint/constraints.py":1482 * if self._exact: * if not (found <= self._n <= missing + found): * return False # <<<<<<<<<<<<<< @@ -39016,7 +39013,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1480 + /* "constraint/constraints.py":1481 * if missing: * if self._exact: * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< @@ -39025,7 +39022,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1479 + /* "constraint/constraints.py":1480 * missing += 1 * if missing: * if self._exact: # <<<<<<<<<<<<<< @@ -39035,7 +39032,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L8; } - /* "constraint/constraints.py":1483 + /* "constraint/constraints.py":1484 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -39043,18 +39040,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, 1483, __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, 1483, __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, 1483, __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, 1483, __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":1484 + /* "constraint/constraints.py":1485 * else: * if self._n > missing + found: * return False # <<<<<<<<<<<<<< @@ -39066,7 +39063,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1483 + /* "constraint/constraints.py":1484 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -39077,33 +39074,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __pyx_L8:; - /* "constraint/constraints.py":1485 + /* "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, 1485, __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, 1485, __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, 1485, __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, 1485, __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, 1485, __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":1488 + /* "constraint/constraints.py":1489 * # All unassigned variables must be assigned to * # values in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -39115,9 +39112,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, 1488, __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, 1488, __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)) { @@ -39125,7 +39122,7 @@ 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, 1488, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1489, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -39135,7 +39132,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { 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, 1488, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1489, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -39146,13 +39143,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1488, __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, 1488, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1489, __pyx_L1_error) PyErr_Clear(); } break; @@ -39162,45 +39159,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":1489 + /* "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, 1489, __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":1490 + /* "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, 1490, __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":1491 + /* "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, 1491, __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, 1491, __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, 1491, __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 (;;) { @@ -39209,7 +39206,7 @@ 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, 1491, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1492, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -39219,7 +39216,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { 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, 1491, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1492, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -39230,13 +39227,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1491, __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, 1491, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1492, __pyx_L1_error) PyErr_Clear(); } break; @@ -39246,17 +39243,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":1492 + /* "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, 1492, __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":1493 + /* "constraint/constraints.py":1494 * for value in domain[:]: * if value not in set: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -39270,12 +39267,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_value}; __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, 1493, __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":1492 + /* "constraint/constraints.py":1493 * domain = domains[variable] * for value in domain[:]: * if value not in set: # <<<<<<<<<<<<<< @@ -39284,7 +39281,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1491 + /* "constraint/constraints.py":1492 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -39294,18 +39291,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1494 + /* "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, 1494, __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":1495 + /* "constraint/constraints.py":1496 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -39318,7 +39315,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":1494 + /* "constraint/constraints.py":1495 * if value not in set: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -39327,7 +39324,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1489 + /* "constraint/constraints.py":1490 * # values in the set. * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -39336,7 +39333,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1488 + /* "constraint/constraints.py":1489 * # All unassigned variables must be assigned to * # values in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -39346,7 +39343,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1485 + /* "constraint/constraints.py":1486 * if self._n > missing + found: * return False * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< @@ -39355,7 +39352,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1478 + /* "constraint/constraints.py":1479 * else: * missing += 1 * if missing: # <<<<<<<<<<<<<< @@ -39365,7 +39362,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L7; } - /* "constraint/constraints.py":1497 + /* "constraint/constraints.py":1498 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -39373,28 +39370,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, 1497, __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, 1497, __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":1498 + /* "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, 1498, __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, 1498, __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, 1498, __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":1499 + /* "constraint/constraints.py":1500 * if self._exact: * if found != self._n: * return False # <<<<<<<<<<<<<< @@ -39406,7 +39403,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1498 + /* "constraint/constraints.py":1499 * else: * if self._exact: * if found != self._n: # <<<<<<<<<<<<<< @@ -39415,7 +39412,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1497 + /* "constraint/constraints.py":1498 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -39425,7 +39422,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L23; } - /* "constraint/constraints.py":1501 + /* "constraint/constraints.py":1502 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -39433,15 +39430,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, 1501, __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, 1501, __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, 1501, __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":1502 + /* "constraint/constraints.py":1503 * else: * if found < self._n: * return False # <<<<<<<<<<<<<< @@ -39453,7 +39450,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1501 + /* "constraint/constraints.py":1502 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -39466,7 +39463,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __pyx_L7:; - /* "constraint/constraints.py":1503 + /* "constraint/constraints.py":1504 * if found < self._n: * return False * return True # <<<<<<<<<<<<<< @@ -39478,7 +39475,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1469 + /* "constraint/constraints.py":1470 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -39506,7 +39503,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca return __pyx_r; } -/* "constraint/constraints.py":1517 +/* "constraint/constraints.py":1518 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -39557,50 +39554,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, 1517, __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, 1517, __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, 1517, __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, 1517, __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, 1517, __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, 1517, __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, 1517, __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, 1517, __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, 1517, __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, 1517, __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, 1517, __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; } @@ -39614,7 +39611,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, 1517, __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:; @@ -39643,34 +39640,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1527 + /* "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, 1527, __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":1528 + /* "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, 1528, __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":1529 + /* "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, 1529, __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":1517 + /* "constraint/constraints.py":1518 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -39690,7 +39687,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ return __pyx_r; } -/* "constraint/constraints.py":1531 +/* "constraint/constraints.py":1532 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -39741,53 +39738,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, 1531, __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, 1531, __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, 1531, __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, 1531, __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, 1531, __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, 1531, __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, 1531, __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, 1531, __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, 1531, __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, 1531, __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, 1531, __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, 1531, __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, 1531, __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; } @@ -39801,7 +39798,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, 1531, __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:; @@ -39812,8 +39809,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, 1531, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1531, __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 */ @@ -39858,19 +39855,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1532 + /* "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, 1532, __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":1533 + /* "constraint/constraints.py":1534 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * set = self._set * missing = 0 # <<<<<<<<<<<<<< @@ -39880,7 +39877,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":1534 + /* "constraint/constraints.py":1535 * set = self._set * missing = 0 * found = 0 # <<<<<<<<<<<<<< @@ -39890,7 +39887,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":1535 + /* "constraint/constraints.py":1536 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -39902,9 +39899,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, 1535, __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, 1535, __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)) { @@ -39912,7 +39909,7 @@ 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, 1535, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1536, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -39922,7 +39919,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_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, 1535, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1536, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -39933,13 +39930,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1535, __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, 1535, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1536, __pyx_L1_error) PyErr_Clear(); } break; @@ -39949,36 +39946,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":1536 + /* "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, 1536, __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":1537 + /* "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, 1537, __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, 1537, __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, 1537, __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, 1537, __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":1536 + /* "constraint/constraints.py":1537 * found = 0 * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -39988,7 +39985,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L5; } - /* "constraint/constraints.py":1539 + /* "constraint/constraints.py":1540 * found += assignments[variable] not in set * else: * missing += 1 # <<<<<<<<<<<<<< @@ -39996,14 +39993,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, 1539, __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":1535 + /* "constraint/constraints.py":1536 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -40013,53 +40010,53 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1540 + /* "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, 1540, __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":1541 + /* "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, 1541, __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, 1541, __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":1542 + /* "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, 1542, __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, 1542, __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, 1542, __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, 1542, __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, 1542, __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":1543 + /* "constraint/constraints.py":1544 * if self._exact: * if not (found <= self._n <= missing + found): * return False # <<<<<<<<<<<<<< @@ -40071,7 +40068,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1542 + /* "constraint/constraints.py":1543 * if missing: * if self._exact: * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< @@ -40080,7 +40077,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1541 + /* "constraint/constraints.py":1542 * missing += 1 * if missing: * if self._exact: # <<<<<<<<<<<<<< @@ -40090,7 +40087,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L8; } - /* "constraint/constraints.py":1545 + /* "constraint/constraints.py":1546 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -40098,18 +40095,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, 1545, __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, 1545, __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, 1545, __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, 1545, __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":1546 + /* "constraint/constraints.py":1547 * else: * if self._n > missing + found: * return False # <<<<<<<<<<<<<< @@ -40121,7 +40118,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1545 + /* "constraint/constraints.py":1546 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -40132,33 +40129,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __pyx_L8:; - /* "constraint/constraints.py":1547 + /* "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, 1547, __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, 1547, __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, 1547, __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, 1547, __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, 1547, __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":1550 + /* "constraint/constraints.py":1551 * # All unassigned variables must be assigned to * # values not in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -40170,9 +40167,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, 1550, __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, 1550, __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)) { @@ -40180,7 +40177,7 @@ 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, 1550, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1551, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -40190,7 +40187,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ { 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, 1550, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1551, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -40201,13 +40198,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1550, __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, 1550, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1551, __pyx_L1_error) PyErr_Clear(); } break; @@ -40217,45 +40214,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":1551 + /* "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, 1551, __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":1552 + /* "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, 1552, __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":1553 + /* "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, 1553, __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, 1553, __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, 1553, __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 (;;) { @@ -40264,7 +40261,7 @@ 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, 1553, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1554, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -40274,7 +40271,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ { 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, 1553, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1554, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -40285,13 +40282,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1553, __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, 1553, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1554, __pyx_L1_error) PyErr_Clear(); } break; @@ -40301,17 +40298,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":1554 + /* "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, 1554, __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":1555 + /* "constraint/constraints.py":1556 * for value in domain[:]: * if value in set: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -40325,12 +40322,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_value}; __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, 1555, __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":1554 + /* "constraint/constraints.py":1555 * domain = domains[variable] * for value in domain[:]: * if value in set: # <<<<<<<<<<<<<< @@ -40339,7 +40336,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1553 + /* "constraint/constraints.py":1554 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -40349,18 +40346,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1556 + /* "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, 1556, __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":1557 + /* "constraint/constraints.py":1558 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -40373,7 +40370,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1556 + /* "constraint/constraints.py":1557 * if value in set: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -40382,7 +40379,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1551 + /* "constraint/constraints.py":1552 * # values not in the set. * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -40391,7 +40388,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1550 + /* "constraint/constraints.py":1551 * # All unassigned variables must be assigned to * # values not in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -40401,7 +40398,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1547 + /* "constraint/constraints.py":1548 * if self._n > missing + found: * return False * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< @@ -40410,7 +40407,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1540 + /* "constraint/constraints.py":1541 * else: * missing += 1 * if missing: # <<<<<<<<<<<<<< @@ -40420,7 +40417,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L7; } - /* "constraint/constraints.py":1559 + /* "constraint/constraints.py":1560 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -40428,28 +40425,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, 1559, __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, 1559, __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":1560 + /* "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, 1560, __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, 1560, __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, 1560, __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":1561 + /* "constraint/constraints.py":1562 * if self._exact: * if found != self._n: * return False # <<<<<<<<<<<<<< @@ -40461,7 +40458,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1560 + /* "constraint/constraints.py":1561 * else: * if self._exact: * if found != self._n: # <<<<<<<<<<<<<< @@ -40470,7 +40467,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1559 + /* "constraint/constraints.py":1560 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -40480,7 +40477,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L23; } - /* "constraint/constraints.py":1563 + /* "constraint/constraints.py":1564 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -40488,15 +40485,15 @@ 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, 1563, __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, 1563, __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, 1563, __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":1564 + /* "constraint/constraints.py":1565 * else: * if found < self._n: * return False # <<<<<<<<<<<<<< @@ -40508,7 +40505,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1563 + /* "constraint/constraints.py":1564 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -40521,7 +40518,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __pyx_L7:; - /* "constraint/constraints.py":1565 + /* "constraint/constraints.py":1566 * if found < self._n: * return False * return True # <<<<<<<<<<<<<< @@ -40533,7 +40530,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1531 + /* "constraint/constraints.py":1532 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -40561,7 +40558,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ return __pyx_r; } -/* "constraint/constraints.py":1570 +/* "constraint/constraints.py":1571 * # Utility functions * * def sum_other_vars(variables: Sequence, variable, values: dict): # <<<<<<<<<<<<<< @@ -40611,38 +40608,38 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { 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, 1570, __pyx_L3_error) + 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, 1570, __pyx_L3_error) + 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, 1570, __pyx_L3_error) + 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, 1570, __pyx_L3_error) + 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, 1570, __pyx_L3_error) + 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, 1570, __pyx_L3_error) } + 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, 1570, __pyx_L3_error) + 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, 1570, __pyx_L3_error) + 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, 1570, __pyx_L3_error) + 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]; @@ -40650,7 +40647,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("sum_other_vars", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1570, __pyx_L3_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:; @@ -40661,7 +40658,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __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, 1570, __pyx_L1_error) + 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 */ @@ -40682,7 +40679,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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":1572 +/* "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) # <<<<<<<<<<<<<< @@ -40700,7 +40697,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_14sum_other_vars_genexpr(Py 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, 1572, __pyx_L1_error) + __PYX_ERR(0, 1573, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -40711,7 +40708,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_14sum_other_vars_genexpr(Py __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, 1572, __pyx_L1_error) + __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; @@ -40751,17 +40748,17 @@ static PyObject *__pyx_gb_10constraint_11constraints_14sum_other_vars_2generator __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, 1572, __pyx_L1_error) + __PYX_ERR(0, 1573, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1572, __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, 1572, __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, 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, 1572, __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, 1573, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -40769,7 +40766,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_14sum_other_vars_2generator { 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, 1572, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1573, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -40779,7 +40776,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_14sum_other_vars_2generator { 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, 1572, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1573, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -40790,13 +40787,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_14sum_other_vars_2generator #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1572, __pyx_L1_error) + 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, 1572, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1573, __pyx_L1_error) PyErr_Clear(); } break; @@ -40807,17 +40804,17 @@ static PyObject *__pyx_gb_10constraint_11constraints_14sum_other_vars_2generator __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, 1572, __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, 1572, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1572, __pyx_L1_error) + 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, 1572, __pyx_L1_error) } + 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, 1572, __pyx_L1_error) + __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, 1572, __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; @@ -40837,7 +40834,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_14sum_other_vars_2generator __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, 1572, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1573, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -40864,7 +40861,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_14sum_other_vars_2generator return __pyx_r; } -/* "constraint/constraints.py":1570 +/* "constraint/constraints.py":1571 * # Utility functions * * def sum_other_vars(variables: Sequence, variable, values: dict): # <<<<<<<<<<<<<< @@ -40889,7 +40886,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_sum_other_vars(CYTHON_UNUSE 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, 1570, __pyx_L1_error) + __PYX_ERR(0, 1571, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -40900,14 +40897,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_sum_other_vars(CYTHON_UNUSE __Pyx_INCREF(__pyx_cur_scope->__pyx_v_values); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_values); - /* "constraint/constraints.py":1572 + /* "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, 1572, __pyx_L1_error) + __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; { @@ -40915,14 +40912,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_sum_other_vars(CYTHON_UNUSE __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, 1572, __pyx_L1_error) + 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":1570 + /* "constraint/constraints.py":1571 * # Utility functions * * def sum_other_vars(variables: Sequence, variable, values: dict): # <<<<<<<<<<<<<< @@ -45026,15 +45023,15 @@ 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); @@ -45045,15 +45042,15 @@ 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, 432, __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, 432, __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, 432, __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); @@ -45064,15 +45061,15 @@ 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, 435, __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, 435, __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, 435, __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); @@ -45083,15 +45080,15 @@ 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, 449, __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, 449, __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, 449, __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); @@ -45102,15 +45099,15 @@ 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, 450, __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, 450, __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, 450, __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); @@ -45121,15 +45118,15 @@ 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, 614, __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, 614, __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, 614, __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); @@ -45140,15 +45137,15 @@ 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, 617, __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, 617, __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, 617, __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); @@ -45159,15 +45156,15 @@ 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, 625, __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, 625, __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, 625, __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); @@ -45178,15 +45175,15 @@ 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, 793, __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, 793, __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, 793, __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); @@ -45197,15 +45194,15 @@ 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_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, 796, __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, 796, __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_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_preProcess) < (0)) __PYX_ERR(0, 796, __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); @@ -45216,15 +45213,15 @@ 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_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, 804, __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, 804, __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_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_genexpr) < (0)) __PYX_ERR(0, 804, __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); @@ -45235,15 +45232,15 @@ 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_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, 869, __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, 869, __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, 869, __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); @@ -45254,15 +45251,15 @@ 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, 898, __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, 898, __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, 898, __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); @@ -45273,15 +45270,15 @@ 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, 989, __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, 989, __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, 989, __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__); @@ -45292,15 +45289,15 @@ 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, 1012, __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, 1012, __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, 1012, __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); @@ -45311,15 +45308,15 @@ 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, 1013, __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, 1013, __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, 1013, __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); @@ -45330,15 +45327,15 @@ 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___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, 1145, __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, 1145, __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___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___call__) < (0)) __PYX_ERR(0, 1145, __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__); @@ -45349,15 +45346,15 @@ 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_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, 1181, __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, 1181, __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_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_genexpr) < (0)) __PYX_ERR(0, 1181, __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); @@ -45368,15 +45365,15 @@ 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_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, 1221, __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, 1221, __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, 1221, __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); @@ -45387,15 +45384,15 @@ 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, 1250, __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, 1250, __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, 1250, __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); @@ -45406,15 +45403,15 @@ 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, 1332, __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, 1332, __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, 1332, __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__); @@ -45425,15 +45422,15 @@ 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, 1368, __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, 1368, __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, 1368, __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); @@ -45444,15 +45441,15 @@ 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_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, 1570, __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, 1570, __pyx_L1_error) + __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, 1570, __pyx_L1_error) + 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); @@ -45463,15 +45460,15 @@ 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_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, 1572, __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, 1572, __pyx_L1_error) + __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, 1572, __pyx_L1_error) + 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); @@ -45790,19 +45787,19 @@ __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 + * */ { - 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, 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); { - PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Unassigned}; - __pyx_t_3 = 0; { + 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) @@ -45813,20 +45810,20 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 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 */ { - PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Callable,__pyx_mstate_global->__pyx_n_u_Union,__pyx_mstate_global->__pyx_n_u_Optional}; - __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_typing, __pyx_imported_names, 3, NULL, 0); if (unlikely(!__pyx_t_1)) __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); { - PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Callable,__pyx_mstate_global->__pyx_n_u_Union,__pyx_mstate_global->__pyx_n_u_Optional}; - for (__pyx_t_3=0; __pyx_t_3 < 3; __pyx_t_3++) { + 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) @@ -45835,45 +45832,21 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 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 * -*/ - { - PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Sequence}; - __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, 5, __pyx_L1_error) - } - __pyx_t_2 = __pyx_t_1; - __Pyx_GOTREF(__pyx_t_2); - { - PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Sequence}; - __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/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: */ { - 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, 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); { - PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_product}; + 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); @@ -45883,29 +45856,29 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 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_4 = __Pyx_PyDict_NewPresized(3); 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); - if (PyDict_SetItem(__pyx_t_4, __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_4, __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_4, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 11, __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, 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); @@ -45913,51 +45886,51 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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, 11, __pyx_L1_error) + 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_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __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, 36, __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, 36, __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, 36, __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, 36, __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, 36, __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, 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 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, 36, __pyx_L1_error) + 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; - /* "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_4 = __Pyx_PyDict_NewPresized(3); 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 (PyDict_SetItem(__pyx_t_4, __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_4, __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_4, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 64, __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, 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); #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, 64, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 64, __pyx_L1_error) + 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); @@ -45965,65 +45938,65 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 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, 64, __pyx_L1_error) + 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_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, 8, __pyx_L1_error) + __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, 8, __pyx_L1_error) + 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_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 105, __pyx_L1_error) + __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_5); 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_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __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, 105, __pyx_L1_error) + __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, 105, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 106, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":133 + /* "constraint/constraints.py":134 * """ * * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_5 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 133, __pyx_L1_error) + __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, 133, __pyx_L1_error) + __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, 133, __pyx_L1_error) + __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, 133, __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, 133, __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, 133, __pyx_L1_error) + 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); @@ -46032,36 +46005,36 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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, 133, __pyx_L1_error) + 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":145 + /* "constraint/constraints.py":146 * self._assigned = assigned * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 145, __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, 145, __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, 145, __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, 145, __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, 145, __pyx_L1_error) + 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, 145, __pyx_L1_error) + 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":151 + /* "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, 151, __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_5)->arg0 = __pyx_t_7; __Pyx_GIVEREF(__pyx_t_7); @@ -46069,67 +46042,67 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 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, 145, __pyx_L1_error) + 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_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, 105, __pyx_L1_error) + __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, 105, __pyx_L1_error) + 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_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":198 + /* "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, 198, __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_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error) + __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_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __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_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __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, 198, __pyx_L1_error) + __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); if (__pyx_t_2 != __pyx_t_4) { - if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 198, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 199, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":201 + /* "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_4 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error) + __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, 201, __pyx_L1_error) + __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, 201, __pyx_L1_error) + __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, 201, __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, 201, __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, 201, __pyx_L1_error) + 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); @@ -46138,99 +46111,99 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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, 201, __pyx_L1_error) + 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":205 + /* "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_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, 205, __pyx_L1_error) + __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, 205, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 205, __pyx_L1_error) + 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, 205, __pyx_L1_error) + 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":198 + /* "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_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, 198, __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); #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, 198, __pyx_L1_error) + 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_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":209 + /* "constraint/constraints.py":210 * * * 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, 209, __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, 209, __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, 209, __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_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __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, 209, __pyx_L1_error) + __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_7, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 209, __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":220 + /* "constraint/constraints.py":221 * """ * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 220, __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_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 220, __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, 220, __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, 220, __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, 220, __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 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, 220, __pyx_L1_error) + 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":226 + /* "constraint/constraints.py":227 * assignments: dict, * forwardcheck=False, * _unassigned=Unassigned, # <<<<<<<<<<<<<< * ): * seen = {} */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 226, __pyx_L1_error) + __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); @@ -46238,77 +46211,77 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 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_7, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < (0)) __PYX_ERR(0, 220, __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":209 + /* "constraint/constraints.py":210 * * * class AllDifferentConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of all given variables are different. * */ - __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, 209, __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 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, 209, __pyx_L1_error) + 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_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":247 + /* "constraint/constraints.py":248 * * * 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, 247, __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_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 247, __pyx_L1_error) + __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_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __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_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 247, __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, 247, __pyx_L1_error) + __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_5) { - if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 247, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 248, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":258 + /* "constraint/constraints.py":259 * """ * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __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, 258, __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, 258, __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, 258, __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, 258, __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, 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); #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, 258, __pyx_L1_error) + 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":264 + /* "constraint/constraints.py":265 * assignments: dict, * forwardcheck=False, * _unassigned=Unassigned, # <<<<<<<<<<<<<< * ): * singlevalue = _unassigned */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 264, __pyx_L1_error) + __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); @@ -46316,62 +46289,62 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 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, 258, __pyx_L1_error) + 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; - /* "constraint/constraints.py":247 + /* "constraint/constraints.py":248 * * * class AllEqualConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of all given variables are equal. * */ - __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, 247, __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 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, 247, __pyx_L1_error) + 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_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":285 + /* "constraint/constraints.py":286 * * * 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, 285, __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_7 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 285, __pyx_L1_error) + __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_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __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, 285, __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_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, 285, __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_7) { - if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 285, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 286, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":301 + /* "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. * */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 301, __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_Union_int_float) < (0)) __PYX_ERR(0, 301, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Optional_Sequence) < (0)) __PYX_ERR(0, 301, __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, 301, __pyx_L1_error) + 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 CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); @@ -46379,45 +46352,45 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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, 301, __pyx_L1_error) + 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; - /* "constraint/constraints.py":316 + /* "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, 316, __pyx_L1_error) + __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, 316, __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, 316, __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, 316, __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, 316, __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, 316, __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, 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, 316, __pyx_L1_error) + 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":339 + /* "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 * exactsum = self._exactsum */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 339, __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, 339, __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, 339, __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, 339, __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, 339, __pyx_L1_error) + 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); @@ -46425,63 +46398,63 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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, 339, __pyx_L1_error) + 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":285 + /* "constraint/constraints.py":286 * * * 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_ExactSumConstraint, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 285, __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 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, 285, __pyx_L1_error) + 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":398 + /* "constraint/constraints.py":399 * return sum == exactsum * * 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, 398, __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, 398, __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, 398, __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, 398, __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_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, 398, __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, 398, __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":416 + /* "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, 416, __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, 416, __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, 416, __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, 416, __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, 416, __pyx_L1_error) + 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); @@ -46489,45 +46462,45 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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_7) < (0)) __PYX_ERR(0, 416, __pyx_L1_error) + 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":435 + /* "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_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 435, __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, 435, __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, 435, __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, 435, __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, 435, __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, 435, __pyx_L1_error) + 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); #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, 435, __pyx_L1_error) + 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":457 + /* "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, 457, __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, 457, __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, 457, __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, 457, __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, 457, __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, 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); @@ -46535,62 +46508,62 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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, 457, __pyx_L1_error) + 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":398 + /* "constraint/constraints.py":399 * return sum == exactsum * * class VariableExactSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the sum of variables equals the value of another variable. * */ - __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, 398, __pyx_L1_error) + __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, 398, __pyx_L1_error) + 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":509 + /* "constraint/constraints.py":510 * * * 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, 509, __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, 509, __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, 509, __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, 509, __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_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, 509, __pyx_L1_error) + __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_7, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 509, __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":525 + /* "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. * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 525, __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_minsum, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < (0)) __PYX_ERR(0, 525, __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, 525, __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, 525, __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); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); @@ -46598,45 +46571,45 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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_7, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < (0)) __PYX_ERR(0, 525, __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":538 + /* "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, 538, __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, 538, __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, 538, __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, 538, __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, 538, __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, 538, __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_7, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < (0)) __PYX_ERR(0, 538, __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":554 + /* "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 */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 554, __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, 554, __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, 554, __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, 554, __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, 554, __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); @@ -46644,63 +46617,63 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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, 554, __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":509 + /* "constraint/constraints.py":510 * * * 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_MinSumConstraint, __pyx_t_2, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 509, __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 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, 509, __pyx_L1_error) + 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_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":581 + /* "constraint/constraints.py":582 * return sum >= minsum or missing * * 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, 581, __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, 581, __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, 581, __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_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 581, __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, 581, __pyx_L1_error) + __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, 581, __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":598 + /* "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, 598, __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, 598, __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, 598, __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, 598, __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, 598, __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); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); @@ -46708,45 +46681,45 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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, 598, __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":617 + /* "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, 617, __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, 617, __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, 617, __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, 617, __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, 617, __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, 617, __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, 617, __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":630 + /* "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, 630, __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, 630, __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, 630, __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, 630, __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, 630, __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); @@ -46754,62 +46727,62 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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, 630, __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":581 + /* "constraint/constraints.py":582 * return sum >= minsum or missing * * 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_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, 581, __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 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, 581, __pyx_L1_error) + 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_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":658 + /* "constraint/constraints.py":659 * * * 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, 658, __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_7 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 658, __pyx_L1_error) + __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_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __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, 658, __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_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, 658, __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_7) { - if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 658, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 659, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":674 + /* "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. * */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 674, __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_Union_int_float) < (0)) __PYX_ERR(0, 674, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Optional_Sequence) < (0)) __PYX_ERR(0, 674, __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, 674, __pyx_L1_error) + 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); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); @@ -46817,45 +46790,45 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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, 674, __pyx_L1_error) + 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":688 + /* "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, 688, __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, 688, __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, 688, __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, 688, __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, 688, __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, 688, __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, 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_7) < (0)) __PYX_ERR(0, 688, __pyx_L1_error) + 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":706 + /* "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 * maxsum = self._maxsum */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 706, __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, 706, __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, 706, __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, 706, __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, 706, __pyx_L1_error) + 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); @@ -46863,63 +46836,63 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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, 706, __pyx_L1_error) + 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":658 + /* "constraint/constraints.py":659 * * * 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_MaxSumConstraint, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 658, __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 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, 658, __pyx_L1_error) + 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":760 + /* "constraint/constraints.py":761 * * * 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, 760, __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, 760, __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, 760, __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, 760, __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_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, 760, __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, 760, __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":777 + /* "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. * */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 777, __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, 777, __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, 777, __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, 777, __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, 777, __pyx_L1_error) + 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); @@ -46927,45 +46900,45 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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_7) < (0)) __PYX_ERR(0, 777, __pyx_L1_error) + 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":796 + /* "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) * */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 796, __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, 796, __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, 796, __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, 796, __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, 796, __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, 796, __pyx_L1_error) + 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); #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, 796, __pyx_L1_error) + 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":809 + /* "constraint/constraints.py":810 * 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, 809, __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, 809, __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, 809, __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, 809, __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, 809, __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, 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); @@ -46973,106 +46946,106 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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, 809, __pyx_L1_error) + 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":760 + /* "constraint/constraints.py":761 * * * class VariableMaxSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the sum of variables sum at most to the value of another variable. * */ - __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, 760, __pyx_L1_error) + __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, 760, __pyx_L1_error) + 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":837 + /* "constraint/constraints.py":838 * * * 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, 837, __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, 837, __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, 837, __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, 837, __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_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, 837, __pyx_L1_error) + __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_7, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 837, __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":853 + /* "constraint/constraints.py":854 * """ * - * def __init__(self, exactprod: Union[int, float]): # <<<<<<<<<<<<<< + * def __init__(self, exactprod: int | float): # <<<<<<<<<<<<<< * """Instantiate an ExactProdConstraint. * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 853, __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_exactprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < (0)) __PYX_ERR(0, 853, __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, 853, __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_7, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < (0)) __PYX_ERR(0, 853, __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":862 + /* "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, 862, __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, 862, __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, 862, __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, 862, __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, 862, __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, 862, __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_7, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < (0)) __PYX_ERR(0, 862, __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":890 + /* "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 */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 890, __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, 890, __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, 890, __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, 890, __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, 890, __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); @@ -47080,138 +47053,138 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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, 890, __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":837 + /* "constraint/constraints.py":838 * * * 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_ExactProdConstraint, __pyx_t_2, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 837, __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 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, 837, __pyx_L1_error) + 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_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":921 + /* "constraint/constraints.py":922 * return True * * 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, 921, __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, 921, __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, 921, __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_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 921, __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, 921, __pyx_L1_error) + __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, 921, __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":938 + /* "constraint/constraints.py":939 * """ * * 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, 938, __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, 938, __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, 938, __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, 938, __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, 938, __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":948 + /* "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 = [] */ - __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, 948, __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); #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, 948, __pyx_L1_error) + 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":968 + /* "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_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, 968, __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 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, 968, __pyx_L1_error) + 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":974 + /* "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) * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 974, __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, 974, __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, 974, __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, 974, __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, 974, __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, 974, __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, 974, __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":989 + /* "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, 989, __pyx_L1_error) + __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, 989, __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, 989, __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, 989, __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, 989, __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, 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); @@ -47219,106 +47192,106 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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, 989, __pyx_L1_error) + 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":921 + /* "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, 921, __pyx_L1_error) + __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, 921, __pyx_L1_error) + 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":1036 + /* "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, 1036, __pyx_L1_error) + __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, 1036, __pyx_L1_error) + __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, 1036, __pyx_L1_error) + __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, 1036, __pyx_L1_error) + __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, 1036, __pyx_L1_error) + __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, 1036, __pyx_L1_error) + 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":1052 + /* "constraint/constraints.py":1053 * """ # noqa: E501 * - * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< + * def __init__(self, minprod: int | float): # <<<<<<<<<<<<<< * """Instantiate a MinProdConstraint. * */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1052, __pyx_L1_error) + __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_Union_int_float) < (0)) __PYX_ERR(0, 1052, __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, 1052, __pyx_L1_error) + 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, 1052, __pyx_L1_error) + 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":1060 + /* "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, 1060, __pyx_L1_error) + __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, 1060, __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, 1060, __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, 1060, __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, 1060, __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, 1060, __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, 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, 1060, __pyx_L1_error) + 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":1071 + /* "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, 1071, __pyx_L1_error) + __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, 1071, __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, 1071, __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, 1071, __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, 1071, __pyx_L1_error) + 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); @@ -47326,138 +47299,138 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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, 1071, __pyx_L1_error) + 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":1036 + /* "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, 1036, __pyx_L1_error) + __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, 1036, __pyx_L1_error) + 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":1087 + /* "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, 1087, __pyx_L1_error) + __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, 1087, __pyx_L1_error) + __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, 1087, __pyx_L1_error) + __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, 1087, __pyx_L1_error) + __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, 1087, __pyx_L1_error) + __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, 1087, __pyx_L1_error) + 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":1104 + /* "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, 1104, __pyx_L1_error) + __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, 1104, __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, 1104, __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, 1104, __pyx_L1_error) + 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, 1104, __pyx_L1_error) + 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":1108 + /* "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, 1108, __pyx_L1_error) + __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, 1108, __pyx_L1_error) + 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":1126 + /* "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, 1126, __pyx_L1_error) + __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, 1126, __pyx_L1_error) + 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":1132 + /* "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, 1132, __pyx_L1_error) + __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, 1132, __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, 1132, __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, 1132, __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, 1132, __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, 1132, __pyx_L1_error) + 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, 1132, __pyx_L1_error) + 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":1145 + /* "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_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1145, __pyx_L1_error) + __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, 1145, __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, 1145, __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, 1145, __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, 1145, __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, 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); @@ -47465,106 +47438,106 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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, 1145, __pyx_L1_error) + 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":1087 + /* "constraint/constraints.py":1088 * * * class VariableMinProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the product of variables is at least the value of another variable. * */ - __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, 1087, __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, 1087, __pyx_L1_error) + 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_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1189 + /* "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, 1189, __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_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1189, __pyx_L1_error) + __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_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1189, __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_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1189, __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, 1189, __pyx_L1_error) + __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, 1189, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 1190, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1205 + /* "constraint/constraints.py":1206 * """ * - * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< + * def __init__(self, maxprod: int | float): # <<<<<<<<<<<<<< * """Instantiate a MaxProdConstraint. * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1205, __pyx_L1_error) + __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_Union_int_float) < (0)) __PYX_ERR(0, 1205, __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, 1205, __pyx_L1_error) + 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, 1205, __pyx_L1_error) + 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":1214 + /* "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_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1214, __pyx_L1_error) + __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, 1214, __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, 1214, __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, 1214, __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, 1214, __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, 1214, __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, 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, 1214, __pyx_L1_error) + 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":1242 + /* "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_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error) + __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, 1242, __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, 1242, __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, 1242, __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, 1242, __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, 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); @@ -47572,138 +47545,138 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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, 1242, __pyx_L1_error) + 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":1189 + /* "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_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, 1189, __pyx_L1_error) + __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, 1189, __pyx_L1_error) + 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":1274 + /* "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, 1274, __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_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1274, __pyx_L1_error) + __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_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1274, __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_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1274, __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, 1274, __pyx_L1_error) + __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, 1274, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 1275, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1291 + /* "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_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1291, __pyx_L1_error) + __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, 1291, __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, 1291, __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, 1291, __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, 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, 1291, __pyx_L1_error) + 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":1295 + /* "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_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, 1295, __pyx_L1_error) + __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, 1295, __pyx_L1_error) + 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":1313 + /* "constraint/constraints.py":1314 * 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_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, 1313, __pyx_L1_error) + __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, 1313, __pyx_L1_error) + 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":1319 + /* "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_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1319, __pyx_L1_error) + __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, 1319, __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, 1319, __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, 1319, __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, 1319, __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, 1319, __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, 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, 1319, __pyx_L1_error) + 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":1332 + /* "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_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1332, __pyx_L1_error) + __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, 1332, __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, 1332, __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, 1332, __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, 1332, __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, 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); @@ -47711,269 +47684,269 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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, 1332, __pyx_L1_error) + 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":1274 + /* "constraint/constraints.py":1275 * * * class VariableMaxProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the product of variables is at most the value of another variable. * */ - __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, 1274, __pyx_L1_error) + __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, 1274, __pyx_L1_error) + 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":1376 + /* "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, 1376, __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_7 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1376, __pyx_L1_error) + __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_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1376, __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_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1376, __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, 1376, __pyx_L1_error) + __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, 1376, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 1377, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1387 + /* "constraint/constraints.py":1388 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * */ - __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, 1387, __pyx_L1_error) + __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, 1387, __pyx_L1_error) + 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":1395 + /* "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_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, 1395, __pyx_L1_error) + __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, 1395, __pyx_L1_error) + 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":1399 + /* "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_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1399, __pyx_L1_error) + __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, 1399, __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, 1399, __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, 1399, __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, 1399, __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, 1399, __pyx_L1_error) + 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, 1399, __pyx_L1_error) + 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":1376 + /* "constraint/constraints.py":1377 * * * class InSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are present in the given set. * */ - __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, 1376, __pyx_L1_error) + __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, 1376, __pyx_L1_error) + 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":1410 + /* "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, 1410, __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_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1410, __pyx_L1_error) + __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_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1410, __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_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1410, __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, 1410, __pyx_L1_error) + __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, 1410, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 1411, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1421 + /* "constraint/constraints.py":1422 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * */ - __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, 1421, __pyx_L1_error) + __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, 1421, __pyx_L1_error) + 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":1429 + /* "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_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, 1429, __pyx_L1_error) + __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, 1429, __pyx_L1_error) + 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":1433 + /* "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_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1433, __pyx_L1_error) + __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, 1433, __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, 1433, __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, 1433, __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, 1433, __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, 1433, __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, 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, 1433, __pyx_L1_error) + 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":1410 + /* "constraint/constraints.py":1411 * * * class NotInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are not present in the given set. * */ - __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, 1410, __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, 1410, __pyx_L1_error) + 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_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1444 + /* "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, 1444, __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_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1444, __pyx_L1_error) + __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_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1444, __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_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1444, __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, 1444, __pyx_L1_error) + __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, 1444, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 1445, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1455 + /* "constraint/constraints.py":1456 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * */ - __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, 1455, __pyx_L1_error) + __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, 1455, __pyx_L1_error) + 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":1469 + /* "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_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1469, __pyx_L1_error) + __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, 1469, __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, 1469, __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, 1469, __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, 1469, __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, 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); @@ -47981,79 +47954,79 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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, 1469, __pyx_L1_error) + 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":1444 + /* "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_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, 1444, __pyx_L1_error) + __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, 1444, __pyx_L1_error) + 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":1506 + /* "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, 1506, __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_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1506, __pyx_L1_error) + __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_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1506, __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_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1506, __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, 1506, __pyx_L1_error) + __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, 1506, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 1507, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1517 + /* "constraint/constraints.py":1518 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * */ - __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, 1517, __pyx_L1_error) + __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, 1517, __pyx_L1_error) + 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":1531 + /* "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_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1531, __pyx_L1_error) + __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, 1531, __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, 1531, __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, 1531, __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, 1531, __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, 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); @@ -48061,52 +48034,52 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); __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, 1531, __pyx_L1_error) + 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":1506 + /* "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_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, 1506, __pyx_L1_error) + __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, 1506, __pyx_L1_error) + 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":1570 + /* "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) */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1570, __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_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 1570, __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, 1570, __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, 1570, __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, 1570, __pyx_L1_error) + 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 constraint.domain import Unassigned + * 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); @@ -48154,11 +48127,11 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 324, __pyx_L1_error) - __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_min); if (!__pyx_builtin_min) __PYX_ERR(0, 320, __pyx_L1_error) - __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_max); if (!__pyx_builtin_max) __PYX_ERR(0, 321, __pyx_L1_error) - __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_round); if (!__pyx_builtin_round) __PYX_ERR(0, 358, __pyx_L1_error) - __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 449, __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; @@ -48182,74 +48155,78 @@ 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":961 + /* "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, 961, __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":301 + /* "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. * */ - __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 301, __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":1455 + /* "constraint/constraints.py":1456 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * */ - __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, 1455, __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]); #if CYTHON_IMMORTAL_CONSTANTS { PyObject **table = __pyx_mstate->__pyx_tuple; for (Py_ssize_t i=0; i<4; ++i) { - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + 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 } @@ -48259,16 +48236,20 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { { PyObject **table = __pyx_mstate->__pyx_slice; for (Py_ssize_t i=0; i<1; ++i) { - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + 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 } @@ -48285,39 +48266,39 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); { - 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},{18},{13},{17},{107},{1},{8},{25},{7},{6},{2},{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},{8},{20},{8},{19},{28},{28},{22},{31},{31},{10},{5},{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},{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},{6},{11},{10},{15},{18},{1},{3},{5},{6},{3},{16},{8},{8},{8},{22},{17},{9},{12},{1},{3},{34},{42},{17},{49},{246},{395},{297},{95},{287},{347},{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},{22},{2},{2},{2},{2},{23},{25},{2},{86},{148},{161}}; - #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (4927 bytes) */ -const char* const cstring = "(\265/\375`\221a\255\231\000:\222@\037;\360\0327\314\300l\000\2222\3101B\243\303\032RX\370 \23707\205\025\365,\332f\215V\034\257C)RR\000\000 \000\000@\t\000b\327e\002\n\010\003\000i]\003\000\240\232\010\330\001\331\001\351\001CKIK\332T\365P\250\203\222\322\034\364\271\351\235\346\232Z/\267\253\252\356\034<\265V\311\341JE\376p\310\333\326A\2526E\207>\337nM\r\245Y]\212\316\366C\363C\252\254nMT\267\031M\365\251\256O-\225\214\276\225\"\344\251>\231m\006\372\200Cu\363\260\271\335(\331\242\344\316\254F\323 \332\246C\340\016\216\212t\241Q\221#D\020\004,\\I\256Xe\362\205\364\221*;l5{\273\335@|\344H\376\330&\352\264\246\246\212\376\364I\376\310`f\247\310'\023}\232*m\304\274\002K\034.\223\272\315\2325\21198\304\331r%%\271\341\n\3149\0235\rn&Mw\252f\365\357\207\236\244fs\232\346\262,m9\\.\227#\346\334\n\314\331p9\235N\247[KJJl%\246o\244$\227\303\001\207A9\340p\347Jb^\201eiR\252(\217m\2436\233\315f+m\344\010\316\266d\326\314Zk\232\354\252\346\235\346\241P\267\346\360\304\265k\317\252.\341p\276\332\0079\002R\222#\265\\\373HJ\032\246kP\253\235\210 \037\033\250[\364F\3748u\313\256\033d\251Lju\220\212\023\364\261\204#G\312$rdI\303\247A\216hd\215\244\017\242\363\3147\220\217\037\322\205\004\256///+:\r\0023\221\206D@\270\265zgRE\365\326lp\017\201(\253j)\324i\353a\232\245H\375[I\r\\7\331\356\254S\262\315O-\351\244\242\246\252\251\322\326\324,z\222\247NS\275\252\244\232MrE[S\035\326\350\324\227S4\010\\eT\035\014\346'\262\255\251Y\346\266[\025UW\223d\327\037\271wNMR\357\354#[3\263\355\366\355n\001\275\306)`G\236\337\371\212N\223\020j\301\016\0004\266b0\373\332\374\3566\227\235\037\241\370;.\"\372D?\177\306\3702\316\024_E\037\034\003\027\275\003\357\214\227y\227\277\361\323\345\271\017\0061\2578P\234\201\207o~\247|\3669\257;\257;q\036\337\340\001|\342\000\200`K\330e:\207\354\313^\224\216\277\353C\236\241\020\273\374\007\304\312Q\330s\237\342\031\260\243\353\025z\235\316\001\213\263\233s[\255\006\005\235ks\244q\n\203\270\344\025]\327i\335\312\21508\226\256L!\246u\024~\245\245\323J0\210""\263\221\300xc\362M4\276\306+\306ybE\236WG\373\264\327\347\271NZ9\255\204\327\221\006\257`|\014\200\357\352\244\213\357h\355\270\205\302W0\210\205\256\216\326\302\001\200\303\226\020\266\275\270\214\237\361\372A\264\212\370\324\242S=\251\251\225}j{A6\267-\333\3524\353\375K\265\336\254\226Z\201\232\335k0\270\0067\220\315\301\340\036n`V{\352\336\252\356\255l\232\235\264\252\346V\357\215\002w\217\270\246\273e{[E\211\364\211>\241O=\263\247\317aj\022u\257\327\333@s=M\364,\333\264\267[\340z\232\246/\337L\235\246\253\251\367\232\232Qf\366i\263\267u\233O\364T\315t]}\276\255U\264\035\256\354j\336V\324T\251v\336\255\252\201\275S\325\277\274\367\251\016W_\257wj\325\t\335;\253C?\r\324\022uOo\206H\365\303\006\211Z}\331k\332r\333[\233Q\246~\2229\331<\325\312\364zi\232\315^\357\2664l\223\332\215\246\347FM'Uo\364\244\n\336Ht\017\346\246\2569%\315\235F\231h\220e\213\226\332\274\246?r$I\r8\336\3467\346\275\231u\223\023\300\216H\025|\302\205\271g\020\320\337F\037\230\017\004\317p@&>\313s\365\035\3411\366\272^\250\356A\30648\000N\3628\\oy\206'\3528\334B\330\013:U\t'\310x\225\347\270^\336\240\317p,\243\203\021G\345\263\257\216\252\003\365\216\207\217\213\225\\\273\020\035<\346E$F*\276Jmv,\253X\270\214\216/\275\000B\326b0\210w\\\346\352A|\305B\370\002\035y\357\356\r\361!\034q\3661^\245o\220q\356\375\336\321?*\215\t\004p\320\273\342E\310X\350!\374A'-\":MB'\214p\340U\307\230\217\032\340\022QE\262#\357\2309\306\354\270{5\336!\276\363\313\342\333\\gr\007v'\016\326/\007\026\317<\347\340\312\270CW\027r\035w\226]\016W\346F\300\n\216\031\022\255\033\021\3225,b\232G\017\350&\274B\002\242\037p\211Y\314\353\273^\364\344\364\235\316\177\026\375\240\037\364\363w\212E0\316;\364-\335\206\253\014\001\375!\343\314\310\026e\212X\271\267\225u\032\376\342\006\356\214\220Cp\0277\331\361\237\033\357\022\270\004L\200S\305D|\314\233\335\003\342\347\360`\221\027\305\213\314\376\216+\274\264w{\031?\"\373\255\3261\273\020\0061\315u\230qg\r\274b&\203\342\030\0221/\303\017\260\320\213{\035^!\217\363L|v\302m\334\031""\314\325#\370\004\354\230\217N\277\377k\372MJ_\311\350\033\t}\241\237\3573\306\030\213d\260\013\276\361z\307,\246\031\207\212\263\"\r\\\3026o\371\n\274&\236\346Q6\007\342\027\263\030\026\323\212\033\006\2027`+\337\341\317\036\323\313\276\001+pa\nq\331Y\236\321\360\263\206\017\210\361\211]\227\365\027\227\326c\001\017G\223\346\356W\357\236;CY\254\231y_\021>\010\007^\3131\222\\\027`\241\031s\340M\223\351Xn6^\024I^\230\276\321\221p\206\370\005\217\363`^\247u7\247f\266e\321kd,\363#\027&\265\313:)w\370\353\225y\177\236\303\247\261\253\354s\262{\243\260\265\313:&!}$\336\217*\316\274\262\227\275\341\371x\003\316\004\027\347\246\300\216I\256\314e]\232\227\255\207Y|`\020C<\304\016\261x&;\356\262v~\327cW\331[\216O\021\3238\306<\010\306\001\000\307V\217\3513\355\374\035\225\257\342\361=^\277\3444\236\036]0\3037J\371)55\27758\n\357\335x\227`\020oT\217\271\000\342}\245\"\016\\\302,\265\257\353WnD,H\"V\024\202W0\370\304\221\321\337\361\025c\212!p\014>\010\351\001\001H\001GG\001==\001<<\0019\0019\256+\000\200-+\341\027\002?0\352G\371\276o\312\230\2159#S\003K\025\023\277(\337\004\325\315\321j\367\337O\237\350\347$\301\270\002\037\302\003v\002F\223\"\255\030C\362u^\204\342\357\202\370E\227\210w\360\013\026\276\005VR\235\210\343\034w\037\375\3441B\236=\333k\021\177\346U\360\276\316A\333\264\232P\320\277*\2420\017v\001\371B}a\347\226\256@\254\013\335\304^\323\347\364W\216W<\024sE\231\362\013\371\201\206\377\3600;v\300\260\204>\373\251^\203\375\356\3041\024\024\376\002\257\270\000S\375Db\357\211w\360\265>\301]\271\023t\037\237\242\3209\330\361\"\367\301\245\020[)\034\000xl\375\364\3279?\007\345\243p|\016\032\357a\330\312\357\311\306\337\270m\t\235\312\356\320i\261\317\n\335\016\327A\363\334\231\033s\371 \007\227\214\237H=\304\0178\035\327\246\2560\366\226\0162\tFj\276\032\035p\201\203\027],\rk1\376I\223xG\315\222\262\253\344A\300\261ma'N\210rB\261\257\264\212k\3574\367\020\363n\203-]\245\341\024\006\260\256q\332\206\200\272Ui\261A\375}\277\031\213\217\305h?(ls\023P\262'\353\372\020g\274\206\312\006\2647\367\246R\t(\210\263B\275,k\024\001Zu@.\252\031pXD\241\372N\300\016n\361\275\365\201\217P\260\316@E=\257\216\221\212.\013/\207\253\203qG\226\021\033\255\013\n\307\034\234\036\240B\207\235\263\0252`}.\363\"\304\034\223\233\245\320\212W\037\016\306\034C\271\364\016\222l\177\352V\261O\267\200D\034\341\341!\201\266\242\000\201\315\241\035&\366\265\326\226u&u\201T9\336Qw\257m\3542\340\004G\005\021\233\264\202\342\"\360\217\013\210\323\312[%\241\035^\373\256\260\003v\371=_\364\0102\013\302\203\343\r\371\010\253m\340F+\014\325K\340\260\003\372\205\006}q\354N\310zf\2636\207\326\201\332P\014\3448$/\234\305=DM\357\025O0\213\260\346\316P\202\345$\276\026\311n\247G\3020h\376j!\006\264]2\205k*\320\343\247\201e\375\n^\210 \205\235\201;\257\357\253N\005\220\346n\037|19<=G\327\177!\207Uw@\307\2609\351I\360\343\334t\310\222C\255\371\301\374\254\201\035\n[S\022\232\2506\2647lI?J\232\365\025\207\266\206w\363\377\2512\363\331\n\214\311\022\266\3420C\302\305\004a\036\210\253\376:\245\353\311\257\377\374\254\306]@\236\205\255\025\021<3\205.\rL\230\320&$\240\000\213\365\037\352u\022\364-\217\225\247\201\343\357\375lj\023\017\331\207PD_;\301\tX\327\263\033\024o\022\232\017\206S\024q\312Y!\265\334$?\211\2451\351\332\243\376\343e\001\231\265<\341P\372\177\251\373g\014C\327\231\244X\243Q\326\206\025<\3270\200C\334\035\245\207\360\377/\264\223b(\301\326{)=\270iG3[~C\362\262\016\213R\311z\016L\365\007d\022/\202\2602\273g\026\331\302'\327X\362\246\334\343=\373\201z\300p\204\245\346X\021 \372\360\014\317\272\335\372X\234\004\370M\241\243\215m\n\332\215\265{{\266\300\202\223.\370\244kv\260\020""\034\271\330\270\212?\254\314\031\0232\310\231zx\364\333\252\247\305;\235#taX\354o\377\352\017\336\343\312\373\031]\014\367(eTn\266$'7\211\306/\020v-H\002\213:\341x\250\217\234k\330\301\340\273'\207\2234\005\021\001\276k\225\021T\3032\231\206\265\367\007\312t\315g\372\305\345W\032\357y\010\232\001T\215\216\255\300\030\250\304\0354!\031\344\232+\241f\213MV\207\320^\310\326\314\273\007,\014[\207\332qz)\261\301\033T\275\366Y\0037\347\222\342ULX#\341\020\001\005\031\276\013<\206\344\304\207\266\364\250\256#3\314%\275Cb\267\324vp\212\301\025\374\224\244\264\t\261*Y\327\361\360x\221c\273\207O\306|\221\n\003\2613$i\224\016\247\375\262B>\332\251e\346^\223\210\277pXO(\234\214|Wj\303\013\251\225\t\033\014\257\rc\301)\307\330%\334;`\353\257\235\036q1\204\247\"\250R\247E_o\025\266x\272\014\026\270\324\031\277x`\027\377\201\303=S\221\221u\202\000\014\314\375\316^#\222+\257\301XC\275\373\323\311\003\241$\304\230z\223\240\262\272Z'b%\215\371\r\253d\032\032L|@\031\321R\245\317\007\215\371\204\220\257\207\207\253\250\272\215\253\n9>g\352BV\325\341\376?0\374IG\252\266\215\310p\243VA\036P\341\014\277E\220\000B\213\342\0007\031\360\034\033,\025~\035\256\216\303\311a\025\226\241T0C\312\261\033O\332\273\377\024\r\2606\204\356\032~xOtl\r\274\356O8\302\032\017Ou\310\230t\233 \317\240q\327a\022IZ\365\244m\204\236\255\202L\023\227\307\215\363}\357\014YN\221^\344]%\014\223\303\031;-\034\354#\013\2547\204e\330\203\361\020\321\031t\032;\030\353F^\261\247\337`\343\233=\276a\376_\226\256H\0232e\273\275\r\032\370\235\314\206\304\233\024\337\276*K\037\371\324,\006*\252\034H\241pv\246\237\255\363\200\260\311\244\030\024\007\310\335\347\010'z?\246\306\250~\022\032\204is\r\245\013!\312\\O\235\311\264\023\0062\202\266H\262e\030\231@\371\0215\203\3749\177\370\372\207.,\274L\026\2712\010t\363e\026\223\251\232E$\304vL/\3611\2019\316t\360\250$\330\021cY\315\016\341\004\3361\025\304<\374L\270!\271\250w{\361y\331\202O\346\205)H_\363/\373]\311O\335\001\032\010\324\243u\222\377\276\303\252`\317\013\277\r\270""\365y\026\010\253n\254\373\323I\264\375\201q\302!YX\250\223\247\203Q'\261\235\023<\203\215\267\214U\224*km\016A4\223\024\241+.\250\255\"C\341\024\333`\027q\005\260\026\357\377\321b\261:z\\\241%\311\342e\366u\230jCp>\007\301F\177>A\262[\220TQE\202\251\344\202b\340\033u\030\321\251q\036\345.lp\241\030[t.\306/\335\230\352\246\266\312q\367\270\2435\321}5\373\206#A85\361\240K\362\234l\333\263\236d\361\240i\303=\223\337h\221&p\275\331F\372\001\277Pxt,\312\034\355\200w.\000\244\261\231um\324Wh\241\266\303\000P\010,E_\341\324=?m\307>\320\233?P\220\013\227f\324\332O}\264\"\247\3227\243\266=\327\261Em2?\204\307\014\240\r\245\241}\\\346%\324\272}J[\250\033\221.k\243\245/B\310\"\270\232\277\215\261\266\233\203A\226KHp\034\254[Z\332e\3463\277t\304\031\364B\300\327\221\r%\300\316\307\351\256\220b\271^\204\006\027\324C\374\364nfOw\207\337\233M)~\325\013R\202\352\020\254\270\273-\202b6\037\216q\340\210\035 \270#(i\017\354\347,#\333X4\337\344T\353\002\031[r\n\025X\215\365\0146*zm \313\230\034\225.\246\205d\202xj0\346\330G\244;C\233\222nhR~L4\346\0342\220\217n\036p\221\360A\262\241\375t\324\275\246Q\2478/DWg\371\214\006\270\313\343YD\000\264\263\251\241\016b\006\270\232\217\244q\302\214n\215l\245\365O?k\200\020\310\214:\227B\224\330Bf\005\371#\250\342\246\344X\352\362\265\242u\260\304\n?\254\275O[2\224\"\311\022F5\334Pa,\215v\243\211\020\"\352\366&\216\324.\250|\310u\355vo\240\264\236x0A)\332\276*Jp\246u\202\340(fE\324;WN\360ca3\254\270h\326m\217W\262WB\013#\337\242\037\245E\227\\\207\374\236+\362\004G=\021[\236\"\272t\251\265\304\236U\013\242\010\232Cu`\343\273c\344\215\314\030oY\303}\223\"\335z\034\206u\237\003\\;\301\354\332\230\3154\335PHW\263W\216\321\364l| `86\371V\330\014H\005\310\337\215\t\013woRr&\252g\227\202\332\326\026\351\317%\016\341,\371\350\263\350\"\237|:e\231\021\251/\026T]\347\321_t:\224\022\0131_\323\022\217\034K\\\202\341}7#\017F7K\260\375c\242\213\300\331\330L\203\230X\204%\237\203\021\372vkAb5\202B\250\236\340\331F\025E\3540\202f\374\333M\303\016\321\235\347)""\\\2369\306\247\240\005w\371\363R\273\207U\000]\370 \354\""; - PyObject *data = __Pyx_DecompressString(cstring, 4927, 3); + 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},{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},{347},{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 (4905 bytes) */ +const char* const cstring = "(\265/\375`ra\375\230\000z\221\024\037;\360\0327\314\300l\000\2222\3101B\243\303\032RX\370 \23707\205\0255\313\266Y\243\025\307\353P\212\224\t\000\000\020\000\000\240\004@\352\272L@\001a\000 \255k@\000D\023\001\326\001\323\001\350\001\352\3523f\215\332T\2650\250\205pz\247\331\306V\346vU\325\235\201\247\326\352(\\\255F_\316\210\333\032h\325\246\250\260\327\333\255\251\2434k\242br\003\252\001\032UV\267&\252\333\214\246\372TW\250\326jF\343H\221\361T\241\3146\377z?\241\272{\330\334ntl\321qgV\243)\020mS\341\217'g5\276\324\254\306\221*\220\004\255\0349\262`\345\021f\354\215*+l5\213\303\341@z\343H\376\330&\372\264\246\246\212\372\3649\372F`f\251F(\023\205\242\"oUy\375\221\271\\\036u\2335kVe\2400w\323\225\224\350\204\353/\347\\\245kr4i\272S5\253}>\364\0345\233\3234\223$y\323\345t:]U\326\255?\335-\2473111YKJJn%fo\244D\247\313\375\204B\272\237p\353\310\252\274\376H\362\204T\321\236\333Fo\267\333\355F\336\306\221\334\215\311\264\231\266\3264\331U\315;\315\302\240nM\341\231kW\237Ue\312\345z\266\217q\004\204\034Gl\331\366\241\244$LW\241V?U\201\200|\354\237nQ\\\325\307\251[v\335 L\244R\253\205\324\034\241\017\246\3348B*\215#L\032=\215qD#k(}\024\235g\306\201|\000\215/\343o\205\201\201a\321)\360\227\253j\306\204\004\\\253w\036UTo\315\002\267\360\207\262\252\236B\237\266\026\246yj\324\276u\324\277u\217\355\316:\035\333\014\325\216O*j\252\332*mM\315\242\347x\3524\325\253:\252\331\034W\2645U\241\215N{9E\201\277uF\325@`\206\032[\233\232gp\273UQu5Gv\365\215{\347\324\034\365\316\275\26153\333\356\336\016\027d\337\210\031\2701XLv\226g4\374\254\341\003d|b\327g\035\306\255uY\267q\212X\221\347w\276\242\327^\\\"\310\025C\000\320\350\222\301\354{\363\273\337^v~\204\342\357\330\250\350\027\001}\032\342\000\221f80\354\3012\260\321K\360\322\370\231\177y\034?]\236\373p\020\363\206\004C\032X\370\346\227\312g\257\363\272\363\372\023\347\361\r\036\300'\020\000\n\272\202}\246s\314~\360M\351\370\273.\344\031\260\370\345? X\212\301\236;\025\317\210\025_o\320\357t\216X\234]\235\333r5\300\342\240k\342""\336p\301\016\2125Nq\020\223\274\342 \016v\223^\353Xn\304A\221tg\260\270\326Sx\026\227\t\227\302A\234\211\005D\234\223\177\242\3615\006>\317}\342\322q)\014\024k0\013\306\307\000\370@\364\252\n\252E\251\312)\252\225\205jK \233\333\226mu\232\365\366\245z\253ZoVO\255?\315\356\025\010\\\201\373\307f p\013\367\332\376\262Z\252{\253\272\\\3314?iU\315\255\336\033\375\355\262jMw\313\226[E\213\364\211B\241P\245Y\352S\230\232U\272,\313\3753\327\263<\3116-w\373[O\323\354e\234\251\323t5\365^SS\312\314=m\226[\267\371DO\325L\327\265\327\333ZE[\341\312\256&nEM\325j\347\335\252\372W\236\252\366\345\275OU\270\366\312\362\324\352\023\272wV\211|:\250\255\322>%M\225\025PY\262\300*\255\302\3545u\301\355\255M)SC\315\234l\246jg\312\262,qL:\005\n[\245v\243\351\271\327\324g>\251z\243\247\025\020G\242\313\030\234\272\346t4w*e\242@\2265bR\322\001\035\256\203\346\2714W\366\362B\016\257\031G\231z\220y\320\364\201#\236\343m~e^\034Z7yA\254\230T\301'^n\314=\205\202\376&\376\304\374 \230\226\0032\361Y\336\253\363\004\213\262\367\365Fu\2171\256\301\001\260\222\317\345z\3133|Q\317\341\026\301n\320\255HXa\306\253\\\3475\340\017:\r\327\":\020sV>\373\232X\365\240\336\361\360s2\222k\027\242\203\313\274\210\304H\305_\261\321\212\344U\013\237\331\361\244\027H\310\\\014\007\361\216\317^]\210\263X\004\337\240\"\357\335\275!>\204#\316^\306\257\364\2151\316\345/\221>\022IT(\200\205^\026/2\306A\017\341\021\372h\021\321k\022&\301\010\007~U\224y)\002.!e4+\362\212\231c\320\212\273W\343%\342;\277-\276\325\365&\227`w\346`\375rh\361\314u\016\356\214+|\365 \337qi\331\345pgnD\314\200'C\242u#B\272\206E\\\363\350\001\375\204WH@t\004.A\213y}\327\215\240\236\376\323\371O\243/\364\205\200>\317\320\010\316y\205\336\245\337\360\025\242\240OD\244\021\331\341\314PK\367\266\263^\303\007\370\201K\023\344\020\374\305O|n\274S\340\0221\001n%\023\3612ov\017\210\257\023\363`\2217\305\213\320\376\216\303\336\332\273\375\214\037\231\375\226\253\230]\210\203\270\346:\320\270\264\006^A\233Eq\014\211\230\227\341\007x\350\315\275\016\357""\220\317\371&\276\343\0264\024~\343\322b\257\036\301'b\305\\|\362}\237\323wZ\372KG\377h\350\017\001\375\036Q\206h4\203_0\216\327;hq\215H4\244\rk`\022\276y\311W\340=\3615\237\262y\020\277\240\305\261\2706\334p\020\274\001c\371\016\177v\231\036\017E\263\346\356W\357\236;\0039\264\241y\007\"z\020\016\334\226\203\236\204\204\177\376\242\327t]\240\245F\324\251\375\032\274k3]\313\315\304\213!\311\033\3237z\222\214\367\344\020\361\013\036\347\301\274\016\333q\350\222\301=\031\257>\272:6\264.\213n\033e\231#\271\261\251\335\026\n\311\303\007\336\231\327\3479|*\313\312^'\2738\260\256\335VQ)\351'\361\276\324\220\346\235\275,N\317\307\033p*\2709W%VT\212\315\\\326\255\201\351z\240\305\010\0071\304C\354 \213i\263\342nk\347w=~\221\275\345\370\0242\215\242\314\203` \000pt\225M\277\211\347\363\254\374\025\217\3571\360I^\343i\361\0053\374#\225\257bc\363[\203\247\360\336\215\227)\006\361Ju\231\213 \336_\032\346\300$\334b\373&=\313\215\220\tI\310\206C0\013\006\237@:\372<\275\241\3140\004\226\301\010!#\354\007$\005 !\005\370\370\004\364\364\004\350\004\350\274\262\000\000\272\260\202?\370\373?\251/\325\373=*b&\352\210M\r-WM\374\202|\025TW\207\253\335\177C\375\242\257\243\004\347\014|\010\017\330\t\020O\206\265\241\014\3117\361\"\024\177'\304/\272D\274\203\007\340\340k\2005\325\213xNq\367\321O.\023\344\331\263\335\026\361i^\230\357u\216\332\256\331\206\204~\326\020\205y\360\013\310\037\352\013;\227t\005d}\010G\366\232^\247\017\350x\305\303P7\234!\377\220'h\370\017\017\264bGL+\350\263\247\352\266\330\307\200\375\005\336p\001\266\362\211\310^\024\357\340m}\202\277r/\350=NE\261\203\260\343F\356\303\013\026c\301\020\000<\272|\372k\235\257\223\362S8>\007\354\303|\270\026\020\000\030\272\362\213\262\3617p]\301'\207^\223}6\350\006\205\035\250\003\331Z\244\223J\r\215\210$I\222\326\023q\0204(\226\213'\265a\327>\243\323\332$\024\206\2014\2040\010B1\010\2070\005\004\021B\210\300\020\242\210\010\211\314\314\330\001K\212n\014yp\373.\270\234/$\375\022\244\326\305\361.7\355\305m\223\232\332M?N=\251""\307\":0e\244\205\214\325y*\026>8\313u\3218\034*\374\343\272@\350\226\246Z\227\214\223\215a\026V\251[\213\373t+\2031\330\201m\315G\210\272\036D\214\262\024\017k\302\332\032\021\254 \336.\311>|\034r.\031\214\020\017\315[\024A+\224e\r\311\211\n\260\350H\272\007\245\354\262m{\261D\177L\010\330\314\177\255*\333Z\304\275X\247\t\031\206\261 \314\244\236\363\236\337\201\036p\367#\207\272\376\023t\226s\251\001\353\2432-\205\272\243\t\261I\024\273\211\235\341\211\352\315\330\250\215\204R\245]\305$P\320MhF>\240\223*+a?LI|\246\221\316\3612\341\202bH\356\023\224\032\014\317\376\207\340d\354[\360\204G\202\342\226-+\321@t\276\331%\244\212a\204\312p\260(Y\270\0374\302\317\032\274\343\014j\315\200\276\352\342\217\341\000S\037\267\342X\240\216\222IEH\020\214?\215\233\375\214\341\256bmL\345w\244\020\373\227\301\265\316L\230\322v/9\316':\2379\351\032\tE\261\310\010\333<\025*3&\014\341\031\000\014Q\301\251\r=\360E\n\"\250\0313\260M(\365\r\371\370\336\231N\244q\207g\200\245t{\246a\263 !\245\367\263M\365F\220\033b\021\304\342\215\177\224\216K\224\332\207\022S5\223\"\030\321\000\301\344O\362\216q\272u\3544\343\247N4\037\377\226K!\300\0039\271\246\352\n\360\265\207'i?NB\3034\247\033\325v\214\257\203\023(\253\310+!n\260\305\t\234\177\017\002 '\017\322&\271p\320\215\250\346\212\323Yn:\2021\234N{\240`E\345+\3255\263X\237\265\221\2254-\276\037\022'\356\220^YY;y\254\340\300\222\260/$D\234\320\247+\277\340\332\371\230>\334p\335\210\245\253\246?\005[\256\313\014\333\010\2412IZ\004\233\376\200o3\305\312r\270\037\304[\\\002(\306[\262\276\\8^Ee\034%n\356d\251\304\024\304\267I=T\032\241\022\351\233Z\235P\2353_\362\303\234\021\207\223\004\312Bh'A'x\232\230}\341@\367\266\265\260\346P\310\t\370\317\356i\236\247\367\326o\264l\336\201\371\2330\343\230\376\006\271\333+\362\225\302\333.\344\276\246\314\034\021a\267\335\265#\000\211\261(YHK=\313\r\2233\253\014_dnJ\356\317J\215\272\017\352\007\246\224w2\253\2636P`+[(\273\000~r\241\317\260\255Dc\032\245\353]\274\206\312\376\223\006\311\330\251R\262\204\235""\366\ts\271\006>.\252\247\211\033\013\212\316\363\003o\374\345\344q\320\305M\223\311yQP]\026\210\266\374BA\231@\214w\207\3552K\362\335\326\007\313>\027\336xA\312\301R!6\217\272\356x\010\005\360SD\330\217o\006\276\366n\310eQdR|l&\315L\256F\243\325A\260\020\214\305\n\371\357<\034\020~\034\205\006\341Cv\206d\231\300R\003\225\351\3718F+\272>\274\\\256.\323\335\263\314\300\2507\350\034\263|\272\252\3527wq+6\301\366i\031\213\010r\224\334,C\"^\366\300\020S\036\n\260\007\311\376\310\251\233\334F\335\002\364r\344\221\010I\326P\005\2657+\357\310\342%\253(\254m\242\013\033\365x\242\274\357\265q\005\0037\234`\270\337\004\t\332..p\006\000\257F9\352$|\300+\023(\364\232\355\3113\377\036\212\231\244\362\000\331\020\037\261\246\rdf\325\\\335\006\242rXYf\265\027\213\234\240[\2634\3259T7P_\005\227\234\204\267\244\321,DB|\367\270\242xY:\313\\\"\"\030N\342AK\316v\335$\010\303\344O\026bT\356\336>\341N\013\351O\312D7\005\343U\261\020\356\337\\\306Y^\366W\237\001\310\3344g~)\001\207\346\350\336\037\237\311\352$\346\3301\3473i}\351\236\336*\344\256KS1\324\020\301(J\302\023\325\216\366\346P)\212H\313\336\333\322\"~\371\234\202\tM\355X\201cY\204\275+\265\341\2137?\304U\347\272\272{\323/\300\342\254\252\233\2224\360\212@\0358\313\230\252\321\360\372-\332\213\206\204\203\034h\237\336\264\004\326\304HsJ\032\310\345\031\353\324j-\010KzG\215\221fixP\274\240\215\3508\326<\036B\201\376\272\352[\230\363\356L\236$A\005\331\022V\3501\303\001\216u\367-\035\217\177G\240C\n\375D\333\267Rz\370\346\314kk\372\355\362b\251U,z\326-\270\313*\220r\374B\002\236\001\256\005F\\B\214kd\311\207\336\357\t\004\246*\320\232\302\212\0005\211]\241\350\332\310C\200\367\234\270\242EK\305\356\213\275b\372\255\370\215\205.\346I\3059\212\0225pq""\314\212o\2563\325`\322LY=\267m\014\246\260\255\030\017\3420P\3447nu\355\272?\226\020\301\374N\355(\217S0\273\036tK\255\t\316\272m$\t\210F\3359|\266r^~X3(\303)R\010\225\201\272\254\266\256*\311O\254\314\322.+\345\024\231\256S*X\261\345\n\362\275K\240\016\300\"\245\253\310&\006\344\341%\340F\303~\r\225\300c\333=\305\203\264\336\310\326\312\373\367\375\010\227\323\327\370\203\314\325\241\317\"\275\372W\311 \367xX\314V-t!\004\302\2648\203s\032\256e\342\322y\033?\302\352d\340[\262R$d\336\327'N\024\370\204\243\"\360\332#\216t\352:\276K\036rd\340\344\003\030\"\222\360\020\355tH\337\245\274d\337\305 \007v\274\262p7b\225\265W\327B\"\223\315\362\316\315p\241X\245\216\004\253\363\301\310C\245\272\235\231\273o\314\002\256\251\226\356\314\360=$\016*\267\350k[\247\366\022.\201\005.\025\306?\036\030\300_/p{P:\262gF\0007\267\200\250\247\345\344\311Q\350\321p\354\376t\344\240\246\t1\246&$P\254W\336F\354\2101\265^\220M\221\002\027\n\260@M\251\364\241\347\370\237\367\371q\342\220\361C\357\274\205\023%b\346\252\337\366\037>\370\211!\024\343FL\341G<\177\006\217N\030\254\020\345\256\316\304\353?m\304\252\026(\374\235&O\206![\223\264 \016\362\016\377\004*\332\330\020'uH\r\027\302\310S\236\325\2517\215\005\317\340\006\255\260\nC""\225\037\254\017e\360\344\202\300\225\037j\253\370(\200\3426\310\345\\\001\2459\372\177IX\021G3.\306\222\331\360\237e;xh\023|\317S\300h\322gK\326\027$mQ\2214\225\270 \024x\323\355!\272m\340\261\230\245vg\313\352E\347b\364\322\215\311N:\253\301w\217\033Z\023\334\255f\337\260$\200S\023\257\272$O\223mqv\033\020\257\2306\3243\371\215,\322$\327\233\332H?\240\027\n/\307\242\014\243\035\020\317\245\2474v\226\256\025~\2053\324\252\016\260\226\300\272\350\025M\335\363\323v\354'\335|\351\005\271p\005\253V\025\324\237\021q\252\2232\212Ps\311.\362\004\333!/\315\222\330P\032\364L;\275\204\202\253O]K\245\2114\262;Z\272B\010\007\010\256Yj\214u\3529\310\242\345\022\037\216\271oKD]^:3J\2168\023\275\020\374]\337\340\014\330\3319\357\n)\"W\214\224\301\005\364\211#\311\233\331\325\335\202\363vS\246\257zE\224\200>\004[\356.\213P\214\306\214g\034\230\"\007\010\336\004\241\354\201\272s\346\311\322\031\215\2669\325\264(\027\026\237B\005V\013\235\203\355\027\275f\220\345\233\007\030\213^\2255\225=E\217Y\244\021\351\205\241\300\232\025\232\225Y&\227\331\207\274\244{\305\201t+|\0204\264\277\256\272\227d\374\224\353\023.u^\177\243\001wY<\033\021\200\006\230<\226\201\230\241\216\3231TJ\310\230]#[\274n\352f\r\021\0052\217\316%2\315X\310\255$\017\010\346\270!3\246\347\277\367\265B/\261\342\016\031\0048K\205\"\222\244\302\240\204\031\022\210\005\321F4\022B4\335\337\204\231\212\341*\037\342h\330\366v\244e\213\0072-E\227j\026\t\316\320\225#\217\242T&[u}F>~3\303Z\227f\225\3468\361{\005N\230H\213\034PZ\354kp\212\373\\7O\230\352i9|\212h\210\256ZM\350Y\267,E\3210T\t2v\0341\321\270\206\221\367\265\3065)\302U\327!e;\034\346\202/\314NL\006\247\305\r\207\340j[\211\031M\351\206\003\004<\347\325o\213mA0\214\314\3631u\260\364&3W\242k\210\275\227m\357H\334^\322\020\336\322\224\342\330(2\346\247\323D\031\221\376bA\307u\016\375Pe|\031X\365\363]\2350\220\006\342P\037\226\273\030\344 \205Y\336\010\277m\235e8\003\314\352\323\343D\226\354\t\306\035\267\251E\210\225\303Z\301\206OD>Z\213\010\322\261eS\356HO\262\037""\303y\022\370W\316\221Y\n\352\357\303} \267p\235J\323\205\3676.\002"; + PyObject *data = __Pyx_DecompressString(cstring, 4905, 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 (5064 bytes) */ -const char* const cstring = "BZh91AY&SY\314\207\314\300\000\016\252\377\377\377\377\377\377\377\377\377\377\277\377\377\377\377\377\377\376@@@@@@@@@@@@@\000@\000`\030\236\356\371\362\366\305\035\035d\266\353\254\346\301\355\256\332t\300\326O5:[\335^\270\356/'s@\245\003#\320{oG\243\253gG\274\352\230>\025%\001F\373\226\303\004\222\022\215S2\206&\362D\323\324i\351\2504l\322\237\204\362\021'\250\3756\215M\032\230I\344\311\352\230\365\036\240M=@\302i\246Ljz\200\022D\324\301\t\r\023\"zM=A\241\352h\03224\032\000\006\200\003A\240\000\320\000\000z\207\250\000I\002)\25154=O)\2235\033S \3654\310\017S\322i\265=CL\233j2CC@\320\320\320\000\000\323L\236\243\321\221=A&\222D\232\204z\247\352\237\252m\242\232dh\320\323\324yM\r\244~\250h\000\003@\000\033P\000\000h2\000\000\021I\002T\366\022\237\351\246\212M\265<\230\244\366\205=&\203A\204d\000h\000\000\000\000\320\000\006\206\2314\004J\010\020M\0314\032\252\177\224zS\364\211\275I\251\266J~\232\241\247\244\001\240\017P\000\006\324\000\000\320\r4\000\361O\370\023]\314\030\355\231\202bL\246\303<\347\027\217'\233\t\273\270\311\352\311\020\276\021\000\272,\035`\205\260\007\\]\204-\221mD\214\r\2642\021T\022\225CJG\230\036xz\001\354\205R0\n\245J\257h,\026\013\005\202\367E\356\264O\225\371\371\325\r\254\010\252&)\210\030\206&\321\371\214\300\321\305\300\301\273\334\tc,\262G!\263a\311\014\203\347Ma\006H\311\030\242,A\001\025$X@R)\026\n\240\240\002\221`\214\210+!\271\260s\300\nC\2010\334\363\275\200\037,\177\224C\334\0038I\"S\343~\375\245\006)Z#\205\207\241\324\220\014\240Do\273\002\033\360\241\200+L\002[ha\033\010`,\202\301\025\204b\022,P\223\240\211\020P\355\231\202\232\220\316\200\325\003N\245(g\215\300\271(\021_\022\020X\300dC\0269\210h@\204D$VD\211\006A\271\221\203t\002\317I%\354\231/P\206a\250\255v\332\233\013\024\261s\003`\357\375\200fj\340\316\t\244\27403\014%\260\227|\345\016\"l\030&\200\333\027\024\354=/;\264y\334\315\035\241\000\220\241B\204X\300\n\021J<\332\307Z\032\335|\330b\3555\234\344\210\201#\030\022B\020&\302\327\326\312,c\255\324g\2707\\\370\035\023@""\334k\031\013!\024v\276\350\250\212\030!`\032P\263\r&\236B\254\322\241`uk\224\032\205)\240\350\246\305B\315\341/\214HW-e\3546\311\272gp\2711\022\221\325p\251b\314\217\256%u\225\006\243\221\2555\256\370\215\265\246d\343\220\351r5\240K;\365\363a\200\030\206\004\327\307\022\257\253\226\224\301Qr\351\240E\004\316\202h`AN\247\204\002a\002\017\261\000)\005@\373\024(\202'\211-\004R\204\001\373(\007\324o\357t\371os\220\005P$\271$\367\331q\254P\315~\003\212|\331\t\302\325\241-\004\235\350``\224\352\354\277\035\372\254\225_\017+b\242\tAlq\225y\274t\222\232\337\262\016d?\340\260\232\236\265Xl\324j\255\"9\312\007\375\332\272\026 \312A(m\253\014:%\233s\202\216*\273,\303J\245\313\252\360\303A2m\347\260\333\0040\005\032\243\212L1\211\250<\355\27762r\272\034\230\241`\206\350\304\323\257X\020\301\004\327\245B\256Ki\322g \322pni\216A\275\370\036\327\243\350\276K\344Z\241\242zOI\364\335,\006\355\325\330HF\020\204.JE\035\203\272\317#m\027\033\ra\234jY\276\306\231\306\207\223\342\220\016\330\357F\007\373\220I\005\217\372\210\034@L\335\333\372\223\230\r\215\221\2715\261\300\242V'Mg58\345\304\264\205\316Sk\350W\262\025)\2406\216P\\\313^?\226\026\346\035f\016\257.=R\010\304:\231\0024\022!D\220\241k(\321l\220)\002\260X\210#\002\222\014\226,H1\214ke\n\024\201m%)\324Br\035\000\372`\003\325&d\0000,*\272\254l\026\177/\020\030\312\302\273\252\251\273R\252D\"\232\301\220\356\240\027\211\216\001V\006\222\034\010\240T\000\201\274\217\222\255\"\257^\256_U\000\337\026\000\t\354\211\"\311%\031$\241\346'u{\305X?c|31\271\204\222](\250\212\242\"\315&\306\031\201\322\314V\346\030Q\225A\210+\026A\202b\322\304Lj\216\220\322\246,b\212k(\364\235\361\351\017#\303\3448\013\023\222\274k\215\252#\\\305\254\342\224S\030\024\230+\305\302*i\225\210\207P\022\356\373\317k\275\003\230e\001\232g\235\346p.\010s\326A%\203vk\000\234\334\322C\234\036\301P\"\001Q\350\240!H\266\200\210\363\272][n\200\221\200i1\231\006\322Mfv{\0347\t\220@\204\030HF@\nB\227\363\235\337ySC\364\303\234\362;\372\020\0174$\021\004I\205\031\t\010@G""\337\265m\247\006\261\331\346\302\333\0179\327\017ryx\250\242\211\332\372\267\213\302\260\204\276\272\004\013\356\223\335\222d\000\355U\250%\371\307\237\311\266\303\243\217H\034~#\367-\365\313\306\004 \310\260db,\"1Q\210\305\"\212\253\024\214dTT\224JM\241Y\013\020\264\342R]\354]\007\020\352\347\246G\005.\330Y<\023\316\n\246\013\016\351\250\210\333.\0168\211\036\2102lhA7\022m8\032\332\350\315\tN\004s*\024\340\227\003x\245\353N\376u\212\252DF\000\252\304Qc\026$\"\222H\205\n\tMq\006\330\030\206i\373ff\2440\r\035\014\343!$\222\004&\244\262\032\016\211\241\237\304l\017\341\320]!\240\232(h\246\201\333\241MOB9b\230\226\326\373\310\331[6~\364\372\360\231#v\351\231\201\362|\010\372\261\346\355(\346&F@~\257\241\363\017|\007\337\r\027,]\177'M\235\302]\307\333\027a\305\000\352\324m\362\261\347\025\003p\260T\r\342\240l\337\253T\356\360\364\322\236\346<\363\240\\\224\252\006\361*\326\326\2523\243m\334j\252N\3000\304\274A\277\010\"e\336\362]I\004(\252\026l`~\373\340g\246\337\210\372[m\335_\251\361\240R`\373\304$\217\277\225J\260$@\n\033\024\227YsY\231\213e\252\241\226\346f.KURr%\217\372\267V\266\325[\276\373\355\266m\230\266Z\253\340\370\036\210\016\010\360\023\207\254\337\273k\354\031\246`ff\246a\305\314\351~\r\036\223\260\341M\363\362c\354Z\224\215\313\320\264$\274\353P\3477!\263\205\346e3\231\3152\310\250\342\322H5di4\236\362\026w\3170v\315\235\235\231\235\252b\261\025\2612\347\232\201\353\206\342\025\202\306\252\342\3109\350[@\346\0132hY\212\267\232\022\3347\352\366\016&\341\366C\230\3479\357;\320\316\215Z\315\215\251\244]\231\241\323\014\231\260e\0049\0143Cn\032\026\215\234C\020\255/w\2235\336\367\006\227\307\364vy\310\300\016\020\207\211\324\351\255[ZU\266\333m\266\333m\266\332\266\333m\266\365M\317\003\232C\301\260\016\300\034\356u\366\232\333C\220\354l(L0X\252\202YQ@\326C0C\201T\235K\253\233\213\"\344\330\344<\355\347\314\361\272{\362\007R\000t<\274\331\230<\333\026\226\333Km\266\333m\266\333m\266\333m\274\307,9g/\247<\376Sn}\244\364<0\337\207\360\357\274l\254\213\254\315""\367[r\006^ 2\314\274\354\22363(y\246j\222bI\206\221\342Y\246\010\224\021&\201\345\014\3210\002\241\232\322#T\326 Z\334\001)\204\300\264\264\263\242\005\300\244\346b\322\032B\213\277\311\202'\t\356_3c\034\354 \300O\0161\020\030\244I\030\212\202(\305\214\220P\"\005\tA\001\033\335\222\256\326\\\273\031\214a\360\340\311_\\\253\342\035\334\007\036\010\210UAO\210\267\333\347\216\334*\033\027\244&\005\351 \006\244\223\230\363\364YW\267\233\271\340\033\303\355{b\271C\312\010v\265\222H\022I!\005UUb*\252\252\336\265\356\020\237\003n\327\223\266\246\320\207'&\335\rkf\223\2733Y\260}\034gT\243\324IR\261(f\360\032\226\313\003%\205m\t#^^kz\221\014\3220\275\352L\234\346\323\234\314\034\231\206O\205\242T\231\251H\206\260T$\366\203\025\030H\347V\262\030\2467\244\257F\035I\242\322\217s\177I\216\377P\222\333\0203\000.\351\207'MX\204\010\010D,\266$\210\341\364+\226%C$\020\373\254\203\2450&\010*H? h|\273\216J9}\232[\006\202\375\252\217\256\010d\344;T;\361\316\3058Pm\253Y\230|\315\303\330\256\3406\001E\212\014\024\200\004+\000\266\376\233@\346\357gl\014\363h\204\301\262\335B\0204d\241\256\365\355\215\007u\320U\270\2579\327\2549\233\302\362\001\326\230S\311h\265\016\251\307%\322b\t,Z\306\201AP2&\244\341v`\261c\006\2735\344i3\017\020@g\000$\346cn\375\357\010\341\004\213~\312\020BL&\320(\220\210\350\333\014\260~\367+l\013\023\033\220\305\376\005\243j\253\244k\267\014\316\312\216\t\205\211W;\206\204L\3273\355\210S\271\320U\211\343,q\033\304\352\2513wRR9\235n{\263\271\023Yn\t\222I\226\201\201\330\241L\201\320\241!jF\207 \344>l0$Uw\234A\351@\"!Z\000\222\215(ZI]/\230\210SMO\030e\214\360\037V\352\335\347\320\027\252)\247\016\035Whj\252\240 RN\340iB\333Y<\001\266q\003~kg4\257Q\tN\221\334P\255\237j\006<\250\005U\312\000\230\204\020 `\211\335\312ZLoxW||\202\370\324\014\034ss\322\367>Z\034,*\352\032\304\230f\375hv#r\373\251\2468e\200(\222\321\000\330:\340\007\333\343\257F\265\361W\270B\365\014\303\226\372]\372\316^\316\303`\274x\205\271\241[\024\204\276\341w\033`\224J@\0039k\364l\016(\226\311\303.""\210\023h\204@)\022@\220\335z\327'\013M\367\350\3504\245\246z\325\372\343\206\233F\243\215\366#\240N\033\002\0359\033\201\2248A\304\237\n\201|C\307\253\334:\256\372\336\223\215N\017\235N\036\215\210\354\001\216\304s\233\010\200D\240Bm\035\372\2051\r\312{{6\001\264z=\203\221\234T=Eh\241\333lf\230\300\033cX\212\344\241\233V\256\226\311TOP\3154\355JQJj\331P5z\221{\337\023\262\234\246\334\r\273\304;5\355$\016:\nj]\030ED\3748 4\223m\006\206z\205\320\210'\317\274\3043)\206)\266\371\ne\334\253\273o]\236\"\237\r\371{C\261;C\270\261o\207\2347\034\002\014\202\022!'\214\357\r\023\177\207\220\007!\010\002\316\372\r\207\023\032\210\013y\3219\312\216z\365\236\261\210\272\343\335\377B\354\353\312\350\030}\260m\334\267\270\r\320\t\327\266\036J\342\314\311\016\220p\303\231\000\007KY\322\260\316-\260\266\311QL\242\210I6H\300m[5\202Y_tB\013Be\016x\326\344-\262|\332\305\273\360\343Pt%\253J\322\203YNq6\344T\272\264\202\024E\310\202\227\230\340\360\306\243a\324\000C)EU\"%\002\"\003\304\224\002\024V\001\202\025\2138'\211:\016\311\014\346\345AD\352\240\264P\036\254\201k\247l\364 \025\305x\025\003\335\014-\241\345\014\342\251pK\305E\204D\221\022\001\346\330y\274\001\033\032\205Z:\354\355x\276\204$\213\273\331\246]|\366\245\251C\227\r|\313\250jI\326\323\257o\010\345K%\010!y\300v\341\257a\330\356\252?EC\t\273XZ(\201\323L\255Z\326\247E\306\213y\211\0143\371\214\365\356\370\334h\236`\361;\373\341\363\301y\t/,!S\n\273\260\2610M\206 &T\311\001(.!M@\3363\020\273\024\322)KIH2f\303\225m=\323\216\214\"\305^\244xt\026$$\n \003\353\367\253\200\205\013J$hl8VT\024\247\234\324\222\201U\272\304\371\\T \036J\001\004F\n\004E\266\263\317C\031$\211\033eK\212\262\324x\361\337\323\305>\235\372\252j\3157\221\220\356\206\277\nH.\333Q)\1779_\005]\352\264@0Lq\227\245\260\026\350xI\t\n\311-\22501J\233A\024\235\035\306\275\265\342\366\351\252\0268H\304\305\250\360\001VY\343\232\252\000\365*\341|K\3555(I$6\261M\251j""\327\261$\205!%\257\177O\265\314\252\246\302\376\001E9\366\371\360\251\321\273Vx\343\215\213\026\331\324u\017.I\310;|\327>\257xg\270\207\205:\3437(|P;&\003/FI\200aC\236\304\260\321Hf\320\200(\306,$\017\010\020\240\211\005\010\340H\261.\201\302\310\005J\213$$$\307\032\344)/\252\024Z\356\201\211\271\320u\351\263\255\270\361\314\263\016\271$\227\251P\001\341\337jR\272\004LA\324\341\237\014\240\303\010\256\341$\222\224\013\027\300g=p\r{,\363j\210\000\341\n\321\221\231\306\235\3329\343\343\310\003\210\234\200\344\247+\026\r\201\303\347Z\036\312\206\340*\304\017f\275\207\302C\216(q\204H\023\024\0055\304K\212\247x%\365q:\202\350\314`@+\341\274\372\007o6\202\035|\322g\365(\356\227Y\207\252\252\023\242\300_\301\007\233Nn\300\334\035\356\254\3467n\362:\037\020\300\000\366\300\016\325_\241\262\217\322U\240\021BQ \260\220\220\223v\035,\236^{[\223\357\337\200\363\256\343r\233\311\024#z\271\244X2\302\374\000\321\nE\034=B\000\213\341s\212o\277\324\007\230\204X\014\207\366\210\304\021PR\002*1|\260\363d_\326\037\231\"\303\344\301\024\201\341\t\"\320@\300\236\364H\237q\240\327'9\321\354{\002D\020?#\010\037\304\223P\302\236\264\202D\004\n\177\302 \025\204\235\341\377\277\241\177k\217\243\367\032\303\004%\027\315\023\317\037o\237*f\301\331a\037\341\244\265\364\322\206\n=\000\344\362aKrS\007 hd\335.:\3767#\344\240\377\234\247;F\335\222,\0142b+E\233?T\247\010\302%!l\031\366\342b!2N\361N\036\361N\031\020\007i\\F\002b\324\301\r2\"Q\213\230\230\252!\352p\234\021\036\tA\243p\206\255\265\351`\351\313\341\031\027&\212p9""\347\257V,b \304I\343%\305\224.m\274M08L\301\033\\\035\252\246r

#\274\313\276%'\023\030y\364|\031j\177\342\356H\247\n\022\031\220\371\230\000"; - PyObject *data = __Pyx_DecompressString(cstring, 5064, 2); + #elif (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (5044 bytes) */ +const char* const cstring = "BZh91AY&SY\2466[\221\000\016\252\177\377\377\377\377\377\377\377\377\377\277\377\377\377\377\377\377\376@@@@@@@@@@@@@\000@\000`\030}\335\363\247\333\036\217G\275w)\335\335\316l\035\275r\226\330\357^\3578T\353k\334\364\347\274\336\3359\315\356\341\324\201\243\243W\273\336\327\243\021\323SE\357\273t\003N\001\364\373\200\034$\222$&\231\0324\361@\006!\240\036\230d\321=(\321\220\r\036I\3511\242zCM=@d\000\r14\320\002H\200Dh\tOj&\306\246\246\206\0206\246\203@\000\017P\r\032h\001\240\032\000\000\320\r\000\t\020D\211(\036\324\232a\250h\030\203@\301\242h1\233S\312zSH4\320\331F\236\246\004b\032z\214\232dmO\010\324\t4\242J~\2244\032mMQ\372MM=G\352\233\322G\221\r=&\233P\323@z\232zj\036\240\000\315@\000\030!\2404\006\200\212H\0210\230\324\304\241\351\264\320\247\351O)\372\240\017\325\001\211\247\250\365\000\000\r\000\000\006\203@\017\022=G\251\240\"P@\231&\2004B3EM?i(\362\233OSF\247\352@\017P\032h\000\003L\200\000\310\310h\000g\252\177\340\207&\274\356\236\354D\301e\306\376rq\370\366y\214:\376$\263\331\260\201\274\n\013\321a\360\004\257\372\007X]t.\300\2734R\037dhE\330RW.`s\003\232\036\200s\302\251\022\n\245J\257h,\026\013\005\202\353\221u\312\344\373o\267\225P\336\300\212\242b\230\201\210bo\037\270f\006\216.\006\r\337\030%\214\262\311\034\206\315\207$2\017jj\020d\214\222E\021b\010\010\251\"\302\002\221H\260U\006\000\022\014\211\010\260$\212`\\9\320\n\t\210\324\300\364<@>\334\177\234C\322\006p\222D\247\322\177\r\245\006)Z#\205\207\245\313 \031@\210\334t\2047\241B\350_K\242a\302\030\006\262\024\026A`\212\3021\t\026(I\302D\210(vL\301M\310g@j\201\247Z\2243\306\340\\\224\010\257\234\204\0260\031\020\305\216b\032\020!\021\t\025\221\"A\220nd`\335\000\263\322I{&K\326!\230n+J\357\233\026)R&B\303\344\375\340\231\250\221\254\262\231\031\220\231$Q\010Q$\374\240\324&\303\004\320\033b\342\234O\226\362\273\307\225\314\321\330 \022\024(P\213\030\001B)G~\243\252\032\272\357\303\027y\251\312H\210\0221\201$!\002lZ\372\262\213\030\352\3563\340\034.|.\211\240p3\030\205\210E\035\256\343\n\210\241$)""\006t,a\234\317\312U\232T,\016\355e\006\241Jh:)\262\241f\360\227\306$+\226\245\3546\311\272gp\2711\022\221\335p\251b\314\217\305\022\272\225\006\243\221\252j\274\361\033j\231\223\253!\322\344k@\226r\347\327\223\034@\3101&\275T}\177~\224AIU\263(\212\t\221\004\312\300\202\234\276(\tX\020}\350\005I \036\245,\010C\214r\220\220\242\004\376P\003\32498\363[\3558\375\244\002\312\n\350*\344\207>\221Qu\375I\r>\264\303 \263b\242\031\010;\320\221$\247We\321\351UbUyy\233\025\020B%\257\313\n\363\267\222Jk\243h9\220\377\202\302nx\252\303m\306\352\322#\234\240\177\335\253\241b\014\244\022\206\372\260\303\236Y\267((\342\253\265\230iT\271u^\2344\023&\375\036\303i\"\300\024j\216(0\305\346A\347n\224\330\304\345prb\213\010\356\031[.a\030B\272\322\352\275\235xe\217y\356\220\357=^o\017Y\341\370\237+\345\372_R\372\213T6\334\237\t\360\237\003\272\300p\246\304\204a\010B\304\261G!\344\263\265\246K\206\30381\255K6he\232\320\370\027M\324DE\000\223@S%\251C\210\022\251\236\347\270\316\001J\020!\006\022\021\220\002\220\245\375\007\262\206g\353\007\003\300\361\362\240\036f\010\243c!)\006\002\017\255\305\301\330\344'\037\230\311\300""\3176r3\306\235\354*(\242{\277\267v\274\252\302\022\366 @\277\031<\322L@\017j\253PK\360\036\036\r\266<\335] u}\003\367\355\364\313\306\004 \310\260\2221\026\021\030\250\304b\221EU\212F2**J%&\220\254\205\210Zm).\313\027!\2649\235y\023\301v\035|\017\214/x\030\024\243.V\276\323\020\241A,R\345J\266P\301\230\030\255d\253\212&\206A\2219\230a\006Y\022\030\212l\3076s\2474\252\244D`\n\254E\0261b$RI\020\241A)\254A\266&A\242ff\205\30373(\310I$\201\t\242Y\014\3074\314\317\330j\037\307\240\272CA4P\321M\0032h\360G\034\023\002\333\237y\033+f\317\340\037N\023$n\244\213\0239\373\310\\\252a\250ua\025*\007;\260Z\305\302`]x\\\225h\255\373\330go\tCVan\030\220\r\273E\335\331\315\261P/\013\002\240h\022@c\321}\355\265\257\222\357\305\246f\316%T\210 4\010\202\204c\004k\207\376\210\035\335\250`1\225\023'\323\t&\252#4eQ$\251\270)X\300\376\027\312g\246\377a\352\337o\035~?\244\201I\203\357\020\222>\376U*\300\214\000(hR\\\342\3438\3060\266Z\252\030\267\030\306\027\022\325T\232\245\217\373\2676\252\255\256\315\2334\323\032c\013e\252\275M\334\000p!i\021\247\2634e\301n\026E\200\261d\213\007L\254l-\353\226\301\3004\276\206\337e\271\027vR$\344Xf\223jH3\031Pc\323&\260\366k5\325\251Q\305\234\200e\201\234\316{\310X\356\307\214\035\261\263\263\2633\265K\325\342\265\346.\201\220=p\326\205`\261\225u0\016\202\026\3109%\214\232\0261V\351\241)\204\371\236\320\332l\017\000tN\221\322\275'\205\2349\265\232\032S(\2723#\227,ZL\242E\310\260\315\026\326`\260\312^\027\205vk}\357\026k\336\373\303\343\372-\240L\000\331\010u\271~Uj\332\322\255\266\333m\266\333m\266\325\266\333m\267\230l7td8\254\003\204\016\243\216\035&t\310\342\033\264&\"0\301w%5e\203\302\033\t\200.\324*\205\223\203\010\310\254\324\365\366M\376\377?\234@\345\300\r\317?8\306\007\241\241im\264\266\333m\265\335\335\335\335\335\335\335\335\335\362\230#\005\206\263\243\201,\362K5 N\237\216:\311h\341|\034\2009=\360\034'\017\320\3409SvE[wEM\025.\210\232n\250\251\2420h\217\010\263F@\005\003\022\312#\003!\021r4\211L&\006\223I\237\214\013\001I\337\327\2242\205""\026\277\202\354N\023\330\270k\342\034\214 \300<\346\030\020\030\244I\030\212\202(\305\214\220P\024\220* \373\331$\342\342\327\3028\003\361\363ws\370d\223\270|TV\233<\23534\2045\327N\316\272\355qj\315f\223\341\310uJ=D\225+\030E\233\301j[\024\214JU\264RF\210s\033\323\214Y\240J\353\252L\234\346\323\234\31192X\236V\214)3%#\026\260T \366\211z\253\223\243\246\2223=\255y\235yd)u\252k\324\353\360\234\035~\375%\312\020\037D\001wL\032\274\252\304 @B!^\030\222#\203\324\277-EB\302\010w\326\003\nRE(*D\017\276\037\355\343YF\256\031OC!x\346\036\362\004\031UE\202A\271KD}.(\337\210\260m)\006\3342\201\214\007I\224\030)\000\010V\001n~\233@\344\3623\266\006~O,M\374\216\344!\003\024\355\353V\254\345\312s\272J\266U\350;\233\201\315\335\027\271\t<\360\212')\214Y\n\340\202\241&IF\014`\360\213\013\221\242\256\217\265\361I\203\006\250\252\"\251\310\234\302n\210\033\000\013#\024j\364s\031\302q\336\256\204\020\223\t\214\024HDr\354\006\264\034V/\265\205i\211\306j\177\201\204p\252\255\321f\330\317\005\221!a\001&|\321Y\344\204m\327sX\203]85bw\302\373\306\361\270\364\231\306\311\010\033\375v.4\356#5\213X\231$\231`0;\016=A\\9!jF\207pw\017\233\014\t\025^s\250\036\224\002\"\020\n\300\002Q\245\013I+\245\363\021\ni\271\352\206X\317(\372\370V\357\346\\5\304\246\234\0306\255P\325U@@\244\234\301\262\206\034,\234\341\260s\003z-\261\247\023p\210\335\304\350\024\306g\210\207+\251@\352\346I\265\002\032\202@\020\242\021\236];H\254\346\304&\313\216\022\244\000\232\245\225\256\224\217\361\3151\022J\361\254I\206o\311\016(\334\277\ni\216\031`\n$\264@6\035`\007\336\343\256\215k\347W\306!z\206a\335\317K\277#\227\273\261\260\275]AnHV\305!/\300^\006\370%\022\220\000\316Z\374\333\007R%\262p\313\232\004\336!\020\nD\220$8^\265\311\302\323\236\374\334\306\224\264\317U\177\272v\247q\264v]4r\211\326\260!\375\310\314\032\301\252\034\311\360(\027\0046\361""\356\230\350~'\244\352\251\320\372\024\350\373\355\221\331R;#\234\330\210\004J\004%\321\256\320\245AyM\313\227\000\27282\035qf\025\r\004\322P\321\245\2571t6\006\370\212\343\241\233kk\223L\252'\250f\232v\245(\2456\264\324\013Z\021|\217\234\343N\351\277\003\1778\207\035w\217V\202\233\227F\020S\030\240%$\332\203B\272\">\336c\000\304\245\260M\257\250\245\274J\274\233u\331\351\024\365\337\267\320<\023\210x\213\026\365\362\207\003\240\"\001'|\361\206\211\317\356\372@;D \013L\262SgnQz\301\025j\262\253C\261sf\243\342W\013\031\211\016\220p\203~ \006\355p\307+J\017\335\370\203N\2631\304\311\265\225l\221\200\332\266k\004\262\276\002\021\\\341\315\033\\\266\371\3676\026\317\257\032\203\241-ZV\224\032\314\253\314'&eL\025\244\020\240\203i\215\336\234*6\034@\010c(\262H0\205\006\020\007RP\010QX\006\004+\025\306\036g\260\355\022\274\274\220\024N\312\013E\001\354\310\026\272wO\201\000\256+\320T\017Pam\017\010g\024\370 \001\200&\021Qa\021$D\200y\367\236~\360F\306\242\255\035\254\362=n\344$\213\303\206\365\325\232/\027s\203\247\026D\257\024\006mI\365a\245\225^(v\020I\264\213\t\353\261\305\341T}*\030N\032\205\242\210\0354\312\325\255js\\h\267\230\214N\325\277'\224\246\350\335\016!\265\264?\024\027P\222\344\204\024\230R\330\t\221\201\031\214\220\252UD\205 \211a\005 \302jXE\220S\033 \264\224\203&4\034Ve\340\333\021\221\222M\320\233\375\003\"\212\022@\007Fy\251\020\241iD\214\216\003\026\n\202\224\364Z\222P*\273\231n\327\236\350\007\321@ \210\301@\210\266\324\357\241\214\2220fu\272\022H\346\315\333\267\3707C\263\247O\0073l:C\024\352'7\303\252.\373Q)~\362\276\342\257:\255\020\014\023\034e\351l\005\270\036\344\220fPfh\325\346Q\0206B4\235\035\306\272\332#u\267j\0268\010\274\275\250\361\000\312;n\331\311\000\370Up\276%\367\233\224$\222\033\330\246\364\265k\305$\205!%\257\177\315\363\362*\251\261\177t(\247.\376\374*sp""\335\2368\343b\305\266\353:\307\273\271;\203\267\340\271\364<\201\237\002\036ZvFpP\366@\3430#\245\212\354\r\224\350\344\226\031)\014i\010\002\214b\302@\352\202\024\021 \240\315\202\310\303H\007\006`\006\014\022*(\274\253\251 \347\024(\265\321\003\t\241\302t\351\243\2355\345\343\025\251\324*\323J@\002\226\245:\353]\020L\004>U\366\361\030\220\202eEZTk\245hG-\320\r\332\331\337\244@\007\010V\214\214\3164\361h\347\217\020\016\2018\201\305N6,\032\2077\265hy\0249\000\253\0205\346\306h \303R\031\304H\022\270\noDKeN\200\227\025\255\312\033\206\246\364\003\227\243\234\362\234y4\020\353\344\223?\216\217\tu\230|\312\250Nk\001\177q\007\223NN!\300-\343wg.\335\3569\2370\\\000\364\000\035\253'[z\316\304\222P\031\001\260I\021E\027\241\263t_\027\257\234\365\017~\375\003\312\274\016\nv\330j\235\317\347\025\300:\003\036\360\365\206\306\t\201\357|\205@\306\263\227\251\345\036\037\365\200}\324\"\300d?\264F \212\202\220\021Q\213\347\207\247\"\372A\372R,>|\021H\035Q$bA\000L\016\371\002\2353)\232NC\207\263\354I\020@\374\254 qI8\310\310}\252\024A\024\377\204@+\t=\001\366\177Z\372\256\036/\211\234\030\020\224_LO\\\236\217\235t\356\211\311\260\003\267\356}\211\326\357\277\233y\224(\233\322\310\214\210T\314\375\035\257[\217\376\215A\004\377\tR\241F\204\211\020\203\271\300|\017\344\373\216\364\004JB\376d\001\373\357\207S\313\210&\244\321d\226\006\203Sg\233\321\016\016\201\3477\361S,b\206\211]Q\036\366B\251B\335\341H\316\t\343\206h\030}\017\003\275kL\324\266\007\304\236A {]ET!\207PF0\\\366\314\tJbD\246=\214\235\274\224\205L\006\224\231\017\004\027W\310itT\354AE>\261\356\n\010\027\347\374\201p\275\243\001\"\212\257\017\341;\014N3\232\361s\326h\n\017\00088&g\216\006\003\303\"hc\346\337\177\033\244\255\241\325\202\340\354\235\254$`\030\323/\210\346s<\255\207\3061\033\n\347\003\236u\262\304\322\216\246\204\310\264\032(\"\017'j:[\207\305\270+\232Q\260f\334eY+A@Y\354l\007\313\201\017\307\375\037\361\207\235\263\373\r\033w^\201\022ux\357\220Xa)\030\034\033\003o\237\"{\202\004\330r\336\3228\326\350GR""\216\222\361\266&\270\237\272\267\025 \303\337[\363\311\r\355\340\310\367\006\325\274}\367\353\331\316j\210<\362#\314\355\001\375U\3642\263\222*g\"7\007\2203\304g\020I\360\214\336\272{\305\2740\252\316\221+\232\267.\231\275B\332oj8Z\353\205\2768\265\"\235\251\034}\261\370\266\206\320\347\255\342v\031\303\203\177b\200\224\314\235iW\376\370\322\336{\276\371\324\236If|\361\237\2000v@\357\263\350\250w!\335\357['yS\373\356\n^\351\334\363\237\222p\363\302\025\035=\244\223\343\234\360\212\346.j\364\003\234\0043\367\022\266nPn\001\313\205\341\362\003\213\262\021\033\023dO\035C=oD\240\332M\233v\205\255\246\243Q\033El]\010\305\030\033\375\363\201\356\273\235\211A\342\276N\332\260\203\274\345<\325\222\361\301q\017v\336\022\372M\276\320<\323Q\312\016\030i\265\277\201sK\200\265y\334B\210\252\205&U\214x\23111\n\252\027f\360\311\216J\026\212\235Al\330\227?\321X\2742\303D.\202x\256\3179\314\360\355\241\326\331/C\000Gi\n\316\220\266\003\254?D=a\304?q\364>\231\357G\357>)S\023\342\216\023\303\006W\002\305J\313\266\304Y\026\335\222\357\356r\340\306\014h\364X*0W\3132w5\257\203\014c\2133*\2645\306$l\203\020Lj\021$\273,\275\r+\023\202\321\013\225Y\213\266\365AR<\301D\004\204\301\240PL\220PQ\001s\242\266*R\321\003\357('\352T\340\"\036\007\255T\225\215\024&\276\266V/\032\344\3114\031U\203\001\211\r\"\2123\003\013e\271\035J\204\301\251w#\300bU\"\333\031pa\206j""\255\336\035t\010\360S\375\213B\345\032\226\232\310\031as\016\365\342q3#XD\273,\201T\332\371\306R\203\201\020_\224\244\205,#*\022\324\025\202\313JQ)U\032\242\300\325\202j\314`\301%\272\214\321P\355\222fn*+9\344l\325\251\316\242\301\265\031\321\313}\373F&\214F\275t\213v>\357:\306:\355\300?PWp\265\2534j=\343\274\313\236\362\223\212\223;\360\365C'\376.\344\212p\241!Ll\267\""; + PyObject *data = __Pyx_DecompressString(cstring, 5044, 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 (5082 bytes) */ -const char* const cstring = "x\332\345\034K{\322\332\326\326zl\217\034\205\226>|\207Zm\253\205#P\337\367x>l\365h}\\\261\276{*7@\332r\344\231\004\333\036\365\373\316\260\303\0143\3140\303\014\0312d\230!C~B\177\302]k'\204\000\t\320\207\026\357\365\323dg?\326^\357\275\326\n\321\027\212r\330\212\006\035\335\327\325\231\216\014$\272\263\351\204\275Ww\025\307\037\214\240\274V\222\272j\222\304Uc\374\252\345\270\245s\265\236\340\337\351)\330d\214\330Q\013,3\335`\225\263;\ri\272\307 \255\323\265\331\216""\307gM\343\263m\340[\215[\257\237m\263\276n\377}?<\203;=8\003?\206\374\275\301\035\034\233\301v3\374\235O\330\243\251k\321nWXzp\307\306Not\217\261\007\333\310i\326r\334\337\336\207\357W*\207e\233.\257\211\035\330\257\231\233\270\272\276\226\210\255Q\353,\235\005\306Q+\372\217\320\2518\263\222Hk\274fL?^\247\222\231\325D\254\236\211\334w\340\"\240Cp\233\242g\250\350tmC\237\317G\356,\303\347\3314\025\245\356Rt\007\354GP\260\221\261\2515\206&\306\232h\370\014L\275\215\301\024\260\3646\025\370\372\363\017G}\363\227\006\204!\323\373\306\221\2753\2040\301\036\037\203!\0333\324\246=C6(\317o\324\346\3368b!\216}1Md\027=\211\246\031 \214\323\374\240\306\304j/\214\353\006\373\004c\317T>\311'\262\311\004\303\032\237m\300|\232\243\022<\376\352\017-\225\247Y\330\263\366\312\363\251\261\244\366\251G:\237\212\302s\363X\212\346\301\025`\221\301\344K\323q\352\212\237P\246\301\366=\313@\300@<\360\334&\277\006\256\002\266\2163\311\004\300\204P\0022=\340`\"\306\003""\2220)M=\277\377\334;{s\226\000b\231\277\230\030\217u\214(\3712Fs\337\321|\002\020\001?\275\231e8\037\365h\205\332\314\344\2514\303\3041\024\311\342\0274\246\005@%q\344\204\334I:\235\316\3604\3627\002\313\301_M\352\237\310\200\277\307\325\017\350$\307\370\376\235\305\031tri\221\311\345\231t\214Y\2566\226\000\331\345Wi\030]\002\241\317P+\311\014\315/\277a\361\333\034\266\346\r\221\374l\"\366\221|\250C\010\004\317h\372\244G\343G\225\3011\362M\017\240\017CX\252\261\370\262'I#\2032i\337\357\240\210\021\240\201\251A\373\325\374\255Pv3\236\340pW&\215\327\325X\202\323Z\361d\202\343\227\370<8\340e\353\267Z\326\275\276H\004\277%\212D\232_&4\367\030\223\347\340\212\273\266\372\\\251\325X\rP\353Ip\346\3608\251\006\323\002\202\321\005bY\247\331\370\334\032\023\373h\352\206\263\037|M\214\3418\213L\326\242\313\000\335j\314\367\257d\006Z\334]0\3524\263\221e\255'k\004X\215\265\304\3124j\275Q]\351\250\271\247\236\204\306!\023R\365C\265]\233\245\321B\210-D\327\020\3304<\032\020\232\373-\227\233\020l\ng\233:\014\340\366#M\274\265\232\252a\322<\322\002\227V\342k\254\3735>\233\321\266\026\\\323\200\t\223\306\224\266\251\243\006\336bD\207\3374R\267A=\366\r\317f\3606\3307\016\324\2007\277\031n\35616\260\034\322\266\260\030\252mRu\376\221\310\363\315\r\3707\017\207S\344\031\263\301\277`V\252\307\200\305\007\206\026]\006*\326c\032.\326\237\302Y\367\326\001lA\337\2534\234}\211\3254\023'GU\213/\212Z\014\331\033A'\213Z\317\321\320l9\007B\207\210^d\210D3\371t\234k9\235\243W\230\352\374V\023kr\266\377\231\254\375\2105y\326z\334\232m\326kZLi\3411:Ze\373\033{\333\201\366\n`\277\244\325\214zR-f\330\213\336b\262\225\340[\371[\273_i\331\365[\221\264C\201\333\256\260\235\320\201\260[\254\261\375\322\311v\240\003Q\333.i5\243\201\314\346\031-D\335<\331R\324-\316\"\273\237\307\332\365[\221\264SQ\333\255\260\235\320\211\250\355\327 \272\032\337\310\377\016\020\257\372\375H\265at \337\352\036\200\211\332s\n\342}\216\3466\323\261D\306\027\313\260\031\310?\323\014\027\215f2I\rv\254\312\230\030de\2118\344""\"\034\2641\301B\001b:\213\217\260\010\210\215\340\177g\300D\351\330\307X2\303A\232\222L2$\370\343|t4VKU|\246\254\305\324\033\317\244\340^?\306C\203\213$y\177\034\217\342H<\023\303KJ\233\252]u&\350\0178Okr\344ub\204\\\311\005)\217\030-\322\200\0046Rm0\033\261d>\316D \2415'\013z;\246\265a'\314\364\"\344\242_u\221\241>7\353\364Zb-\021g^c\001\022\020f6\252J\021Ip\021\203\341\244*\000\027\226\007\276s\311\014\360\224\020\003\327\r\370\033!?N\346\260\205\010\247\022 \273\364*<\022\212\364;\334\310 \271\301\365\023\2061)\206\2475a\301\2524\374\255\202\202\226\031T\"\255\201\322\356p\323\006\361\006W\000eL$7\024H\265\231fViL\241a\007\240;\twh\261\231\010h\026\233@e\251\225\"j-\316\324\313\245#@i\232N\301R`$\260\000QDB\364FB\373qv\225\261\234\366\2247\002\035\355\031\304\306\325\026iO\372\312Z?\351\313fi6\305e3\331l\006 \200\221\021\026\032m\230Pm\343\216\\\315\342\"\320\301\300b&BF\364Q\202TU\350\270o\025\317H\0043d\2150\226Ie>1,\252D\235/\343 Y\347\230\344\nd\352q\016\224\007\377\221\213\266\014Zqf\205\006^!\257\223\214V\310\346Y\220\013J\250Fk\375S\223;\301am-i\260\034\2174\363H\254V\252A\243\252\265h\243\033g\351-\243\217\0002\332,\350n\226(S\004|\003`\317\257\261\231u\255\302b\022\222U\213`R{\254V\222>\301\006d\017\rc\350\306\211h0\206\256\3413\232\003\271\243\202j+#F\303\354:\214\316\365\004\277f\356\340>\231\234\315\306\337\211\254\332w^=\037P\274\205\334\366\340\241\201_\266\036\013\271r\277Cu\234\021Cp\337z\"\366\264\237A\036)\251G=tN=w\273\340\251\364\035\333\nn\255\na\265\317\243zf\225\247E\227\266\364\251\350j^Z\007\241o\\\035\277\246^{X\372\251D\227\373\217m\315n}\021oH\236\262cH\360W\372G\205\317\222G\232\225\000\201\323\242\277\334\177J\364T\000\300\037\302,\340\3448\261\305\013A\201.;'\244\307rN\351\2518\317\213\353\022-\345*\000\3506`32%\367\224\035\347\305\274\024R/\336PH\377\354\026\254\034R\207&\2449)\267\375\323\241\201\223b\257xA\014\213\253RXb\344\240L\313\353\n\255\344\013\363\305#\305p\271\177X\010\013q\321'\367\310C\362\274rDyS\270W\210\026\373""\212\363\245\276\322\274\372\374\265\372\372M\031\360\344\324S3r\250\326\302\255~\003\310^\211\223\275\n[p\021\212\266\307\017\r8\267r\235S=\206\254\002\024\254\250\366H\247\345\220\034\2568O\211\223\222K\362\324\250\023\356JCRh\277\210;)\272`J\257\177\251\276|\253\276\375S\375\363?\352\177V\324\225\325\n\231HW\234'\305Q\251\007Pp\272\205?\304\353\320p\203\236\211\037\344\200\374R\031T\002\312\313\302p\201\306]\303\345\261s\342_@\245\013\021A.\272A\235*\375'\232D\341\026\346\221\3430P\356\037\024<\345\376\021\201\256h\004o\361\352\320\214<'s\212G!\304:@\251\235n\325}E\276\241\\)\204Q\263\027\324\221KRLv\311W`s\027\312jS<\014\212\353\034\023\217\001WB(\253*3t]-k\272*\254\0004\340\3455\261G\034\021\321\340\266\346\205~\261O\274\017\242|,\363J\020\344\366\2658WdK\356\322+\365\0050\345\025\341}\271\312{\202\316\220pK\374C\372\227\234W\036\025\336\024\237\250\317\027\325E\224\242\372&\256\306W\325\3255d\307\033)$\205\313\3561q@\032\001\004\306N\213\327\244^\351\022\210\330S>3.]F\255*\273G\005\0360\037;\217\31042\252\242[1!\360(\314p\216\n\304\230\206\204\tPM\215\177\372\024\267\360X\314I=vt\236\330\312\013sB\243\034\006Mp\272A\016\207\305\240H\213_\311\266\023\nS\010\300>\007\306}\344F\\\324\355\335\306q\270\205\020\341\234a\232G\204\017R\020\010\345\345;\n\255\231\001\0078XzP9\026\3044XXN9V\360\343&\233\322Q4\020CE\316\210\217\244\327\260\335\231\363\"/\005\240\031\220\227\n\275\005O\231\272$\375\245\364(.\263\220+f\2434Q\227;\020\312\236\200\003\354\214\242\260%5\272\340P\272\254zr\032\216\353G\340\331\334\205\027\352\357\377.q\352\213\305\212C\327\245\006\2658\276\025\027\252\n\340\024\214\360\253\346\021O\212\247A\341\336\243;\2558k*\202\024\022\005\275&\376$\306$7\250\344C\345\036\350899\211\342\362b@|\013\034\320N\323*\321}\322<\270\262Kx\272\303\201\340\032\356\200\364O\250\3576B4\360\270\016:?\217\240\364\375\257\203o\231\025\365\275-\\d\307\204C@tp\204/B\200\272\317\204\353\216\300%\270\205\260\356\010\010\023\210#\330\225\371\353\247B{k2\235\010\0142fP\270(\344\320qi1.\253\272<\322\240\356\177\021u\014dW\355|p=\t\373\341\306vi\341\271\356qW\373M\301\336\335R\243\376m\373\364\014\347\202z\341\272Bo\037\3074\360\031\nOK\003\253\003h\217u\335\023\352\304\r\365\306\202\272\300\250\314\312\366\245C\003\016\022\354}\306\364\245\354@\0341\324w\014\013o \306\017\243\360\007H\200\246[\244_|\014\022?\205\222\320\323!\\\264.F\245\237$\032\217\317\036\361\2444)\017\312\327\025W\303f\250WW\340p]\2018{\263\360K1\214\201\354/\252\203`i\312\\\035\3470\215\202\235U\347\244\264\016\251T\316:\324\374J\344\347\204\034\363\":\266\212{\0303T\222\216\rk\351E\325\025\251'\220\345G\344\227\252\177\256\030,B\000aC\341u\022H\031\224\r\237\206p4\n\036gA\216\201@\252\375\007G\227\036\366\357\033]\017I\354\326)]\230\307\"\354\227\240 \340\353\017\013~\214\320\214\204yL\374Ez\251N\377V\010\027\022\305/\352\342KtL\223`1\036-e\305\000\014\222i\2274!Ee\2072Ol\024\220\203$[\035\235\224X\260\0107\252\022-\346:""\341p=/\254\251\036\022\357\211qi\nR\352P\307TVj\241\251U\350iJ\206\037\211\257%\342\221>A\276\375\0316A'uT\311\025\372\n!\314\204WI\372\\\213B\215\245g\301\027\367I!S\243C`\355\306\333K\020hSO]\221g\325_\357\025=\305k\245\303\020\366\207\214p\026\231\331+^\306\222\215|\224x\334@a\251\324WZP_\353\231\225\272\306\251\034\337\371Lb\013[\013B\232\314<\206\231\244!\252\263\342\007r\246\374]t\027\233\037\033\324\367\016(\315\tR\3401\324\330vD\333\264\031\301\017\245`\211.\255\223L1\252F\001\321\217\352\307\224\232\312\251\271\317\333\207\016}\351Y\350\205\333B\357S\274=\355}\206\267g\275\357\360\366\256\367}\2575\325{\007\212\025\272^HH\347\225\201\202\253p\271x\257\030\005N>Q\337\276\333\265<\367C<'\305s\244\357v\341e\321e)\217c\244\370\363\315\371\276k.\350\201\3157\320\325\266\312\371\355Tp\367\332R1'\335\271r+\307\324\241?j\277\343\030\226\255\010L8<\026!:p\231\032\306\3211*|\221f\325\311;\005\177\341Q\361O5\374\302\312\241\237%\220\357I\037\225\021\302j'\226v0\213_V.(a\255,pC\034\207\000\205\223'1(\265w\371z\322\322\362\354\030\305\230\315\210q\352\002\033\364\227\270\323\203]\202\036\022C\035\201\276\251\336|\013r\005\240\352q\217F\310\315BO\005\366H\212\036\321\257\366]R/\335Ro=Q\237|P?D\266'\016\r\234\023\303\345\246\232!D\022$\304(\273\247e\027\204\023\025\214\034\306aG\027&P\247\252\302'U:\243\\\006Q\247:q\033Nh\022\206\362\222\237\310\264\307T:\323k|\346R/\211S\245\220\034\372'T\031r\227]\203\345\341\221r\377@\331=\274}\027\243\262\220\236[8\266\356\013$\326a\205!\350tjlZ\302\250\270\342\254\362\014\223E4#\307\326M!\000v\354\300\242\36118\213\343\220\375\365*S\030=\270\205\247\240\002\017A9Ye\010B\n\320\271\342G5\374^}\277T!\211\017\211|\376\tm;\320\034\037\n\315\210\241Q\320uET\244u\001\302\"@\357\013\226#\313NL\007\\\030\232$\345\tyE\231S\364@\237\274{\350\023\237\240u7\024'\375\246\022$j\367\r\331\243U\031\315\005\311\353\250\2765\216\"\363\376\t\031U]\302\"R_$\375Mx7\026\177Mx\177B\026\232t\rE\003\274\n\t\357D\332\252\224\352o(\230\272,\260#I\212\277LMJ""\325R\351\031L\200\266\335:g\021\227\007\232p\027 \242\353\243\244\036\215\353\344U\227\371\21181\210\216!\241\001G\3510g.\320+\205\013a1\214\357\270\316\212\257po\204\370H\363\343OE\027v\277\207\024D\177\363U\033\220`\350\202\364\273\362k\361,\244G\356\032TcK\210\305+\325\372\016\004\235\302W\360\314\234\354!\245L\016\264\311\341Q=\013%R\211\274\003\341\361aP5\260\032\265\357W\214\324]\202\331a\031/\207\\\030\344\242\317\243\215\222\206K\213{\007I)\233\224\036\264R\255\376\316\010\226\241V\217@\362\036%\357\035F\365w>}\240\277}\205\007ER]\364\203\256\037\207\250\223\003\215c\024bX\234\340\001\274b\232\037\000\234*{\306i\330\300\301U\336_\004\377\013\037\367$B"; - PyObject *data = __Pyx_DecompressString(cstring, 5082, 1); + #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (5063 bytes) */ +const char* const cstring = "x\332\345\034K{\322h\327\326\252\355\310hi\351\305{\250\325\266\3322\002\365\376\215\363`\253\243\365\362\211\365\336Q&@\3322B\200$\330v\324\347\231e\227Yf\231e\226Y\262d\3112K\226\374\204\376\204\357\2347!\004H\200^\264\370\215\217&o\336\313y\317\375=\347\204\350\013Ey\201\243c\002\025\245y\206\212%i\236\247\226\323\034\025K\2638\220`\005\3367G\263\023\002\265Jg2\014;\227Ne\022I:\232d\356\347\330\230\220HCOe&\025\243Y\212M\003,\200D'\223L\234\212'8&&$7,\223\030\026\340\307\022\354\n%\254\322\002\005\177\223\014\315\013\024\237N1Tz\031z\031\352\023\235\3141<>\255$>1,k\031\237m\001\337n\334~\375l\213\3655\373""\357\371\341\031\334\356\301\031\3701\344?\023\334\306\261\031l5\303\337\376\204]\232\272\036\355v\204\245\007\267m\354\364z\347\030{\260\205\234fm\307\203\266\343A\373\365\337\"\222\335\2061\006\361\010\3721\004d\237_\316\004\035\022L\247\244\3046\024\366\267\014\205\333(gW+\327t2\331P\275\2469\206\212'\226\227\031\216a;\245P\035J&\347+(Y\272\367\263J\335>\223\355\030\214o\007,\257\006\320\001v\332\313\201\357\374b`[\305\376\326\032L2\273\316\321\336{\210\316\367\325\334\035\277Iq\326\\<\266\031Lg\222\033xlW^h\321\251t\256c\\\205M\272\025\334\177?\261\207\347&p\342J\273/1l\230q\345\373d\233\3669\246Cf\271K\225\264&\215\035\251\223\r\211A\260S\337\257~\267d\253\031w \234\371.\231\222Czd\037J\357RGs\231\316\325\316\372@9\330\251\277\320\330\027\355\254\347\316\367\321\316\332t\241\035\255\335\271~\3068\206\026\030PN\313\213\251\3121_\257\261\270G\347\234\363u\257)\002\377W\007}\345U\317n8\362-\225\325\376P\231\261gUM\262\352\360\336l/U\330\360\267\225\310\240c\325\270\3615x\340_\020\033\264~\213\331\224E\376\357T\273q\372E\200\323\357\000\354\373\375{\037Q8\253;)\251v\256\2667\274Y\016\374\013b\215\355i{\003\213f\374\373\350\303\375\255}\370^\245rX\266\351\360\232\330\276\375\232\271\201\253k\253\211\330*\265\306\321\031`\034\265l\374\010\235\2123\313\tV\3475c\371\361:\225L\257$b\265L\344\277\003\027\001\035\202\333$=ME\247\252\033\372|>r\347\030!\307\261T\224\272C\321m\260\037A\301F\346\246\366\030Z\030k\241\34130\365\026\006S\300\322[T\340\353O?\034\365\215_\032\020\206L\355\031Gv\317\020\302\004g|L\206\254OS\033\316\014Y\247\274\277R\033\273\343\210\2158\366\3044\221]\364\004\232f\2000N\367\203:\023+\2750n\030\354c\214=S\271\244\220\310$\023\014g~\266\001\363i\236J\010\370\253?\264T\201\346`\317\352+\317'\346\222\352\247\036l.\025\205\347\306\261\024-\200+\300\"\203\305\227\262q\352\262\237P\246\303\366=MC\300@<\360\334\206\260\n\256\002\266\2163\311\004\300\204P\0022=\340`\"&\000\2220\211\245\236\335{63{c\226\000\342\230\277\230\230\200u\214(\3712Fw\337\321""\\\002\020\001?\275\221ax\037\365p\231\332H\347(\226a\342\030\212d\360\013\032\313\002\240\2228rB\356\004\315\262i\201F\376F`9\370\253\t\343\023\031\360\367\270\372>\235\344\031\337\"\223\3151l\214\241\276PO\323,Sy\\\002L\337\277\346\360;\034\256\352\371\220\324L\"\366\221|\224C\210\001/h\371|G\247\275\302\314\030\371~\007P\205!,\313\330|\305\223\244\221\031i\326\367\033(]\004\360e\252\320~\261~\027\224\331\210'x\334\225a\361\272\022\303\325_\250\345d\032(\344\365\316x2\301\013KB\016\374\356{\373\227Y\366\275\276H\004?!\212D\032\337!4\366\230\223\347\340\212\2736\373J\251\331X\025P\363Ip\324\0108\251\n\323\006\202\331\005\022Z\243\271\370\334*\023\373h\351\206#\037\\L\214\341y\233\004\326\246\313\004\335l\314\367\237d\032Z\374\035\260e\226Y\317p\366\223u\002\354\306\232be\031\265\337\250\246b\324\330SKB\375\220\005\251\332\241\352\256\215\322h\"\304&\242\253\213g\352\036M\010\215\375\266\313-\0106D\261\r\035&p\347\221\006\336\332M\3251i\034i\202K3\361\325\227\373\352\237\255h\333\013\256a\300\202I}&\333\320Q\005o3b\300o\030\251\331\240\026\373\272g+x\007\354\353\007\252\300\033_\0107\366\230\033\330\016\351[\330\014U7\211D\236m\254\303\277y8\213\"O\231u\3419\263\\q\3746\337\023\332t\231(\330\217\3518\330\177\371f\337[\003\260\t]/Y8\352\022+,\023o\362\355P\223!g\275ogQ\3639:\206M\347@\220\0201\312\t\221h:\307\306\371\246\323yz\231\251\314o6\261*Z\347\037\304:\217\330\223g\257\272\315\331f\277\246\311\224&N\242\255U\216\277\246w\034h\255\000\316K\232\315\250%\325f\206\263\350m&\333\t\276\231\213u\372=\226S\277\035I\333\024\270\343\n\307\tm\010\273\311\032\307o\232\034\007\332\020\265\343\222f3\352\310l\234\321D\324\215\223mE\335\344\370q\372!\254S\277\035I\333\025\265\323\n\307\t\355\210\332y\r\242\253\363\215\374?\000\361\212\313\217T\032f\007\362\255\346\001\230\250?\247 \304\347i~\203\215%\322\276X\232KC\246\3112|4\232N'u\330\261\ncb\220\177%\342\220\211\300\301HR)\024 &\256\370\010\213\200\330\010\376\307\005L\224\216}\214%\323<$)\311$C\342=\336GGc\325D\305g\311Y,""\275\361t\n\356\265c\0024\370HR\360\307\361\024\216\304\3231\274\244\364\251\372\325`\202\361\200\363\364&O^\034F\310\225\\\220\362\210\331\"\rHU#\225\006\263\036K\346\342L\004RWk~`\264cz\033v\302\2107\270\002(s\"\271\241@*M\226Y\2411Y\206\035\200\356$\334\241\305\245#\240Y\\\002\225\245Zt\250\266xK/\317F\200R\226N\301R`$\260\000QDB\214FB\377\031v\205\261\274\376\2243c\034\375\031\304\306W\027\351O\306\312j?\351\313dh.\305g\322\231L\032 \200\221\021\026\232m\230Pi\343\216\2745\"\2046,f\"d\304\030%HU\204\216\373V\360\214D0)\326\t\343\230T\372\023\303\241J\324\3702\036Ru\236I.Cr\036\347Ay\360\037\271\350\313\240\025g\226i\340\025\362:\311\350%k\201\003\271\240\204\252\264\326>5\270\023\034\326\327\222\006\307\013H\263\200\304\352E\0314\252j\2136\273q\226\3212\373\010 \263\315\201\356f\2102E\3007\000\366\302*\227^\263\210\307\256Ep\250>V\252E\237\0004\201\256\343\n\3358\021M\305\3242|FC wTM}e\304lX\235\206\331\271\226\020V\255\035\374'\213\233Y\377;\221\321\016\234\325\316\336\312{\313=G7\203\233+bX\353\031\323\306\256jW\037\024\017\027\351R\357\321\315\331\315/\322u\331[r\r\212\376r\357\210\370Y\366\312\263r\266\324{J\362\227zOJ\336r\257k\363wqV\314\226\\\3077\0051(\322\245\376q\371\221\222U\273\312\375\347\2445\231\226\263e\000t\013\200\017O*]%\3279)'\207\264\013\327U\322?\273\t+\007\265\301qyN\316n\035>\320wB\352\226\316KaiE\016\313\214\022TheM\245\325\\~\276p\250\020.\365\016\211a1.\371\224.eP\231W\017\251\257\363w\363\321BOa\276\330S\234\327\236\275\322^\275.\001\236\274vrZ\tU[\270\325\257\000yF\346\225\031\225\313\273\tE[c\007\372\3727\263\355S=*u\021\024\354\250\366\312\247\224\220\022.\367\237\224&d\267\354\255R'\336\221\007\345\320^\021wBr\303\224ne\214L\t#\276\301MZ;~N\342d\267\201""\362\321M\177\311\325/\036\001\004\373\317\313~\371\256\034W.(\237\363\347\363\317\363|\301[\352\207Y%\317\031\351\271\304\003i\327\025\257rU=\250\372\325\337\363\376\374\275\202\247\360\262\350-y.\000\222q\305\227\357\312\017\022\004_\027\357\026\243\332\263\027\332\2137\332\233?\264?\376\324\376\\\326\226W\312d\"]\356?!\215\310]\200B\277G\374]\272\006\r\317i)$}P\002\312\013u@\r\250/\362Cy\032w\r\227F\317J\177\001\225nD\004\271\350\001u*\367\036o\020\205G\234G\216\303@\251w@\364\226z\207E\272\254\023\274)h\203\323\312\234\302\253^\225\020\353\222B\260\265\346\271\254\\W/\347\201/\256\315\005m\370\242\034S\334\312e\330\334\215\262\332\220\016\202\342\366\217JG\201+!\224U\205\031\206\256\226t]\025\227\001\032\360\362\252\324%\rKY\0046/\366J=\322=\020\345#EP\203 \267\257\205\271\002W\364\024_j\317\201)/\t\357K\025\336\023t\006\305\233\322\357\362\177\224\234\3720\377\272\360X{\266\250-\242\024\265\327q-\276\242\255\254\";^\313!9\\\362\214J}\3620 0zJ\272*w\313\027A\304\336\322\3511\371\022jU\3113\"\n\200\371\3509D\246\236Q\250\216\217\201Q\204\300#0\243\177D$\3064(\216\203j\352\3743\246x\304GRV\356r\242\363\370fN\234\023\353\3450`\201\323\tr8(\005%Z\372J\266\035W\231|\000\366\3317\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\225\35021c\334\274~N\270\014\r\360+\362k\035E\234l0\355#:\202Q\351\020x\232\217\212\233\354Y\006\246\377-\r \234\021\335meuC\235\005\222\010y\210\367\250W\036!v9\212\376\3754%\367)\303J\266D]Vn\251\213\371\303\340\214\216\026\375\350\212\336jo#Z\004<\000]\242\316\3137\225\273\n]\032\277\244\\RCj\270\\\273\356\271\232m\234\203\033\340\316\247\301;\351\334\202\313-iQ\356\332\tk\267\307\325*\327\364\21669\354\304\\\344\353\240\024\262\303\273\324\253\273\267\336c\23349-\215\0131!r\202\032x\377\004\036\375\240\342W\036\001\257\210\332\316I\304)\336\006Z\376\006\347\351/{&\200\250\233\204u\326&\010\235HO;5M\264`\364\262\342/\021Q\273\245\013\350\010\206EF\362\203\327r\353'U@\033\272 ?""\2277\300\333\317\252\234v\363aq\240XU\211\257\322\274\334\253\364\300\301\322\205\312\261 \261`aY\365h\336\217\233l\310G\320@L\0259-=\224_\301v\247\317I\202\034\200f@Y\312w\347\275%\352\242\374\227\332\245\272\255B.[\215\322B]v_({\014\016\260=\212\302\266\324\030\202C\351r\332\211)8\256\037\202g\363\344\237k\277\375\267\310k\317\027\313.C\227\352\324\342\330f\\\254(@\277\330U\262:n\342\021OH\247@\341\336\241;-\367WU\004)$\nzU:,\305d\017\250\344\003\365.\350899\211\342\nR@z\003\034\320O\323\n\321=\362<\270\262\213x\272\303\201\340\036j\203\364O\250\357\016B4\361\270\006:?\217\240\214\375\257\201o\231\225\214\275m\\d\333\204C@\264\177\204/B\200\272\307\204\033\216\300-z\304\260\341\010\010\023\210#\330\221\371\033\247Bkk\262\234\010\0142f@\274 f\321q\3511.\247\271\275\362\200\341\177\021u\014dW\234|p-\t{\341\306vh\341\331\316qW{M\301\356\335R\275\376m\371\214\014\347\274v\376\232Jo\035;\320\367\363\346S\024\236Ks\235\306SK\037@{\254\351\036\327\306\257k\327\027\264\005Fc\226\267.\036\350s\221`\3573\246/%\027\342\210\241\276kH|\r1~\030\205\337G\0024\303\"\375\322#\220\370I\224\204\221\016\341\2425)*\037\226i<>\273\244\023\362\2042\240\\S\335u\233\241^]\206\303u\031\342\354\215\374\317\2050\006\262?k.\202%\340f\272\216\263\230F\301\316Z\377\204\274\006\251T\326>\324\374J\344\327\0179\346\005tle\317\020f\250$\035\033\322\323\213\212+\322\216#\313\017)/4\377\\!X\200\000\302\201\302k$\2202)\033:\005\341h\024<\316\202\022\003\201T\372\367\217.#\354\3373\272\036\220\330\255]\2720\217E\330/@A\300\327\037\024\375\030\241\231\t\363\250\364\263\374B\233\3725\037\316'\n_\264\305\027\350\230&\300b\274z\312\212\001\030$\323ny\\\216*.u\236\330( \007I\26662!s`\021\036T%Z\312\266\303\341Z^\330S=(\335\225\342\362$\244\324\241\266\251,WCS\273\320\323\222\014?\224^\311\304#}\202|\3733l\202N\352\210\232\315\367\344C\230\t\257\220\364\271\032\205\232K\317\200/\356\221C\226F\233\300Z\215\267\226 \320\246\235\274\254\314j\277\334-x\013W\213\007!\354\017\231\341,2\263[\272\204%\033\345\010""\361\270\201\374R\261\247\270\240\27522+m\225\327x\241\375\231\304\0266\027D\226\314<\212\231\244)\2523\322\007r\246\374]\360\024\032\037\353\324\3676(\315qR\3401\325\330qD\337\264\021\301\017\305`\221.\256\221L1\252E\001\321\217\332\307\224\226\312j\331\317[\007\016|\351Z\350\206\333B\367\023\274=\351~\212\267\247\335o\361\366\266\373]\267=\325\273\007\252\271(\310L/\301a\321\227w\347/\025\356\026\242\300\311\307\332\233\267;\226\347^\210\347\204t\226\364\335\312\277(\270m\345q\224\024\177\2769\337w\314\005#\260\371\006\272\332R9\277\235\n\356\\[\312\326\244;[j\346\230\332\364G\255w\034\305\262\025\201\t\207\307\"D\007nK\303<:F\304/\362\2546q;\357\317?,\374\241\205\237\3339\3643\004\362]\371\243:LX\335\217\245\035\314\342\337\253\347\325\260^\026\270.\215A\200\302+\023\030\224:\273|#iizv\214`\314f\30685\201\r\372K\334\351\376\016A\017J\241\266@\337\320n\274\001\271\002P\355\230W'\344F\276\253\014{$%\257\344\327z.j\027oj7\037k\217?h\037\"[\343\007\372\316J\341RC\315\020\"\t\022b\224k\251\227\304\251rH\t\375\023*\017zJ\356\201\322\320p\251\267\257\344\031\332\272\203QY\310\310-\\\233\367D\022\353p\342 t\366\353lZ\302\250\270\334_\341\031&\213hF\256\315\033b\000\354\330\205E\343\243p\026\307!\373\353V'1z\360\210O@\005\036\200rr\352 \204\024\240s\205\217Z\370\235\366n\251L\022\037\022\371\374\023\332r\2419>\020\033\021C\243\240k\212\250H\353\002\204E\200\336\027,G\226\3721\035pch\222T\306\225euN5\002}\362\356\241Gz\214\326]W\234\364[J\220\250\335\327\025\257^e\264\026$\257\241\372V9\212\314\373'dVu\t\213H}\221\3647\340]_\374\265\340\375\tYh\3215\024\r\360*$\276\225h\273R\252\277\256`\352\266\301\216$)\376\0225!WJ\245\2471\001\332\362\030\234E\\\356\353\302]\200\210\256\207\222\273t\256\003\202\265O\304\211At\254\365\234\223\276*O\362\356\255\001\034yD\"\020\222\246\030t\265\234`\270C\314k\301\345\272\2549\020\300\227\303\371\260\024\306\227_g\244\227H""\005\256z\250\237\010O$7v\277\203d\306\200^\035\220a\350\274\374\233\372K\341\014$Z\236*TsK\300\240\\\251\024A\370*~\005\037\317+^R\024\345A/]^\315\273P$5\315\333\020h\037\004\245\005\373\323z\274\362\031%\225\367\353\033>!.\260\216\234Z\252~\301\034\301-Z]\245\371Z\312\215\3415z[\332,\246\270\365\210{\200\024\321I\321C/\022\033o\253`\031\332\323\260\030\026\243\344\215\307\210\361\266\251\007,\247'\177\277@\352\232~\260\262c\020\357\362\240\353\214JL\232\027\275@GL\367@\200Sy\3278\r\2318\270K{\213\340\377\000l\342\027u"; + PyObject *data = __Pyx_DecompressString(cstring, 5063, 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 (25233 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.Optional[Sequence]Sequence[str]Union[int, float]Wrapper function for picklable string constraints that must be compiled into a FunctionConstraint later on.?add_noteconstraint/constraints.pydisableenablegcisenabledlist[tuple]AllDifferentConstraintAllDifferentConstraint.__call__AllEqualConstraintAllEqualConstraint.__call__CallableCompilableFunctionConstraintCompilableFunctionConstraint.__call__CompilableFunct""ionConstraint.__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.preProcessOptional__Pyx_PyDict_NextRefSequenceSomeInSetConstraintSomeInSetConstraint.__call__SomeInSetConstraint.__init__SomeNotInSetConstraintSomeNotInSetConstraint.__call__SomeNotInSetConstraint.__init__UnassignedUnionVariableExactProdConstraintVariableExactProdConstraint.__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__Variab""leMaxProdConstraint._get_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_boundsappendassigned_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__throwtyping_unassignedunassignedunassigned_varsunassignedvariablevvalvaluevaluesvar_var_is_negative_var_max_var_minvariable_variable_contains_lt1variable_with_lt1variablesvconstraintsxzip\320\004\037\320\0372\260-\270q\360\022\000\t\r\210K\220q\330\010\014\320\014\034\230A\330\010\014\210L\230\001\320\004\037\320\0372\260-\270q\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\000\036\320\036:\270!\340\004\013\2103\210g\220Q\320\004!\320!4\260M\300\021\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\"\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 \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\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\"\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/""\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!"; + #else /* compression: none (25202 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_boundsappendassigned_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__throw_unassign""edunassignedunassigned_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 \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\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 < 295; i++) { + for (int i = 0; i < 292; 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); @@ -48328,7 +48309,7 @@ const char* const bytes = ".Abstract base class for constraints.Can't happenComp stringtab[i] = string; pos += bytes_length; } - for (int i = 295; i < 351; i++) { + for (int i = 292; i < 348; i++) { Py_ssize_t bytes_length = index[i].length; PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length); stringtab[i] = string; @@ -48339,25 +48320,29 @@ const char* const bytes = ".Abstract base class for constraints.Can't happenComp } } Py_XDECREF(data); - for (Py_ssize_t i = 0; i < 351; i++) { + for (Py_ssize_t i = 0; i < 348; i++) { if (unlikely(PyObject_Hash(stringtab[i]) == -1)) { __PYX_ERR(0, 1, __pyx_L1_error) } } #if CYTHON_IMMORTAL_CONSTANTS { - PyObject **table = stringtab + 295; + PyObject **table = stringtab + 292; for (Py_ssize_t i=0; i<56; ++i) { - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + 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 } @@ -48376,16 +48361,20 @@ const char* const bytes = ".Abstract base class for constraints.Can't happenComp { PyObject **table = __pyx_mstate->__pyx_number_tab; for (Py_ssize_t i=0; i<3; ++i) { - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + 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 } @@ -48419,392 +48408,392 @@ 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), 432}; + 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_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), 449}; + 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_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), 450}; + 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_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), 614}; + 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_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), 625}; + 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_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), 793}; + 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[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), 804}; + 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[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), 869}; + 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[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), 898}; + 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), 1012}; + 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[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), 1013}; + 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[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), 1181}; + 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[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), 1221}; + 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), 1250}; + 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_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), 1368}; + 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_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), 1572}; + 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}; + 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[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}; + 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[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}; + 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[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), 133}; + 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[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), 145}; + 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[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), 201}; + 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[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), 205}; + 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[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), 220}; + 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[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), 258}; + 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[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), 301}; + 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[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_4M_M_A_L_L, 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_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, 22, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 316}; + 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, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 339}; + 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), 416}; + 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[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), 435}; + 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[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), 457}; + 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[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), 525}; + 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[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_2_q_Kq_A_L, 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_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, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 538}; + 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 = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 554}; + 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), 598}; + 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[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), 617}; + 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[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), 630}; + 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[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), 674}; + 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[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_2_q_Kq_A_L_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[37])) 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, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 688}; + 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, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 706}; + 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), 777}; + 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[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), 796}; + 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[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), 809}; + 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[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), 853}; + 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[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), 862}; + 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[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, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 890}; + 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), 938}; + 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[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), 948}; + 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[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), 968}; + 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[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), 974}; + 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[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, 20, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 989}; + 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), 1052}; + 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[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), 1060}; + 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[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), 1071}; + 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[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), 1104}; + 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[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), 1108}; + 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[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), 1126}; + 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[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), 1132}; + 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[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), 1145}; + 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[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), 1205}; + 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[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), 1214}; + 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[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, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1242}; + 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), 1291}; + 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[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), 1295}; + 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[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), 1313}; + 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[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), 1319}; + 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[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), 1332}; + 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[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), 1387}; + 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[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), 1395}; + 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[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), 1399}; + 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[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), 1421}; + 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[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), 1429}; + 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[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), 1433}; + 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[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), 1455}; + 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[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), 1469}; + 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[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), 1517}; + 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[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), 1531}; + 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[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), 1570}; + 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; } @@ -49057,11 +49046,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++) { + 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; } @@ -50938,7 +50927,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, @@ -50946,7 +50935,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; @@ -50975,7 +50964,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 @@ -51341,6 +51330,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 */ @@ -51514,8 +51504,8 @@ static CYTHON_INLINE int __Pyx_PyLong_BoolNeObjC(PyObject *op1, PyObject *op2, l #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; } @@ -52770,6 +52760,48 @@ __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { __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) { + CYTHON_UNUSED_VAR(context); + PyObject *annotations = __Pyx_CyFunction_get_annotations((__pyx_CyFunctionObject *) 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 (value == Py_None) { + return 0; + } + PyObject *annotations = PyObject_CallObject(value, NULL); + if (!annotations) return -1; + int result = __Pyx_CyFunction_set_annotations((__pyx_CyFunctionObject *) op_in, annotations, NULL); + Py_DECREF(annotations); + return result; +} static PyObject * __Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; @@ -52782,7 +52814,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; } @@ -52885,6 +52916,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}, @@ -53023,8 +53055,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) 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 { @@ -53032,7 +53063,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); @@ -53084,11 +53114,10 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, 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; @@ -55552,7 +55581,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); } @@ -55749,14 +55779,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)) { @@ -55781,9 +55807,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); @@ -55844,35 +55878,23 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( } 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) { diff --git a/constraint/constraints.py b/constraint/constraints.py index 08839f1..9a2ce80 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.""" @@ -298,7 +299,7 @@ class ExactSumConstraint(Constraint): [[('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: @@ -413,7 +414,7 @@ class VariableExactSumConstraint(Constraint): [[('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: @@ -522,7 +523,7 @@ class MinSumConstraint(Constraint): [[('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: @@ -595,7 +596,7 @@ class VariableMinSumConstraint(Constraint): [[('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: @@ -671,7 +672,7 @@ class MaxSumConstraint(Constraint): [[('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: @@ -774,7 +775,7 @@ class VariableMaxSumConstraint(Constraint): [[('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: @@ -850,7 +851,7 @@ class ExactProdConstraint(Constraint): [[('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: @@ -1049,7 +1050,7 @@ class MinProdConstraint(Constraint): [[('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: @@ -1202,7 +1203,7 @@ class MaxProdConstraint(Constraint): [[('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: diff --git a/constraint/domain.c b/constraint/domain.c index 5000b2f..e0c4feb 100644 --- a/constraint/domain.c +++ b/constraint/domain.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.2.4 */ +/* Generated by Cython 3.2.6 */ /* BEGIN: Cython Metadata { @@ -37,8 +37,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x03080000 #error Cython requires Python 3.8+. #else -#define __PYX_ABI_VERSION "3_2_4" -#define CYTHON_HEX_VERSION 0x030204F0 +#define __PYX_ABI_VERSION "3_2_6" +#define CYTHON_HEX_VERSION 0x030206F0 #define CYTHON_FUTURE_DIVISION 1 /* CModulePreamble */ #include @@ -2676,7 +2676,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: @@ -2814,7 +2814,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: @@ -2951,7 +2951,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: @@ -3128,7 +3128,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: @@ -3303,7 +3303,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: @@ -3447,7 +3447,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: @@ -3669,7 +3669,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: @@ -4429,16 +4429,20 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { { PyObject **table = __pyx_mstate->__pyx_slice; for (Py_ssize_t i=0; i<1; ++i) { - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + 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 } @@ -4518,16 +4522,20 @@ const char* const bytes = "?Class used to control possible values for variables. { PyObject **table = stringtab + 53; for (Py_ssize_t i=0; i<8; ++i) { - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + 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 } @@ -4691,11 +4699,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++) { + 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; } @@ -6895,6 +6903,48 @@ __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { __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) { + CYTHON_UNUSED_VAR(context); + PyObject *annotations = __Pyx_CyFunction_get_annotations((__pyx_CyFunctionObject *) 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 (value == Py_None) { + return 0; + } + PyObject *annotations = PyObject_CallObject(value, NULL); + if (!annotations) return -1; + int result = __Pyx_CyFunction_set_annotations((__pyx_CyFunctionObject *) op_in, annotations, NULL); + Py_DECREF(annotations); + return result; +} static PyObject * __Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; @@ -6907,7 +6957,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; } @@ -7010,6 +7059,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}, @@ -7148,8 +7198,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) 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 { @@ -7157,7 +7206,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); @@ -7209,11 +7257,10 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, 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; @@ -8347,8 +8394,8 @@ __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp) #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; } diff --git a/constraint/parser.c b/constraint/parser.c index 8aec4a4..1d2075d 100644 --- a/constraint/parser.c +++ b/constraint/parser.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.2.4 */ +/* Generated by Cython 3.2.6 */ /* BEGIN: Cython Metadata { @@ -37,8 +37,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x03080000 #error Cython requires Python 3.8+. #else -#define __PYX_ABI_VERSION "3_2_4" -#define CYTHON_HEX_VERSION 0x030204F0 +#define __PYX_ABI_VERSION "3_2_6" +#define CYTHON_HEX_VERSION 0x030206F0 #define CYTHON_FUTURE_DIVISION 1 /* CModulePreamble */ #include @@ -1544,7 +1544,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr; /* "constraint/parser.py":32 * * - * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< + * 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 */ @@ -1560,9 +1560,9 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions { /* "constraint/parser.py":81 * return split_restrictions * - * def to_numeric_constraint(restriction: str, params: list[str]) -> Optional[ # <<<<<<<<<<<<<< - * Union[ - * MinSumConstraint, + * 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 @@ -1573,7 +1573,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint }; -/* "constraint/parser.py":99 +/* "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): # <<<<<<<<<<<<<< @@ -1595,7 +1595,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr { }; -/* "constraint/parser.py":110 +/* "constraint/parser.py":95 * * # split the string on the comparison and remove leading and trailing whitespace * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< @@ -1612,7 +1612,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr { }; -/* "constraint/parser.py":155 +/* "constraint/parser.py":140 * * # we have a potentially rewritten restriction, split again * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< @@ -1629,7 +1629,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr { }; -/* "constraint/parser.py":175 +/* "constraint/parser.py":160 * if len(variables) == 0: * return None * if any(var.strip() not in tune_params for var in variables): # <<<<<<<<<<<<<< @@ -1644,7 +1644,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr { }; -/* "constraint/parser.py":184 +/* "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) # <<<<<<<<<<<<<< @@ -1659,7 +1659,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr { }; -/* "constraint/parser.py":185 +/* "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) # <<<<<<<<<<<<<< @@ -1674,7 +1674,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr { }; -/* "constraint/parser.py":190 +/* "constraint/parser.py":175 * if ( * len(variable_unique_operators) <= 1 * and all(s.strip() in params for s in variables) # <<<<<<<<<<<<<< @@ -1689,7 +1689,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr { }; -/* "constraint/parser.py":282 +/* "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): # <<<<<<<<<<<<<< @@ -1704,7 +1704,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr { }; -/* "constraint/parser.py":289 +/* "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): # <<<<<<<<<<<<<< @@ -1719,12 +1719,12 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr { }; -/* "constraint/parser.py":313 +/* "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_12_to_equality_constraint { PyObject_HEAD @@ -1733,7 +1733,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constrai }; -/* "constraint/parser.py":332 +/* "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): # <<<<<<<<<<<<<< @@ -1748,7 +1748,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr { }; -/* "constraint/parser.py":342 +/* "constraint/parser.py":327 * * # remove functionally duplicate restrictions (preserves order and whitespace) * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< @@ -3038,7 +3038,7 @@ typedef struct { PyObject *__pyx_slice[4]; PyObject *__pyx_tuple[4]; PyObject *__pyx_codeobj_tab[21]; - PyObject *__pyx_string_tab[232]; + PyObject *__pyx_string_tab[229]; PyObject *__pyx_number_tab[3]; /* #### Code section: module_state_contents ### */ /* CommonTypesMetaclass.module_state_decls */ @@ -3164,53 +3164,53 @@ 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_kp_u_Invalid_comparator __pyx_string_tab[1] -#define __pyx_kp_u_Invalid_operator __pyx_string_tab[2] -#define __pyx_kp_u_Not_possible_comparator_should_b __pyx_string_tab[3] -#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[4] -#define __pyx_kp_u_Optional_Union_AllEqualConstrain __pyx_string_tab[5] -#define __pyx_kp_u_Optional_Union_MinSumConstraint __pyx_string_tab[6] -#define __pyx_kp_u_Optional_Union_int_float __pyx_string_tab[7] -#define __pyx_kp_u_Restriction __pyx_string_tab[8] -#define __pyx_kp_u_Variables __pyx_string_tab[9] -#define __pyx_kp_u__10 __pyx_string_tab[10] -#define __pyx_kp_u__11 __pyx_string_tab[11] -#define __pyx_kp_u__12 __pyx_string_tab[12] -#define __pyx_kp_u__13 __pyx_string_tab[13] -#define __pyx_kp_u__14 __pyx_string_tab[14] -#define __pyx_kp_u__15 __pyx_string_tab[15] -#define __pyx_kp_u__16 __pyx_string_tab[16] -#define __pyx_kp_u__17 __pyx_string_tab[17] -#define __pyx_kp_u__18 __pyx_string_tab[18] -#define __pyx_kp_u__19 __pyx_string_tab[19] -#define __pyx_kp_u__2 __pyx_string_tab[20] -#define __pyx_kp_u__20 __pyx_string_tab[21] -#define __pyx_kp_u__21 __pyx_string_tab[22] -#define __pyx_kp_u__22 __pyx_string_tab[23] -#define __pyx_kp_u__23 __pyx_string_tab[24] -#define __pyx_kp_u__24 __pyx_string_tab[25] -#define __pyx_kp_u__3 __pyx_string_tab[26] -#define __pyx_kp_u__4 __pyx_string_tab[27] -#define __pyx_kp_u__5 __pyx_string_tab[28] -#define __pyx_kp_u__6 __pyx_string_tab[29] -#define __pyx_kp_u__7 __pyx_string_tab[30] -#define __pyx_kp_u__8 __pyx_string_tab[31] -#define __pyx_kp_u__9 __pyx_string_tab[32] -#define __pyx_kp_u_a_zA_Z__0_9 __pyx_string_tab[33] -#define __pyx_kp_u_a_zA_Z__a_zA_Z__0_9 __pyx_string_tab[34] -#define __pyx_kp_u_add_note __pyx_string_tab[35] -#define __pyx_kp_u_and __pyx_string_tab[36] -#define __pyx_kp_u_constraint_parser_py __pyx_string_tab[37] -#define __pyx_kp_u_d __pyx_string_tab[38] -#define __pyx_kp_u_def_r __pyx_string_tab[39] -#define __pyx_kp_u_disable __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_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_U __pyx_string_tab[46] -#define __pyx_kp_u_list_tuple_Union_Constraint_str __pyx_string_tab[47] +#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] @@ -3229,172 +3229,169 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_Optional __pyx_string_tab[66] -#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[67] -#define __pyx_n_u_Union __pyx_string_tab[68] -#define __pyx_n_u_VERBOSE __pyx_string_tab[69] -#define __pyx_n_u_VariableExactProdConstraint __pyx_string_tab[70] -#define __pyx_n_u_VariableExactSumConstraint __pyx_string_tab[71] -#define __pyx_n_u_VariableMaxProdConstraint __pyx_string_tab[72] -#define __pyx_n_u_VariableMaxSumConstraint __pyx_string_tab[73] -#define __pyx_n_u_VariableMinProdConstraint __pyx_string_tab[74] -#define __pyx_n_u_VariableMinSumConstraint __pyx_string_tab[75] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[76] -#define __pyx_n_u_class_getitem __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_co_consts __pyx_string_tab[80] -#define __pyx_n_u_code_object __pyx_string_tab[81] -#define __pyx_n_u_comparator __pyx_string_tab[82] -#define __pyx_n_u_comparators __pyx_string_tab[83] -#define __pyx_n_u_comparators_found __pyx_string_tab[84] -#define __pyx_n_u_comparators_indices __pyx_string_tab[85] -#define __pyx_n_u_compile __pyx_string_tab[86] -#define __pyx_n_u_compile_to_constraints __pyx_string_tab[87] -#define __pyx_n_u_compiled_constraints __pyx_string_tab[88] -#define __pyx_n_u_constraint __pyx_string_tab[89] -#define __pyx_n_u_constraint_constraints __pyx_string_tab[90] -#define __pyx_n_u_constraint_parser __pyx_string_tab[91] -#define __pyx_n_u_constraints __pyx_string_tab[92] -#define __pyx_n_u_dict __pyx_string_tab[93] -#define __pyx_n_u_domains __pyx_string_tab[94] -#define __pyx_n_u_end __pyx_string_tab[95] -#define __pyx_n_u_equalities_found __pyx_string_tab[96] -#define __pyx_n_u_eval __pyx_string_tab[97] -#define __pyx_n_u_exec __pyx_string_tab[98] -#define __pyx_n_u_expr __pyx_string_tab[99] -#define __pyx_n_u_extract_operators __pyx_string_tab[100] -#define __pyx_n_u_finalized_constraint __pyx_string_tab[101] -#define __pyx_n_u_findall __pyx_string_tab[102] -#define __pyx_n_u_finditer __pyx_string_tab[103] -#define __pyx_n_u_fromkeys __pyx_string_tab[104] -#define __pyx_n_u_func __pyx_string_tab[105] -#define __pyx_n_u_func_2 __pyx_string_tab[106] -#define __pyx_n_u_genexpr __pyx_string_tab[107] -#define __pyx_n_u_group __pyx_string_tab[108] -#define __pyx_n_u_i __pyx_string_tab[109] -#define __pyx_n_u_index __pyx_string_tab[110] -#define __pyx_n_u_inequalities_found __pyx_string_tab[111] -#define __pyx_n_u_is_coroutine __pyx_string_tab[112] -#define __pyx_n_u_is_or_evals_to_number __pyx_string_tab[113] -#define __pyx_n_u_items __pyx_string_tab[114] -#define __pyx_n_u_key __pyx_string_tab[115] -#define __pyx_n_u_keys __pyx_string_tab[116] -#define __pyx_n_u_left __pyx_string_tab[117] -#define __pyx_n_u_left_num __pyx_string_tab[118] -#define __pyx_n_u_left_remainder __pyx_string_tab[119] -#define __pyx_n_u_left_swap __pyx_string_tab[120] -#define __pyx_n_u_m __pyx_string_tab[121] -#define __pyx_n_u_main __pyx_string_tab[122] -#define __pyx_n_u_match_object __pyx_string_tab[123] -#define __pyx_n_u_matches __pyx_string_tab[124] -#define __pyx_n_u_module __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_next_stop __pyx_string_tab[128] -#define __pyx_n_u_number __pyx_string_tab[129] -#define __pyx_n_u_o __pyx_string_tab[130] -#define __pyx_n_u_offset __pyx_string_tab[131] -#define __pyx_n_u_operator __pyx_string_tab[132] -#define __pyx_n_u_operators __pyx_string_tab[133] -#define __pyx_n_u_operators_found __pyx_string_tab[134] -#define __pyx_n_u_operators_left __pyx_string_tab[135] -#define __pyx_n_u_operators_right __pyx_string_tab[136] -#define __pyx_n_u_p __pyx_string_tab[137] -#define __pyx_n_u_param __pyx_string_tab[138] -#define __pyx_n_u_params __pyx_string_tab[139] -#define __pyx_n_u_params_used __pyx_string_tab[140] -#define __pyx_n_u_params_used_list __pyx_string_tab[141] -#define __pyx_n_u_parse_restrictions __pyx_string_tab[142] -#define __pyx_n_u_parse_restrictions_locals_genexp __pyx_string_tab[143] -#define __pyx_n_u_parse_restrictions_locals_replac __pyx_string_tab[144] -#define __pyx_n_u_parse_restrictions_locals_replac_2 __pyx_string_tab[145] -#define __pyx_n_u_parse_restrictions_locals_to_equ __pyx_string_tab[146] -#define __pyx_n_u_parse_restrictions_locals_to_equ_2 __pyx_string_tab[147] -#define __pyx_n_u_parse_restrictions_locals_to_mul __pyx_string_tab[148] -#define __pyx_n_u_parse_restrictions_locals_to_num __pyx_string_tab[149] -#define __pyx_n_u_parse_restrictions_locals_to_num_2 __pyx_string_tab[150] -#define __pyx_n_u_parse_restrictions_locals_to_num_3 __pyx_string_tab[151] -#define __pyx_n_u_parsed_restriction __pyx_string_tab[152] -#define __pyx_n_u_parsed_restrictions __pyx_string_tab[153] -#define __pyx_n_u_pattern __pyx_string_tab[154] -#define __pyx_n_u_picklable __pyx_string_tab[155] -#define __pyx_n_u_pop __pyx_string_tab[156] -#define __pyx_n_u_prev_stop __pyx_string_tab[157] -#define __pyx_n_u_qualname __pyx_string_tab[158] -#define __pyx_n_u_r __pyx_string_tab[159] -#define __pyx_n_u_re __pyx_string_tab[160] -#define __pyx_n_u_regex_match_variable __pyx_string_tab[161] -#define __pyx_n_u_regex_match_variable_or_constant __pyx_string_tab[162] -#define __pyx_n_u_replace __pyx_string_tab[163] -#define __pyx_n_u_replace_params __pyx_string_tab[164] -#define __pyx_n_u_replace_params_split __pyx_string_tab[165] -#define __pyx_n_u_res __pyx_string_tab[166] -#define __pyx_n_u_restriction __pyx_string_tab[167] -#define __pyx_n_u_restrictions __pyx_string_tab[168] -#define __pyx_n_u_restrictions_cleaned __pyx_string_tab[169] -#define __pyx_n_u_restrictions_cleaned_unique __pyx_string_tab[170] -#define __pyx_n_u_restrictions_unique_indices __pyx_string_tab[171] -#define __pyx_n_u_return __pyx_string_tab[172] -#define __pyx_n_u_right __pyx_string_tab[173] -#define __pyx_n_u_right_num __pyx_string_tab[174] -#define __pyx_n_u_right_remainder __pyx_string_tab[175] -#define __pyx_n_u_right_swap __pyx_string_tab[176] -#define __pyx_n_u_s __pyx_string_tab[177] -#define __pyx_n_u_search __pyx_string_tab[178] -#define __pyx_n_u_send __pyx_string_tab[179] -#define __pyx_n_u_set_name __pyx_string_tab[180] -#define __pyx_n_u_setdefault __pyx_string_tab[181] -#define __pyx_n_u_split __pyx_string_tab[182] -#define __pyx_n_u_split_restrictions __pyx_string_tab[183] -#define __pyx_n_u_splitted __pyx_string_tab[184] -#define __pyx_n_u_start __pyx_string_tab[185] -#define __pyx_n_u_str __pyx_string_tab[186] -#define __pyx_n_u_strip __pyx_string_tab[187] -#define __pyx_n_u_sub __pyx_string_tab[188] -#define __pyx_n_u_swapped_side_first_component __pyx_string_tab[189] -#define __pyx_n_u_temp_copy __pyx_string_tab[190] -#define __pyx_n_u_test __pyx_string_tab[191] -#define __pyx_n_u_throw __pyx_string_tab[192] -#define __pyx_n_u_to_equality_constraint __pyx_string_tab[193] -#define __pyx_n_u_to_multiple_restrictions __pyx_string_tab[194] -#define __pyx_n_u_to_numeric_constraint __pyx_string_tab[195] -#define __pyx_n_u_tune_params __pyx_string_tab[196] -#define __pyx_n_u_types __pyx_string_tab[197] -#define __pyx_n_u_typing __pyx_string_tab[198] -#define __pyx_n_u_union __pyx_string_tab[199] -#define __pyx_n_u_unique_operators __pyx_string_tab[200] -#define __pyx_n_u_unique_operators_left __pyx_string_tab[201] -#define __pyx_n_u_unique_operators_right __pyx_string_tab[202] -#define __pyx_n_u_v __pyx_string_tab[203] -#define __pyx_n_u_value __pyx_string_tab[204] -#define __pyx_n_u_values __pyx_string_tab[205] -#define __pyx_n_u_var __pyx_string_tab[206] -#define __pyx_n_u_variable_operators_left __pyx_string_tab[207] -#define __pyx_n_u_variable_operators_right __pyx_string_tab[208] -#define __pyx_n_u_variable_supported_operators __pyx_string_tab[209] -#define __pyx_n_u_variable_unique_operators __pyx_string_tab[210] -#define __pyx_n_u_variables __pyx_string_tab[211] -#define __pyx_n_u_variables_on_left __pyx_string_tab[212] -#define __pyx_kp_b_iso88591_1 __pyx_string_tab[213] -#define __pyx_kp_b_iso88591_1_2 __pyx_string_tab[214] -#define __pyx_kp_b_iso88591_A_3axs_Qa_1_2XQfA_Rxq_a_5_AS_2S __pyx_string_tab[215] -#define __pyx_kp_b_iso88591_A_l_4s_Cq_2V2Q_1 __pyx_string_tab[216] -#define __pyx_kp_b_iso88591_A_l_4s_Cq_t1A_1_1 __pyx_string_tab[217] -#define __pyx_kp_b_iso88591_HA_4vRxq_Q_a_b_1AV3d_q __pyx_string_tab[218] -#define __pyx_kp_b_iso88591_Q __pyx_string_tab[219] -#define __pyx_kp_b_iso88591_Q_2 __pyx_string_tab[220] -#define __pyx_kp_b_iso88591_Q_G1_xs_c_1_6_uA_AV1D_Qd_e2YasR __pyx_string_tab[221] -#define __pyx_kp_b_iso88591_V1_A_UUV__A_Qm1_q_9_gQm_q_1Kz_g __pyx_string_tab[222] -#define __pyx_kp_b_iso88591_XQ_Qa_z_5_q_q __pyx_string_tab[223] -#define __pyx_kp_b_iso88591_Ya_1_q_Q2_m5_aP_U_6_Q_q_t4uA_d __pyx_string_tab[224] -#define __pyx_kp_b_iso88591__25 __pyx_string_tab[225] -#define __pyx_kp_b_iso88591__26 __pyx_string_tab[226] -#define __pyx_kp_b_iso88591__27 __pyx_string_tab[227] -#define __pyx_kp_b_iso88591__28 __pyx_string_tab[228] -#define __pyx_kp_b_iso88591_a_3axs_C_1_avV6_a_Bhas_q_a_3a_Q __pyx_string_tab[229] -#define __pyx_kp_b_iso88591_q __pyx_string_tab[230] -#define __pyx_kp_b_iso88591_q_2 __pyx_string_tab[231] +#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_asyncio_coroutines __pyx_string_tab[74] +#define __pyx_n_u_class_getitem __pyx_string_tab[75] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[76] +#define __pyx_n_u_close __pyx_string_tab[77] +#define __pyx_n_u_co_consts __pyx_string_tab[78] +#define __pyx_n_u_code_object __pyx_string_tab[79] +#define __pyx_n_u_comparator __pyx_string_tab[80] +#define __pyx_n_u_comparators __pyx_string_tab[81] +#define __pyx_n_u_comparators_found __pyx_string_tab[82] +#define __pyx_n_u_comparators_indices __pyx_string_tab[83] +#define __pyx_n_u_compile __pyx_string_tab[84] +#define __pyx_n_u_compile_to_constraints __pyx_string_tab[85] +#define __pyx_n_u_compiled_constraints __pyx_string_tab[86] +#define __pyx_n_u_constraint __pyx_string_tab[87] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[88] +#define __pyx_n_u_constraint_parser __pyx_string_tab[89] +#define __pyx_n_u_constraints __pyx_string_tab[90] +#define __pyx_n_u_dict __pyx_string_tab[91] +#define __pyx_n_u_domains __pyx_string_tab[92] +#define __pyx_n_u_end __pyx_string_tab[93] +#define __pyx_n_u_equalities_found __pyx_string_tab[94] +#define __pyx_n_u_eval __pyx_string_tab[95] +#define __pyx_n_u_exec __pyx_string_tab[96] +#define __pyx_n_u_expr __pyx_string_tab[97] +#define __pyx_n_u_extract_operators __pyx_string_tab[98] +#define __pyx_n_u_finalized_constraint __pyx_string_tab[99] +#define __pyx_n_u_findall __pyx_string_tab[100] +#define __pyx_n_u_finditer __pyx_string_tab[101] +#define __pyx_n_u_fromkeys __pyx_string_tab[102] +#define __pyx_n_u_func __pyx_string_tab[103] +#define __pyx_n_u_func_2 __pyx_string_tab[104] +#define __pyx_n_u_genexpr __pyx_string_tab[105] +#define __pyx_n_u_group __pyx_string_tab[106] +#define __pyx_n_u_i __pyx_string_tab[107] +#define __pyx_n_u_index __pyx_string_tab[108] +#define __pyx_n_u_inequalities_found __pyx_string_tab[109] +#define __pyx_n_u_is_coroutine __pyx_string_tab[110] +#define __pyx_n_u_is_or_evals_to_number __pyx_string_tab[111] +#define __pyx_n_u_items __pyx_string_tab[112] +#define __pyx_n_u_key __pyx_string_tab[113] +#define __pyx_n_u_keys __pyx_string_tab[114] +#define __pyx_n_u_left __pyx_string_tab[115] +#define __pyx_n_u_left_num __pyx_string_tab[116] +#define __pyx_n_u_left_remainder __pyx_string_tab[117] +#define __pyx_n_u_left_swap __pyx_string_tab[118] +#define __pyx_n_u_m __pyx_string_tab[119] +#define __pyx_n_u_main __pyx_string_tab[120] +#define __pyx_n_u_match_object __pyx_string_tab[121] +#define __pyx_n_u_matches __pyx_string_tab[122] +#define __pyx_n_u_module __pyx_string_tab[123] +#define __pyx_n_u_name __pyx_string_tab[124] +#define __pyx_n_u_next __pyx_string_tab[125] +#define __pyx_n_u_next_stop __pyx_string_tab[126] +#define __pyx_n_u_number __pyx_string_tab[127] +#define __pyx_n_u_o __pyx_string_tab[128] +#define __pyx_n_u_offset __pyx_string_tab[129] +#define __pyx_n_u_operator __pyx_string_tab[130] +#define __pyx_n_u_operators __pyx_string_tab[131] +#define __pyx_n_u_operators_found __pyx_string_tab[132] +#define __pyx_n_u_operators_left __pyx_string_tab[133] +#define __pyx_n_u_operators_right __pyx_string_tab[134] +#define __pyx_n_u_p __pyx_string_tab[135] +#define __pyx_n_u_param __pyx_string_tab[136] +#define __pyx_n_u_params __pyx_string_tab[137] +#define __pyx_n_u_params_used __pyx_string_tab[138] +#define __pyx_n_u_params_used_list __pyx_string_tab[139] +#define __pyx_n_u_parse_restrictions __pyx_string_tab[140] +#define __pyx_n_u_parse_restrictions_locals_genexp __pyx_string_tab[141] +#define __pyx_n_u_parse_restrictions_locals_replac __pyx_string_tab[142] +#define __pyx_n_u_parse_restrictions_locals_replac_2 __pyx_string_tab[143] +#define __pyx_n_u_parse_restrictions_locals_to_equ __pyx_string_tab[144] +#define __pyx_n_u_parse_restrictions_locals_to_equ_2 __pyx_string_tab[145] +#define __pyx_n_u_parse_restrictions_locals_to_mul __pyx_string_tab[146] +#define __pyx_n_u_parse_restrictions_locals_to_num __pyx_string_tab[147] +#define __pyx_n_u_parse_restrictions_locals_to_num_2 __pyx_string_tab[148] +#define __pyx_n_u_parse_restrictions_locals_to_num_3 __pyx_string_tab[149] +#define __pyx_n_u_parsed_restriction __pyx_string_tab[150] +#define __pyx_n_u_parsed_restrictions __pyx_string_tab[151] +#define __pyx_n_u_pattern __pyx_string_tab[152] +#define __pyx_n_u_picklable __pyx_string_tab[153] +#define __pyx_n_u_pop __pyx_string_tab[154] +#define __pyx_n_u_prev_stop __pyx_string_tab[155] +#define __pyx_n_u_qualname __pyx_string_tab[156] +#define __pyx_n_u_r __pyx_string_tab[157] +#define __pyx_n_u_re __pyx_string_tab[158] +#define __pyx_n_u_regex_match_variable __pyx_string_tab[159] +#define __pyx_n_u_regex_match_variable_or_constant __pyx_string_tab[160] +#define __pyx_n_u_replace __pyx_string_tab[161] +#define __pyx_n_u_replace_params __pyx_string_tab[162] +#define __pyx_n_u_replace_params_split __pyx_string_tab[163] +#define __pyx_n_u_res __pyx_string_tab[164] +#define __pyx_n_u_restriction __pyx_string_tab[165] +#define __pyx_n_u_restrictions __pyx_string_tab[166] +#define __pyx_n_u_restrictions_cleaned __pyx_string_tab[167] +#define __pyx_n_u_restrictions_cleaned_unique __pyx_string_tab[168] +#define __pyx_n_u_restrictions_unique_indices __pyx_string_tab[169] +#define __pyx_n_u_return __pyx_string_tab[170] +#define __pyx_n_u_right __pyx_string_tab[171] +#define __pyx_n_u_right_num __pyx_string_tab[172] +#define __pyx_n_u_right_remainder __pyx_string_tab[173] +#define __pyx_n_u_right_swap __pyx_string_tab[174] +#define __pyx_n_u_s __pyx_string_tab[175] +#define __pyx_n_u_search __pyx_string_tab[176] +#define __pyx_n_u_send __pyx_string_tab[177] +#define __pyx_n_u_set_name __pyx_string_tab[178] +#define __pyx_n_u_setdefault __pyx_string_tab[179] +#define __pyx_n_u_split __pyx_string_tab[180] +#define __pyx_n_u_split_restrictions __pyx_string_tab[181] +#define __pyx_n_u_splitted __pyx_string_tab[182] +#define __pyx_n_u_start __pyx_string_tab[183] +#define __pyx_n_u_str __pyx_string_tab[184] +#define __pyx_n_u_strip __pyx_string_tab[185] +#define __pyx_n_u_sub __pyx_string_tab[186] +#define __pyx_n_u_swapped_side_first_component __pyx_string_tab[187] +#define __pyx_n_u_temp_copy __pyx_string_tab[188] +#define __pyx_n_u_test __pyx_string_tab[189] +#define __pyx_n_u_throw __pyx_string_tab[190] +#define __pyx_n_u_to_equality_constraint __pyx_string_tab[191] +#define __pyx_n_u_to_multiple_restrictions __pyx_string_tab[192] +#define __pyx_n_u_to_numeric_constraint __pyx_string_tab[193] +#define __pyx_n_u_tune_params __pyx_string_tab[194] +#define __pyx_n_u_types __pyx_string_tab[195] +#define __pyx_n_u_union __pyx_string_tab[196] +#define __pyx_n_u_unique_operators __pyx_string_tab[197] +#define __pyx_n_u_unique_operators_left __pyx_string_tab[198] +#define __pyx_n_u_unique_operators_right __pyx_string_tab[199] +#define __pyx_n_u_v __pyx_string_tab[200] +#define __pyx_n_u_value __pyx_string_tab[201] +#define __pyx_n_u_values __pyx_string_tab[202] +#define __pyx_n_u_var __pyx_string_tab[203] +#define __pyx_n_u_variable_operators_left __pyx_string_tab[204] +#define __pyx_n_u_variable_operators_right __pyx_string_tab[205] +#define __pyx_n_u_variable_supported_operators __pyx_string_tab[206] +#define __pyx_n_u_variable_unique_operators __pyx_string_tab[207] +#define __pyx_n_u_variables __pyx_string_tab[208] +#define __pyx_n_u_variables_on_left __pyx_string_tab[209] +#define __pyx_kp_b_iso88591_1 __pyx_string_tab[210] +#define __pyx_kp_b_iso88591_1_2 __pyx_string_tab[211] +#define __pyx_kp_b_iso88591_A_3axs_Qa_1_2XQfA_Rxq_a_5_AS_2S __pyx_string_tab[212] +#define __pyx_kp_b_iso88591_A_l_4s_Cq_2V2Q_1 __pyx_string_tab[213] +#define __pyx_kp_b_iso88591_A_l_4s_Cq_t1A_1_1 __pyx_string_tab[214] +#define __pyx_kp_b_iso88591_HA_4vRxq_Q_a_b_1AV3d_q __pyx_string_tab[215] +#define __pyx_kp_b_iso88591_Q __pyx_string_tab[216] +#define __pyx_kp_b_iso88591_Q_2 __pyx_string_tab[217] +#define __pyx_kp_b_iso88591_Q_G1_xs_c_1_6_uA_AV1D_Qd_e2YasR __pyx_string_tab[218] +#define __pyx_kp_b_iso88591_V1_A_Oq__A_Qm1_q_9_gQm_q_1Kz_gQ __pyx_string_tab[219] +#define __pyx_kp_b_iso88591_XQ_Qa_z_5_q_q __pyx_string_tab[220] +#define __pyx_kp_b_iso88591_Ya_1_q_Q2_m5_ar_U_6_Q_q_t4uA_d __pyx_string_tab[221] +#define __pyx_kp_b_iso88591__25 __pyx_string_tab[222] +#define __pyx_kp_b_iso88591__26 __pyx_string_tab[223] +#define __pyx_kp_b_iso88591__27 __pyx_string_tab[224] +#define __pyx_kp_b_iso88591__28 __pyx_string_tab[225] +#define __pyx_kp_b_iso88591_a_3axs_C_1_avV6_a_Bhas_q_a_3a_Q __pyx_string_tab[226] +#define __pyx_kp_b_iso88591_q __pyx_string_tab[227] +#define __pyx_kp_b_iso88591_q_2 __pyx_string_tab[228] #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] @@ -3445,7 +3442,7 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { 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<21; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<232; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<229; ++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 */ @@ -3505,7 +3502,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void 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<21; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<232; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<229; ++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 */ @@ -3526,7 +3523,7 @@ return 0; /* "constraint/parser.py":32 * * - * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< + * 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 */ @@ -3572,7 +3569,7 @@ 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, 32, __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: @@ -3683,7 +3680,7 @@ 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, 38, __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: @@ -3903,7 +3900,7 @@ 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, 46, __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: @@ -4134,7 +4131,7 @@ 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, 56, __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: @@ -4661,7 +4658,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * split_restrictions.append(temp_copy[prev_stop:next_stop].strip()) * return split_restrictions # <<<<<<<<<<<<<< * - * def to_numeric_constraint(restriction: str, params: list[str]) -> Optional[ + * 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); @@ -4704,9 +4701,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple /* "constraint/parser.py":81 * return split_restrictions * - * def to_numeric_constraint(restriction: str, params: list[str]) -> Optional[ # <<<<<<<<<<<<<< - * Union[ - * MinSumConstraint, + * 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 */ @@ -4750,7 +4747,7 @@ 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, 81, __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: @@ -4816,7 +4813,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds 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":99 +/* "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): # <<<<<<<<<<<<<< @@ -4836,7 +4833,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_3_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 99, __pyx_L1_error) + __PYX_ERR(0, 84, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -4844,7 +4841,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_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, 99, __pyx_L1_error) + __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); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -4882,16 +4879,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, 99, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 99, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 84, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 84, __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, 99, __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, 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, 99, __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)) { @@ -4899,7 +4896,7 @@ 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, 99, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 84, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -4909,7 +4906,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 99, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 84, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -4920,13 +4917,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __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, 99, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 84, __pyx_L1_error) PyErr_Clear(); } break; @@ -4997,7 +4994,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_2_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 99, __pyx_L1_error) + __PYX_ERR(0, 84, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5008,7 +5005,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_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, 99, __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; @@ -5047,40 +5044,40 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 99, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 99, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 84, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 84, __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, 99, __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_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __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_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 99, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 84, __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 subscriptable"); - __PYX_ERR(0, 99, __pyx_L1_error) + __PYX_ERR(0, 84, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_tune_params, __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_tune_params, __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7genexpr_genexpr(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_4 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7genexpr_genexpr(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { @@ -5122,7 +5119,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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":110 +/* "constraint/parser.py":95 * * # split the string on the comparison and remove leading and trailing whitespace * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< @@ -5142,7 +5139,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_4_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 110, __pyx_L1_error) + __PYX_ERR(0, 95, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5153,7 +5150,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_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, 110, __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; @@ -5193,11 +5190,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __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, 110, __pyx_L1_error) + __PYX_ERR(0, 95, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 110, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 110, __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, 110, __pyx_L1_error) + 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), -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; @@ -5206,13 +5203,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 110, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 95, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __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); @@ -5225,7 +5222,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __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, 110, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_r = __pyx_t_1; @@ -5244,7 +5241,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_2); __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 110, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 95, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -5272,7 +5269,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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":155 +/* "constraint/parser.py":140 * * # we have a potentially rewritten restriction, split again * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< @@ -5292,7 +5289,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_5_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 155, __pyx_L1_error) + __PYX_ERR(0, 140, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5303,7 +5300,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_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, 155, __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; @@ -5343,11 +5340,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __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, 155, __pyx_L1_error) + __PYX_ERR(0, 140, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 155, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 155, __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, 155, __pyx_L1_error) + 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), -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; @@ -5356,13 +5353,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 155, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 140, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __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); @@ -5375,7 +5372,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __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, 155, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_r = __pyx_t_1; @@ -5394,7 +5391,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_2); __pyx_t_3 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 155, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 140, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -5422,7 +5419,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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":175 +/* "constraint/parser.py":160 * if len(variables) == 0: * return None * if any(var.strip() not in tune_params for var in variables): # <<<<<<<<<<<<<< @@ -5442,7 +5439,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, 175, __pyx_L1_error) + __PYX_ERR(0, 160, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5453,7 +5450,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_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, 175, __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; @@ -5492,16 +5489,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, 175, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 175, __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, 175, __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, 160, __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, 175, __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, 160, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -5509,7 +5506,7 @@ 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, 175, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 160, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5519,7 +5516,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 175, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 160, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5530,13 +5527,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error) + 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, 175, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 160, __pyx_L1_error) PyErr_Clear(); } break; @@ -5554,15 +5551,15 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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, 175, __pyx_L1_error) + 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, 175, __pyx_L1_error) } + 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, 175, __pyx_L1_error) + __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, 175, __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); @@ -5603,7 +5600,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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":184 +/* "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) # <<<<<<<<<<<<<< @@ -5623,7 +5620,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_7_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 184, __pyx_L1_error) + __PYX_ERR(0, 169, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5634,7 +5631,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_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, 184, __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; @@ -5672,11 +5669,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 184, __pyx_L1_error) - __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 184, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 184, __pyx_L1_error) } - __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 169, __pyx_L1_error) } + __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -5685,20 +5682,20 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 184, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 169, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __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, 184, __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, 184, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_variable_supported_operators)) { __Pyx_RaiseClosureNameError("variable_supported_operators"); __PYX_ERR(0, 169, __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, 169, __pyx_L1_error) if (__pyx_t_4) { __pyx_t_5 = __pyx_cur_scope->__pyx_v_s; __Pyx_INCREF(__pyx_t_5); @@ -5707,10 +5704,10 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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, 184, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 184, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } } @@ -5740,7 +5737,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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":185 +/* "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) # <<<<<<<<<<<<<< @@ -5760,7 +5757,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, 185, __pyx_L1_error) + __PYX_ERR(0, 170, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5771,7 +5768,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_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, 185, __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; @@ -5809,11 +5806,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 185, __pyx_L1_error) - __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 185, __pyx_L1_error) + 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, 185, __pyx_L1_error) } - __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) + 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; @@ -5822,20 +5819,20 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 185, __pyx_L1_error) + 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_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) + 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, 185, __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, 185, __pyx_L1_error) + 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); @@ -5844,10 +5841,10 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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, 185, __pyx_L1_error) + 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, 185, __pyx_L1_error) + 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; } } @@ -5877,7 +5874,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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":190 +/* "constraint/parser.py":175 * if ( * len(variable_unique_operators) <= 1 * and all(s.strip() in params for s in variables) # <<<<<<<<<<<<<< @@ -5897,7 +5894,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_9_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 190, __pyx_L1_error) + __PYX_ERR(0, 175, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5908,7 +5905,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_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, 190, __pyx_L1_error) + __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; @@ -5948,16 +5945,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, 190, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 190, __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, 190, __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, 190, __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)) { @@ -5965,7 +5962,7 @@ 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, 190, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 175, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5975,7 +5972,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 190, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 175, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5986,13 +5983,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __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, 190, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 175, __pyx_L1_error) PyErr_Clear(); } break; @@ -6010,11 +6007,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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, 190, __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, 190, __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, 190, __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) { @@ -6056,7 +6053,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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":282 +/* "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): # <<<<<<<<<<<<<< @@ -6076,7 +6073,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_10_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 282, __pyx_L1_error) + __PYX_ERR(0, 267, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6087,7 +6084,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_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, 282, __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; @@ -6125,16 +6122,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, 282, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 282, __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, 282, __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, 282, __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)) { @@ -6142,7 +6139,7 @@ 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, 282, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 267, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6152,7 +6149,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 282, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 267, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6163,13 +6160,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __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, 282, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 267, __pyx_L1_error) PyErr_Clear(); } break; @@ -6180,9 +6177,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, 282, __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, 282, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 282, __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) { @@ -6223,7 +6220,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } 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":289 +/* "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): # <<<<<<<<<<<<<< @@ -6243,7 +6240,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_11_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 289, __pyx_L1_error) + __PYX_ERR(0, 274, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6254,7 +6251,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_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, 289, __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; @@ -6294,16 +6291,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, 289, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 289, __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, 289, __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, 289, __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)) { @@ -6311,7 +6308,7 @@ 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, 289, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 274, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6321,7 +6318,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { 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, 289, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 274, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6332,13 +6329,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __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, 289, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 274, __pyx_L1_error) PyErr_Clear(); } break; @@ -6356,11 +6353,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric 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, 289, __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, 289, __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, 289, __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) { @@ -6404,9 +6401,9 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric /* "constraint/parser.py":81 * return split_restrictions * - * def to_numeric_constraint(restriction: str, params: list[str]) -> Optional[ # <<<<<<<<<<<<<< - * Union[ - * MinSumConstraint, + * 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) { @@ -6482,7 +6479,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_params); __Pyx_INCREF(__pyx_v_restriction); - /* "constraint/parser.py":99 + /* "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): # <<<<<<<<<<<<<< @@ -6491,7 +6488,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __pyx_t_2 = __pyx_cur_scope->__pyx_v_params; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 == 0); if (!__pyx_t_4) { @@ -6499,19 +6496,19 @@ 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_genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_params); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __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, 99, __pyx_L1_error) + __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); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = (!__pyx_t_4); __pyx_t_1 = __pyx_t_6; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":100 + /* "constraint/parser.py":85 * # 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 # <<<<<<<<<<<<<< @@ -6522,7 +6519,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":99 + /* "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): # <<<<<<<<<<<<<< @@ -6531,34 +6528,34 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":102 + /* "constraint/parser.py":87 * return None * * comparators = ["<=", "==", ">=", ">", "<"] # <<<<<<<<<<<<<< * comparators_found = re.findall("|".join(comparators), restriction) * # check if there is exactly one comparator, if not, return None */ - __pyx_t_5 = PyList_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_5 = PyList_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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_5, 0, __pyx_mstate_global->__pyx_kp_u__2) != (0)) __PYX_ERR(0, 102, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_mstate_global->__pyx_kp_u__2) != (0)) __PYX_ERR(0, 87, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__7); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_mstate_global->__pyx_kp_u__7) != (0)) __PYX_ERR(0, 102, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_mstate_global->__pyx_kp_u__7) != (0)) __PYX_ERR(0, 87, __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_5, 2, __pyx_mstate_global->__pyx_kp_u__3) != (0)) __PYX_ERR(0, 102, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_mstate_global->__pyx_kp_u__3) != (0)) __PYX_ERR(0, 87, __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_5, 3, __pyx_mstate_global->__pyx_kp_u__4) != (0)) __PYX_ERR(0, 102, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 3, __pyx_mstate_global->__pyx_kp_u__4) != (0)) __PYX_ERR(0, 87, __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_5, 4, __pyx_mstate_global->__pyx_kp_u__5) != (0)) __PYX_ERR(0, 102, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 4, __pyx_mstate_global->__pyx_kp_u__5) != (0)) __PYX_ERR(0, 87, __pyx_L1_error); __pyx_v_comparators = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/parser.py":103 + /* "constraint/parser.py":88 * * comparators = ["<=", "==", ">=", ">", "<"] * comparators_found = re.findall("|".join(comparators), restriction) # <<<<<<<<<<<<<< @@ -6566,12 +6563,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if len(comparators_found) != 1: */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_comparators); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_7 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_comparators); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -6591,24 +6588,24 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 103, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_v_comparators_found = __pyx_t_5; __pyx_t_5 = 0; - /* "constraint/parser.py":105 + /* "constraint/parser.py":90 * comparators_found = re.findall("|".join(comparators), restriction) * # check if there is exactly one comparator, if not, return None * if len(comparators_found) != 1: # <<<<<<<<<<<<<< * return None * comparator = comparators_found[0] */ - __pyx_t_3 = PyObject_Length(__pyx_v_comparators_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_comparators_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 90, __pyx_L1_error) __pyx_t_1 = (__pyx_t_3 != 1); if (__pyx_t_1) { - /* "constraint/parser.py":106 + /* "constraint/parser.py":91 * # check if there is exactly one comparator, if not, return None * if len(comparators_found) != 1: * return None # <<<<<<<<<<<<<< @@ -6619,7 +6616,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":105 + /* "constraint/parser.py":90 * comparators_found = re.findall("|".join(comparators), restriction) * # check if there is exactly one comparator, if not, return None * if len(comparators_found) != 1: # <<<<<<<<<<<<<< @@ -6628,28 +6625,28 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":107 + /* "constraint/parser.py":92 * if len(comparators_found) != 1: * return None * comparator = comparators_found[0] # <<<<<<<<<<<<<< * * # 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, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __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; - /* "constraint/parser.py":110 + /* "constraint/parser.py":95 * * # split the string on the comparison and remove leading and trailing whitespace * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< * * # if we have an inverse operation, rewrite to the other side */ - __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, 110, __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, 110, __pyx_L1_error) + __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); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (1) { @@ -6658,7 +6655,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 110, __pyx_L1_error) + __PYX_ERR(0, 95, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); @@ -6666,9 +6663,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 110, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 110, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -6678,7 +6675,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_v_right = __pyx_t_7; __pyx_t_7 = 0; - /* "constraint/parser.py":113 + /* "constraint/parser.py":98 * * # if we have an inverse operation, rewrite to the other side * operators_left = extract_operators(left) # <<<<<<<<<<<<<< @@ -6686,7 +6683,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if len(operators_left) > 0 and len(operators_right) > 0: */ __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, 113, __pyx_L1_error) + __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 @@ -6705,13 +6702,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 113, __pyx_L1_error) + 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":114 + /* "constraint/parser.py":99 * # if we have an inverse operation, rewrite to the other side * operators_left = extract_operators(left) * operators_right = extract_operators(right) # <<<<<<<<<<<<<< @@ -6719,7 +6716,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # if there are operators on both sides, we can't handle this yet */ __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, 114, __pyx_L1_error) + __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 @@ -6738,33 +6735,33 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 114, __pyx_L1_error) + 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":115 + /* "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 = PyObject_Length(__pyx_v_operators_left); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 115, __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_L8_bool_binop_done; } - __pyx_t_3 = PyObject_Length(__pyx_v_operators_right); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 115, __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_L8_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":117 + /* "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 # <<<<<<<<<<<<<< @@ -6775,7 +6772,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":115 + /* "constraint/parser.py":100 * operators_left = extract_operators(left) * operators_right = extract_operators(right) * if len(operators_left) > 0 and len(operators_right) > 0: # <<<<<<<<<<<<<< @@ -6784,67 +6781,67 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":118 + /* "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, 118, __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":119 + /* "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, 119, __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":120 + /* "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, 120, __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":121 + /* "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( */ - __pyx_t_3 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 121, __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":122 + /* "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 */ - __pyx_t_3 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators_left); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 122, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyBool_FromLong((__pyx_t_3 > 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 122, __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":123 + /* "constraint/parser.py":108 * if len(unique_operators) == 1: * variables_on_left = len(unique_operators_left) > 0 * swapped_side_first_component = re.search( # <<<<<<<<<<<<<< @@ -6852,21 +6849,21 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * ) # 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, 123, __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, 123, __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; - /* "constraint/parser.py":124 + /* "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, 124, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 124, __pyx_L1_error) + 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; @@ -6892,13 +6889,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 123, __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":126 + /* "constraint/parser.py":111 * regex_match_variable_or_constant, left if variables_on_left else right * ) # noqa: E501 * if swapped_side_first_component is None: # <<<<<<<<<<<<<< @@ -6908,7 +6905,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_1 = (__pyx_v_swapped_side_first_component == Py_None); if (__pyx_t_1) { - /* "constraint/parser.py":128 + /* "constraint/parser.py":113 * if swapped_side_first_component is None: * # if there is no variable on the left side, we can't handle this yet * return None # <<<<<<<<<<<<<< @@ -6919,7 +6916,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":126 + /* "constraint/parser.py":111 * regex_match_variable_or_constant, left if variables_on_left else right * ) # noqa: E501 * if swapped_side_first_component is None: # <<<<<<<<<<<<<< @@ -6928,7 +6925,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":130 + /* "constraint/parser.py":115 * return None * else: * swapped_side_first_component = swapped_side_first_component.group(0) # <<<<<<<<<<<<<< @@ -6943,83 +6940,83 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_0}; __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, 130, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_DECREF_SET(__pyx_v_swapped_side_first_component, __pyx_t_8); __pyx_t_8 = 0; } - /* "constraint/parser.py":131 + /* "constraint/parser.py":116 * else: * swapped_side_first_component = swapped_side_first_component.group(0) * if "-" in unique_operators: # <<<<<<<<<<<<<< * 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__8, __pyx_v_unique_operators, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 131, __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":132 + /* "constraint/parser.py":117 * swapped_side_first_component = swapped_side_first_component.group(0) * 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) :] */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 132, __pyx_L1_error) + __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); if (__pyx_t_6) { - /* "constraint/parser.py":134 + /* "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) :] # <<<<<<<<<<<<<< * left_swap = right_remainder.replace("-", "+") * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_component}" */ - __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_component); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 134, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_right, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_component); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_right, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_right_remainder = __pyx_t_8; __pyx_t_8 = 0; - /* "constraint/parser.py":135 + /* "constraint/parser.py":120 * # e.g. "G == B-M" becomes "G+M == B" * 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_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_left_swap = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/parser.py":136 + /* "constraint/parser.py":121 * 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" */ - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_component, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_component, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_10[0] = __pyx_t_2; __pyx_t_10[1] = __pyx_t_8; __pyx_t_10[2] = __pyx_t_5; __pyx_t_10[3] = __pyx_t_7; __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7)); - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 136, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -7028,7 +7025,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF_SET(__pyx_v_restriction, ((PyObject*)__pyx_t_11)); __pyx_t_11 = 0; - /* "constraint/parser.py":132 + /* "constraint/parser.py":117 * swapped_side_first_component = swapped_side_first_component.group(0) * if "-" in unique_operators: * if not variables_on_left: # <<<<<<<<<<<<<< @@ -7038,7 +7035,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ goto __pyx_L13; } - /* "constraint/parser.py":139 + /* "constraint/parser.py":124 * else: * # e.g. "B-M == G" becomes "B == G+M" * left_remainder = left[len(swapped_side_first_component) :] # <<<<<<<<<<<<<< @@ -7046,48 +7043,48 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * restriction = f"{swapped_side_first_component}{comparator}{right}{right_swap}" */ /*else*/ { - __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_component); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 139, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_v_left, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_component); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_v_left, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_v_left_remainder = __pyx_t_11; __pyx_t_11 = 0; - /* "constraint/parser.py":140 + /* "constraint/parser.py":125 * # e.g. "B-M == G" becomes "B == G+M" * 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: */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_v_right_swap = __pyx_t_7; __pyx_t_7 = 0; - /* "constraint/parser.py":141 + /* "constraint/parser.py":126 * 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: */ - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_component, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_component, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10[0] = __pyx_t_7; __pyx_t_10[1] = __pyx_t_11; __pyx_t_10[2] = __pyx_t_5; __pyx_t_10[3] = __pyx_t_8; __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8)); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __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; @@ -7098,7 +7095,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ } __pyx_L13:; - /* "constraint/parser.py":131 + /* "constraint/parser.py":116 * else: * swapped_side_first_component = swapped_side_first_component.group(0) * if "-" in unique_operators: # <<<<<<<<<<<<<< @@ -7107,76 +7104,76 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":142 + /* "constraint/parser.py":127 * 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" */ - __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, 142, __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":143 + /* "constraint/parser.py":128 * 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) :] */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 143, __pyx_L1_error) + __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); if (__pyx_t_1) { - /* "constraint/parser.py":145 + /* "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) :] # <<<<<<<<<<<<<< * left_swap = right_remainder.replace("/", "*") * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_component}" */ - __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_component); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 145, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_right, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_component); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_right, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_right_remainder, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":146 + /* "constraint/parser.py":131 * # e.g. "G == B/M" becomes "G*M == B" * 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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_right_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_left_swap, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/parser.py":147 + /* "constraint/parser.py":132 * 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" */ - __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_left, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_left_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_component, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_component, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10[0] = __pyx_t_8; __pyx_t_10[1] = __pyx_t_2; __pyx_t_10[2] = __pyx_t_5; __pyx_t_10[3] = __pyx_t_11; __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11)); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 147, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 132, __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; @@ -7185,7 +7182,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF_SET(__pyx_v_restriction, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; - /* "constraint/parser.py":143 + /* "constraint/parser.py":128 * restriction = f"{swapped_side_first_component}{comparator}{right}{right_swap}" * if "/" in unique_operators: * if not variables_on_left: # <<<<<<<<<<<<<< @@ -7195,7 +7192,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ goto __pyx_L15; } - /* "constraint/parser.py":150 + /* "constraint/parser.py":135 * else: * # e.g. "B/M == G" becomes "B == G*M" * left_remainder = left[len(swapped_side_first_component) :] # <<<<<<<<<<<<<< @@ -7203,48 +7200,48 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * restriction = f"{swapped_side_first_component}{comparator}{right}{right_swap}" */ /*else*/ { - __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_component); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 150, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_left, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_swapped_side_first_component); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_left, __pyx_t_3, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_left_remainder, __pyx_t_7); __pyx_t_7 = 0; - /* "constraint/parser.py":151 + /* "constraint/parser.py":136 * # e.g. "B/M == G" becomes "B == G*M" * left_remainder = left[len(swapped_side_first_component) :] * right_swap = left_remainder.replace("/", "*") # <<<<<<<<<<<<<< * restriction = f"{swapped_side_first_component}{comparator}{right}{right_swap}" * */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_left_remainder, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_right_swap, __pyx_t_11); __pyx_t_11 = 0; - /* "constraint/parser.py":152 + /* "constraint/parser.py":137 * 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 */ - __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_component, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_swapped_side_first_component, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_right, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_right_swap, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10[0] = __pyx_t_11; __pyx_t_10[1] = __pyx_t_7; __pyx_t_10[2] = __pyx_t_5; __pyx_t_10[3] = __pyx_t_2; __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2)); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 152, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -7255,7 +7252,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ } __pyx_L15:; - /* "constraint/parser.py":142 + /* "constraint/parser.py":127 * right_swap = left_remainder.replace("-", "+") * restriction = f"{swapped_side_first_component}{comparator}{right}{right_swap}" * if "/" in unique_operators: # <<<<<<<<<<<<<< @@ -7264,16 +7261,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":155 + /* "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 = extract_operators(left) * operators_right = extract_operators(right) */ - __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, 155, __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, 155, __pyx_L1_error) + __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); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (1) { @@ -7282,7 +7279,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 155, __pyx_L1_error) + __PYX_ERR(0, 140, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); @@ -7290,9 +7287,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -7302,7 +7299,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF_SET(__pyx_v_right, __pyx_t_5); __pyx_t_5 = 0; - /* "constraint/parser.py":156 + /* "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 = extract_operators(left) # <<<<<<<<<<<<<< @@ -7310,7 +7307,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * unique_operators_left = set(operators_left) */ __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, 156, __pyx_L1_error) + __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 @@ -7329,13 +7326,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 156, __pyx_L1_error) + 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":157 + /* "constraint/parser.py":142 * left, right = tuple(s.strip() for s in restriction.split(comparator)) * operators_left = extract_operators(left) * operators_right = extract_operators(right) # <<<<<<<<<<<<<< @@ -7343,7 +7340,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * unique_operators_right = set(operators_right) */ __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, 157, __pyx_L1_error) + __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 @@ -7362,49 +7359,49 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 157, __pyx_L1_error) + 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":158 + /* "constraint/parser.py":143 * 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) */ - __pyx_t_2 = PySet_New(__pyx_v_operators_left); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_2 = PySet_New(__pyx_v_operators_left); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_unique_operators_left, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "constraint/parser.py":159 + /* "constraint/parser.py":144 * 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) * */ - __pyx_t_2 = PySet_New(__pyx_v_operators_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_2 = PySet_New(__pyx_v_operators_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_unique_operators_right, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "constraint/parser.py":160 + /* "constraint/parser.py":145 * 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 */ - __pyx_t_2 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PySet_Type__union, __pyx_v_unique_operators_left, __pyx_v_unique_operators_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_2 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PySet_Type__union, __pyx_v_unique_operators_left, __pyx_v_unique_operators_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_unique_operators, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "constraint/parser.py":121 + /* "constraint/parser.py":106 * unique_operators_right = set(operators_right) * unique_operators = unique_operators_left.union(unique_operators_right) * if len(unique_operators) == 1: # <<<<<<<<<<<<<< @@ -7413,7 +7410,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":164 + /* "constraint/parser.py":149 * # find out which side is the constant number * # 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) # <<<<<<<<<<<<<< @@ -7421,7 +7418,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if (left_num is None and right_num is None) or (left_num is not None and right_num is not None): */ __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, 164, __pyx_L1_error) + __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 @@ -7440,13 +7437,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 164, __pyx_L1_error) + 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":165 + /* "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) # <<<<<<<<<<<<<< @@ -7454,7 +7451,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # if both sides are parameters, try to use the VariableConstraints */ __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, 165, __pyx_L1_error) + __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_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -7473,13 +7470,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 165, __pyx_L1_error) + 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":166 + /* "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): # <<<<<<<<<<<<<< @@ -7509,26 +7506,26 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_L17_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":168 + /* "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 = ["+", "*"] # <<<<<<<<<<<<<< * # 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_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __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_2, 0, __pyx_mstate_global->__pyx_kp_u__9) != (0)) __PYX_ERR(0, 168, __pyx_L1_error); + 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, 168, __pyx_L1_error); + 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":170 + /* "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) # <<<<<<<<<<<<<< @@ -7536,12 +7533,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # if the restriction contains more than the variables and supported operators, return None */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 170, __pyx_L1_error) + __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, 170, __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, 170, __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))) { @@ -7559,24 +7556,24 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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_2)) __PYX_ERR(0, 170, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_variables = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/parser.py":173 + /* "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_3 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 173, __pyx_L1_error) + __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":174 + /* "constraint/parser.py":159 * # if the restriction contains more than the variables and supported operators, return None * if len(variables) == 0: * return None # <<<<<<<<<<<<<< @@ -7587,7 +7584,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":173 + /* "constraint/parser.py":158 * * # if the restriction contains more than the variables and supported operators, return None * if len(variables) == 0: # <<<<<<<<<<<<<< @@ -7596,23 +7593,23 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":175 + /* "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_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, 175, __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_7 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 175, __pyx_L1_error) + __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_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 175, __pyx_L1_error) + __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":176 + /* "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()}") # <<<<<<<<<<<<<< @@ -7620,16 +7617,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * 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, 176, __pyx_L1_error) + __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, 176, __pyx_L1_error) } + 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, 176, __pyx_L1_error) + __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, 176, __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, 176, __pyx_L1_error) + __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; @@ -7637,7 +7634,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 176, __pyx_L1_error) + 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; @@ -7647,14 +7644,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 176, __pyx_L1_error) + 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, 176, __pyx_L1_error) + __PYX_ERR(0, 161, __pyx_L1_error) - /* "constraint/parser.py":175 + /* "constraint/parser.py":160 * if len(variables) == 0: * return None * if any(var.strip() not in tune_params for var in variables): # <<<<<<<<<<<<<< @@ -7663,7 +7660,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":178 + /* "constraint/parser.py":163 * raise ValueError(f"Variables {variables} not in tune_params {tune_params.keys()}") * if ( * len(re.findall(r"[+-]?\d+", restriction)) > 0 # <<<<<<<<<<<<<< @@ -7671,9 +7668,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # 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, 178, __pyx_L1_error) + __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, 178, __pyx_L1_error) + __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; @@ -7693,14 +7690,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 178, __pyx_L1_error) + 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, 178, __pyx_L1_error) + __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":177 + /* "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 ( # <<<<<<<<<<<<<< @@ -7709,7 +7706,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ if (__pyx_t_1) { - /* "constraint/parser.py":181 + /* "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 # <<<<<<<<<<<<<< @@ -7720,7 +7717,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":177 + /* "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 ( # <<<<<<<<<<<<<< @@ -7729,48 +7726,48 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":184 + /* "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, 184, __pyx_L1_error) + __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, 184, __pyx_L1_error) + __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":185 + /* "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, 185, __pyx_L1_error) + __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, 185, __pyx_L1_error) + __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":186 + /* "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, 186, __pyx_L1_error) + __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, 186, __pyx_L1_error) + __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; { @@ -7779,23 +7776,23 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 186, __pyx_L1_error) + 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, 186, __pyx_L1_error) + __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":189 + /* "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, 189, __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, 174, __pyx_L1_error) __pyx_t_6 = (__pyx_t_3 <= 1); if (__pyx_t_6) { } else { @@ -7803,19 +7800,19 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ goto __pyx_L25_bool_binop_done; } - /* "constraint/parser.py":190 + /* "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, 190, __pyx_L1_error) + __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, 190, __pyx_L1_error) + __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, 190, __pyx_L1_error) + __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 { @@ -7823,26 +7820,26 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ goto __pyx_L25_bool_binop_done; } - /* "constraint/parser.py":191 + /* "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, 191, __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, 176, __pyx_L1_error) __pyx_t_6 = (__pyx_t_3 == 0); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; 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, 191, __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_L25_bool_binop_done:; - /* "constraint/parser.py":188 + /* "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 ( # <<<<<<<<<<<<<< @@ -7851,52 +7848,52 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ if (__pyx_t_1) { - /* "constraint/parser.py":193 + /* "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, 193, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyBool_FromLong((__pyx_t_3 > 0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 193, __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, 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":194 + /* "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 ( */ - __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_variable_unique_operators); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 194, __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_L30_bool_binop_done; } - __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, 194, __pyx_L1_error) + __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, 194, __pyx_L1_error) + __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_L30_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":195 + /* "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]) */ - __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, 195, __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":196 + /* "constraint/parser.py":181 * if len(variable_unique_operators) == 0 or variable_unique_operators[0] == "+": * if comparator == "==": * return ( # <<<<<<<<<<<<<< @@ -7905,17 +7902,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __Pyx_XDECREF(__pyx_r); - /* "constraint/parser.py":198 + /* "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, 198, __pyx_L1_error) + __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) { - /* "constraint/parser.py":197 + /* "constraint/parser.py":182 * if comparator == "==": * return ( * VariableExactSumConstraint(variables[-1], variables[:-1]) # <<<<<<<<<<<<<< @@ -7923,11 +7920,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * 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, 197, __pyx_L1_error) + __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_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, 197, __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, 197, __pyx_L1_error) + __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 @@ -7948,14 +7945,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 197, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_7 = __pyx_t_8; __pyx_t_8 = 0; } else { - /* "constraint/parser.py":199 + /* "constraint/parser.py":184 * VariableExactSumConstraint(variables[-1], variables[:-1]) * if variables_on_left * else VariableExactSumConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< @@ -7963,11 +7960,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * 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, 199, __pyx_L1_error) + __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_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, 199, __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, 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, 199, __pyx_L1_error) + __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 @@ -7988,7 +7985,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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_8)) __PYX_ERR(0, 199, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_7 = __pyx_t_8; @@ -7998,7 +7995,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":195 + /* "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 == "==": # <<<<<<<<<<<<<< @@ -8007,17 +8004,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":201 + /* "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 ( */ - __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, 201, __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":203 + /* "constraint/parser.py":188 * elif comparator == "<=": * # "B+C <= A" (maxsum) if variables_on_left else "A <= B+C" (minsum) * return ( # <<<<<<<<<<<<<< @@ -8026,17 +8023,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __Pyx_XDECREF(__pyx_r); - /* "constraint/parser.py":205 + /* "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, 205, __pyx_L1_error) + __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":204 + /* "constraint/parser.py":189 * # "B+C <= A" (maxsum) if variables_on_left else "A <= B+C" (minsum) * return ( * VariableMaxSumConstraint(variables[-1], variables[:-1]) # <<<<<<<<<<<<<< @@ -8044,11 +8041,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * else VariableMinSumConstraint(variables[0], variables[1:]) */ __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __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, 204, __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, 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, 204, __pyx_L1_error) + __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_9 = 1; #if CYTHON_UNPACK_METHODS @@ -8069,14 +8066,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 204, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_7 = __pyx_t_8; __pyx_t_8 = 0; } else { - /* "constraint/parser.py":206 + /* "constraint/parser.py":191 * VariableMaxSumConstraint(variables[-1], variables[:-1]) * if variables_on_left * else VariableMinSumConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< @@ -8084,11 +8081,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * 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, 206, __pyx_L1_error) + __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_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, 206, __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, 206, __pyx_L1_error) + __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 @@ -8109,7 +8106,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 206, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_7 = __pyx_t_8; @@ -8119,7 +8116,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":201 + /* "constraint/parser.py":186 * else VariableExactSumConstraint(variables[0], variables[1:]) * ) # noqa: E501 * elif comparator == "<=": # <<<<<<<<<<<<<< @@ -8128,17 +8125,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":208 + /* "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 ( */ - __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, 208, __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":210 + /* "constraint/parser.py":195 * elif comparator == ">=": * # "B+C >= A" (minsum) if variables_on_left else "A >= B+C" (maxsum) * return ( # <<<<<<<<<<<<<< @@ -8147,17 +8144,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __Pyx_XDECREF(__pyx_r); - /* "constraint/parser.py":212 + /* "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, 212, __pyx_L1_error) + __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) { - /* "constraint/parser.py":211 + /* "constraint/parser.py":196 * # "B+C >= A" (minsum) if variables_on_left else "A >= B+C" (maxsum) * return ( * VariableMinSumConstraint(variables[-1], variables[:-1]) # <<<<<<<<<<<<<< @@ -8165,11 +8162,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * 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, 211, __pyx_L1_error) + __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_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, 211, __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, 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, 211, __pyx_L1_error) + __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 @@ -8190,14 +8187,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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_8)) __PYX_ERR(0, 211, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_7 = __pyx_t_8; __pyx_t_8 = 0; } else { - /* "constraint/parser.py":213 + /* "constraint/parser.py":198 * VariableMinSumConstraint(variables[-1], variables[:-1]) * if variables_on_left * else VariableMaxSumConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< @@ -8205,11 +8202,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * elif variable_unique_operators[0] == "*": */ __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __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, 213, __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, 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, 213, __pyx_L1_error) + __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_9 = 1; #if CYTHON_UNPACK_METHODS @@ -8230,7 +8227,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 213, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_7 = __pyx_t_8; @@ -8240,7 +8237,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":208 + /* "constraint/parser.py":193 * else VariableMinSumConstraint(variables[0], variables[1:]) * ) # noqa: E501 * elif comparator == ">=": # <<<<<<<<<<<<<< @@ -8249,7 +8246,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":194 + /* "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] == "+": # <<<<<<<<<<<<<< @@ -8259,30 +8256,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ goto __pyx_L29; } - /* "constraint/parser.py":215 + /* "constraint/parser.py":200 * else VariableMaxSumConstraint(variables[0], variables[1:]) * ) # noqa: E501 * elif variable_unique_operators[0] == "*": # <<<<<<<<<<<<<< * if comparator == "==": * return ( */ - __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, 215, __pyx_L1_error) + __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, 215, __pyx_L1_error) + __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":216 + /* "constraint/parser.py":201 * ) # noqa: E501 * elif variable_unique_operators[0] == "*": * if 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, 216, __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":217 + /* "constraint/parser.py":202 * elif variable_unique_operators[0] == "*": * if comparator == "==": * return ( # <<<<<<<<<<<<<< @@ -8291,17 +8288,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __Pyx_XDECREF(__pyx_r); - /* "constraint/parser.py":219 + /* "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, 219, __pyx_L1_error) + __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) { - /* "constraint/parser.py":218 + /* "constraint/parser.py":203 * if comparator == "==": * return ( * VariableExactProdConstraint(variables[-1], variables[:-1]) # <<<<<<<<<<<<<< @@ -8309,11 +8306,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * 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, 218, __pyx_L1_error) + __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_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, 218, __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, 218, __pyx_L1_error) + __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 @@ -8334,14 +8331,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 218, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_7 = __pyx_t_8; __pyx_t_8 = 0; } else { - /* "constraint/parser.py":220 + /* "constraint/parser.py":205 * VariableExactProdConstraint(variables[-1], variables[:-1]) * if variables_on_left * else VariableExactProdConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< @@ -8349,11 +8346,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * 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, 220, __pyx_L1_error) + __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_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, 220, __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, 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, 220, __pyx_L1_error) + __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 @@ -8374,7 +8371,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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_8)) __PYX_ERR(0, 220, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_7 = __pyx_t_8; @@ -8384,7 +8381,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":216 + /* "constraint/parser.py":201 * ) # noqa: E501 * elif variable_unique_operators[0] == "*": * if comparator == "==": # <<<<<<<<<<<<<< @@ -8393,17 +8390,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":222 + /* "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 ( */ - __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, 222, __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":224 + /* "constraint/parser.py":209 * elif comparator == "<=": * # "B*C <= A" (maxprod) if variables_on_left else "A <= B*C" (minprod) * return ( # <<<<<<<<<<<<<< @@ -8412,17 +8409,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __Pyx_XDECREF(__pyx_r); - /* "constraint/parser.py":226 + /* "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, 226, __pyx_L1_error) + __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":225 + /* "constraint/parser.py":210 * # "B*C <= A" (maxprod) if variables_on_left else "A <= B*C" (minprod) * return ( * VariableMaxProdConstraint(variables[-1], variables[:-1]) # <<<<<<<<<<<<<< @@ -8430,11 +8427,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * else VariableMinProdConstraint(variables[0], variables[1:]) */ __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __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, 225, __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, 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, 225, __pyx_L1_error) + __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_9 = 1; #if CYTHON_UNPACK_METHODS @@ -8455,14 +8452,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 225, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_7 = __pyx_t_8; __pyx_t_8 = 0; } else { - /* "constraint/parser.py":227 + /* "constraint/parser.py":212 * VariableMaxProdConstraint(variables[-1], variables[:-1]) * if variables_on_left * else VariableMinProdConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< @@ -8470,11 +8467,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * 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, 227, __pyx_L1_error) + __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_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, 227, __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, 227, __pyx_L1_error) + __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 @@ -8495,7 +8492,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 227, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_7 = __pyx_t_8; @@ -8505,7 +8502,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":222 + /* "constraint/parser.py":207 * else VariableExactProdConstraint(variables[0], variables[1:]) * ) # noqa: E501 * elif comparator == "<=": # <<<<<<<<<<<<<< @@ -8514,17 +8511,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":229 + /* "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 ( */ - __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, 229, __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":231 + /* "constraint/parser.py":216 * elif comparator == ">=": * # "B*C >= A" (minprod) if variables_on_left else "A >= B*C" (maxprod) * return ( # <<<<<<<<<<<<<< @@ -8533,17 +8530,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __Pyx_XDECREF(__pyx_r); - /* "constraint/parser.py":233 + /* "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, 233, __pyx_L1_error) + __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) { - /* "constraint/parser.py":232 + /* "constraint/parser.py":217 * # "B*C >= A" (minprod) if variables_on_left else "A >= B*C" (maxprod) * return ( * VariableMinProdConstraint(variables[-1], variables[:-1]) # <<<<<<<<<<<<<< @@ -8551,11 +8548,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * 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, 232, __pyx_L1_error) + __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_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, 232, __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, 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, 232, __pyx_L1_error) + __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 @@ -8576,14 +8573,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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_8)) __PYX_ERR(0, 232, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_7 = __pyx_t_8; __pyx_t_8 = 0; } else { - /* "constraint/parser.py":234 + /* "constraint/parser.py":219 * VariableMinProdConstraint(variables[-1], variables[:-1]) * if variables_on_left * else VariableMaxProdConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< @@ -8591,11 +8588,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * */ __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __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, 234, __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, 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, 234, __pyx_L1_error) + __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_9 = 1; #if CYTHON_UNPACK_METHODS @@ -8616,7 +8613,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_7 = __pyx_t_8; @@ -8626,7 +8623,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":229 + /* "constraint/parser.py":214 * else VariableMinProdConstraint(variables[0], variables[1:]) * ) # noqa: E501 * elif comparator == ">=": # <<<<<<<<<<<<<< @@ -8635,7 +8632,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":215 + /* "constraint/parser.py":200 * else VariableMaxSumConstraint(variables[0], variables[1:]) * ) # noqa: E501 * elif variable_unique_operators[0] == "*": # <<<<<<<<<<<<<< @@ -8645,7 +8642,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ } __pyx_L29:; - /* "constraint/parser.py":188 + /* "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 ( # <<<<<<<<<<<<<< @@ -8654,7 +8651,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":238 + /* "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 # <<<<<<<<<<<<<< @@ -8665,7 +8662,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":166 + /* "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): # <<<<<<<<<<<<<< @@ -8674,7 +8671,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":242 + /* "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) # <<<<<<<<<<<<<< @@ -8690,19 +8687,19 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ 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, 242, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) + __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_2, 0, __pyx_v_left_num) != (0)) __PYX_ERR(0, 242, __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, 242, __pyx_L1_error); + 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_2, 2, Py_False) != (0)) __PYX_ERR(0, 242, __pyx_L1_error); + 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; @@ -8714,19 +8711,19 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ 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, 242, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error) + __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_8, 0, __pyx_v_right_num) != (0)) __PYX_ERR(0, 242, __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, 242, __pyx_L1_error); + 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_8, 2, Py_True) != (0)) __PYX_ERR(0, 242, __pyx_L1_error); + 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; @@ -8737,7 +8734,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 241, __pyx_L1_error) + __PYX_ERR(0, 226, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); @@ -8747,19 +8744,19 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_11); #else - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __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_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) + __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, 241, __pyx_L1_error) + __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_7); __pyx_t_7 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 226, __pyx_L1_error) } - /* "constraint/parser.py":241 + /* "constraint/parser.py":226 * * # if one side is a number, the other side must be a variable or expression * number, variables, variables_on_left = ( # <<<<<<<<<<<<<< @@ -8773,7 +8770,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_XDECREF_SET(__pyx_v_variables_on_left, __pyx_t_11); __pyx_t_11 = 0; - /* "constraint/parser.py":246 + /* "constraint/parser.py":231 * * # we can map '>' to '>=' and '<' to '<=' by adding a tiny offset to the number * offset = 1e-12 # <<<<<<<<<<<<<< @@ -8782,42 +8779,42 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __pyx_v_offset = 1e-12; - /* "constraint/parser.py":247 + /* "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, 247, __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":248 + /* "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, 248, __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":250 + /* "constraint/parser.py":235 * if variables_on_left: * # (x < 2) == (x <= 2-offset) * number -= offset # <<<<<<<<<<<<<< * else: * # (2 < x) == (2+offset <= x) */ - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 250, __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_t_11 = PyNumber_InPlaceSubtract(__pyx_v_number, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 250, __pyx_L1_error) + __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":248 + /* "constraint/parser.py":233 * offset = 1e-12 * if comparator == "<": * if variables_on_left: # <<<<<<<<<<<<<< @@ -8827,7 +8824,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ goto __pyx_L35; } - /* "constraint/parser.py":253 + /* "constraint/parser.py":238 * else: * # (2 < x) == (2+offset <= x) * number += offset # <<<<<<<<<<<<<< @@ -8835,9 +8832,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if variables_on_left: */ /*else*/ { - __pyx_t_11 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 253, __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, 253, __pyx_L1_error) + __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_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_7); @@ -8845,7 +8842,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ } __pyx_L35:; - /* "constraint/parser.py":247 + /* "constraint/parser.py":232 * # we can map '>' to '>=' and '<' to '<=' by adding a tiny offset to the number * offset = 1e-12 * if comparator == "<": # <<<<<<<<<<<<<< @@ -8855,42 +8852,42 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ goto __pyx_L34; } - /* "constraint/parser.py":254 + /* "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, 254, __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":255 + /* "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, 255, __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":257 + /* "constraint/parser.py":242 * if variables_on_left: * # (x > 2) == (x >= 2+offset) * number += offset # <<<<<<<<<<<<<< * else: * # (2 > x) == (2-offset >= x) */ - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 257, __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_t_11 = PyNumber_InPlaceAdd(__pyx_v_number, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 257, __pyx_L1_error) + __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":255 + /* "constraint/parser.py":240 * number += offset * elif comparator == ">": * if variables_on_left: # <<<<<<<<<<<<<< @@ -8900,7 +8897,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ goto __pyx_L36; } - /* "constraint/parser.py":260 + /* "constraint/parser.py":245 * else: * # (2 > x) == (2-offset >= x) * number -= offset # <<<<<<<<<<<<<< @@ -8908,9 +8905,9 @@ 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_11 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 260, __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, 260, __pyx_L1_error) + __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_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_7); @@ -8918,7 +8915,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ } __pyx_L36:; - /* "constraint/parser.py":254 + /* "constraint/parser.py":239 * # (2 < x) == (2+offset <= x) * number += offset * elif comparator == ">": # <<<<<<<<<<<<<< @@ -8928,28 +8925,28 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ } __pyx_L34:; - /* "constraint/parser.py":263 + /* "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_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 263, __pyx_L1_error) + __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, 263, __pyx_L1_error); + 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_7, 1, __pyx_mstate_global->__pyx_kp_u__13) != (0)) __PYX_ERR(0, 263, __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_7, 2, __pyx_mstate_global->__pyx_kp_u__14) != (0)) __PYX_ERR(0, 263, __pyx_L1_error); + 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":264 + /* "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) # <<<<<<<<<<<<<< @@ -8957,12 +8954,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # no operators found, return only based on comparator */ __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error) + __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_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 264, __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, 264, __pyx_L1_error) + __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 @@ -8982,24 +8979,24 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 264, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_v_operators_found = __pyx_t_7; __pyx_t_7 = 0; - /* "constraint/parser.py":265 + /* "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, 265, __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":267 + /* "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,7 +9005,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __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, 267, __pyx_L1_error) + __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) { @@ -9016,12 +9013,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_1 = __pyx_t_6; 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, 267, __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_L39_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":269 + /* "constraint/parser.py":254 * if len(params) != 1 or variables not in params: * # there were more than one variable but no operator * return None # <<<<<<<<<<<<<< @@ -9032,7 +9029,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":267 + /* "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: # <<<<<<<<<<<<<< @@ -9041,17 +9038,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":272 + /* "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, 272, __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":273 + /* "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) # <<<<<<<<<<<<<< @@ -9060,7 +9057,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error) + __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 @@ -9079,14 +9076,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 273, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":272 + /* "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 == "==": # <<<<<<<<<<<<<< @@ -9095,25 +9092,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":274 + /* "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, 274, __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_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, 274, __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_L41_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":275 + /* "constraint/parser.py":260 * return ExactSumConstraint(number) * elif comparator == "<=" or comparator == "<": * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< @@ -9121,10 +9118,10 @@ 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, 275, __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_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 275, __pyx_L1_error) + __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 @@ -9143,14 +9140,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 275, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_7 = __pyx_t_2; __pyx_t_2 = 0; } else { __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 275, __pyx_L1_error) + __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 @@ -9169,7 +9166,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 275, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_7 = __pyx_t_2; @@ -9179,7 +9176,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":274 + /* "constraint/parser.py":259 * elif comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or comparator == "<": # <<<<<<<<<<<<<< @@ -9188,25 +9185,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":276 + /* "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, 276, __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_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, 276, __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_L43_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":277 + /* "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) # <<<<<<<<<<<<<< @@ -9214,10 +9211,10 @@ 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, 277, __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_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 277, __pyx_L1_error) + __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 @@ -9236,14 +9233,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 277, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_7 = __pyx_t_2; __pyx_t_2 = 0; } else { __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 277, __pyx_L1_error) + __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 @@ -9262,7 +9259,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 277, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_7 = __pyx_t_2; @@ -9272,7 +9269,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":276 + /* "constraint/parser.py":261 * elif comparator == "<=" or comparator == "<": * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or comparator == ">": # <<<<<<<<<<<<<< @@ -9281,7 +9278,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":278 + /* "constraint/parser.py":263 * elif comparator == ">=" or comparator == ">": * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * raise ValueError(f"Invalid comparator {comparator}") # <<<<<<<<<<<<<< @@ -9289,9 +9286,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # check which operator is applied on the variables */ __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, 278, __pyx_L1_error) + __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, 278, __pyx_L1_error) + __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_8); __pyx_t_8 = 0; __pyx_t_9 = 1; @@ -9300,14 +9297,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 278, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 263, __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, 278, __pyx_L1_error) + __PYX_ERR(0, 263, __pyx_L1_error) - /* "constraint/parser.py":265 + /* "constraint/parser.py":250 * operators = [r"\*\*", r"\*", r"\+"] * operators_found = re.findall(str("|".join(operators)), variables) * if len(operators_found) == 0: # <<<<<<<<<<<<<< @@ -9316,37 +9313,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":281 + /* "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_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, 281, __pyx_L1_error) + __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":282 + /* "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_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, 282, __pyx_L1_error) + __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, 282, __pyx_L1_error) + __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, 282, __pyx_L1_error) + __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":284 + /* "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 # <<<<<<<<<<<<<< @@ -9357,7 +9354,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":282 + /* "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): # <<<<<<<<<<<<<< @@ -9366,7 +9363,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":287 + /* "constraint/parser.py":272 * * # split the string on the comparison * splitted = variables.split(operator) # <<<<<<<<<<<<<< @@ -9380,23 +9377,23 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ 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, 287, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } __pyx_v_splitted = __pyx_t_11; __pyx_t_11 = 0; - /* "constraint/parser.py":289 + /* "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, 289, __pyx_L1_error) + __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, 289, __pyx_L1_error) + __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) { @@ -9404,28 +9401,28 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_6 = __pyx_t_1; goto __pyx_L47_bool_binop_done; } - __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, 289, __pyx_L1_error) + __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, 289, __pyx_L1_error) + __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, 289, __pyx_L1_error) + __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_L47_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":291 + /* "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__15, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 291, __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":293 + /* "constraint/parser.py":278 * if operator == "**": * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None # <<<<<<<<<<<<<< @@ -9436,7 +9433,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":291 + /* "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 == "**": # <<<<<<<<<<<<<< @@ -9445,27 +9442,27 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":294 + /* "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__11, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 294, __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":295 + /* "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, 295, __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":296 + /* "constraint/parser.py":281 * elif operator == "*": * if comparator == "==": * return ExactProdConstraint(number) # <<<<<<<<<<<<<< @@ -9474,7 +9471,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __Pyx_XDECREF(__pyx_r); __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) + __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 @@ -9493,14 +9490,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 296, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":295 + /* "constraint/parser.py":280 * return None * elif operator == "*": * if comparator == "==": # <<<<<<<<<<<<<< @@ -9509,25 +9506,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":297 + /* "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, 297, __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_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, 297, __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_L51_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":298 + /* "constraint/parser.py":283 * return ExactProdConstraint(number) * elif comparator == "<=" or comparator == "<": * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) # <<<<<<<<<<<<<< @@ -9535,10 +9532,10 @@ 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, 298, __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_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 298, __pyx_L1_error) + __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 @@ -9557,14 +9554,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 298, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_7 = __pyx_t_2; __pyx_t_2 = 0; } else { __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 298, __pyx_L1_error) + __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 @@ -9583,7 +9580,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 298, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_7 = __pyx_t_2; @@ -9593,7 +9590,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":297 + /* "constraint/parser.py":282 * if comparator == "==": * return ExactProdConstraint(number) * elif comparator == "<=" or comparator == "<": # <<<<<<<<<<<<<< @@ -9602,25 +9599,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":299 + /* "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, 299, __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_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, 299, __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_L53_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":300 + /* "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) # <<<<<<<<<<<<<< @@ -9628,10 +9625,10 @@ 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, 300, __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_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 300, __pyx_L1_error) + __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 @@ -9650,14 +9647,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 300, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_7 = __pyx_t_2; __pyx_t_2 = 0; } else { __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 300, __pyx_L1_error) + __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 @@ -9676,7 +9673,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 300, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_7 = __pyx_t_2; @@ -9686,7 +9683,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":299 + /* "constraint/parser.py":284 * elif comparator == "<=" or comparator == "<": * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or comparator == ">": # <<<<<<<<<<<<<< @@ -9695,7 +9692,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":294 + /* "constraint/parser.py":279 * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None * elif operator == "*": # <<<<<<<<<<<<<< @@ -9705,27 +9702,27 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ goto __pyx_L49; } - /* "constraint/parser.py":301 + /* "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__9, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 301, __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":302 + /* "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, 302, __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":303 + /* "constraint/parser.py":288 * elif operator == "+": * if comparator == "==": * return ExactSumConstraint(number) # <<<<<<<<<<<<<< @@ -9734,7 +9731,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 303, __pyx_L1_error) + __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 @@ -9753,14 +9750,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 303, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":302 + /* "constraint/parser.py":287 * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": * if comparator == "==": # <<<<<<<<<<<<<< @@ -9769,25 +9766,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":304 + /* "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, 304, __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_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, 304, __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_L56_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":306 + /* "constraint/parser.py":291 * elif comparator == "<=" or comparator == "<": * # raise ValueError(restriction, comparator) * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< @@ -9795,10 +9792,10 @@ 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, 306, __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_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 306, __pyx_L1_error) + __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 @@ -9817,14 +9814,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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_11)) __PYX_ERR(0, 306, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } __pyx_t_7 = __pyx_t_11; __pyx_t_11 = 0; } else { __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error) + __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 @@ -9843,7 +9840,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 306, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } __pyx_t_7 = __pyx_t_11; @@ -9853,7 +9850,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":304 + /* "constraint/parser.py":289 * if comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or comparator == "<": # <<<<<<<<<<<<<< @@ -9862,25 +9859,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":307 + /* "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, 307, __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_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, 307, __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_L58_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":308 + /* "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) # <<<<<<<<<<<<<< @@ -9888,10 +9885,10 @@ 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, 308, __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_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 308, __pyx_L1_error) + __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 @@ -9910,14 +9907,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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_11)) __PYX_ERR(0, 308, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } __pyx_t_7 = __pyx_t_11; __pyx_t_11 = 0; } else { __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error) + __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 @@ -9936,7 +9933,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 308, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } __pyx_t_7 = __pyx_t_11; @@ -9946,7 +9943,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":307 + /* "constraint/parser.py":292 * # raise ValueError(restriction, comparator) * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or comparator == ">": # <<<<<<<<<<<<<< @@ -9955,7 +9952,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":301 + /* "constraint/parser.py":286 * elif comparator == ">=" or comparator == ">": * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": # <<<<<<<<<<<<<< @@ -9965,7 +9962,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ goto __pyx_L49; } - /* "constraint/parser.py":310 + /* "constraint/parser.py":295 * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * else: * raise ValueError(f"Invalid operator {operator}") # <<<<<<<<<<<<<< @@ -9974,9 +9971,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ /*else*/ { __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, 310, __pyx_L1_error) + __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, 310, __pyx_L1_error) + __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_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = 1; @@ -9985,16 +9982,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __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, 310, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 295, __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, 310, __pyx_L1_error) + __PYX_ERR(0, 295, __pyx_L1_error) } __pyx_L49:; - /* "constraint/parser.py":289 + /* "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): # <<<<<<<<<<<<<< @@ -10003,7 +10000,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":311 + /* "constraint/parser.py":296 * else: * raise ValueError(f"Invalid operator {operator}") * return None # <<<<<<<<<<<<<< @@ -10017,9 +10014,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ /* "constraint/parser.py":81 * return split_restrictions * - * def to_numeric_constraint(restriction: str, params: list[str]) -> Optional[ # <<<<<<<<<<<<<< - * Union[ - * MinSumConstraint, + * 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 */ @@ -10075,12 +10072,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ return __pyx_r; } -/* "constraint/parser.py":313 +/* "constraint/parser.py":298 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] - * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: + * ) -> AllEqualConstraint | AllDifferentConstraint | None: */ /* Python wrapper */ @@ -10124,39 +10121,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, 313, __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, 313, __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, 313, __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, 313, __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, 313, __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, 313, __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, 313, __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, 313, __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:; @@ -10167,8 +10164,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, 314, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 314, __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 */ @@ -10189,7 +10186,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } 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":332 +/* "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): # <<<<<<<<<<<<<< @@ -10209,7 +10206,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_22to_equalit if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 332, __pyx_L1_error) + __PYX_ERR(0, 317, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10220,7 +10217,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_22to_equalit __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_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, 332, __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; @@ -10259,21 +10256,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, 332, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 332, __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, 332, __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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __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); @@ -10286,11 +10283,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __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, 332, __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, 332, __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, 332, __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) { @@ -10331,12 +10328,12 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit return __pyx_r; } -/* "constraint/parser.py":313 +/* "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) { @@ -10365,7 +10362,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 313, __pyx_L1_error) + __PYX_ERR(0, 298, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10376,7 +10373,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":318 + /* "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): # <<<<<<<<<<<<<< @@ -10385,21 +10382,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, 318, __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, 318, __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, 318, __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, 318, __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":319 + /* "constraint/parser.py":304 * # check if all parameters are involved * if len(params) != len(tune_params): * return None # <<<<<<<<<<<<<< @@ -10410,7 +10407,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":318 + /* "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): # <<<<<<<<<<<<<< @@ -10419,7 +10416,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":322 + /* "constraint/parser.py":307 * * # find whether (in)equalities appear in this restriction * equalities_found = re.findall("==", restriction) # <<<<<<<<<<<<<< @@ -10427,9 +10424,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, 322, __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, 322, __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; @@ -10449,13 +10446,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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, 322, __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":323 + /* "constraint/parser.py":308 * # find whether (in)equalities appear in this restriction * equalities_found = re.findall("==", restriction) * inequalities_found = re.findall("!=", restriction) # <<<<<<<<<<<<<< @@ -10463,9 +10460,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, 323, __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, 323, __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; @@ -10485,37 +10482,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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, 323, __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":325 + /* "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, 325, __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, 325, __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, 325, __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, 325, __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, 325, __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, 325, __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":326 + /* "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 # <<<<<<<<<<<<<< @@ -10526,7 +10523,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":325 + /* "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)): # <<<<<<<<<<<<<< @@ -10535,22 +10532,22 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":327 + /* "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, 327, __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, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __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, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __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; @@ -10558,29 +10555,29 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __pyx_v_comparator = __pyx_t_7; __pyx_t_7 = 0; - /* "constraint/parser.py":330 + /* "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), -1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 330, __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":332 + /* "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, 332, __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, 332, __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) { @@ -10588,28 +10585,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, 332, __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, 332, __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, 332, __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":334 + /* "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, 334, __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":335 + /* "constraint/parser.py":320 * # map to a Constraint * if comparator == "==": * return AllEqualConstraint() # <<<<<<<<<<<<<< @@ -10618,7 +10615,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, 335, __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 @@ -10637,14 +10634,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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, 335, __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":334 + /* "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 == "==": # <<<<<<<<<<<<<< @@ -10653,17 +10650,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":336 + /* "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, 336, __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":337 + /* "constraint/parser.py":322 * return AllEqualConstraint() * elif comparator == "!=": * return AllDifferentConstraint() # <<<<<<<<<<<<<< @@ -10672,7 +10669,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, 337, __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 @@ -10691,14 +10688,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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, 337, __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":336 + /* "constraint/parser.py":321 * if comparator == "==": * return AllEqualConstraint() * elif comparator == "!=": # <<<<<<<<<<<<<< @@ -10707,7 +10704,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":338 + /* "constraint/parser.py":323 * elif comparator == "!=": * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") # <<<<<<<<<<<<<< @@ -10716,9 +10713,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = NULL; - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __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, 338, __pyx_L1_error) + __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_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = 1; @@ -10727,14 +10724,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __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_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 338, __pyx_L1_error) + 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":332 + /* "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): # <<<<<<<<<<<<<< @@ -10743,7 +10740,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":339 + /* "constraint/parser.py":324 * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") * return None # <<<<<<<<<<<<<< @@ -10754,12 +10751,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":313 + /* "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 */ @@ -10783,7 +10780,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality } 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":342 +/* "constraint/parser.py":327 * * # remove functionally duplicate restrictions (preserves order and whitespace) * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< @@ -10803,7 +10800,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(CY if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 342, __pyx_L1_error) + __PYX_ERR(0, 327, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10811,7 +10808,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_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, 342, __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; @@ -10848,21 +10845,21 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator1 return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 342, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 342, __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, 342, __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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __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); @@ -10910,7 +10907,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator1 /* "constraint/parser.py":32 * * - * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< + * 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 */ @@ -11033,15 +11030,15 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED /* "constraint/parser.py":81 * return split_restrictions * - * def to_numeric_constraint(restriction: str, params: list[str]) -> Optional[ # <<<<<<<<<<<<<< - * Union[ - * MinSumConstraint, + * 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, 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, 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_Optional_Union_MinSumConstraint) < (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); @@ -11049,42 +11046,42 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __pyx_v_to_numeric_constraint = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":313 + /* "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, 313, __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, 313, __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, 313, __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, 313, __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, 313, __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":342 + /* "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] */ - __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(NULL, __pyx_v_restrictions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __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, 342, __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, 342, __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":344 + /* "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] # <<<<<<<<<<<<<< @@ -11092,7 +11089,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * # 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, 344, __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; @@ -11100,22 +11097,22 @@ 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, 344, __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_GetItemRefFast(__pyx_t_2, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 344, __pyx_L6_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L6_error) __Pyx_GOTREF(__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_9genexpr13__pyx_v_r, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 344, __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, 344, __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, 344, __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; @@ -11129,7 +11126,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __pyx_v_restrictions_cleaned = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":345 + /* "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 # <<<<<<<<<<<<<< @@ -11143,16 +11140,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_restrictions_cleaned}; __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, 345, __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, 345, __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":347 + /* "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] # <<<<<<<<<<<<<< @@ -11160,7 +11157,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * */ { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __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; @@ -11168,19 +11165,19 @@ 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, 347, __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_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 347, __pyx_L13_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L13_error) __Pyx_GOTREF(__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_9genexpr14__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 347, __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, 347, __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; @@ -11194,7 +11191,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __pyx_v_restrictions_unique_indices = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":348 + /* "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] # <<<<<<<<<<<<<< @@ -11202,7 +11199,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, 348, __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; @@ -11210,19 +11207,19 @@ 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, 348, __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_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __pyx_L20_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L20_error) __Pyx_GOTREF(__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_9genexpr15__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __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, 348, __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; @@ -11236,7 +11233,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __Pyx_DECREF_SET(__pyx_v_restrictions, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "constraint/parser.py":342 + /* "constraint/parser.py":327 * * # remove functionally duplicate restrictions (preserves order and whitespace) * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< @@ -11245,32 +11242,32 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":351 + /* "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, 351, __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, 351, __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":353 + /* "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, 353, __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":354 + /* "constraint/parser.py":339 * # split into functions that only take their relevant parameters * parsed_restrictions = list() * for res in restrictions: # <<<<<<<<<<<<<< @@ -11279,7 +11276,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, 354, __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; @@ -11287,32 +11284,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, 354, __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_GetItemRefFast(__pyx_t_2, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __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":355 + /* "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, 355, __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":356 + /* "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() # <<<<<<<<<<<<<< @@ -11320,9 +11317,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, 356, __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, 356, __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; @@ -11342,7 +11339,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __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, 356, __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; @@ -11353,25 +11350,25 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __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, 356, __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":357 + /* "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, 357, __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":358 + /* "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 # <<<<<<<<<<<<<< @@ -11381,25 +11378,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":359 + /* "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, 359, __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, 359, __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":361 + /* "constraint/parser.py":346 * if " or " not in res and " and " not in res: * # if applicable, strip the outermost round brackets * while ( # <<<<<<<<<<<<<< @@ -11408,16 +11405,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ while (1) { - /* "constraint/parser.py":362 + /* "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, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __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, 362, __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 { @@ -11425,16 +11422,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":363 + /* "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, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __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, 363, __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 { @@ -11442,16 +11439,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":364 + /* "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, 364, __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, 364, __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 { @@ -11459,35 +11456,35 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":365 + /* "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, 365, __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, 365, __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":367 + /* "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, 367, __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":369 + /* "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) # <<<<<<<<<<<<<< @@ -11496,14 +11493,14 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ __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, 369, __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, 369, __pyx_L1_error) + 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":370 + /* "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: # <<<<<<<<<<<<<< @@ -11513,7 +11510,7 @@ 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":372 + /* "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) # <<<<<<<<<<<<<< @@ -11522,14 +11519,14 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ __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, 372, __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, 372, __pyx_L1_error) + 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":370 + /* "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: # <<<<<<<<<<<<<< @@ -11538,7 +11535,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":359 + /* "constraint/parser.py":344 * params_used_list = list(params_used) * finalized_constraint = None * if " or " not in res and " and " not in res: # <<<<<<<<<<<<<< @@ -11547,7 +11544,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":373 + /* "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: # <<<<<<<<<<<<<< @@ -11557,16 +11554,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":375 + /* "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, 375, __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, 375, __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; @@ -11574,14 +11571,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, 375, __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":373 + /* "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: # <<<<<<<<<<<<<< @@ -11590,25 +11587,25 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":376 + /* "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, 376, __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, 376, __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, 376, __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, 376, __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":354 + /* "constraint/parser.py":339 * # split into functions that only take their relevant parameters * parsed_restrictions = list() * for res in restrictions: # <<<<<<<<<<<<<< @@ -11618,7 +11615,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":378 + /* "constraint/parser.py":363 * parsed_restrictions.append((finalized_constraint, params_used_list)) * * return parsed_restrictions # <<<<<<<<<<<<<< @@ -11633,7 +11630,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED /* "constraint/parser.py":32 * * - * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< + * 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 */ @@ -11674,12 +11671,12 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED return __pyx_r; } -/* "constraint/parser.py":381 +/* "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 + * ) -> list[tuple[Constraint, list[str], str | None]]: # noqa: E501 */ /* Python wrapper */ @@ -11724,49 +11721,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, 381, __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, 381, __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, 381, __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, 381, __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, 381, __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":382 + /* "constraint/parser.py":367 * * def compile_to_constraints( * constraints: list[str], domains: dict, picklable=False # <<<<<<<<<<<<<< - * ) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 + * ) -> 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, 381, __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, 381, __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, 381, __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, 381, __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; } @@ -11778,7 +11775,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, 381, __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:; @@ -11789,16 +11786,16 @@ 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, 382, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 382, __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":381 + /* "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 + * ) -> list[tuple[Constraint, list[str], str | None]]: # noqa: E501 */ /* function exit code */ @@ -11846,15 +11843,15 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compile_to_constraints", 0); - /* "constraint/parser.py":394 + /* "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 * 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, 394, __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 @@ -11873,27 +11870,27 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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, 394, __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":395 + /* "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, 395, __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":396 + /* "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 @@ -11903,9 +11900,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, 396, __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, 396, __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)) { @@ -11913,7 +11910,7 @@ 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, 396, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 381, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -11923,7 +11920,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN { 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, 396, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 381, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -11934,13 +11931,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __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, 396, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 381, __pyx_L1_error) PyErr_Clear(); } break; @@ -11953,7 +11950,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, 396, __pyx_L1_error) + __PYX_ERR(0, 381, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -11963,22 +11960,22 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __Pyx_INCREF(__pyx_t_7); } else { __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 396, __pyx_L1_error) + 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, 396, __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, 396, __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, 396, __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); @@ -11986,7 +11983,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, 396, __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; @@ -11994,7 +11991,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, 396, __pyx_L1_error) + __PYX_ERR(0, 381, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_restriction, __pyx_t_2); @@ -12002,8 +11999,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":397 - * 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 @@ -12012,17 +12009,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":399 + /* "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, 399, __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":400 + /* "constraint/parser.py":385 * # if it's a string, wrap it in a (compilable or compiled) function constraint * if picklable: * constraint = CompilableFunctionConstraint(restriction) # <<<<<<<<<<<<<< @@ -12030,7 +12027,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, 400, __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 @@ -12049,13 +12046,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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, 400, __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":399 + /* "constraint/parser.py":384 * if isinstance(restriction, str): * # if it's a string, wrap it in a (compilable or compiled) function constraint * if picklable: # <<<<<<<<<<<<<< @@ -12065,7 +12062,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L8; } - /* "constraint/parser.py":402 + /* "constraint/parser.py":387 * constraint = CompilableFunctionConstraint(restriction) * else: * code_object = compile(restriction, "", "exec") # <<<<<<<<<<<<<< @@ -12079,13 +12076,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN 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((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; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __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":403 + /* "constraint/parser.py":388 * else: * code_object = compile(restriction, "", "exec") * func = FunctionType(code_object.co_consts[0], globals()) # <<<<<<<<<<<<<< @@ -12093,14 +12090,14 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * compiled_constraints.append((constraint, params_used, restriction)) */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 403, __pyx_L1_error) + __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, 403, __pyx_L1_error) + __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, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 403, __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, 403, __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 @@ -12121,13 +12118,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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, 403, __pyx_L1_error) + 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":404 + /* "constraint/parser.py":389 * code_object = compile(restriction, "", "exec") * func = FunctionType(code_object.co_consts[0], globals()) * constraint = FunctionConstraint(func) # <<<<<<<<<<<<<< @@ -12135,7 +12132,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * elif isinstance(restriction, Constraint): */ __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 404, __pyx_L1_error) + __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 @@ -12154,7 +12151,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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, 404, __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); @@ -12162,29 +12159,29 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN } __pyx_L8:; - /* "constraint/parser.py":405 + /* "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, 405, __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, 405, __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, 405, __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, 405, __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, 405, __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":397 - * 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 @@ -12193,41 +12190,41 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L7; } - /* "constraint/parser.py":406 + /* "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, 406, __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, 406, __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":408 + /* "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, 408, __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, 408, __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, 408, __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, 408, __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, 408, __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":406 + /* "constraint/parser.py":391 * constraint = FunctionConstraint(func) * compiled_constraints.append((constraint, params_used, restriction)) * elif isinstance(restriction, Constraint): # <<<<<<<<<<<<<< @@ -12237,7 +12234,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L7; } - /* "constraint/parser.py":410 + /* "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)}") # <<<<<<<<<<<<<< @@ -12246,16 +12243,16 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN */ /*else*/ { __pyx_t_8 = NULL; - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_restriction, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 410, __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, 410, __pyx_L1_error) + __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_7; __pyx_t_13[2] = __pyx_mstate_global->__pyx_kp_u_is_neither_a_string_or_Constrai; __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, 410, __pyx_L1_error) + 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; @@ -12265,18 +12262,18 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __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_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __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, 410, __pyx_L1_error) + __PYX_ERR(0, 395, __pyx_L1_error) } __pyx_L7:; - /* "constraint/parser.py":396 + /* "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 @@ -12284,7 +12281,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":413 + /* "constraint/parser.py":398 * * # return the restrictions and used parameters * return compiled_constraints # <<<<<<<<<<<<<< @@ -12296,12 +12293,12 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __pyx_r = __pyx_v_compiled_constraints; goto __pyx_L0; - /* "constraint/parser.py":381 + /* "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 + * ) -> list[tuple[Constraint, list[str], str | None]]: # noqa: E501 */ /* function exit code */ @@ -12327,10 +12324,10 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN return __pyx_r; } -/* "constraint/parser.py":419 +/* "constraint/parser.py":404 * * - * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< + * 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: */ @@ -12375,32 +12372,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { 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, 419, __pyx_L3_error) + 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, 419, __pyx_L3_error) + 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, 419, __pyx_L3_error) + 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, 419, __pyx_L3_error) } + 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, 419, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 404, __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, 419, __pyx_L3_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:; @@ -12411,7 +12408,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __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, 419, __pyx_L1_error) + 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 */ @@ -12451,8 +12448,8 @@ static PyObject *__pyx_pf_10constraint_6parser_4is_or_evals_to_number(CYTHON_UNU int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_or_evals_to_number", 0); - /* "constraint/parser.py":421 - * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: + /* "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') @@ -12467,7 +12464,7 @@ static PyObject *__pyx_pf_10constraint_6parser_4is_or_evals_to_number(CYTHON_UNU __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "constraint/parser.py":423 + /* "constraint/parser.py":408 * try: * # check if it's a number or solvable to a number (e.g. '32*2') * number = eval(s) # <<<<<<<<<<<<<< @@ -12475,15 +12472,15 @@ static PyObject *__pyx_pf_10constraint_6parser_4is_or_evals_to_number(CYTHON_UNU * return number */ __pyx_t_5 = NULL; - __pyx_t_6 = __Pyx_Globals(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 423, __pyx_L3_error) + __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, 423, __pyx_L3_error) + __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, 423, __pyx_L3_error) + 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, 423, __pyx_L3_error) + 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; { @@ -12492,13 +12489,13 @@ static PyObject *__pyx_pf_10constraint_6parser_4is_or_evals_to_number(CYTHON_UNU __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, 423, __pyx_L3_error) + 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":424 + /* "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)) # <<<<<<<<<<<<<< @@ -12518,14 +12515,14 @@ static PyObject *__pyx_pf_10constraint_6parser_4is_or_evals_to_number(CYTHON_UNU __pyx_L9_bool_binop_done:; if (unlikely(!__pyx_t_9)) { __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0); - __PYX_ERR(0, 424, __pyx_L3_error) + __PYX_ERR(0, 409, __pyx_L3_error) } } #else - if ((1)); else __PYX_ERR(0, 424, __pyx_L3_error) + if ((1)); else __PYX_ERR(0, 409, __pyx_L3_error) #endif - /* "constraint/parser.py":425 + /* "constraint/parser.py":410 * number = eval(s) * assert isinstance(number, (int, float)) * return number # <<<<<<<<<<<<<< @@ -12537,8 +12534,8 @@ static PyObject *__pyx_pf_10constraint_6parser_4is_or_evals_to_number(CYTHON_UNU __pyx_r = __pyx_v_number; goto __pyx_L7_try_return; - /* "constraint/parser.py":421 - * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: + /* "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') @@ -12551,7 +12548,7 @@ static PyObject *__pyx_pf_10constraint_6parser_4is_or_evals_to_number(CYTHON_UNU __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/parser.py":426 + /* "constraint/parser.py":411 * assert isinstance(number, (int, float)) * return number * except Exception: # <<<<<<<<<<<<<< @@ -12562,7 +12559,7 @@ static PyObject *__pyx_pf_10constraint_6parser_4is_or_evals_to_number(CYTHON_UNU if (__pyx_t_11) { __Pyx_ErrRestore(0,0,0); - /* "constraint/parser.py":428 + /* "constraint/parser.py":413 * except Exception: * # it's not a solvable subexpression, return None * return None # <<<<<<<<<<<<<< @@ -12575,8 +12572,8 @@ static PyObject *__pyx_pf_10constraint_6parser_4is_or_evals_to_number(CYTHON_UNU } goto __pyx_L5_except_error; - /* "constraint/parser.py":421 - * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: + /* "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') @@ -12602,10 +12599,10 @@ static PyObject *__pyx_pf_10constraint_6parser_4is_or_evals_to_number(CYTHON_UNU goto __pyx_L0; } - /* "constraint/parser.py":419 + /* "constraint/parser.py":404 * * - * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< + * 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: */ @@ -12625,7 +12622,7 @@ static PyObject *__pyx_pf_10constraint_6parser_4is_or_evals_to_number(CYTHON_UNU return __pyx_r; } -/* "constraint/parser.py":431 +/* "constraint/parser.py":416 * * * def extract_operators(expr: str) -> list[str]: # <<<<<<<<<<<<<< @@ -12673,32 +12670,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { 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, 431, __pyx_L3_error) + 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, 431, __pyx_L3_error) + 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, 431, __pyx_L3_error) + 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, 431, __pyx_L3_error) } + 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, 431, __pyx_L3_error) + 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, 431, __pyx_L3_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:; @@ -12709,7 +12706,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __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, 431, __pyx_L1_error) + 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 */ @@ -12749,22 +12746,22 @@ static PyObject *__pyx_pf_10constraint_6parser_6extract_operators(CYTHON_UNUSED __Pyx_RefNannySetupContext("extract_operators", 0); __Pyx_INCREF(__pyx_v_expr); - /* "constraint/parser.py":437 + /* "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, 437, __pyx_L1_error) + __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, 437, __pyx_L1_error) + __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":440 + /* "constraint/parser.py":425 * * # Match ** first to avoid matching * twice * pattern = r""" # <<<<<<<<<<<<<< @@ -12774,21 +12771,21 @@ static PyObject *__pyx_pf_10constraint_6parser_6extract_operators(CYTHON_UNUSED __Pyx_INCREF(__pyx_mstate_global->__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":445 + /* "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, 445, __pyx_L1_error) + __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, 445, __pyx_L1_error) + __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, 445, __pyx_L1_error) + __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, 445, __pyx_L1_error) + __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; @@ -12809,29 +12806,29 @@ static PyObject *__pyx_pf_10constraint_6parser_6extract_operators(CYTHON_UNUSED __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, 445, __pyx_L1_error) + 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":446 + /* "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, 446, __pyx_L5_error) + __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, 446, __pyx_L5_error) + __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, 446, __pyx_L5_error) + __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)) { @@ -12839,7 +12836,7 @@ static PyObject *__pyx_pf_10constraint_6parser_6extract_operators(CYTHON_UNUSED { 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, 446, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 431, __pyx_L5_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -12849,7 +12846,7 @@ static PyObject *__pyx_pf_10constraint_6parser_6extract_operators(CYTHON_UNUSED { 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, 446, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 431, __pyx_L5_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -12860,13 +12857,13 @@ static PyObject *__pyx_pf_10constraint_6parser_6extract_operators(CYTHON_UNUSED #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 446, __pyx_L5_error) + 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, 446, __pyx_L5_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 431, __pyx_L5_error) PyErr_Clear(); } break; @@ -12882,10 +12879,10 @@ static PyObject *__pyx_pf_10constraint_6parser_6extract_operators(CYTHON_UNUSED 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, 446, __pyx_L5_error) + 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, 446, __pyx_L5_error) + 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; @@ -12900,7 +12897,7 @@ static PyObject *__pyx_pf_10constraint_6parser_6extract_operators(CYTHON_UNUSED __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/parser.py":431 + /* "constraint/parser.py":416 * * * def extract_operators(expr: str) -> list[str]: # <<<<<<<<<<<<<< @@ -15566,15 +15563,15 @@ 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, 99, __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, 99, __pyx_L1_error) + __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) #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, 99, __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); @@ -15585,15 +15582,15 @@ 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, 99, __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, 99, __pyx_L1_error) + __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) #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, 99, __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); @@ -15604,15 +15601,15 @@ 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, 110, __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, 110, __pyx_L1_error) + __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) #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, 110, __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); @@ -15623,15 +15620,15 @@ 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, 155, __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, 155, __pyx_L1_error) + __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) #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, 155, __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); @@ -15642,15 +15639,15 @@ 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, 175, __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, 175, __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, 175, __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); @@ -15661,15 +15658,15 @@ 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, 184, __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, 184, __pyx_L1_error) + __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) #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, 184, __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); @@ -15680,15 +15677,15 @@ 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, 185, __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, 185, __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, 185, __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); @@ -15699,15 +15696,15 @@ 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, 190, __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, 190, __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, 190, __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); @@ -15718,15 +15715,15 @@ 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, 282, __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, 282, __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, 282, __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); @@ -15737,15 +15734,15 @@ 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_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, 289, __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, 289, __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_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_genexpr) < (0)) __PYX_ERR(0, 289, __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); @@ -15756,15 +15753,15 @@ 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_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, 313, __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, 313, __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_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_to_equality_constraint) < (0)) __PYX_ERR(0, 313, __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); @@ -15775,15 +15772,15 @@ 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_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, 332, __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, 332, __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, 332, __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); @@ -15794,15 +15791,15 @@ 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_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, 342, __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, 342, __pyx_L1_error) + __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, 342, __pyx_L1_error) + 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); @@ -16119,7 +16116,7 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); * * import re # <<<<<<<<<<<<<< * from types import FunctionType - * from typing import Union, Optional + * */ __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; @@ -16131,7 +16128,7 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); * * import re * from types import FunctionType # <<<<<<<<<<<<<< - * from typing import Union, Optional + * * from constraint.constraints import ( */ { @@ -16151,45 +16148,21 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":5 - * import re - * from types import FunctionType - * from typing import Union, Optional # <<<<<<<<<<<<<< - * from constraint.constraints import ( - * AllDifferentConstraint, -*/ - { - PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Union,__pyx_mstate_global->__pyx_n_u_Optional}; - __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_typing, __pyx_imported_names, 2, 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); - { - PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Union,__pyx_mstate_global->__pyx_n_u_Optional}; - 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, 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/parser.py":6 * from types import FunctionType - * from typing import Union, Optional + * * from constraint.constraints import ( # <<<<<<<<<<<<<< * AllDifferentConstraint, * AllEqualConstraint, */ { - 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_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}; + 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); { - 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_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}; + 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); @@ -16202,7 +16175,7 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); /* "constraint/parser.py":32 * * - * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< + * 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 */ @@ -16210,7 +16183,7 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); __Pyx_GOTREF(__pyx_t_2); 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_Union_Constraint_str) < (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 @@ -16221,19 +16194,19 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); 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":381 + /* "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 + * ) -> list[tuple[Constraint, list[str], str | None]]: # noqa: E501 */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __pyx_L1_error) + __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, 381, __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, 381, __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_U) < (0)) __PYX_ERR(0, 381, __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, 381, __pyx_L1_error) + 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 CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); @@ -16241,49 +16214,49 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); __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, 381, __pyx_L1_error) + 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; - /* "constraint/parser.py":419 + /* "constraint/parser.py":404 * * - * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< + * 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_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 419, __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); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_s, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 419, __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, 419, __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, 419, __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, 419, __pyx_L1_error) + 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":431 + /* "constraint/parser.py":416 * * * 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, 431, __pyx_L1_error) + __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, 431, __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, 431, __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, 431, __pyx_L1_error) + 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 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, 431, __pyx_L1_error) + 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; /* "constraint/parser.py":1 @@ -16333,8 +16306,8 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_compile); if (!__pyx_builtin_compile) __PYX_ERR(0, 402, __pyx_L1_error) - __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_eval); if (!__pyx_builtin_eval) __PYX_ERR(0, 423, __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; @@ -16362,107 +16335,111 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "constraint/parser.py":135 + /* "constraint/parser.py":120 * # e.g. "G == B-M" becomes "G+M == B" * 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__8, __pyx_mstate_global->__pyx_kp_u__9); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 135, __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":146 + /* "constraint/parser.py":131 * # e.g. "G == B/M" becomes "G*M == B" * 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__10, __pyx_mstate_global->__pyx_kp_u__11); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 146, __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":197 + /* "constraint/parser.py":182 * if comparator == "==": * 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, 197, __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]); - /* "constraint/parser.py":199 + /* "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, 199, __pyx_L1_error) + __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":344 + /* "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 * # 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, 344, __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":365 + /* "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, 365, __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":367 + /* "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, 367, __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":381 + /* "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 + * ) -> 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, 381, __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 CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + 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 } @@ -16472,16 +16449,20 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { { PyObject **table = __pyx_mstate->__pyx_slice; for (Py_ssize_t i=0; i<4; ++i) { - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + 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 } @@ -16498,39 +16479,39 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); { - const struct { const unsigned int length: 11; } index[] = {{3},{19},{17},{52},{179},{59},{293},{27},{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},{35},{9},{9},{52},{46},{176},{20},{4},{21},{10},{8},{22},{18},{28},{10},{19},{18},{18},{12},{17},{16},{17},{16},{8},{20},{5},{7},{27},{26},{25},{24},{25},{24},{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},{6},{5},{16},{21},{22},{1},{5},{6},{3},{23},{24},{28},{25},{9},{17},{2},{2},{223},{50},{50},{69},{2},{2},{251},{177},{45},{392},{2},{2},{2},{2},{1757},{2},{2}}; - #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (3196 bytes) */ -const char* const cstring = "(\265/\375`\206\030\225c\000\n\201\320\033;\360\0327\314\300l\000\2222\3101\342\246\001+\244\220\224A>anJ|\310\265;\331\254\355.\321:\235\"e\202$\304EH\022@\t\000\000\001@\021\202K\002QfRT\021B\004\250\001\234\001\265\001*\253\232%*j\246B\256s\214\206l\212r\222x\273\250\rn\241\022'($*\313Ux\224\002uz\350\r\215\314\230\262\300v\263#L\215\226\013\3563E\313\334\310}\345N\201&\343H\3108\"2\352LB\234Dr5\256\366L\023\03705au\325(\334\347^G\030\222Q\310\352\024\335\2218\325t\247S\315\312)7\023\322\252\351\330\206\204\214Rf\253}#GV-\304\211\224\251\001\031\021t\272\235\216\214#\271\335[\201\255.\327r\264wj\251\026\335\251\031\225n\216\236 \354\310\333\247\310\351T\243#\021\311\t\327\022vs\0233-\317S\353j!\272\027\222\223\216\262\211\344vE\242s \"$33Y24345%\010\3438R\233\221\001\031g\310\220\020\021\247\020\223\221\357\"\255\366x\247\312\022\005uPk\352`\216FY\235\344\003\032\245h\220N\327\246\233\335<\036\2123\216\264)\252S\365\246\247\201\277\234^\357\226K\221r=\275\016\225l\336\323:\273\ne\321s\244E\245h\231\252h\253[5Mu\273\371\230n\256\327Qm\307s\357t\004\252\302\221\3273\226\360\275\n\3331E\333\036\n\334\215\362\326\334S\233\035\317T\217*.*$D9Dc\312\356\326D\331\226\217\302\336\336\241\275}\246\252T+\274\031[-\325\216\233\243\343\010m\206\244\215\264\231\031\332\270w\343\331\003\252R\034f\367v(\347\352:\266\252\320^\325\221U[\315\352\325\247\232\343\211\366tU\332\243\323\321\002A\267\310\255\212\275\000b]7\317\323/\000\376\255\333z\353J\024\2138\030\005Nz\370\001\375\347\336\270\263\330L\272|\2502\313|\200\377\350\275\341\002\327o\310\000\233\223\220>\322\321?\312\370\270\016\203{I.d\263\354\255I|\211\206\031k\310\020+\2221\014\310\207\371_\277\351\017\375\n\347o\236\327c\334Y\371\364\237t_\367\363w\344\r\331\346\344\377\336\033\017\210\017\001\233\213p\237%\016\305|2\346\260\206;`\001\330\350EyE(~@7ro.\201\2732L\200\025\365[\360\376|\260\027u\014\330|{y\036\347\227:J\277\260\271\017\261Yw\\\347\350\334\r\016\3650e\030;\000(\350B8\230I\277\0011\337""\270l\260\315\247j\311\252\353\n\344|\003\253\200V*+\325\226\245p]}\351N\325\022\345\225\373D\371\272\003\362\265e\317\335j\336>\333\315\313R\312d\365\346|\003\177h\n,\317\235\352\335\246\272*\270\2436\273Y\266,\253Vu\2452\3215m\317\335[\321\266\007\364\tW^\232\272\267n\266\204\306T{2%\234-\313ss`\311\327V*\ne\333\315y\225\345\261\275\236>\257R\224\307\203\301m\356\340\336\033m\321\315}\352\331\226\224\234m\271\267\211\236)P\345\225|\247\226\373TM^\252\346\2462\365n\233\245o\267h\273\243\312\262\344\033\030\264\206\033\337\301\360q\304\240\227\037\020\273p|\216x \376\301-\260\003\t\313`\233\3067\3508\256~Sv\376c\366g\r\246OQ\210\025\003`\211\243>\3534\267eV\351\026\2609G\364\211`>L\307\267y\016\230\201\356\031\004\305\333L\006\347\274\004\257Q\014\202x$s\3102\231%\216\241}]\224\305\001\261\360Uy\311\367\364\0371\020V\201\333\327c\342\3275\334\210\027\000\013HGr\r\210\026b\030\274\362\372\272\306\013\000\245+\303o\274\000f\000\r]\004\263\255_h\231)\236\361\370\036\000\277\030K\230\003\336\025_\353\262\231+\203\025_\004E\214\235\376\032\352C\345~n\344\333\336\247~\353!\256\203\354\2031\024$\024fR\326\301\027/\353\r\374\210\223\243\342\216\253\367\307\333|\226\033\313\300\276\250\236\321 \213_0>\206\367\2718\027\346\346KWa\010#\210u\357\355\035\251\370\026/\200\210\256\202\327\354!\233\0034\261\2008\025\373\3006\270&\025\365\315o:}\247\246\337\224\363o\362\203\314\306\0211\013L\356h\263Y\211\210BL\222_\362.N\211\311X \336\301\005\360\3575\271\370\267~\341I\317\273\356\020\375\300m(\202<\3749\212\367yK\177I\351+\025}N\324D&\031E\336qG|\3028x\006\007\3008\257\355M\332\360\033/\320Gx\226N\366\212XQ\326 {i~\243a\266\275\003\257\2047{\007\303\3160F\306[\257\t\301\307\2718\370\327=\372\351\246\270I\303\333\3206L \230\311W\340\375\360\024=\240\303\334\035B\227\0362\274p\376\025\277\376\3638\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\300\002b8\300\354zJwa\210I\340\007&\367\346B\014\364\t\205\231\354\026\262n\2721\256\303>\377\231\364c\210\t\262D|\000O\371\016\257\323\201n\323\320\326\023\\\331L\201\342&\277\304\346\014]y!\266\362-\226\021\312*\262\003\216C\034\020qd\233\\\303\021}#b\217L\300\004\337`\025\212\032\361\224qrOl\213c\310y\324\340DT\356\220\005d!\313\305L1\201\345J\314`>\207\213`\016\030E\342\313j@~CQ\346\033\r\300'\020\3745\231\375\"\321\377\021#\210=\266\037p\003\211\3156\330\005\344\025\371\271\023\262[\274\021\013\275ZR\256\215;/\375\034\361F\004*\371\270\367b\312\2150\0338\276@\237\210\025\315\335\337\341\376\021\361E\224\220\017b\034\230W\361\352\251\301`]6\035XE\343k\304\002<\336\214\237\361\352\267$6{t\020\367AA)\351W\305\310\244l\343\3613<9\303\275\034G$\025\014\322\354\025|\031\3748\273\331*\356C\313B\3741\371&\305\221\"\016\346\203\300(\260R\214\022\307\374`}b\361\037\315R\234\007C\266\367cU\222\001Z\001\277\207A\305\230\202#z\000\025|\364\257d\r}\024-\347\372\245\356\352Y\343\026\213\\\013\200\024\205p\216\203\336D\300(\345\177\3200\257nV[\2555\005\255\316d}+\272$\207!\027\365H\003\201\372\224?[u.\2331\353b\006k \352A\021\241\342J\256\224\335\362\336H\337,\304\224\242\354\212 \243\233\215\305\371\311BU\264\213\016m\306\025\253\365\376\220\n\223\320\3623\242R#\314E'=\2445\373\017\303\361@!:\255\364\321q\204\255\220\n\31530\364\255\223?m>\342\234\322\302*\231\027\326\326\rNmx\265m`u\n\034\251\230S\251\000H\007\231C\265\222\245\276\3323\226\353\007\262\253^5;7R #\312\254\263\310\022\005e\365\214'\203\327\314)\355\227\261\024c\215\337%\346\017\365\217`\251\202\021\022\365l`\334A~V\255\276\030\263pR\310g\r\222\336\255Co\330\305\355\323\265[\245A\241\340\205\265j\t-)\306\312\313\263;\224nS\032^\271\213\021\341\240\337C\260\331W*I\237\231\200y\374\233\241=\345\267\014\353\222jQ\220|\345n$y\247\234\0225d,\323H\2026-p \364>I\362I""\272\317}\021\020T\200C\315X\257o\246w\236D\205W[ \344p\201\245\263re\344X\230\257\372x\252\003;\264?\316\271a\337\323\224$x\357\201x\321\021\373\323Od\260wV!\325\316bIw\205gc\333%A\303<%\207\177\036\001p\371L\357\323\373VTh\371\347\315\023\022~$\266\202\371g-\221\336\221\004K\177lp;\373\300\373_` 9\3714\2471=\342\323\271({\372\237]s\333\3562+\373\226H\014L\244]\225\327\004M\230\024gX\020C\233(a\224\004\0029\325`\362\343r\302\340\273*NJ\002\005\241\3029\376\213#\006\350\302\264\307\r\267\020\272\022V-\"\252\271\\W#\265\004zaXp\203\034\225B}uW\007\326@\322eCnlSi\004\022\314\343\325\203|B\016\003\373\301\344\177\323\234\300\005\202C\307\263U\262Y\214p_\236\372A@\353\235;Z\000\246\025K\036'\037\244qE}\031\234\375K\233y\370\253\030\370\031s\244\204./\3177\320^\230\210G\362\366\221\230\257\310Yz\301*8k\341\201u\366i3\266\214\365K\220\326\206\201\031\005.\356\026\370\222.\241TN\220\231\241x\342\351In\255)\000\241\246\236q\321\215\360\260\034\023p\023\341\215\335\253O\342l\335\273\320\317\340\375\275\037\376n\241\027\354\327b'\2012\\ \r\350\021\302\022\224\001\306\330\032iA]\013q{\305\300K\374\202\261\022\023Z~\222H\022C\334\034\001"; - PyObject *data = __Pyx_DecompressString(cstring, 3196, 3); + 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},{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 (3170 bytes) */ +const char* const cstring = "(\265/\375`U\030\305b\000\372\200\304\033:\340\032=0\314\363D\204\201k1\236\347y\236\347y>\256\205k1\233'\\\311+\270\302\312\262\032\341\207\333\\\365J\364\013\364Bv\201\276\205\332G\321\024\252\225\036\252\207\333\021\001\250\001\235\001\264\001QeY\266\374UY\325,QQ3\005\266;\307h\310\246('i\307\213\334\037\027*q~@\242\262\\\201G\351\253\303Cohd\304\224}]\316\21205\032\356\307\317\024-qb\333+y\372\232\210#!\342\210\210\2303\tq\022\301\325Z\225g\232\364\336\324\204\335U\"\220\237|\025aHD \273STG\342T\313\235N5+'\334L\210\253\246\242\033\022\"J\231\356\356\211\034Y\265\020\247Q\246\006DD\310\345r#\342\010\216\363\326\327\315\341\334\026\345\235[dQ\236n\225\2673\243R\336\242'\010+\356\370)r:\325\344HDp\300\265\204\345\255\211\231\226\347\271s\265\220\334\013\311IG\331Dr\273\"\3318\020\021\222\231\231,\031\232\031\232\232\022\004Q\034\251\315\310\200\2103cH\210\210S\210\t/*\341-o\353\360*\224EO\221\026\225\242e\252\242\356v\3254\335.o\305\224\267{\025UW<9O\305W\005\212\273\036\261\244\345+\320\025S\324\345\241\257N\334\251b\313\333v\363L\335\333\212\255k\362)\316\212g\272E\025\027\025\022\242\034\"1e\271k\242\"\220\307u(\217\237\251*\345\002oDwK\271\"\027[T\034\241\315\2144\22163C\023\271N\375\247\334\317\375\374\035z\203\2669\371\276\370\306\003\342C\300\352\"\362\263\302\241\230?\316\255\274\345\016Y@6\212Qb\021\212\037\320\215\340\033L\000\257\004\023`\303\035\027\304>\377\353E\035\003V\337\342\235'\375RG\351\0276\370!V\357Nv\216\336\302""\277\340\016\246\004c\007\000\005]\010\007\365\3507 \352\033\227M\266\371T-Yu]\337\266\345oU\372Z\251\254\224[\226\300u\355\245)\014z\371\001\263\013\307\347\230\007f\237\334\";\214\262L\266i|\203\216\003\3578E\347?f\177\326`\372\024\205\3300@\2268\352\263N\203[j\225n\001\253qD\237\010\346\303t|\233\347\200\031\354\236A0\274\315drNL\020\033\305 \204G4\007-\243Y\346\030\332\337C\331\0340\003c\225x\214O\3771\277\262\212\354\306\036\023\276\256\001G\274\000X@:\022\\\300.\3140y%\356u\215\027\000JW\206\337x\001\314\000\032\272\010j[\277\3304\323<\343\361=\000\3760\226P\007\304+\276\326e3X\006\033\276\010\206\030\272\3757\324\207\302}\334\310\267\305O\375\326C`\007\272'c(H(\324#\235\223/b\326\033x\221\244\243\346\216\253\370\307\333|\026<\313\310\275\250\236\321 \233_0>\206\357\301$\014s\363%\254\020\204\021\324>\341\320\234\213o\361H\305\267x\001Dt\025\274j\017Y\035\260\205\005\302\251\331G\266\3115\251\250o~\323\351;5\375\246\234\177\243\037hv\216\230Y\344QG\233\325JB\024a\022\375\242us\312<\316\002\263N.\220}\261\311\305\277\365\013?\372\266\357\016\321\017\340\206!\310\303\257\243v\177\267\364\227\224\276R\321o\205[\310D\243\320|\356\230O\231\224gr\200\214\023\333\342\244\r\277\021\277>\302\263\364\261W\304\206\262\006YL\363\033\r\265-\036\210%\274\331;\030v\202\261q\336\212M\010>\t\223\262\257{\364\023N\201\223\202\267\240-\230@P\217\261@\374\341)z@\207\301:\204\256\035\014\276\356\363\344\370\207P\345\027\372B-\377gH2\364\207\\>n6\345\230\025\210\331C\205\254\006""\276\324\330\344QF\301\370>\337'\345'`\275\030\0160\272\236\322]\030f\022\371\201\t\276\301\020\003}B\241\036\273\205\254\233p\014\354\300\317\177&\375\030a\002-1\037\310S\276\303\353\364\027n\n\332z\002,\233)P\334\350\227\331\234\241+/B\227\276\3152@Z\205v [\210\003!\016m\243k$\3217\022\366\320\004L\362MV\241\250\tO\232\244{f\333\0343\326\242F+D\351\016Z\200\006\262\\\324\024\023X\260\304\014\346\267r\221\314!\243H|Y\r\310o\030\312|\243\001\371\004\242\215Mf\177H\364}\302\010a\217\355\007\334@b\265Mv\001\211E|\360\204\3546o\314B\261\226\024l\003\327K\037'\274\t\201J>\031_L\301\021f\003\307\027\350\023\261\241\251\373:\362\037\t_B\t\372`\306\221w\025\257\236\032\014\326e\323\221U4\276F,\300#\316\370\031\361\216Kb\265G\007\201\037\024\224\222~U\014=\3226\036?\303\21732\3468\032\251`\220f\257_\314\340\305\331\rW\201\037\\\026\341\217\3117\031\216\014I\230\017\"\243\310J3\312\0343\340\223\367\211\305\177\360\243\315,#\362G\025\357\340\331\256QW\374\212\020\212_\341]:\207\245\202\014>Oz\016\277\301\360\367\274\340\021\267~{\251n\323/b\210\230\305'\365*x\303\021\2601\306\332\230\211E\010\3768\217~\224\307x\303\267\034\031}\226O\312/\027\357\007\274\230\360\215\212~\021\315'\347\031Z\202\200\250\022\273\214%\231S$2\"\222$)\244\003\"\030\014\020\215\306i*l\037\262\332\230E\306(cFDDDD\002\021IA\312((\2445x89\310\200\013E@\301\350OHb,\023\034\014\210O\313\002\\N\214B\301-\004P5\242U\314\225\0252\276\227 \301\253\247\001\213U\223\264\331z\016?a\2208\356]9\325\305Kpk\000\205\235h\321T\324\332\370\340#\371\325\335\206\356%\240\347>\272\247@\227\236\271k\344\2377\246\372(B!X\306\016\364\200%\305\263\022v\306\335\225z\276|c\014\200~L\324\276yo2gI\306\014\r\355\032\240\300\013\241\325%PE\025&\036\351`Q\263]\177\t\352\242\236\361\3545\224A\370m\265i\244\253\036\261\246k\366\200\276\310\251\272\313\245\3208m\233\201\270L\330\326b\007t\230\326\337\220\362\214s\360\327V_\036\336\235\277c\222uC\374\300\241\n\t\335D\207E\265E\311\020P\233/n\223\027\312\277\264\263]\216\343F\036#\020""\342\223\303I\214\307\242\007\033\206\352\331\222~,k\214\004\311\355\230w\3436\254)\242J\225\305\321N\0079\256\t\245\262g\370\003\265\024\335\336\354\350\273\364\225Ll\2308o\213\266\371\354+\030w\234^\263y0\345\326\002b\000;U\213\327\344\3076\330;M\240Ru\262\347\006v%\031\237\010\032F\277\201\246\232\217\2401\260\237\313HA\273\321Y\233\"\277tJ\364\002|\364\347\271\306\325\227{2\232\247\333h,\336\254\233\2501kO!mWXD\267\214 \021\314_D\333\016\271\307\307}\241G(\r+\333\275\252F\306Ci5\256&\373\377\022\\@\354\234\016k\204\262\027\353\375\202\304\367`\356*>\344'w3\332\237\010ET@\234\222\007I\315\301\030*\235\0361v\036F\356\343Q\240\267\247[\223)\346\316\020s\203:Wo\000\350\331\227K\302_\377l\243tXk\007}Jb\211\002\351\212'h\327\254\241\276\200\224\243\nf\322U.(F6H\246\343s%Rh\327\276_O\224-y\303\0274\347\211\222\242\203\2230\267\373\226\177=\002M\203Q\231\224\340pZ\3143ZbH\324\334\217L\236}\3552\362)\240ak\024[\265\004\226\331T\330)\332{\\\372\r\353\2768\226\377\220\237\017\236\341j\373\306q\344n\266q\336\336\005'1FE0\000\237\342a\022\312Oj9\324O!\253\001\217\013Z\344%\200\326)\224|\273\275\345@\031\312\370\"\000W%\313\210\254\201\202\372\316$\337\212U\222\224\311\221\375' \240:\255\317\346\316q}lx\230\301\336\177\005S\344)\302\237\303\302\005\336\333\203\232\031L?\227\004\010ht\023Xp<\031\356G\233\350\210f\\\261Z\257\021\251 \363 \3314\017\304\177\273h\242 n\325\200\275\225z\037\274\036(\177h1\363i\246CJ\350C\207H\016\211\300\2201D;\244\204\212\026\216\320\017\003\034\271E\362\246\t%.\247[p+\357\302L\267\211\3244\257\277?\246\257@X%\231\352\007\242u\310\034\251[\002u\353<\003\256\337(N\325\377\263z\323\203q\242\243-\007A\"_;\362\274\026\370\202\234V\364\220\226JB\223_\214\370 \250\021\364\256\200s\242\237\025J\247\231\037\020\247\217\216YL\251\240Y\n\244]\004B\020v\325\235\322\272\372zB\211\345E\265\265\202\206ru5g\351\035\252\341)\t\257\276\333x\030\220\271\020\374\361\365%cj\3721\201\314f(\232\0345S])\353)2hQA\220\201\247|\005\321E\215_>\007*\235@.b\364K\226\032\245%,""v\376.=e\207>5-\033\356q\003\263\222E\232k\361\262\354\224\3273T\372o\337\244\222\3709\242C \264\266\277\276\277\241T\034d\032\302I\303\022\366\357\307H\235\024\213hR\307\014\224\030j!DV\304\341$\342\202s\266DM=\002M1\034\236Ve""\200\314\2140\3271m\257\234\307\002\200\262/J\212\302y;\377\010\235\026y)\253\234\021\205d`\023\226\303\217QGz\361\351e\352\245;\\\\z\315S\227\262\331\246\363ND\022\271\214\222\r\352\370{\220\264\363\215\014sGb\355\206\336\35540\300\206\231\313~\372\223\262\265\027\251!\314T\270\327\360].}\025\342\370\335\014\331\272$\\\343ON\313x\342j`\310\231\325\226\312\n{\213\365<\236\221\241\360\245{\311\r^\016\365j\267+\001\314\267\223'+\340A\240`<\026\271q\310\2358\010px|2\3602\253\226\222c4\214j\3132h\354\264\014\321\320\246\322!\300\257\220\325\224\350JR\231\023\242\321E\205\223\273;\n\322nK\272i\346\366lE\370s2\003\020\303,J\372\3340\220DG\235\254\321\236v\204!\315\031\335\251\\\366\034\264z\021\3371\260\327\307\275m\241\365h\0333>\010\352,\233%\361\304\300\346}!b \034\035\270v\314\275\233\255\365PLL[L\233\306\232\272-\027Z\007\243\275\1771\004\2027n\3369\036\225\313\276i\032\3437+\247\001\205z\211p\032[\215\254\327J\021G\363\035\3517\207\262p\236s\373m\262[Gc\213\037;\271\347\244$\222YI\313\230\363\234;\244\222J\023\322\342\346lL\031\003\231\200\231\006L\247\007\347\370\361*r)\261\206f\2029\234TG5\016\037\246\262e\351\274\240\233\342\032\376mF\274k\005\255\206f33u'9\357I\272\207VR\027\220\352\362M\357\2423!\257\220\355\263332\324t\245\003CX\342kM)D7Y\251M\352\312\0162\2638\302\326S\0067\305-:Jd\366p@\257\007\300\233\247\271\327D\353\316\211\2040Ufffh%Ii\033\213o\3422\242D\t\354)0\2529;\207|\352aJ=\355\260\315\202\263\223\322E\372\024\263\022\255K\257Z\315vf\313\273\255\370\001Bb\3255\346\332\3311z\240\261\240\260\344+\301q\243V\330\336\211\326\276\365\"\321\225{7\261\2276p\257\276\257C\247;\273i;/\274\351\327\311\314MkY\033wD\262\256D\304\220\252\304\311z]\246\361\004\3046\265\365\001r\317\004\206\335\300\310\310\272\023#\232\317\222\312\235\304\312V\271\263\267\223\202J\312\3679&q\367Y02\210l\252\246\375]\266\311\351cK\017\241-\357=\237\304\321\312>:\221l\355{\tx\351\241\312I\360\341\252,s\013\000e\223\366\031\2739\330F9c\010\352\330=\033\275\271&$\254\343\014\304;X\231\2250{\224\317\272:\223\264\365\265?o\247\302\031\"E\314\212&\236\313\211\274\323\256\223\250ha\337}o\206\301\202\372\341\251\016)~\204\033\232\002\357\201Z\261\322]\230\366ODL\177\253&9\264Z\226\366k\027p\340\213\266\365\267LzQ\357\036\357mV\265\265\207o\246z\365\211'|\217\247\305WH\253\337\"\322\331\364\212\\(\266\332J\203\371\373\214\207\250\374\3234\244\372`y\375\2020{\212\346\362~\3478d&\305\325[%g\343\342\342\252\342\3115\305g:\361_z\0100r\035\013B \347\333\034\356\222I\346f\241b3\260\213UVh\345\326hF\227S \264\245\017r\251C\336\231\324\372\210\260\302\322ki-\005U\213Np\354\332\3321|4]\220\231\2010\236\345\254\327y\260\"\225\226\341\367\t$\325Md\220\035\366\363e\224\257\013dI\312\245s\326\014\341\\g\271\262\311KO\347\337\225\013)\241As\342i\325\234lr\255s\212\271\250\373\315\262\304\224\362\337\033\276\336\250\352io\374]\311\024\341B@\017\177s\310"; - PyObject *data = __Pyx_DecompressString(cstring, 3276, 2); + #elif (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (3246 bytes) */ +const char* const cstring = "BZh91AY&SY\021z\037\314\000\002\016\177\377\377\377\377\377\377\377\377\377\277\377\377\377\377\377\377\377@@@@@@@@@@@@@\000@\000`\014=\337\003\326\367w\260\357\033\225\266\273;\303=-A\241\273\234\323v\033\300\000\016\363\330J\021!\006\205\017\324d\233S\311\247\24044\311<\023JzO&\230Li\251\352b\036\212dy\251\r\250\3614#d\310\311\246\232'\251\240\320\211\246\002h\020)\2645M=\t\344\312\001\264\010\320\006A\240\000\000h\000\014\206OH\006\200\006\210\302\232\023CS\"d4d\032\r\006\324\000\000\006\200\000\000\000\000\000\000\0004\tM\020\232M52\247\342\236I\264\210\311\270\260 \2645*t\030\344\311\264\357\326d\222I%\302\305S6?\320\016%\013o\220\355\005A\303\256)\224k\210\223\010s\210\354\352\210:\370\360\267v\270\303\225\002\337\344\032r\372\350[\026\333<\245\352\224\362r\262\334\013`d\2669\rK9\330\363\312w0wW-\366\321G\2725\337\027%\033\261\351\025;\354\215\247\257\201\325\374\0162\351\276\354K\373Z\026\325\270\214\026\n3]EW\177^\"#\005]\251\202\002\321:\025]\256y\027\212\302\347\2241\005\237E\\!M\020\202d\t\022 p\202\022\022@\177\025L(\202H\034\032\001\306G\334\255\001\262\035""\033\224\roB\361\207\310hX\336\343\020\261@9\237\217H\021\356\356\010\010\027\3545\246\2134\303r\024\275fMP\013^F\303\332n\374\312\256\320\202~\000Q\023dD\247\013#\241J\3169\n\3710E\036\037\020\036hr\351=\371\326\272\327\235\330\251\nh\361\252\247'Tb@<-\324T\365p9o\321\320\310i#\370\204*$\253\2775\371`\272k[\255\013\220\242\214J\007\305=Q\265}h\262\316\037\010M\275\271we\2760\277\016\371\301V&\364P\036r\242a\360\201\205U\332\366@\303\266\235\001\2438k\234L\273\025\267\002O=\000\312 K)\220A&1|\2540\254\026c\030\253\274UlD&\337u\333:\257\332{\317\211$\251b\301\002\276%\tz\025\362\3614].\3359\311Ma\033^\324\220f\340\311H\312\254I\221\231\333o\030IB\256\246x.!\341\214\3337\03086\242`\363\326\362\326S\274\230j\335J\332\370W%\356\037#\222O\277A\222\343\014\210\312\252of\353\266\027V\376@}I\017\334\255\346;\270gF|Z\325}d\214\004\313\346#\370\256\325\026\320\272\270\031c\344\231\032\331WF\001R\350\354\3247v\177(\345\345\356Qv^\035\273\314j7=\352\007\347h\244\274\355<\377\353\353\317\020\215\033\251\032q\235\254\342W\314\227j\235\203.\356\337\355\2005K\230\026\355H\221O\301\010{\031b\357\001J\221\325]kJ\306\355v\007\331\205hU,\013:\324\213h\220\342\353\276\307\254>\364\370\017\321\253J\302\302%\236q\352\323#\236\002\323;\21770\315\360\021g\353z\005>\345\026\3071P\203\271\260\310zO\334\310'\300\227\033\236\261\0309\nf\332o\2370\301M[\\\332\305(;\027\327\312\267\3165\005g;A\324\266d\330\334S<\027\005T\230\353)ksQ\"p\010\254 \223\236xe\331G\302J\222\301\310\251h\231\212Y\2130c\310\036AA\244NP4\006f\362\214]\225p\025\351j+\235HDP\"\004r\322\222\316\303\024\021\213\"\335\317@$\232\251\255$\342>}\352\250\263r\332\024\206\023\215\016\310Dq8g\205\367\262\270\376\376P\221[3\260xp\321\247\nq?\365v\034\357\006\031\302\252\225\0041\350\262/fM\201)U\377\213\271\"\234(H\010\275\017\346\000"; + PyObject *data = __Pyx_DecompressString(cstring, 3246, 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 (3177 bytes) */ -const char* const cstring = "x\332\305WK{\323H\026M \001\003N'&\016\341\021@\316\203\274\023\034B\200<\3403\001\272i\246!NBx8n\265l\225\023\201-\331\222\234\216\351\236\371f\351\245\226Zj\251\245\226Zj\351e-\275\364O\340'\314\275%\333q^\014\314f\302g\251TU\367\326\255{\3179U\214&\223/\345=!+\211\\Z\311\345\005U\320\025\225kt)y\342w\274Vt.\257h\232\224\312\222\305\326\231\332\256R\314\212\\\212p\243++\243\034\364\214FVF\2478IC\033\302\351\273\202\316\255\226\364]E\306>\221d\245\024\372$\331\022\247\351\252\224\326\211\212\223dn\355\371\332\364\374\303yN\220EN%\237HZ\3278\255\230Jg\005M#\032\247d\270TQ\312\352\222\314\351\245<\321f\270\227\031\256\244\0249\231\020\221\323\025.\017\363Z\r\364]\"s\032\321\261\301\215\n\262\254\350\202.)2\017\346\222\2743\312\211\222\n\213H{\004\255_\010Y\215\314\274\311\343\014!\233x+\303;\021\313f\237\027\212BvU\221!VA\222\365)\016\372\236I\231\014Q\211\254\037\364'\223GL\177\223\344\215b\256\325pKP%\001\322w|\344\371\276\220\326O\231}\322\330o\302\376i\276\217\215\300jk\252\"\236\022\310\321!\266\332i\363O\034\204\025O\365\177t\350X\222\330\364LV\021`h\235\370p\200\376\246\007\215\233\235\330\366\377MNLDV\270\261\345\225\361)\216\2738\363\344\361\312\343\345\277WV\246'\307\022\302\364\227\330\364G~\370\356\364\243\344\304\370\301w\362\310\210 \212\274\214\230D\204\245\233Q\315\002\2245\242\316\344K\211\311\351\344\223mqR$\031N\035\023%\rc 2>w\322\210^\231H\000&\225\023\030t\345\035\204\373\301\366`\206?Y\314J\232\236\200\336$k\350\305|\226$Z3\324\034\237\342\374D@{\n\370\"\223d\262\325\306\037l\265\364\215\232\366\311\344E\256\3767\366d9\262=1\216\311\362;\376\206\337\020\227\023\364\364.71\001\344\3219\330=4'ZmV\022\333\177\216o\213\311\361\355\351\246MJ\222\005\265\304M/ry`\010\021\201_\251\022\267'\250\263r1\007\354\235Mg\025\r\267?\336\364\224\230\334\236\230Mr\207\377\032\253ONq\023S\334\254?\031c@\016\027e\302\243\210\3444\016\323\3507\023\376\213\227d\221\354'F\307\027A\t\364\242*s\313~\302\037\237\314\276\343<]\005\205\222\262X\214\027E\231\201\252u\254""\321:\001\321\307\371v\334A\243g\023t\350\030\310\217R\360\030\313\216\362\277\301\t\236_+\355\303\357\031\220\200\177M\366\365u\222a\000\330z\276\376\364\315\306\363o\320\360t\2618\225\213\247)\306\251\342p\232|\tZINK\312LZQ\225\"\2503\321x\236I0\277CtI'9\374\204n\250)\017\026i\222\022\322\237\021@$\255\360\214\205ZZ\021\t\257\244P\362\017N\226\203\226\326\322\3443JQ\026[;\000*R\232\2609R\226\324_\274^\367\315Bl\014\212\207\373\032\315\203\326\314\211\3433\276@\264\214\301\212\272\250\344\240\r\214\027\tBO\322%R\217\216\300\331I\366\2018\373@\237}\334\263\3167\016R-\003\334\312J_\016\305\002}\242\220\315\342\013\022\246fT%\367\231\224 \217\031\000\232\377\334!2\272\333\201\034\347%\306\016H\351\221uyI\343\233U\200\266\242\362\030\212\206\311\360\211\213\345\320\3005z\317\222\214\216?\034bo\225\340\206D\242\262/\355O!\017\245\303.|\002\215\353\025bm,rN\021\213\220i\370\223\205\034\274!@\035\177\274\246+y\177=E\311d\340\004nl\276\231\204f\303\017\374\340\023\227>\370R\245\235]=\317$\301\327\205\272:\0245\"\2664y\224CV#\330C\363\020\321\216\367\314,g\2254$\344\361L=\235\337\232\242\222|\026\320\3127W\376\316\231\274\226\207\242|k>\224\243^\272R\013\010~(\270\223]\374\027\213\\\021nOp\254|w\226|\334\000l\322\337\212\363G\003\377\016\227?\354\201\031\210\255\026\307{`\253:\260K\316K\351\317\354d\310+y \350\036\303+\317c:} \253*\034/;d\277\016\373\275\272\360\235\324\207\034cQ\010\262^\207\301a4\234\204\r\210\251%\254\326\010[\333\240\232D\220\211xR\037_\224\245B\221\034\032\362\273\032r\350\037\233\214@\354\2019\363\033M\232\373\237\310s\270.\013jz\027\265\214\347\201\257uBC\013nB\002\240\206\205\315\036\207\022\312zt\"\302\366U\035\272q$\0177p\364\231\207(5\tt=#A?\217\n\014\327\033\031\246\347\362\360\225/\361\274\016\256\340\271\253*\177\236\214\347\3230{\"\004Z.\024\354\377\007\376-\277\210\007h=5Ma9\372\315d\347X'\313\317\036\010h\221\260\207\006E?\250\373!\333\023\272}\353F\277V\314\347\025\025Ru0\2439vt\341\306\300A\203\207\377\264\3402V\324\211\376;V\355\033\264""\"\325\013\027\277\236k\273\020,\337+\013\345}C3\207\314\270)T\203\275F\024\373\007\3149\363\275\025\2672v\254\032\270i\256\233\373V\301>g\013\265\300\245\362}\243\303\210\031\033f;\2756i\317\331\033\316\031g\330\021\034\315\215\320\2457\025\225\306\327\231\233j\240\217\366\2150\037\253v\201\336}\352\rz?\323WI\232\374\235\376\316\343\"ac\311\314X1+\216^1\216/f\257\271j\026\254\000\035[t#\265`w\371/\214\253\332\323O\373\307\355P54\200\303\354s\332\216\343*\213f\234\336\332\244\233o\351\333\255j\240\273\\\200\355\005~*g\315;V\273\025\252\202\337\371\262fD\252\301\260\261j\024\314v\260\241\275\030\365\2263\347\304k\030\347\277c\265o[\364\033\272\0315clS\314\202\266\r\230\277X\261\257\301\266\316 \314\3363\326\215}\210\272\323\212\303\256:\273\313\302\327\213\370J\031\001\263\335\274f\335\261\317\330\221j\307\245r\264\034+o\031\367\014\321\0341\013N\334\210\323\216Y\373_.l?\202+\007\313?\343\002\335\254\034\303f\332\352\267\317\332\321j\317\2405j\207\300CO\250\026\274nF\314\005\353\212U\204\272\004\007\255A\310\336\226\035\265\2379\355N\330\211;\242;\354\022o\316\373P\021*\032]\177G\337\275\247\35734\263S\005\267\260+\332;\206>k\207|\366\030\027\314>S05+b\301r\003\260\325\236\001:0k\027\234sN\312=\343F\334{n\312\353\364\266*s\225w\220k\260\252\206G\031 RP\374\210\263\340^qU\257\327\213\321\347\037\351\307m\272\235\246i\\\225\356\3546\226\032w\242\316\257\356\247\312\271\212\340\327\251\275\032\032\301\330\253\235\347\276^i\353\274A\257O\3311;\351B\246X1;\002\345.\203\267bX\221E#n\344,\226\033\250\376Mz\363\221\033\002|\364\3342w\000_9g\331EP\030\177[Q\353\225\375\005\306\206\335\035/\316f\342.\240\206\234u\336R\355\001'\351E\252]\375P\327.@]\275\367\246\223\363\300\367ec\302\214\231\277\333Q:\225\240\t\330\304\037\364\017\201\n)\254i\260\014E\277\211\214\250ut\326\002!#\014\021\261\215|1C\346\270u\337ng\273\252^\n\326\360M\333F\350\310\212\373\301\023\320z\300\214V; _`\373\265\247\r\366\033n\353\034\264na\351\277\316\265u\3366s\366}'\340\376\004\263\327\316\30380\307xk""\216\371$]h\353\274b\000Dn\003\302\332\255\253\220\312\021[w\346\235\242\013\251\271c\211v\304\236\267Kn\273\033\252\301\247@G\227\334\005/\344\ry\233\225>\3145n6\0100\331\260;\354\347N\010\343\t#\005\242v\254\326q\013(\017\211>\017\221\007\206\240\370\214\352 \023tx\221.\256\3215`\026\0244Q\r\3340\347q\375*\206\201\025y`\214\232as\023\342\351w\332k\301.Di\304\272g\245\201\245=a\032\276c\245\000h\367l\001\276\214g\346yz;\352\204\234H\313\327e\007`\010Yz\340\024\334\263.\344\177\210\016=t\333\351\243\337*\300\354n\332=l\255B\312zF\351\350\212\033\247\217\327\351\372\006\254L/q\326Y\204\302\220\365\220\001\277\323\211\323\005\034\244\033\233\030\347\003k\020\242\007t \341\354\210\023\261\" L\035\223\366\nK\360p\253\346\r\202\234\374\005,`\314\016\\1\004c\317\334\262\026\354>\210;0`>5w-\301\322 \341\005\347'W\250\253\024\355\036\264\206\254\370\201\306A\326\255\002\352Ywy\327 \346C\213)\350uzm\002j\003S\256\323\353,\335\325\206\375mS\265.[\363\3409B'\227\335\247\340\332w\306\266\206\220\217X\275\250\213\260\037z\343.\260Pp\nMk6\206\210>\213uZr\347\\\210\005%\355\235\003\304\235s\306\350b\0344\270\2069\234B\351\255\0015\3401Kg_U\026`\004\023\tL\322A\211\240<\275\306<\214B\301\010\304\270\312\330\022\346\254n{\037\352\322\t\256\303\276\312\274\205\275,\202\302|\006lE`\177\260\353M\300\342\220\035\207\\\205#\200\346\303\006t\344\251\027\361\226@\207\366\200\315t\353\335\377aI\260\351\3525\306@m\341\364\252\006A\rfl\301\206\326-z\253\256\013\014d@\336\340\010\020\244\035\300\033\274Mo\317;/@\363\242_\003pD\241bb\177\000@=\316$\023t\372%\234~\235\200\376\353\200\360\214\363\314\275\340\365W:+\2334\016\302\221\242\251t-\210\005\007\266\325\202W\3153\310d:\004\222\205\361\364\240\014\303\271\227\006\305\307\272\300\202x\242]1>\001\273\007\3548\235\371G%VI\320\367xNV\221X\200\014\343\251\261\013\002\375O\373\265;\350\306\300M\350\252\201\210\353\232\264\307\200T\260\332C'Z\r\216\001\305cp\036\267\323\350\313\312\225J\201\256!)@\260ku?4L\371?NZ\343\330\244\232/\0254\202\034\210\263K\207U0\013\377\001]{(_"; - PyObject *data = __Pyx_DecompressString(cstring, 3177, 1); + #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (3151 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\202dA+\312)I\231I)\252R\000l \032\3173\000\340w\211.\351$\213\237@\2064\362 \221\"I!\365\001k\206\244\024\236\265\237\226RD\302+I\004\234C\\;\\iMK>\255\024d\261\231\000\325!\245\010\333#eH\355\305\3535\335\314\305:S24\361\300\242.*YXCc\213\004\253M\322%R\363\216\300|#\007\320+\007\3201\007xf\235\257\017;-\r\355\224\221>\036\361\005h\242\220\311\340\013\002\246\246U%\373\201\024!\216i\250-\377\271KdT\267\0131\316I\254! \244_\331\345%\215od\001\326\212\312\243+\032\006\303\357UL\207\006\252Q{\206\244u\374!\213\275U\202\007\022\211\312\276\264\277\204\034\244\016I\370\204\316\255e\210\2551\311YE,@\244\341O\026\262\360\006\007u\374\361\232\256\344|{\212\222N\003\376\327\017\337\010Bc\341;~\370\211\246\017\277TiwO\3171\024\360\241\240\006\010\005\215\210MK\036\021\220\345\010\316\320\230\036\332q\312\314rFIA@\036\314\324\302\371\255-*\311e\240Z\371\206\345\357\334\311k9H\312\267\366C:j\251+6\025\301\0179\327Z\305\177\221\310\026`v\303\014\371\356(\371u\003e\223\372\226\237?\352\370w\250\374a\rL@l\2268N\201\243\352\320]rNJ}`\303 \247\344\240A\367Y\275\362<\206\323/dU\205\211\262K\016je\277_\003\276V4\3541\346\205 \353\26528Z\r\255j\003|jr\253\331\303\3465\240&\021d\"\266\242\361\005Y\312\027\310\021\226O\252\303\241?)Y\003\261\007\306\314_4\332\334\377\304>\207\313\232\240\246\366\020\313x\036\372\265\326\320\260\202+\220\000U\303\334f\217#\001e\024\235\210p|U\0072rrp\377C\2359\360R\223\000\327\323\022\320yD`\270\312\310\260=\233\203\257\\\221\347uP\005\317=U\371\253u=\237T\263-K\240\351\016\301n\247\020\017E\256\005\245\001)_\1773\3009Fd\221\331\007\350,\020\366\320 \335\207\031?\"\333\202\354K\327\351Z!\227ST\010\322\341\216\006\357k\303u\306\341\202\207\3132\232\261\242N\364\357X\245o\320\212T\316\236\373r\246\355l\260t\273$\224\016\014\315\0342\343\246P\t\366\032Q\244\017\230s\346\033+n\245\355X%p\315\\7\017\254\274}\306\026\252\201\363\245;F\207\02136\314vzy\322\236\2637\234S\316\260#8\232\033\241K/\313*\215\25735""\225@\037\355\033a:V\355<\275\365\310\033\364~\241\317\0234\361\007\375\203G#ac\311L[1+\216Z\321\217\217f\257\271j\346\255\000\035[t#\325`w\351\023\372U\351\351\247\375\343v\250\022\032@6\373\234\266\343he\321\214\323\353\233t\363\025}\265U\tt\227\362p\274\300\317\245\214y\323j\267B\025\320;_\322\214H%\0306V\215\274\331\0162\264\027\275\336r\346\234x\025\375\374;V\375\266D\277\241\233Q3\306\016\305$h\333\200\371\253\025\373\022l\353\014\302\356}c\3358\000\257;\2558\234\252\263\273$|9\207\257\244\0210\333\315\313\326M\373\224\035\251t\234/EK\261\322\226q\333\020\315\0213\357\304\2158\355\230\265\377\343\302\361#h9X\372\005\rt\263t\014\233)\253\337>mG+=\203\326\250\035\002\r=\241j\360\212\0311\027\254\213V\001\362\022\034\264\006!z[v\324~\354\264;a'\356\210\356\260K\2749\357mY(kt\3755}\375\206\276I\323\364n\005\324\302\251h\357\030\352\254\036\321\331c\2345\373L\301\324\254\210\005\346\006\340\250=\003t`\326\316;g\234\244{\312\215\270\267\335\244\327\351m\225\347\312\257!\326 U\t\217\262\202HB\362#\316\202{\321U\275^/F\237\274\243\357v\350N\212\246\320*\335\335\253\233\032w\242\316o\356\373\362\231\262\340\347\251\275\022\032A\337+\235g\276\\l\353\274J\257L\3311;\341B\244^\226\363\225\216@\251\313\340\255\030&d\321\210\033Y\213\205\006\222\177\215^\273\357\206\240[Q\353\271\375\021x\303\356\256\027g;\361\020\220B\316\372\311R\355\001'\341E*]\375\220\326.(\272\032\365\232\223\365@\367\005c\302\214\231\177\330Q:\265M\267\341\014\177\322?\005*$1\245\301\022\344\374\0326D\265\243\263\032\010\031a\360\210\235\343\243\0312\307\255;v;;T\345|\260\212o\3326BGV\334\267\236\200\322\003f\264\322\001\341\002\331/=mp\334p[\347\240u\0353\377e\256\255\363\206\231\265\3578\001\367g\330\255\302\3663\3208\306+s\314\357\321\205\266\316\213\006T\310\r(\260v\353\022Dr\304\326\235y\247\340BhnZ\242\035\261\347\355\242\333\356\206\252\360)\320\321%w\301\013yC\336f\271\017C\215\207\rB\225l\330\035\366\023'\204\376\204\261\003\242v\254\332q\035:\036\002\375\023x""\036\030\202\334\263N\007\224\240\303\213tq\215\256AcA>\267+\201\253\346<\332\257\240\033\230\221\273\306\250\03167\301\237~\247\275\032\354\302\"\215X\267\255\0244iO\230\206oZI\250\263\333\266\000_\306c\363'z#\352\204\234H\323\327\005\007\252\020\242t\327\311\273\247]\210\377\020\035\272\347\266\323\373\277\227\241\261\273i\367\260\265\n!\353\031\245\243+n\234>X\247\353\033`\231\236\347\254\323X\nC\326=V\367\235N\234. \223nl\242\237w\255A\360\036\252\003\373\315\2168\021+\002\270\3241i\257\260\000\037\201\274A@\223O\320\004\254\261\003\027\r\301\3307\267\254\005\273\017\374\016\014\230\217\314=K\2604\010x\336\371\331\025j E\273\007\255!+~\010q\020u+\217\212\273K{\0061\357Y\014@\257\320\313\023\220\033\330r\205^a\341\256\324\345o\230\252u\301\232\007\315\021:\271\354>\002\325\2762v4,\371\210\325\213\260\010\347\241WoA\023\nN\276!\315xX\321\2471OK\356\234\013\276 \242\275v\240o\347\2341\272\030\007\010\256b\014\247\020y\253\320\032\360\230\245\263\317\313\013\300\301@B'\351\000D\220\236^c\036\270\2200\002>\256\262n\tsV\267}\000y\351\004\325a\037d^\301Y\026\001`>@mE\340|p\352M\250\305!;\016\261\nG\240\232\217\n\320\221G^\304[\002\030\332\007d\246[\257\377\017&A\246\253\327\030\003\260\205\341U\t\002\032\314\330\202\r\253\353\364z\r\027X\221A\363\006G\240A\332\241x\2037\350\215y\347)@^\364K\000&\024\002&\322\003P\324\343\0141\001\246\237\301\360\353\204\352\277\002\025\236v\036\273g\275\376rgy\223\306\0018\2224\231\252\0061\341\320m\325\340%\363\024v2\035\002\310B\177z\020\205a\354\245\000\3601/`\020\007\332E\343=t\367\200\035\2473\377*\307\312\333\364\r\216\311\n6\026T\206\361\310\330\003|\376\267\375\302\035tc\240&t\311\300\212\353\232\264\307\240\251\300\332='Z\t\216A\213\307`\034\267\323\350\263\362\305r\236\256aS\000^Wkzhx\326\326\260\013q\376\367\364\371#\374\226s\032F\341\0066!]\206\33583\252=,0t\354!\300z\010e!q\264\177\316\031r\326\035\215.\372za'C\207p\277\361\211\265\304\245\313\225\201\005(\326\242w\312\033\366$\234@\033\225\033\\%\262\344F\335g^\334\023""\313\3435\217.\373\355\215\022\363N\314y\013\363\245\303{V\336\240kq&\201\010?\356E\275\307\345\263~\311\376\017\022}\230n\r|\216\037u\021!\347\254w\301\233\367\212~\210\230\374\262\033C\300\366\364\362}\377:\321l\361\016\324\241\004\261\010\303dM\341\005\007%\000e\334\373^\014\220\366\262\217\077\077.\0015\326\025\366o\\!\343<\314\211`W\351\235Q0\237Z\303\326{\347\254\333\357\235//\321-\0103L#\221\212\004\213\362\202\301\256)KF\312\014a[As\303\265\000\313\342\252\t\343\355\222y\032\025}EG\023}pm{\2133\023@\t\300\357W6\026\332\355^,Ug\332=\304\230\032\306\262+\203q\317\274m&\201\260\210\010\303\300\004t]\270\326\270\211\371m\301\256f\0058\376'\026pd\340\r\341<\275\375\033\375\r\313\004f\352\367m\362'1\2756\007\027\213\250\177M|\310n&\376M\240Z\277\242\206\215\373\020'`\234|{,b(\230\313\225\320\025\377&\331[k\2760@\253\017\007}x\332;0\256\226\234\224\3533\360&\262M\357\275\244/k\227\200\357\333\324\312\3064\203\253\243\342Ud D<\247w_\320\027x\035\246\374\237\255l\034\333T\365\241\202F\260\007\342\354\322a\345\315\374?\023\234\023\345"; + PyObject *data = __Pyx_DecompressString(cstring, 3151, 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 (6534 bytes) */ -const char* const bytes = "']]Invalid comparator Invalid operator Not 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.Optional[Union[AllEqualConstraint, AllDifferentConstraint]]Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, VariableMinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint, VariableMaxProdConstraint]]Optional[Union[int, float]]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(disableenablegc is neither a string or Constraint isenabledlist[str]list[tuple[Constraint, list[str], Union[str, None]]]list[tuple[Union[Constraint, str], list[str]]]\n (?AllDifferentConstraintAllEqualConstraintCompilableFunctionConstraintConstraintExactProdConstraintExactSumConstraintFunctionConstraintFunctionTypeMaxProdConstraintMaxSumConstraintMinProdConstraintMinSumConstraintOptional__Pyx_PyDict_NextRefUnionVERBOSEVariableExactProdConstraintVariableExactSumConstraintVariableMaxProdConstraintVariableMaxSumConstraintVariableMinProdConstraintVariableMinSumConstraintasyncio.coroutines__class_getitem__cline_in_tracebackcloseco_constscode_objectcomparatorcomparatorscomparators_foundcomparators_indicescompilecompile_to_constraintscompiled_constraintsconstraintconstraint.constraintsconstraint.parserconstraintsdictdomainsendequalities_foundevalexecexprextract_operatorsfinalized_constraintfindallfinditerfromkeys__func__funcgenexprgroupiindexinequa""lities_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_paramstypestypingunionunique_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\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\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\360P\007\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$\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.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 < 213; i++) { + for (int i = 0; i < 210; 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); @@ -16541,7 +16522,7 @@ const char* const bytes = "']]Invalid comparator Invalid operator Not possible: stringtab[i] = string; pos += bytes_length; } - for (int i = 213; i < 232; i++) { + for (int i = 210; i < 229; i++) { Py_ssize_t bytes_length = index[i].length; PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length); stringtab[i] = string; @@ -16552,25 +16533,29 @@ const char* const bytes = "']]Invalid comparator Invalid operator Not possible: } } Py_XDECREF(data); - for (Py_ssize_t i = 0; i < 232; i++) { + for (Py_ssize_t i = 0; i < 229; i++) { if (unlikely(PyObject_Hash(stringtab[i]) == -1)) { __PYX_ERR(0, 1, __pyx_L1_error) } } #if CYTHON_IMMORTAL_CONSTANTS { - PyObject **table = stringtab + 213; + PyObject **table = stringtab + 210; for (Py_ssize_t i=0; i<19; ++i) { - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + 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 } @@ -16589,16 +16574,20 @@ const char* const bytes = "']]Invalid comparator Invalid operator Not possible: { PyObject **table = __pyx_mstate->__pyx_number_tab; for (Py_ssize_t i=0; i<3; ++i) { - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + 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 } @@ -16632,62 +16621,62 @@ 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), 99}; + 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_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), 99}; + 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_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), 110}; + 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_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), 155}; + 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_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), 175}; + 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), 184}; + 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[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), 185}; + 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[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), 190}; + 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[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), 282}; + 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[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), 289}; + 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[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), 332}; + 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_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), 342}; + 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_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad; } @@ -16712,27 +16701,27 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { __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), 313}; + 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_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), 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_mstate->__pyx_kp_b_iso88591_Ya_1_q_Q2_m5_aP_U_6_Q_q_t4uA_d, 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), 381}; + 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_mstate->__pyx_kp_b_iso88591_V1_A_UUV__A_Qm1_q_9_gQm_q_1Kz_g, 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), 419}; + 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), 431}; + 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; } @@ -16985,11 +16974,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++) { + 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; } @@ -18746,6 +18735,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 */ @@ -18978,8 +18968,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: @@ -19952,6 +19942,48 @@ __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { __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) { + CYTHON_UNUSED_VAR(context); + PyObject *annotations = __Pyx_CyFunction_get_annotations((__pyx_CyFunctionObject *) 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 (value == Py_None) { + return 0; + } + PyObject *annotations = PyObject_CallObject(value, NULL); + if (!annotations) return -1; + int result = __Pyx_CyFunction_set_annotations((__pyx_CyFunctionObject *) op_in, annotations, NULL); + Py_DECREF(annotations); + return result; +} static PyObject * __Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; @@ -19964,7 +19996,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; } @@ -20067,6 +20098,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}, @@ -20205,8 +20237,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) 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 { @@ -20214,7 +20245,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); @@ -20266,11 +20296,10 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, 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; @@ -21559,8 +21588,8 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #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; } @@ -23106,7 +23135,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); } @@ -23303,14 +23333,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)) { @@ -23335,9 +23361,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); @@ -23398,35 +23432,23 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( } 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) { diff --git a/constraint/parser.py b/constraint/parser.py index d7734a3..d2ea965 100644 --- a/constraint/parser.py +++ b/constraint/parser.py @@ -2,34 +2,34 @@ 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]]]: +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]*)" @@ -78,22 +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): @@ -312,7 +297,7 @@ def to_numeric_constraint(restriction: str, params: list[str]) -> Optional[ 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): @@ -380,7 +365,7 @@ def to_equality_constraint( def compile_to_constraints( constraints: list[str], domains: dict, picklable=False -) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 +) -> 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: @@ -392,7 +377,7 @@ def compile_to_constraints( 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 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 @@ -416,7 +401,7 @@ def compile_to_constraints( # Utility functions -def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: +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') diff --git a/constraint/problem.c b/constraint/problem.c index bb0e06b..3b5efa8 100644 --- a/constraint/problem.c +++ b/constraint/problem.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.2.4 */ +/* Generated by Cython 3.2.6 */ /* BEGIN: Cython Metadata { @@ -37,8 +37,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x03080000 #error Cython requires Python 3.8+. #else -#define __PYX_ABI_VERSION "3_2_4" -#define CYTHON_HEX_VERSION 0x030204F0 +#define __PYX_ABI_VERSION "3_2_6" +#define CYTHON_HEX_VERSION 0x030206F0 #define CYTHON_FUTURE_DIVISION 1 /* CModulePreamble */ #include @@ -1531,7 +1531,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":164 +/* "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}" # <<<<<<<<<<<<<< @@ -1545,7 +1545,7 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr { }; -/* "constraint/problem.py":239 +/* "constraint/problem.py":238 * return self._solver.getSolutionIter(domains, constraints, vconstraints) * * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: # <<<<<<<<<<<<<< @@ -1558,7 +1558,7 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedL }; -/* "constraint/problem.py":243 +/* "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) # <<<<<<<<<<<<<< @@ -1572,7 +1572,7 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr { }; -/* "constraint/problem.py":245 +/* "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) # <<<<<<<<<<<<<< @@ -1587,7 +1587,7 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr { }; -/* "constraint/problem.py":290 +/* "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 # <<<<<<<<<<<<<< @@ -2825,7 +2825,7 @@ typedef struct { PyObject *__pyx_slice[1]; PyObject *__pyx_tuple[3]; PyObject *__pyx_codeobj_tab[17]; - PyObject *__pyx_string_tab[192]; + PyObject *__pyx_string_tab[189]; PyObject *__pyx_number_tab[1]; /* #### Code section: module_state_contents ### */ @@ -2906,32 +2906,32 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_kp_u_Add_one_or_more_variables_to_the __pyx_string_tab[3] #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_Constraints __pyx_string_tab[6] -#define __pyx_kp_u_Constraints_must_be_instances_of __pyx_string_tab[7] -#define __pyx_kp_u_Domain_is_empty __pyx_string_tab[8] -#define __pyx_kp_u_Domains_must_be_instances_of_sub __pyx_string_tab[9] -#define __pyx_kp_u_Duplicate_configs __pyx_string_tab[10] -#define __pyx_kp_u_Expected_constraints_to_be_strin __pyx_string_tab[11] -#define __pyx_kp_u_Find_and_return_a_solution_to_th __pyx_string_tab[12] -#define __pyx_kp_u_Find_and_return_all_solutions_to __pyx_string_tab[13] -#define __pyx_kp_u_None __pyx_string_tab[14] -#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[15] -#define __pyx_kp_u_Obtain_the_problem_solver_curren __pyx_string_tab[16] -#define __pyx_kp_u_Optional_Sequence __pyx_string_tab[17] +#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_141 __pyx_string_tab[19] -#define __pyx_kp_u_Problem_addVariable_line_86 __pyx_string_tab[20] -#define __pyx_kp_u_Problem_addVariables_line_118 __pyx_string_tab[21] -#define __pyx_kp_u_Problem_getSolutionIter_line_218 __pyx_string_tab[22] -#define __pyx_kp_u_Problem_getSolution_line_180 __pyx_string_tab[23] -#define __pyx_kp_u_Problem_getSolutions_line_199 __pyx_string_tab[24] -#define __pyx_kp_u_Problem_getSolver_line_72 __pyx_string_tab[25] -#define __pyx_kp_u_Problem_reset_line_44 __pyx_string_tab[26] -#define __pyx_kp_u_Problem_setSolver_line_57 __pyx_string_tab[27] +#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_Tried_to_insert_duplicated_varia __pyx_string_tab[30] -#define __pyx_kp_u_Union_Constraint_Callable_str __pyx_string_tab[31] +#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] @@ -2956,142 +2956,139 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_Optional __pyx_string_tab[56] -#define __pyx_n_u_ParallelSolver __pyx_string_tab[57] -#define __pyx_n_u_Problem __pyx_string_tab[58] -#define __pyx_n_u_Problem___init __pyx_string_tab[59] -#define __pyx_n_u_Problem__getArgs __pyx_string_tab[60] -#define __pyx_n_u_Problem__getArgs_locals_genexpr __pyx_string_tab[61] -#define __pyx_n_u_Problem_addConstraint __pyx_string_tab[62] -#define __pyx_n_u_Problem_addConstraint_locals_gen __pyx_string_tab[63] -#define __pyx_n_u_Problem_addVariable __pyx_string_tab[64] -#define __pyx_n_u_Problem_addVariables __pyx_string_tab[65] -#define __pyx_n_u_Problem_getSolution __pyx_string_tab[66] -#define __pyx_n_u_Problem_getSolutionIter __pyx_string_tab[67] -#define __pyx_n_u_Problem_getSolutions __pyx_string_tab[68] -#define __pyx_n_u_Problem_getSolutionsAsListDict __pyx_string_tab[69] -#define __pyx_n_u_Problem_getSolutionsOrderedList __pyx_string_tab[70] -#define __pyx_n_u_Problem_getSolutionsOrderedList_2 __pyx_string_tab[71] -#define __pyx_n_u_Problem_getSolver __pyx_string_tab[72] -#define __pyx_n_u_Problem_reset __pyx_string_tab[73] -#define __pyx_n_u_Problem_setSolver __pyx_string_tab[74] -#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[75] -#define __pyx_n_u_Sequence __pyx_string_tab[76] -#define __pyx_n_u_Solver __pyx_string_tab[77] -#define __pyx_n_u_Union __pyx_string_tab[78] -#define __pyx_n_u__7 __pyx_string_tab[79] -#define __pyx_n_u_addConstraint __pyx_string_tab[80] -#define __pyx_n_u_addVariable __pyx_string_tab[81] -#define __pyx_n_u_addVariables __pyx_string_tab[82] -#define __pyx_n_u_allvariables __pyx_string_tab[83] -#define __pyx_n_u_append __pyx_string_tab[84] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[85] -#define __pyx_n_u_bool __pyx_string_tab[86] -#define __pyx_n_u_c __pyx_string_tab[87] -#define __pyx_n_u_clear __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_collections_abc __pyx_string_tab[91] -#define __pyx_n_u_compile_to_constraints __pyx_string_tab[92] -#define __pyx_n_u_constraint __pyx_string_tab[93] -#define __pyx_n_u_constraint_constraints __pyx_string_tab[94] -#define __pyx_n_u_constraint_domain __pyx_string_tab[95] -#define __pyx_n_u_constraint_parser __pyx_string_tab[96] -#define __pyx_n_u_constraint_problem __pyx_string_tab[97] -#define __pyx_n_u_constraint_solvers __pyx_string_tab[98] -#define __pyx_n_u_constraints __pyx_string_tab[99] -#define __pyx_n_u_constraints_2 __pyx_string_tab[100] -#define __pyx_n_u_copy __pyx_string_tab[101] -#define __pyx_n_u_count __pyx_string_tab[102] -#define __pyx_n_u_deepcopy __pyx_string_tab[103] -#define __pyx_n_u_doc __pyx_string_tab[104] -#define __pyx_n_u_domain __pyx_string_tab[105] -#define __pyx_n_u_domains __pyx_string_tab[106] -#define __pyx_n_u_extend __pyx_string_tab[107] -#define __pyx_n_u_freethreading __pyx_string_tab[108] -#define __pyx_n_u_func __pyx_string_tab[109] -#define __pyx_n_u_genexpr __pyx_string_tab[110] -#define __pyx_n_u_getArgs __pyx_string_tab[111] -#define __pyx_n_u_getSolution __pyx_string_tab[112] -#define __pyx_n_u_getSolutionIter __pyx_string_tab[113] -#define __pyx_n_u_getSolutions __pyx_string_tab[114] -#define __pyx_n_u_getSolutionsAsListDict __pyx_string_tab[115] -#define __pyx_n_u_getSolutionsOrderedList __pyx_string_tab[116] -#define __pyx_n_u_getSolver __pyx_string_tab[117] -#define __pyx_n_u_get_in_order __pyx_string_tab[118] -#define __pyx_n_u_getitem __pyx_string_tab[119] -#define __pyx_n_u_init __pyx_string_tab[120] -#define __pyx_n_u_is_coroutine __pyx_string_tab[121] -#define __pyx_n_u_is_gil_enabled __pyx_string_tab[122] -#define __pyx_n_u_itemgetter __pyx_string_tab[123] -#define __pyx_n_u_items __pyx_string_tab[124] -#define __pyx_n_u_keys __pyx_string_tab[125] -#define __pyx_n_u_main __pyx_string_tab[126] -#define __pyx_n_u_metaclass __pyx_string_tab[127] -#define __pyx_n_u_module __pyx_string_tab[128] -#define __pyx_n_u_msg __pyx_string_tab[129] -#define __pyx_n_u_name __pyx_string_tab[130] -#define __pyx_n_u_next __pyx_string_tab[131] -#define __pyx_n_u_operator __pyx_string_tab[132] -#define __pyx_n_u_order __pyx_string_tab[133] -#define __pyx_n_u_params __pyx_string_tab[134] -#define __pyx_n_u_parsed __pyx_string_tab[135] -#define __pyx_n_u_picklable __pyx_string_tab[136] -#define __pyx_n_u_pop __pyx_string_tab[137] -#define __pyx_n_u_preProcess __pyx_string_tab[138] -#define __pyx_n_u_prepare __pyx_string_tab[139] -#define __pyx_n_u_process_mode __pyx_string_tab[140] -#define __pyx_n_u_qualname __pyx_string_tab[141] -#define __pyx_n_u_requires_pickling __pyx_string_tab[142] -#define __pyx_n_u_reset __pyx_string_tab[143] -#define __pyx_n_u_resetState __pyx_string_tab[144] -#define __pyx_n_u_return __pyx_string_tab[145] -#define __pyx_n_u_self __pyx_string_tab[146] -#define __pyx_n_u_send __pyx_string_tab[147] -#define __pyx_n_u_setSolver __pyx_string_tab[148] -#define __pyx_n_u_set_name __pyx_string_tab[149] -#define __pyx_n_u_setdefault __pyx_string_tab[150] -#define __pyx_n_u_size_dict __pyx_string_tab[151] -#define __pyx_n_u_size_list __pyx_string_tab[152] -#define __pyx_n_u_solution __pyx_string_tab[153] -#define __pyx_n_u_solutions __pyx_string_tab[154] -#define __pyx_n_u_solutions_dict __pyx_string_tab[155] -#define __pyx_n_u_solutions_list __pyx_string_tab[156] -#define __pyx_n_u_solver __pyx_string_tab[157] -#define __pyx_n_u_solver_2 __pyx_string_tab[158] -#define __pyx_n_u_str_constraints __pyx_string_tab[159] -#define __pyx_n_u_sys __pyx_string_tab[160] -#define __pyx_n_u_test __pyx_string_tab[161] -#define __pyx_n_u_throw __pyx_string_tab[162] -#define __pyx_n_u_typing __pyx_string_tab[163] -#define __pyx_n_u_v __pyx_string_tab[164] -#define __pyx_n_u_validate __pyx_string_tab[165] -#define __pyx_n_u_value __pyx_string_tab[166] -#define __pyx_n_u_values __pyx_string_tab[167] -#define __pyx_n_u_variable __pyx_string_tab[168] -#define __pyx_n_u_variables __pyx_string_tab[169] -#define __pyx_n_u_variables_2 __pyx_string_tab[170] -#define __pyx_n_u_vconstraints __pyx_string_tab[171] -#define __pyx_n_u_warn __pyx_string_tab[172] -#define __pyx_n_u_warnings __pyx_string_tab[173] -#define __pyx_n_u_zip __pyx_string_tab[174] -#define __pyx_kp_b_iso88591_A_9Ct1_8_Qa_AQ_4z_V7_4t7_8ST_T __pyx_string_tab[175] -#define __pyx_kp_b_iso88591_A_D_Q_KvQ __pyx_string_tab[176] -#define __pyx_kp_b_iso88591_A_Kq __pyx_string_tab[177] -#define __pyx_kp_b_iso88591_A_oT_T_QR_4q_1_t8_q __pyx_string_tab[178] -#define __pyx_kp_b_iso88591_A_oT_T_QR_4q_1_t8_q_a __pyx_string_tab[179] -#define __pyx_kp_b_iso88591_A_oT_T_QR_4q_4q_t8_1I __pyx_string_tab[180] -#define __pyx_kp_b_iso88591_A_t1 __pyx_string_tab[181] -#define __pyx_kp_b_iso88591_A_z_5Qa_Cq_t1Cq_8_Qa_1_1A_z_A_j __pyx_string_tab[182] -#define __pyx_kp_b_iso88591_J_UV_Ql_q_A_jjkkl_4z_a_xq_q_1L __pyx_string_tab[183] -#define __pyx_kp_b_iso88591_Q __pyx_string_tab[184] -#define __pyx_kp_b_iso88591_Q_2 __pyx_string_tab[185] -#define __pyx_kp_b_iso88591__5 __pyx_string_tab[186] -#define __pyx_kp_b_iso88591__6 __pyx_string_tab[187] -#define __pyx_kp_b_iso88591_a_L_AZq __pyx_string_tab[188] -#define __pyx_kp_b_iso88591_g_B_M_6_E_Cq_s_vQ_z_1 __pyx_string_tab[189] -#define __pyx_kp_b_iso88591_q_k_a_we1_5Q_3at_b_d_q_izQR_Cs __pyx_string_tab[190] -#define __pyx_kp_b_iso88591_xq_Kwc_A_1_2_z_j_1_aaeeffjjk_Qd __pyx_string_tab[191] +#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_append __pyx_string_tab[82] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[83] +#define __pyx_n_u_bool __pyx_string_tab[84] +#define __pyx_n_u_c __pyx_string_tab[85] +#define __pyx_n_u_clear __pyx_string_tab[86] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[87] +#define __pyx_n_u_close __pyx_string_tab[88] +#define __pyx_n_u_collections_abc __pyx_string_tab[89] +#define __pyx_n_u_compile_to_constraints __pyx_string_tab[90] +#define __pyx_n_u_constraint __pyx_string_tab[91] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[92] +#define __pyx_n_u_constraint_domain __pyx_string_tab[93] +#define __pyx_n_u_constraint_parser __pyx_string_tab[94] +#define __pyx_n_u_constraint_problem __pyx_string_tab[95] +#define __pyx_n_u_constraint_solvers __pyx_string_tab[96] +#define __pyx_n_u_constraints __pyx_string_tab[97] +#define __pyx_n_u_constraints_2 __pyx_string_tab[98] +#define __pyx_n_u_copy __pyx_string_tab[99] +#define __pyx_n_u_count __pyx_string_tab[100] +#define __pyx_n_u_deepcopy __pyx_string_tab[101] +#define __pyx_n_u_doc __pyx_string_tab[102] +#define __pyx_n_u_domain __pyx_string_tab[103] +#define __pyx_n_u_domains __pyx_string_tab[104] +#define __pyx_n_u_extend __pyx_string_tab[105] +#define __pyx_n_u_freethreading __pyx_string_tab[106] +#define __pyx_n_u_func __pyx_string_tab[107] +#define __pyx_n_u_genexpr __pyx_string_tab[108] +#define __pyx_n_u_getArgs __pyx_string_tab[109] +#define __pyx_n_u_getSolution __pyx_string_tab[110] +#define __pyx_n_u_getSolutionIter __pyx_string_tab[111] +#define __pyx_n_u_getSolutions __pyx_string_tab[112] +#define __pyx_n_u_getSolutionsAsListDict __pyx_string_tab[113] +#define __pyx_n_u_getSolutionsOrderedList __pyx_string_tab[114] +#define __pyx_n_u_getSolver __pyx_string_tab[115] +#define __pyx_n_u_get_in_order __pyx_string_tab[116] +#define __pyx_n_u_getitem __pyx_string_tab[117] +#define __pyx_n_u_init __pyx_string_tab[118] +#define __pyx_n_u_is_coroutine __pyx_string_tab[119] +#define __pyx_n_u_is_gil_enabled __pyx_string_tab[120] +#define __pyx_n_u_itemgetter __pyx_string_tab[121] +#define __pyx_n_u_items __pyx_string_tab[122] +#define __pyx_n_u_keys __pyx_string_tab[123] +#define __pyx_n_u_main __pyx_string_tab[124] +#define __pyx_n_u_metaclass __pyx_string_tab[125] +#define __pyx_n_u_module __pyx_string_tab[126] +#define __pyx_n_u_msg __pyx_string_tab[127] +#define __pyx_n_u_name __pyx_string_tab[128] +#define __pyx_n_u_next __pyx_string_tab[129] +#define __pyx_n_u_operator __pyx_string_tab[130] +#define __pyx_n_u_order __pyx_string_tab[131] +#define __pyx_n_u_params __pyx_string_tab[132] +#define __pyx_n_u_parsed __pyx_string_tab[133] +#define __pyx_n_u_picklable __pyx_string_tab[134] +#define __pyx_n_u_pop __pyx_string_tab[135] +#define __pyx_n_u_preProcess __pyx_string_tab[136] +#define __pyx_n_u_prepare __pyx_string_tab[137] +#define __pyx_n_u_process_mode __pyx_string_tab[138] +#define __pyx_n_u_qualname __pyx_string_tab[139] +#define __pyx_n_u_requires_pickling __pyx_string_tab[140] +#define __pyx_n_u_reset __pyx_string_tab[141] +#define __pyx_n_u_resetState __pyx_string_tab[142] +#define __pyx_n_u_return __pyx_string_tab[143] +#define __pyx_n_u_self __pyx_string_tab[144] +#define __pyx_n_u_send __pyx_string_tab[145] +#define __pyx_n_u_setSolver __pyx_string_tab[146] +#define __pyx_n_u_set_name __pyx_string_tab[147] +#define __pyx_n_u_setdefault __pyx_string_tab[148] +#define __pyx_n_u_size_dict __pyx_string_tab[149] +#define __pyx_n_u_size_list __pyx_string_tab[150] +#define __pyx_n_u_solution __pyx_string_tab[151] +#define __pyx_n_u_solutions __pyx_string_tab[152] +#define __pyx_n_u_solutions_dict __pyx_string_tab[153] +#define __pyx_n_u_solutions_list __pyx_string_tab[154] +#define __pyx_n_u_solver __pyx_string_tab[155] +#define __pyx_n_u_solver_2 __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_n_u_v __pyx_string_tab[161] +#define __pyx_n_u_validate __pyx_string_tab[162] +#define __pyx_n_u_value __pyx_string_tab[163] +#define __pyx_n_u_values __pyx_string_tab[164] +#define __pyx_n_u_variable __pyx_string_tab[165] +#define __pyx_n_u_variables __pyx_string_tab[166] +#define __pyx_n_u_variables_2 __pyx_string_tab[167] +#define __pyx_n_u_vconstraints __pyx_string_tab[168] +#define __pyx_n_u_warn __pyx_string_tab[169] +#define __pyx_n_u_warnings __pyx_string_tab[170] +#define __pyx_n_u_zip __pyx_string_tab[171] +#define __pyx_kp_b_iso88591_A_9Ct1_8_Qa_AQ_4z_V7_4t7_8ST_T __pyx_string_tab[172] +#define __pyx_kp_b_iso88591_A_D_Q_KvQ __pyx_string_tab[173] +#define __pyx_kp_b_iso88591_A_Kq __pyx_string_tab[174] +#define __pyx_kp_b_iso88591_A_oT_T_QR_4q_1_t8_q __pyx_string_tab[175] +#define __pyx_kp_b_iso88591_A_oT_T_QR_4q_1_t8_q_a __pyx_string_tab[176] +#define __pyx_kp_b_iso88591_A_oT_T_QR_4q_4q_t8_1I __pyx_string_tab[177] +#define __pyx_kp_b_iso88591_A_t1 __pyx_string_tab[178] +#define __pyx_kp_b_iso88591_A_z_5Qa_Cq_t1Cq_8_Qa_1_1A_z_A_j __pyx_string_tab[179] +#define __pyx_kp_b_iso88591_E_PQ_Ql_q_A_jjkkl_4z_a_xq_q_1L __pyx_string_tab[180] +#define __pyx_kp_b_iso88591_Q __pyx_string_tab[181] +#define __pyx_kp_b_iso88591_Q_2 __pyx_string_tab[182] +#define __pyx_kp_b_iso88591__5 __pyx_string_tab[183] +#define __pyx_kp_b_iso88591__6 __pyx_string_tab[184] +#define __pyx_kp_b_iso88591_a_L_AZq __pyx_string_tab[185] +#define __pyx_kp_b_iso88591_g_B_M_6_E_Cq_s_vQ_z_1 __pyx_string_tab[186] +#define __pyx_kp_b_iso88591_q_k_a_we1_5Q_3at_b_d_q_izQR_Cs __pyx_string_tab[187] +#define __pyx_kp_b_iso88591_xq_Kwc_A_1_2_z_j_1_aaeeffjjk_Qd __pyx_string_tab[188] #define __pyx_int_1 __pyx_number_tab[0] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE @@ -3120,7 +3117,7 @@ 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<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<192; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<189; ++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 */ @@ -3160,7 +3157,7 @@ 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<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<192; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<189; ++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 */ @@ -3178,7 +3175,7 @@ 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): # <<<<<<<<<<<<<< @@ -3227,35 +3224,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; } @@ -3266,7 +3263,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:; @@ -3304,14 +3301,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); @@ -3319,7 +3316,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 @@ -3338,53 +3335,53 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED __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)})." # <<<<<<<<<<<<<< @@ -3393,52 +3390,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(((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 # <<<<<<<<<<<<<< @@ -3446,7 +3443,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 @@ -3465,24 +3462,24 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED __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) { @@ -3490,16 +3487,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.") # <<<<<<<<<<<<<< @@ -3507,7 +3504,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 @@ -3526,12 +3523,12 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED __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: # <<<<<<<<<<<<<< @@ -3540,7 +3537,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): # <<<<<<<<<<<<<< @@ -3549,7 +3546,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): # <<<<<<<<<<<<<< @@ -3573,7 +3570,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): # <<<<<<<<<<<<<< @@ -3621,32 +3618,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:; @@ -3679,26 +3676,26 @@ 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); @@ -3708,12 +3705,12 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_2reset(CYTHON_UNUSED Py __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): # <<<<<<<<<<<<<< @@ -3736,7 +3733,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): # <<<<<<<<<<<<<< @@ -3785,39 +3782,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:; @@ -3846,16 +3843,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): # <<<<<<<<<<<<<< @@ -3875,7 +3872,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): # <<<<<<<<<<<<<< @@ -3923,32 +3920,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:; @@ -3978,7 +3975,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 # <<<<<<<<<<<<<< @@ -3986,13 +3983,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): # <<<<<<<<<<<<<< @@ -4011,7 +4008,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): # <<<<<<<<<<<<<< @@ -4061,38 +4058,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]; @@ -4100,7 +4097,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:; @@ -4139,38 +4136,38 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU __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 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) # <<<<<<<<<<<<<< @@ -4183,14 +4180,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_msg}; __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, 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: # <<<<<<<<<<<<<< @@ -4199,14 +4196,14 @@ 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 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_6 = PyList_Check(__pyx_v_variable); if (!__pyx_t_6) { @@ -4230,25 +4227,25 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU __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, 105, __pyx_L1_error) + __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) */ - __pyx_t_1 = PySequence_List(__pyx_v_domain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + __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":105 + /* "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__"): # <<<<<<<<<<<<<< @@ -4257,20 +4254,20 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU */ } - /* "constraint/problem.py":107 + /* "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, 107, __pyx_L1_error) + __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, 107, __pyx_L1_error) + __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":108 + /* "constraint/problem.py":107 * domain = list(domain) * if isinstance(domain, Domain): * domain = copy.deepcopy(domain) # <<<<<<<<<<<<<< @@ -4278,9 +4275,9 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * 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, 108, __pyx_L1_error) + __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, 108, __pyx_L1_error) + __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; @@ -4300,13 +4297,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU __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, 108, __pyx_L1_error) + 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":107 + /* "constraint/problem.py":106 * if not isinstance(variable, (list, tuple, Domain)) and not hasattr(domain, "__getitem__"): * domain = list(domain) * if isinstance(domain, Domain): # <<<<<<<<<<<<<< @@ -4316,17 +4313,17 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU goto __pyx_L10; } - /* "constraint/problem.py":109 + /* "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, 109, __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":110 + /* "constraint/problem.py":109 * domain = copy.deepcopy(domain) * elif hasattr(domain, "__getitem__"): * domain = Domain(domain) # <<<<<<<<<<<<<< @@ -4334,7 +4331,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU * msg = "Domains must be instances of subclasses of the Domain class" */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error) + __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 @@ -4353,13 +4350,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU __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, 110, __pyx_L1_error) + 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":109 + /* "constraint/problem.py":108 * if isinstance(domain, Domain): * domain = copy.deepcopy(domain) * elif hasattr(domain, "__getitem__"): # <<<<<<<<<<<<<< @@ -4369,7 +4366,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU goto __pyx_L10; } - /* "constraint/problem.py":112 + /* "constraint/problem.py":111 * domain = Domain(domain) * else: * msg = "Domains must be instances of subclasses of the Domain class" # <<<<<<<<<<<<<< @@ -4380,7 +4377,7 @@ 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":113 + /* "constraint/problem.py":112 * else: * msg = "Domains must be instances of subclasses of the Domain class" * raise TypeError(msg) # <<<<<<<<<<<<<< @@ -4393,27 +4390,27 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU 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, 113, __pyx_L1_error) + 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, 113, __pyx_L1_error) + __PYX_ERR(0, 112, __pyx_L1_error) } __pyx_L10:; - /* "constraint/problem.py":114 + /* "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, 114, __pyx_L1_error) + __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":115 + /* "constraint/problem.py":114 * raise TypeError(msg) * if not domain: * raise ValueError("Domain is empty") # <<<<<<<<<<<<<< @@ -4426,14 +4423,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU 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, 115, __pyx_L1_error) + 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, 115, __pyx_L1_error) + __PYX_ERR(0, 114, __pyx_L1_error) - /* "constraint/problem.py":114 + /* "constraint/problem.py":113 * msg = "Domains must be instances of subclasses of the Domain class" * raise TypeError(msg) * if not domain: # <<<<<<<<<<<<<< @@ -4442,19 +4439,19 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU */ } - /* "constraint/problem.py":116 + /* "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, 116, __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, 116, __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): # <<<<<<<<<<<<<< @@ -4480,7 +4477,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU return __pyx_r; } -/* "constraint/problem.py":118 +/* "constraint/problem.py":117 * self._variables[variable] = domain * * def addVariables(self, variables: Sequence, domain): # <<<<<<<<<<<<<< @@ -4530,38 +4527,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, 118, __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, 118, __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, 118, __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, 118, __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, 118, __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, 118, __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, 118, __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, 118, __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, 118, __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]; @@ -4569,7 +4566,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, 118, __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:; @@ -4605,7 +4602,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addVariables", 0); - /* "constraint/problem.py":138 + /* "constraint/problem.py":137 * may assume * """ * for variable in variables: # <<<<<<<<<<<<<< @@ -4617,9 +4614,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, 138, __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, 138, __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)) { @@ -4627,7 +4624,7 @@ 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, 138, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 137, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -4637,7 +4634,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U { 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, 138, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 137, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -4648,13 +4645,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __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, 138, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 137, __pyx_L1_error) PyErr_Clear(); } break; @@ -4664,12 +4661,12 @@ 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":139 + /* "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); @@ -4678,12 +4675,12 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_variable, __pyx_v_domain}; __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, 139, __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":138 + /* "constraint/problem.py":137 * may assume * """ * for variable in variables: # <<<<<<<<<<<<<< @@ -4693,7 +4690,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":118 + /* "constraint/problem.py":117 * self._variables[variable] = domain * * def addVariables(self, variables: Sequence, domain): # <<<<<<<<<<<<<< @@ -4717,10 +4714,10 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U return __pyx_r; } -/* "constraint/problem.py":141 +/* "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. * */ @@ -4767,41 +4764,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, 141, __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, 141, __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, 141, __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, 141, __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, 141, __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, 141, __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, 141, __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, 141, __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, 141, __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; } @@ -4813,7 +4810,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, 141, __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:; @@ -4835,7 +4832,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":164 +/* "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}" # <<<<<<<<<<<<<< @@ -4855,7 +4852,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, 164, __pyx_L1_error) + __PYX_ERR(0, 163, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -4863,7 +4860,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, 164, __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; @@ -4901,16 +4898,16 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2genera return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 164, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 164, __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, 164, __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, 164, __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)) { @@ -4918,7 +4915,7 @@ 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, 164, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 163, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -4928,7 +4925,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2genera { 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, 164, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 163, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -4939,13 +4936,13 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2genera #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __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, 164, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 163, __pyx_L1_error) PyErr_Clear(); } break; @@ -4995,10 +4992,10 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2genera return __pyx_r; } -/* "constraint/problem.py":141 +/* "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. * */ @@ -5021,7 +5018,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ __Pyx_RefNannySetupContext("addConstraint", 0); __Pyx_INCREF(__pyx_v_constraint); - /* "constraint/problem.py":160 + /* "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): # <<<<<<<<<<<<<< @@ -5031,19 +5028,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":161 + /* "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, 161, __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, 161, __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":162 + /* "constraint/problem.py":161 * if isinstance(constraint, str): * self._str_constraints.append(constraint) * return # <<<<<<<<<<<<<< @@ -5054,7 +5051,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/problem.py":160 + /* "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): # <<<<<<<<<<<<<< @@ -5063,7 +5060,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ */ } - /* "constraint/problem.py":163 + /* "constraint/problem.py":162 * self._str_constraints.append(constraint) * return * elif isinstance(constraint, list): # <<<<<<<<<<<<<< @@ -5073,7 +5070,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":164 + /* "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}" # <<<<<<<<<<<<<< @@ -5082,36 +5079,36 @@ 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, 164, __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, 164, __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, 164, __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, 164, __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, 164, __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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 164, __pyx_L1_error) + __PYX_ERR(0, 163, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 164, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 163, __pyx_L1_error) #endif - /* "constraint/problem.py":165 + /* "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, 165, __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); @@ -5121,12 +5118,12 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ __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, 165, __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":166 + /* "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 # <<<<<<<<<<<<<< @@ -5137,7 +5134,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/problem.py":163 + /* "constraint/problem.py":162 * self._str_constraints.append(constraint) * return * elif isinstance(constraint, list): # <<<<<<<<<<<<<< @@ -5146,31 +5143,31 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ */ } - /* "constraint/problem.py":169 + /* "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, 169, __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, 169, __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":170 + /* "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, 170, __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":172 + /* "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) # <<<<<<<<<<<<<< @@ -5178,7 +5175,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, 172, __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 @@ -5197,13 +5194,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ __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, 172, __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":170 + /* "constraint/problem.py":169 * # add regular constraints * if not isinstance(constraint, Constraint): * if callable(constraint): # <<<<<<<<<<<<<< @@ -5213,7 +5210,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ goto __pyx_L5; } - /* "constraint/problem.py":173 + /* "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): # <<<<<<<<<<<<<< @@ -5223,7 +5220,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":174 + /* "constraint/problem.py":173 * constraint = FunctionConstraint(constraint) * elif isinstance(constraint, str): * constraint = CompilableFunctionConstraint(constraint) # <<<<<<<<<<<<<< @@ -5231,7 +5228,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, 174, __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 @@ -5250,13 +5247,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ __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, 174, __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":173 + /* "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): # <<<<<<<<<<<<<< @@ -5266,7 +5263,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ goto __pyx_L5; } - /* "constraint/problem.py":176 + /* "constraint/problem.py":175 * constraint = CompilableFunctionConstraint(constraint) * else: * msg = "Constraints must be instances of subclasses " "of the Constraint class" # <<<<<<<<<<<<<< @@ -5277,7 +5274,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":177 + /* "constraint/problem.py":176 * else: * msg = "Constraints must be instances of subclasses " "of the Constraint class" * raise ValueError(msg) # <<<<<<<<<<<<<< @@ -5290,16 +5287,16 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_msg}; __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; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __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, 177, __pyx_L1_error) + __PYX_ERR(0, 176, __pyx_L1_error) } __pyx_L5:; - /* "constraint/problem.py":169 + /* "constraint/problem.py":168 * * # add regular constraints * if not isinstance(constraint, Constraint): # <<<<<<<<<<<<<< @@ -5308,31 +5305,31 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ */ } - /* "constraint/problem.py":178 + /* "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, 178, __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_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __pyx_L1_error) + __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_5, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 178, __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_5, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 178, __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, 178, __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_5); __pyx_t_5 = 0; - /* "constraint/problem.py":141 + /* "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. * */ @@ -5355,7 +5352,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ return __pyx_r; } -/* "constraint/problem.py":180 +/* "constraint/problem.py":179 * self._constraints.append((constraint, variables)) * * def getSolution(self): # <<<<<<<<<<<<<< @@ -5403,32 +5400,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, 180, __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, 180, __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, 180, __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, 180, __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, 180, __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, 180, __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:; @@ -5469,7 +5466,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolution", 0); - /* "constraint/problem.py":194 + /* "constraint/problem.py":193 * dictionary mapping variables to values: Solution for the problem * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) # <<<<<<<<<<<<<< @@ -5478,22 +5475,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, 194, __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, 194, __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, 194, __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, 194, __pyx_L1_error) + 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, 194, __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))) { @@ -5502,7 +5499,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, 194, __pyx_L1_error) + __PYX_ERR(0, 193, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -5514,27 +5511,27 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) + 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, 194, __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, 194, __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, 194, __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, 194, __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); @@ -5544,7 +5541,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, 194, __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; @@ -5552,7 +5549,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, 194, __pyx_L1_error) + __PYX_ERR(0, 193, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_domains = __pyx_t_3; @@ -5562,18 +5559,18 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN __pyx_v_vconstraints = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/problem.py":195 + /* "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, 195, __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":196 + /* "constraint/problem.py":195 * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: * return None # <<<<<<<<<<<<<< @@ -5584,7 +5581,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":195 + /* "constraint/problem.py":194 * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: # <<<<<<<<<<<<<< @@ -5593,7 +5590,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN */ } - /* "constraint/problem.py":197 + /* "constraint/problem.py":196 * if not domains: * return None * return self._solver.getSolution(domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -5601,7 +5598,7 @@ 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, 197, __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); @@ -5611,14 +5608,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN __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, 197, __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":180 + /* "constraint/problem.py":179 * self._constraints.append((constraint, variables)) * * def getSolution(self): # <<<<<<<<<<<<<< @@ -5644,7 +5641,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN return __pyx_r; } -/* "constraint/problem.py":199 +/* "constraint/problem.py":198 * return self._solver.getSolution(domains, constraints, vconstraints) * * def getSolutions(self): # <<<<<<<<<<<<<< @@ -5692,32 +5689,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, 199, __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, 199, __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, 199, __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, 199, __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, 199, __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, 199, __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:; @@ -5758,7 +5755,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolutions", 0); - /* "constraint/problem.py":213 + /* "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) # <<<<<<<<<<<<<< @@ -5767,22 +5764,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, 213, __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, 213, __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, 213, __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, 213, __pyx_L1_error) + 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, 213, __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))) { @@ -5791,7 +5788,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, 213, __pyx_L1_error) + __PYX_ERR(0, 212, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -5803,27 +5800,27 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error) + 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, 213, __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, 213, __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, 213, __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, 213, __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); @@ -5833,7 +5830,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, 213, __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; @@ -5841,7 +5838,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, 213, __pyx_L1_error) + __PYX_ERR(0, 212, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_domains = __pyx_t_3; @@ -5851,18 +5848,18 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U __pyx_v_vconstraints = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/problem.py":214 + /* "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, 214, __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":215 + /* "constraint/problem.py":214 * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: * return [] # <<<<<<<<<<<<<< @@ -5870,13 +5867,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, 215, __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":214 + /* "constraint/problem.py":213 * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: # <<<<<<<<<<<<<< @@ -5885,7 +5882,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U */ } - /* "constraint/problem.py":216 + /* "constraint/problem.py":215 * if not domains: * return [] * return self._solver.getSolutions(domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -5893,7 +5890,7 @@ 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, 216, __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); @@ -5903,14 +5900,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U __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, 216, __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":199 + /* "constraint/problem.py":198 * return self._solver.getSolution(domains, constraints, vconstraints) * * def getSolutions(self): # <<<<<<<<<<<<<< @@ -5936,7 +5933,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U return __pyx_r; } -/* "constraint/problem.py":218 +/* "constraint/problem.py":217 * return self._solver.getSolutions(domains, constraints, vconstraints) * * def getSolutionIter(self): # <<<<<<<<<<<<<< @@ -5984,32 +5981,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, 218, __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, 218, __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, 218, __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, 218, __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, 218, __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, 218, __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:; @@ -6050,7 +6047,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolutionIter", 0); - /* "constraint/problem.py":234 + /* "constraint/problem.py":233 * StopIteration * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) # <<<<<<<<<<<<<< @@ -6059,22 +6056,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, 234, __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, 234, __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, 234, __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, 234, __pyx_L1_error) + 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, 234, __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))) { @@ -6083,7 +6080,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, 234, __pyx_L1_error) + __PYX_ERR(0, 233, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -6095,27 +6092,27 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + 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, 234, __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, 234, __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, 234, __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, 234, __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); @@ -6125,7 +6122,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, 234, __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; @@ -6133,7 +6130,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, 234, __pyx_L1_error) + __PYX_ERR(0, 233, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_domains = __pyx_t_3; @@ -6143,18 +6140,18 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO __pyx_v_vconstraints = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/problem.py":235 + /* "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, 235, __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":236 + /* "constraint/problem.py":235 * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: * return iter(()) # <<<<<<<<<<<<<< @@ -6162,13 +6159,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, 236, __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":235 + /* "constraint/problem.py":234 * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: # <<<<<<<<<<<<<< @@ -6177,7 +6174,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO */ } - /* "constraint/problem.py":237 + /* "constraint/problem.py":236 * if not domains: * return iter(()) * return self._solver.getSolutionIter(domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -6185,7 +6182,7 @@ 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, 237, __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); @@ -6195,14 +6192,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO __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, 237, __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":218 + /* "constraint/problem.py":217 * return self._solver.getSolutions(domains, constraints, vconstraints) * * def getSolutionIter(self): # <<<<<<<<<<<<<< @@ -6228,7 +6225,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO return __pyx_r; } -/* "constraint/problem.py":239 +/* "constraint/problem.py":238 * return self._solver.getSolutionIter(domains, constraints, vconstraints) * * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: # <<<<<<<<<<<<<< @@ -6277,35 +6274,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, 239, __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, 239, __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, 239, __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, 239, __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, 239, __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, 239, __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, 239, __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; } @@ -6316,7 +6313,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, 239, __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:; @@ -6327,7 +6324,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, 239, __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 */ @@ -6348,7 +6345,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":243 +/* "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) # <<<<<<<<<<<<<< @@ -6368,7 +6365,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, 243, __pyx_L1_error) + __PYX_ERR(0, 242, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6376,7 +6373,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, 243, __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; @@ -6413,13 +6410,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, 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, 243, __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, 243, __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; @@ -6427,13 +6424,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, 243, __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_GetItemRefFast(__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, 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); @@ -6446,13 +6443,13 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __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, 243, __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, 243, __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, 243, __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; @@ -6481,7 +6478,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":245 +/* "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) # <<<<<<<<<<<<<< @@ -6501,7 +6498,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, 245, __pyx_L1_error) + __PYX_ERR(0, 244, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6512,7 +6509,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, 245, __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; @@ -6550,13 +6547,13 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 245, __pyx_L1_error) - __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 245, __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, 245, __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, 245, __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; @@ -6564,20 +6561,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, 245, __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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __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, 245, __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; @@ -6597,10 +6594,10 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi __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, 245, __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, 245, __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; @@ -6629,7 +6626,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi return __pyx_r; } -/* "constraint/problem.py":239 +/* "constraint/problem.py":238 * return self._solver.getSolutionIter(domains, constraints, vconstraints) * * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: # <<<<<<<<<<<<<< @@ -6659,12 +6656,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, 239, __pyx_L1_error) + __PYX_ERR(0, 238, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/problem.py":241 + /* "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() # <<<<<<<<<<<<<< @@ -6678,14 +6675,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __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, 241, __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, 241, __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":242 + /* "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: # <<<<<<<<<<<<<< @@ -6700,15 +6697,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, 242, __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, 242, __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":243 + /* "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) # <<<<<<<<<<<<<< @@ -6716,16 +6713,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, 243, __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, 243, __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":242 + /* "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: # <<<<<<<<<<<<<< @@ -6734,18 +6731,18 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi */ } - /* "constraint/problem.py":244 + /* "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, 244, __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, 244, __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, 244, __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; @@ -6753,7 +6750,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":245 + /* "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) # <<<<<<<<<<<<<< @@ -6761,16 +6758,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, 245, __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, 245, __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":239 + /* "constraint/problem.py":238 * return self._solver.getSolutionIter(domains, constraints, vconstraints) * * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: # <<<<<<<<<<<<<< @@ -6795,7 +6792,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi return __pyx_r; } -/* "constraint/problem.py":247 +/* "constraint/problem.py":246 * return list(get_in_order(params) for params in solutions) * * def getSolutionsAsListDict( # <<<<<<<<<<<<<< @@ -6845,28 +6842,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, 247, __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, 247, __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, 247, __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, 247, __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, 247, __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":248 + /* "constraint/problem.py":247 * * def getSolutionsAsListDict( * self, order: list[str] = None, validate: bool = True # <<<<<<<<<<<<<< @@ -6875,21 +6872,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds */ 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("getSolutionsAsListDict", 0, 1, 3, i); __PYX_ERR(0, 247, __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, 247, __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, 247, __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, 247, __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; } @@ -6898,14 +6895,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_self = values[0]; __pyx_v_order = ((PyObject*)values[1]); if (values[2]) { - __pyx_v_validate = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_validate == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L3_error) + __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, 247, __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:; @@ -6916,10 +6913,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, 248, __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":247 + /* "constraint/problem.py":246 * return list(get_in_order(params) for params in solutions) * * def getSolutionsAsListDict( # <<<<<<<<<<<<<< @@ -6969,7 +6966,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolutionsAsListDict", 0); - /* "constraint/problem.py":251 + /* "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) # <<<<<<<<<<<<<< @@ -6983,26 +6980,26 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_order}; __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, 251, __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":252 + /* "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, 252, __pyx_L1_error) - __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __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":253 + /* "constraint/problem.py":252 * solutions_list = self.getSolutionsOrderedList(order) * size_list = len(solutions_list) * solutions_dict: dict = dict(zip(solutions_list, range(size_list))) # <<<<<<<<<<<<<< @@ -7017,7 +7014,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic 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, 253, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_3 = 1; @@ -7026,7 +7023,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic __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, 253, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_3 = 1; @@ -7035,13 +7032,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic __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_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __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":254 + /* "constraint/problem.py":253 * size_list = len(solutions_list) * solutions_dict: dict = dict(zip(solutions_list, range(size_list))) * if validate: # <<<<<<<<<<<<<< @@ -7050,32 +7047,32 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic */ if (__pyx_v_validate) { - /* "constraint/problem.py":256 + /* "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, 256, __pyx_L1_error) - __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __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":257 + /* "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 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, 257, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 257, __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_9)) { - /* "constraint/problem.py":258 + /* "constraint/problem.py":257 * size_dict = len(solutions_dict) * if size_list != size_dict: * raise ValueError( # <<<<<<<<<<<<<< @@ -7084,31 +7081,31 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic */ __pyx_t_5 = NULL; - /* "constraint/problem.py":259 + /* "constraint/problem.py":258 * if size_list != size_dict: * 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}" */ - __pyx_t_2 = PyNumber_Subtract(__pyx_v_size_list, __pyx_v_size_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) + __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, 259, __pyx_L1_error) + __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, 259, __pyx_L1_error) + __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, 259, __pyx_L1_error) + 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":260 + /* "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]))}", # <<<<<<<<<<<<<< @@ -7116,16 +7113,16 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * ) */ { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L7_error) + __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, 260, __pyx_L7_error) + __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, 260, __pyx_L7_error) + __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)) { @@ -7133,7 +7130,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic { 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, 260, __pyx_L7_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 259, __pyx_L7_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -7143,7 +7140,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic { 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, 260, __pyx_L7_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 259, __pyx_L7_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -7154,13 +7151,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 260, __pyx_L7_error) + 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, 260, __pyx_L7_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 259, __pyx_L7_error) PyErr_Clear(); } break; @@ -7176,15 +7173,15 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic 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, 260, __pyx_L7_error) + 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, 260, __pyx_L7_error) + __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, 260, __pyx_L7_error) + __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, 260, __pyx_L7_error) + 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; @@ -7195,34 +7192,34 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic 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, 260, __pyx_L1_error) + __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, 260, __pyx_L1_error) + __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_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, 260, __pyx_L1_error) + __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_Concat(__pyx_mstate_global->__pyx_kp_u_Duplicate_configs, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __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":261 + /* "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, 261, __pyx_L1_error) + __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, 261, __pyx_L1_error) + __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, 261, __pyx_L1_error) + __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, 261, __pyx_L1_error) + __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; @@ -7230,7 +7227,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic __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, 261, __pyx_L1_error) + 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; @@ -7242,14 +7239,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __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, 258, __pyx_L1_error) + 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, 258, __pyx_L1_error) + __PYX_ERR(0, 257, __pyx_L1_error) - /* "constraint/problem.py":257 + /* "constraint/problem.py":256 * # check for duplicates * size_dict = len(solutions_dict) * if size_list != size_dict: # <<<<<<<<<<<<<< @@ -7258,7 +7255,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic */ } - /* "constraint/problem.py":254 + /* "constraint/problem.py":253 * size_list = len(solutions_list) * solutions_dict: dict = dict(zip(solutions_list, range(size_list))) * if validate: # <<<<<<<<<<<<<< @@ -7267,7 +7264,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic */ } - /* "constraint/problem.py":263 + /* "constraint/problem.py":262 * f"Constraints: {self._constraints}, {self._str_constraints}" * ) * return ( # <<<<<<<<<<<<<< @@ -7276,29 +7273,29 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic */ __Pyx_XDECREF(__pyx_r); - /* "constraint/problem.py":264 + /* "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, 264, __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, 264, __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, 264, __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, 264, __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":247 + /* "constraint/problem.py":246 * return list(get_in_order(params) for params in solutions) * * def getSolutionsAsListDict( # <<<<<<<<<<<<<< @@ -7328,7 +7325,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic return __pyx_r; } -/* "constraint/problem.py":269 +/* "constraint/problem.py":268 * ) * * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< @@ -7376,35 +7373,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, 269, __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, 269, __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, 269, __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, 269, __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, 269, __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, 269, __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, 269, __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; } @@ -7415,7 +7412,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, 269, __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:; @@ -7437,7 +7434,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":290 +/* "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 # <<<<<<<<<<<<<< @@ -7457,7 +7454,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, 290, __pyx_L1_error) + __PYX_ERR(0, 289, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -7465,7 +7462,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, 290, __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; @@ -7505,21 +7502,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, 290, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 290, __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, 290, __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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __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; @@ -7527,7 +7524,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, 290, __pyx_L1_error) + __PYX_ERR(0, 289, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -7537,22 +7534,22 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ __Pyx_INCREF(__pyx_t_5); } else { __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L1_error) + 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, 290, __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, 290, __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, 290, __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); @@ -7560,7 +7557,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, 290, __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; @@ -7568,7 +7565,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, 290, __pyx_L1_error) + __PYX_ERR(0, 289, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c); @@ -7579,9 +7576,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, 290, __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, 290, __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); @@ -7623,7 +7620,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ return __pyx_r; } -/* "constraint/problem.py":269 +/* "constraint/problem.py":268 * ) * * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< @@ -7670,14 +7667,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_getArgs", 0); - /* "constraint/problem.py":270 + /* "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, 270, __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); @@ -7687,13 +7684,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __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, 270, __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":271 + /* "constraint/problem.py":270 * def _getArgs(self, picklable=False): * domains = self._variables.copy() * allvariables = domains.keys() # <<<<<<<<<<<<<< @@ -7707,55 +7704,55 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __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, 271, __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":272 + /* "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, 272, __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":275 + /* "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, 275, __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, 275, __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":277 + /* "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, 277, __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, 277, __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, 277, __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 (;;) { @@ -7764,7 +7761,7 @@ 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, 277, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 276, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -7774,7 +7771,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { 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, 277, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 276, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -7785,13 +7782,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __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, 277, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 276, __pyx_L1_error) PyErr_Clear(); } break; @@ -7801,7 +7798,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":278 + /* "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) # <<<<<<<<<<<<<< @@ -7809,13 +7806,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, 278, __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, 278, __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, 278, __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))) { @@ -7830,21 +7827,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, 278, __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, 278, __pyx_L1_error) + 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, 278, __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":279 + /* "constraint/problem.py":278 * for constraint in self._str_constraints: * parsed = compile_to_constraints([constraint], domains, picklable=picklable) * for c, v, _ in parsed: # <<<<<<<<<<<<<< @@ -7856,9 +7853,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, 279, __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, 279, __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)) { @@ -7866,7 +7863,7 @@ 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, 278, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -7876,7 +7873,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { 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, 278, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -7887,13 +7884,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 279, __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, 279, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 278, __pyx_L1_error) PyErr_Clear(); } break; @@ -7906,7 +7903,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, 279, __pyx_L1_error) + __PYX_ERR(0, 278, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -7918,27 +7915,27 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 279, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_10); __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 279, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_9); __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __pyx_L1_error) + 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, 279, __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, 279, __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, 279, __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, 279, __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); @@ -7948,7 +7945,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, 279, __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; @@ -7956,7 +7953,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, 279, __pyx_L1_error) + __PYX_ERR(0, 278, __pyx_L1_error) __pyx_L9_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_10); @@ -7966,7 +7963,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":280 + /* "constraint/problem.py":279 * parsed = compile_to_constraints([constraint], domains, picklable=picklable) * for c, v, _ in parsed: * self.addConstraint(c, v) # <<<<<<<<<<<<<< @@ -7980,12 +7977,12 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_c, __pyx_v_v}; __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, 280, __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":279 + /* "constraint/problem.py":278 * for constraint in self._str_constraints: * parsed = compile_to_constraints([constraint], domains, picklable=picklable) * for c, v, _ in parsed: # <<<<<<<<<<<<<< @@ -7995,7 +7992,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":277 + /* "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: # <<<<<<<<<<<<<< @@ -8005,7 +8002,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":275 + /* "constraint/problem.py":274 * * # parse string constraints * if len(self._str_constraints) > 0: # <<<<<<<<<<<<<< @@ -8014,23 +8011,23 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE */ } - /* "constraint/problem.py":283 + /* "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, 283, __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, 283, __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, 283, __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 (;;) { @@ -8039,7 +8036,7 @@ 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, 283, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 282, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -8049,7 +8046,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { 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, 283, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 282, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -8060,13 +8057,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __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, 283, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 282, __pyx_L1_error) PyErr_Clear(); } break; @@ -8079,7 +8076,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, 283, __pyx_L1_error) + __PYX_ERR(0, 282, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8089,22 +8086,22 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 283, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error) + 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, 283, __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, 283, __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, 283, __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); @@ -8112,7 +8109,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, 283, __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; @@ -8120,7 +8117,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, 283, __pyx_L1_error) + __PYX_ERR(0, 282, __pyx_L1_error) __pyx_L15_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_8); @@ -8128,30 +8125,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":284 + /* "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, 284, __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":285 + /* "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, 285, __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":284 + /* "constraint/problem.py":283 * # add regular constraints * for constraint, variables in self._constraints: * if not variables: # <<<<<<<<<<<<<< @@ -8160,25 +8157,25 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE */ } - /* "constraint/problem.py":286 + /* "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, 286, __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, 286, __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, 286, __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, 286, __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":283 + /* "constraint/problem.py":282 * * # add regular constraints * for constraint, variables in self._constraints: # <<<<<<<<<<<<<< @@ -8188,17 +8185,17 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":289 + /* "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, 289, __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":290 + /* "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 # <<<<<<<<<<<<<< @@ -8207,24 +8204,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, 290, __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, 290, __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, 290, __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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_You_have_used_FunctionConstraint, 0, 0); - __PYX_ERR(0, 290, __pyx_L1_error) + __PYX_ERR(0, 289, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 290, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 289, __pyx_L1_error) #endif - /* "constraint/problem.py":289 + /* "constraint/problem.py":288 * * # check if there are any precompiled FunctionConstraints when there shouldn't be * if picklable: # <<<<<<<<<<<<<< @@ -8233,19 +8230,19 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE */ } - /* "constraint/problem.py":292 + /* "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, 292, __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":293 + /* "constraint/problem.py":292 * * vconstraints = {} * for variable in domains: # <<<<<<<<<<<<<< @@ -8257,9 +8254,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, 293, __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, 293, __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)) { @@ -8267,7 +8264,7 @@ 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, 293, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 292, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -8277,7 +8274,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { 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, 293, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 292, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -8288,13 +8285,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __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, 293, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 292, __pyx_L1_error) PyErr_Clear(); } break; @@ -8304,19 +8301,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":294 + /* "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, 294, __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, 294, __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":293 + /* "constraint/problem.py":292 * * vconstraints = {} * for variable in domains: # <<<<<<<<<<<<<< @@ -8326,7 +8323,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":295 + /* "constraint/problem.py":294 * for variable in domains: * vconstraints[variable] = [] * for constraint, variables in constraints: # <<<<<<<<<<<<<< @@ -8339,13 +8336,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, 295, __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_GetItemRefFast(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __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; @@ -8353,7 +8350,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, 295, __pyx_L1_error) + __PYX_ERR(0, 294, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8363,22 +8360,22 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 295, __pyx_L1_error) + 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, 295, __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, 295, __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, 295, __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); @@ -8386,7 +8383,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, 295, __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; @@ -8394,7 +8391,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, 295, __pyx_L1_error) + __PYX_ERR(0, 294, __pyx_L1_error) __pyx_L25_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_2); @@ -8402,7 +8399,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":296 + /* "constraint/problem.py":295 * vconstraints[variable] = [] * for constraint, variables in constraints: * for variable in variables: # <<<<<<<<<<<<<< @@ -8414,9 +8411,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, 296, __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, 296, __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)) { @@ -8424,7 +8421,7 @@ 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, 296, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 295, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -8434,7 +8431,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { 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, 296, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 295, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -8445,13 +8442,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 296, __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, 296, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 295, __pyx_L1_error) PyErr_Clear(); } break; @@ -8461,28 +8458,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":297 + /* "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, 297, __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, 297, __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, 297, __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, 297, __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, 297, __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":296 + /* "constraint/problem.py":295 * vconstraints[variable] = [] * for constraint, variables in constraints: * for variable in variables: # <<<<<<<<<<<<<< @@ -8492,7 +8489,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":295 + /* "constraint/problem.py":294 * for variable in domains: * vconstraints[variable] = [] * for constraint, variables in constraints: # <<<<<<<<<<<<<< @@ -8502,14 +8499,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":298 + /* "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, 298, __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; @@ -8518,13 +8515,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, 298, __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_GetItemRefFast(__pyx_t_1, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __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; @@ -8532,7 +8529,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, 298, __pyx_L1_error) + __PYX_ERR(0, 297, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8542,22 +8539,22 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 298, __pyx_L1_error) + 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, 298, __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, 298, __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, 298, __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); @@ -8565,7 +8562,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, 298, __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; @@ -8573,7 +8570,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, 298, __pyx_L1_error) + __PYX_ERR(0, 297, __pyx_L1_error) __pyx_L33_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_2); @@ -8581,7 +8578,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":299 + /* "constraint/problem.py":298 * vconstraints[variable].append((constraint, variables)) * for constraint, variables in constraints[:]: * constraint.preProcess(variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -8595,12 +8592,12 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE 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((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, 299, __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":298 + /* "constraint/problem.py":297 * for variable in variables: * vconstraints[variable].append((constraint, variables)) * for constraint, variables in constraints[:]: # <<<<<<<<<<<<<< @@ -8610,7 +8607,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":300 + /* "constraint/problem.py":299 * for constraint, variables in constraints[:]: * constraint.preProcess(variables, domains, constraints, vconstraints) * for domain in domains.values(): # <<<<<<<<<<<<<< @@ -8620,9 +8617,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, 300, __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, 300, __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; @@ -8630,12 +8627,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, 300, __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":301 + /* "constraint/problem.py":300 * constraint.preProcess(variables, domains, constraints, vconstraints) * for domain in domains.values(): * domain.resetState() # <<<<<<<<<<<<<< @@ -8649,23 +8646,23 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; __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, 301, __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":302 + /* "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, 302, __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":303 + /* "constraint/problem.py":302 * domain.resetState() * if not domain: * return None, None, None # <<<<<<<<<<<<<< @@ -8678,7 +8675,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":302 + /* "constraint/problem.py":301 * for domain in domains.values(): * domain.resetState() * if not domain: # <<<<<<<<<<<<<< @@ -8689,28 +8686,28 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":305 + /* "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, 305, __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, 305, __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, 305, __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, 305, __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":269 + /* "constraint/problem.py":268 * ) * * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< @@ -9632,15 +9629,15 @@ 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, 164, __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, 164, __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, 164, __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); @@ -9651,15 +9648,15 @@ 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, 239, __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, 239, __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, 239, __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); @@ -9670,15 +9667,15 @@ 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, 243, __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, 243, __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, 243, __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); @@ -9689,15 +9686,15 @@ 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, 245, __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, 245, __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, 245, __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); @@ -9708,15 +9705,15 @@ 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, 290, __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, 290, __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, 290, __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); @@ -10039,7 +10036,7 @@ __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_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) @@ -10051,19 +10048,19 @@ __Pyx_RefNannySetupContext("PyInit_problem", 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 */ { - 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, 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); { - PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_warn}; - __pyx_t_3 = 0; { + 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) @@ -10074,10 +10071,10 @@ __Pyx_RefNannySetupContext("PyInit_problem", 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 + * from warnings import warn + * */ { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_itemgetter}; @@ -10097,21 +10094,21 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/problem.py":6 - * 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 CompilableFunctionConstraint, Constraint, FunctionConstraint */ { - PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Callable,__pyx_mstate_global->__pyx_n_u_Optional,__pyx_mstate_global->__pyx_n_u_Union}; - __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_typing, __pyx_imported_names, 3, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __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); { - PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Callable,__pyx_mstate_global->__pyx_n_u_Optional,__pyx_mstate_global->__pyx_n_u_Union}; - for (__pyx_t_3=0; __pyx_t_3 < 3; __pyx_t_3++) { + 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) @@ -10120,46 +10117,46 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":7 - * from operator import itemgetter - * from typing import Callable, Optional, Union - * 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.parser import compile_to_constraints */ { - PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Sequence,__pyx_mstate_global->__pyx_n_u_Hashable}; - __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, 7, __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); { - PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Sequence,__pyx_mstate_global->__pyx_n_u_Hashable}; - 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, 7, __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, 7, __pyx_L1_error) + 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; /* "constraint/problem.py":9 - * from collections.abc import Sequence, Hashable * - * from constraint.constraints import Constraint, FunctionConstraint, CompilableFunctionConstraint # <<<<<<<<<<<<<< - * from constraint.domain import Domain - * from constraint.solvers import Solver, OptimizedBacktrackingSolver, ParallelSolver + * from constraint.constraints import CompilableFunctionConstraint, Constraint, FunctionConstraint + * from constraint.domain import Domain # <<<<<<<<<<<<<< + * from constraint.parser import compile_to_constraints + * from constraint.solvers import OptimizedBacktrackingSolver, ParallelSolver, Solver */ { - 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, 9, __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); { - 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++) { + 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) @@ -10169,20 +10166,20 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/problem.py":10 + * from constraint.constraints import CompilableFunctionConstraint, Constraint, FunctionConstraint + * from constraint.domain import Domain + * from constraint.parser import compile_to_constraints # <<<<<<<<<<<<<< + * from constraint.solvers import OptimizedBacktrackingSolver, ParallelSolver, Solver * - * from constraint.constraints import Constraint, FunctionConstraint, CompilableFunctionConstraint - * from constraint.domain import Domain # <<<<<<<<<<<<<< - * from constraint.solvers import Solver, OptimizedBacktrackingSolver, ParallelSolver - * from constraint.parser import compile_to_constraints */ { - 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, 10, __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); { - PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Domain}; + 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); @@ -10193,20 +10190,20 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/problem.py":11 - * from constraint.constraints import Constraint, FunctionConstraint, CompilableFunctionConstraint * 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: */ { - PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Solver,__pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver,__pyx_mstate_global->__pyx_n_u_ParallelSolver}; + 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); { - PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Solver,__pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver,__pyx_mstate_global->__pyx_n_u_ParallelSolver}; + 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); @@ -10216,32 +10213,8 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":12 - * from constraint.domain import Domain - * from constraint.solvers import Solver, OptimizedBacktrackingSolver, ParallelSolver - * from constraint.parser import compile_to_constraints # <<<<<<<<<<<<<< - * - * try: -*/ - { - 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, 12, __pyx_L1_error) - } - __pyx_t_2 = __pyx_t_1; - __Pyx_GOTREF(__pyx_t_2); - { - 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, 12, __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, 12, __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 @@ -10256,7 +10229,7 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { - /* "constraint/problem.py":15 + /* "constraint/problem.py":14 * * try: * from sys import _is_gil_enabled # <<<<<<<<<<<<<< @@ -10265,22 +10238,22 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); */ { 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, 15, __pyx_L2_error) + __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); { 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, 15, __pyx_L2_error) + __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, 15, __pyx_L2_error) + 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; - /* "constraint/problem.py":16 + /* "constraint/problem.py":15 * try: * from sys import _is_gil_enabled * freethreading = _is_gil_enabled() # <<<<<<<<<<<<<< @@ -10288,7 +10261,7 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * freethreading = False */ __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, 16, __pyx_L2_error) + __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; { @@ -10296,14 +10269,14 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); __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, 16, __pyx_L2_error) + 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_2) < (0)) __PYX_ERR(0, 16, __pyx_L2_error) + 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 @@ -10319,7 +10292,7 @@ __Pyx_RefNannySetupContext("PyInit_problem", 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: # <<<<<<<<<<<<<< @@ -10329,19 +10302,19 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); __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_2, &__pyx_t_8, &__pyx_t_4) < 0) __PYX_ERR(0, 17, __pyx_L4_except_error) + 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) + 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; @@ -10349,8 +10322,8 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); } 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 @@ -10370,27 +10343,27 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); __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_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, 21, __pyx_L1_error) + __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_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 24, __pyx_L1_error) + __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, 24, __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, 24, __pyx_L1_error) + 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); @@ -10398,106 +10371,106 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); __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, 24, __pyx_L1_error) + 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_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, 44, __pyx_L1_error) + __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, 44, __pyx_L1_error) + 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_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, 57, __pyx_L1_error) + __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, 57, __pyx_L1_error) + 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_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, 72, __pyx_L1_error) + __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, 72, __pyx_L1_error) + 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_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + __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, 86, __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, 86, __pyx_L1_error) + 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, 86, __pyx_L1_error) + 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":118 + /* "constraint/problem.py":117 * self._variables[variable] = domain * * def addVariables(self, variables: Sequence, domain): # <<<<<<<<<<<<<< * """Add one or more variables to the problem. * */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 118, __pyx_L1_error) + __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, 118, __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, 118, __pyx_L1_error) + 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, 118, __pyx_L1_error) + 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":141 + /* "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_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) + __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_Union_Constraint_Callable_str) < (0)) __PYX_ERR(0, 141, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables_2, __pyx_mstate_global->__pyx_kp_u_Optional_Sequence) < (0)) __PYX_ERR(0, 141, __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, 141, __pyx_L1_error) + 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); @@ -10505,66 +10478,66 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); __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, 141, __pyx_L1_error) + 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":180 + /* "constraint/problem.py":179 * self._constraints.append((constraint, variables)) * * def getSolution(self): # <<<<<<<<<<<<<< * """Find and return a solution to the problem. * */ - __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, 180, __pyx_L1_error) + __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, 180, __pyx_L1_error) + 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":199 + /* "constraint/problem.py":198 * return self._solver.getSolution(domains, constraints, vconstraints) * * def getSolutions(self): # <<<<<<<<<<<<<< * """Find and return all solutions to the problem. * */ - __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, 199, __pyx_L1_error) + __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, 199, __pyx_L1_error) + 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":218 + /* "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_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, 218, __pyx_L1_error) + __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, 218, __pyx_L1_error) + 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":239 + /* "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_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) + __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, 239, __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, 239, __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, 239, __pyx_L1_error) + 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); @@ -10572,35 +10545,35 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); __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, 239, __pyx_L1_error) + 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":248 + /* "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, 248, __pyx_L1_error) + __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":247 + /* "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_8 = PyTuple_Pack(2, Py_None, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 247, __pyx_L1_error) + __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, 247, __pyx_L1_error) + __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, 247, __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, 247, __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, 247, __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, 247, __pyx_L1_error) + 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); @@ -10609,38 +10582,38 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); __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, 247, __pyx_L1_error) + 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":269 + /* "constraint/problem.py":268 * ) * * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< * domains = self._variables.copy() * allvariables = domains.keys() */ - __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, 269, __pyx_L1_error) + __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, 269, __pyx_L1_error) + 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_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, 21, __pyx_L1_error) + __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, 21, __pyx_L1_error) + 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; @@ -10651,15 +10624,15 @@ __Pyx_RefNannySetupContext("PyInit_problem", 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_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_4, __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_4, __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_4, __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_4, __pyx_mstate_global->__pyx_kp_u_Problem_addVariables_line_118, __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_141, __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_180, __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_199, __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_218, __pyx_mstate_global->__pyx_kp_u_Return_an_iterator_to_the_soluti) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) + 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; @@ -10702,7 +10675,7 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 253, __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; @@ -10722,63 +10695,67 @@ 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":303 + /* "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, 303, __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":269 + /* "constraint/problem.py":268 * ) * * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< * domains = self._variables.copy() * allvariables = domains.keys() */ - __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(1, ((PyObject*)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 269, __pyx_L1_error) + __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 CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + 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 } @@ -10788,16 +10765,20 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { { PyObject **table = __pyx_mstate->__pyx_slice; for (Py_ssize_t i=0; i<1; ++i) { - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + 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 } @@ -10814,39 +10795,39 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); { - const struct { const unsigned int length: 10; } index[] = {{2},{1010},{514},{677},{335},{54},{13},{67},{15},{59},{19},{40},{373},{393},{4},{179},{327},{18},{127},{32},{29},{31},{34},{30},{31},{27},{23},{27},{235},{453},{36},{32},{94},{227},{2},{1},{1},{8},{21},{7},{43},{6},{2},{9},{9},{11},{45},{41},{8},{8},{28},{10},{6},{18},{8},{27},{8},{14},{7},{16},{16},{33},{21},{38},{19},{20},{19},{23},{20},{30},{48},{31},{17},{13},{17},{20},{8},{6},{5},{1},{13},{11},{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},{6},{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 (2995 bytes) */ -const char* const cstring = "(\265/\375`\006 M]\000\252p\014\027G\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\254jD\344\252\353Z\225M\260\302\2155\252\301\034\272\213\221\220\004\013X(\335y[\001>\001B\001`\001\033\274\247-\305G\035B\204\356[\377\214\273\277\370\273\357\276\253\256\364W\255\361\255\272\373]\367\303\320\270\354\327>z\353}\333G[W;;L\347\276\377\331al\356ql,=Y\241\377r\314\216\025\037\355 \271)e\246\344\010\211B\241}\347\316\330\353\300\331y~\232\361{\340\276\230\336\367\336\3053\373M\325Sp\243\277\271W\251\246\323\230D\377\265~\277\016\271+\263\266\332\370\236\237\235\256\327p1k\203/\242\220O\317\365\357D9}\372Y\356V\221\326\2373F\001nN\337\363f\266\361\337\270\373\251|DCc\322zZ\316\004z&Wa\177\356\316\032\322\253|\202\331\277j\361\272?\213\265\347wa\317\257\372\021}\235\247\347\240\265\223\253x\177\323G{v\031\253|u\253\333\271\357w5\277w\363^\301\335E(+\3362\3027z\247\243\250Loi\361\315M\233\217\246O\272u\323\206P3\035|\264\342#\222\214\217fP6\024\037\241L\024\231\220\2365\317\031\224\316L\024z\361\026\0371b\204\351\255\327\315\233\023~\340@\326\275\335p\366\374Y\333\361\366}\353\314[_\314\371tJO\231(\277\361\325(\235$2\037\211@\226\315t\315aZ\301v\233\365\033p\315\266o\225y\0336\230\264\2677\313_\324\242i\375\234~\327d\371\207md\371=\317X\177\223\333\377Y\345\373\303\254]m\374)\356\334b\374B\347gV\214_-cf\204\222\2712(\365\235\277\036\360\360\206\311\262l\353i\237\373\354[\343.\344\333s3\264o\376z!\025\316xW\277\323?\206\010\204\007]*\255\200p\205\010\301\201eE\005\013I\177`y\021\221J$\377\373\222\351\377\264\376\354\257\347\333\027\317\364T\325T{\277\221\256\366\255\235y\276\314\300\310\330\rF\366\332N\024\271RO\001\26767\276w\246\274\366\253\247\367\327?\014\272J\205g\372\326m\353\267\225XJ\032^N\274\370\235\240\375=\363o\325>E\375\306/N\372\353\214\314\214\214\265n\362\274\3319\230'Wi\214\035+\245\322_\374\302\365\364\233?z+\n\337x\345#\275yU\265'W\301\355u\357\333\247\365o\276\365\327\271\233t\366\256""\257y\177~\274\235\242l\376\305\324\325a\362\256\341\246\t\3728\265\253\333\203\341-\257?\320\356\3739\177\277\272\223\205\322>g*\021JO\311'l\302+\204l\215\"`\032^'\244\207l\021Y\302\235\243\000$F\nKb\244\312\007>btL0\020\354\344\025CbqB\270 \004\200\004\010)\321%\022\272\344\210\204\0000\371q\352q\032?b+d\221\363i\211@;'\221$\316\250\021\236B\023\221\030i\004\215'Sd\205\251\320\004\212\t\031|b10%\213\017\220\017\020:\033V\202\211^ \310\031\243\212H\"\342\344\224r\020\200\304R\342I\314\020NX\nf\002\363\300X\026\224\013>1\222\270CT\030\"\347\023\002\300\177\234F\013\003J\257\342\350\233\247\215\246\367\244\325N\227\313\006g\326\326\277u\336\232\246\367\265\312~\376=7\214\246?\327l\347\327z\355\345\263\347a\257\206\253\036\325\036\356\346\325o?\212\347\376N\3234\3705Z\263u\245iM\353~\327\215\357\247\3224\315a\252i\336?\335\367\303\034\350\351L3\ro\3559n\233\334[\213\271\327\330r[\343\362|\313q\026\343M\377\305\031s\031\256\334\005\365\244\367=\317\245\251>\306\276\371\027\332\rH\077\077\3150\\\266\256-\364\351\216\320\330\212\3104M\323RT\257\303\250\254\336\317g\366h$\023r]5\315\214\014\325\225[\335\377f\376\362\357\357<\327\225\202^\251\360\024\232\274,\274(\311\243\024zNc\006\221\316r\322\2244\2442\204\304!Z\030y\255\200`\246Oy\202\211\000\225\334\347GK\274\001wH\343\214\224\250r\032i\210\253p\205N\367\262A\252\324\204\r^2$\230\0162\006\271\032m\210\247\324(A\364|@vj\320(i\\(/\224\224\244\023\371\031\267\217\213(a$F\212\031E\346\230@|`\022k\211\027D=\202\243SO\312\223\021*&\330\361\220\333\210\241\244\33493\247\303\2136sd0\326\204\026\302\005 \261\226\260dt\340\n\035\220z40\266D\324\211\260$\374@\362r1\016\030\035d\007\244cBC\271j\2157>\241Gl\021\3721G\014\003J\317H2\246\306\2248\311\321\030`t \272 \031\347\016\010F\002\013\021\363\220-\"\220\304<\257\026\271aB9ad\347f\216\243\002?p\2248J\224%@%\310\201\010\211\203\0214R\216\214\026\303\217\0312J\025\037+Beh@)\362\211\205\200\354\270T0\211\331\232\262\246\226UU\252\276|\255\324R%\347\203\007\354\002\214\276L\274H/""\320K\223\223\264@\222\220\"\223\330\r\033\245\215\032e\215\n\345\202\021'\234a\003\223\230g\304\0216\030)Q\360\021 >\370\354\220\010\300XBekD\215\244q\213\024P\241\tHl\276R/\017\023J\023\361\004d\347@H\214\344\2053\2460(\031$\210\235z\220FB\000<\000\351\314\274T\220$2\202\232\250r\233\026\204\016!\022\031\021I\222$\215\001R\020\010\010\244\211\034i\263=R\231<\213\201 \245\0142\206(\"#\"\023\211\210\210\024\024$)\024:\006\202Z\231 \\\270Gs)\221\242\025*\300\020C{\265f.\026\376\3028\310(j%\361\213u2j^\272\265\331=\310\030!\026r'\266W\200\016\260UX\004\237\375 \000\242\267+w\034\374\333o\031\324\355L\316\257w\331\027\336\025\0173K\362\270\375!!\3710\341\236\2448>\\@-B\344}\364\203\350\246\266\265s\351\220\324\232\330d\007\350\"]&\215A\322O\205x6\223J8\004J\247\270.fC\n\006%\255]i\346\027k\005\306\202\364\270\222f(z\032\277U\202\316#q\272\307\275\336\312\n\253\212\330\330\274E^H\236{\373\237\350:@\003\256\224}\225\341\255#A\233\227\244\360\035\242q\371\317_l^\342s\362M}\007\323\217f@\317\327\255\227\357\274\3163\337Z\335\325_\030\2145\341\356\266\337\350\005\206\305\007\316D \311\250c\224\307`\323\373\347:\030`\270\241C\230\372\240\210\255\244\250\323~\n9CP\206\251\\\345\202\255\316dE\025bc\023\331\004\320\026t\322\226J$\2026J\035u\332\356 k\206\303$c\252~\327\212\025\220\271\220y\310X5p\356q\206:\311j\214>\323*\2337\236\212\316bL16\246C:M\251\025\323\025y\302\201a@\262*G\237\000\ny\272\320\2777\306\025+\0226\016\010V\014\366u\210\036\357[\001\036\372\321\0160\277\017i\324\242\035g\231\202\006]\333\006\034\002"; - PyObject *data = __Pyx_DecompressString(cstring, 2995, 3); + 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},{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 (2976 bytes) */ +const char* const cstring = "(\265/\375`\353\037\265\\\000Jp\370\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\327\264\245\370\310\203\210\320}\353\237q\367\027\177\367\335w\325\225\376\2525\276Uw\277\353\376\227\031\227\375\332Go\275o\373h\353jg\207\351\334\367?{\214\315}\216\215\245'+\364_\206\341\241\342#\036$/\245\314\024\035!Q(\264\357\334\031{\0358;\317O3~\017\334\027\323\373\336\273xf\277\251z\nn\3647\367*\325\364\231\222\350\277\326\357\327!we\326\326\032\337\363\263\323\365\033.fm\020%\n\371\364\\\377\316\223\323\247\237\345n\025i\3759\343\024\340\346\364=o\346\032\377\215\273\237\312G33%\255\247\345J\240Wr\025\366\347\356\254!\275\312\246\227\375\253\026\257\373\263X{~\027\366\374\252\037\321\327yz\016Z;\271\212\3677}\264g\227\261\312W\267\272\235\373~W\363{6\357\025\334]\204\242\342-$|\243w:\212\206\351--\276yi\363\321\364I\267n\332\320I\306\203\217T|D\212\361\221\014\312\206\342#\224\211\022\023\322\263\346I\203\322\231\211B(oq\022$H\224\336z\335\264A\341\007\016d\335\333\rg\317\237\265\035o\337\267\316\274\365\305\234O\247\324\224\211\002\033_\215\322Y\"\363\221\010d\325L\327\034\246\025l\267Y\317\001\327l\373V\231\307\201CI{{\263\374E-\232\326\317\351wM\226\177\370F\226\337\363\214\3657\271\375\237U\276?\314\332\265\306\237\342\316-\306(:?\263`\374\352\031\224\372\316_3\314\216\027\017\357\227,\313\266\236\366\271\317\2765\356B\276=7C\333\346\357\256^H\2053\336\325\357\364\227!\002\361A{X!\205p\261\210\020\021BeE\010\222\376\300\202\022uX!\371_T\246\377\323\372\263\277\236oQ\236\351\251\242\251\366~#]\355[;\363Dm1\262\327v\246\310\225z\n\270\265\271\361\2753\345\265_=\275\277\376a\320U+<\323\267n[\277m\205ee\003\n\005\312o\006\355\357\231\177\253\366\351\3517\206a\322_ebdb\254\365\222\347\315\316\301<\271Je\360PYY\371\213a\270\236~\363GoM\341\033\257|\2447\257\252\366\344*\270\275\356\267O\353\337|\353\257s""/\351\223\357\310\336\3655\357\317\217\267\323S\315\303\230\272\372K\3364\334!\000|\3074Z\030Pz\365F\337{\036\366h\270\352Q\355\341n^\375\366\243x\356\3574M\203O\2435[W\232\326\264\356w\335\370~*M\323\034\246\232\346\375\323}?\314\201\236\3164\323\360\326\236\343\266\311\275\265\230{\215-\2675.\317\267\034g1\336\364_\2341\227\341\312]POz\337\363\\\252\227\261m\036\206f\003\322\317Os\014\227\255\253\013m\272$4\266#2M\3234\025\325\353\360)\253\367s\231=\032\305\204\\W=##\023Cu\345V\367\277\231\277\374\373;\317u\245\240\367\001\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\222\310\202\226\250\222\223\026\204\016\r\211\214\210$I\222\306R\020\010\210\244\201\234)\263=b\221\242\3448\022R\006\031C\024\221\021\221\211DDD\n\n\222\024\n\035\006\302\332\227Bt\261W\343B\"\324\212]\326P\244\275e\346\224\t\177w_m\024\362\222\365\305\247\214i^Cm[\217WG\350\007r;\266*@\007X\r,0\037\210\020\356Qv+K\016\265\355[\031D;s\326w\263\234\316o\025\217CJ\226\270\337\321\350\370)\341\rR\214\372(\200\352@\204\343\365{Q\266\366\204\307\342 \324>\272\345\003(!\335;\215\200\244\217\n\t6\023W\370\013\224g\360\021\263\201\r\0069[\333l\346\0253\004\306\n\351\321$\275\241 ox\243\216\236\227\307q\3005\275\r&\026\031\261\301\374M\274\220\034\367\364\317\314\365\217\006\314)KT\252V\207\204NSI\316;\304\374\022\201\337\373\374\226\317vg\304p\244\037\215@\317\3609\207\0205HZ\331Z\227\301\n\245\014.@?o7\001Ar\225\234l\025q\346/-\003\035\347\032\377\3560\302rn\246\354\362\n\nqOR\313h\204\001r1d\223\353\355\007\233\213\325RGB\026\203>Z,\361\323\230E\362BI@\375iW\244\003ba\342t\002\276\201\323\241\206D\332\305jO#yI\3455\2332?B\376\352Np\177R\363\357\2121\356\371\305\016t\006\020'\026\234\023\336\325\330\315\206\032-4\351\206\241\020m\274\340\372\025\343\351\244\335\210\020H\360\270'\250\0263\3328\317\231G\312t\350A\377\016\001\272\326a\"x.%\016\344k\266e|\266\325\264N\363\300\037\022\312\310\264f\007b\006\215\006\247\032\2776\353j\331-i\305\250\240\351HV\260\372\330H\034w<\006\247\000\276E\"\240\006\216\260\217\016\361\361\331\356\373\035%\333\343\262\271\223\330\311\370StW\251I\\\214\032(\351\223\034q\201'1\274\223\305\313\314\250l$\333H\034\360\242\251\223\2737\255\360\352V\327\212\006_-\326\022\327\311\023\024*\206\330%n\243\210\310\203\005\315\024cCm\364\264)\216\252h\215X6\231\302-\260\353K\324B\315\375\223Ek\3756\315\226\300SP""\037\031\343\314\221i\227\324\037\037\034N\213\351\005{\266\234D\2571\234\230-\002\355\371\203\247,\273\310\370<\302u\210&\323UC\240x?!\203\311\232>\306*x\214\201\341\264]g\021N\220\320j}m\034\017f\346\205{M\027\352D}\372p\323U\347\354(\312\361\305\223$\375Z\241\220\234\246\310\235\032\361\312\002\370!\360\002\204\351\374\000.\243\264X\272L\360\"[p\207\231\243\306;\242\334\034z?i\360\253\270c\363i\350\000M\355\246\220\261t2\216\356v\014\271\037*\035\357!e\314\247\342\274K\003L\034E\270c\252_\246}\236\263\304""\355\206\311\261#\004\324V\347iQ\200\240u\237\353\365\003\235\207w\346KQ\303\372\033\377\261V\335\331\373\365Kf.z\327\031\0054\031\036C\241\024\354\222\3775\212!\343\346\333a\264\203a[\205t]\317\251\313\rM\031\216v\335l\266>\017\024-\317MH\304C\000\250\200\303\2662\"t4Q\351\316g\013\016L3s\3448\363\265+L\252@(\224\350CFi(pW\010U^\2502\372iV\273c\361N\364T\343 \335\210FHY*Qy\r\237\247\262\014I\222\260\334\025\207b\311\010\010m\337H\254X\327a\326\200\255\300d]!\317\303\270UH\262\037\354\200\276\373\220j\215\344*\226\030\304\217\252\232\374!"; + PyObject *data = __Pyx_DecompressString(cstring, 2976, 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 (3079 bytes) */ -const char* const cstring = "BZh91AY&SY\272\020\200\237\000\003)\177\377\377\377\377\376\377\377\377\367\377\177\377\372\377\377\377\376\300@@@@@@@@@@@@\000@\000`\014n\370\344\212;J\335\330\235:]\200\255P\001Dl\324\200\003\262\037^\r\t\010\204\363*z\003j`\223\303S\323\"\214\322yM=\010\304\320\323OQ\223\t\24024h\3044\336\244\0065\032i\351=A\240 &\201\024\324~\244\315C\t\246M\3514\324\362\232\003\020\000h4\000\000\000\000\000\014\201\352 \311\200\023\000\0010\004i\204`\000\000\000\2314\304\320`\004`\000\000\000\004\232\222S\325=OS\325?)\352z\217T\364\217Pzz\223\321\r\006\236\246\2314\323 \320\014\201\2404\000\323\023@\000\321\202yA\241\332&\t\200\32110\00110\004\320\300\002i\200&L\000\010\300\010`\230\t\2024\301\"@\204\320L\023Bz\232d\365\006\212=\023L#dC\3224\032\000\320\000\000\000\321\210\320\031\014\203\005,\347\337Hi\305\344\034\261\017\312\\\226\177C\366\\\277\300\240\261(\326E\"\220\355\002\206@\022\230\266J\354\366a\005\212*\351\022H\356@6\247o\350t\247\026\006\315s\355[\300}\250A\354\022\264\227\263\341\025\357\324I\201T\320\177G#\346\344\226GH\306\316v)8EfA\355\372\337\332\313\327\320\275\376\22096\241nc`\r\363r1\244TUK\256o:\322V(\212P8\"r\224\225\023ne\354M\336X\230\245P\270\341l\365\352jUY\314\247S\001\214\330!+\314-\252\006\346\334R\3023\221S\233\311\2114\347\264\254j\2479\013\234K|\253\030\343\221Vp\335@\242\014Y\024\003\t@i \010\020pH\005\276=4\373\021\326\201\364\357#\265\022\223'3\332\354T\225\250\035'\253\"L\220\306\240=\225\303\327'\220\340\201\340g=\205C\016\346K\347\242s\227\365\236\212O\007\234\320K\361\200b\002\370\026G\030\330\001\000\342\013NL\016+\020w\376\r\201\364\374\3751\025\317>\002\266I:9\304~\2103\223_\234\re\232\233\236qK9R\365\265\336T#q\301\372X\\\036\370,h\340\345\373\250\325^\327\033\211\361qE\027TM\3546\024N\303u\341\245D\341Gsa\236\244V\2674\245\211\014p\207\233*\311*J(\325\263d\222\243=\275\232r\240\214(@)\002\324FAl\311r\224)j\252Hc39\005\033\00288\234SD\262\006\341\220R\3160\2331A\204B42 \207&\214\215_\002vf9\031\\\r\233v)\023\006\346&\031\2616\270_h""\321\247\000\365\307\211\331\r\3768\332\344n\026\276g-_\227\264\223e\226\275\371\n$e\304Y@\310\351\200\323x\261Y\251\022$%\242\347\324\204\207!\246\201\177A24!\311\022\345\364>\347i0\233%6\311\256%$^*\246\t\316\025*Fj\361\235\246\206\031\003\006g\010 7\324\023N\222\201;\032\03302\312\301\345\030\251\351\331\036\214\271\365\266gO\234\202tbD\325y\347\333-\214\033\260\031\027\251(0\014\224\361\305U\376\002`\334\260\213\343 P\231\031\250'\312.>\321\014//\361t\3176\216\021NI\330\355\322\371\271\304\\\241\200K\315~Z\222H\212>\201@\217 \366a&\277\221\335\214:\240#Bl\324\021\3149$\t\"\254\232\325\224\300\\1m\024\r%\254\313\000ff\014\370hM\223_\2218\036\334\001PY\264wT\207\270\370\345qY\252=_\030\257\017\026\276\014X\365`h\223zrdiD\023z\201\277\223$\230&\236y\276\232\237\177\273d\217\0304\263k\255\022A\212\244$\203RH/\350\302<\362\247n\001\222\034J\212\220\274\324\267\320\266P\202\236\330\034~-\326;\014\340\272Pq\2256\2624\346\2422M2,pYj4\320\224\014\272\243\035\274H\t\320\302cj\265\306\240uO\201w\024\300\313\000a\010`xO\246w\336\231\231&\343P\276g\201\357\0378\305\214\200\336\215c\242\274c;\030\321\024t\241(p\342)k\336\336\3025B\323\033\371\311I67\022\303&\260\343\364C\017O\257\230\271\264\t\233W\244H\210\"8\240\3363\205^-.\336\243Vu\344/\347\242\376=\373\300QN\347\002\353\363p\255\264_\277\306\251\2145\310\226Z\240@\310\246\266\201\266\300\217\033\263$-_35\0008E\323|\315\360\355\251\277u\204N\027V\216\252]\340\367;\216\376\\.\265\\J\n9]\177\216Ttu6\365\240\300\254R\373Hd\241\214\223\351\302r\025FVc\357R\212e\216L\230u\270\272\223\023&p\265\325\330\260g\025\356\234a\262\273I\3023uqZ]<\362\261\206\331\007%\024\223-J\005\210\212\024\223Owq\236\372\252Nn\260D\345L\005\2723\214\342\034\304]%\030\265\307\007\033E\2232_y\203 \3034P\"\202*\346\\\305Y\301I\204\035\366\327\016=\234\346pc#\010\335\327\344\341\320\220\177\236,\031\310\312^@o(q3\227\217'rv.\004g\210\340\252\r\0049\2616jx0\210\246\347;\225\212#[\"\037\017|_\202g\302\313|\201\264\222\377\215d\224y\327\342\000h\300\241\013\260p\324\352\340'%\264\215\234\3662\033\354`\031w\014cn\032\203h\310~\021\344A\213\251\225\355\274#D\214\245\036\360\213Z\224\276\363\037\331\022\312\366\302\357\304) Li.\034z\003C\023i\030\214\000\356\306\215W\245\206bxO\210?\3304\331q\205hiw\217g;\343\272\3503\234\341\347l\352\013\3371\274\341\356WY\331\311\002\260\302\307\276\243\330\273l\353<\360fC\254\323\354F\335\27184\224a\244\003\2416\201\203[\360\221_@\302I\241\202\021sI\031K\226^L\250/\315\321|\315\376\237\245\320h2ylZ\232\017qe\200\327W\022b\240\220j`\203\260\021\250|\232I\002\021Db\305\323\244pG\230\360+\211\013)\334\211\3102\327\002\261\257\002\344\026\271Y\312\246\275\345\362\341\305*\2545W\332\204D(\240X\024\310\250\244(-\235\301\215ED\332g\231bb\224\r\023P\351\002\030\314\034\202\013L\230\"\221\t_\363\213\244\235-\311u\310\253\021r`8!4\014\0045{m+4\202R\"\350D$R\2334\010&<\002\200\210i\343\225+\271\013\244\r\261\237\\\3362\n\301\004H\212DDD\004dc\033\317\002\010\270M[\361N\022n\331*$\017\023\023\244ZB%\361""\0300\031\021Q\223F\215\030F\343\0042&\261\245Zz48x\211\r&\037\225\301\030\237\215\303\226\213\354\014\371E\212\257\t\006\256b,\373\374B\311\330?\007f\222\342g:\222\006+^J\016p\303\000\272w\330\231$\220t\261}\347\226U\335\350\013\037A,K^s\334\361\027\223\324-\276o\204d\217\030L\250\214\215\003\033PF0\231\242\033q\215Q8\226\204\206\352N\025\307j\226v\206\346%\323\353.>+.\311]t\236\364NKe\245\265g\216\226U\\\035\344\262\200\025\323\0211\203\220\313.A\300@\326\200\310\2021\021\202 \243\020`\212\250*]2\337|\033\302\352p\001khu\007U\262&\216\226\243,\334JH\202R\035&\241\315\226\245)@\242\033#D9C\206\232\211DO+K\264\252A\240\205Z\304\372[\331\204\333\231BM`\032\014[fM\021{gF\027\356\302{\n\327\020\245)\003{N\314n\031m\232cB\300\357\263I\\\211b\3472\335S<\246\025)\217\217>\030\211fL5\220c\252e\372\311U\315\240\255PJX\374\034h\002$)\215\032\025\226\027KOg\201\332\337\221_vm\330\024#D\347\025T\225\244X\345\242\207.\351\025+\005)2Ch!8\032\234J\215\000D\23124\022\2311\276\373R\003'\203\031\225\300\225]\344\213\321\207\237\026\265fLc\254i\327*V\272\322I\363\203\274\264X\350\016-&{RFA\242\320\020)X\221$\244\322\206\221H\250vr\0100\251\305\242\363>u_( \004b\333FC\021\215\243<\022$O/&d\311%\236F\035\336\362\\\275\356\374\267\031\375\354\271\321.P&($\303\232]\275\245\016\342\360\207\021\223p\274\253\216\231%\310\212\340\321\331.\014\302A3\321\344\2503\253\252KD\242CE\271hW\246\366P\014\030%\233\225W\257v\002\265\027g\325\021d.i\230\3623\020\311\312\340\233\346|\351x7Bi\245\001\021X\313\206\004[\260K\240\014\207t\251t\006\000\236\365\201\240fn8\254Mk\024D\231\274fpT_\265Q\021O_\342\016\227T\233D\253\025S\301z}\037\232\006\217\260E\007\242\037Ef\363g\327+\254n\266Z\233\025\375\356;\376E\266%\212\250\245\316~\246\241\355\r\030\254\242V~\250\030\377+KH\373\n\231\2507yv\240\302\340\026\205\227\272br\");\261\346\212j\333\336L\365\306w\204q\036\037\t9\276\355\243\332\253\301)Of?c\251\254\340|&P\177\301F'3\233\331\0327\017\273F\004\224\350\341\274u\343\024N~G\0370\366\236\347;\274\370\260P""\030yT\034w\035\321\\\353\212\027\342d\251=_9/\036e\275\301}\004mC\313\305\273.k\313\315LK8\324\357\254\215\332W\274Ts\213E\221tZ8L\333\232\321R\267\246;]\020\177\215'\271z\256\272\004\013\007\30090\024\335d\255\006H\331h\023\302<\365$\340\372\023&\202\336\007\244\31425\230+\3178\005\303H1\177\255O\341\007^\300\337\0242\307\210/\257\330*\025dWPl\321e\221\203\0160\220\304%\225\t\300\332\005\314BB-?4\336\220\242\021\353h\3123IF\251\033\215\032(\220*W\310\253\354\177s\224\335Uav.*\344^\025\277\361w$S\205\t\013\241\010\t\360"; - PyObject *data = __Pyx_DecompressString(cstring, 3079, 2); + #elif (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (3063 bytes) */ +const char* const cstring = "BZh91AY&SY\034\376\326\351\000\003+\177\377\377\377\377\376\377\377\377\367\377\177\377\372\377\377\377\376\300@@@@@@@@@@@@\000@\000`\014[\276<\220s\335+\262\026\346=\260^\261\320\000\024\353Ji\320\016x\036\r\t\020CO$i\244\362\236\322\231<\023\323B'\246\247\224\3651\224\364\236\221\246\236\221\211\352i\352i\241\223L\214CG\224\0320\215=LA\246\211\240\0221&\224\331O\325\036\246A\246\203\324\362\215\003&\200\000\001\352\000\000\000\000\000\000\032\r\001\010\221\251\342\206\236\246\233\325=G\246S\332\246\217S@z\206\200\000\000\006\200\000\000\000\000\r\r4\022j\222S\365F\324=&j\000\001\240\321\352\000\000h\000\006\200\000\000\003@\000\000=A\242\014\230\0010\000\023\000F\230F\000\000\000\t\223LM\006\000F\000\000\000\000H\220A4\t\201&&\236\215#B2OL\247\244\332\020h\365\r\000d\003@\000\003F#\324dd\310\020+Gw\023\032\265\347\306;B]B\373}\377\003\362_\254\300\241\211M\221QP\377\240\244@\022\3038\224\305\305\204\026(\253\214$\221\311\200^\031\256\026$\333@\273O\005T\320\203\344\204\036\321+$\275\277\020\256\177A&\005SA\375\234\217\243\212X\235#\013\034\354)8EfA\357{\036\345\213\331\314\274\276\0008u\241mc`\r\361p\261\244TUK\252r\034rV\024E(\033\3219JJ\211\2672\346&\356,&)T-6t{\314Y,\324\242R\304\010\023\000\250\317@\330X\016\277\202K\200\225&\225\341\345I!Jo\264\0131\244\305\334O\236\226\224\261\311-H\362\3240\214\023$\210\200\234F\322\000\201\003z@.H\361\247\326\2168\0377!\035\021)2s<\235j\222\262\201\314z\322$\311\014j\003\333[\375\222x\215\350\035\346S\332T>\036\234WO<\347/ry\351;\355\214\306qO\302B\010\006\210\246FR\314\001\020\342-n\252&M t\375\360\304\361y\332\344-\253V\333C%\245\\\310~j3\2344g\022\323\315\213\234\344\270:WCa\177&2\271\213\370\372n\037DZUpg\3730\335\267/\033\243\342\342\254/aG\300m\260\246\003\261x\3550\244j\356`4\304,c2\210\327\nAT\007F\tfvW)-\026dr?\215y\340\200-]\000d\t\270\205\003a\005\273$k\205\231f1\2413\0146\306\314\\VK\265<\301p\310'\252\342\264\314\305\006\021\010\320\260A\016M\031\032\275bvf9\031V\006\315\262\212D\301\271\211\2035sl!W\0163\264""\320\017R\274\030c\336\031\332\201\223N\300\265\232\333\352\367\362Q\352\312y\347\303 \341\031q\025Pdx\3403\017&\375\212\017\237;Z\377B\203\2646\231d\027\370\023\002\303\316\241\305\313\271\364\364&\023d\246\3315\235I\027\n\251\202s\205J\221\222\273\016\206@\301\2200fn\302\003\232\240\226g(\023x\017\030\270\303\013\007\024c_\325\2603vi\354l\307\221\035\004|\002D\2652d\"\274\205|\003\200\332\013\203,)f\371Pp\322\035\343\244^\202(u\237\261r;K^\362\030\\]\351n\236L\334\361M\263\260\350\245\323s\210\265C\000\227\305}\365$\221\013\270\201@\2170\375\216\323[\321[e\272 #\"4d\020\214Ih\006\205\026\251RS\240\270u\322\212\005f\006\220I \235\205Q\272\3341H\001\355\270J\013\311\365v\3342\250s\247\036\035\017s\327\360\021\350a\303\213\014\233\220s\245\274\371\2118l`\315\354\016\224\262\245j\341\330\273\013\217\361t\330\221\351\203K&\232\321$\030*BH4$\202\355\327\307\236T\353\300\0211\310\260\262\r\005\223\236\251\274\250\030\360\001\323\364\327\300\3403\213m;\006;\370\225\341U\202\365\313\222c\245\247\270WR\324A\267%.\014P\nW\220\241\262\321x`X\017\350\355\340\203- \205A\244\351\237\021\300\340u\024Z'\312\335\013\254N\262.P\016\302u\226R\343\223r2\222\227p\312T\252\274\250u\340\203%LWw`fBA*\334k_05\366\340Y\274y\013\033@\231\361\227\246H\210\"\031\237\210\203\232\256m-\372\r\031\027qy-\343\002\2757p^?M\304Z\307\032\242\272}\310\234\257\244\0202\003\006\000\020\030\301\251\332\013\323\255\232\200\032\020z\307r\335\302c\3150\021\220\251\246\227\226\2572\341\315\213<\243\003E@\346\262]\332\241\261\270\273B\t\204\021\345\025\006\025\014\030S\267\206\312\n\000\304\030\035.\344\302#zE>\373k\310\260ik\003\316\024\244\031~\014\355d~\251\227\325\225\030\311\302\314\244B\021C\3040\376a\301\244\304\215L$\322\227\260\3159x\202\254M\227\000\210?\347\025\007\355\016\210\321\006\206\277\245\211p\032\025\234\250\036\242\374X\013\033 S\331)W%O\n5\263=\213\234\256\232O\221\023\222\325d\265\254\261\314\312\253C\264\2260\002\274\021\023\032\036S:\233\007h\203\256\201\244\301\030\210\301\020Q\2100ET\025,K\352\353\203P\234;@\224\271\337\030\36791\231\271\232\214sq)\"\tHt\232\2076YJR\201D6Fhr\207\r5\022\210\2366\227B\251\006b\025k\023\346']`L\003\206)P1\027$\213b\264$q\353N5a\254F7\001\335\324\027\254\347\215\243,\325\301\031\225\347\373g\001\\I`\3472\316\314\316\363\n\224\303\345e\277\001,\211\206\222\0144L\273I*\271\264\025\252\tK\0177\n\000\211\ncFe\022\236Kc\036\340\273EB\232Ul\316\034%fd\201:\305DF+\222\030ZB@A\036\223$6\202\023\201\251\304\250\320\004I\223#1)\223\033\355\265 1w0\231[\311U\334H\271\027\371\361e\225\2311\216\261\301\246T\255t\244\223\345\007qdXn\014\374\006[)#\020\321d\004\nPBP\322\206\2218\240s\342\020_S>k\214\271U{\301\000#\006\3321\030\014m\031 \221\"x\370r&I,\322/\355%\303\332\355\313a\223\376\341\221\022\341\002b\202L:\222\350\324P\353\257\020f1l\027z\323t\222\332\212\336\321\314Z\031\004\202g\245\266\240\316\236\231,\322\211\r\026p\320\256\353\231@/`\227w\211W\253m\342\262\213\237\326\021b\027\034\314:\214\3001q8&\370\337*]\315\260\263f\222\307.\375\n\2314\n\220\031N\317\323\362\3606\235\024\2270\3162\27085kz\030w\014\346\007\325`\250\276uDE9]p\304\373\023\032\224\250\245&\255\371x{p0<\242(> \357R\336\372y%>\346S\366\322]\247\362\376\345U\177IA\020\214\302\307\007\216 \262\r\014RQ+\301\345\002\237\313\235h\237\201\223]\006\3676\325\274[c\234r\271\216#\242\"\223>\024a9[\233\351\242\270\316\320\034G\215p\245p7\316{T~\221T\347rf\216F\254\2410%A3\305-\365\331[\371zOf7.""\332El\\\200\333\206%\234\214\276+\243l\367z\033\350\237nH\306\251&St\333\031G\224$\341\214H\255vu\311xX\235;\242\r\274\013'Z~\t]\201\002\317c\216\204\350<\203zn\027\352^qi0/KK\025\216h\314\224\336\237 \256\374\037\016\237{\357\003z\263\362\323\333\305(\257\333\3523\356I9\231\005\254+\3523W\023\257\017\252{\357\336\303\260\306\325)\3343\355\024\373\3463\365g|-\323\321\034\002Ea\250\027\265P\244\321\211\224\241\014\321h,H\344\305f%\006\227$n\250r#1(S\210\275cUC\326BS\225\026r\262\312\345a%X\245m\342\331\366\377\272N\216\314\321\276.,\350\217\177\374]\311\024\341B@s\373[\244"; + PyObject *data = __Pyx_DecompressString(cstring, 3063, 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 (2997 bytes) */ -const char* const cstring = "x\332\335Y\315s\333\306\025\267Z\267\225\\*\221,\371\253\211\247K\177\304dD\323\245\242\304\262&r\303\310\311\324ibK\226\374\025\215\006Z\002K\t\026\010@XP2\335f\222\243\2168\342\210#\217<\362\350\243\2178\362\250?\301\177B\337\333\005@\360C\262\223i\234N=\266\264\330\335\367\375{\357\355\256\363\305\262\246\021JT\313\344\256Cu\323%\256E\334mFl\307\252\030\254Vn\303fb\316r4\360b\2156\204\317k\266\345\000\026\334\256}2\343c1\357.\337s\"3E\236\037\223\233\251\004\310\345\021)\271\177]\243\327\026H\351\207\002\221\243\331\037z\251\327\234:;.1\022Ks\333\224o\313\304\254<\203\360@\364\356\213\001q\030\002\005\222\034QCc]\006\234\036s\352Y\320\000C\250\246\241s\200\253[\007\227\025\000-\256@\346\021\211xG\320l\202\002\253\210\256*\321]V\343\003\362\000\031\272\211*\211\000Y\200dT\036Q\016\300\024\210\306\205-}\217\231]+!\360\003\214@h\275\306z\020`\231\210\024R\263\034\226B\373\377^\361\377\371E\222\030\314\314%d\275\313\267\0066KL}R \327*\002e\010\271\204\370\027\341L\324\214n""\261\350\003\035\326\214\262\331\210\276\006\"\005\t\355R\031t\332Ss\"\352\030\252\002\251o\302)\1773P\177\023\214\016r\301j\325\007\322\245mjn\2614\0341.\242\243\326\035\007r\025z.\230S\347\354m`\032\221.\222\373\266\253\327\364\027L\373\222\252;P:\325\035P~U\254\036\215\334\024\272%\2437\325/\301\215\350<\222\373\263p\024\251\332\323\304i:2\222?F\346\036\333?\022\004}\222\227\220\026\275\245a\222\213\250\261n\251\023G\037\207A\333d{\254\213\377b\267\023\363\205T[\346\244V\347\256\354\351RI\216Z\362zE\250(\2770r\2513\200X\221\240B\307\260\232\3556\344\347[s\213\250%'\300/tnW\364\300\252\016N\204\340\333\242\351\246\272\"\217\216\036\362@\300\013d\313r\311\327:\236\363\244\301u\307\304D\213\014\376\225\353__o\343\344\036T\341Al\274u\371\304\3129\367\326\315\264g\227,{s\263?tM| \274\321\007FM\027'.\3524 Gm\033\023\275\247[\310D\207\032\021{\020\016\307i\027&\314\006\234\016G\235nm\177g~\207~\201\247\375\365\215w\344\366\376\376\264\2368~\343\r\236\3072\215\300O\"\240\203\307\217\215A\271\307\245G\005\0021w\317r\231,\316K\342\350\214X\324\230\241W\340\342\3422(\254\230/\220J\310\001\316\346\313_-_\237\233\237\213\302'\373PovV\352\272\341\342\261\036\016\241\274H\356VI\303\252\023\223\311jcc\351I\021\200Z&\036\221\204~\327\250iZ.E\245\025 \007\353\256\201\315\016\010\201\236\201\324_S\003j\374\375\n\366\305\377\373v0\024\no\352\004\211oE\036\016\363I\302\016\355\0050\031\353\253\321\331bc\231:\220\213\314\210(A\311.q\372\366[\020\341\257\233\206\276\203\010\221u\265Jy\202\222c\\Y$\313\006\243\234\341\351\005\256#\300\t\024\203v\017XY\036v'\307C\n\264\247\322\\)\277<\230\205\321\352\374g\303\026yL[\232O\226S\371x\027\325\225;f\207\357\210\351\347\3776l5a\177\353V\337\362^\302\370\346l\262$\216j\321\364\334\\2\315\373(>\275\231\177\300\342\204\210\334\237\200M\236\260P\370o~9\023\346\344~I\277\301\307\213^\214\003\010\360H\t\005\007\013\225\254\377\335\352\025u\374\377rC\300\232\232\263\207\243\"\227\377\025;\003\032:\374\002#E\017\020\230\354\271\233C\252\243\332\366[""\022\254A\036\262\n\344\"\311\325,\2167]\025\261\205O\036\004*\206;\344\335\246X\354}\013Yu-\373\256\010\024\250{\252\313X\227\305\035\212\023\203\224\326\342\363\230\326\275\212>4\201b=\375\232\263\024\275\345\024\260\303l<\344\361\305\241\277\010\231dm\333aT[\266,\003\356\250\032#\373:4\252\272K\252\016c\256XCZ\361\242\243R\250pp\367\000\034A\271\022\257sP\330\212O\241\003mS\350!\342\320;\370\222\305\005\317>\321\210\0168\177r\005\205.b\364\363I\361B)\321\313R\372\204\211\325\031\324\301[\037#\333\256k\363\205\0337l\371$\325\335W\334\002a\365JQ\267\006\327n\210'C\254\306\305m\267f\\NQ\3659F\263T\016\027%\364\373\376v#_ \305\277\003\010\025h\240,\305.\206\231\335\320t.\"\221D\007\337\276h\215!\034\345\271\271.\343\n\031W\027\307\rf\"\301\226\252s9\3220g\3261Zb \256\215\033\233\342Z\255(X}\025%\371\206\344\305K[\377w\361s\303\202\264\342\267!\273M|y\034\332\331\206N\036G\032\027\230a\255nH\177:\242\345\r\353d\303\346\312\374[\210\323\035\010\317\260\325\373\370\262\3104\334r\244\312G\354\037\350\225=\035r\240/\202\273\033\317\341\037j\242\334\203\322\366\200U\343\023\213\334!j\213\322\343\306\224k\322^\202\320&\307e|\34365\312\033\246\252[E\325r\000\365\320\200y\005\352\214\252\002\235\243bC\206\220+n\\9U\303\342\220]\000\020U^\212iEU\0054\231\342ZJ\252\024t\207\251\014\036\272^\224\2171\251\t\361&\355\244'\244OR32\351\370p\2110\264\033\252U7]\2151\033?\024\005\252\005\376@I\362'\007O\202\375=5TQ\360Y]Q\2428\306pN\305\261\017K\351\010\017\307\316\021\030Hb\017\003\364\260x\250F\301.>-)J\234i\212\2166F\241\301\217-\335P\242j\204;\201\000\324\020\317Q;\254\301\025\005MCr\250kT\324\035\361aiu\210\220R\343`\242\t5\017~\202\371\226-\217\034B\270(\206\\\376w\200\255\253;\242\330\330\226m;\230o\242\017(0\206\r@\255\244[\203\242\354\326\251!\331:\000L\270\260pE\260\000\227\nL\213\037\253p\261a\362\306\313""\231Q\205\232\252\2450\016\303H3\030E\377\r\300\241T)X\037\305\000\253fr(\212\177'\003\271/\371\2126#\353\370\227\353\244\321\302\321Y.\343\340c\010\277\265/\257[{p\177\3245\320S\334#\345e2N\030%\311\234\356 \305p\237:&\376\303\267\225\027\272\035\236\274\022\224_\223\023c\231\203[\336\222\347\372\245N\346txz\276=\322\236n\257\264)|y\037\373e\177\2453\372\347\203\271\203\027\376\244?\023\353Q\357Ep:\274\374$|\3624|\372}g:\337\234l^i\322&oe[\245\326\227-\255}\265\375\343+5\\QB\205\205\254\032V\365P\337\tw\214\316\364e\020v\007E\211\330\037\216\216u2\343\362ox2\027\346\276y5\023>|\364\372#\304\n\206\330\010 \200\023\341D68\007N\235\304\235\343\347d\320:\231l\230\375\"\374\342Y\370L\260\356\335\366\372\217\310B\202\251\020P\264\3429\032|8q1\274x\243\271\333\032\351L~\000\366}\333\034\351\340\324\255\366d;{\010&\322\310\316`\022\201\360\235\177.\370]PhR\177%X\t&\203\221\360\344G\001}\235C\\|\013\356\313Lx\031\000\323\367\340>X\330\n\257\177\3712{8J\202\223\301w\340tp\344g\336\224\367\025\270o\311\337\r\376\024\360&\230s\016\301\325\031=\207N\004\330\216Ny\213\310\027\314\352\214\236\366\256x;\301\031P\030\326\367}\206\353\0201i\315'\007\364\300\r\247>\n*\315\221C\220\374\236\257\201{&.\204\027\204A\000\035\375\345\013D\311""\004F\227\373W\375\335\316\364y\377\275\200\242`\344\201J\217\007k\350!\004N\2513\361\241\177G\330\232Aq\225 \323,KY\220\242S\341\324\325\360\352\343\360\361\223\303Q\241\\F\232|\336\037\361?\014V\344\3678\014\244\023\220W\331\177\032l5\0374\377\335.\305\313\353\340\351\314Y0j2\230i>m\325^\212\225o\274-\3771\306\360\2647\203\031\033i\203\256y\024\224\016\001\326\rd\215^y\356\357\276\316\310<\334\367\3250\373y\033R9\023f\026\332Y\361\033\240/~\317\266\204\211\023\"\344W\374g\315\261\260\264\031n\322\220J\010\"N\244m\010,\315\377\030\305Ox#^\344\2149\220\364cSk]\201\364\230\300R\262\362\037\371\313\032I"; - PyObject *data = __Pyx_DecompressString(cstring, 2997, 1); + #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (2982 bytes) */ +const char* const cstring = "x\332\335X\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&\351TcK\213\335}\337\277\367\336\356\346\213eM#\224\250\226\311]\207\352\246K\\\213\270\233\214\330\216U1X\255\370\301\007$\372\271\367\202\326l\203\315%\023\370s\347\316\235x+\231'\213r\224\313\037\266\247H5\355\tut\n\037<\267z\236\236/\220\363\225\363k\005\262Z*\220\353\005rc\355H\332\205D\317\234Ak\025\215\022Z \2259R!\363\363\204^\001\036]\236\357\312\350|LL\250\t\276\270R!w\346\311\365\363y \272@\330\013\2339z\215\231.5\010P\350\346\006\251ZN\215\272\005B\353\256\005\003]\245\206\321 6u8\323\n \204U\231\203\006\022k\2079\004W\205\271\003\352p\313\250\273:(\002\236\213U\333`\356r<=\350\306n0\312\316\006\357\215D*\2049\035\206\324TA\203*\231\263\033s\252A9\237[\357\032\275^ \325\272\251\242\030\014x\205\221]\207\3326\323H\245\221\246\370:\332\324Ci9\261'\300;\016\343\0346\344{\225\301\237\205\036L\201\010\335T\215\272\0062t\263\007bd\201\232\270\316t\230u\000\215]\312\002b3r \311%*\203\0062\374y\241\315b\303\335\264\314\253l\207\032u\261s@=\220G]\262\253\033\006\n\222\241\352\215_\261G\377\235\030\243$\307\231+,f\333u\026\2714Y\315\317\245\235\225\000{\235\320j\225\251.\323\006\234\002\356E\323\323\301\322X\225\326\r\341$P$\305\274H\3562\233\231\032\2302\300\3072\373\371\270\r\233\2119\313\321\300\2135\332\020>\257\331\226\003Xp\273\366\311\214\217\305\374z\371\236\023\231)\362\374\210\334L%@.\217H\311\375\3472\275 \017\220\241\233\250\222\010\220\005HF\345\021\345\000L\201h\\\330\320w\230\331\265\022\002?\300\010\204\326k\254\007\001\226\211H!5\313a)\264\377\357\025\377\367/""\222\304`f.!\353]\276=\260Yb\352F\201\\\256\010\224!\344\022\342\237\2053Q3\272\305\242\017tX3\312f#\372\032\210\024$\264Ke\320iO\315\211\250c\250\n\244\276\r\247\374\355@\375M0:\310\005\253U\037H\0276\251\271\301\322p\304\270\210\216Zw\034\310U\350\271`N\235\263w\201iD:O\036\331\256^\323_2\355+\252nA\351T\267@\371e\261z8rS\350\226\214\336V\277\0047\242\363H\356{\341(R\265\247\211\323td$\177\214\314C\266{(\010\372$/ -zK\303$\027Qc\335R'\216>\016\203\266\311vX\027\377\305T\017\177\005m:j\304\257\260\301v\227\370\\\252csR\253sW\266{\251?G\003x\275\"\264\227_\030\324\024k\261\"\361\206>c5\333m\310\317w\346\026QKN\000mh\352\256h\217U\035\374\013\270\260E?N5L\036\235J\344Y\201\027\310\206\345\222\257u<\002J_\324\035\023s0\362\305/\\\032\373\332\036'\017\241@\017\302\346\235++\026\325\231w\356\263=\273dE\234\271\376}\327\304\307\302\033}8\325tq\030\243N\003\322\327\266\261\006\3644\022Y\003\240|\304\036\204ss\332\205\t\263\001\247\303)\250[\366\1775\277C+\301\213\300\352\332\257\344\366\376\326\265\2328~\355-\236\307\n\216\300O\"\240\203\307\217\214A\271\307\245\207\005\0021\367\320r\231\254\333\013\342T\215X\324\230\241W\340N\3432\250\271\230/\220J\310\001\216\355\213\367\026\257\316\314\316D\341\223-\2527;+u\335p\361\304\017\347S^$\367\253\244a\325\211\311d!\262\261*\245\010@-\023OOB\277\313\3244-\227\242\322\n\220\203u\227\301f\007\204@;A\352\257\251\001\345\377Q\005[\346\377}\247\030\n\205\2675\211\304\267\"\017\207\371$a\267H\035\310\203\366\262I\241A\210\303\356\340\013\026\027<\373D#\030\340p\311\025\024:\217\301\316'\265\n\245D/J\351\343#\226^P\007o{\214l\272\256\315\347\256]\263\345STw_q\003\204\325+E\335\032\\\273&\236\n\321y\305M\267f\\HQ\3659F\263T\016\027$\364\353\356f#_ \305\277\003\346\024\350\216,\305.F\225\335\320t.<\235x\037\337\274h\215!\372\344\241\270.\303\010\tV\027g\tf\"\301\206\252s9\3220EV\201\363\232\030\210\353\342\332:\217\272\n4\007\220\335\323}\342\366\"\356\0319\330 HVS\324\005q`Y\215n\236\240\360\232\374\r\275D\007\014\025\343\373\305\202U\263u1\032\014^w$O\374\203;\376\021\335\267\217\350B\275\316\215\252D\\\222\025\005\213\254\242$\337\220\243xI\353\377.~aX\220=\374\016$\261\211/\215C\033\330\320\311\243H\343:2\254\243\riC\207t\266a\rk\330\\\231?\200\370\334\205\260\014[}\204/\211L\303-\207\252|\310\376\201\226\330\323\010\007\332\037\270\273\361\002\376\243&\312C\250`\217Y5.,\321\216\036\017\246\274\222v\020D59\376\342s\266\251Q\3360U\335*\252\226\003@\207\026\313+PZT\025\350\034\025[.D[q\343\332\250\032\026\207\204\002l\250\362\376K+\252*\320\310\024\327RR\331\337\035\246\222v\350zQ\276\273\244&\304\363\263\223\236\220\356H\315\310<\343\303%\302\320n\250V\335t5\306l\374P\024(\020\370\013%\311\337\034\234\010\366\367\224ME\301\027tE\211B\030#9\025\302>\030\245\203;\0346\207\204?\t;\014\320\303\342M\032\005\273\370\212\244(q\222):\332\030\205\006?6tC\211\n\020\356\004\002PC\274=\030\025\312e\244\311g\374\021\377\223`I~\217\303@:\001y\225\375g\301F\363q\363U\273\024/\257\202\2473\247\300\250\311\340J\363Y\253\266/V\376\351m\370\337b\014OxW0c#m\3205O\202\322\001\300\272\201\254\321+/\374\3557\031\231\207\273\276\032f\277hC*g\302\314\\;+\376\002\364\305\337\353-a\342\204\010\371E\377ys,,\255\207\3534\244\022\202\210\023i\033\002K\363?C\361\023\336\210\0279c\006$\375\320\324Z\027!=&\260\224,\375\004|\210\016\345"; + PyObject *data = __Pyx_DecompressString(cstring, 2982, 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 (8454 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.Constraints: 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 = OptimizedBacktrackingSolver()\n >>> proble""m = 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 Optional[Sequence]ParallelSolver is currently experimental, and unlikely to be faster than OptimizedBacktrackingSolver. Please report any issues.Problem.addConstraint (line 141)Problem.addVariable (line 86)Problem.addVariables (line 118)Problem.getSolutionIter (line 218)Problem.getSolution (line 180)Problem.getSolutions (line 199)Problem.getSolver (line 72)Problem.reset (line 44)Problem.setSolver (line 57)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 Tried to insert duplicated variable Union[Constraint, Callable, str]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.CallableCompilableFunctionConstraintConstraintDomainFunctionConstraintHashableOp""timizedBacktrackingSolverOptionalParallelSolverProblemProblem.__init__Problem._getArgsProblem._getArgs..genexprProblem.addConstraintProblem.addConstraint..genexprProblem.addVariableProblem.addVariablesProblem.getSolutionProblem.getSolutionIterProblem.getSolutionsProblem.getSolutionsAsListDictProblem.getSolutionsOrderedList..genexprProblem.getSolutionsOrderedListProblem.getSolverProblem.resetProblem.setSolver__Pyx_PyDict_NextRefSequenceSolverUnion_addConstraintaddVariableaddVariablesallvariablesappendasyncio.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__throwtypingvvalidatevaluevaluesvariable_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(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!@\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"; + #else /* compression: none (8427 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_addConstraintaddVariableaddVariablesallvariablesappendasyncio.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 < 175; i++) { + for (int i = 0; i < 172; 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); @@ -10857,7 +10838,7 @@ const char* const bytes = ").Add a constraint to the problem.\n\n Example stringtab[i] = string; pos += bytes_length; } - for (int i = 175; i < 192; i++) { + for (int i = 172; i < 189; i++) { Py_ssize_t bytes_length = index[i].length; PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length); stringtab[i] = string; @@ -10868,25 +10849,29 @@ const char* const bytes = ").Add a constraint to the problem.\n\n Example } } Py_XDECREF(data); - for (Py_ssize_t i = 0; i < 192; i++) { + for (Py_ssize_t i = 0; i < 189; i++) { if (unlikely(PyObject_Hash(stringtab[i]) == -1)) { __PYX_ERR(0, 1, __pyx_L1_error) } } #if CYTHON_IMMORTAL_CONSTANTS { - PyObject **table = stringtab + 175; + PyObject **table = stringtab + 172; for (Py_ssize_t i=0; i<17; ++i) { - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + 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 } @@ -10905,16 +10890,20 @@ const char* const bytes = ").Add a constraint to the problem.\n\n Example { PyObject **table = __pyx_mstate->__pyx_number_tab; for (Py_ssize_t i=0; i<1; ++i) { - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + 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 } @@ -10948,87 +10937,87 @@ 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), 164}; + 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_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), 243}; + 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_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), 245}; + 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_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), 290}; + 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}; + 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_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}; + 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_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}; + 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_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}; + 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_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}; + 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_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), 118}; + 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_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), 141}; + 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_mstate->__pyx_kp_b_iso88591_J_UV_Ql_q_A_jjkkl_4z_a_xq_q_1L, 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), 180}; + 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_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), 199}; + 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_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), 218}; + 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_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), 239}; + 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_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, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 247}; + 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), 269}; + 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; } @@ -11281,11 +11270,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++) { + 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; } @@ -12437,8 +12426,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: @@ -12793,6 +12782,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); } /* PyObjectCall2Args (used by PyObjectCallMethod1) */ @@ -12937,8 +12927,8 @@ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { #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; } @@ -13264,7 +13254,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, @@ -13272,7 +13262,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; @@ -13301,7 +13291,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 @@ -14697,6 +14687,48 @@ __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { __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) { + CYTHON_UNUSED_VAR(context); + PyObject *annotations = __Pyx_CyFunction_get_annotations((__pyx_CyFunctionObject *) 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 (value == Py_None) { + return 0; + } + PyObject *annotations = PyObject_CallObject(value, NULL); + if (!annotations) return -1; + int result = __Pyx_CyFunction_set_annotations((__pyx_CyFunctionObject *) op_in, annotations, NULL); + Py_DECREF(annotations); + return result; +} static PyObject * __Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; @@ -14709,7 +14741,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; } @@ -14812,6 +14843,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}, @@ -14950,8 +14982,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) 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 { @@ -14959,7 +14990,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); @@ -15011,11 +15041,10 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, 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; @@ -17294,7 +17323,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); } @@ -17491,14 +17521,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)) { @@ -17523,9 +17549,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); @@ -17586,35 +17620,23 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( } 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) { diff --git a/constraint/problem.py b/constraint/problem.py index 881dc9d..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 @@ -138,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: diff --git a/constraint/solvers.c b/constraint/solvers.c index f9b549a..de9dbef 100644 --- a/constraint/solvers.c +++ b/constraint/solvers.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.2.4 */ +/* Generated by Cython 3.2.6 */ /* BEGIN: Cython Metadata { @@ -37,8 +37,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x03080000 #error Cython requires Python 3.8+. #else -#define __PYX_ABI_VERSION "3_2_4" -#define CYTHON_HEX_VERSION 0x030204F0 +#define __PYX_ABI_VERSION "3_2_6" +#define CYTHON_HEX_VERSION 0x030206F0 #define CYTHON_FUTURE_DIVISION 1 /* CModulePreamble */ #include @@ -3492,7 +3492,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: @@ -3916,7 +3916,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: @@ -4893,7 +4893,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: @@ -5096,7 +5096,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: @@ -5299,7 +5299,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: @@ -5500,7 +5500,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: @@ -5648,7 +5648,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: @@ -5774,7 +5774,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: @@ -7369,7 +7369,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: @@ -7648,7 +7648,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: @@ -7832,7 +7832,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: @@ -7980,7 +7980,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: @@ -9515,7 +9515,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: @@ -10393,7 +10393,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: @@ -10623,7 +10623,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: @@ -10902,7 +10902,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: @@ -11020,7 +11020,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: @@ -11410,7 +11410,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: @@ -11560,7 +11560,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: @@ -11688,7 +11688,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: @@ -12788,7 +12788,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: @@ -13013,7 +13013,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: @@ -13205,7 +13205,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: @@ -13372,7 +13372,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: @@ -14512,7 +14512,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: @@ -14713,7 +14713,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: @@ -14915,7 +14915,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: @@ -15033,7 +15033,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: @@ -15894,7 +15894,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: @@ -16076,7 +16076,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: @@ -16745,7 +16745,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: @@ -16993,7 +16993,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: @@ -17435,7 +17435,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: @@ -18273,7 +18273,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: @@ -21745,16 +21745,20 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { { PyObject **table = __pyx_mstate->__pyx_tuple; for (Py_ssize_t i=0; i<4; ++i) { - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + 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 } @@ -21764,16 +21768,20 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { { PyObject **table = __pyx_mstate->__pyx_slice; for (Py_ssize_t i=0; i<1; ++i) { - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + 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 } @@ -21853,16 +21861,20 @@ const char* const bytes = ".Abstract base class for solvers.Can't happenNote tha { PyObject **table = stringtab + 214; for (Py_ssize_t i=0; i<30; ++i) { - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + 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 } @@ -21882,16 +21894,20 @@ const char* const bytes = ".Abstract base class for solvers.Can't happenNote tha { PyObject **table = __pyx_mstate->__pyx_number_tab; for (Py_ssize_t i=0; i<3; ++i) { - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #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_IMMORTAL_REFCNT_LOCAL); + 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 } @@ -22353,11 +22369,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++) { + 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; } @@ -24167,7 +24183,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, @@ -24175,7 +24191,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; @@ -24204,7 +24220,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 @@ -25150,6 +25166,48 @@ __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { __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) { + CYTHON_UNUSED_VAR(context); + PyObject *annotations = __Pyx_CyFunction_get_annotations((__pyx_CyFunctionObject *) 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 (value == Py_None) { + return 0; + } + PyObject *annotations = PyObject_CallObject(value, NULL); + if (!annotations) return -1; + int result = __Pyx_CyFunction_set_annotations((__pyx_CyFunctionObject *) op_in, annotations, NULL); + Py_DECREF(annotations); + return result; +} static PyObject * __Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; @@ -25162,7 +25220,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; } @@ -25265,6 +25322,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}, @@ -25403,8 +25461,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) 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 { @@ -25412,7 +25469,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); @@ -25464,11 +25520,10 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, 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; @@ -25847,8 +25902,8 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qual #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; } @@ -26036,6 +26091,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); } /* IterNextPlain (used by IterNext) */ @@ -28962,7 +29018,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); } @@ -29159,14 +29216,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)) { @@ -29191,9 +29244,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); @@ -29254,35 +29315,23 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( } 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) { diff --git a/docs/requirements.txt b/docs/requirements.txt index 686294c..3a45531 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,33 +1,31 @@ -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.6.3 ; 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.6.17 ; python_version >= "3.11" +charset-normalizer==3.4.7 ; 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.11" +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.2 ; 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.6.1 ; python_version >= "3.11" +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" +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.15.0 ; python_version >= "3.11" +urllib3==2.7.0 ; python_version >= "3.11" diff --git a/noxfile.py b/noxfile.py index b045a79..b2cda3c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -5,15 +5,14 @@ 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", diff --git a/pyproject.toml b/pyproject.toml index ebef04c..40483e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ 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.5.0" # adhere to PEP440 versioning: https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#id55 +version = "2.6.0" # adhere to PEP440 versioning: https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#id55 authors = [ {name = "Floris-Jan Willemsen", email = "fjwillemsen97@gmail.com"}, {name = "Sébastien Celles", email = "s.celles@gmail.com"}, @@ -33,8 +33,6 @@ 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", @@ -42,7 +40,7 @@ classifiers = [ ] # 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/" @@ -66,9 +64,11 @@ 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 >=8.*.* when Python 3.9 is dropped +sphinx-autodoc-typehints = ">=3.0.0" # can be updated to >=3.*.* when Python 3.9 is dropped sphinx_rtd_theme = "^3.0.2" sphinx-pyproject = "^0.3.0" From ff7c525df33f2732dd65b4245a27214ef0736a12 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Mon, 29 Jun 2026 15:01:59 +0200 Subject: [PATCH 80/87] Implemted fix and test for the issue described in #108 --- CHANGELOG.md | 2 +- constraint/constraints.c | 163 ++++++++++++++++++++------------------ constraint/constraints.py | 4 +- tests/test_constraint.py | 18 +++++ 4 files changed, 109 insertions(+), 78 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c9caa4..7b7c856 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ All notable changes to this code base will be documented in this file, for every - Released: 2026-06-29 - Issues / Enhancements: - Improved type specification. - - Resolved issue #108 relating to pruning. + - Resolved issue #108 relating to pruning (thank you @gaoflow). - Various minor improvements. - Updated build and documentation dependencies. - Dropped Python 3.9 & 3.10 support. diff --git a/constraint/constraints.c b/constraint/constraints.c index 2148cc5..d85c575 100644 --- a/constraint/constraints.c +++ b/constraint/constraints.c @@ -13507,7 +13507,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain * 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); @@ -13553,132 +13553,145 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain /* "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_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, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { - __pyx_t_9 = __pyx_t_8; __Pyx_INCREF(__pyx_t_9); + __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_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 499, __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, 499, __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_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; for (;;) { if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_9))) { + 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, 499, __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_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_9, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_9 = __Pyx_PyList_GetItemRefFast(__pyx_t_8, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_11; } 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, 499, __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_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_11)); + __pyx_t_9 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_11)); #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_11); + __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_11); #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 499, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 500, __pyx_L1_error) } else { - __pyx_t_8 = __pyx_t_12(__pyx_t_9); - if (unlikely(!__pyx_t_8)) { + __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, 499, __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_8); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8); - __pyx_t_8 = 0; - - /* "constraint/constraints.py":500 - * else: - * for value in domain[:]: - * temp_sum = sum_value + value # <<<<<<<<<<<<<< - * if temp_sum > target_value: - * domain.hideValue(value) -*/ - __pyx_t_8 = PyNumber_Add(__pyx_v_sum_value, __pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 500, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_v_temp_sum, __pyx_t_8); - __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_9); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_9); + __pyx_t_9 = 0; /* "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_8 = PyObject_RichCompare(__pyx_v_temp_sum, __pyx_v_target_value, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 501, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 501, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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":502 - * temp_sum = sum_value + value - * if temp_sum > target_value: + * 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_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_8 = __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_8)) __PYX_ERR(0, 502, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + 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_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "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":499 - * 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_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_L22:; /* "constraint/constraints.py":503 - * if temp_sum > target_value: + * if temp_sum + value > target_value: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False @@ -13702,7 +13715,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L0; /* "constraint/constraints.py":503 - * if temp_sum > target_value: + * if temp_sum + value > target_value: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False @@ -48266,33 +48279,33 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); { - 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},{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},{347},{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 (4905 bytes) */ -const char* const cstring = "(\265/\375`ra\375\230\000z\221\024\037;\360\0327\314\300l\000\2222\3101B\243\303\032RX\370 \23707\205\0255\313\266Y\243\025\307\353P\212\224\t\000\000\020\000\000\240\004@\352\272L@\001a\000 \255k@\000D\023\001\326\001\323\001\350\001\352\3523f\215\332T\2650\250\205pz\247\331\306V\346vU\325\235\201\247\326\352(\\\255F_\316\210\333\032h\325\246\250\260\327\333\255\251\2434k\242br\003\252\001\032UV\267&\252\333\214\246\372TW\250\326jF\343H\221\361T\241\3146\377z?\241\272{\330\334ntl\321qgV\243)\020mS\341\217'g5\276\324\254\306\221*\220\004\255\0349\262`\345\021f\354\215*+l5\213\303\341@z\343H\376\330&\372\264\246\246\212\372\3649\372F`f\251F(\023\205\242\"oUy\375\221\271\\\036u\2335kVe\2400w\323\225\224\350\204\353/\347\\\245kr4i\272S5\253}>\364\0345\233\3234\223$y\323\345t:]U\326\255?\335-\2473111YKJJn%fo\244D\247\313\375\204B\272\237p\353\310\252\274\376H\362\204T\321\236\333Fo\267\333\355F\336\306\221\334\215\311\264\231\266\3264\331U\315;\315\302\240nM\341\231kW\237Ue\312\345z\266\217q\004\204\034Gl\331\366\241\244$LW\241V?U\201\200|\354\237nQ\\\325\307\251[v\335 L\244R\253\205\324\034\241\017\246\3348B*\215#L\032=\215qD#k(}\024\235g\306\201|\000\215/\343o\205\201\201a\321)\360\227\253j\306\204\004\\\253w\036UTo\315\002\267\360\207\262\252\236B\237\266\026\246yj\324\276u\324\277u\217\355\316:\035\333\014\325\216O*j\252\332*mM\315\242\347x\3524\325\253:\252\331\034W\2645U\241\215N{9E\201\277uF\325@`\206\032[\233\232gp\273UQu5Gv\365\215{\347\324\034\365\316\275\26153\333\356\336\016\027d\337\210\031\2701XLv\226g4\374\254\341\003d|b\327g\035\306\255uY\267q\212X\221\347w\276\242\327^\\\"\310\025C\000\320\350\222\301\354{\363\273\337^v~\204\342\357\330\250\350\027\001}\032\342\000\221f80\354\3012\260\321K\360\322\370\231\177y\034?]\236\373p\020\363\206\004C\032X\370\346\227\312g\257\363\272\363\372\023\347\361\r\036\300'\020\000\n\272\202}\246s\314~\360M\351\370\273.\344\031\260\370\345? X\212\301\236;\025\317\210\025_o\320\357t\216X\234]\235\333r5\300\342\240k\342""\336p\301\016\2125Nq\020\223\274\342 \016v\223^\353Xn\304A\221tg\260\270\326Sx\026\227\t\227\302A\234\211\005D\234\223\177\242\3615\006>\317}\342\322q)\014\024k0\013\306\307\000\370@\364\252\n\252E\251\312)\252\225\205jK \233\333\226mu\232\365\366\245z\253ZoVO\255?\315\356\025\010\\\201\373\307f p\013\367\332\376\262Z\252{\253\272\\\3314?iU\315\255\336\033\375\355\262jMw\313\226[E\213\364\211B\241P\245Y\352S\230\232U\272,\313\3753\327\263<\3116-w\373[O\323\354e\234\251\323t5\365^SS\312\314=m\226[\267\371DO\325L\327\265\327\333ZE[\341\312\256&nEM\325j\347\335\252\372W\236\252\366\345\275OU\270\366\312\362\324\352\023\272wV\211|:\250\255\322>%M\225\025PY\262\300*\255\302\3545u\301\355\255M)SC\315\234l\246jg\312\262,qL:\005\n[\245v\243\351\271\327\324g>\251z\243\247\025\020G\242\313\030\234\272\346t4w*e\242@\2265bR\322\001\035\256\203\346\2714W\366\362B\016\257\031G\231z\220y\320\364\201#\236\343m~e^\034Z7yA\254\230T\301'^n\314=\205\202\376&\376\304\374 \230\226\0032\361Y\336\253\363\004\213\262\367\365Fu\2171\256\301\001\260\222\317\345z\3133|Q\317\341\026\301n\320\255HXa\306\253\\\3475\340\017:\r\327\":\020sV>\373\232X\365\240\336\361\360s2\222k\027\242\203\313\274\210\304H\305_\261\321\212\344U\013\237\331\361\244\027H\310\\\014\007\361\216\317^]\210\263X\004\337\240\"\357\335\275!>\204#\316^\306\257\364\2151\316\345/\221>\022IT(\200\205^\026/2\306A\017\341\021\372h\021\321k\022&\301\010\007~U\224y)\002.!e4+\362\212\231c\320\212\273W\343%\342;\277-\276\325\365&\227`w\346`\375rh\361\314u\016\356\214+|\365 \337qi\331\345pgnD\314\200'C\242u#B\272\206E\\\363\350\001\375\204WH@t\004.A\213y}\327\215\240\236\376\323\371O\243/\364\205\200>\317\320\010\316y\205\336\245\337\360\025\242\240OD\244\021\331\341\314PK\367\266\263^\303\007\370\201K\023\344\020\374\305O|n\274S\340\0221\001n%\023\3612ov\017\210\257\023\363`\2217\305\213\320\376\216\303\336\332\273\375\214\037\231\375\226\253\230]\210\203\270\346:\320\270\264\006^A\233Eq\014\211\230\227\341\007x\350\315\275\016\357""\220\317\371&\276\343\0264\024~\343\322b\257\036\301'b\305\\|\362}\237\323wZ\372KG\377h\350\017\001\375\036Q\206h4\203_0\216\327;hq\215H4\244\rk`\022\276y\311W\340=\3615\237\262y\020\277\240\305\261\2706\334p\020\274\001c\371\016\177v\231\036\017E\263\346\356W\357\236;\0039\264\241y\007\"z\020\016\334\226\203\236\204\204\177\376\242\327t]\240\245F\324\251\375\032\274k3]\313\315\304\213!\311\033\3237z\222\214\367\344\020\361\013\036\347\301\274\016\333q\350\222\301=\031\257>\272:6\264.\213n\033e\231#\271\261\251\335\026\n\311\303\007\336\231\327\3479|*\313\312^'\2738\260\256\335VQ)\351'\361\276\324\220\346\235\275,N\317\307\033p*\2709W%VT\212\315\\\326\255\201\351z\240\305\010\0071\304C\354 \213i\263\342nk\347w=~\221\275\345\370\0242\215\242\314\203` \000pt\225M\277\211\347\363\254\374\025\217\3571\360I^\343i\361\0053\374#\225\257bc\363[\203\247\360\336\215\227)\006\361Ju\231\213 \336_\032\346\300$\334b\373&=\313\215\220\tI\310\206C0\013\006\237@:\372<\275\241\3140\004\226\301\010!#\354\007$\005 !\005\370\370\004\364\364\004\350\004\350\274\262\000\000\272\260\202?\370\373?\251/\325\373=*b&\352\210M\r-WM\374\202|\025TW\207\253\335\177C\375\242\257\243\004\347\014|\010\017\330\t\020O\206\265\241\014\3117\361\"\024\177'\304/\272D\274\203\007\340\340k\2005\325\213xNq\367\321O.\023\344\331\263\335\026\361i^\230\357u\216\332\256\331\206\204~\326\020\205y\360\013\310\037\352\013;\227t\005d}\010G\366\232^\247\017\350x\305\303P7\234!\377\220'h\370\017\017\264bGL+\350\263\247\352\266\330\307\200\375\005\336p\001\266\362\211\310^\024\357\340m}\202\277r/\350=NE\261\203\260\343F\356\303\013\026c\301\020\000<\272|\372k\235\257\223\362S8>\007\354\303|\270\026\020\000\030\272\362\213\262\3617p]\301'\207^\223}6\350\006\205\035\250\003\331Z\244\223J\r\215\210$I\222\326\023q\0204(\226\213'\265a\327>\243\323\332$\024\206\2014\2040\010B1\010\2070\005\004\021B\210\300\020\242\210\010\211\314\314\330\001K\212n\014yp\373.\270\234/$\375\022\244\326\305\361.7\355\305m\223\232\332M?N=\251""\307\":0e\244\205\214\325y*\026>8\313u\3218\034*\374\343\272@\350\226\246Z\227\214\223\215a\026V\251[\213\373t+\2031\330\201m\315G\210\272\036D\214\262\024\017k\302\332\032\021\254 \336.\311>|\034r.\031\214\020\017\315[\024A+\224e\r\311\211\n\260\350H\272\007\245\354\262m{\261D\177L\010\330\314\177\255*\333Z\304\275X\247\t\031\206\261 \314\244\236\363\236\337\201\036p\367#\207\272\376\023t\226s\251\001\353\2432-\205\272\243\t\261I\024\273\211\235\341\211\352\315\330\250\215\204R\245]\305$P\320MhF>\240\223*+a?LI|\246\221\316\3612\341\202bH\356\023\224\032\014\317\376\207\340d\354[\360\204G\202\342\226-+\321@t\276\331%\244\212a\204\312p\260(Y\270\0374\302\317\032\274\343\014j\315\200\276\352\342\217\341\000S\037\267\342X\240\216\222IEH\020\214?\215\233\375\214\341\256bmL\345w\244\020\373\227\301\265\316L\230\322v/9\316':\2379\351\032\tE\261\310\010\333<\025*3&\014\341\031\000\014Q\301\251\r=\360E\n\"\250\0313\260M(\365\r\371\370\336\231N\244q\207g\200\245t{\246a\263 !\245\367\263M\365F\220\033b\021\304\342\215\177\224\216K\224\332\207\022S5\223\"\030\321\000\301\344O\362\216q\272u\3544\343\247N4\037\377\226K!\300\0039\271\246\352\n\360\265\207'i?NB\3034\247\033\325v\214\257\203\023(\253\310+!n\260\305\t\234\177\017\002 '\017\322&\271p\320\215\250\346\212\323Yn:\2021\234N{\240`E\345+\3255\263X\237\265\221\2254-\276\037\022'\356\220^YY;y\254\340\300\222\260/$D\234\320\247+\277\340\332\371\230>\334p\335\210\245\253\246?\005[\256\313\014\333\010\2412IZ\004\233\376\200o3\305\312r\270\037\304[\\\002(\306[\262\276\\8^Ee\034%n\356d\251\304\024\304\267I=T\032\241\022\351\233Z\235P\2353_\362\303\234\021\207\223\004\312Bh'A'x\232\230}\341@\367\266\265\260\346P\310\t\370\317\356i\236\247\367\326o\264l\336\201\371\2330\343\230\376\006\271\333+\362\225\302\333.\344\276\246\314\034\021a\267\335\265#\000\211\261(YHK=\313\r\2233\253\014_dnJ\356\317J\215\272\017\352\007\246\224w2\253\2636P`+[(\273\000~r\241\317\260\255Dc\032\245\353]\274\206\312\376\223\006\311\330\251R\262\204\235""\366\ts\271\006>.\252\247\211\033\013\212\316\363\003o\374\345\344q\320\305M\223\311yQP]\026\210\266\374BA\231@\214w\207\3552K\362\335\326\007\313>\027\336xA\312\301R!6\217\272\356x\010\005\360SD\330\217o\006\276\366n\310eQdR|l&\315L\256F\243\325A\260\020\214\305\n\371\357<\034\020~\034\205\006\341Cv\206d\231\300R\003\225\351\3718F+\272>\274\\\256.\323\335\263\314\300\2507\350\034\263|\272\252\3527wq+6\301\366i\031\213\010r\224\334,C\"^\366\300\020S\036\n\260\007\311\376\310\251\233\334F\335\002\364r\344\221\010I\326P\005\2657+\357\310\342%\253(\254m\242\013\033\365x\242\274\357\265q\005\0037\234`\270\337\004\t\332..p\006\000\257F9\352$|\300+\023(\364\232\355\3113\377\036\212\231\244\362\000\331\020\037\261\246\rdf\325\\\335\006\242rXYf\265\027\213\234\240[\2634\3259T7P_\005\227\234\204\267\244\321,DB|\367\270\242xY:\313\\\"\"\030N\342AK\316v\335$\010\303\344O\026bT\356\336>\341N\013\351O\312D7\005\343U\261\020\356\337\\\306Y^\366W\237\001\310\3344g~)\001\207\346\350\336\037\237\311\352$\346\3301\3473i}\351\236\336*\344\256KS1\324\020\301(J\302\023\325\216\366\346P)\212H\313\336\333\322\"~\371\234\202\tM\355X\201cY\204\275+\265\341\2137?\304U\347\272\272{\323/\300\342\254\252\233\2224\360\212@\0358\313\230\252\321\360\372-\332\213\206\204\203\034h\237\336\264\004\326\304HsJ\032\310\345\031\353\324j-\010KzG\215\221fixP\274\240\215\3508\326<\036B\201\376\272\352[\230\363\356L\236$A\005\331\022V\3501\303\001\216u\367-\035\217\177G\240C\n\375D\333\267Rz\370\346\314kk\372\355\362b\251U,z\326-\270\313*\220r\374B\002\236\001\256\005F\\B\214kd\311\207\336\357\t\004\246*\320\232\302\212\0005\211]\241\350\332\310C\200\367\234\270\242EK\305\356\213\275b\372\255\370\215\205.\346I\3059\212\0225pq""\314\212o\2563\325`\322LY=\267m\014\246\260\255\030\017\3420P\3447nu\355\272?\226\020\301\374N\355(\217S0\273\036tK\255\t\316\272m$\t\210F\3359|\266r^~X3(\303)R\010\225\201\272\254\266\256*\311O\254\314\322.+\345\024\231\256S*X\261\345\n\362\275K\240\016\300\"\245\253\310&\006\344\341%\340F\303~\r\225\300c\333=\305\203\264\336\310\326\312\373\367\375\010\227\323\327\370\203\314\325\241\317\"\275\372W\311 \367xX\314V-t!\004\302\2648\203s\032\256e\342\322y\033?\302\352d\340[\262R$d\336\327'N\024\370\204\243\"\360\332#\216t\352:\276K\036rd\340\344\003\030\"\222\360\020\355tH\337\245\274d\337\305 \007v\274\262p7b\225\265W\327B\"\223\315\362\316\315p\241X\245\216\004\253\363\301\310C\245\272\235\231\273o\314\002\256\251\226\356\314\360=$\016*\267\350k[\247\366\022.\201\005.\025\306?\036\030\300_/p{P:\262gF\0007\267\200\250\247\345\344\311Q\350\321p\354\376t\344\240\246\t1\246&$P\254W\336F\354\2101\265^\220M\221\002\027\n\260@M\251\364\241\347\370\237\367\371q\342\220\361C\357\274\205\023%b\346\252\337\366\037>\370\211!\024\343FL\341G<\177\006\217N\030\254\020\345\256\316\304\353?m\304\252\026(\374\235&O\206![\223\264 \016\362\016\377\004*\332\330\020'uH\r\027\302\310S\236\325\2517\215\005\317\340\006\255\260\nC""\225\037\254\017e\360\344\202\300\225\037j\253\370(\200\3426\310\345\\\001\2459\372\177IX\021G3.\306\222\331\360\237e;xh\023|\317S\300h\322gK\326\027$mQ\2214\225\270 \024x\323\355!\272m\340\261\230\245vg\313\352E\347b\364\322\215\311N:\253\301w\217\033Z\023\334\255f\337\260$\200S\023\257\272$O\223mqv\033\020\257\2306\3243\371\215,\322$\327\233\332H?\240\027\n/\307\242\014\243\035\020\317\245\2474v\226\256\025~\2053\324\252\016\260\226\300\272\350\025M\335\363\323v\354'\335|\351\005\271p\005\253V\025\324\237\021q\252\2232\212Ps\311.\362\004\333!/\315\222\330P\032\364L;\275\204\202\253O]K\245\2114\262;Z\272B\010\007\010\256Yj\214u\3529\310\242\345\022\037\216\271oKD]^:3J\2168\023\275\020\374]\337\340\014\330\3319\357\n)\"W\214\224\301\005\364\211#\311\233\331\325\335\202\363vS\246\257zE\224\200>\004[\356.\213P\214\306\214g\034\230\"\007\010\336\004\241\354\201\272s\346\311\322\031\215\2669\325\264(\027\026\237B\005V\013\235\203\355\027\275f\220\345\233\007\030\213^\2255\225=E\217Y\244\021\351\205\241\300\232\025\232\225Y&\227\331\207\274\244{\305\201t+|\0204\264\277\256\272\227d\374\224\353\023.u^\177\243\001wY<\033\021\200\006\230<\226\201\230\241\216\3231TJ\310\230]#[\274n\352f\r\021\0052\217\316%2\315X\310\255$\017\010\346\270!3\246\347\277\367\265B/\261\342\016\031\0048K\205\"\222\244\302\240\204\031\022\210\005\321F4\022B4\335\337\204\231\212\341*\037\342h\330\366v\244e\213\0072-E\227j\026\t\316\320\225#\217\242T&[u}F>~3\303Z\227f\225\3468\361{\005N\230H\213\034PZ\354kp\212\373\\7O\230\352i9|\212h\210\256ZM\350Y\267,E\3210T\t2v\0341\321\270\206\221\367\265\3065)\302U\327!e;\034\346\202/\314NL\006\247\305\r\207\340j[\211\031M\351\206\003\004<\347\325o\213mA0\214\314\3631u\260\364&3W\242k\210\275\227m\357H\334^\322\020\336\322\224\342\330(2\346\247\323D\031\221\376bA\307u\016\375Pe|\031X\365\363]\2350\220\006\342P\037\226\273\030\344 \205Y\336\010\277m\235e8\003\314\352\323\343D\226\354\t\306\035\267\251E\210\225\303Z\301\206OD>Z\213\010\322\261eS\356HO\262\037""\303y\022\370W\316\221Y\n\352\357\303} \267p\235J\323\205\3676.\002"; - PyObject *data = __Pyx_DecompressString(cstring, 4905, 3); + 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},{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 (4914 bytes) */ +const char* const cstring = "(\265/\375`zaE\231\000\252\221 \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\325\001\324\001\352\001IG{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\0340\352c|\3515^\006\357\3135\227\276\355\030\r_g\300\001\260.\241\3632\377\362\322<\314\327\372\304\353\310\203u0\205\247\265z\204\020\353\205\000\220\221\005\223\333\330\006sos\321\301\"\023\237\317CB_\310\347\313\030\007\2142\305\201\242O\216\221\207b\202X\006\226\301-\370\326\321\227\367:\034\314\274\"AQF\036\306:\216\2025\234\203\267\347y\246\316\353\032=\240K \000\024d\t\375\316o\310\2760F\341\370:?\354\030\256\271\005{<\254\034\205^""\373\250\216\361:\266b!\234\3437^\263~s\257\213\325\340\232\205o\311[\203\345:8\322\372\304\301\\v\212\203Y\350K<\315S\275\020\007\307\362\225\271f\232G\351UX%X\n\007\2636\026\030mL\276I\306\317\030\370\274\227\t+\207\2450p\244\311+\027\377\002\340\007\323)b\223\233F\231PQl\333\344\232\301V\273n\353nUo\376S7_\367\346\355\206b\201\273\345l0\310\0069\260\325\301 \037r\240^\315\225\363u\233l\253j\246\275\256\332\335\234\247@n\022Y\225\273\255\311\327Th\243iS\332d\236\346F\207\352I\334\246ir\340\311\242&Z\272\252\311] \213\236\247O\337\316\255\252\354\2719\253\236O\247\366\355\323\344\333\325h\212\256\247\312\262>\037\337k\352\016\331\226=olz\256R\\sw\335@\023]\367Os\216\256C\326g\232\350^\231R\316\365\032\364\333?.q\363\2302D)\037\323l\203\304\275\276pVm\271q\276\317\247s7\355\320VG\271;\3234\315[\322V\203C\367\310\345\251\212rV\375\235L\353\346)*\025\274\215l\023\346\266\262Z%O\256>\235i\260m\207\002ol\363\336\331\013k\301\275XK\326O\240\034`\0352~\200\250\343\272k3\363g/x\035\215(\272D\353}\275h\357\347sc\017\314\377\221g7\037\022\277\345\265\274\216\360\010\213[\261\223\357 g\232\034 \037\3018\234w;\006,\344oz\205\320\033x\251RV\330\301k\307i\r\300\007^\246[\031c\306\033\225\337\306%R\376\307s8|\334L/\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\202\003\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\243\227\354m\337\231\227,\207\331\214p0?8\3141\330<\223\035uW:X\347\347V\351\335\215?\001\3138\302\340\217\013\004\200\215,S\351+\351|\035\225\257\322\361;\006~\331i]=\266d\206O\224\362Shj0\317\350(\274X#Nz=\304O>\306\342\207\367\221\2127r)\263\324~\211\257z!`\275\010X\021H^\271\350\022ED_\307W\214)\202\3100\031\001\204t\375\000\243\200\242\242\000\036\236\200\235\235\000\234\000\234V\025\000@\026\225\360\013\201\037\370\364\237|\337\027e\324\306\234Q\251\201eJ\251[\224\261\302\372\342`\271\374\363\246/\364q\216d\234\001\014\322\003t\002F\223\"\255\0303\362K\340\220\211\257\353u\013\0371\353\344\001Y\030\033PAy\241~s\324yx\264\307\010\273\206[_\203\3702\261\013\366\371\r\032\247\325\200z\277\252\230\312<\331\345\343\003\371\005\335[\276\0020\017d\003\213O\030\307\017\344:\205C1W\334\225\037\010&h\370\016\016\263#\307\313J\010k8\312\327^\377\302\365\027x\305\005Y\352\027\002\213O\340\030\\\363\022\275\245}\201\367\365\250\211\034\004]\037z\035Z\256\231\312\205\000\320\221\365\333\177\343|\034\224\217\262\3617\\\337\305\203\265\200\000\300\220\245\343\023\215\257q\313\0222\305<\r\366[\341\313\021\205!\250\363\330Z$\224J\r\215\210$I\222\326\023a\0204(\226\313G\265]\327>\203\363\332$\024\206\2014\2040\010B1\010\2070\005\004\021B\210\300\020\242\210\010""\211\314\314\330\001K\212n:}8\3736\270\240)D\3162\202\255\327\370N!\355]oS\013\332\215(O\315\337\217\256:PPTg\314\325\300TL|\250\231k\3074\020*\346\217k\006\302\002\242\252,R\222eBV\254\245r\333\241\323h\326hp,\333\342\262(\362\372q\254\322\021\036\371\302\302=\"z!k\203\310:i\354\346\0033\237\220\t\232\315\264\022+\314\313\335\222\233\000a\233q\215\203.\354\032l;:\211\266C\020\260\331\274\242\352p\332\334\276\342g\0242\212A\302\210HF\346\325\335A\221\301\347\307/u\035%hv\264\251\204\221QiM\014%G\0001(\200\335\277N\351\311\362\246\241Q3B\005\355\256#\n)\326Lj\251\037\020f\025\226\260c\341\244:\343hny\242p s$\367\201J\215\205\337=Dp\237}[\314\213RO\214\022Dm\211^\tR\321\352\315[B\325\017\343'\305\301\272\344\266~\320\030~\342\332\235<(\177\003\325*\215|\224\001N\365x\032\220\025?\272\221J\"\225a\014:7\rgl@\025_\350\200\357\300C\356\334\214\263\236\031X\346k_\321\276\317_\215\306\321uP\212\242&'\034\362T_gL\030bo\000Y\242\302S{{\340\254\024\004P#f\340\232P@?\3443zG:\377f \236#\026\326m\221\216\315\202,\235\336\3176\335c\0027f!\022\013I\3761\032.Qb\237JL\025K\212\300D\003\244\311\037\320<\346\351F\333\351\214\237\272\\|\034u\206B\340\r$pE]X\374\325\303>\211p91/\323\201n\356\3311\264\016J\240TU^\235\271\361V'\354\374\367:\010R~9\231\214\336\205~D\231\007N_g\223\034\214\313\224Z8\005\003!\017v\304\302\202\327\026B\226\271\2511+\221\222\270B;eed\354q\n\207O\302\252\260$\222\302\024]\271\200+\314\007\374!\211\366F\314e\365\346\025\220\245\256\237|c\206\322\033i\275%\002\024}\001(\036\313\361\375\240\333\246\023@%\217\262\371\355\302\361.*7\250\305\275GJ%\211\030\257d\356\205\322h\025Hg\357\365\353\352\004\371\220\037\332|8\234\004S\006\200;\003\212\304\323\335\354\001\013\206\251\257\2075\267BN\354\177\252\237\347\222\336c}\245iSI\374\365\340\030\262\0058\350\335fQ.\205\221\273\223\367\273\345\343C\004\200v\321\034\021Pc\255f\243muon|\336\0144\334\356\333i\320G\221\252<\037\366\2370S\320S\353\307\334$\300\346ny\237%,\311\205\306\341\272\032\305\325h\325\003\361y*\027\262""\246,3\324\312\310\032|\362\245\314\246\r~`^\343#lf\250:P\002X\367\267\363\033\203\216j\232\224\353\305jtY\360\337\362\003\re\0045\306\036\266\244\226\326Wu\037L\355]\310\343E\225\303l\207`;\352\252\343K\024\240\016\001\241\237\277\031\260\032\230\240w\314\221Y\361\263\273\264C\231\322\315^\203wC\351\013vd\375<\331#\3749\016\317\322\017l\215\241\370\232\263\206\266\300\311\253\253\350UT\277\260T@Q\032\2002\2471\201O+S\351\004w\344xB\323\241\004\\\006J\265\363I~\222fS\316\362u\207\206s\363\302.*W\240\252Z\331\005Z\030\007\350\0228\241\333\310\257\227\261\367\\\034\206\352\255\372\334(\026\225L\301\220\007\247\225\237\250V\363\335\334\245 gIC\0014\302\233\\\006\360\222\375\373h\203\005\302\252\373@\272\n\323\206\007\240\273Hve\033t\247^\360P\316\331)k\225\350\355Hc\004\211\366\347\266k\n\010*\271a\010\271\230\351\201X\316B*j!\301\352\267o\375\372\t!\3035I\244\013\020\354\3104\021\222GS\025\262\337\254\274\223\2111V\034\261.)]Rs\342\311\372\276\331\006\007\003pp|\240\"S?H\210\224\364D\000\304\202\362\217I\224\033\336\004\240\320h\366#\317|zff-\311\203tCF\304j\033\330\247\265wu\024\350\354P\321\302M[Tr\255\267>o~\350P0P\205\025)\331J\220\222h\260\230\n\201\326\203\211\232d!,s\213\210\240\234\204\002-\231\355\004\226p\007\217?\266\211qsW\326\302\265[\350\366\223\025l\362\252\r\001\273\261f8\310\213\3435>\000\332b*\232o\223\200Kqt\360\007e\214u;w\204\234\253\231\244\177\345H\177\026\271\226KQ1\350D\260\203\222\226\211\352E{\235P\251G$y\257\202i\211\337t\266\023\230&0\254\300\265,\302\324\215\336\260\305\233'\304Uu]\323\305\004\024\227sV\246\215I\212\360\252@\005\234e|\325 {\304\030I\005Y\302\301\264QE\217Y\232\266a\226q M\352\322\2105z\274\236\205\275\236\252b\344\263\030\036\006Vi\024\225\312\302\236\035(\355\177\365\340B\014\207k\016\245X\246ZZ\300\n8f\330\206'\357\240\245N\304\377\025\352H\261\337\250\375\236\224*\267i'l-\275\375y\221\267Jf\027\035/\004\374\rd4z\221\201g\014lA7\256\212\361DI\372^w\317B\307\270\017U[\254Q\240\\\270U(\2526\362 \200\272$Rhq^1\371\024\357""\266\236*\"a\251\233s\024>\207}\005\014\\\233\247\"\2156&k\242\014\002\246\211\376o{\231\371\206\n\010\017*\030\256\3407]\210\307\356Ge\031\300\234J\003)\037\205\223\275ag\276\300*\027G\033\306\344\340\361Nw\370\336O\356\tlbx\016'\307\311R\200\364`\232\241\312\224\220\2622M\213\334\273Sd]\346o\312\342\204+\n\357M8\037\000U\233\256/\017\030\260\305\213\235\033\215\3065Tb\222\255\265\234\207\365zC[\314\360\034\244\021Zg_\307$2W\207\0316\326\352\263\007\264\370\347\341\274{\266\242\0065\004\366\201\241{fH_\342LQ\352\267\347\304\246\325[.9Htb_s\234B8\2061\344\343\365C\234q\252\232\177\227\234s`\345\344{\037[\244\r \355\370A\257G5e\237\301 \007vR\231\304wg\221\025VWF:\023\317\364B\004\177\301\243\232\354\022V\027\002<>\026\002\355\207\356\241s2vM[x\033\206OM\252\252\327\242\237\263>\337=\273\030\027x\225\234?=0\240\377_\325=\270\354\330\326\214\300\335\231\003F\275\227\227QF!\243\361\261\253\253\323\303\232*\305\225\235K\244X]y\033c!m~=\"\231 \005\323((\215h\245\251#\236\342>\355\243\343\311\241\346\207\326y\213N\324\205\365\021z[\375\227\350\355\315\036uS9\220\267J\207\322\020C\371\211\023n~P\266\375\214;\207=2\017muu\323\357\222\265G\312V\220l\344\310\2750\266i$\237/\316\221\341\214\324e~\217\203\331\334\321\270L\275\303\032Id\277\302\031\231\271\231\216\350\302\3263\242\017Y<\003\255\357A\223\345\221\215i\371\270Q\242\2343\016LQcfJ<\251 \326\337DX3\234^\271f;W\344\t\344z0\267!E4/\250\326\022zV-\206\"h\n\325\205\215:\034\2316\276\313\250\327ZqL\212\177\352\352`N]g\270\3423\263S\243A\323\341\006C\274J\254\262FSn\303\003\221\324q\356M\327\266 \306#\3032f\016\350a\223\310\221*\034\222\024\030[\272\310P\227'\004e\231\307>>\216\274i\351Tb\036\221zYP\364\234B{\257L\177\002\254&\233\316N\030I\004q\326\017\013]sr\360u\026\274\341\377,\007\273\263\211\2314_\261\010K>\007#\322[m""\301\303\332\221Zp\372\223\037\037\325+b\316\010\233\327\367M\207\277\305q\236a\374\375s\214\237\202\326{k\037\2727s\247:ua\367\260\213"; + PyObject *data = __Pyx_DecompressString(cstring, 4914, 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 (5044 bytes) */ -const char* const cstring = "BZh91AY&SY\2466[\221\000\016\252\177\377\377\377\377\377\377\377\377\377\277\377\377\377\377\377\377\376@@@@@@@@@@@@@\000@\000`\030}\335\363\247\333\036\217G\275w)\335\335\316l\035\275r\226\330\357^\3578T\353k\334\364\347\274\336\3359\315\356\341\324\201\243\243W\273\336\327\243\021\323SE\357\273t\003N\001\364\373\200\034$\222$&\231\0324\361@\006!\240\036\230d\321=(\321\220\r\036I\3511\242zCM=@d\000\r14\320\002H\200Dh\tOj&\306\246\246\206\0206\246\203@\000\017P\r\032h\001\240\032\000\000\320\r\000\t\020D\211(\036\324\232a\250h\030\203@\301\242h1\233S\312zSH4\320\331F\236\246\004b\032z\214\232dmO\010\324\t4\242J~\2244\032mMQ\372MM=G\352\233\322G\221\r=&\233P\323@z\232zj\036\240\000\315@\000\030!\2404\006\200\212H\0210\230\324\304\241\351\264\320\247\351O)\372\240\017\325\001\211\247\250\365\000\000\r\000\000\006\203@\017\022=G\251\240\"P@\231&\2004B3EM?i(\362\233OSF\247\352@\017P\032h\000\003L\200\000\310\310h\000g\252\177\340\207&\274\356\236\354D\301e\306\376rq\370\366y\214:\376$\263\331\260\201\274\n\013\321a\360\004\257\372\007X]t.\300\2734R\037dhE\330RW.`s\003\232\036\200s\302\251\022\n\245J\257h,\026\013\005\202\353\221u\312\344\373o\267\225P\336\300\212\242b\230\201\210bo\037\270f\006\216.\006\r\337\030%\214\262\311\034\206\315\207$2\017jj\020d\214\222E\021b\010\010\251\"\302\002\221H\260U\006\000\022\014\211\010\260$\212`\\9\320\n\t\210\324\300\364<@>\334\177\234C\322\006p\222D\247\322\177\r\245\006)Z#\205\207\245\313 \031@\210\334t\2047\241B\350_K\242a\302\030\006\262\024\026A`\212\3021\t\026(I\302D\210(vL\301M\310g@j\201\247Z\2243\306\340\\\224\010\257\234\204\0260\031\020\305\216b\032\020!\021\t\025\221\"A\220nd`\335\000\263\322I{&K\326!\230n+J\357\233\026)R&B\303\344\375\340\231\250\221\254\262\231\031\220\231$Q\010Q$\374\240\324&\303\004\320\033b\342\234O\226\362\273\307\225\314\321\330 \022\024(P\213\030\001B)G~\243\252\032\272\357\303\027y\251\312H\210\0221\201$!\002lZ\372\262\213\030\352\3563\340\034.|.\211\240p3\030\205\210E\035\256\343\n\210\241$)""\006t,a\234\317\312U\232T,\016\355e\006\241Jh:)\262\241f\360\227\306$+\226\245\3546\311\272gp\2711\022\221\335p\251b\314\217\305\022\272\225\006\243\221\252j\274\361\033j\231\223\253!\322\344k@\226r\347\327\223\034@\3101&\275T}\177~\224AIU\263(\212\t\221\004\312\300\202\234\276(\tX\020}\350\005I \036\245,\010C\214r\220\220\242\004\376P\003\32498\363[\3558\375\244\002\312\n\350*\344\207>\221Qu\375I\r>\264\303 \263b\242\031\010;\320\221$\247We\321\351UbUyy\233\025\020B%\257\313\n\363\267\222Jk\243h9\220\377\202\302nx\252\303m\306\352\322#\234\240\177\335\253\241b\014\244\022\206\372\260\303\236Y\267((\342\253\265\230iT\271u^\2344\023&\375\036\303i\"\300\024j\216(0\305\346A\347n\224\330\304\345prb\213\010\356\031[.a\030B\272\322\352\275\235xe\217y\356\220\357=^o\017Y\341\370\237+\345\372_R\372\213T6\334\237\t\360\237\003\272\300p\246\304\204a\010B\304\261G!\344\263\265\246K\206\30381\255K6he\232\320\370\027M\324DE\000\223@S%\251C\210\022\251\236\347\270\316\001J\020!\006\022\021\220\002\220\245\375\007\262\206g\353\007\003\300\361\362\240\036f\010\243c!)\006\002\017\255\305\301\330\344'\037\230\311\300""\3176r3\306\235\354*(\242{\277\267v\274\252\302\022\366 @\277\031<\322L@\017j\253PK\360\036\036\r\266<\335] u}\003\367\355\364\313\306\004 \310\260\2221\026\021\030\250\304b\221EU\212F2**J%&\220\254\205\210Zm).\313\027!\2649\235y\023\301v\035|\017\214/x\030\024\243.V\276\323\020\241A,R\345J\266P\301\230\030\255d\253\212&\206A\2219\230a\006Y\022\030\212l\3076s\2474\252\244D`\n\254E\0261b$RI\020\241A)\254A\266&A\242ff\205\30373(\310I$\201\t\242Y\014\3074\314\317\330j\037\307\240\272CA4P\321M\0032h\360G\034\023\002\333\237y\033+f\317\340\037N\023$n\244\213\0239\373\310\\\252a\250ua\025*\007;\260Z\305\302`]x\\\225h\255\373\330go\tCVan\030\220\r\273E\335\331\315\261P/\013\002\240h\022@c\321}\355\265\257\222\357\305\246f\316%T\210 4\010\202\204c\004k\207\376\210\035\335\250`1\225\023'\323\t&\252#4eQ$\251\270)X\300\376\027\312g\246\377a\352\337o\035~?\244\201I\203\357\020\222>\376U*\300\214\000(hR\\\342\3438\3060\266Z\252\030\267\030\306\027\022\325T\232\245\217\373\2676\252\255\256\315\2334\323\032c\013e\252\275M\334\000p!i\021\247\2634e\301n\026E\200\261d\213\007L\254l-\353\226\301\3004\276\206\337e\271\027vR$\344Xf\223jH3\031Pc\323&\260\366k5\325\251Q\305\234\200e\201\234\316{\310X\356\307\214\035\261\263\263\2633\265K\325\342\265\346.\201\220=p\326\205`\261\225u0\016\202\026\3109%\214\232\0261V\351\241)\204\371\236\320\332l\017\000tN\221\322\275'\205\2349\265\232\032S(\2723#\227,ZL\242E\310\260\315\026\326`\260\312^\027\205vk}\357\026k\336\373\303\343\372-\240L\000\331\010u\271~Uj\332\322\255\266\333m\266\333m\266\325\266\333m\267\230l7td8\254\003\204\016\243\216\035&t\310\342\033\264&\"0\301w%5e\203\302\033\t\200.\324*\205\223\203\010\310\254\324\365\366M\376\377?\234@\345\300\r\317?8\306\007\241\241im\264\266\333m\265\335\335\335\335\335\335\335\335\335\362\230#\005\206\263\243\201,\362K5 N\237\216:\311h\341|\034\2009=\360\034'\017\320\3409SvE[wEM\025.\210\232n\250\251\2420h\217\010\263F@\005\003\022\312#\003!\021r4\211L&\006\223I\237\214\013\001I\337\327\2242\205""\026\277\202\354N\023\330\270k\342\034\214 \300<\346\030\020\030\244I\030\212\202(\305\214\220P\024\220* \373\331$\342\342\327\3028\003\361\363ws\370d\223\270|TV\233<\23534\2045\327N\316\272\355qj\315f\223\341\310uJ=D\225+\030E\233\301j[\024\214JU\264RF\210s\033\323\214Y\240J\353\252L\234\346\323\234\31192X\236V\214)3%#\026\260T \366\211z\253\223\243\246\2223=\255y\235yd)u\252k\324\353\360\234\035~\375%\312\020\037D\001wL\032\274\252\304 @B!^\030\222#\203\324\277-EB\302\010w\326\003\nRE(*D\017\276\037\355\343YF\256\031OC!x\346\036\362\004\031UE\202A\271KD}.(\337\210\260m)\006\3342\201\214\007I\224\030)\000\010V\001n~\233@\344\3623\266\006~O,M\374\216\344!\003\024\355\353V\254\345\312s\272J\266U\350;\233\201\315\335\027\271\t<\360\212')\214Y\n\340\202\241&IF\014`\360\213\013\221\242\256\217\265\361I\203\006\250\252\"\251\310\234\302n\210\033\000\013#\024j\364s\031\302q\336\256\204\020\223\t\214\024HDr\354\006\264\034V/\265\205i\211\306j\177\201\204p\252\255\321f\330\317\005\221!a\001&|\321Y\344\204m\327sX\203]85bw\302\373\306\361\270\364\231\306\311\010\033\375v.4\356#5\213X\231$\231`0;\016=A\\9!jF\207pw\017\233\014\t\025^s\250\036\224\002\"\020\n\300\002Q\245\013I+\245\363\021\ni\271\352\206X\317(\372\370V\357\346\\5\304\246\234\0306\255P\325U@@\244\234\301\262\206\034,\234\341\260s\003z-\261\247\023p\210\335\304\350\024\306g\210\207+\251@\352\346I\265\002\032\202@\020\242\021\236];H\254\346\304&\313\216\022\244\000\232\245\225\256\224\217\361\3151\022J\361\254I\206o\311\016(\334\277\ni\216\031`\n$\264@6\035`\007\336\343\256\215k\347W\306!z\206a\335\317K\277#\227\273\261\260\275]AnHV\305!/\300^\006\370%\022\220\000\316Z\374\333\007R%\262p\313\232\004\336!\020\nD\220$8^\265\311\302\323\236\374\334\306\224\264\317U\177\272v\247q\264v]4r\211\326\260!\375\310\314\032\301\252\034\311\360(\027\0046\361""\356\230\350~'\244\352\251\320\372\024\350\373\355\221\331R;#\234\330\210\004J\004%\321\256\320\245AyM\313\227\000\27282\035qf\025\r\004\322P\321\245\2571t6\006\370\212\343\241\233kk\223L\252'\250f\232v\245(\2456\264\324\013Z\021|\217\234\343N\351\277\003\1778\207\035w\217V\202\233\227F\020S\030\240%$\332\203B\272\">\336c\000\304\245\260M\257\250\245\274J\274\233u\331\351\024\365\337\267\320<\023\210x\213\026\365\362\207\003\240\"\001'|\361\206\211\317\356\372@;D \013L\262SgnQz\301\025j\262\253C\261sf\243\342W\013\031\211\016\220p\203~ \006\355p\307+J\017\335\370\203N\2631\304\311\265\225l\221\200\332\266k\004\262\276\002\021\\\341\315\033\\\266\371\3676\026\317\257\032\203\241-ZV\224\032\314\253\314'&eL\025\244\020\240\203i\215\336\234*6\034@\010c(\262H0\205\006\020\007RP\010QX\006\004+\025\306\036g\260\355\022\274\274\220\024N\312\013E\001\354\310\026\272wO\201\000\256+\320T\017Pam\017\010g\024\370 \001\200&\021Qa\021$D\200y\367\236~\360F\306\242\255\035\254\362=n\344$\213\303\206\365\325\232/\027s\203\247\026D\257\024\006mI\365a\245\225^(v\020I\264\213\t\353\261\305\341T}*\030N\032\205\242\210\0354\312\325\255js\\h\267\230\214N\325\277'\224\246\350\335\016!\265\264?\024\027P\222\344\204\024\230R\330\t\221\201\031\214\220\252UD\205 \211a\005 \302jXE\220S\033 \264\224\203&4\034Ve\340\333\021\221\222M\320\233\375\003\"\212\022@\007Fy\251\020\241iD\214\216\003\026\n\202\224\364Z\222P*\273\231n\327\236\350\007\321@ \210\301@\210\266\324\357\241\214\2220fu\272\022H\346\315\333\267\3707C\263\247O\0073l:C\024\352'7\303\252.\373Q)~\362\276\342\257:\255\020\014\023\034e\351l\005\270\036\344\220fPfh\325\346Q\0206B4\235\035\306\272\332#u\267j\0268\010\274\275\250\361\000\312;n\331\311\000\370Up\276%\367\233\224$\222\033\330\246\364\265k\305$\205!%\257\177\315\363\362*\251\261\177t(\247.\376\374*sp""\335\2368\343b\305\266\353:\307\273\271;\203\267\340\271\364<\201\237\002\036ZvFpP\366@\3430#\245\212\354\r\224\350\344\226\031)\014i\010\002\214b\302@\352\202\024\021 \240\315\202\310\303H\007\006`\006\014\022*(\274\253\251 \347\024(\265\321\003\t\241\302t\351\243\2355\345\343\025\251\324*\323J@\002\226\245:\353]\020L\004>U\366\361\030\220\202eEZTk\245hG-\320\r\332\331\337\244@\007\010V\214\214\3164\361h\347\217\020\016\2018\201\305N6,\032\2077\265hy\0249\000\253\0205\346\306h \303R\031\304H\022\270\noDKeN\200\227\025\255\312\033\206\246\364\003\227\243\234\362\234y4\020\353\344\223?\216\217\tu\230|\312\250Nk\001\177q\007\223NN!\300-\343wg.\335\3569\2370\\\000\364\000\035\253'[z\316\304\222P\031\001\260I\021E\027\241\263t_\027\257\234\365\017~\375\003\312\274\016\nv\330j\235\317\347\025\300:\003\036\360\365\206\306\t\201\357|\205@\306\263\227\251\345\036\037\365\200}\324\"\300d?\264F \212\202\220\021Q\213\347\207\247\"\372A\372R,>|\021H\035Q$bA\000L\016\371\002\2353)\232NC\207\263\354I\020@\374\254 qI8\310\310}\252\024A\024\377\204@+\t=\001\366\177Z\372\256\036/\211\234\030\020\224_LO\\\236\217\235t\356\211\311\260\003\267\356}\211\326\357\277\233y\224(\233\322\310\214\210T\314\375\035\257[\217\376\215A\004\377\tR\241F\204\211\020\203\271\300|\017\344\373\216\364\004JB\376d\001\373\357\207S\313\210&\244\321d\226\006\203Sg\233\321\016\016\201\3477\361S,b\206\211]Q\036\366B\251B\335\341H\316\t\343\206h\030}\017\003\275kL\324\266\007\304\236A {]ET!\207PF0\\\366\314\tJbD\246=\214\235\274\224\205L\006\224\231\017\004\027W\310itT\354AE>\261\356\n\010\027\347\374\201p\275\243\001\"\212\257\017\341;\014N3\232\361s\326h\n\017\00088&g\216\006\003\303\"hc\346\337\177\033\244\255\241\325\202\340\354\235\254$`\030\323/\210\346s<\255\207\3061\033\n\347\003\236u\262\304\322\216\246\204\310\264\032(\"\017'j:[\207\305\270+\232Q\260f\334eY+A@Y\354l\007\313\201\017\307\375\037\361\207\235\263\373\r\033w^\201\022ux\357\220Xa)\030\034\033\003o\237\"{\202\004\330r\336\3228\326\350GR""\216\222\361\266&\270\237\272\267\025 \303\337[\363\311\r\355\340\310\367\006\325\274}\367\353\331\316j\210<\362#\314\355\001\375U\3642\263\222*g\"7\007\2203\304g\020I\360\214\336\272{\305\2740\252\316\221+\232\267.\231\275B\332oj8Z\353\205\2768\265\"\235\251\034}\261\370\266\206\320\347\255\342v\031\303\203\177b\200\224\314\235iW\376\370\322\336{\276\371\324\236If|\361\237\2000v@\357\263\350\250w!\335\357['yS\373\356\n^\351\334\363\237\222p\363\302\025\035=\244\223\343\234\360\212\346.j\364\003\234\0043\367\022\266nPn\001\313\205\341\362\003\213\262\021\033\023dO\035C=oD\240\332M\233v\205\255\246\243Q\033El]\010\305\030\033\375\363\201\356\273\235\211A\342\276N\332\260\203\274\345<\325\222\361\301q\017v\336\022\372M\276\320<\323Q\312\016\030i\265\277\201sK\200\265y\334B\210\252\205&U\214x\23111\n\252\027f\360\311\216J\026\212\235Al\330\227?\321X\2742\303D.\202x\256\3179\314\360\355\241\326\331/C\000Gi\n\316\220\266\003\254?D=a\304?q\364>\231\357G\357>)S\023\342\216\023\303\006W\002\305J\313\266\304Y\026\335\222\357\356r\340\306\014h\364X*0W\3132w5\257\203\014c\2133*\2645\306$l\203\020Lj\021$\273,\275\r+\023\202\321\013\225Y\213\266\365AR<\301D\004\204\301\240PL\220PQ\001s\242\266*R\321\003\357('\352T\340\"\036\007\255T\225\215\024&\276\266V/\032\344\3114\031U\203\001\211\r\"\2123\003\013e\271\035J\204\301\251w#\300bU\"\333\031pa\206j""\255\336\035t\010\360S\375\213B\345\032\226\232\310\031as\016\365\342q3#XD\273,\201T\332\371\306R\203\201\020_\224\244\205,#*\022\324\025\202\313JQ)U\032\242\300\325\202j\314`\301%\272\214\321P\355\222fn*+9\344l\325\251\316\242\301\265\031\321\313}\373F&\214F\275t\213v>\357:\306:\355\300?PWp\265\2534j=\343\274\313\236\362\223\212\223;\360\365C'\376.\344\212p\241!Ll\267\""; - PyObject *data = __Pyx_DecompressString(cstring, 5044, 2); + #elif (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (5043 bytes) */ +const char* const cstring = "BZh91AY&SY\207{HT\000\016\252\377\377\377\377\377\377\377\377\377\377\277\377\377\377\377\377\377\376@@@@@@@@@@@@@\000@\000`\030\177|_E\037@\035\366\017D\210>\330\223\345\237'\\\205\364\353nr\235\336\365-\200\003J\000z=w,z8\200O\252\272\336\335\rP\001\246\300S\341$D\220\223\311=M\246\"d\321\341G\240\231=1\201\031I\265=\246\236\223%?E<\232dm$\362\236\247\244\323M\250zCCi\2122\000d\324&R~\224\375SI\345\017H\r\000\000\310\006\206\200\000\000\000\014A\220\003@\032\000\000\022\232\004D\244hz\206#M\r\000\320\003@\320\003M\244\320h\000\000\000\000\000\320\000h\004\232I\025<\224\321\203)\352\217\324jh=G\250\036\246\206i4\310\000\000\000\000i\352\000\323@\r\003@\000\004T\002\022\223\304\324f\220\362\231\251\3511\250\364\232h\332\236\240\3654\320\000\375Q\241\352\r\014\206\324\000=@h\014\233Q\372$z\201\022\204\004\3114\302&\232\014\204\033ST\3311\251\036L\246 z\207\250\323@\032\000\006\215\000=@\007\251\247\250\323\324\365>\200O[\035\275\034\252\302\245\032W}\254y\275\232?Z'\257\352\264~z\"\032\204\200\3740\016\260I\376\300\310;\210\356\217bd\322\035\202\010\224\240Mi(JF\300{A\355\206\310\\\245\002\345\265\317\304\027\205\341x^\030`\230`\340\237\353\377o\325\014\246\001\005Q,\226\002\301c(w\213\300\301\263R\366\347\302\tc\034qG\021\263a\305\014C\350M\002\014\221\222H\242,A\001\025$X@R)\026\n\240\300\002A\221!\026\004\221K\313\203\202\001A0\032\227\236\243\324\001\363\307\371\204<\340e\t$J}\247\3544\240\305+Do\260\377O\337\240\r \210\352\346!\335\0246\207:m\023\227 \336<\010\240\262\013\004V\021\210H\261BNr$AC\270d\nlC*\003T\014\372T\241\226\027\001q(\021_1\010,`2!\203\034\2043 B\"\022+\"D\203 \334b^\334\200Y\344Iu\223\025\351\020\3106\025\245v\315K\024\250\361\001A\312\365\341\021/\002l\"P\370\200\210 gv\031\340\215\310h&\243\004\314\033`\340=G\266\363\273G\235\310\315\324 \022\024(P\213\030\001B)Gn\203\242\032:m\277\007i\241\316H\210\0221\201$!\002jZ\355\031E\214tv\031n\r\327\036\343\232f\033\216sA\320L)3\363\216\t\201r7\006\364u\r\346\377u\306\365\300\310\035\232J\rB\224""\314sSUB\315\320\227a\022\025\307B\353\r\261nL\256\013\211\200\224\216\313\202\245\2132?\203\022\272\025\006\243\211\242h\211\302\332&D\350\304s\270\215h\022\316<4\346\303\0001\014\t\247E\037O\325K\241y\206\207h\212\t\343A;X \247\337\370\200N C\344\200\024\202\240|\224\242\010\236bZ\010\245\010\003\376\310\007\310|\337/\033}\312\353\364\220\013\320WT\266H:\230\0262\237\334\210\327\241!\210_u\211e\216J\"\002\004\325$\307+\357#Y\222\2073/ @s\305\211\331t\272z\362I\250\333\273a\310\207\336,&\307\251V\032\3546V\221\034\245\003\376\355\\\313\020e \2246\325\205\374%\233s\202\216\n\272\331\206uK\213\225y_\230\306|\264\310\234K@\014&%\006\260\206\303\230\245\371|\327\303J\030\355\241x\305\204v\014\255\227 \214!])r\257{\246\374p\362\235\204<\247\261\344\356\364\235\337\211\353{~w\330_`\265C]\211\356\036\341\355;,\006\352jHF\020\204,J1\035\007\220\316\356\332.6\032\3038T\263}\2153\205\017i\332 \036\300\235\204`\177\311\004\220X\377\270\201\320\002d\356\341\322\234\300j\331\034\313\336<\260\\\213\360\347\241\315\355\231\213\2743=\351\303k\236H\341\206\320\351=\340\314\307L>\310[\230t/vwtt\310#\020\351d\010\320H\205\022B\201k(\321l\220)\002\260X\210#\002\222\014\226,H1\214ke\n\024\201m%)\310\204\340s\204\373`\003\363\225h\0000X\252\372\234\036\002\333\363\370\201\320uo\r\372*\247\223\025T\221\024\362\003A\365\320\rJ\236\201V\r\344o\"\201P\002\007\022=\312\264\212\275[<\037Y\000\343\026\000\t\343\022E\222J2IC\314N\352\375\222\254\036\366\370fcs\t$\272QQ\025DE\232M\2143\003\312f+s\014(\312\240\304\025\213 \3011ib&5GHiS\0261E5\224|\243\277;'\217\342p:B\304\341^5\306\325\021\256b\326qJ)\214\nL\025\342\341\0254\312\220\203\250\004]\337\245\255\324\003D\347\001\323:\307G\010\027\\;\313\230F`t\013 '74\220\347\007\250T\010\200Tw\320\020\244[@D\234\035.\255\267@H\3004\230\314\203i&\263=\037\242\351n\023!\000D\210\243\024\002\245\333\325\036\332\234O\242\035S\327\035\236\264\000\364\354\021F\306BR\014\004\037?\243\227\271\333'k\334\262r\263\335\316\333Vw\ts\207\252.\247B\001\346\330m\363\330\363\n\201\270X*\007\001P5\341\263d\360\366}:S\327\303\236o\027\025*\201\300J\265\265\252\235\225\372(\342\252\246t\002\021/\020o\302\010\231w\304\230i \206\212rZZ\363\370\236\323,\366\374\007\261\266\336\032\373\377i\002\222\367\320BH\3738\324\253\0020\000\241\261Iu\2275\231\230\266Z\252\031nfb\344\265U'\004\261\377V\352\325U\265\337}\366\3336\314[-U\360\271\271@\345\203\304N?P\341\273k\3432L\200\310\311L\203\241\310\344\373y\274\216\243\2158O\216>;R\221\270\272\205\241%\323\274\241\316nC^7L\212e2\231\343\211\211A\336T7T\336o>\342:\347\256\241I\254\244\244\222\223\023c\260r\330i\367N`\375\300\354G \310\334\372\225\017\272\217HP\271\324\275\035G\034\357E\274/\331\3368\233\207x:\307`\354^\303\316\316}Z\315\215\251\244]\231\241\323\246.\314^\036\203\3303=\257\305\r,\211\2010%\231\224\346\236\31559\201\343\311\261h\026 \033\302\036\233\223\311\255[ZU\266\333m\266\333m\266\332\266\333m\266\367\306\3477ZC\242\3009\300\360\234\347\332km\016C\233bdD,\252\202SQ@\255\204\202\034\n\246v\227l\033-\214\rY9\033\316\277\314\352x\004\016H\001\314\3655\231\203\325\330\264\266\332[m\266\333mI$\222I$\222\262(E\r/\306U\0042\320&\366.\025G\341w(\033Y\317\215`9\216\230\r\243k}\260\336\305P\363IT\223\022L)\036%)\222bI\205b\225\264\226\270\000\3004w\t\264\346,>\307\021o\013\300\342q7\374\240b\027\237W\207hv\205\333>\361\266X-\216\247""\213\240|lA\200\374,a\000b\221$b*\010\243\0262A@R@\250\203\354d\223\243\243\207\206r\207\337\351\363u9\344\223\341\036\341\017\025\025UAO\207%>\n\3732\225)\002\342\236\3605\n{\302\001e^\177-U{\333z\336\001\327\017\345\352I'\202\236\261 x\323\025PUQ\025UW\267J*\252\252\347\177}y\t\357\366\337\310\333ShC\207\r\273\2348qr\325x\264\0255H\306*@\223\031=\317f\3404lW\001Y\204\254<\222-;\236\335g\275\231\302\265\327%\227v\256\354\247,\255\303\326\223\030\263s\211\225\240d!\364\223cMH\350\335t\210\026\336\302\322\302\320\"\312\023\276S\371w;3\026\347!\\\361\003\206\000\272f\376\367\337VD\010\021\020\341\312Q\021\337\372\234\364\342\250b\202\036\376!\300J\220\252\n\220\200\354\206\366a\236\243n\264gF\"\365\344>\024\00478\216\325\017\036\031X\247\032\r\266hd\036\026\340\361Wp\032\201E\212\014\024\200\004+\000\267\016V\201\315\342g~\006^.\330\233y\235\210D\016\014\334\314X\257\321\321>\301\016\314;\370\302\375\225\331\260\237\227\335\205\347\237\232\265>?\245\247\236\374\313^\351\3301V;H\024\205\nb\016e\t\013R4:\303\254|\227\336H\252\360:\001\344\200DB\001X\000J4\241i%s\273!\020\246{\036\210c\204\355\037N\352\334\374w\006\230\027\337\277\177\227e\316\030`\004\024\243\352\207\221\016\\\232>\200\354\254\014:\350\007\206\312\345\000LB\010\0200D\337w\\\270\306\373\341[\343\334\027aP/p\311\313;\256>z\034l*\354\032\304\227\344\374P\352F\342\355\324\317\013\361\274\024Ih\200j:@\017\245\206\231\265\257\231_\010\205\325\014\203\257\205.~'\036\315ME\350\350\013sB\266)\tv\341w\033`\224J@\003)k\267\352\035\010\226\305\277\035\360&\321\010\200R$\201!\272\352\327\026\373N\027o\336gKL\264W\373g}:\317)\311\374Q\321\023\266`!\273\023\214\031\341\302\r\t\346\250""\035\220\207\027;L\316\243\254\362:*q}E8\237OTuT\216\250\3455\"\001\022\201\t\264xl\024\3007)\353k\250\033G\177\214\3532\212\207\244\255\024=9\370\252m\016 \357\304W:\214\264\264\262e\226\204\3542\224\333)J\246\226Z\201\213U\027\304\371\216\252u\315\267\233x\010ui\264z3\024\330\271\260\202\230E\001)&\264\032\025\315\021\3727\227\206\005-zkv\202\226\360*\363k\323g\220\247\246\356\377\250;\223\250<\005\213zy\303q\304\"\001'\226xC4\341\331\347\000\357\210@\026xh6\034\014* -\323|\347*9i\241\365\006\"\351\037\007\314.\275\354n@\277\300\033w-\327\000\334\200N\366\330yz*\200`\204Q\002\010\222\372\t\225\007g\273\245\207\204\347\217\213\034T\325\361]jcT\306c\034e}\312\0358\224\321\314u4J(x\003\343\260\001\344\306\3741\264\240\372\376\000\317\244\310p1me[$`6\255\232\301,\257p\204W(o\215\256-\266\177\366\242\331\364\341Ps%\253J\322\203Y\215w\211\315\221R\365i\004( \332as\312\372\215\207\000\002\030J+$\030B\203\010\003\300\224\002\024V\001\202\025\2130\207\221\357\035\361+\317\315\001D\357PZ(\017{\020Z\347\327=\244\002\270/\022\240{\001}\263;\241\224S\332\200\005\340\227\305E\204D\221\022\001\346\332y\274\240\215\215\005Z:\331\346z]\210I\027wj\225\313\327\247\2443V\353\274&`\2703\\*\345-\261\222y\t\201\002\rl\032U^\247S\272\250\371\324/\233\264\013E\0209S\033V\265\251\276\341\242\3350![\356\305\227\317k\024\356C\212hh\021\344\003\244\257,$\322\003N\000T\234\211\324L\rjkF\006\240\\B\232\201\274f!v)\244R\226\222\220\313&\305\312\315<\274b22I\315\t\327\352\232\024P\212\000:\272\222\250\205\026\250\220\341\271\247\0076\301T\330l\221\200\252\354e\273\357\013\220\017\262\200A\021\202\201\021m\241\345\241\204\222D\215\261\245\302\254\265\036\\\267\361\344\237\201wEM\231'\0022\035p\323\307I\005\333j%.\362\225\361\252\360U\242\001za\204\272\226\274[\200\361\311\010\232\022S\227\263\014A\272\t\305\341\334Z\351\265:\351\277\310ho\030\330lXy\000\306:\354\325\305\000\367\025o\273\002\355\246\305\t$\206\326)\265-Z\365$\220\244$\265\327~g\233\231UMK\273\002\212s\355\362\337S~\355\231a\206""\026,[^\223\244z\372\323\254;\376\325\307\303\342\014\267\020\355\247z3r\207\301\003\252^.\326+\270oN\266\211a\242\220\315\241\000Q\214XH\035\220B\202$\024\031\270\2620\332\001\313\250\001\206\022*(\275+\300\220u\224(\265\331\003\023c\234\360i\263\255\270rfYS\240U\246t\200\005-Jt\326\271\240\227\210z\327k\3400!\004\306\212\264\250\327:\320\216; \0334\263\2678\200\r\360\255\031\031\224i\340\315\313\016\240\016\"u\001\324\247U\213\006\201\277\350Z\036%\016`*\304\017\025zOI\016X!\350\021 \234 _\272Jy\024\372\342j\257\007\2646\rM\250\007?\036\007i\325\315\230\207O4\231{\364wK\226_\356\325Bo\260\027x\320y\263\346\352\r\301o\013\263)ss\326o|\201p\001\352\000\035\365^\335h\372\025h\004P\224H,$$$\335\177&O?\257ku\236\315\334G\235w\033\224\357\330j=o\346\225\2748\206\036P\364\206\245\351y\350\370\212\201\234''\003\311\315\254Fr\225\204\364C\\\201\340\300\363BF\331\003\033\263\214q\205Td6\210*\252\272\334,'R\226\031=\363/XH\326^E\001BT\213<\362\244\241\350\007\244\343\030P-XD\307\2730$\300\261\222L\251\374\372k\214\375z\247\345,\322\204l\214\276\240\201\331\003Q\226\2330h\"\306\223\272ZL\314\177\034\340q\354\032\025\3338\276\321\007Q7% B\221\242\017\034\345Ux\003@\007cl\202\255]9\\\010;\251\267a\237\375\003\275d\314<,\305\330\361\370\210\204\244$%\224$R\227E\320\362\212av#8`m\261\323\231\245C\302T\033\272;[\237\230*\200R9_\270k\031\237m\001\337n\334~\375l\213\3655\373""\357\371\341\031\334\356\301\031\3701\344?\023\334\306\261\031l5\303\337\376\204]\232\272\036\355v\204\245\007\267m\354\364z\347\030{\260\205\234fm\307\203\266\343A\373\365\337\"\222\335\2061\006\361\010\3721\004d\237_\316\004\035\022L\247\244\3046\024\366\267\014\205\333(gW+\327t2\331P\275\2469\206\212'\226\227\031\216a;\245P\035J&\347+(Y\272\367\263J\335>\223\355\030\214o\007,\257\006\320\001v\332\313\201\357\374b`[\305\376\326\032L2\273\316\321\336{\210\316\367\325\334\035\277Iq\326\\<\266\031Lg\222\033xlW^h\321\251t\256c\\\205M\272\025\334\177?\261\207\347&p\342J\273/1l\230q\345\373d\233\3669\246Cf\271K\225\264&\215\035\251\223\r\211A\260S\337\257~\267d\253\031w \234\371.\231\222Czd\037J\357RGs\231\316\325\316\372@9\330\251\277\320\330\027\355\254\347\316\367\321\316\332t\241\035\255\335\271~\3068\206\026\030PN\313\213\251\3121_\257\261\270G\347\234\363u\257)\002\377W\007}\345U\317n8\362-\225\325\376P\231\261gUM\262\352\360\336l/U\330\360\267\225\310\240c\325\270\3615x\340_\020\033\264~\213\331\224E\376\357T\273q\372E\200\323\357\000\354\373\375{\037Q8\253;)\251v\256\2667\274Y\016\374\013b\215\355i{\003\213f\374\373\350\303\375\255}\370^\245rX\266\351\360\232\330\276\375\232\271\201\253k\253\211\330*\265\306\321\031`\034\265l\374\010\235\2123\313\tV\3475c\371\361:\225L\257$b\265L\344\277\003\027\001\035\202\333$=ME\247\252\033\372|>r\347\030!\307\261T\224\272C\321m\260\037A\301F\346\246\366\030Z\030k\241\34130\365\026\006S\300\322[T\340\353O?\034\365\215_\032\020\206L\355\031Gv\317\020\302\004g|L\206\254OS\033\316\014Y\247\274\277R\033\273\343\210\2158\366\3044\221]\364\004\232f\2000N\367\203:\023+\2750n\030\354c\214=S\271\244\220\310$\023\014g~\266\001\363i\236J\010\370\253?\264T\201\346`\317\352+\317'\346\222\352\247\036l.\025\205\347\306\261\024-\200+\300\"\203\305\227\262q\352\262\237P\246\303\366=MC\300@<\360\334\206\260\n\256\002\266\2163\311\004\300\204P\0022=\340`\"&\000\2220\211\245\236\335{63{c\226\000\342\230\277\230\230\200u\214(\3712Fw\337\321""\\\002\020\001?\275\221ax\037\365p\231\332H\347(\226a\342\030\212d\360\013\032\313\002\240\2228rB\356\004\315\262i\201F\376F`9\370\253\t\343\023\031\360\367\270\372>\235\344\031\337\"\223\3151l\214\241\276PO\323,Sy\\\002L\337\277\346\360;\034\256\352\371\220\324L\"\366\221|\224C\210\001/h\371|G\247\275\302\314\030\371~\007P\205!,\313\330|\305\223\244\221\031i\326\367\033(]\004\360e\252\320~\261~\027\224\331\210'x\334\225a\361\272\022\303\325_\250\345d\032(\344\365\316x2\301\013KB\016\374\356{\373\227Y\366\275\276H\004?!\212D\032\337!4\366\230\223\347\340\212\2736\373J\251\331X\025P\363Ip\324\0108\251\n\323\006\202\331\005\022Z\243\271\370\334*\023\373h\351\206#\037\\L\214\341y\233\004\326\246\313\004\335l\314\367\237d\032Z\374\035\260e\226Y\317p\366\223u\002\354\306\232be\031\265\337\250\246b\324\330SKB\375\220\005\251\332\241\352\256\215\322h\"\304&\242\253\213g\352\036M\010\215\375\266\313-\0106D\261\r\035&p\347\221\006\336\332M\3251i\034i\202K3\361\325\227\373\352\237\255h\333\013\256a\300\202I}&\333\320Q\005o3b\300o\030\251\331\240\026\373\272g+x\007\354\353\007\252\300\033_\0107\366\230\033\330\016\351[\330\014U7\211D\236m\254\303\277y8\213\"O\231u\3419\263\\q\3746\337\023\332t\231(\330\217\3518\330\177\371f\337[\003\260\t]/Y8\352\022+,\023o\362\355P\223!g\275ogQ\3639:\206M\347@\220\0201\312\t\221h:\307\306\371\246\323yz\231\251\314o6\261*Z\347\037\304:\217\330\223g\257\272\315\331f\277\246\311\224&N\242\255U\216\277\246w\034h\255\000\316K\232\315\250%\325f\206\263\350m&\333\t\276\231\213u\372=\226S\277\035I\333\024\270\343\n\307\tm\010\273\311\032\307o\232\034\007\332\020\265\343\222f3\352\310l\234\321D\324\215\223mE\335\344\370q\372!\254S\277\035I\333\025\265\323\n\307\t\355\210\332y\r\242\253\363\215\374?\000\361\212\313\217T\032f\007\362\255\346\001\230\250?\247 \304\347i~\203\215%\322\276X\232KC\246\3112|4\232N'u\330\261\ncb\220\177%\342\220\211\300\301HR)\024 &\256\370\010\213\200\330\010\376\307\005L\224\216}\214%\323<$)\311$C\342=\336GGc\325D\305g\311Y,""\275\361t\n\356\265c\0024\370HR\360\307\361\024\216\304\3231\274\244\364\251\372\325`\202\361\200\363\364&O^\034F\310\225\\\220\362\210\331\"\rHU#\225\006\263\036K\346\342L\004RWk~`\264cz\033v\302\2107\270\002(s\"\271\241@*M\226Y\2411Y\206\035\200\356$\334\241\305\245#\240Y\\\002\225\245Zt\250\266xK/\317F\200R\226N\301R`$\260\000QDB\214FB\377\031v\205\261\274\376\2243c\034\375\031\304\306W\027\351O\306\312j?\351\313dh.\305g\322\231L\032 \200\221\021\026\232m\230Pi\343\216\2745\"\2046,f\"d\304\030%HU\204\216\373V\360\214D0)\326\t\343\230T\372\023\303\241J\324\3702\036Ru\236I.Cr\036\347Ay\360\037\271\350\313\240\025g\226i\340\025\362:\311\350%k\201\003\271\240\204\252\264\326>5\270\023\034\326\327\222\006\307\013H\263\200\304\352E\0314\252j\2136\273q\226\3212\373\010 \263\315\201\356f\2102E\3007\000\366\302*\227^\263\210\307\256Ep\250>V\252E\237\0004\201\256\343\n\3358\021M\305\3242|FC wTM}e\304lX\235\206\331\271\226\020V\255\035\374'\213\233Y\377;\221\321\016\234\325\316\336\312{\313=G7\203\233+bX\353\031\323\306\256jW\037\024\017\027\351R\357\321\315\331\315/\322u\331[r\r\212\376r\357\210\370Y\366\312\263r\266\324{J\362\227zOJ\336r\257k\363wqV\314\226\\\3077\0051(\322\245\376q\371\221\222U\273\312\375\347\2445\231\226\263e\000t\013\200\017O*]%\3279)'\207\264\013\327U\322?\273\t+\007\265\301qyN\316n\035>\320wB\352\226\316KaiE\016\313\214\022TheM\245\325\\~\276p\250\020.\365\016\211a1.\371\224.eP\231W\017\251\257\363w\363\321BOa\276\330S\234\327\236\275\322^\275.\001\236\274vrZ\tU[\270\325\257\000yF\346\225\031\225\313\273\tE[c\007\372\3727\263\355S=*u\021\024\354\250\366\312\247\224\220\022.\367\237\224&d\267\354\255R'\336\221\007\345\320^\021wBr\303\224ne\214L\t#\276\301MZ;~N\342d\267\201""\362\321M\177\311\325/\036\001\004\373\317\313~\371\256\034W.(\237\363\347\363\317\363|\301[\352\207Y%\317\031\351\271\304\003i\327\025\257rU=\250\372\325\337\363\376\374\275\202\247\360\262\350-y.\000\222q\305\227\357\312\017\022\004_\027\357\026\243\332\263\027\332\2137\332\233?\264?\376\324\376\\\326\226W\312d\"]\356?!\215\310]\200B\277G\374]\272\006\r\317i)$}P\002\312\013u@\r\250/\362Cy\032w\r\227F\317J\177\001\225nD\004\271\350\001u*\367\036o\020\205G\234G\216\303@\251w@\364\226z\207E\272\254\023\274)h\203\323\312\234\302\253^\225\020\353\222B\260\265\346\271\254\\W/\347\201/\256\315\005m\370\242\034S\334\312e\330\334\215\262\332\220\016\202\342\366\217JG\201+!\224U\205\031\206\256\226t]\025\227\001\032\360\362\252\324%\rKY\0046/\366J=\322=\020\345#EP\203 \267\257\205\271\002W\364\024_j\317\201)/\t\357K\025\336\023t\006\305\233\322\357\362\177\224\234\3720\377\272\360X{\266\250-\242\024\265\327q-\276\242\255\254\";^\313!9\\\362\214J}\3620 0zJ\272*w\313\027A\304\336\322\3511\371\022jU\3113\"\n\200\371\3509D\246\236Q\250\216\217\201Q\204\300#0\243\177D$\3064(\216\203j\352\3743\246x\304GRV\356r\242\363\370fN\234\023\353\3450`\201\323\tr8(\005%Z\372J\266\035W\231|\000\366\3317\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\225\35021c\334\274~N\270\014\r\360+\362k\035E\234l0\355#:\202Q\351\020x\232\217\212\233\354Y\006\246\377-\r \234\021\335meuC\235\005\222\010y\210\367\250W\036!v9\212\376\3754%\367)\303J\266D]Vn\251\213\371\303\340\214\216\026\375\350\212\336jo#Z\004<\000]\242\316\3137\225\273\n]\032\277\244\\RCj\270\\\273\356\271\232m\234\203\033\340\316\247\301;\351\334\202\313-iQ\356\332\tk\267\307\325*\327\364\21669\354\304\\\344\353\240\024\262\303\273\324\253\273\267\336c\23349-\215\0131!r\202\032x\377\004\036\375\240\342W\036\001\257\210\332\316I\304)\336\006Z\376\006\347\351/{&\200\250\233\204u\326&\010\235HO;5M\264`\364\262\342/\021Q\273\245\013\350\010\206EF\362\203\327r\353'U@\033\272 ?""\2277\300\333\317\252\234v\363aq\240XU\211\257\322\274\334\253\364\300\301\322\205\312\261 \261`aY\365h\336\217\233l\310G\320@L\0259-=\224_\301v\247\317I\202\034\200f@Y\312w\347\275%\352\242\374\227\332\245\272\255B.[\215\322B]v_({\014\016\260=\212\302\266\324\030\202C\351r\332\211)8\256\037\202g\363\344\237k\277\375\267\310k\317\027\313.C\227\352\324\342\330f\\\254(@\277\330U\262:n\342\021OH\247@\341\336\241;-\367WU\004)$\nzU:,\305d\017\250\344\003\365.\350899\211\342\nR@z\003\034\320O\323\n\321=\362<\270\262\213x\272\303\201\340\036j\203\364O\250\357\016B4\361\270\006:?\217\240\214\375\257\201o\231\225\214\275m\\d\333\204C@\264\177\204/B\200\272\307\204\033\216\300-z\304\260\341\010\010\023\210#\330\221\371\033\247Bkk\262\234\010\0142f@\274 f\321q\3511.\247\271\275\362\200\341\177\021u\014dW\234|p-\t{\341\306vh\341\331\316qW{M\301\356\335R\275\376m\371\214\014\347\274v\376\232Jo\035;\320\367\363\346S\024\236Ks\235\306SK\037@{\254\351\036\327\306\257k\327\027\264\005Fc\226\267.\036\350s\221`\3573\246/%\027\342\210\241\276kH|\r1~\030\205\337G\0024\303\"\375\322#\220\370I\224\204\221\016\341\2425)*\037\226i<>\273\244\023\362\2042\240\\S\335u\233\241^]\206\303u\031\342\354\215\374\317\2050\006\262?k.\202%\340f\272\216\263\230F\301\316Z\377\204\274\006\251T\326>\324\374J\344\327\0179\346\005tle\317\020f\250$\035\033\322\323\213\212+\322\216#\313\017)/4\377\\!X\200\000\302\201\302k$\2202)\033:\005\341h\024<\316\202\022\003\201T\372\367\217.#\354\3373\272\036\220\330\255]\2720\217E\330/@A\300\327\037\024\375\030\241\231\t\363\250\364\263\374B\233\3725\037\316'\n_\264\305\027\350\230&\300b\274z\312\212\001\030$\323ny\\\216*.u\236\330( \007I\26662!s`\021\036T%Z\312\266\303\341Z^\330S=(\335\225\342\362$\244\324\241\266\251,WCS\273\320\323\222\014?\224^\311\304#}\202|\3733l\202N\352\210\232\315\367\344C\230\t\257\220\364\271\032\205\232K\317\200/\356\221C\226F\233\300Z\215\267\226 \320\246\235\274\254\314j\277\334-x\013W\213\007!\354\017\231\341,2\263[\272\204%\033\345\010""\361\270\201\374R\261\247\270\240\27522+m\225\327x\241\375\231\304\0266\027D\226\314<\212\231\244)\2523\322\007r\246\374]\360\024\032\037\353\324\3676(\315qR\3401\325\330qD\337\264\021\301\017\305`\221.\256\221L1\252E\001\321\217\332\307\224\226\312j\331\317[\007\016|\351Z\350\206\333B\367\023\274=\351~\212\267\247\335o\361\366\266\373]\267=\325\273\007\252\271(\310L/\301a\321\227w\347/\025\356\026\242\300\311\307\332\233\267;\226\347^\210\347\204t\226\364\335\312\277(\270m\345q\224\024\177\2769\337w\314\005#\260\371\006\272\332R9\277\235\n\356\\[\312\326\244;[j\346\230\332\364G\255w\034\305\262\025\201\t\207\307\"D\007nK\303<:F\304/\362\2546q;\357\317?,\374\241\205\237\3339\3643\004\362]\371\243:LX\335\217\245\035\314\342\337\253\347\325\260^\026\270.\215A\200\302+\023\030\224:\273|#iizv\214`\314f\30685\201\r\372K\334\351\376\016A\017J\241\266@\337\320n\274\001\271\002P\355\230W'\344F\276\253\014{$%\257\344\327z.j\027oj7\037k\217?h\037\"[\343\007\372\316J\341RC\315\020\"\t\022b\224k\251\227\304\251rH\t\375\023*\017zJ\356\201\322\320p\251\267\257\344\031\332\272\203QY\310\310-\\\233\367D\022\353p\342 t\366\353lZ\302\250\270\334_\341\031&\213hF\256\315\033b\000\354\330\205E\343\243p\026\307!\373\353V'1z\360\210O@\005\036\200rr\352 \204\024\240s\205\217Z\370\235\366n\251L\022\037\022\371\374\023\332r\2419>\020\033\021C\243\240k\212\250H\353\002\204E\200\336\027,G\226\3721\035pch\222T\306\225euN5\002}\362\356\241Gz\214\326]W\234\364[J\220\250\335\327\025\257^e\264\026$\257\241\372V9\212\314\373'dVu\t\213H}\221\3647\340]_\374\265\340\375\tYh\3215\024\r\360*$\276\225h\273R\252\277\256`\352\266\301\216$)\376\0225!WJ\245\2471\001\332\362\030\234E\\\356\353\302]\200\210\256\207\222\273t\256\003\202\265O\304\211At\254\365\234\223\276*O\362\356\255\001\034yD\"\020\222\246\030t\265\234`\270C\314k\301\345\272\2549\020\300\227\303\371\260\024\306\227_g\244\227H""\005\256z\250\237\010O$7v\277\203d\306\200^\035\220a\350\274\374\233\372K\341\014$Z\236*TsK\300\240\\\251\024A\370*~\005\037\317+^R\024\345A/]^\315\273P$5\315\333\020h\037\004\245\005\373\323z\274\362\031%\225\367\353\033>!.\260\216\234Z\252~\301\034\301-Z]\245\371Z\312\215\3415z[\332,\246\270\365\210{\200\024\321I\321C/\022\033o\253`\031\332\323\260\030\026\243\344\215\307\210\361\266\251\007,\247'\177\277@\352\232~\260\262c\020\357\362\240\353\214JL\232\027\275@GL\367@\200Sy\3278\r\2318\270K{\213\340\377\000l\342\027u"; - PyObject *data = __Pyx_DecompressString(cstring, 5063, 1); + #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (5074 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,\212\231\006\236\022b\340\272\001\177#\344g\310<\266\020\341T\002d\307\256\302#\241\310\270\303\215\014\222\033\\?\321 \264\024#\320\272\260`\025\013\177+\240\240e\005\225`uP\372\035n\372 \336\340\n\240\314\211\344\206\002\2514Yf\225\306d\031v\000\272\223p\207\026\227\216\200fq\tT\226j\321\241\332\342-\275<\033\001JY:\005K\201\221\300\002D\021\t1\032\t\375g\330\025\306\362\372S\316\214q\364g\020\033_]\244?\031+\253\375\244/\223\241\271\024\237Ig2i\200\000FFXh\266aB\245\215;\362\326\210\020\332\260\230\211\220\021c\224 U\021:\356[\3013\022\301\244X'\214cR\351O\014\207*Q\343\313xH\325y&\271\002\311y\234\007\345\301\177\344\242/\203V\234Y\241\201W\310\353$\243\227\254\005\016\344\202\022\252\322Z\373\324\340NpX_K\032\034/ \315\002\022\253\027e\320\250\252-\332\354\306YF\313\354#\200\3146\007\272\233!\312\024\001\337\000\330\013k\\z\335\"\036\273\026\301\241\372X\251\026}\002\320\004\272\216+t\343D4\025S\313\360\031\r\201\334Q5\365\225\021\263au\032f\347zBX\263v\360\237,nf\343\357DF;tN;7\227\367\226{\216m\005\267V\305\260\3263\246\215]\323\256=(\376T\244K\275\307\266f\267\276H7do\3115(\372\313\275#\342g\331+\317\312\331R\357i\311_\352=%y\313\275\256\255?\304Y1[r\235\330\022\304\240H\227\372\307\345GJV\355*\367\237\227\326eZ\316\226\001\320\034\000\037\236T\272J\256\363RN\016i\027o\250\244\177v\013V\016j\203\343\362\274\234\335\376\351P\337I\251[\272 \205\245U9,3JP\241\225u\225Vs\371\205\302\221B\270\324;$\206\305\270\344S\272\224AeA=\242\276\316\337\315G\013=\205\205bOqA{\366J{\365\272\004x\362\332\251i%Tm\341V\277\001\344\031\231WfT.\357&\024m\217\035\352\353\337\312\266O\365\250\324EP\260\243\332+\237VBJ\270\334\177J\232\220\335\262\267J\235xG\036\224C\373E\334I\311\rS\272\22512%\214\370\006\267h\355\304y\211\223\335\006\312\307\266\374%W\277x\024\020\354\277 \373\345\273r""\\\271\250|\316_\310?\317\363\005o\251\037f\225R\0045\010r\373Z\230/pEO\361\245\366\034\230\362\222\360\276T\341=AgP\274%\375!\377K\311\251\017\363\257\013\217\265gK\332\022JQ{\035\327\342\253\332\352\032\262\343\265\034\222\303%\317\250\324'\017\003\002\243\247\245kr\267|\tD\354-\235\031\223/\243V\225<#\242\000\230\217\236Gd\352\031\205\352\370\030\030E\010<\n3\372GDbL\203\3428\250\246\316?c\212G|$e\345.':Ol\345\304y\261^\016\003\0268\235 \207\303RP\242\245\257d\333q\225\311\007`\237\003\343>r#.\031\366\356\3408\242#\030\225\216\200\247\371\250\270\311\236e`\372\337\322\000\302\031\321\335VV7\324Y \211\220\207x\217z\345\021b\227\243\350\337\317Pr\2372\254dK\324\025eN]\312\377\004\316\350X\321\217\256\350\255\3666\242E\300\003\320%\352\202|K\271\253\320\245\361\313\312e5\244\206\313g&\344\277\301\342\321D\262\026 \372\274\025\365\256Z\235\213\033!\006g\300K\351\\\203\313\234\264$w\355\206\305;\343n\225{zG\233\234vb2\362wP\n\331\341]\352\325\335\\\357\361-\232\234\232\306\205\230\0229I\r\274\177\006\317~X\361+\217\200qD}\347%\342\034o\003-\310R\177\3313\001D\335\"\254\2636A\370D\212\332\351i\242\r\243W\024\177\211\210\334-]D\2070,2\222\037\274\227[?\261\002\332\320E\371\271\274\t^\177V\345""\264[\017\213\003\305\252j|\225\026\344^\245\007\016\230.T\222E\211\005K\313\252\307\362~\334dS>\212\206b\252\312\031\351\241\374\n\266;s^\022\344\0004\003\312r\276;\357-Q\227\344\277\324.\325m\025r\331j\234\026\352\262\007B\331cp\204\355Q\024\266\245\306\020\034J\227\323NN\301\261\375\020<\234'\377\\\373\375\337E^{\276Tv\031\272T\247\026\307\267\342bE\001\372\305\256\222\325\201\023\317xR:\r\n\367\016\335j\271\277\252\"H!Q\320k\322ORL\366\200J> \006ENP\242\270\202\024\220\336\000\007\364S\265Bt\217\274\000.\355\022\236\362p0\270\207\332 \375\023\352\273\203\020M<\256\203\316/ (c\377\353\340cf%co\033W\3316\341\020\030\035\034\341K\020\250\3563\341\206#p\213\0361l8\002\302\004\342\010ve\376\306\351\320\332\232,'\003\203\214\031\020/\212Yt\\z\254\313in\257<`\370_D\035\003\332U'\037\\K\302~\270\261]Zx\266s\334\325~S\260w\267T\257\177\333>#\323\271\240]\270\256\322\333\307\017\365\375\262\365\024\205\347\322\\g\360\324\322\007\320\036k\272\307\265\361\033\332\215Em\221\321\230\225\355K\207\372\\$\350\373\214iL\311\2058b\310\357\032\022_C\254\037F\341\367\221@\315\260H\277\364\010$~\n%a\244E\270h]\212\312?\3114\036\237]\322IyB\031P\256\253\356\272\315P\257\256\300\341\272\002\361\366f\376\227B\030\003\332_4\027\301\022p3]\3079L\247`g\255\177B^\207\224*k\037r~%\362\353\207\\\363\":\266\262g\0103U\222\226\r\351iF\305\025i'\220\345G\224\027\232\177\276\020,@\000\341@\341u\022P\231\224\r\235\206\2604\n\036gQ\211\201@*\375\007G\227\021\376\357\033]\017H\234\327.]\230\317\"\354\027\240 \340\353\017\213~\214\320\314\304yT\372E~\241M\375\226\017\347\023\205/\332\322\013tL\023`1^=u\305\000\014\222j\267<.G\025\227\272@l\024\220\203d[\033\231\2209\260\010\017\252\022-e\333\341p-/\354\251\036\224\356Jqy\022R\353P\333T\226\253\241\251]\350iI\212\037J\257d\342\221>A\336\375\0316A'uT\315\346{\362!\314\210WI\032]\215B\315\245g\301\027\367\310!K\243M`\255\306[K\020h\323N]Qf\265_\357\026\274\205k\305\303\020\376\207\314p\026\231\331-]\306\322\215r\224x\334@~\271\330S\\\324^\031\031\226""\266\306k\274\320\376Lb\013[\213\"Kf\036\303\214\322\024\325Y\351\0039S\376.x\n\215\217u\352{\033\224\346\004)\364\230j\3548\242o\332\210\340\207b\260H\027\327I\306\030\325\242\200\350G\355cJKe\265\354\347\355C\207\276t-v\303m\261\373\t\336\236t?\305\333\323\356\267x{\333\375\256\333\236\352\275\003\325\\\024d\250\227\341\260\350\313\273\363\227\013w\013Q\340\344c\355\315\333]\313s?\304sR:G\372\346\362/\nn[y\034#E\240o\316\367]s\301\010l\276\201\256\266T\316o\247\202\273\327\226\2625\351\316\226\2329\2466\375Q\353\035G\261|E`\302\341\261\004\321\201\333\3220\217\216\021\361\213<\253M\334\316\373\363\017\013\177j\341\347v\016\375,\201|W\376\250\016\023V\367c\211\007\263\370\367\352\0055\254\227\005nHc\020\240\360\312\004\006\245\316.\337HZ\232\236\035#\030\263\2311NM`\203\376\022w\272\277K\320\203R\250-\3207\265\233o@\256\000T;\356\325\t\271\231\357*\303\036I\311+\371\265\236K\332\245[\332\255\307\332\343\017\332\207\310\366\370\241\276sR\270\324P;\204H\202\204\030%\317\224\342\206p\242\214\221\303\030\354\350\306\004\352TE\370\244Zg\226\315 \352\324\306\347\340\204&a\250 \373\211L\273,%4\243\326g-\371\2228U\016)\241\177B\345AO\311=P\032\032.\365\366\225>> 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_boundsappendassigned_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__throw_unassign""edunassignedunassigned_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 \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\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!"; + #else /* compression: none (25210 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_boundsappendassigned_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__throw_unassign""edunassignedunassigned_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 diff --git a/constraint/constraints.py b/constraint/constraints.py index 9a2ce80..f392237 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -496,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 diff --git a/tests/test_constraint.py b/tests/test_constraint.py index 863e167..675e03c 100644 --- a/tests/test_constraint.py +++ b/tests/test_constraint.py @@ -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 From cac004197947d96c571a1626cdf132818fa05960 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Mon, 29 Jun 2026 15:26:21 +0200 Subject: [PATCH 81/87] Resolved an issue with reStructuredText formatting --- README.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 1b24119..6adf220 100644 --- a/README.rst +++ b/README.rst @@ -12,19 +12,21 @@ python-constraint | ⚠️ 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. -| + .. contents:: :local: :depth: 1 -| + Introduction ------------ The :code:`python-constraint` module offers efficient solvers for `Constraint Satisfaction Problems (CSPs) `_ over finite domains in an accessible Python package. From 29b31216d5a2ed6b64f824d3e30fc95e688a61e9 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Fri, 14 Aug 2026 15:19:11 +0200 Subject: [PATCH 82/87] Bumped version numbers of build system, e.g. Python versions and GitHub Actions --- .../workflows/build-test-python-package-pull.yml | 2 +- .github/workflows/build-test-python-package.yml | 6 +++--- .github/workflows/publish-package.yml | 16 ++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-test-python-package-pull.yml b/.github/workflows/build-test-python-package-pull.yml index 801a2f5..4b27df0 100644 --- a/.github/workflows/build-test-python-package-pull.yml +++ b/.github/workflows/build-test-python-package-pull.yml @@ -11,7 +11,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: fjwillemsen/setup-nox2@v3.0.0 - run: | nox -- ${{ runner.os }} diff --git a/.github/workflows/build-test-python-package.yml b/.github/workflows/build-test-python-package.yml index a2951ed..4f279c8 100644 --- a/.github/workflows/build-test-python-package.yml +++ b/.github/workflows/build-test-python-package.yml @@ -26,11 +26,11 @@ 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 @@ -41,7 +41,7 @@ jobs: 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 3198fd7..402ef43 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -27,12 +27,12 @@ jobs: 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 @@ -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 From eed3e1581aee56d31bf3c2ca0fa80a30864c3668 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Fri, 14 Aug 2026 15:20:05 +0200 Subject: [PATCH 83/87] Dropped no longer needed testing dependency. --- tests/test_toml_file.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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"] From 6e1ae93f2c572a976318c1d7957f6dace5f3a72c Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Fri, 14 Aug 2026 15:29:04 +0200 Subject: [PATCH 84/87] Updated several development and documentation dependencies, Cythonized with new version --- CHANGELOG.md | 8 + constraint/constraints.c | 1146 +++++++++++++++++++++----------------- constraint/domain.c | 287 ++++++---- constraint/parser.c | 641 ++++++++++++--------- constraint/problem.c | 489 +++++++++------- constraint/solvers.c | 807 ++++++++++++++++----------- docs/requirements.txt | 17 +- pyproject.toml | 21 +- 8 files changed, 2005 insertions(+), 1411 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b7c856..f9f38a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ 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.6.1 +- Released: 2026-08-13 +- Issues / Enhancements: + - 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: diff --git a/constraint/constraints.c b/constraint/constraints.c index d85c575..dfe055d 100644 --- a/constraint/constraints.c +++ b/constraint/constraints.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.2.6 */ +/* Generated by Cython 3.2.9 */ /* BEGIN: Cython Metadata { @@ -37,8 +37,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x03080000 #error Cython requires Python 3.8+. #else -#define __PYX_ABI_VERSION "3_2_6" -#define CYTHON_HEX_VERSION 0x030206F0 +#define __PYX_ABI_VERSION "3_2_9" +#define CYTHON_HEX_VERSION 0x030209F0 #define CYTHON_FUTURE_DIVISION 1 /* CModulePreamble */ #include @@ -904,28 +904,39 @@ enum __Pyx_ReferenceSharing { #else #define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0) #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 +#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) - #else - #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) - #endif +#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) __Pyx_NewRef(PyList_GET_ITEM(o, i)) + #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_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) (__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\ - __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i)) +#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_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_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(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) @@ -2094,10 +2105,10 @@ 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 /* py_dict_items.proto (used by OwnedDictNext) */ @@ -3274,7 +3285,7 @@ typedef struct { PyObject *__pyx_slice[1]; PyObject *__pyx_tuple[4]; PyObject *__pyx_codeobj_tab[78]; - PyObject *__pyx_string_tab[348]; + PyObject *__pyx_string_tab[349]; PyObject *__pyx_number_tab[3]; /* #### Code section: module_state_contents ### */ @@ -3578,215 +3589,216 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_append __pyx_string_tab[139] -#define __pyx_n_u_assigned __pyx_string_tab[140] -#define __pyx_n_u_assigned_2 __pyx_string_tab[141] -#define __pyx_n_u_assigned_prod __pyx_string_tab[142] -#define __pyx_n_u_assigned_product __pyx_string_tab[143] -#define __pyx_n_u_assignments __pyx_string_tab[144] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[145] -#define __pyx_n_u_b __pyx_string_tab[146] -#define __pyx_n_u_bool __pyx_string_tab[147] -#define __pyx_n_u_bounds __pyx_string_tab[148] -#define __pyx_n_u_c __pyx_string_tab[149] -#define __pyx_n_u_call __pyx_string_tab[150] -#define __pyx_n_u_candidates __pyx_string_tab[151] -#define __pyx_n_u_class_getitem __pyx_string_tab[152] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[153] -#define __pyx_n_u_close __pyx_string_tab[154] -#define __pyx_n_u_collections_abc __pyx_string_tab[155] -#define __pyx_n_u_constraint_constraints __pyx_string_tab[156] -#define __pyx_n_u_constraint_domain __pyx_string_tab[157] -#define __pyx_n_u_constraints __pyx_string_tab[158] -#define __pyx_n_u_contains_lt1 __pyx_string_tab[159] -#define __pyx_n_u_dict __pyx_string_tab[160] -#define __pyx_n_u_doc __pyx_string_tab[161] -#define __pyx_n_u_dom __pyx_string_tab[162] -#define __pyx_n_u_domain __pyx_string_tab[163] -#define __pyx_n_u_domain_bounds __pyx_string_tab[164] -#define __pyx_n_u_domain_dict __pyx_string_tab[165] -#define __pyx_n_u_domains __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_n_u_genexpr __pyx_string_tab[180] -#define __pyx_n_u_get __pyx_string_tab[181] -#define __pyx_n_u_get_product_bounds __pyx_string_tab[182] -#define __pyx_n_u_hi __pyx_string_tab[183] -#define __pyx_n_u_hideValue __pyx_string_tab[184] -#define __pyx_n_u_index __pyx_string_tab[185] -#define __pyx_n_u_init __pyx_string_tab[186] -#define __pyx_n_u_is_coroutine __pyx_string_tab[187] -#define __pyx_n_u_items __pyx_string_tab[188] -#define __pyx_n_u_itertools __pyx_string_tab[189] -#define __pyx_n_u_lo __pyx_string_tab[190] -#define __pyx_n_u_m __pyx_string_tab[191] -#define __pyx_n_u_main __pyx_string_tab[192] -#define __pyx_n_u_max __pyx_string_tab[193] -#define __pyx_n_u_max_others __pyx_string_tab[194] -#define __pyx_n_u_max_sum_missing __pyx_string_tab[195] -#define __pyx_n_u_maxprod __pyx_string_tab[196] -#define __pyx_n_u_maxprod_2 __pyx_string_tab[197] -#define __pyx_n_u_maxsum __pyx_string_tab[198] -#define __pyx_n_u_maxsum_2 __pyx_string_tab[199] -#define __pyx_n_u_maxval __pyx_string_tab[200] -#define __pyx_n_u_metaclass __pyx_string_tab[201] -#define __pyx_n_u_min __pyx_string_tab[202] -#define __pyx_n_u_min_others __pyx_string_tab[203] -#define __pyx_n_u_min_sum_missing __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_missing_negative __pyx_string_tab[212] -#define __pyx_n_u_module __pyx_string_tab[213] -#define __pyx_n_u_mro_entries __pyx_string_tab[214] -#define __pyx_n_u_multiplier __pyx_string_tab[215] -#define __pyx_n_u_multipliers __pyx_string_tab[216] -#define __pyx_n_u_multipliers_2 __pyx_string_tab[217] -#define __pyx_n_u_n __pyx_string_tab[218] -#define __pyx_n_u_n_2 __pyx_string_tab[219] -#define __pyx_n_u_name __pyx_string_tab[220] -#define __pyx_n_u_next __pyx_string_tab[221] -#define __pyx_n_u_o __pyx_string_tab[222] -#define __pyx_n_u_other_max __pyx_string_tab[223] -#define __pyx_n_u_other_min __pyx_string_tab[224] -#define __pyx_n_u_other_products __pyx_string_tab[225] -#define __pyx_n_u_other_unassigned __pyx_string_tab[226] -#define __pyx_n_u_other_vars_max __pyx_string_tab[227] -#define __pyx_n_u_other_vars_min __pyx_string_tab[228] -#define __pyx_n_u_others_max __pyx_string_tab[229] -#define __pyx_n_u_others_min __pyx_string_tab[230] -#define __pyx_n_u_p __pyx_string_tab[231] -#define __pyx_n_u_parms __pyx_string_tab[232] -#define __pyx_n_u_pop __pyx_string_tab[233] -#define __pyx_n_u_possible_max __pyx_string_tab[234] -#define __pyx_n_u_possible_min __pyx_string_tab[235] -#define __pyx_n_u_possible_prods __pyx_string_tab[236] -#define __pyx_n_u_preProcess __pyx_string_tab[237] -#define __pyx_n_u_prepare __pyx_string_tab[238] -#define __pyx_n_u_prod __pyx_string_tab[239] -#define __pyx_n_u_prods __pyx_string_tab[240] -#define __pyx_n_u_product __pyx_string_tab[241] -#define __pyx_n_u_product_vars __pyx_string_tab[242] -#define __pyx_n_u_products __pyx_string_tab[243] -#define __pyx_n_u_qualname __pyx_string_tab[244] -#define __pyx_n_u_remove __pyx_string_tab[245] -#define __pyx_n_u_round __pyx_string_tab[246] -#define __pyx_n_u_safe_product __pyx_string_tab[247] -#define __pyx_n_u_seen __pyx_string_tab[248] -#define __pyx_n_u_self __pyx_string_tab[249] -#define __pyx_n_u_send __pyx_string_tab[250] -#define __pyx_n_u_set __pyx_string_tab[251] -#define __pyx_n_u_set_2 __pyx_string_tab[252] -#define __pyx_n_u_set_name __pyx_string_tab[253] -#define __pyx_n_u_setdefault __pyx_string_tab[254] -#define __pyx_n_u_singlevalue __pyx_string_tab[255] -#define __pyx_n_u_str __pyx_string_tab[256] -#define __pyx_n_u_sum __pyx_string_tab[257] -#define __pyx_n_u_sum_other_vars __pyx_string_tab[258] -#define __pyx_n_u_sum_other_vars_locals_genexpr __pyx_string_tab[259] -#define __pyx_n_u_sum_value __pyx_string_tab[260] -#define __pyx_n_u_sum_vars __pyx_string_tab[261] -#define __pyx_n_u_t_max __pyx_string_tab[262] -#define __pyx_n_u_t_min __pyx_string_tab[263] -#define __pyx_n_u_target_dom __pyx_string_tab[264] -#define __pyx_n_u_target_domain __pyx_string_tab[265] -#define __pyx_n_u_target_max __pyx_string_tab[266] -#define __pyx_n_u_target_min __pyx_string_tab[267] -#define __pyx_n_u_target_value __pyx_string_tab[268] -#define __pyx_n_u_target_var __pyx_string_tab[269] -#define __pyx_n_u_temp_sum __pyx_string_tab[270] -#define __pyx_n_u_test __pyx_string_tab[271] -#define __pyx_n_u_throw __pyx_string_tab[272] -#define __pyx_n_u_unassigned __pyx_string_tab[273] -#define __pyx_n_u_unassigned_2 __pyx_string_tab[274] -#define __pyx_n_u_unassigned_vars __pyx_string_tab[275] -#define __pyx_n_u_unassignedvariable __pyx_string_tab[276] -#define __pyx_n_u_v __pyx_string_tab[277] -#define __pyx_n_u_val __pyx_string_tab[278] -#define __pyx_n_u_value __pyx_string_tab[279] -#define __pyx_n_u_values __pyx_string_tab[280] -#define __pyx_n_u_var __pyx_string_tab[281] -#define __pyx_n_u_var_is_negative __pyx_string_tab[282] -#define __pyx_n_u_var_max __pyx_string_tab[283] -#define __pyx_n_u_var_min __pyx_string_tab[284] -#define __pyx_n_u_variable __pyx_string_tab[285] -#define __pyx_n_u_variable_contains_lt1 __pyx_string_tab[286] -#define __pyx_n_u_variable_with_lt1 __pyx_string_tab[287] -#define __pyx_n_u_variables __pyx_string_tab[288] -#define __pyx_n_u_vconstraints __pyx_string_tab[289] -#define __pyx_n_u_x __pyx_string_tab[290] -#define __pyx_n_u_zip __pyx_string_tab[291] -#define __pyx_kp_b_iso88591_3gQ __pyx_string_tab[292] -#define __pyx_kp_b_iso88591_55H_a_4_7_1_4q_1_G4q_t3a_Kq_waq __pyx_string_tab[293] -#define __pyx_kp_b_iso88591_55H_a_4_7_1_4q_Q_G4q_t3a_AQ_4q __pyx_string_tab[294] -#define __pyx_kp_b_iso88591_55H_a_D_q_a_3at_Cs_1_A_7_Q_J_c __pyx_string_tab[295] -#define __pyx_kp_b_iso88591_55H_a_L_y_q_q_a_q_L_Kq_QfA_5_q __pyx_string_tab[296] -#define __pyx_kp_b_iso88591_55H_a_a_q_a_3at_Cs_1_A_7_Q_J_c __pyx_string_tab[297] -#define __pyx_kp_b_iso88591_55H_a_d_4_7_1_4q_A_1_3at_a_4s_A __pyx_string_tab[298] -#define __pyx_kp_b_iso88591_55H_a_d_4_7_1_4q_A_1_3at_a_4s_A_2 __pyx_string_tab[299] -#define __pyx_kp_b_iso88591_55H_a_d_4q_a_1_1_1Kq_9Cq_az_1_t __pyx_string_tab[300] -#define __pyx_kp_b_iso88591_55H_a_d_L_y_1_AZs_1_1_t1_5_c_WH __pyx_string_tab[301] -#define __pyx_kp_b_iso88591_55H_a_d_L_y_1_AZwa_1_1_t1_5_c_W __pyx_string_tab[302] -#define __pyx_kp_b_iso88591_55H_a_d_Q_a_1_1Kq_9Cq_az_1_t9AQ __pyx_string_tab[303] -#define __pyx_kp_b_iso88591_55H_a_d_Q_a_1_1_1Kq_9Cq_az_1_t9 __pyx_string_tab[304] -#define __pyx_kp_b_iso88591_55H_a_q __pyx_string_tab[305] -#define __pyx_kp_b_iso88591_6a_N_A __pyx_string_tab[306] -#define __pyx_kp_b_iso88591_6a_N_A_2 __pyx_string_tab[307] -#define __pyx_kp_b_iso88591_77JJeef_3a_Q_y_WAQ_q_4t1Kz_1_wb __pyx_string_tab[308] -#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_6a_A_L_gQ_waq_J __pyx_string_tab[309] -#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_6a_A_L_gQ_waq_J_2 __pyx_string_tab[310] -#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_WAT_1A_G4q_T_Qi __pyx_string_tab[311] -#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_a_L_WAQ_q_6_Bd_A __pyx_string_tab[312] -#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_1_3at_a_IV1_vR __pyx_string_tab[313] -#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4_B_5_1A_4q_L __pyx_string_tab[314] -#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4_B_5_1A_L_Cq __pyx_string_tab[315] -#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4_B_5_1A_Q_L_C __pyx_string_tab[316] -#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4q_t1_S_A_IV1 __pyx_string_tab[317] -#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_q_A_S_S_G4q_4_1I __pyx_string_tab[318] -#define __pyx_kp_b_iso88591_77JJeef_d_L_WAQ_q_6_6_7_F __pyx_string_tab[319] -#define __pyx_kp_b_iso88591_77JJeef_d_L_WAQ_q_6_A_6_7_F __pyx_string_tab[320] -#define __pyx_kp_b_iso88591_88XXY __pyx_string_tab[321] -#define __pyx_kp_b_iso88591_8_l_1 __pyx_string_tab[322] -#define __pyx_kp_b_iso88591_99LL___Q_L_y_q_c_1_q_1_4t1Ky_AQ __pyx_string_tab[323] -#define __pyx_kp_b_iso88591_A __pyx_string_tab[324] -#define __pyx_kp_b_iso88591_A_2 __pyx_string_tab[325] -#define __pyx_kp_b_iso88591_A_A_E_r_A_WA_WAQ_1_82Q_D_3d_M_HC __pyx_string_tab[326] -#define __pyx_kp_b_iso88591_A_HA __pyx_string_tab[327] -#define __pyx_kp_b_iso88591_A_a_L_Kt1Ja_3a_a_wl_fCq_q_L_q_A __pyx_string_tab[328] -#define __pyx_kp_b_iso88591_A_q_E_A_q __pyx_string_tab[329] -#define __pyx_kp_b_iso88591_A_q_L_Kt1Ja_vWA_6_A_1_AYa_1_A_9G __pyx_string_tab[330] -#define __pyx_kp_b_iso88591_E_HA_F_Ja __pyx_string_tab[331] -#define __pyx_kp_b_iso88591_L __pyx_string_tab[332] -#define __pyx_kp_b_iso88591_L_6a __pyx_string_tab[333] -#define __pyx_kp_b_iso88591_M_Kq_A_L __pyx_string_tab[334] -#define __pyx_kp_b_iso88591_M_Kq_A_L_2 __pyx_string_tab[335] -#define __pyx_kp_b_iso88591_N_6a __pyx_string_tab[336] -#define __pyx_kp_b_iso88591_Q __pyx_string_tab[337] -#define __pyx_kp_b_iso88591_Q_2 __pyx_string_tab[338] -#define __pyx_kp_b_iso88591_Q_3 __pyx_string_tab[339] -#define __pyx_kp_b_iso88591_Q_4 __pyx_string_tab[340] -#define __pyx_kp_b_iso88591_U_A_IQ_M __pyx_string_tab[341] -#define __pyx_kp_b_iso88591_Zz_IQ_M __pyx_string_tab[342] -#define __pyx_kp_b_iso88591__3 __pyx_string_tab[343] -#define __pyx_kp_b_iso88591_a_N_L_A_1_3a_Cs_Rs_J_b_3c __pyx_string_tab[344] -#define __pyx_kp_b_iso88591_m1_M_A_L_L __pyx_string_tab[345] -#define __pyx_kp_b_iso88591_q_G4q_t3a_Qa_t1_3avS_4q_3a_Qb_E __pyx_string_tab[346] -#define __pyx_kp_b_iso88591_q_G4q_t3a_Qa_t1_3avS_Qb_E_4q_3a __pyx_string_tab[347] +#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] +#define __pyx_n_u_hi __pyx_string_tab[184] +#define __pyx_n_u_hideValue __pyx_string_tab[185] +#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_n_u_items __pyx_string_tab[189] +#define __pyx_n_u_itertools __pyx_string_tab[190] +#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] +#define __pyx_n_u_maxsum_2 __pyx_string_tab[200] +#define __pyx_n_u_maxval __pyx_string_tab[201] +#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_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] @@ -3855,7 +3867,7 @@ 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<78; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<348; ++i) { Py_CLEAR(clear_module_state->__pyx_string_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 */ @@ -3933,7 +3945,7 @@ 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<78; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<348; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_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 */ @@ -4350,7 +4362,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY #endif if (__pyx_t_1 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_1, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_1, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_1; } else { { @@ -4789,7 +4801,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -4960,7 +4972,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -5627,7 +5639,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -6566,7 +6578,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -6717,7 +6729,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -7206,7 +7218,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -7378,7 +7390,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -7494,7 +7506,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call #endif if (__pyx_t_8 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_7, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_7, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_8; } else { { @@ -8138,7 +8150,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { @@ -8183,10 +8195,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_9); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -8292,7 +8304,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_2 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { @@ -8337,10 +8349,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_9); } else { - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -8443,7 +8455,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { @@ -8488,10 +8500,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -8641,7 +8653,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #endif if (__pyx_t_12 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_9, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_9, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_12; } else { { @@ -8825,7 +8837,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_9 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { @@ -8870,10 +8882,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_4); } else { - __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -8991,7 +9003,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_9, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_9, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { @@ -9036,10 +9048,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_4); } else { - __pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -9147,7 +9159,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_9, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_9, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { @@ -9536,7 +9548,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -9581,10 +9593,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -9897,7 +9909,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_8, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_8, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -9942,10 +9954,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_7); } else { - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -10033,7 +10045,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal #endif if (__pyx_t_12 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_7, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_7, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_12; } else { { @@ -10220,7 +10232,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_8, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_8, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -10516,7 +10528,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_8, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_8, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -10600,7 +10612,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal #endif if (__pyx_t_12 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_12; } else { { @@ -11070,7 +11082,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -11544,7 +11556,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -11744,7 +11756,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -11993,7 +12005,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { @@ -12038,10 +12050,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_3); } else { - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -12121,7 +12133,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif if (__pyx_t_11 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_11; } else { { @@ -12273,7 +12285,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_2 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { @@ -12399,7 +12411,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif if (__pyx_t_11 >= __pyx_temp) break; } - __pyx_t_2 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_11; } else { { @@ -12910,7 +12922,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -12955,10 +12967,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -13095,7 +13107,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -13331,7 +13343,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -13425,7 +13437,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif if (__pyx_t_11 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_8, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_8, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_11; } else { { @@ -13602,7 +13614,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif if (__pyx_t_11 >= __pyx_temp) break; } - __pyx_t_9 = __Pyx_PyList_GetItemRefFast(__pyx_t_8, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_8, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_11; } else { { @@ -14270,7 +14282,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { @@ -14315,10 +14327,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_9); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -14421,7 +14433,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { @@ -14466,10 +14478,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_4); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -14583,7 +14595,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc #endif if (__pyx_t_12 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_12; } else { { @@ -14724,7 +14736,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { @@ -14769,10 +14781,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProc __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_9); } else { - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -15154,7 +15166,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -15199,10 +15211,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -15354,7 +15366,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call_ #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -15817,7 +15829,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -16291,7 +16303,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -16528,7 +16540,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ #endif if (__pyx_t_8 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_8; } else { { @@ -16629,7 +16641,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ #endif if (__pyx_t_11 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_10, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_11; } else { { @@ -17069,7 +17081,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -17114,10 +17126,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -17273,7 +17285,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_9, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_9, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -17938,7 +17950,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { @@ -17983,10 +17995,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_9); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -18089,7 +18101,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { @@ -18134,10 +18146,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_4); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -18251,7 +18263,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc #endif if (__pyx_t_12 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_12; } else { { @@ -18389,7 +18401,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { @@ -18434,10 +18446,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_4); } else { - __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -18545,7 +18557,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { @@ -18918,7 +18930,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -18963,10 +18975,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -19248,7 +19260,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -19293,10 +19305,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_7); } else { - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -19384,7 +19396,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif if (__pyx_t_12 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_7, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_7, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_12; } else { { @@ -19571,7 +19583,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -19836,7 +19848,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_7, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_7, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -19920,7 +19932,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ #endif if (__pyx_t_12 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_8, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_8, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_12; } else { { @@ -20335,7 +20347,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -20809,7 +20821,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -21046,7 +21058,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ #endif if (__pyx_t_8 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_8; } else { { @@ -21147,7 +21159,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ #endif if (__pyx_t_11 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_10, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_11; } else { { @@ -21587,7 +21599,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -21632,10 +21644,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -21791,7 +21803,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_9, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_9, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -22355,7 +22367,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -22549,7 +22561,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -22661,7 +22673,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -22706,10 +22718,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_3); } else { - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -22854,7 +22866,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -22966,7 +22978,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif if (__pyx_t_13 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_13, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_13, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_13; } else { { @@ -23370,7 +23382,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__ca #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -23567,7 +23579,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_6 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { @@ -23679,7 +23691,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_6, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { @@ -23724,10 +23736,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -23979,7 +23991,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_6, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { @@ -24078,7 +24090,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -24626,7 +24638,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { @@ -24797,7 +24809,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_9, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_9, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 960, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); @@ -24878,7 +24890,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_11 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_11 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 965, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_11); @@ -24897,10 +24909,10 @@ 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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -24984,7 +24996,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { @@ -25049,7 +25061,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 966, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_7); @@ -25305,7 +25317,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -25680,7 +25692,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -25749,10 +25761,10 @@ 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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -25830,7 +25842,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif if (__pyx_t_10 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_10, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_10, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_10; } else { { @@ -26247,7 +26259,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -26383,7 +26395,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 1014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -26590,7 +26602,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -26783,7 +26795,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 1011, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_3); @@ -26860,7 +26872,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_11, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_11, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1012, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_3); @@ -26879,10 +26891,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_13); } else { - __pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -26966,7 +26978,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_12 = __Pyx_PyList_GetItemRefFast(__pyx_t_11, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_12 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_11, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -27533,7 +27545,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -27607,7 +27619,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro #endif if (__pyx_t_8 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_8; } else { { @@ -27923,7 +27935,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -28046,7 +28058,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -28533,7 +28545,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { @@ -28746,7 +28758,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_11 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_11 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1123, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_11); @@ -28765,10 +28777,10 @@ 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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -28852,7 +28864,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { @@ -28917,7 +28929,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 1124, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_7); @@ -29171,7 +29183,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -29523,7 +29535,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -29592,10 +29604,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -29673,7 +29685,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif if (__pyx_t_10 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_10, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_10, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_10; } else { { @@ -30055,7 +30067,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 1182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -30273,7 +30285,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -30421,7 +30433,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 1164, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); @@ -30498,7 +30510,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 1165, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_3); @@ -30517,10 +30529,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_13); } else { - __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -30604,7 +30616,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_12 = __Pyx_PyList_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_12 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -30680,7 +30692,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_12 = __Pyx_PyList_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_12 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1166, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_12); @@ -30772,7 +30784,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 1171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -30799,7 +30811,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif if (__pyx_t_16 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_12, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 1172, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_6); @@ -30858,7 +30870,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif if (__pyx_t_16 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_12, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 1174, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_6); @@ -30935,7 +30947,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif if (__pyx_t_16 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_13, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 1175, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_6); @@ -30954,10 +30966,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_14); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -31041,7 +31053,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif if (__pyx_t_16 >= __pyx_temp) break; } - __pyx_t_9 = __Pyx_PyList_GetItemRefFast(__pyx_t_13, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_13, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; } else { { @@ -31166,7 +31178,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif if (__pyx_t_16 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_13, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_13, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; } else { { @@ -31219,7 +31231,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif if (__pyx_t_18 >= __pyx_temp) break; } - __pyx_t_12 = __Pyx_PyList_GetItemRefFast(__pyx_t_9, __pyx_t_18, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_12 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_9, __pyx_t_18, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_18; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1181, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_12); @@ -31791,7 +31803,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -31985,7 +31997,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -32097,7 +32109,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -32142,10 +32154,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_3); } else { - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -32290,7 +32302,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -32402,7 +32414,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif if (__pyx_t_13 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_13, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_13, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_13; } else { { @@ -32808,7 +32820,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -33005,7 +33017,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_6 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { @@ -33117,7 +33129,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_6, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { @@ -33162,10 +33174,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -33409,7 +33421,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_6, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { @@ -33508,7 +33520,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -34052,7 +34064,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { @@ -34265,7 +34277,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_11 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_11 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1310, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_11); @@ -34284,10 +34296,10 @@ 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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -34371,7 +34383,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { @@ -34436,7 +34448,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 1311, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_7); @@ -34690,7 +34702,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -35042,7 +35054,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -35111,10 +35123,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -35192,7 +35204,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif if (__pyx_t_10 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_10, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_10, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_10; } else { { @@ -35574,7 +35586,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 1369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -35792,7 +35804,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -35940,7 +35952,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 1351, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); @@ -36017,7 +36029,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 1352, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_3); @@ -36036,10 +36048,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_13); } else { - __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -36123,7 +36135,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_12 = __Pyx_PyList_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_12 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -36199,7 +36211,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_12 = __Pyx_PyList_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_12 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1353, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_12); @@ -36291,7 +36303,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 1358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -36318,7 +36330,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif if (__pyx_t_16 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_12, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 1359, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_6); @@ -36377,7 +36389,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif if (__pyx_t_16 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_12, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 1361, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_6); @@ -36454,7 +36466,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif if (__pyx_t_16 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_13, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 1362, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_6); @@ -36473,10 +36485,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_14); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -36560,7 +36572,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif if (__pyx_t_16 >= __pyx_temp) break; } - __pyx_t_9 = __Pyx_PyList_GetItemRefFast(__pyx_t_13, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_13, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; } else { { @@ -36685,7 +36697,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif if (__pyx_t_16 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_13, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_13, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; } else { { @@ -36738,7 +36750,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif if (__pyx_t_18 >= __pyx_temp) break; } - __pyx_t_12 = __Pyx_PyList_GetItemRefFast(__pyx_t_9, __pyx_t_18, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_12 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_9, __pyx_t_18, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_18; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1368, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_12); @@ -37452,7 +37464,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -37526,7 +37538,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_5, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_5, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -38216,7 +38228,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -38290,7 +38302,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_5, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_5, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -38871,7 +38883,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -39139,7 +39151,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -39223,7 +39235,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif if (__pyx_t_8 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_6, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_8; } else { { @@ -39926,7 +39938,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -40194,7 +40206,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -40278,7 +40290,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif if (__pyx_t_8 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_6, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_8; } else { { @@ -40783,7 +40795,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_14sum_other_vars_2generator #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -48279,39 +48291,39 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); { - 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},{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 (4914 bytes) */ -const char* const cstring = "(\265/\375`zaE\231\000\252\221 \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\325\001\324\001\352\001IG{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\0340\352c|\3515^\006\357\3135\227\276\355\030\r_g\300\001\260.\241\3632\377\362\322<\314\327\372\304\353\310\203u0\205\247\265z\204\020\353\205\000\220\221\005\223\333\330\006sos\321\301\"\023\237\317CB_\310\347\313\030\007\2142\305\201\242O\216\221\207b\202X\006\226\301-\370\326\321\227\367:\034\314\274\"AQF\036\306:\216\2025\234\203\267\347y\246\316\353\032=\240K \000\024d\t\375\316o\310\2760F\341\370:?\354\030\256\271\005{<\254\034\205^""\373\250\216\361:\266b!\234\3437^\263~s\257\213\325\340\232\205o\311[\203\345:8\322\372\304\301\\v\212\203Y\350K<\315S\275\020\007\307\362\225\271f\232G\351UX%X\n\007\2636\026\030mL\276I\306\317\030\370\274\227\t+\207\2450p\244\311+\027\377\002\340\007\323)b\223\233F\231PQl\333\344\232\301V\273n\353nUo\376S7_\367\346\355\206b\201\273\345l0\310\0069\260\325\301 \037r\240^\315\225\363u\233l\253j\246\275\256\332\335\234\247@n\022Y\225\273\255\311\327Th\243iS\332d\236\346F\207\352I\334\246ir\340\311\242&Z\272\252\311] \213\236\247O\337\316\255\252\354\2719\253\236O\247\366\355\323\344\333\325h\212\256\247\312\262>\037\337k\352\016\331\226=olz\256R\\sw\335@\023]\367Os\216\256C\326g\232\350^\231R\316\365\032\364\333?.q\363\2302D)\037\323l\203\304\275\276pVm\271q\276\317\247s7\355\320VG\271;\3234\315[\322V\203C\367\310\345\251\212rV\375\235L\353\346)*\025\274\215l\023\346\266\262Z%O\256>\235i\260m\207\002ol\363\336\331\013k\301\275XK\326O\240\034`\0352~\200\250\343\272k3\363g/x\035\215(\272D\353}\275h\357\347sc\017\314\377\221g7\037\022\277\345\265\274\216\360\010\213[\261\223\357 g\232\034 \037\3018\234w;\006,\344oz\205\320\033x\251RV\330\301k\307i\r\300\007^\246[\031c\306\033\225\337\306%R\376\307s8|\334L/\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\202\003\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\243\227\354m\337\231\227,\207\331\214p0?8\3141\330<\223\035uW:X\347\347V\351\335\215?\001\3138\302\340\217\013\004\200\215,S\351+\351|\035\225\257\322\361;\006~\331i]=\266d\206O\224\362Shj0\317\350(\274X#Nz=\304O>\306\342\207\367\221\2127r)\263\324~\211\257z!`\275\010X\021H^\271\350\022ED_\307W\214)\202\3100\031\001\204t\375\000\243\200\242\242\000\036\236\200\235\235\000\234\000\234V\025\000@\026\225\360\013\201\037\370\364\237|\337\027e\324\306\234Q\251\201eJ\251[\224\261\302\372\342`\271\374\363\246/\364q\216d\234\001\014\322\003t\002F\223\"\255\0303\362K\340\220\211\257\353u\013\0371\353\344\001Y\030\033PAy\241~s\324yx\264\307\010\273\206[_\203\3702\261\013\366\371\r\032\247\325\200z\277\252\230\312<\331\345\343\003\371\005\335[\276\0020\017d\003\213O\030\307\017\344:\205C1W\334\225\037\010&h\370\016\016\263#\307\313J\010k8\312\327^\377\302\365\027x\305\005Y\352\027\002\213O\340\030\\\363\022\275\245}\201\367\365\250\211\034\004]\037z\035Z\256\231\312\205\000\320\221\365\333\177\343|\034\224\217\262\3617\\\337\305\203\265\200\000\300\220\245\343\023\215\257q\313\0222\305<\r\366[\341\313\021\205!\250\363\330Z$\224J\r\215\210$I\222\326\023a\0204(\226\313G\265]\327>\203\363\332$\024\206\2014\2040\010B1\010\2070\005\004\021B\210\300\020\242\210\010""\211\314\314\330\001K\212n:}8\3736\270\240)D\3162\202\255\327\370N!\355]oS\013\332\215(O\315\337\217\256:PPTg\314\325\300TL|\250\231k\3074\020*\346\217k\006\302\002\242\252,R\222eBV\254\245r\333\241\323h\326hp,\333\342\262(\362\372q\254\322\021\036\371\302\302=\"z!k\203\310:i\354\346\0033\237\220\t\232\315\264\022+\314\313\335\222\233\000a\233q\215\203.\354\032l;:\211\266C\020\260\331\274\242\352p\332\334\276\342g\0242\212A\302\210HF\346\325\335A\221\301\347\307/u\035%hv\264\251\204\221QiM\014%G\0001(\200\335\277N\351\311\362\246\241Q3B\005\355\256#\n)\326Lj\251\037\020f\025\226\260c\341\244:\343hny\242p s$\367\201J\215\205\337=Dp\237}[\314\213RO\214\022Dm\211^\tR\321\352\315[B\325\017\343'\305\301\272\344\266~\320\030~\342\332\235<(\177\003\325*\215|\224\001N\365x\032\220\025?\272\221J\"\225a\014:7\rgl@\025_\350\200\357\300C\356\334\214\263\236\031X\346k_\321\276\317_\215\306\321uP\212\242&'\034\362T_gL\030bo\000Y\242\302S{{\340\254\024\004P#f\340\232P@?\3443zG:\377f \236#\026\326m\221\216\315\202,\235\336\3176\335c\0027f!\022\013I\3761\032.Qb\237JL\025K\212\300D\003\244\311\037\320<\346\351F\333\351\214\237\272\\|\034u\206B\340\r$pE]X\374\325\303>\211p91/\323\201n\356\3311\264\016J\240TU^\235\271\361V'\354\374\367:\010R~9\231\214\336\205~D\231\007N_g\223\034\214\313\224Z8\005\003!\017v\304\302\202\327\026B\226\271\2511+\221\222\270B;eed\354q\n\207O\302\252\260$\222\302\024]\271\200+\314\007\374!\211\366F\314e\365\346\025\220\245\256\237|c\206\322\033i\275%\002\024}\001(\036\313\361\375\240\333\246\023@%\217\262\371\355\302\361.*7\250\305\275GJ%\211\030\257d\356\205\322h\025Hg\357\365\353\352\004\371\220\037\332|8\234\004S\006\200;\003\212\304\323\335\354\001\013\206\251\257\2075\267BN\354\177\252\237\347\222\336c}\245iSI\374\365\340\030\262\0058\350\335fQ.\205\221\273\223\367\273\345\343C\004\200v\321\034\021Pc\255f\243muon|\336\0144\334\356\333i\320G\221\252<\037\366\2370S\320S\353\307\334$\300\346ny\237%,\311\205\306\341\272\032\305\325h\325\003\361y*\027\262""\246,3\324\312\310\032|\362\245\314\246\r~`^\343#lf\250:P\002X\367\267\363\033\203\216j\232\224\353\305jtY\360\337\362\003\re\0045\306\036\266\244\226\326Wu\037L\355]\310\343E\225\303l\207`;\352\252\343K\024\240\016\001\241\237\277\031\260\032\230\240w\314\221Y\361\263\273\264C\231\322\315^\203wC\351\013vd\375<\331#\3749\016\317\322\017l\215\241\370\232\263\206\266\300\311\253\253\350UT\277\260T@Q\032\2002\2471\201O+S\351\004w\344xB\323\241\004\\\006J\265\363I~\222fS\316\362u\207\206s\363\302.*W\240\252Z\331\005Z\030\007\350\0228\241\333\310\257\227\261\367\\\034\206\352\255\372\334(\026\225L\301\220\007\247\225\237\250V\363\335\334\245 gIC\0014\302\233\\\006\360\222\375\373h\203\005\302\252\373@\272\n\323\206\007\240\273Hve\033t\247^\360P\316\331)k\225\350\355Hc\004\211\366\347\266k\n\010*\271a\010\271\230\351\201X\316B*j!\301\352\267o\375\372\t!\3035I\244\013\020\354\3104\021\222GS\025\262\337\254\274\223\2111V\034\261.)]Rs\342\311\372\276\331\006\007\003pp|\240\"S?H\210\224\364D\000\304\202\362\217I\224\033\336\004\240\320h\366#\317|zff-\311\203tCF\304j\033\330\247\265wu\024\350\354P\321\302M[Tr\255\267>o~\350P0P\205\025)\331J\220\222h\260\230\n\201\326\203\211\232d!,s\213\210\240\234\204\002-\231\355\004\226p\007\217?\266\211qsW\326\302\265[\350\366\223\025l\362\252\r\001\273\261f8\310\213\3435>\000\332b*\232o\223\200Kqt\360\007e\214u;w\204\234\253\231\244\177\345H\177\026\271\226KQ1\350D\260\203\222\226\211\352E{\235P\251G$y\257\202i\211\337t\266\023\230&0\254\300\265,\302\324\215\336\260\305\233'\304Uu]\323\305\004\024\227sV\246\215I\212\360\252@\005\234e|\325 {\304\030I\005Y\302\301\264QE\217Y\232\266a\226q M\352\322\2105z\274\236\205\275\236\252b\344\263\030\036\006Vi\024\225\312\302\236\035(\355\177\365\340B\014\207k\016\245X\246ZZ\300\n8f\330\206'\357\240\245N\304\377\025\352H\261\337\250\375\236\224*\267i'l-\275\375y\221\267Jf\027\035/\004\374\rd4z\221\201g\014lA7\256\212\361DI\372^w\317B\307\270\017U[\254Q\240\\\270U(\2526\362 \200\272$Rhq^1\371\024\357""\266\236*\"a\251\233s\024>\207}\005\014\\\233\247\"\2156&k\242\014\002\246\211\376o{\231\371\206\n\010\017*\030\256\3407]\210\307\356Ge\031\300\234J\003)\037\205\223\275ag\276\300*\027G\033\306\344\340\361Nw\370\336O\356\tlbx\016'\307\311R\200\364`\232\241\312\224\220\2622M\213\334\273Sd]\346o\312\342\204+\n\357M8\037\000U\233\256/\017\030\260\305\213\235\033\215\3065Tb\222\255\265\234\207\365zC[\314\360\034\244\021Zg_\307$2W\207\0316\326\352\263\007\264\370\347\341\274{\266\242\0065\004\366\201\241{fH_\342LQ\352\267\347\304\246\325[.9Htb_s\234B8\2061\344\343\365C\234q\252\232\177\227\234s`\345\344{\037[\244\r \355\370A\257G5e\237\301 \007vR\231\304wg\221\025VWF:\023\317\364B\004\177\301\243\232\354\022V\027\002<>\026\002\355\207\356\241s2vM[x\033\206OM\252\252\327\242\237\263>\337=\273\030\027x\225\234?=0\240\377_\325=\270\354\330\326\214\300\335\231\003F\275\227\227QF!\243\361\261\253\253\323\303\232*\305\225\235K\244X]y\033c!m~=\"\231 \005\323((\215h\245\251#\236\342>\355\243\343\311\241\346\207\326y\213N\324\205\365\021z[\375\227\350\355\315\036uS9\220\267J\207\322\020C\371\211\023n~P\266\375\214;\207=2\017muu\323\357\222\265G\312V\220l\344\310\2750\266i$\237/\316\221\341\214\324e~\217\203\331\334\321\270L\275\303\032Id\277\302\031\231\271\231\216\350\302\3263\242\017Y<\003\255\357A\223\345\221\215i\371\270Q\242\2343\016LQcfJ<\251 \326\337DX3\234^\271f;W\344\t\344z0\267!E4/\250\326\022zV-\206\"h\n\325\205\215:\034\2316\276\313\250\327ZqL\212\177\352\352`N]g\270\3423\263S\243A\323\341\006C\274J\254\262FSn\303\003\221\324q\356M\327\266 \306#\3032f\016\350a\223\310\221*\034\222\024\030[\272\310P\227'\004e\231\307>>\216\274i\351Tb\036\221zYP\364\234B{\257L\177\002\254&\233\316N\030I\004q\326\017\013]sr\360u\026\274\341\377,\007\273\263\211\2314_\261\010K>\007#\322[m""\301\303\332\221Zp\372\223\037\037\325+b\316\010\233\327\367M\207\277\305q\236a\374\375s\214\237\202\326{k\037\2727s\247:ua\367\260\213"; - PyObject *data = __Pyx_DecompressString(cstring, 4914, 3); + 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<\200O[\035\275\034\252\302\245\032W}\254y\275\232?Z'\257\352\264~z\"\032\204\200\3740\016\260I\376\300\310;\210\356\217bd\322\035\202\010\224\240Mi(JF\300{A\355\206\310\\\245\002\345\265\317\304\027\205\341x^\030`\230`\340\237\353\377o\325\014\246\001\005Q,\226\002\301c(w\213\300\301\263R\366\347\302\tc\034qG\021\263a\305\014C\350M\002\014\221\222H\242,A\001\025$X@R)\026\n\240\300\002A\221!\026\004\221K\313\203\202\001A0\032\227\236\243\324\001\363\307\371\204<\340e\t$J}\247\3544\240\305+Do\260\377O\337\240\r \210\352\346!\335\0246\207:m\023\227 \336<\010\240\262\013\004V\021\210H\261BNr$AC\270d\nlC*\003T\014\372T\241\226\027\001q(\021_1\010,`2!\203\034\2043 B\"\022+\"D\203 \334b^\334\200Y\344Iu\223\025\351\020\3106\025\245v\315K\024\250\361\001A\312\365\341\021/\002l\"P\370\200\210 gv\031\340\215\310h&\243\004\314\033`\340=G\266\363\273G\235\310\315\324 \022\024(P\213\030\001B)Gn\203\242\032:m\277\007i\241\316H\210\0221\201$!\002jZ\355\031E\214tv\031n\r\327\036\343\232f\033\216sA\320L)3\363\216\t\201r7\006\364u\r\346\377u\306\365\300\310\035\232J\rB\224""\314sSUB\315\320\227a\022\025\307B\353\r\261nL\256\013\211\200\224\216\313\202\245\2132?\203\022\272\025\006\243\211\242h\211\302\332&D\350\304s\270\215h\022\316<4\346\303\0001\014\t\247E\037O\325K\241y\206\207h\212\t\343A;X \247\337\370\200N C\344\200\024\202\240|\224\242\010\236bZ\010\245\010\003\376\310\007\310|\337/\033}\312\353\364\220\013\320WT\266H:\230\0262\237\334\210\327\241!\210_u\211e\216J\"\002\004\325$\307+\357#Y\222\2073/ @s\305\211\331t\272z\362I\250\333\273a\310\207\336,&\307\251V\032\3546V\221\034\245\003\376\355\\\313\020e \2246\325\205\374%\233s\202\216\n\272\331\206uK\213\225y_\230\306|\264\310\234K@\014&%\006\260\206\303\230\245\371|\327\303J\030\355\241x\305\204v\014\255\227 \214!])r\257{\246\374p\362\235\204<\247\261\344\356\364\235\337\211\353{~w\330_`\265C]\211\356\036\341\355;,\006\352jHF\020\204,J1\035\007\220\316\356\332.6\032\3038T\263}\2153\205\017i\332 \036\300\235\204`\177\311\004\220X\377\270\201\320\002d\356\341\322\234\300j\331\034\313\336<\260\\\213\360\347\241\315\355\231\213\2743=\351\303k\236H\341\206\320\351=\340\314\307L>\310[\230t/vwtt\310#\020\351d\010\320H\205\022B\201k(\321l\220)\002\260X\210#\002\222\014\226,H1\214ke\n\024\201m%)\310\204\340s\204\373`\003\363\225h\0000X\252\372\234\036\002\333\363\370\201\320uo\r\372*\247\223\025T\221\024\362\003A\365\320\rJ\236\201V\r\344o\"\201P\002\007\022=\312\264\212\275[<\037Y\000\343\026\000\t\343\022E\222J2IC\314N\352\375\222\254\036\366\370fcs\t$\272QQ\025DE\232M\2143\003\312f+s\014(\312\240\304\025\213 \3011ib&5GHiS\0261E5\224|\243\277;'\217\342p:B\304\341^5\306\325\021\256b\326qJ)\214\nL\025\342\341\0254\312\220\203\250\004]\337\245\255\324\003D\347\001\323:\307G\010\027\\;\313\230F`t\013 '74\220\347\007\250T\010\200Tw\320\020\244[@D\234\035.\255\267@H\3004\230\314\203i&\263=\037\242\351n\023!\000D\210\243\024\002\245\333\325\036\332\234O\242\035S\327\035\236\264\000\364\354\021F\306BR\014\004\037?\243\227\271\333'k\334\262r\263\335\316\333Vw\ts\207\252.\247B\001\346\330m\363\330\363\n\201\270X*\007\001P5\341\263d\360\366}:S\327\303\236o\027\025*\201\300J\265\265\252\235\225\372(\342\252\246t\002\021/\020o\302\010\231w\304\230i \206\212rZZ\363\370\236\323,\366\374\007\261\266\336\032\373\377i\002\222\367\320BH\3738\324\253\0020\000\241\261Iu\2275\231\230\266Z\252\031nfb\344\265U'\004\261\377V\352\325U\265\337}\366\3336\314[-U\360\271\271@\345\203\304N?P\341\273k\3432L\200\310\311L\203\241\310\344\373y\274\216\243\2158O\216>;R\221\270\272\205\241%\323\274\241\316nC^7L\212e2\231\343\211\211A\336T7T\336o>\342:\347\256\241I\254\244\244\222\223\023c\260r\330i\367N`\375\300\354G \310\334\372\225\017\272\217HP\271\324\275\035G\034\357E\274/\331\3368\233\207x:\307`\354^\303\316\316}Z\315\215\251\244]\231\241\323\246.\314^\036\203\3303=\257\305\r,\211\2010%\231\224\346\236\31559\201\343\311\261h\026 \033\302\036\233\223\311\255[ZU\266\333m\266\333m\266\332\266\333m\266\367\306\3477ZC\242\3009\300\360\234\347\332km\016C\233bdD,\252\202SQ@\255\204\202\034\n\246v\227l\033-\214\rY9\033\316\277\314\352x\004\016H\001\314\3655\231\203\325\330\264\266\332[m\266\333mI$\222I$\222\262(E\r/\306U\0042\320&\366.\025G\341w(\033Y\317\215`9\216\230\r\243k}\260\336\305P\363IT\223\022L)\036%)\222bI\205b\225\264\226\270\000\3004w\t\264\346,>\307\021o\013\300\342q7\374\240b\027\237W\207hv\205\333>\361\266X-\216\247""\213\240|lA\200\374,a\000b\221$b*\010\243\0262A@R@\250\203\354d\223\243\243\207\206r\207\337\351\363u9\344\223\341\036\341\017\025\025UAO\207%>\n\3732\225)\002\342\236\3605\n{\302\001e^\177-U{\333z\336\001\327\017\345\352I'\202\236\261 x\323\025PUQ\025UW\267J*\252\252\347\177}y\t\357\366\337\310\333ShC\207\r\273\2348qr\325x\264\0255H\306*@\223\031=\317f\3404lW\001Y\204\254<\222-;\236\335g\275\231\302\265\327%\227v\256\354\247,\255\303\326\223\030\263s\211\225\240d!\364\223cMH\350\335t\210\026\336\302\322\302\320\"\312\023\276S\371w;3\026\347!\\\361\003\206\000\272f\376\367\337VD\010\021\020\341\312Q\021\337\372\234\364\342\250b\202\036\376!\300J\220\252\n\220\200\354\206\366a\236\243n\264gF\"\365\344>\024\00478\216\325\017\036\031X\247\032\r\266hd\036\026\340\361Wp\032\201E\212\014\024\200\004+\000\267\016V\201\315\342g~\006^.\330\233y\235\210D\016\014\334\314X\257\321\321>\301\016\314;\370\302\375\225\331\260\237\227\335\205\347\237\232\265>?\245\247\236\374\313^\351\3301V;H\024\205\nb\016e\t\013R4:\303\254|\227\336H\252\360:\001\344\200DB\001X\000J4\241i%s\273!\020\246{\036\210c\204\355\037N\352\334\374w\006\230\027\337\277\177\227e\316\030`\004\024\243\352\207\221\016\\\232>\200\354\254\014:\350\007\206\312\345\000LB\010\0200D\337w\\\270\306\373\341[\343\334\027aP/p\311\313;\256>z\034l*\354\032\304\227\344\374P\352F\342\355\324\317\013\361\274\024Ih\200j:@\017\245\206\231\265\257\231_\010\205\325\014\203\257\205.~'\036\315ME\350\350\013sB\266)\tv\341w\033`\224J@\003)k\267\352\035\010\226\305\277\035\360&\321\010\200R$\201!\272\352\327\026\373N\027o\336gKL\264W\373g}:\317)\311\374Q\321\023\266`!\273\023\214\031\341\302\r\t\346\250""\035\220\207\027;L\316\243\254\362:*q}E8\237OTuT\216\250\3455\"\001\022\201\t\264xl\024\3007)\353k\250\033G\177\214\3532\212\207\244\255\024=9\370\252m\016 \357\304W:\214\264\264\262e\226\204\3542\224\333)J\246\226Z\201\213U\027\304\371\216\252u\315\267\233x\010ui\264z3\024\330\271\260\202\230E\001)&\264\032\025\315\021\3727\227\206\005-zkv\202\226\360*\363k\323g\220\247\246\356\377\250;\223\250<\005\213zy\303q\304\"\001'\226xC4\341\331\347\000\357\210@\026xh6\034\014* -\323|\347*9i\241\365\006\"\351\037\007\314.\275\354n@\277\300\033w-\327\000\334\200N\366\330yz*\200`\204Q\002\010\222\372\t\225\007g\273\245\207\204\347\217\213\034T\325\361]jcT\306c\034e}\312\0358\224\321\314u4J(x\003\343\260\001\344\306\3741\264\240\372\376\000\317\244\310p1me[$`6\255\232\301,\257p\204W(o\215\256-\266\177\366\242\331\364\341Ps%\253J\322\203Y\215w\211\315\221R\365i\004( \332as\312\372\215\207\000\002\030J+$\030B\203\010\003\300\224\002\024V\001\202\025\2130\207\221\357\035\361+\317\315\001D\357PZ(\017{\020Z\347\327=\244\002\270/\022\240{\001}\263;\241\224S\332\200\005\340\227\305E\204D\221\022\001\346\332y\274\240\215\215\005Z:\331\346z]\210I\027wj\225\313\327\247\2443V\353\274&`\2703\\*\345-\261\222y\t\201\002\rl\032U^\247S\272\250\371\324/\233\264\013E\0209S\033V\265\251\276\341\242\3350![\356\305\227\317k\024\356C\212hh\021\344\003\244\257,$\322\003N\000T\234\211\324L\rjkF\006\240\\B\232\201\274f!v)\244R\226\222\220\313&\305\312\315<\274b22I\315\t\327\352\232\024P\212\000:\272\222\250\205\026\250\220\341\271\247\0076\301T\330l\221\200\252\354e\273\357\013\220\017\262\200A\021\202\201\021m\241\345\241\204\222D\215\261\245\302\254\265\036\\\267\361\344\237\201wEM\231'\0022\035p\323\307I\005\333j%.\362\225\361\252\360U\242\001za\204\272\226\274[\200\361\311\010\232\022S\227\263\014A\272\t\305\341\334Z\351\265:\351\277\310ho\030\330lXy\000\306:\354\325\305\000\367\025o\273\002\355\246\305\t$\206\326)\265-Z\365$\220\244$\265\327~g\233\231UMK\273\002\212s\355\362\337S~\355\231a\206""\026,[^\223\244z\372\323\254;\376\325\307\303\342\014\267\020\355\247z3r\207\301\003\252^.\326+\270oN\266\211a\242\220\315\241\000Q\214XH\035\220B\202$\024\031\270\2620\332\001\313\250\001\206\022*(\275+\300\220u\224(\265\331\003\023c\234\360i\263\255\270rfYS\240U\246t\200\005-Jt\326\271\240\227\210z\327k\3400!\004\306\212\264\250\327:\320\216; \0334\263\2678\200\r\360\255\031\031\224i\340\315\313\016\240\016\"u\001\324\247U\213\006\201\277\350Z\036%\016`*\304\017\025zOI\016X!\350\021 \234 _\272Jy\024\372\342j\257\007\2646\rM\250\007?\036\007i\325\315\230\207O4\231{\364wK\226_\356\325Bo\260\027x\320y\263\346\352\r\301o\013\263)ss\326o|\201p\001\352\000\035\365^\335h\372\025h\004P\224H,$$$\335\177&O?\257ku\236\315\334G\235w\033\224\357\330j=o\346\225\2748\206\036P\364\206\245\351y\350\370\212\201\234''\003\311\315\254Fr\225\204\364C\\\201\340\300\363BF\331\003\033\263\214q\205Td6\210*\252\272\334,'R\226\031=\363/XH\326^E\001BT\213<\362\244\241\350\007\244\343\030P-XD\307\2730$\300\261\222L\251\374\372k\214\375z\247\345,\322\204l\214\276\240\201\331\003Q\226\2330h\"\306\223\272ZL\314\177\034\340q\354\032\025\3338\276\321\007Q7% B\221\242\017\034\345Ux\003@\007cl\202\255]9\\\010;\251\267a\237\375\003\275d\314<,\305\330\361\370\210\204\244$%\224$R\227E\320\362\212av#8`m\261\323\231\245C\302T\033\272;[\237\230*\200R9_\270\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 (5074 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,\212\231\006\236\022b\340\272\001\177#\344g\310<\266\020\341T\002d\307\256\302#\241\310\270\303\215\014\222\033\\?\321 \264\024#\320\272\260`\025\013\177+\240\240e\005\225`uP\372\035n\372 \336\340\n\240\314\211\344\206\002\2514Yf\225\306d\031v\000\272\223p\207\026\227\216\200fq\tT\226j\321\241\332\342-\275<\033\001JY:\005K\201\221\300\002D\021\t1\032\t\375g\330\025\306\362\372S\316\214q\364g\020\033_]\244?\031+\253\375\244/\223\241\271\024\237Ig2i\200\000FFXh\266aB\245\215;\362\326\210\020\332\260\230\211\220\021c\224 U\021:\356[\3013\022\301\244X'\214cR\351O\014\207*Q\343\313xH\325y&\271\002\311y\234\007\345\301\177\344\242/\203V\234Y\241\201W\310\353$\243\227\254\005\016\344\202\022\252\322Z\373\324\340NpX_K\032\034/ \315\002\022\253\027e\320\250\252-\332\354\306YF\313\354#\200\3146\007\272\233!\312\024\001\337\000\330\013k\\z\335\"\036\273\026\301\241\372X\251\026}\002\320\004\272\216+t\343D4\025S\313\360\031\r\201\334Q5\365\225\021\263au\032f\347zBX\263v\360\237,nf\343\357DF;tN;7\227\367\226{\216m\005\267V\305\260\3263\246\215]\323\256=(\376T\244K\275\307\266f\267\276H7do\3115(\372\313\275#\342g\331+\317\312\331R\357i\311_\352=%y\313\275\256\255?\304Y1[r\235\330\022\304\240H\227\372\307\345GJV\355*\367\237\227\326eZ\316\226\001\320\034\000\037\236T\272J\256\363RN\016i\027o\250\244\177v\013V\016j\203\343\362\274\234\335\376\351P\337I\251[\272 \205\245U9,3JP\241\225u\225Vs\371\205\302\221B\270\324;$\206\305\270\344S\272\224AeA=\242\276\316\337\315G\013=\205\205bOqA{\366J{\365\272\004x\362\332\251i%Tm\341V\277\001\344\031\231WfT.\357&\024m\217\035\352\353\337\312\266O\365\250\324EP\260\243\332+\237VBJ\270\334\177J\232\220\335\262\267J\235xG\036\224C\373E\334I\311\rS\272\22512%\214\370\006\267h\355\304y\211\223\335\006\312\307\266\374%W\277x\024\020\354\277 \373\345\273r""\\\271\250|\316_\310?\317\363\005o\251\037f\225R\0045\010r\373Z\230/pEO\361\245\366\034\230\362\222\360\276T\341=AgP\274%\375!\377K\311\251\017\363\257\013\217\265gK\332\022JQ{\035\327\342\253\332\352\032\262\343\265\034\222\303%\317\250\324'\017\003\002\243\247\245kr\267|\tD\354-\235\031\223/\243V\225<#\242\000\230\217\236Gd\352\031\205\352\370\030\030E\010<\n3\372GDbL\203\3428\250\246\316?c\212G|$e\345.':Ol\345\304y\261^\016\003\0268\235 \207\303RP\242\245\257d\333q\225\311\007`\237\003\343>r#.\031\366\356\3408\242#\030\225\216\200\247\371\250\270\311\236e`\372\337\322\000\302\031\321\335VV7\324Y \211\220\207x\217z\345\021b\227\243\350\337\317Pr\2372\254dK\324\025eN]\312\377\004\316\350X\321\217\256\350\255\3666\242E\300\003\320%\352\202|K\271\253\320\245\361\313\312e5\244\206\313g&\344\277\301\342\321D\262\026 \372\274\025\365\256Z\235\213\033!\006g\300K\351\\\203\313\234\264$w\355\206\305;\343n\225{zG\233\234vb2\362wP\n\331\341]\352\325\335\\\357\361-\232\234\232\306\205\230\0229I\r\274\177\006\317~X\361+\217\200qD}\347%\342\034o\003-\310R\177\3313\001D\335\"\254\2636A\370D\212\332\351i\242\r\243W\024\177\211\210\334-]D\2070,2\222\037\274\227[?\261\002\332\320E\371\271\274\t^\177V\345""\264[\017\213\003\305\252j|\225\026\344^\245\007\016\230.T\222E\211\005K\313\252\307\362~\334dS>\212\206b\252\312\031\351\241\374\n\266;s^\022\344\0004\003\312r\276;\357-Q\227\344\277\324.\325m\025r\331j\234\026\352\262\007B\331cp\204\355Q\024\266\245\306\020\034J\227\323NN\301\261\375\020<\234'\377\\\373\375\337E^{\276Tv\031\272T\247\026\307\267\342bE\001\372\305\256\222\325\201\023\317xR:\r\n\367\016\335j\271\277\252\"H!Q\320k\322ORL\366\200J> \006ENP\242\270\202\024\220\336\000\007\364S\265Bt\217\274\000.\355\022\236\362p0\270\207\332 \375\023\352\273\203\020M<\256\203\316/ (c\377\353\340cf%co\033W\3316\341\020\030\035\034\341K\020\250\3563\341\206#p\213\0361l8\002\302\004\342\010ve\376\306\351\320\332\232,'\003\203\214\031\020/\212Yt\\z\254\313in\257<`\370_D\035\003\332U'\037\\K\302~\270\261]Zx\266s\334\325~S\260w\267T\257\177\333>#\323\271\240]\270\256\322\333\307\017\365\375\262\365\024\205\347\322\\g\360\324\322\007\320\036k\272\307\265\361\033\332\215Em\221\321\230\225\355K\207\372\\$\350\373\214iL\311\2058b\310\357\032\022_C\254\037F\341\367\221@\315\260H\277\364\010$~\n%a\244E\270h]\212\312?\3114\036\237]\322IyB\031P\256\253\356\272\315P\257\256\300\341\272\002\361\366f\376\227B\030\003\332_4\027\301\022p3]\3079L\247`g\255\177B^\207\224*k\037r~%\362\353\207\\\363\":\266\262g\0103U\222\226\r\351iF\305\025i'\220\345G\224\027\232\177\276\020,@\000\341@\341u\022P\231\224\r\235\206\2604\n\036gQ\211\201@*\375\007G\227\021\376\357\033]\017H\234\327.]\230\317\"\354\027\240 \340\353\017\213~\214\320\314\304yT\372E~\241M\375\226\017\347\023\205/\332\322\013tL\023`1^=u\305\000\014\222j\267<.G\025\227\272@l\024\220\203d[\033\231\2209\260\010\017\252\022-e\333\341p-/\354\251\036\224\356Jqy\022R\353P\333T\226\253\241\251]\350iI\212\037J\257d\342\221>A\336\375\0316A'uT\315\346{\362!\314\210WI\032]\215B\315\245g\301\027\367\310!K\243M`\255\306[K\020h\323N]Qf\265_\357\026\274\205k\305\303\020\376\207\314p\026\231\331-]\306\322\215r\224x\334@~\271\330S\\\324^\031\031\226""\266\306k\274\320\376Lb\013[\213\"Kf\036\303\214\322\024\325Y\351\0039S\376.x\n\215\217u\352{\033\224\346\004)\364\230j\3548\242o\332\210\340\207b\260H\027\327I\306\030\325\242\200\350G\355cJKe\265\354\347\355C\207\276t-v\303m\261\373\t\336\236t?\305\333\323\356\267x{\333\375\256\333\236\352\275\003\325\\\024d\250\227\341\260\350\313\273\363\227\013w\013Q\340\344c\355\315\333]\313s?\304sR:G\372\346\362/\nn[y\034#E\240o\316\367]s\301\010l\276\201\256\266T\316o\247\202\273\327\226\2625\351\316\226\2329\2466\375Q\353\035G\261|E`\302\341\261\004\321\201\333\3220\217\216\021\361\213<\253M\334\316\373\363\017\013\177j\341\347v\016\375,\201|W\376\250\016\023V\367c\211\007\263\370\367\352\0055\254\227\005nHc\020\240\360\312\004\006\245\316.\337HZ\232\236\035#\030\263\2311NM`\203\376\022w\272\277K\320\203R\250-\3207\265\233o@\256\000T;\356\325\t\271\231\357*\303\036I\311+\371\265\236K\332\245[\332\255\307\332\343\017\332\207\310\366\370\241\276sR\270\324P;\204H\202\204\030%\317\224\342\206p\242\214\221\303\030\354\350\306\004\352TE\370\244Zg\226\315 \352\324\306\347\340\204&a\250 \373\211L\273,%4\243\326g-\371\2228U\016)\241\177B\345AO\311=P\032\032.\365\366\225\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 (25210 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_boundsappendassigned_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__throw_unassign""edunassignedunassigned_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!"; + #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 < 292; i++) { + 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); @@ -48322,7 +48334,7 @@ const char* const bytes = ".Abstract base class for constraints.Can't happenComp stringtab[i] = string; pos += bytes_length; } - for (int i = 292; i < 348; i++) { + 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; @@ -48333,14 +48345,14 @@ const char* const bytes = ".Abstract base class for constraints.Can't happenComp } } Py_XDECREF(data); - for (Py_ssize_t i = 0; i < 348; i++) { + 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 + 292; + PyObject **table = stringtab + 293; for (Py_ssize_t i=0; i<56; ++i) { #if PY_VERSION_HEX >= 0x030F0000 PyUnstable_SetImmortal(table[i]); @@ -49349,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); } @@ -50131,21 +50143,33 @@ 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, int wraparound, int boundscheck, int unsafe_shared) { CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); -#if CYTHON_ASSUME_SAFE_SIZE +#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 ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS)) { - return __Pyx_PyList_GetItemRefFast(o, wrapped_i, unsafe_shared); - } else - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { - return __Pyx_NewRef(PyList_GET_ITEM(o, wrapped_i)); + 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; @@ -50155,15 +50179,35 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck, int unsafe_shared) { CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); -#if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS +#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 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; } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { - return __Pyx_NewRef(PyTuple_GET_ITEM(o, wrapped_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; } - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); + 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; @@ -50176,11 +50220,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, #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 ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)) { - return __Pyx_PyList_GetItemRefFast(o, n, unsafe_shared); - } else if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { - return __Pyx_NewRef(PyList_GET_ITEM(o, n)); - } + 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)) { @@ -50190,6 +50230,10 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, } } 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 { @@ -50223,7 +50267,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, #endif (void)wraparound; (void)boundscheck; - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic_size(o, i); } /* DictGetItem */ @@ -51072,7 +51116,7 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( #endif if (unlikely(pos >= list_size)) return 0; *ppos = pos + 1; - next_item = __Pyx_PyList_GetItemRef(iter_obj, pos); + next_item = __Pyx_PyList_GET_ITEM_REF(iter_obj, pos, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!next_item)) return -1; } else #endif @@ -51178,6 +51222,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(); @@ -51233,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); @@ -51256,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); @@ -51303,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; @@ -52737,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); @@ -52751,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; @@ -52765,11 +52861,37 @@ __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; } @@ -52790,8 +52912,11 @@ static PyMethodDef __Pyx_CyFunction_annotate_method = { }; static PyObject * __Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) { + PyObject *annotate = NULL; CYTHON_UNUSED_VAR(context); - PyObject *annotations = __Pyx_CyFunction_get_annotations((__pyx_CyFunctionObject *) op_in, NULL); + 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, @@ -52806,14 +52931,17 @@ __Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) { PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted"); return -1; } - if (value == Py_None) { - return 0; + if (unlikely(value != Py_None && !PyCallable_Check(value))) { + PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None"); + return -1; } - PyObject *annotations = PyObject_CallObject(value, NULL); - if (!annotations) return -1; - int result = __Pyx_CyFunction_set_annotations((__pyx_CyFunctionObject *) op_in, annotations, NULL); - Py_DECREF(annotations); - return result; + 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) { @@ -55886,6 +56014,10 @@ 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; } diff --git a/constraint/domain.c b/constraint/domain.c index e0c4feb..5b14059 100644 --- a/constraint/domain.c +++ b/constraint/domain.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.2.6 */ +/* Generated by Cython 3.2.9 */ /* BEGIN: Cython Metadata { @@ -37,8 +37,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x03080000 #error Cython requires Python 3.8+. #else -#define __PYX_ABI_VERSION "3_2_6" -#define CYTHON_HEX_VERSION 0x030206F0 +#define __PYX_ABI_VERSION "3_2_9" +#define CYTHON_HEX_VERSION 0x030209F0 #define CYTHON_FUTURE_DIVISION 1 /* CModulePreamble */ #include @@ -904,28 +904,39 @@ enum __Pyx_ReferenceSharing { #else #define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0) #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 +#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)) -#endif -#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_PyList_GetItemRefFast(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_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(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) @@ -1648,10 +1659,10 @@ 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 /* py_dict_items.proto (used by OwnedDictNext) */ @@ -2387,7 +2398,7 @@ typedef struct { __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop; PyObject *__pyx_slice[1]; PyObject *__pyx_codeobj_tab[8]; - PyObject *__pyx_string_tab[61]; + PyObject *__pyx_string_tab[62]; /* #### Code section: module_state_contents ### */ /* CommonTypesMetaclass.module_state_decls */ PyTypeObject *__pyx_CommonTypesMetaclassType; @@ -2443,52 +2454,53 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_n_u_diff __pyx_string_tab[21] -#define __pyx_n_u_doc __pyx_string_tab[22] -#define __pyx_n_u_extend __pyx_string_tab[23] -#define __pyx_n_u_func __pyx_string_tab[24] -#define __pyx_n_u_hidden __pyx_string_tab[25] -#define __pyx_n_u_hideValue __pyx_string_tab[26] -#define __pyx_n_u_init __pyx_string_tab[27] -#define __pyx_n_u_is_coroutine __pyx_string_tab[28] -#define __pyx_n_u_items __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_setdefault __pyx_string_tab[48] -#define __pyx_n_u_states __pyx_string_tab[49] -#define __pyx_n_u_test __pyx_string_tab[50] -#define __pyx_n_u_value __pyx_string_tab[51] -#define __pyx_n_u_values __pyx_string_tab[52] -#define __pyx_kp_b_iso88591_1_q_s_q __pyx_string_tab[53] -#define __pyx_kp_b_iso88591_A_G1D_D_D __pyx_string_tab[54] -#define __pyx_kp_b_iso88591_A_G1F_HG1A __pyx_string_tab[55] -#define __pyx_kp_b_iso88591_A_HA __pyx_string_tab[56] -#define __pyx_kp_b_iso88591_A_HG1Cq __pyx_string_tab[57] -#define __pyx_kp_b_iso88591_A_IQfA_Kq_Kq __pyx_string_tab[58] -#define __pyx_kp_b_iso88591_A_t1 __pyx_string_tab[59] -#define __pyx_kp_b_iso88591_A_t84s_Cq_1_q_HAQa_HAQa __pyx_string_tab[60] +#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] +#define __pyx_n_u_func __pyx_string_tab[25] +#define __pyx_n_u_hidden __pyx_string_tab[26] +#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_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) { @@ -2505,7 +2517,7 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { #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<61; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + 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); @@ -2530,7 +2542,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode); 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<61; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + 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); @@ -4459,39 +4471,39 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); { - const struct { const unsigned int length: 8; } index[] = {{1},{170},{172},{20},{6},{15},{16},{15},{16},{17},{20},{10},{8},{17},{17},{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 (644 bytes) */ -const char* const cstring = "(\265/\375`)\003\325\023\000Fbk2`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\013T\000Y\000T\000\357_|Q;\235=\301\366h\232>K\257\221\324n\221\337\343\323\310?\333\304\202\220\333\373\257\330j\3515\343\3611H:u\356\311:U\257S\352\373\203\032[\022\321\203\003\215\363\233SF\352]A6\321\206\237\347.'\205r~\224M\345\253k\257\324\235\241EE\274;\247\236!\256\343\310s\347\010\022\265\307\237\364\306~{\235\023\213c\367\333{J^=\377\307$\247\220vO\332\335\325t\254I#\361\361\361|\377\250\305 \315\370\354\221~\027Y}\276k|\014'W\301\314\267&\371H\311YR+\362s\315@\236\244?\351u$>\007\2112\355v#\330\036g\365=\333D\202zB\256\250\335\311\r\342\330o~\354\225\263a\345$\177\357\356:\250\377\255\307v\033\253hw\267I\267\033E\317iJ\032\177\272\361\374\205\3155|\023H\266\215\336\226\264\226\032\224\362\343\035\337Wr\312\246\221\257E\313\331\305\236\246\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.*\276\373\317\357\373\260\342(d\250Q\231\202\210!\023MRR\310t0\206(\207\314<\260\352\2064i\014HT\300\214\347\317\337\367\337\2255\202k\\o_U\023\315Q\326\005z\037\323\002N~\314\\\323\241\300n\231!\276\376z\333\247\026\320\227\201[B \201O\034p$\026,d\017\020!\022\016\"\260\264\310\373\252\001\035\313L\227\302hWoh\241\322\020\035\316\215\022\264\307\t\014\0262\320\334l\000(\257\213\334\272\355\303\0133\221\237\014\031\264\222\2371\007\3346\024E\265\267\200GtF\001\262}-\010\"\300\257\277\216p\234\230\002\210\000\207\212\313K\345\223\223\221\223\320\336S\004\205\254(\324G\212`\004\300\347\217\207\340\354 Iz\234\321vN\337}\362Tj"; - PyObject *data = __Pyx_DecompressString(cstring, 644, 3); + 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 (706 bytes) */ -const char* const cstring = "BZh91AY&SY\367R\033\343\000\000Z\177\363\347\377\320\210p\005\244@\255\351{\200\277\377\377`@@@@@@@@@\000@\000@\002|\001\240Z\032\247\252\031\006LC@\031\000\r\006F\232\000\320h\000\375P\204\320i\023\310\210z\237\2526\223L\203\023#!\201\001\210\310hy\016\032i\221\210\302i\200\206\0014\3020LL\206\231\032\032\001\246\211\240M%?FM\t=#P\311\352h\300##\010z\0034\236R\275\313\356i\257n!<\211\303\207i\035\246\334\260\207\024\344@*\034#\216\372^\017\337\242{\"\024(M\2402\205\030\206\335]A\000\270'\317\257\337z\373\3037\\;\"\354\217\366\223.\227\r.\257\253\307\342\260\230\272\202\205B\356\035\333\232\343qC!{\262\003\265&9\020\275EEO$OJ\266\252tY\032\242\200\2023TY\252E\031\247n\037UU\\\351rS&P\037\222\240W*\2321\207\331\363\253V\177\220\222\314(F2\232\301^l\271\224\341\025D\211\010\t\270\351\354\300\240\273\262\\\335\241\004\0054\361\3409$\000\374\350F\2026\274P\206\032,\202y\265\021/\327%\335\213k\357\214\212\r\226\204\024B\365\223I\r\360\323\263\232%\267N\244H\241\005S\tQ\365\317\333H\350\331\267\000\253\271\222\226\026\014\245\262\r\022\273\016\212l\343\230\221z\360\260x?\322\320\241\337,\235\032\036\016\345\260#7\276a^\3604\2307]\264e\267\236\312Q\000\220\355\312\013a\"\017~{\325\245\264\007 \211i\230 j\305(6\010\006\250\272\341|1\204\364\356|\241\246\224\020X\251=;\307\353\341V\224\222\243\024\252Q\210\251\214\0028\265\3530\3433\224\271\330\261m[\336\004\321DMQ\324k\260\200\244\306<\314\202\363ZV\204I\365e\026\256r\035.\032\250\256v\025\342\020\254\320j\244\251\001}\350\270\007\316\001\236\241\250B\243\200S \014\356\233\220\032/\t\201i\215\344*w2\302\242\rTE)H\033\276\375\311\0369\020\346\010\201\016\220\221!xO\370\013*`\204?L\374\027\236A9\307AQ\354\326Z\324E\351/\240\336\350\251362q\245,\"\264\345\007\372\000\220;\305\334\221N\024$=\324\206\370""\300"; - PyObject *data = __Pyx_DecompressString(cstring, 706, 2); + #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\2027\227M\032&1\357KS\256\037\261\347\311\3227\343>\361\224\340\207\360>\270\366m{\336\226\277\251\373\361r\274\032\2366\317\2322\354\205Y;i/[\036\035{\315,L\302e\340\377\000&L\2174"; - PyObject *data = __Pyx_DecompressString(cstring, 632, 1); + #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (637 bytes) */ +const char* const cstring = "x\332US=o\3330\020u\2014\315\207\333\004]:ta;\007.\014t\350V\0301\032\027\005\212\246E\322\361@S\247\210\rEJ$eD[F\217\0329j\354\317\351\350\261?!?\241G\311v\\\001\246\336\335\273\257w\246>\236+\356\034\253\034&\314\033&\214\366\326(V\030\347\344\\![pU\241c\251\261\004\255\344\344s\243\243#F\317\317\0145S\322yF\244\257\nb\030\267\330\327\342\216%&\347R\2733\3463\254;\206W\236|^\n\256T\335\325\240~\013\264\276o\3165\243x\317\265@fRJ\343\236\2118\336\250\213\235\241*\320\366\236\377\006b\t\246RK/\215^\217v\345\244\276\241\002\322\255\303\t\230\"\006pu\306\210\244\016\\\327,\343.\353*\230\371/\024\376\254K&VUI,P(\022\300\234\267d\2206\235\020\347\361\006-\211\312y\315\346\217bw\226\263\326Ei\224\355\337\365k\030\025\365\264\003\3759\002\210\023\003\254\315L&x\035W\275\266\013S\374\360\334o\315\312e\273\266E\207\276s\000|\253\357\3507\225\302\303W\274\363\3371\275\322$Y\336hL\256\327Sm\336\333\266;\016\213\205\005z\270\326\246\257\310\213\002u\302]\255\2054#a\254\251\274\324\350\346\306(\221\241\270\005\231\2020y!\025&B\021EU\201\344\n\234sq\373\250}\324kOd\232\002$F\000\320\200T\032 \2554Y@\262\023\324[\361\233\351@:\330\266\225\036s\007\020\013\3051s\364\274\373O;\303$\225\302\016Y\003HwW\"\021\232\347\2709i\223\233e\222Ab\351\"\022\330,\024\240\254\270\352C-\346f\201\233\215<\356\330\242\257\254v\250R\362\000\304\243O DW\217W\312\203\213\201\324\232\016\n\351\276\232\376\323\3713x\035\306\017\303\301\323\375\207\375\301\341\351\262\\\035\277j\\x\263:8Y\226\367\223\277\007\303\345E3n\246\341\311\212\340\2649\330\001\367\223\207\227\203\303\347]\300\247\2302\\\316\232\2130\016\023b^Df\326Dx\324\303\310\234\207\262\215y\303\350\372\334\\6i\230\304\274/M\271~\305\236'K\337\214\373\304S\202\037\302\373\340\332\267\355y[\376\246\356\307\313\361jx\332__pyx_string_tab; Py_ssize_t pos = 0; - for (int i = 0; i < 53; i++) { + 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); @@ -4502,7 +4514,7 @@ const char* const bytes = "?Class used to control possible values for variables. stringtab[i] = string; pos += bytes_length; } - for (int i = 53; i < 61; i++) { + 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; @@ -4513,14 +4525,14 @@ const char* const bytes = "?Class used to control possible values for variables. } } Py_XDECREF(data); - for (Py_ssize_t i = 0; i < 61; i++) { + 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 + 53; + PyObject **table = stringtab + 54; for (Py_ssize_t i=0; i<8; ++i) { #if PY_VERSION_HEX >= 0x030F0000 PyUnstable_SetImmortal(table[i]); @@ -4989,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); } @@ -6867,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); @@ -6881,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; @@ -6895,11 +6954,37 @@ __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; } @@ -6920,8 +7005,11 @@ static PyMethodDef __Pyx_CyFunction_annotate_method = { }; static PyObject * __Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) { + PyObject *annotate = NULL; CYTHON_UNUSED_VAR(context); - PyObject *annotations = __Pyx_CyFunction_get_annotations((__pyx_CyFunctionObject *) op_in, NULL); + 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, @@ -6936,14 +7024,17 @@ __Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) { PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted"); return -1; } - if (value == Py_None) { - return 0; + if (unlikely(value != Py_None && !PyCallable_Check(value))) { + PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None"); + return -1; } - PyObject *annotations = PyObject_CallObject(value, NULL); - if (!annotations) return -1; - int result = __Pyx_CyFunction_set_annotations((__pyx_CyFunctionObject *) op_in, annotations, NULL); - Py_DECREF(annotations); - return result; + 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) { diff --git a/constraint/parser.c b/constraint/parser.c index 1d2075d..6f2d79c 100644 --- a/constraint/parser.c +++ b/constraint/parser.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.2.6 */ +/* Generated by Cython 3.2.9 */ /* BEGIN: Cython Metadata { @@ -37,8 +37,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x03080000 #error Cython requires Python 3.8+. #else -#define __PYX_ABI_VERSION "3_2_6" -#define CYTHON_HEX_VERSION 0x030206F0 +#define __PYX_ABI_VERSION "3_2_9" +#define CYTHON_HEX_VERSION 0x030209F0 #define CYTHON_FUTURE_DIVISION 1 /* CModulePreamble */ #include @@ -904,28 +904,39 @@ enum __Pyx_ReferenceSharing { #else #define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0) #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 +#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) - #else - #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) - #endif +#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) __Pyx_NewRef(PyList_GET_ITEM(o, i)) + #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_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) (__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\ - __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i)) +#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_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_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(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) @@ -1948,10 +1959,10 @@ 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 /* py_dict_items.proto (used by OwnedDictNext) */ @@ -2131,7 +2142,7 @@ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, #endif #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_DefinitelyUnique) + #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 @@ -3038,7 +3049,7 @@ typedef struct { PyObject *__pyx_slice[4]; PyObject *__pyx_tuple[4]; PyObject *__pyx_codeobj_tab[21]; - PyObject *__pyx_string_tab[229]; + PyObject *__pyx_string_tab[230]; PyObject *__pyx_number_tab[3]; /* #### Code section: module_state_contents ### */ /* CommonTypesMetaclass.module_state_decls */ @@ -3237,161 +3248,162 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_asyncio_coroutines __pyx_string_tab[74] -#define __pyx_n_u_class_getitem __pyx_string_tab[75] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[76] -#define __pyx_n_u_close __pyx_string_tab[77] -#define __pyx_n_u_co_consts __pyx_string_tab[78] -#define __pyx_n_u_code_object __pyx_string_tab[79] -#define __pyx_n_u_comparator __pyx_string_tab[80] -#define __pyx_n_u_comparators __pyx_string_tab[81] -#define __pyx_n_u_comparators_found __pyx_string_tab[82] -#define __pyx_n_u_comparators_indices __pyx_string_tab[83] -#define __pyx_n_u_compile __pyx_string_tab[84] -#define __pyx_n_u_compile_to_constraints __pyx_string_tab[85] -#define __pyx_n_u_compiled_constraints __pyx_string_tab[86] -#define __pyx_n_u_constraint __pyx_string_tab[87] -#define __pyx_n_u_constraint_constraints __pyx_string_tab[88] -#define __pyx_n_u_constraint_parser __pyx_string_tab[89] -#define __pyx_n_u_constraints __pyx_string_tab[90] -#define __pyx_n_u_dict __pyx_string_tab[91] -#define __pyx_n_u_domains __pyx_string_tab[92] -#define __pyx_n_u_end __pyx_string_tab[93] -#define __pyx_n_u_equalities_found __pyx_string_tab[94] -#define __pyx_n_u_eval __pyx_string_tab[95] -#define __pyx_n_u_exec __pyx_string_tab[96] -#define __pyx_n_u_expr __pyx_string_tab[97] -#define __pyx_n_u_extract_operators __pyx_string_tab[98] -#define __pyx_n_u_finalized_constraint __pyx_string_tab[99] -#define __pyx_n_u_findall __pyx_string_tab[100] -#define __pyx_n_u_finditer __pyx_string_tab[101] -#define __pyx_n_u_fromkeys __pyx_string_tab[102] -#define __pyx_n_u_func __pyx_string_tab[103] -#define __pyx_n_u_func_2 __pyx_string_tab[104] -#define __pyx_n_u_genexpr __pyx_string_tab[105] -#define __pyx_n_u_group __pyx_string_tab[106] -#define __pyx_n_u_i __pyx_string_tab[107] -#define __pyx_n_u_index __pyx_string_tab[108] -#define __pyx_n_u_inequalities_found __pyx_string_tab[109] -#define __pyx_n_u_is_coroutine __pyx_string_tab[110] -#define __pyx_n_u_is_or_evals_to_number __pyx_string_tab[111] -#define __pyx_n_u_items __pyx_string_tab[112] -#define __pyx_n_u_key __pyx_string_tab[113] -#define __pyx_n_u_keys __pyx_string_tab[114] -#define __pyx_n_u_left __pyx_string_tab[115] -#define __pyx_n_u_left_num __pyx_string_tab[116] -#define __pyx_n_u_left_remainder __pyx_string_tab[117] -#define __pyx_n_u_left_swap __pyx_string_tab[118] -#define __pyx_n_u_m __pyx_string_tab[119] -#define __pyx_n_u_main __pyx_string_tab[120] -#define __pyx_n_u_match_object __pyx_string_tab[121] -#define __pyx_n_u_matches __pyx_string_tab[122] -#define __pyx_n_u_module __pyx_string_tab[123] -#define __pyx_n_u_name __pyx_string_tab[124] -#define __pyx_n_u_next __pyx_string_tab[125] -#define __pyx_n_u_next_stop __pyx_string_tab[126] -#define __pyx_n_u_number __pyx_string_tab[127] -#define __pyx_n_u_o __pyx_string_tab[128] -#define __pyx_n_u_offset __pyx_string_tab[129] -#define __pyx_n_u_operator __pyx_string_tab[130] -#define __pyx_n_u_operators __pyx_string_tab[131] -#define __pyx_n_u_operators_found __pyx_string_tab[132] -#define __pyx_n_u_operators_left __pyx_string_tab[133] -#define __pyx_n_u_operators_right __pyx_string_tab[134] -#define __pyx_n_u_p __pyx_string_tab[135] -#define __pyx_n_u_param __pyx_string_tab[136] -#define __pyx_n_u_params __pyx_string_tab[137] -#define __pyx_n_u_params_used __pyx_string_tab[138] -#define __pyx_n_u_params_used_list __pyx_string_tab[139] -#define __pyx_n_u_parse_restrictions __pyx_string_tab[140] -#define __pyx_n_u_parse_restrictions_locals_genexp __pyx_string_tab[141] -#define __pyx_n_u_parse_restrictions_locals_replac __pyx_string_tab[142] -#define __pyx_n_u_parse_restrictions_locals_replac_2 __pyx_string_tab[143] -#define __pyx_n_u_parse_restrictions_locals_to_equ __pyx_string_tab[144] -#define __pyx_n_u_parse_restrictions_locals_to_equ_2 __pyx_string_tab[145] -#define __pyx_n_u_parse_restrictions_locals_to_mul __pyx_string_tab[146] -#define __pyx_n_u_parse_restrictions_locals_to_num __pyx_string_tab[147] -#define __pyx_n_u_parse_restrictions_locals_to_num_2 __pyx_string_tab[148] -#define __pyx_n_u_parse_restrictions_locals_to_num_3 __pyx_string_tab[149] -#define __pyx_n_u_parsed_restriction __pyx_string_tab[150] -#define __pyx_n_u_parsed_restrictions __pyx_string_tab[151] -#define __pyx_n_u_pattern __pyx_string_tab[152] -#define __pyx_n_u_picklable __pyx_string_tab[153] -#define __pyx_n_u_pop __pyx_string_tab[154] -#define __pyx_n_u_prev_stop __pyx_string_tab[155] -#define __pyx_n_u_qualname __pyx_string_tab[156] -#define __pyx_n_u_r __pyx_string_tab[157] -#define __pyx_n_u_re __pyx_string_tab[158] -#define __pyx_n_u_regex_match_variable __pyx_string_tab[159] -#define __pyx_n_u_regex_match_variable_or_constant __pyx_string_tab[160] -#define __pyx_n_u_replace __pyx_string_tab[161] -#define __pyx_n_u_replace_params __pyx_string_tab[162] -#define __pyx_n_u_replace_params_split __pyx_string_tab[163] -#define __pyx_n_u_res __pyx_string_tab[164] -#define __pyx_n_u_restriction __pyx_string_tab[165] -#define __pyx_n_u_restrictions __pyx_string_tab[166] -#define __pyx_n_u_restrictions_cleaned __pyx_string_tab[167] -#define __pyx_n_u_restrictions_cleaned_unique __pyx_string_tab[168] -#define __pyx_n_u_restrictions_unique_indices __pyx_string_tab[169] -#define __pyx_n_u_return __pyx_string_tab[170] -#define __pyx_n_u_right __pyx_string_tab[171] -#define __pyx_n_u_right_num __pyx_string_tab[172] -#define __pyx_n_u_right_remainder __pyx_string_tab[173] -#define __pyx_n_u_right_swap __pyx_string_tab[174] -#define __pyx_n_u_s __pyx_string_tab[175] -#define __pyx_n_u_search __pyx_string_tab[176] -#define __pyx_n_u_send __pyx_string_tab[177] -#define __pyx_n_u_set_name __pyx_string_tab[178] -#define __pyx_n_u_setdefault __pyx_string_tab[179] -#define __pyx_n_u_split __pyx_string_tab[180] -#define __pyx_n_u_split_restrictions __pyx_string_tab[181] -#define __pyx_n_u_splitted __pyx_string_tab[182] -#define __pyx_n_u_start __pyx_string_tab[183] -#define __pyx_n_u_str __pyx_string_tab[184] -#define __pyx_n_u_strip __pyx_string_tab[185] -#define __pyx_n_u_sub __pyx_string_tab[186] -#define __pyx_n_u_swapped_side_first_component __pyx_string_tab[187] -#define __pyx_n_u_temp_copy __pyx_string_tab[188] -#define __pyx_n_u_test __pyx_string_tab[189] -#define __pyx_n_u_throw __pyx_string_tab[190] -#define __pyx_n_u_to_equality_constraint __pyx_string_tab[191] -#define __pyx_n_u_to_multiple_restrictions __pyx_string_tab[192] -#define __pyx_n_u_to_numeric_constraint __pyx_string_tab[193] -#define __pyx_n_u_tune_params __pyx_string_tab[194] -#define __pyx_n_u_types __pyx_string_tab[195] -#define __pyx_n_u_union __pyx_string_tab[196] -#define __pyx_n_u_unique_operators __pyx_string_tab[197] -#define __pyx_n_u_unique_operators_left __pyx_string_tab[198] -#define __pyx_n_u_unique_operators_right __pyx_string_tab[199] -#define __pyx_n_u_v __pyx_string_tab[200] -#define __pyx_n_u_value __pyx_string_tab[201] -#define __pyx_n_u_values __pyx_string_tab[202] -#define __pyx_n_u_var __pyx_string_tab[203] -#define __pyx_n_u_variable_operators_left __pyx_string_tab[204] -#define __pyx_n_u_variable_operators_right __pyx_string_tab[205] -#define __pyx_n_u_variable_supported_operators __pyx_string_tab[206] -#define __pyx_n_u_variable_unique_operators __pyx_string_tab[207] -#define __pyx_n_u_variables __pyx_string_tab[208] -#define __pyx_n_u_variables_on_left __pyx_string_tab[209] -#define __pyx_kp_b_iso88591_1 __pyx_string_tab[210] -#define __pyx_kp_b_iso88591_1_2 __pyx_string_tab[211] -#define __pyx_kp_b_iso88591_A_3axs_Qa_1_2XQfA_Rxq_a_5_AS_2S __pyx_string_tab[212] -#define __pyx_kp_b_iso88591_A_l_4s_Cq_2V2Q_1 __pyx_string_tab[213] -#define __pyx_kp_b_iso88591_A_l_4s_Cq_t1A_1_1 __pyx_string_tab[214] -#define __pyx_kp_b_iso88591_HA_4vRxq_Q_a_b_1AV3d_q __pyx_string_tab[215] -#define __pyx_kp_b_iso88591_Q __pyx_string_tab[216] -#define __pyx_kp_b_iso88591_Q_2 __pyx_string_tab[217] -#define __pyx_kp_b_iso88591_Q_G1_xs_c_1_6_uA_AV1D_Qd_e2YasR __pyx_string_tab[218] -#define __pyx_kp_b_iso88591_V1_A_Oq__A_Qm1_q_9_gQm_q_1Kz_gQ __pyx_string_tab[219] -#define __pyx_kp_b_iso88591_XQ_Qa_z_5_q_q __pyx_string_tab[220] -#define __pyx_kp_b_iso88591_Ya_1_q_Q2_m5_ar_U_6_Q_q_t4uA_d __pyx_string_tab[221] -#define __pyx_kp_b_iso88591__25 __pyx_string_tab[222] -#define __pyx_kp_b_iso88591__26 __pyx_string_tab[223] -#define __pyx_kp_b_iso88591__27 __pyx_string_tab[224] -#define __pyx_kp_b_iso88591__28 __pyx_string_tab[225] -#define __pyx_kp_b_iso88591_a_3axs_C_1_avV6_a_Bhas_q_a_3a_Q __pyx_string_tab[226] -#define __pyx_kp_b_iso88591_q __pyx_string_tab[227] -#define __pyx_kp_b_iso88591_q_2 __pyx_string_tab[228] +#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] @@ -3442,7 +3454,7 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { 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<21; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<229; ++i) { Py_CLEAR(clear_module_state->__pyx_string_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 */ @@ -3502,7 +3514,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void 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<21; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<229; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_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 */ @@ -4246,7 +4258,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -4381,7 +4393,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple #endif if (__pyx_t_12 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_10, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_12; } else { { @@ -4900,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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -5056,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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __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); @@ -5207,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_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __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); @@ -5357,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_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __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); @@ -5510,7 +5522,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -5686,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_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __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); @@ -5823,7 +5835,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __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); @@ -5966,7 +5978,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -6143,7 +6155,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -6312,7 +6324,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -10268,7 +10280,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -10857,7 +10869,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator1 #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -11101,7 +11113,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 329, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); @@ -11169,7 +11181,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 332, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); @@ -11211,7 +11223,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 333, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_6); @@ -11288,7 +11300,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -11914,7 +11926,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -11959,10 +11971,10 @@ 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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -12840,7 +12852,7 @@ static PyObject *__pyx_pf_10constraint_6parser_6extract_operators(CYTHON_UNUSED #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_5 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { @@ -16479,39 +16491,39 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); { - 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},{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 (3170 bytes) */ -const char* const cstring = "(\265/\375`U\030\305b\000\372\200\304\033:\340\032=0\314\363D\204\201k1\236\347y\236\347y>\256\205k1\233'\\\311+\270\302\312\262\032\341\207\333\\\365J\364\013\364Bv\201\276\205\332G\321\024\252\225\036\252\207\333\021\001\250\001\235\001\264\001QeY\266\374UY\325,QQ3\005\266;\307h\310\246('i\307\213\334\037\027*q~@\242\262\\\201G\351\253\303Cohd\304\224}]\316\21205\032\356\307\317\024-qb\333+y\372\232\210#!\342\210\210\2303\tq\022\301\325Z\225g\232\364\336\324\204\335U\"\220\237|\025aHD \273STG\342T\313\235N5+'\334L\210\253\246\242\033\022\"J\231\356\356\211\034Y\265\020\247Q\246\006DD\310\345r#\342\010\216\363\326\327\315\341\334\026\345\235[dQ\236n\225\2673\243R\336\242'\010+\356\370)r:\325\344HDp\300\265\204\345\255\211\231\226\347\271s\265\220\334\013\311IG\331Dr\273\"\3318\020\021\222\231\231,\031\232\031\232\232\022\004Q\034\251\315\310\200\2103cH\210\210S\210\t/*\341-o\353\360*\224EO\221\026\225\242e\252\242\356v\3254\335.o\305\224\267{\025UW<9O\305W\005\212\273\036\261\244\345+\320\025S\324\345\241\257N\334\251b\313\333v\363L\335\333\212\255k\362)\316\212g\272E\025\027\025\022\242\034\"1e\271k\242\"\220\307u(\217\237\251*\345\002oDwK\271\"\027[T\034\241\315\2144\22163C\023\271N\375\247\334\317\375\374\035z\203\2669\371\276\370\306\003\342C\300\352\"\362\263\302\241\230?\316\255\274\345\016Y@6\212Qb\021\212\037\320\215\340\033L\000\257\004\023`\303\035\027\304>\377\353E\035\003V\337\342\235'\375RG\351\0276\370!V\357Nv\216\336\302""\277\340\016\246\004c\007\000\005]\010\007\365\3507 \352\033\227M\266\371T-Yu]\337\266\345oU\372Z\251\254\224[\226\300u\355\245)\014z\371\001\263\013\307\347\230\007f\237\334\";\214\262L\266i|\203\216\003\3578E\347?f\177\326`\372\024\205\3300@\2268\352\263N\203[j\225n\001\253qD\237\010\346\303t|\233\347\200\031\354\236A0\274\315drNL\020\033\305 \204G4\007-\243Y\346\030\332\337C\331\0340\003c\225x\214O\3771\277\262\212\354\306\036\023\276\256\001G\274\000X@:\022\\\300.\3140y%\356u\215\027\000JW\206\337x\001\314\000\032\272\010j[\277\3304\323<\343\361=\000\3760\226P\007\304+\276\326e3X\006\033\276\010\206\030\272\3757\324\207\302}\334\310\267\305O\375\326C`\007\272'c(H(\324#\235\223/b\326\033x\221\244\243\346\216\253\370\307\333|\026<\313\310\275\250\236\321 \233_0>\206\357\301$\014s\363%\254\020\204\021\324>\341\320\234\213o\361H\305\267x\001Dt\025\274j\017Y\035\260\205\005\302\251\331G\266\3115\251\250o~\323\351;5\375\246\234\177\243\037hv\216\230Y\344QG\233\325JB\024a\022\375\242us\312<\316\002\263N.\220}\261\311\305\277\365\013?\372\266\357\016\321\017\340\206!\310\303\257\243v\177\267\364\227\224\276R\321o\205[\310D\243\320|\356\230O\231\224gr\200\214\023\333\342\244\r\277\021\277>\302\263\364\261W\304\206\262\006YL\363\033\r\265-\036\210%\274\331;\030v\202\261q\336\212M\010>\t\223\262\257{\364\023N\201\223\202\267\240-\230@P\217\261@\374\341)z@\207\301:\204\256\035\014\276\356\363\344\370\207P\345\027\372B-\377gH2\364\207\\>n6\345\230\025\210\331C\205\254\006""\276\324\330\344QF\301\370>\337'\345'`\275\030\0160\272\236\322]\030f\022\371\201\t\276\301\020\003}B\241\036\273\205\254\233p\014\354\300\317\177&\375\030a\002-1\037\310S\276\303\353\364\027n\n\332z\002,\233)P\334\350\227\331\234\241+/B\227\276\3152@Z\205v [\210\003!\016m\243k$\3217\022\366\320\004L\362MV\241\250\tO\232\244{f\333\0343\326\242F+D\351\016Z\200\006\262\\\324\024\023X\260\304\014\346\267r\221\314!\243H|Y\r\310o\030\312|\243\001\371\004\242\215Mf\177H\364}\302\010a\217\355\007\334@b\265Mv\001\211E|\360\204\3546o\314B\261\226\024l\003\327K\037'\274\t\201J>\031_L\301\021f\003\307\027\350\023\261\241\251\373:\362\037\t_B\t\372`\306\221w\025\257\236\032\014\326e\323\221U4\276F,\300#\316\370\031\361\216Kb\265G\007\201\037\024\224\222~U\014=\3226\036?\303\21732\3468\032\251`\220f\257_\314\340\305\331\rW\201\037\\\026\341\217\3117\031\216\014I\230\017\"\243\310J3\312\0343\340\223\367\211\305\177\360\243\315,#\362G\025\357\340\331\256QW\374\212\020\212_\341]:\207\245\202\014>Oz\016\277\301\360\367\274\340\021\267~{\251n\323/b\210\230\305'\365*x\303\021\2601\306\332\230\211E\010\3768\217~\224\307x\303\267\034\031}\226O\312/\027\357\007\274\230\360\215\212~\021\315'\347\031Z\202\200\250\022\273\214%\231S$2\"\222$)\244\003\"\030\014\020\215\306i*l\037\262\332\230E\306(cFDDDD\002\021IA\312((\2445x89\310\200\013E@\301\350OHb,\023\034\014\210O\313\002\\N\214B\301-\004P5\242U\314\225\0252\276\227 \301\253\247\001\213U\223\264\331z\016?a\2208\356]9\325\305Kpk\000\205\235h\321T\324\332\370\340#\371\325\335\206\356%\240\347>\272\247@\227\236\271k\344\2377\246\372(B!X\306\016\364\200%\305\263\022v\306\335\225z\276|c\014\200~L\324\276yo2gI\306\014\r\355\032\240\300\013\241\325%PE\025&\036\351`Q\263]\177\t\352\242\236\361\3545\224A\370m\265i\244\253\036\261\246k\366\200\276\310\251\272\313\245\3208m\233\201\270L\330\326b\007t\230\326\337\220\362\214s\360\327V_\036\336\235\277c\222uC\374\300\241\n\t\335D\207E\265E\311\020P\233/n\223\027\312\277\264\263]\216\343F\036#\020""\342\223\303I\214\307\242\007\033\206\352\331\222~,k\214\004\311\355\230w\3436\254)\242J\225\305\321N\0079\256\t\245\262g\370\003\265\024\335\336\354\350\273\364\225Ll\2308o\213\266\371\354+\030w\234^\263y0\345\326\002b\000;U\213\327\344\3076\330;M\240Ru\262\347\006v%\031\237\010\032F\277\201\246\232\217\2401\260\237\313HA\273\321Y\233\"\277tJ\364\002|\364\347\271\306\325\227{2\232\247\333h,\336\254\233\2501kO!mWXD\267\214 \021\314_D\333\016\271\307\307}\241G(\r+\333\275\252F\306Ci5\256&\373\377\022\\@\354\234\016k\204\262\027\353\375\202\304\367`\356*>\344'w3\332\237\010ET@\234\222\007I\315\301\030*\235\0361v\036F\356\343Q\240\267\247[\223)\346\316\020s\203:Wo\000\350\331\227K\302_\377l\243tXk\007}Jb\211\002\351\212'h\327\254\241\276\200\224\243\nf\322U.(F6H\246\343s%Rh\327\276_O\224-y\303\0274\347\211\222\242\203\2230\267\373\226\177=\002M\203Q\231\224\340pZ\3143ZbH\324\334\217L\236}\3552\362)\240ak\024[\265\004\226\331T\330)\332{\\\372\r\353\2768\226\377\220\237\017\236\341j\373\306q\344n\266q\336\336\005'1FE0\000\237\342a\022\312Oj9\324O!\253\001\217\013Z\344%\200\326)\224|\273\275\345@\031\312\370\"\000W%\313\210\254\201\202\372\316$\337\212U\222\224\311\221\375' \240:\255\317\346\316q}lx\230\301\336\177\005S\344)\302\237\303\302\005\336\333\203\232\031L?\227\004\010ht\023Xp<\031\356G\233\350\210f\\\261Z\257\021\251 \363 \3314\017\304\177\273h\242 n\325\200\275\225z\037\274\036(\177h1\363i\246CJ\350C\207H\016\211\300\2201D;\244\204\212\026\216\320\017\003\034\271E\362\246\t%.\247[p+\357\302L\267\211\3244\257\277?\246\257@X%\231\352\007\242u\310\034\251[\002u\353<\003\256\337(N\325\377\263z\323\203q\242\243-\007A\"_;\362\274\026\370\202\234V\364\220\226JB\223_\214\370 \250\021\364\256\200s\242\237\025J\247\231\037\020\247\217\216YL\251\240Y\n\244]\004B\020v\325\235\322\272\372zB\211\345E\265\265\202\206ru5g\351\035\252\341)\t\257\276\333x\030\220\271\020\374\361\365%cj\3721\201\314f(\232\0345S])\353)2hQA\220\201\247|\005\321E\215_>\007*\235@.b\364K\226\032\245%,""= 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 (3246 bytes) */ -const char* const cstring = "BZh91AY&SY\021z\037\314\000\002\016\177\377\377\377\377\377\377\377\377\377\277\377\377\377\377\377\377\377@@@@@@@@@@@@@\000@\000`\014=\337\003\326\367w\260\357\033\225\266\273;\303=-A\241\273\234\323v\033\300\000\016\363\330J\021!\006\205\017\324d\233S\311\247\24044\311<\023JzO&\230Li\251\352b\036\212dy\251\r\250\3614#d\310\311\246\232'\251\240\320\211\246\002h\020)\2645M=\t\344\312\001\264\010\320\006A\240\000\000h\000\014\206OH\006\200\006\210\302\232\023CS\"d4d\032\r\006\324\000\000\006\200\000\000\000\000\000\000\0004\tM\020\232M52\247\342\236I\264\210\311\270\260 \2645*t\030\344\311\264\357\326d\222I%\302\305S6?\320\016%\013o\220\355\005A\303\256)\224k\210\223\010s\210\354\352\210:\370\360\267v\270\303\225\002\337\344\032r\372\350[\026\333<\245\352\224\362r\262\334\013`d\2669\rK9\330\363\312w0wW-\366\321G\2725\337\027%\033\261\351\025;\354\215\247\257\201\325\374\0162\351\276\354K\373Z\026\325\270\214\026\n3]EW\177^\"#\005]\251\202\002\321:\025]\256y\027\212\302\347\2241\005\237E\\!M\020\202d\t\022 p\202\022\022@\177\025L(\202H\034\032\001\306G\334\255\001\262\035""\033\224\roB\361\207\310hX\336\343\020\261@9\237\217H\021\356\356\010\010\027\3545\246\2134\303r\024\275fMP\013^F\303\332n\374\312\256\320\202~\000Q\023dD\247\013#\241J\3169\n\3710E\036\037\020\036hr\351=\371\326\272\327\235\330\251\nh\361\252\247'Tb@<-\324T\365p9o\321\320\310i#\370\204*$\253\2775\371`\272k[\255\013\220\242\214J\007\305=Q\265}h\262\316\037\010M\275\271we\2760\277\016\371\301V&\364P\036r\242a\360\201\205U\332\366@\303\266\235\001\2438k\234L\273\025\267\002O=\000\312 K)\220A&1|\2540\254\026c\030\253\274UlD&\337u\333:\257\332{\317\211$\251b\301\002\276%\tz\025\362\3614].\3359\311Ma\033^\324\220f\340\311H\312\254I\221\231\333o\030IB\256\246x.!\341\214\3337\03086\242`\363\326\362\326S\274\230j\335J\332\370W%\356\037#\222O\277A\222\343\014\210\312\252of\353\266\027V\376@}I\017\334\255\346;\270gF|Z\325}d\214\004\313\346#\370\256\325\026\320\272\270\031c\344\231\032\331WF\001R\350\354\3247v\177(\345\345\356Qv^\035\273\314j7=\352\007\347h\244\274\355<\377\353\353\317\020\215\033\251\032q\235\254\342W\314\227j\235\203.\356\337\355\2005K\230\026\355H\221O\301\010{\031b\357\001J\221\325]kJ\306\355v\007\331\205hU,\013:\324\213h\220\342\353\276\307\254>\364\370\017\321\253J\302\302%\236q\352\323#\236\002\323;\21770\315\360\021g\353z\005>\345\026\3071P\203\271\260\310zO\334\310'\300\227\033\236\261\0309\nf\332o\2370\301M[\\\332\305(;\027\327\312\267\3165\005g;A\324\266d\330\334S<\027\005T\230\353)ksQ\"p\010\254 \223\236xe\331G\302J\222\301\310\251h\231\212Y\2130c\310\036AA\244NP4\006f\362\214]\225p\025\351j+\235HDP\"\004r\322\222\316\303\024\021\213\"\335\317@$\232\251\255$\342>}\352\250\263r\332\024\206\023\215\016\310Dq8g\205\367\262\270\376\376P\221[3\260xp\321\247\nq?\365v\034\357\006\031\302\252\225\0041\350\262/fM\201)U\377\213\271\"\234(H\010\275\017\346\000"; - PyObject *data = __Pyx_DecompressString(cstring, 3246, 2); + #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 (3151 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\202dA+\312)I\231I)\252R\000l \032\3173\000\340w\211.\351$\213\237@\2064\362 \221\"I!\365\001k\206\244\024\236\265\237\226RD\302+I\004\234C\\;\\iMK>\255\024d\261\231\000\325!\245\010\333#eH\355\305\3535\335\314\305:S24\361\300\242.*YXCc\213\004\253M\322%R\363\216\300|#\007\320+\007\3201\007xf\235\257\017;-\r\355\224\221>\036\361\005h\242\220\311\340\013\002\246\246U%\373\201\024!\216i\250-\377\271KdT\267\0131\316I\254! \244_\331\345%\215od\001\326\212\312\243+\032\006\303\357UL\207\006\252Q{\206\244u\374!\213\275U\202\007\022\211\312\276\264\277\204\034\244\016I\370\204\316\255e\210\2551\311YE,@\244\341O\026\262\360\006\007u\374\361\232\256\344|{\212\222N\003\376\327\017\337\010Bc\341;~\370\211\246\017\277TiwO\3171\024\360\241\240\006\010\005\215\210MK\036\021\220\345\010\316\320\230\036\332q\312\314rFIA@\036\314\324\302\371\255-*\311e\240Z\371\206\345\357\334\311k9H\312\267\366C:j\251+6\025\301\0179\327Z\305\177\221\310\026`v\303\014\371\356(\371u\003e\223\372\226\237?\352\370w\250\374a\rL@l\2268N\201\243\352\320]rNJ}`\303 \247\344\240A\367Y\275\362<\206\323/dU\205\211\262K\016je\277_\003\276V4\3541\346\205 \353\26528Z\r\255j\003|jr\253\331\303\3465\240&\021d\"\266\242\361\005Y\312\027\310\021\226O\252\303\241?)Y\003\261\007\306\314_4\332\334\377\304>\207\313\232\240\246\366\020\313x\036\372\265\326\320\260\202+\220\000U\303\334f\217#\001e\024\235\210p|U\0072rrp\377C\2359\360R\223\000\327\323\022\320yD`\270\312\310\260=\233\203\257\\\221\347uP\005\317=U\371\253u=\237T\263-K\240\351\016\301n\247\020\017E\256\005\245\001)_\1773\3009Fd\221\331\007\350,\020\366\320 \335\207\031?\"\333\202\354K\327\351Z!\227ST\010\322\341\216\006\357k\303u\306\341\202\207\3132\232\261\242N\364\357X\245o\320\212T\316\236\373r\246\355l\260t\273$\224\016\014\315\0342\343\246P\t\366\032Q\244\017\230s\346\033+n\245\355X%p\315\\7\017\254\274}\306\026\252\201\363\245;F\207\02136\314vzy\322\236\2637\234S\316\260#8\232\033\241K/\313*\215\25735""\225@\037\355\033a:V\355<\275\365\310\033\364~\241\317\0234\361\007\375\203G#ac\311L[1+\216Z\321\217\217f\257\271j\346\255\000\035[t#\325`w\351\023\372U\351\351\247\375\343v\250\022\032@6\373\234\266\343he\321\214\323\353\233t\363\025}\265U\tt\227\362p\274\300\317\245\214y\323j\267B\025\320;_\322\214H%\0306V\215\274\331\0162\264\027\275\336r\346\234x\025\375\374;V\375\266D\277\241\233Q3\306\016\305$h\333\200\371\253\025\373\022l\353\014\302\356}c\3358\000\257;\2558\234\252\263\273$|9\207\257\244\0210\333\315\313\326M\373\224\035\251t\234/EK\261\322\226q\333\020\315\0213\357\304\2158\355\230\265\377\343\302\361#h9X\372\005\rt\263t\014\233)\253\337>mG+=\203\326\250\035\002\r=\241j\360\212\0311\027\254\213V\001\362\022\034\264\006!z[v\324~\354\264;a'\356\210\356\260K\2749\357mY(kt\3755}\375\206\276I\323\364n\005\324\302\251h\357\030\352\254\036\321\331c\2345\373L\301\324\254\210\005\346\006\340\250=\003t`\326\316;g\234\244{\312\215\270\267\335\244\327\351m\225\347\312\257!\326 U\t\217\262\202HB\362#\316\202{\321U\275^/F\237\274\243\357v\350N\212\246\320*\335\335\253\233\032w\242\316o\356\373\362\231\262\340\347\251\275\022\032A\337+\235g\276\\l\353\274J\257L\3311;\341B\244^\226\363\225\216@\251\313\340\255\030&d\321\210\033Y\213\205\006\222\177\215^\273\357\206\240[Q\353\271\375\021x\303\356\256\027g;\361\020\220B\316\372\311R\355\001'\341E*]\375\220\326.(\272\032\365\232\223\365@\367\005c\302\214\231\177\330Q:\265M\267\341\014\177\322?\005*$1\245\301\022\344\374\0326D\265\243\263\032\010\031a\360\210\235\343\243\0312\307\255;v;;T\345|\260\212o\3326BGV\334\267\236\200\322\003f\264\322\001\341\002\331/=mp\334p[\347\240u\0353\377e\256\255\363\206\231\265\3578\001\367g\330\255\302\3663\3208\306+s\314\357\321\205\266\316\213\006T\310\r(\260v\353\022Dr\304\326\235y\247\340BhnZ\242\035\261\347\355\242\333\356\206\252\360)\320\321%w\301\013yC\336f\271\017C\215\207\rB\225l\330\035\366\023'\204\376\204\261\003\242v\254\332q\035:\036\002\375\023x""\036\030\202\334\263N\007\224\240\303\213tq\215\256AcA>\267+\201\253\346<\332\257\240\033\230\221\273\306\250\03167\301\237~\247\275\032\354\302\"\215X\267\255\0244iO\230\206oZI\250\263\333\266\000_\306c\363'z#\352\204\234H\323\327\005\007\252\020\242t\327\311\273\247]\210\377\020\035\272\347\266\323\373\277\227\241\261\273i\367\260\265\n!\353\031\245\243+n\234>X\247\353\033`\231\236\347\254\323X\nC\326=V\367\235N\234. \223nl\242\237w\255A\360\036\252\003\373\315\2168\021+\002\270\3241i\257\260\000\037\201\274A@\223O\320\004\254\261\003\027\r\301\3307\267\254\005\273\017\374\016\014\230\217\314=K\2604\010x\336\371\331\025j E\273\007\255!+~\010q\020u+\217\212\273K{\0061\357Y\014@\257\320\313\023\220\033\330r\205^a\341\256\324\345o\230\252u\301\232\007\315\021:\271\354>\002\325\2762v4,\371\210\325\213\260\010\347\241WoA\023\nN\276!\315xX\321\2471OK\356\234\013\276 \242\275v\240o\347\2341\272\030\007\010\256b\014\247\020y\253\320\032\360\230\245\263\317\313\013\300\301@B'\351\000D\220\236^c\036\270\2200\002>\256\262n\tsV\267}\000y\351\004\325a\037d^\301Y\026\001`>@mE\340|p\352M\250\305!;\016\261\nG\240\232\217\n\320\221G^\304[\002\030\332\007d\246[\257\377\017&A\246\253\327\030\003\260\205\341U\t\002\032\314\330\202\r\253\353\364z\r\027X\221A\363\006G\240A\332\241x\2037\350\215y\347)@^\364K\000&\024\002&\322\003P\324\343\0141\001\246\237\301\360\353\204\352\277\002\025\236v\036\273g\275\376rgy\223\306\0018\2224\231\252\0061\341\320m\325\340%\363\024v2\035\002\310B\177z\020\205a\354\245\000\3601/`\020\007\332E\343=t\367\200\035\2473\377*\307\312\333\364\r\216\311\n6\026T\206\361\310\330\003|\376\267\375\302\035tc\240&t\311\300\212\353\232\264\307\240\251\300\332='Z\t\216A\213\307`\034\267\323\350\263\362\305r\236\256aS\000^Wkzhx\326\326\260\013q\376\367\364\371#\374\226s\032F\341\0066!]\206\33583\252=,0t\354!\300z\010e!q\264\177\316\031r\326\035\215.\372za'C\207p\277\361\211\265\304\245\313\225\201\005(\326\242w\312\033\366$\234@\033\225\033\\%\262\344F\335g^\334\023""\313\3435\217.\373\355\215\022\363N\314y\013\363\245\303{V\336\240kq&\201\010?\356E\275\307\345\263~\311\376\017\022}\230n\r|\216\037u\021!\347\254w\301\233\367\212~\210\230\374\262\033C\300\366\364\362}\377:\321l\361\016\324\241\004\261\010\303dM\341\005\007%\000e\334\373^\014\220\366\262\217\077\077.\0015\326\025\366o\\!\343<\314\211`W\351\235Q0\237Z\303\326{\347\254\333\357\235//\321-\0103L#\221\212\004\213\362\202\301\256)KF\312\014a[As\303\265\000\313\342\252\t\343\355\222y\032\025}EG\023}pm{\2133\023@\t\300\357W6\026\332\355^,Ug\332=\304\230\032\306\262+\203q\317\274m&\201\260\210\010\303\300\004t]\270\326\270\211\371m\301\256f\0058\376'\026pd\340\r\341<\275\375\033\375\r\313\004f\352\367m\362'1\2756\007\027\213\250\177M|\310n&\376M\240Z\277\242\206\215\373\020'`\234|{,b(\230\313\225\320\025\377&\331[k\2760@\253\017\007}x\332;0\256\226\234\224\3533\360&\262M\357\275\244/k\227\200\357\333\324\312\3064\203\253\243\342Ud D<\247w_\320\027x\035\246\374\237\255l\034\333T\365\241\202F\260\007\342\354\322a\345\315\374?\023\234\023\345"; - PyObject *data = __Pyx_DecompressString(cstring, 3151, 1); + #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 (6485 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_NextRefVERBOSEVariableExactProdConstraintVariableExactSumConstraintVariableMaxProdConstraintVariableMaxSumConstraintVariableMinProdConstraintVariableMinSumConstraintasyncio.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_nu""mberitemskeykeysleftleft_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.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 < 210; i++) { + 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); @@ -16522,7 +16534,7 @@ const char* const bytes = "']]AllEqualConstraint | AllDifferentConstraint | None stringtab[i] = string; pos += bytes_length; } - for (int i = 210; i < 229; i++) { + 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; @@ -16533,14 +16545,14 @@ const char* const bytes = "']]AllEqualConstraint | AllDifferentConstraint | None } } Py_XDECREF(data); - for (Py_ssize_t i = 0; i < 229; i++) { + 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 + 210; + PyObject **table = stringtab + 211; for (Py_ssize_t i=0; i<19; ++i) { #if PY_VERSION_HEX >= 0x030F0000 PyUnstable_SetImmortal(table[i]); @@ -17264,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); } @@ -18100,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, unsafe_shared) + 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))) { @@ -18392,21 +18405,33 @@ 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, int wraparound, int boundscheck, int unsafe_shared) { CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); -#if CYTHON_ASSUME_SAFE_SIZE +#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 ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS)) { - return __Pyx_PyList_GetItemRefFast(o, wrapped_i, unsafe_shared); - } else - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { - return __Pyx_NewRef(PyList_GET_ITEM(o, wrapped_i)); + 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; @@ -18416,15 +18441,35 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck, int unsafe_shared) { CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); -#if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS +#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 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; } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { - return __Pyx_NewRef(PyTuple_GET_ITEM(o, wrapped_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; } - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); + 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; @@ -18437,11 +18482,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, #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 ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)) { - return __Pyx_PyList_GetItemRefFast(o, n, unsafe_shared); - } else if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { - return __Pyx_NewRef(PyList_GET_ITEM(o, n)); - } + 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)) { @@ -18451,6 +18492,10 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, } } 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 { @@ -18484,7 +18529,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, #endif (void)wraparound; (void)boundscheck; - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic_size(o, i); } /* ObjectGetItem */ @@ -18508,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(); @@ -18625,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); @@ -18648,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); @@ -18695,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; @@ -19906,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); @@ -19920,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; @@ -19934,11 +20031,37 @@ __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; } @@ -19959,8 +20082,11 @@ static PyMethodDef __Pyx_CyFunction_annotate_method = { }; static PyObject * __Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) { + PyObject *annotate = NULL; CYTHON_UNUSED_VAR(context); - PyObject *annotations = __Pyx_CyFunction_get_annotations((__pyx_CyFunctionObject *) op_in, NULL); + 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, @@ -19975,14 +20101,17 @@ __Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) { PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted"); return -1; } - if (value == Py_None) { - return 0; + if (unlikely(value != Py_None && !PyCallable_Check(value))) { + PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None"); + return -1; } - PyObject *annotations = PyObject_CallObject(value, NULL); - if (!annotations) return -1; - int result = __Pyx_CyFunction_set_annotations((__pyx_CyFunctionObject *) op_in, annotations, NULL); - Py_DECREF(annotations); - return result; + 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) { @@ -23427,6 +23556,10 @@ 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; } diff --git a/constraint/problem.c b/constraint/problem.c index 3b5efa8..9390eb0 100644 --- a/constraint/problem.c +++ b/constraint/problem.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.2.6 */ +/* Generated by Cython 3.2.9 */ /* BEGIN: Cython Metadata { @@ -37,8 +37,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x03080000 #error Cython requires Python 3.8+. #else -#define __PYX_ABI_VERSION "3_2_6" -#define CYTHON_HEX_VERSION 0x030206F0 +#define __PYX_ABI_VERSION "3_2_9" +#define CYTHON_HEX_VERSION 0x030209F0 #define CYTHON_FUTURE_DIVISION 1 /* CModulePreamble */ #include @@ -904,28 +904,39 @@ enum __Pyx_ReferenceSharing { #else #define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0) #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 +#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)) -#endif -#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_PyList_GetItemRefFast(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_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(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) @@ -1788,10 +1799,10 @@ 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 /* py_dict_items.proto (used by OwnedDictNext) */ @@ -2825,7 +2836,7 @@ typedef struct { PyObject *__pyx_slice[1]; PyObject *__pyx_tuple[3]; PyObject *__pyx_codeobj_tab[17]; - PyObject *__pyx_string_tab[189]; + PyObject *__pyx_string_tab[190]; PyObject *__pyx_number_tab[1]; /* #### Code section: module_state_contents ### */ @@ -2982,113 +2993,114 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_append __pyx_string_tab[82] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[83] -#define __pyx_n_u_bool __pyx_string_tab[84] -#define __pyx_n_u_c __pyx_string_tab[85] -#define __pyx_n_u_clear __pyx_string_tab[86] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[87] -#define __pyx_n_u_close __pyx_string_tab[88] -#define __pyx_n_u_collections_abc __pyx_string_tab[89] -#define __pyx_n_u_compile_to_constraints __pyx_string_tab[90] -#define __pyx_n_u_constraint __pyx_string_tab[91] -#define __pyx_n_u_constraint_constraints __pyx_string_tab[92] -#define __pyx_n_u_constraint_domain __pyx_string_tab[93] -#define __pyx_n_u_constraint_parser __pyx_string_tab[94] -#define __pyx_n_u_constraint_problem __pyx_string_tab[95] -#define __pyx_n_u_constraint_solvers __pyx_string_tab[96] -#define __pyx_n_u_constraints __pyx_string_tab[97] -#define __pyx_n_u_constraints_2 __pyx_string_tab[98] -#define __pyx_n_u_copy __pyx_string_tab[99] -#define __pyx_n_u_count __pyx_string_tab[100] -#define __pyx_n_u_deepcopy __pyx_string_tab[101] -#define __pyx_n_u_doc __pyx_string_tab[102] -#define __pyx_n_u_domain __pyx_string_tab[103] -#define __pyx_n_u_domains __pyx_string_tab[104] -#define __pyx_n_u_extend __pyx_string_tab[105] -#define __pyx_n_u_freethreading __pyx_string_tab[106] -#define __pyx_n_u_func __pyx_string_tab[107] -#define __pyx_n_u_genexpr __pyx_string_tab[108] -#define __pyx_n_u_getArgs __pyx_string_tab[109] -#define __pyx_n_u_getSolution __pyx_string_tab[110] -#define __pyx_n_u_getSolutionIter __pyx_string_tab[111] -#define __pyx_n_u_getSolutions __pyx_string_tab[112] -#define __pyx_n_u_getSolutionsAsListDict __pyx_string_tab[113] -#define __pyx_n_u_getSolutionsOrderedList __pyx_string_tab[114] -#define __pyx_n_u_getSolver __pyx_string_tab[115] -#define __pyx_n_u_get_in_order __pyx_string_tab[116] -#define __pyx_n_u_getitem __pyx_string_tab[117] -#define __pyx_n_u_init __pyx_string_tab[118] -#define __pyx_n_u_is_coroutine __pyx_string_tab[119] -#define __pyx_n_u_is_gil_enabled __pyx_string_tab[120] -#define __pyx_n_u_itemgetter __pyx_string_tab[121] -#define __pyx_n_u_items __pyx_string_tab[122] -#define __pyx_n_u_keys __pyx_string_tab[123] -#define __pyx_n_u_main __pyx_string_tab[124] -#define __pyx_n_u_metaclass __pyx_string_tab[125] -#define __pyx_n_u_module __pyx_string_tab[126] -#define __pyx_n_u_msg __pyx_string_tab[127] -#define __pyx_n_u_name __pyx_string_tab[128] -#define __pyx_n_u_next __pyx_string_tab[129] -#define __pyx_n_u_operator __pyx_string_tab[130] -#define __pyx_n_u_order __pyx_string_tab[131] -#define __pyx_n_u_params __pyx_string_tab[132] -#define __pyx_n_u_parsed __pyx_string_tab[133] -#define __pyx_n_u_picklable __pyx_string_tab[134] -#define __pyx_n_u_pop __pyx_string_tab[135] -#define __pyx_n_u_preProcess __pyx_string_tab[136] -#define __pyx_n_u_prepare __pyx_string_tab[137] -#define __pyx_n_u_process_mode __pyx_string_tab[138] -#define __pyx_n_u_qualname __pyx_string_tab[139] -#define __pyx_n_u_requires_pickling __pyx_string_tab[140] -#define __pyx_n_u_reset __pyx_string_tab[141] -#define __pyx_n_u_resetState __pyx_string_tab[142] -#define __pyx_n_u_return __pyx_string_tab[143] -#define __pyx_n_u_self __pyx_string_tab[144] -#define __pyx_n_u_send __pyx_string_tab[145] -#define __pyx_n_u_setSolver __pyx_string_tab[146] -#define __pyx_n_u_set_name __pyx_string_tab[147] -#define __pyx_n_u_setdefault __pyx_string_tab[148] -#define __pyx_n_u_size_dict __pyx_string_tab[149] -#define __pyx_n_u_size_list __pyx_string_tab[150] -#define __pyx_n_u_solution __pyx_string_tab[151] -#define __pyx_n_u_solutions __pyx_string_tab[152] -#define __pyx_n_u_solutions_dict __pyx_string_tab[153] -#define __pyx_n_u_solutions_list __pyx_string_tab[154] -#define __pyx_n_u_solver __pyx_string_tab[155] -#define __pyx_n_u_solver_2 __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_n_u_v __pyx_string_tab[161] -#define __pyx_n_u_validate __pyx_string_tab[162] -#define __pyx_n_u_value __pyx_string_tab[163] -#define __pyx_n_u_values __pyx_string_tab[164] -#define __pyx_n_u_variable __pyx_string_tab[165] -#define __pyx_n_u_variables __pyx_string_tab[166] -#define __pyx_n_u_variables_2 __pyx_string_tab[167] -#define __pyx_n_u_vconstraints __pyx_string_tab[168] -#define __pyx_n_u_warn __pyx_string_tab[169] -#define __pyx_n_u_warnings __pyx_string_tab[170] -#define __pyx_n_u_zip __pyx_string_tab[171] -#define __pyx_kp_b_iso88591_A_9Ct1_8_Qa_AQ_4z_V7_4t7_8ST_T __pyx_string_tab[172] -#define __pyx_kp_b_iso88591_A_D_Q_KvQ __pyx_string_tab[173] -#define __pyx_kp_b_iso88591_A_Kq __pyx_string_tab[174] -#define __pyx_kp_b_iso88591_A_oT_T_QR_4q_1_t8_q __pyx_string_tab[175] -#define __pyx_kp_b_iso88591_A_oT_T_QR_4q_1_t8_q_a __pyx_string_tab[176] -#define __pyx_kp_b_iso88591_A_oT_T_QR_4q_4q_t8_1I __pyx_string_tab[177] -#define __pyx_kp_b_iso88591_A_t1 __pyx_string_tab[178] -#define __pyx_kp_b_iso88591_A_z_5Qa_Cq_t1Cq_8_Qa_1_1A_z_A_j __pyx_string_tab[179] -#define __pyx_kp_b_iso88591_E_PQ_Ql_q_A_jjkkl_4z_a_xq_q_1L __pyx_string_tab[180] -#define __pyx_kp_b_iso88591_Q __pyx_string_tab[181] -#define __pyx_kp_b_iso88591_Q_2 __pyx_string_tab[182] -#define __pyx_kp_b_iso88591__5 __pyx_string_tab[183] -#define __pyx_kp_b_iso88591__6 __pyx_string_tab[184] -#define __pyx_kp_b_iso88591_a_L_AZq __pyx_string_tab[185] -#define __pyx_kp_b_iso88591_g_B_M_6_E_Cq_s_vQ_z_1 __pyx_string_tab[186] -#define __pyx_kp_b_iso88591_q_k_a_we1_5Q_3at_b_d_q_izQR_Cs __pyx_string_tab[187] -#define __pyx_kp_b_iso88591_xq_Kwc_A_1_2_z_j_1_aaeeffjjk_Qd __pyx_string_tab[188] +#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 @@ -3117,7 +3129,7 @@ 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<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<189; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + 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 */ @@ -3157,7 +3169,7 @@ 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<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<189; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + 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 */ @@ -4628,7 +4640,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -4919,7 +4931,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2genera #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -5510,13 +5522,13 @@ 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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -5799,13 +5811,13 @@ 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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -6091,13 +6103,13 @@ 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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -6428,7 +6440,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -6565,7 +6577,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -7134,7 +7146,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_7, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_7, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -7514,7 +7526,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -7533,10 +7545,10 @@ 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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -7765,7 +7777,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -7867,7 +7879,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif if (__pyx_t_11 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_11; } else { { @@ -7914,13 +7926,13 @@ 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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -8040,7 +8052,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -8085,10 +8097,10 @@ 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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -8268,7 +8280,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -8340,7 +8352,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -8359,10 +8371,10 @@ 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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -8425,7 +8437,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif if (__pyx_t_11 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_11; } else { { @@ -8519,7 +8531,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + __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, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -8538,10 +8550,10 @@ 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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -10795,39 +10807,39 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); { - 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},{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 (2976 bytes) */ -const char* const cstring = "(\265/\375`\353\037\265\\\000Jp\370\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\327\264\245\370\310\203\210\320}\353\237q\367\027\177\367\335w\325\225\376\2525\276Uw\277\353\376\227\031\227\375\332Go\275o\373h\353jg\207\351\334\367?{\214\315}\216\215\245'+\364_\206\341\241\342#\036$/\245\314\024\035!Q(\264\357\334\031{\0358;\317O3~\017\334\027\323\373\336\273xf\277\251z\nn\3647\367*\325\364\231\222\350\277\326\357\327!we\326\326\032\337\363\263\323\365\033.fm\020%\n\371\364\\\377\316\223\323\247\237\345n\025i\3759\343\024\340\346\364=o\346\032\377\215\273\237\312G33%\255\247\345J\240Wr\025\366\347\356\254!\275\312\246\227\375\253\026\257\373\263X{~\027\366\374\252\037\321\327yz\016Z;\271\212\3677}\264g\227\261\312W\267\272\235\373~W\363{6\357\025\334]\204\242\342-$|\243w:\212\206\351--\276yi\363\321\364I\267n\332\320I\306\203\217T|D\212\361\221\014\312\206\342#\224\211\022\023\322\263\346I\203\322\231\211B(oq\022$H\224\336z\335\264A\341\007\016d\335\333\rg\317\237\265\035o\337\267\316\274\365\305\234O\247\324\224\211\002\033_\215\322Y\"\363\221\010d\325L\327\034\246\025l\267Y\317\001\327l\373V\231\307\201CI{{\263\374E-\232\326\317\351wM\226\177\370F\226\337\363\214\3657\271\375\237U\276?\314\332\265\306\237\342\316-\306(:?\263`\374\352\031\224\372\316_3\314\216\027\017\357\227,\313\266\236\366\271\317\2765\356B\276=7C\333\346\357\256^H\2053\336\325\357\364\227!\002\361A{X!\205p\261\210\020\021BeE\010\222\376\300\202\022uX!\371_T\246\377\323\372\263\277\236oQ\236\351\251\242\251\366~#]\355[;\363Dm1\262\327v\246\310\225z\n\270\265\271\361\2753\345\265_=\275\277\376a\320U+<\323\267n[\277m\205ee\003\n\005\312o\006\355\357\231\177\253\366\351\3517\206a\322_ebdb\254\365\222\347\315\316\301<\271Je\360PYY\371\213a\270\236~\363GoM\341\033\257|\2447\257\252\366\344*\270\275\356\267O\353\337|\353\257s""/\351\223\357\310\336\3655\357\317\217\267\323S\315\303\230\272\372K\3364\334!\000|\3074Z\030Pz\365F\337{\036\366h\270\352Q\355\341n^\375\366\243x\356\3574M\203O\2435[W\232\326\264\356w\335\370~*M\323\034\246\232\346\375\323}?\314\201\236\3164\323\360\326\236\343\266\311\275\265\230{\215-\2675.\317\267\034g1\336\364_\2341\227\341\312]POz\337\363\\\252\227\261m\036\206f\003\322\317Os\014\227\255\253\013m\272$4\266#2M\3234\025\325\353\360)\253\367s\231=\032\305\204\\W=##\023Cu\345V\367\277\231\277\374\373;\317u\245\240\367\001\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\222\310\202\226\250\222\223\026\204\016\r\211\214\210$I\222\306R\020\010\210\244\201\234)\263=b\221\242\3448\022R\006\031C\024\221\021\221\211DDD\n\n\222\024\n\035\006\302\332\227Bt\261W\343B\"\324\212]\326P\244\275e\346\224\t\177w_m\024\362\222\365\305\247\214i^Cm[\217WG\350\007r;\266*@\007X\r,0\037\210\020\356Qv+K\016\265\355[\031D;s\326w\263\234\316o\025\217CJ\226\270\337\321\350\370)\341\rR\214\372(\200\352@\204\343\365{Q\266\366\204\307\342 \324>\272\345\003(!\335;\215\200\244\217\n\t6\023W\370\013\224g\360\021\263\201\r\0069[\333l\346\0253\004\306\n\351\321$\275\241 ox\243\216\236\227\307q\3005\275\r&\026\031\261\301\374M\274\220\034\367\364\317\314\365\217\006\314)KT\252V\207\204NSI\316;\304\374\022\201\337\373\374\226\317vg\304p\244\037\215@\317\3609\207\0205HZ\331Z\227\301\n\245\014.@?o7\001Ar\225\234l\025q\346/-\003\035\347\032\377\3560\302rn\246\354\362\n\nqOR\313h\204\001r1d\223\353\355\007\233\213\325RGB\026\203>Z,\361\323\230E\362BI@\375iW\244\003ba\342t\002\276\201\323\241\206D\332\305jO#yI\3455\2332?B\376\352Np\177R\363\357\2121\356\371\305\016t\006\020'\026\234\023\336\325\330\315\206\032-4\351\206\241\020m\274\340\372\025\343\351\244\335\210\020H\360\270'\250\0263\3328\317\231G\312t\350A\377\016\001\272\326a\"x.%\016\344k\266e|\266\325\264N\363\300\037\022\312\310\264f\007b\006\215\006\247\032\2776\353j\331-i\305\250\240\351HV\260\372\330H\034w<\006\247\000\276E\"\240\006\216\260\217\016\361\361\331\356\373\035%\333\343\262\271\223\330\311\370StW\251I\\\214\032(\351\223\034q\201'1\274\223\305\313\314\250l$\333H\034\360\242\251\223\2737\255\360\352V\327\212\006_-\326\022\327\311\023\024*\206\330%n\243\210\310\203\005\315\024cCm\364\264)\216\252h\215X6\231\302-\260\353K\324B\315\375\223Ek\3756\315\226\300SP""\037\031\343\314\221i\227\324\037\037\034N\213\351\005{\266\234D\2571\234\230-\002\355\371\203\247,\273\310\370<\302u\210&\323UC\240x?!\203\311\232>\306*x\214\201\341\264]g\021N\220\320j}m\034\017f\346\205{M\027\352D}\372p\323U\347\354(\312\361\305\223$\375Z\241\220\234\246\310\235\032\361\312\002\370!\360\002\204\351\374\000.\243\264X\272L\360\"[p\207\231\243\306;\242\334\034z?i\360\253\270c\363i\350\000M\355\246\220\261t2\216\356v\014\271\037*\035\357!e\314\247\342\274K\003L\034E\270c\252_\246}\236\263\304""\355\206\311\261#\004\324V\347iQ\200\240u\237\353\365\003\235\207w\346KQ\303\372\033\377\261V\335\331\373\365Kf.z\327\031\0054\031\036C\241\024\354\222\3775\212!\343\346\333a\264\203a[\205t]\317\251\313\rM\031\216v\335l\266>\017\024-\317MH\304C\000\250\200\303\2662\"t4Q\351\316g\013\016L3s\3448\363\265+L\252@(\224\350CFi(pW\010U^\2502\372iV\273c\361N\364T\343 \335\210FHY*Qy\r\237\247\262\014I\222\260\334\025\207b\311\010\010m\337H\254X\327a\326\200\255\300d]!\317\303\270UH\262\037\354\200\276\373\220j\215\344*\226\030\304\217\252\232\374!"; - PyObject *data = __Pyx_DecompressString(cstring, 2976, 3); + 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\373k\310\260ik\003\316\024\244\031~\014\355d~\251\227\325\225\030\311\302\314\244B\021C\3040\376a\301\244\304\215L$\322\227\260\3159x\202\254M\227\000\210?\347\025\007\355\016\210\321\006\206\277\245\211p\032\025\234\250\036\242\374X\013\033 S\331)W%O\n5\263=\213\234\256\232O\221\023\222\325d\265\254\261\314\312\253C\264\2260\002\274\021\023\032\036S:\233\007h\203\256\201\244\301\030\210\301\020Q\2100ET\025,K\352\353\203P\234;@\224\271\337\030\36791\231\271\232\214sq)\"\tHt\232\2076YJR\201D6Fhr\207\r5\022\210\2366\227B\251\006b\025k\023\346']`L\003\206)P1\027$\213b\264$q\353N5a\254F7\001\335\324\027\254\347\215\243,\325\301\031\225\347\373g\001\\I`\3472\316\314\316\363\n\224\303\345e\277\001,\211\206\222\0144L\273I*\271\264\025\252\tK\0177\n\000\211\ncFe\022\236Kc\036\340\273EB\232Ul\316\034%fd\201:\305DF+\222\030ZB@A\036\223$6\202\023\201\251\304\250\320\004I\223#1)\223\033\355\265 1w0\231[\311U\334H\271\027\371\361e\225\2311\216\261\301\246T\255t\244\223\345\007qdXn\014\374\006[)#\020\321d\004\nPBP\322\206\2218\240s\342\020_S>k\214\271U{\301\000#\006\3321\030\014m\031 \221\"x\370r&I,\322/\355%\303\332\355\313a\223\376\341\221\022\341\002b\202L:\222\350\324P\353\257\020f1l\027z\323t\222\332\212\336\321\314Z\031\004\202g\245\266\240\316\236\231,\322\211\r\026p\320\256\353\231@/`\227w\211W\253m\342\262\213\237\326\021b\027\034\314:\214\3001q8&\370\337*]\315\260\263f\222\307.\375\n\2314\n\220\031N\317\323\362\3606\235\024\2270\3162\27085kz\030w\014\346\007\325`\250\276uDE9]p\304\373\023\032\224\250\245&\255\371x{p0<\242(> \357R\336\372y%>\346S\366\322]\247\362\376\345U\177IA\020\214\302\307\007\216 \262\r\014RQ+\301\345\002\237\313\235h\237\201\223]\006\3676\325\274[c\234r\271\216#\242\"\223>\024a9[\233\351\242\270\316\320\034G\215p\245p7\316{T~\221T\347rf\216F\254\2410%A3\305-\365\331[\371zOf7.""\332El\\\200\333\206%\234\214\276+\243l\367z\033\350\237nH\306\251&St\333\031G\224$\341\214H\255vu\311xX\235;\242\r\274\013'Z~\t]\201\002\317c\216\204\350<\203zn\027\352^qi0/KK\025\216h\314\224\336\237 \256\374\037\016\237{\357\003z\263\362\323\333\305(\257\333\3523\356I9\231\005\254+\3523W\023\257\017\252{\357\336\303\260\306\325)\3343\355\024\373\3463\365g|-\323\321\034\002Ea\250\027\265P\244\321\211\224\241\014\321h,H\344\305f%\006\227$n\250r#1(S\210\275cUC\326BS\225\026r\262\312\345a%X\245m\342\331\366\377\272N\216\314\321\276.,\350\217\177\374]\311\024\341B@s\373[\244"; - PyObject *data = __Pyx_DecompressString(cstring, 3063, 2); + #elif (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (3081 bytes) */ +const char* const cstring = "BZh91AY&SYIES\365\000\003+\177\377\377\377\377\376\377\377\377\367\377\177\377\372\377\377\377\376\300@@@@@@@@@@@@\000@\000`\014W>f\330\236m\351l\221\273\005\001@\000\000\350\036\203\240{\240w\206\204\240\232\231\251\372\rMM\244\331O)\351\206\232\024\315C\312z\230\322zOH\320\332OH\365=CM\r\251\352dl\243#\312\r\033MFjzj\r\004\004\006\241\032\215\251\352=F\215\r\006\021\352\000\000\006\232\000\000\000\000\000\003F\201\243A\251\215M\020\244\365==P\017S@=M\224\036\210\017Q\265\006\200\000\000\000\000\000\000\000\001\2404\322MS\3244\000\000\320h\320\000\000\000\000\000\000\000\000\000\001\220\000\004\0310\002`\000&\000\2150\214\000\000\000\023&\230\232\014\000\214\000\000\000\000\221 \200\200\001L\325=O\321\250h)\221\231L\214$m\032\214\002=F\000\010\300\t\246\320h\006\232F\034W\217\022\335\331j\233t\357\010uK\355\367\315\037\202\374\376\202\206\022\233\021QP\363\201@\200%vxE\376\376@\200\224$\022KB\"!\220\000\010a/\201\306\226h\007\312\357\261_\000`*\001\332\030\353\023\272\320$1\304D \010D(\004\022\301\212\361\217\013V!\322\343\241\256*+2\017\347\371\377}\213\333\316\275\366\2208mB\336\306\300\033\350\340\306\221QU/0\342t\311XQ\024\240sD\345)*&\334\313\230\233\270\260\230\245P\264\273\244\274\246\245:\306%\031\314\006\031\260!+b\026\231\300\330d=)\017\214\nl\234W\223#\034ea\252\234`(h\206yN\367\312\301O\027_@\241\314+\004\340\301\007\014\002\000\201\001<\210\000G\253~\206mf\024\027\317B\277V0\207\034\020&\341\003\035h\017\206k\003\010\220\306\240?R\347\355\223\300\346\201\336f?J\241\375{p\272z'9~\371\350\244\357\2663\232\004~o\014 *qX7\276\310\001\301\241\313>\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 (2982 bytes) */ -const char* const cstring = "x\332\335X\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&\351TcK\213\335}\337\277\367\336\356\346\213eM#\224\250\226\311]\207\352\246K\\\213\270\233\214\330\216U1X\255\370\301\007$\372\271\367\202\326l\203\315%\023\370s\347\316\235x+\231'\213r\224\313\037\266\247H5\355\tut\n\037<\267z\236\236/\220\363\225\363k\005\262Z*\220\353\005rc\355H\332\205D\317\234Ak\025\215\022Z \2259R!\363\363\204^\001\036]\236\357\312\350|LL\250\t\276\270R!w\346\311\365\363y \272@\330\013\2339z\215\231.5\010P\350\346\006\251ZN\215\272\005B\353\256\005\003]\245\206\321 6u8\323\n \204U\231\203\006\022k\2079\004W\205\271\003\352p\313\250\273:(\002\236\213U\333`\356r<=\350\306n0\312\316\006\357\215D*\2049\035\206\324TA\203*\231\263\033s\252A9\237[\357\032\275^ \325\272\251\242\030\014x\205\221]\207\3326\323H\245\221\246\370:\332\324Ci9\261'\300;\016\343\0346\344{\225\301\237\205\036L\201\010\335T\215\272\0062t\263\007bd\201\232\270\316t\230u\000\215]\312\002b3r \311%*\203\0062\374y\241\315b\303\335\264\314\253l\207\032u\261s@=\220G]\262\253\033\006\n\222\241\352\215_\261G\377\235\030\243$\307\231+,f\333u\026\2714Y\315\317\245\235\225\000{\235\320j\225\251.\323\006\234\002\356E\323\323\301\322X\225\326\r\341$P$\305\274H\3562\233\231\032\2302\300\3072\373\371\270\r\233\2119\313\321\300\2135\332\020>\257\331\226\003Xp\273\366\311\214\217\305\374z\371\236\023\231)\362\374\210\334L%@.\217H\311\375\3472\275 \017\220\241\233\250\222\010\220\005HF\345\021\345\000L\201h\\\330\320w\230\331\265\022\002?\300\010\204\326k\254\007\001\226\211H!5\313a)\264\377\357\025\377\367/""\222\304`f.!\353]\276=\260Yb\352F\201\\\256\010\224!\344\022\342\237\2053Q3\272\305\242\017tX3\312f#\372\032\210\024$\264Ke\320iO\315\211\250c\250\n\244\276\r\247\374\355@\375M0:\310\005\253U\037H\0276\251\271\301\322p\304\270\210\216Zw\034\310U\350\271`N\235\263w\201iD:O\036\331\256^\323_2\355+\252nA\351T\267@\371e\261z8rS\350\226\214\336V\277\0047\242\363H\356{\341(R\265\247\211\323td$\177\214\314C\266{(\010\372$/ -zK\303$\027Qc\335R'\216>\016\203\266\311vX\027\377\305T\017\177\005m:j\304\257\260\301v\227\370\\\252csR\253sW\266{\251?G\003x\275\"\264\227_\030\324\024k\261\"\361\206>c5\333m\310\317w\346\026QKN\000mh\352\256h\217U\035\374\013\270\260E?N5L\036\235J\344Y\201\027\310\206\345\222\257u<\002J_\324\035\023s0\362\305/\\\032\373\332\036'\017\241@\017\302\346\235++\026\325\231w\356\263=\273dE\234\271\376}\327\304\307\302\033}8\325tq\030\243N\003\322\327\266\261\006\3644\022Y\003\240|\304\036\204ss\332\205\t\263\001\247\303)\250[\366\1775\277C+\301\213\300\352\332\257\344\366\376\326\265\2328~\355-\236\307\n\216\300O\"\240\203\307\217\214A\271\307\245\207\005\0021\367\320r\231\254\333\013\342T\215X\324\230\241W\340N\3432\250\271\230/\220J\310\001\216\355\213\367\026\257\316\314\316D\341\223-\2527;+u\335p\361\304\017\347S^$\367\253\244a\325\211\311d!\262\261*\245\010@-\023OOB\277\313\3244-\227\242\322\n\220\203u\227\301f\007\204@;A\352\257\251\001\345\377Q\005[\346\377}\247\030\n\205\2675\211\304\267\"\017\207\371$a\267H\035\310\203\366\262I\241A\210\303\356\340\013\026\027<\373D#\030\340p\311\025\024:\217\301\316'\265\n\245D/J\351\343#\226^P\007o{\214l\272\256\315\347\256]\263\345STw_q\003\204\325+E\335\032\\\273&\236\n\321y\305M\267f\\HQ\3659F\263T\016\027$\364\353\356f#_ \305\277\003\346\024\350\216,\305.F\225\335\320t.<\235x\037\337\274h\215!\372\344\241\270.\303\010\tV\027g\tf\"\301\206\252s9\3220EV\201\363\232\030\210\353\342\332:\217\272\n4\007\220\335\323}\342\366\"\356\0319\330 HVS\324\005q`Y\215n\236\240\360\232\374\r\275D\007\014\025\343\373\305\202U\263u1\032\014^w$O\374\203;\376\021\335\267\217\350B\275\316\215\252D\\\222\025\005\213\254\242$\337\220\243xI\353\377.~aX\220=\374\016$\261\211/\215C\033\330\320\311\243H\343:2\254\243\riC\207t\266a\rk\330\\\231?\200\370\334\205\260\014[}\204/\211L\303-\207\252|\310\376\201\226\330\323\010\007\332\037\270\273\361\002\376\243&\312C\250`\217Y5.,\321\216\036\017\246\274\222v\020D59\376\342s\266\251Q\3360U\335*\252\226\003@\207\026\313+PZT\025\350\034\025[.D[q\343\332\250\032\026\207\204\002l\250\362\376K+\252*\320\310\024\327RR\331\337\035\246\222v\350zQ\276\273\244&\304\363\263\223\236\220\356H\315\310<\343\303%\302\320n\250V\335t5\306l\374P\024(\020\370\013%\311\337\034\234\010\366\367\224ME\301\027tE\211B\030#9\025\302>\030\245\203;\0346\207\204?\t;\014\320\303\342M\032\005\273\370\212\244(q\222):\332\030\205\006?6tC\211\n\020\356\004\002PC\274=\030\025\312e\244\311g\374\021\377\223`I~\217\303@:\001y\225\375g\301F\363q\363U\273\024/\257\202\2473\247\300\250\311\340J\363Y\253\266/V\376\351m\370\337b\014OxW0c#m\3205O\202\322\001\300\272\201\254\321+/\374\3557\031\231\207\273\276\032f\277hC*g\302\314\\;+\376\002\364\305\337\353-a\342\204\010\371E\377ys,,\255\207\3534\244\022\202\210\023i\033\002K\363?C\361\023\336\210\0279c\006$\375\320\324Z\027!=&\260\224,\375\004|\210\016\345"; - PyObject *data = __Pyx_DecompressString(cstring, 2982, 1); + #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 (8427 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_addConstraintaddVariableaddVariablesallvariablesappendasyncio.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"; + #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 < 172; i++) { + 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); @@ -10838,7 +10850,7 @@ const char* const bytes = ").Add a constraint to the problem.\n\n Example stringtab[i] = string; pos += bytes_length; } - for (int i = 172; i < 189; i++) { + 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; @@ -10849,14 +10861,14 @@ const char* const bytes = ").Add a constraint to the problem.\n\n Example } } Py_XDECREF(data); - for (Py_ssize_t i = 0; i < 189; i++) { + 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 + 172; + PyObject **table = stringtab + 173; for (Py_ssize_t i=0; i<17; ++i) { #if PY_VERSION_HEX >= 0x030F0000 PyUnstable_SetImmortal(table[i]); @@ -11560,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); } @@ -12672,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); @@ -12695,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); @@ -12742,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; @@ -13386,7 +13398,7 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( #endif if (unlikely(pos >= list_size)) return 0; *ppos = pos + 1; - next_item = __Pyx_PyList_GetItemRef(iter_obj, pos); + next_item = __Pyx_PyList_GET_ITEM_REF(iter_obj, pos, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!next_item)) return -1; } else #endif @@ -14651,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); @@ -14665,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; @@ -14679,11 +14738,37 @@ __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; } @@ -14704,8 +14789,11 @@ static PyMethodDef __Pyx_CyFunction_annotate_method = { }; static PyObject * __Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) { + PyObject *annotate = NULL; CYTHON_UNUSED_VAR(context); - PyObject *annotations = __Pyx_CyFunction_get_annotations((__pyx_CyFunctionObject *) op_in, NULL); + 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, @@ -14720,14 +14808,17 @@ __Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) { PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted"); return -1; } - if (value == Py_None) { - return 0; + if (unlikely(value != Py_None && !PyCallable_Check(value))) { + PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None"); + return -1; } - PyObject *annotations = PyObject_CallObject(value, NULL); - if (!annotations) return -1; - int result = __Pyx_CyFunction_set_annotations((__pyx_CyFunctionObject *) op_in, annotations, NULL); - Py_DECREF(annotations); - return result; + 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) { @@ -17615,6 +17706,10 @@ 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; } diff --git a/constraint/solvers.c b/constraint/solvers.c index de9dbef..4e109d4 100644 --- a/constraint/solvers.c +++ b/constraint/solvers.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.2.6 */ +/* Generated by Cython 3.2.9 */ /* BEGIN: Cython Metadata { @@ -37,8 +37,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x03080000 #error Cython requires Python 3.8+. #else -#define __PYX_ABI_VERSION "3_2_6" -#define CYTHON_HEX_VERSION 0x030206F0 +#define __PYX_ABI_VERSION "3_2_9" +#define CYTHON_HEX_VERSION 0x030209F0 #define CYTHON_FUTURE_DIVISION 1 /* CModulePreamble */ #include @@ -904,28 +904,39 @@ enum __Pyx_ReferenceSharing { #else #define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0) #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 +#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) - #else - #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) - #endif +#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) __Pyx_NewRef(PyList_GET_ITEM(o, i)) + #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_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) (__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\ - __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i)) +#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_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_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(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) @@ -1856,10 +1867,10 @@ 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 /* py_dict_items.proto (used by OwnedDictNext) */ @@ -2145,7 +2156,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( #endif #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_DefinitelyUnique) + #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 @@ -3018,7 +3029,7 @@ typedef struct { PyObject *__pyx_slice[1]; PyObject *__pyx_tuple[4]; PyObject *__pyx_codeobj_tab[37]; - PyObject *__pyx_string_tab[244]; + PyObject *__pyx_string_tab[245]; PyObject *__pyx_number_tab[3]; /* #### Code section: module_state_contents ### */ /* CommonTypesMetaclass.module_state_decls */ @@ -3176,177 +3187,178 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #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_append __pyx_string_tab[73] -#define __pyx_n_u_arcconstraints __pyx_string_tab[74] -#define __pyx_n_u_arcs __pyx_string_tab[75] -#define __pyx_n_u_arcsvariable __pyx_string_tab[76] -#define __pyx_n_u_args __pyx_string_tab[77] -#define __pyx_n_u_assignment __pyx_string_tab[78] -#define __pyx_n_u_assignments __pyx_string_tab[79] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[80] -#define __pyx_n_u_bool __pyx_string_tab[81] -#define __pyx_n_u_c __pyx_string_tab[82] -#define __pyx_n_u_check __pyx_string_tab[83] -#define __pyx_n_u_choice __pyx_string_tab[84] -#define __pyx_n_u_chunksize __pyx_string_tab[85] -#define __pyx_n_u_class __pyx_string_tab[86] -#define __pyx_n_u_class_getitem __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_co_consts __pyx_string_tab[90] -#define __pyx_n_u_code_object __pyx_string_tab[91] -#define __pyx_n_u_collections_abc __pyx_string_tab[92] -#define __pyx_n_u_compile __pyx_string_tab[93] -#define __pyx_n_u_compile_to_function __pyx_string_tab[94] -#define __pyx_n_u_concurrent_futures __pyx_string_tab[95] -#define __pyx_n_u_conflicted __pyx_string_tab[96] -#define __pyx_n_u_constraint __pyx_string_tab[97] -#define __pyx_n_u_constraint_constraints __pyx_string_tab[98] -#define __pyx_n_u_constraint_domain __pyx_string_tab[99] -#define __pyx_n_u_constraint_lookup __pyx_string_tab[100] -#define __pyx_n_u_constraint_solvers __pyx_string_tab[101] -#define __pyx_n_u_constraints __pyx_string_tab[102] -#define __pyx_n_u_constraints_lookup __pyx_string_tab[103] -#define __pyx_n_u_copy __pyx_string_tab[104] -#define __pyx_n_u_count __pyx_string_tab[105] -#define __pyx_n_u_dict __pyx_string_tab[106] -#define __pyx_n_u_doArc8 __pyx_string_tab[107] -#define __pyx_n_u_doc __pyx_string_tab[108] -#define __pyx_n_u_domain __pyx_string_tab[109] -#define __pyx_n_u_domains __pyx_string_tab[110] -#define __pyx_n_u_enter __pyx_string_tab[111] -#define __pyx_n_u_exec __pyx_string_tab[112] -#define __pyx_n_u_executor __pyx_string_tab[113] -#define __pyx_n_u_exit __pyx_string_tab[114] -#define __pyx_n_u_first_value __pyx_string_tab[115] -#define __pyx_n_u_first_var __pyx_string_tab[116] -#define __pyx_n_u_forwardcheck __pyx_string_tab[117] -#define __pyx_n_u_forwardcheck_2 __pyx_string_tab[118] -#define __pyx_n_u_fromkeys __pyx_string_tab[119] -#define __pyx_n_u_func __pyx_string_tab[120] -#define __pyx_n_u_func_2 __pyx_string_tab[121] -#define __pyx_n_u_func_3 __pyx_string_tab[122] -#define __pyx_n_u_func_string __pyx_string_tab[123] -#define __pyx_n_u_genexpr __pyx_string_tab[124] -#define __pyx_n_u_get __pyx_string_tab[125] -#define __pyx_n_u_getArcs __pyx_string_tab[126] -#define __pyx_n_u_getSolution __pyx_string_tab[127] -#define __pyx_n_u_getSolutionIter __pyx_string_tab[128] -#define __pyx_n_u_getSolutions __pyx_string_tab[129] -#define __pyx_n_u_getSolutionsList __pyx_string_tab[130] -#define __pyx_n_u_getSortedVariables __pyx_string_tab[131] -#define __pyx_n_u_hideValue __pyx_string_tab[132] -#define __pyx_n_u_init __pyx_string_tab[133] -#define __pyx_n_u_is_coroutine __pyx_string_tab[134] -#define __pyx_n_u_is_valid __pyx_string_tab[135] -#define __pyx_n_u_is_valid_locals_genexpr __pyx_string_tab[136] -#define __pyx_n_u_is_valid_locals_genexpr_locals_g __pyx_string_tab[137] -#define __pyx_n_u_item __pyx_string_tab[138] -#define __pyx_n_u_items __pyx_string_tab[139] -#define __pyx_n_u_iter __pyx_string_tab[140] -#define __pyx_n_u_key __pyx_string_tab[141] -#define __pyx_n_u_keys __pyx_string_tab[142] -#define __pyx_n_u_lambda __pyx_string_tab[143] -#define __pyx_n_u_list __pyx_string_tab[144] -#define __pyx_n_u_local_assignment __pyx_string_tab[145] -#define __pyx_n_u_lst __pyx_string_tab[146] -#define __pyx_n_u_main __pyx_string_tab[147] -#define __pyx_n_u_map __pyx_string_tab[148] -#define __pyx_n_u_metaclass __pyx_string_tab[149] -#define __pyx_n_u_mincount __pyx_string_tab[150] -#define __pyx_n_u_minvalues __pyx_string_tab[151] -#define __pyx_n_u_module __pyx_string_tab[152] -#define __pyx_n_u_mro_entries __pyx_string_tab[153] -#define __pyx_n_u_msg __pyx_string_tab[154] -#define __pyx_n_u_name __pyx_string_tab[155] -#define __pyx_n_u_next __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_n_u_pushState __pyx_string_tab[168] -#define __pyx_n_u_pushdomains __pyx_string_tab[169] -#define __pyx_n_u_qualname __pyx_string_tab[170] -#define __pyx_n_u_queue __pyx_string_tab[171] -#define __pyx_n_u_rand __pyx_string_tab[172] -#define __pyx_n_u_rand_2 __pyx_string_tab[173] -#define __pyx_n_u_random __pyx_string_tab[174] -#define __pyx_n_u_recursiveBacktracking __pyx_string_tab[175] -#define __pyx_n_u_remaining_vars __pyx_string_tab[176] -#define __pyx_n_u_requires_pickling __pyx_string_tab[177] -#define __pyx_n_u_result __pyx_string_tab[178] -#define __pyx_n_u_results __pyx_string_tab[179] -#define __pyx_n_u_return __pyx_string_tab[180] -#define __pyx_n_u_self __pyx_string_tab[181] -#define __pyx_n_u_send __pyx_string_tab[182] -#define __pyx_n_u_sequential_optimized_backtrack __pyx_string_tab[183] -#define __pyx_n_u_sequential_recursive_backtrack __pyx_string_tab[184] -#define __pyx_n_u_set_name __pyx_string_tab[185] -#define __pyx_n_u_setdefault __pyx_string_tab[186] -#define __pyx_n_u_shuffle __pyx_string_tab[187] -#define __pyx_n_u_single __pyx_string_tab[188] -#define __pyx_n_u_solutions __pyx_string_tab[189] -#define __pyx_n_u_sort __pyx_string_tab[190] -#define __pyx_n_u_sorted __pyx_string_tab[191] -#define __pyx_n_u_sorted_variables __pyx_string_tab[192] -#define __pyx_n_u_sorted_vars __pyx_string_tab[193] -#define __pyx_n_u_steps __pyx_string_tab[194] -#define __pyx_n_u_steps_2 __pyx_string_tab[195] -#define __pyx_n_u_super __pyx_string_tab[196] -#define __pyx_n_u_test __pyx_string_tab[197] -#define __pyx_n_u_throw __pyx_string_tab[198] -#define __pyx_n_u_types __pyx_string_tab[199] -#define __pyx_n_u_unassigned_vars __pyx_string_tab[200] -#define __pyx_n_u_v __pyx_string_tab[201] -#define __pyx_n_u_val __pyx_string_tab[202] -#define __pyx_n_u_vals __pyx_string_tab[203] -#define __pyx_n_u_value __pyx_string_tab[204] -#define __pyx_n_u_values __pyx_string_tab[205] -#define __pyx_n_u_var __pyx_string_tab[206] -#define __pyx_n_u_variable __pyx_string_tab[207] -#define __pyx_n_u_variable1 __pyx_string_tab[208] -#define __pyx_n_u_variable2 __pyx_string_tab[209] -#define __pyx_n_u_variables __pyx_string_tab[210] -#define __pyx_n_u_vars_involved __pyx_string_tab[211] -#define __pyx_n_u_vconstraints __pyx_string_tab[212] -#define __pyx_n_u_x __pyx_string_tab[213] -#define __pyx_kp_b_iso88591_1_Ja_IQ __pyx_string_tab[214] -#define __pyx_kp_b_iso88591_39A_D_1_e81_9G5_9Cq_t1A_Q_S_a_1 __pyx_string_tab[215] -#define __pyx_kp_b_iso88591_3awVWWX __pyx_string_tab[216] -#define __pyx_kp_b_iso88591_66QQR_D_at9N_a_z_Yas_Q __pyx_string_tab[217] -#define __pyx_kp_b_iso88591_66QQR_V_d_fL_G7_F_a_L_q_F_7_1_E __pyx_string_tab[218] -#define __pyx_kp_b_iso88591_66QQR_b_Zq __pyx_string_tab[219] -#define __pyx_kp_b_iso88591_66QQR_t_1I_4q_1 __pyx_string_tab[220] -#define __pyx_kp_b_iso88591_77RRS_4q_4q_AYm1_t_AYa __pyx_string_tab[221] -#define __pyx_kp_b_iso88591_77RRS_b_Zq __pyx_string_tab[222] -#define __pyx_kp_b_iso88591_77RRS_t1D_q __pyx_string_tab[223] -#define __pyx_kp_b_iso88591_77RRS_t_AYa __pyx_string_tab[224] -#define __pyx_kp_b_iso88591_77RRS_t_i_T __pyx_string_tab[225] -#define __pyx_kp_b_iso88591_8_1_Q_L_3a_Q_1_1Ks_Qk_G1A_1Ks_Q __pyx_string_tab[226] -#define __pyx_kp_b_iso88591_AQd_1A __pyx_string_tab[227] -#define __pyx_kp_b_iso88591_A_b_A_c_jPTT_a_5_Q_HA_t2S_q_WA_Q __pyx_string_tab[228] -#define __pyx_kp_b_iso88591_BBn_o_J_J_K __pyx_string_tab[229] -#define __pyx_kp_b_iso88591_EQ_A_1_q_Qd_Qa __pyx_string_tab[230] -#define __pyx_kp_b_iso88591_N_O_E_E_F_A_Q_A_4_2_9A_A_9G1_WA __pyx_string_tab[231] -#define __pyx_kp_b_iso88591_N_O_E_E_F_P_qPUUaaeeffkkoosszz __pyx_string_tab[232] -#define __pyx_kp_b_iso88591_UUV __pyx_string_tab[233] -#define __pyx_kp_b_iso88591_UUV_b_Zq __pyx_string_tab[234] -#define __pyx_kp_b_iso88591_UUn_o_Z_Z_P_P_Q_q_L_y_q_WA_Q_t1 __pyx_string_tab[235] -#define __pyx_kp_b_iso88591_UUn_o_Z_Z_P_P_Q_t1_q_q_1__Cq_1 __pyx_string_tab[236] -#define __pyx_kp_b_iso88591_U_U_V_k_FWWX_1_q_E_1_q_QgQe1A_P __pyx_string_tab[237] -#define __pyx_kp_b_iso88591__3 __pyx_string_tab[238] -#define __pyx_kp_b_iso88591__4 __pyx_string_tab[239] -#define __pyx_kp_b_iso88591_aq __pyx_string_tab[240] -#define __pyx_kp_b_iso88591_iq_b_A_c_jPTT_a_5_Q_q_c_E __pyx_string_tab[241] -#define __pyx_kp_b_iso88591_q_Q __pyx_string_tab[242] -#define __pyx_kp_b_iso88591_q_Ry_Q __pyx_string_tab[243] +#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] +#define __pyx_n_u_queue __pyx_string_tab[172] +#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_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] @@ -3381,7 +3393,7 @@ 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<244; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + 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 */ @@ -3425,7 +3437,7 @@ 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<244; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + 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 */ @@ -3610,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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __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); @@ -3639,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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -3710,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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -4091,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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -4217,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_GetItemRefFast(__pyx_t_1, __pyx_t_9, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_5 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_9, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_9; } else { { @@ -4353,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_GetItemRefFast(__pyx_t_5, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_5, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_11; } else { { @@ -4431,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_GetItemRefFast(__pyx_t_2, __pyx_t_13, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_6 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_13, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_13; } else { { @@ -4499,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_GetItemRefFast(__pyx_t_6, __pyx_t_15, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_17 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_6, __pyx_t_15, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_15; } else { { @@ -4544,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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -6100,7 +6112,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_9 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __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); @@ -6354,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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -6445,7 +6457,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_2 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -6591,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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -6682,7 +6694,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_10 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_10 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -6864,7 +6876,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_10 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_10 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -6966,7 +6978,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -7011,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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -7171,7 +7183,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -8237,7 +8249,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_2 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -8500,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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -8591,7 +8603,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_11 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_11 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -8737,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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -8828,7 +8840,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -9010,7 +9022,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -9112,7 +9124,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_7, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_7, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -9157,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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -9317,7 +9329,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_7, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_7, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -9705,7 +9717,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_2 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -9870,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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -9981,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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -10124,7 +10136,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_7, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_7, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -10169,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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -11247,7 +11259,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_10 = __Pyx_PyList_GetItemRefFast(__pyx_t_9, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __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); @@ -11268,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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -11845,7 +11857,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_5 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { @@ -11957,7 +11969,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __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); @@ -12117,7 +12129,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_7, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_7, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { @@ -12220,7 +12232,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_7, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_7, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { @@ -12300,7 +12312,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __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); @@ -12374,7 +12386,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_8, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_8, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -12419,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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -12627,7 +12639,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_8, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __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); @@ -13738,7 +13750,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_10 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + __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); @@ -13774,7 +13786,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_10 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_10 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -13819,10 +13831,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_14); } else { - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_14 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -13996,7 +14008,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_10, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -14077,7 +14089,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio #endif if (__pyx_t_18 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_18, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_18, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_18; } else { { @@ -14122,10 +14134,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio __pyx_t_15 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_15); } else { - __pyx_t_14 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -15214,7 +15226,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_14ParallelSolver_16getSolutionsL #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -15665,7 +15677,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_8, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_8, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -16240,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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -16413,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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __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); @@ -16432,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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -17205,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_GetItemRefFast(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -17613,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_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __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); @@ -17752,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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -17863,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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -18006,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_GetItemRefFast(__pyx_t_5, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_5, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -18051,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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -18497,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_GetItemRefFast(__pyx_t_5, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_5, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_12; } else { { @@ -18542,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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + __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_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + __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); } @@ -21798,39 +21810,39 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); { - 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},{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 (3656 bytes) */ -const char* const cstring = "(\265/\375`3)\365q\000\372\210\000\035G\340\316\272\0010\314\3634\204\3015\234\347i\010\003a \014\204\301\265\020\006k\240\2168\314\224\311\246d\031\304c9z\016df\316\230y\036\220\371\254p\364\220\027R]\342n\2458ag\032\331\271\333\031\323\233Z\215\364\267\225\001\233\001\336\001\331Z\032n\306/'Q]Yo\274\223o\247i~\267\345\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_vj\035\363\3241\264;\265\366\331;\323*j\377j\353\256\260m-\343b]P\333@{wm\246n]C\255c\234\337oU\303\273\255\210R\371\355\343w{\256\305\225_\r\306\334\220W\233A\274S[\266\336\373%_[L\013\253s\033\3260\264_\355\371~\235k\333\252\352|vv?{\307=\223q\345\266\333\261k\005\336\276Y+\231~sF\226K\235\325\226Ym\331j\301\231\315\206\253\2361\316\353\246\266pHf$\265EbInV\334\342mi@\320\272X\254\225L\206\214A\254\304\014\034\007*\325\345r\265pX\016f\252Um\261^\265\245\262\252\325\315M\255P{8r\027\027\227\026~C\321f{^jF\206\013\267uH\313\372\253\266\321\2063\266e]A\333\rgz\307\\\227\207\026\346\356\340\215\301\252\312\311\330\313\032w\333u\316VU\373\3455_n\305\252{\005\357\315u\324\270J\213\251.~E\\\257\031\367\020\217\263J\323\225\337\331\310+\357\337Uqw\005\263\255+\021VPb/\261\232\367\355\037\256\270\360v\273\357\014\207\027\254\034\327\254k\035\227\241v[\353\365v\035\"_Q\264\265\332U\331fp\361}wB\315\353\326\264\312\271\r\277z\271\235\325\376\331\335\371\014\346\n\244\206\234F\000P\306\017\014\225p\252\324\257\200<\201\276\214\214\311\225H\251%;\34440@\033?\257\262\005\3511\372=;\036w\360\342;y\344\321\273\326\371\355\342\310=\3169\367\370\ri\264\261\306\373\345\236\347a\016\346\313i\341\345y\343\361v7\277\333\003\263\335w\274\241\035o5>\212[\274\335v\031Q\213[\363\210\236\3566\233=/\207\343\255w8\202:c\233\355W\344\241\2679\210=NsA\\\343\236\347q\334\325\261\351M\363@\257\363\215iw\337O\203\236\027\341\3330\r\366<\352\017'rq\324\321:\364\\\340\345w\217}\244m\232\247\273\367\315l\030\352o\246\275\013\352\217{\372\273\\\207_\3672\366<\317\363""\270N\036k\337\375\260\256}:\337\255}\037\277Yo\375\2714\3762.\207\347l\373m\013nN\273#z\317\r\341i\350\301m\375\262\305\236\233;\307\037\370\355\373\212\270\231\014\334\305\205Spy^\307\031{\236\253\266B\255g.\024pp@\216m\315_N\276\034\007\247\266n\306~\3239\016q\331\342h\250\255\032\267\034n\372\207A\234x\273\316\236\005\261\336\235\021\340\r/\250m\020XR\302pD\021S\\\2631'%\245\205\213\275\327*\317\3054\256>\323\370\273\"\027q\277lm\373\212w\177\031\333\320^\216k\013\003\277\270\343\020\317\254h?\336\2221\tI\014\177\255P\347\303\"\310\243+\377\362\010\023b\321\246E\333\345\265k\260U/\037+x\342\355\026\367)~\212\231?\023\373*t-\325g\266N\2200\222#\344\007\366\"\205\300\303|^>\033t\034:\235S\306_\236@\211g\221\2639\225\020)\225\345\002\344H\243\364\225+\205\320\010\253\277\352\370\035\240\177\362\231\321\2718\261i\302\272\241('\310\312\2326&/\235\355\264i\211\374\321-\267\"3\342\217`\371,&\337d\364M\006n\344\n\006\212c\306\224\034?U\236\312T\201_\300\233 Qd\210\234\345\014\334\014\230\254)\340\025S\362\221\236\312\355\025\200\244'3dz\224\251\217\235\005\"6g\203\025~\305#\370H-*CEN\020\037(Y\t+kDL/\263\205\212G`\332u\240v \037 \247NK\n=\241'L\215\362\003\314\227HS)\205\221/\222\243\274\236\247\004RJ-\331A\276\274\316\324\311\002S\226|)\r\371\017;K\036\360\201\321\235\240,\347\006sd~\360\264\220\017\003]\006\352q\252L\260\234\340iH\224\314,1yiK\033\217\362+r\006|L|Bt\323\232\256\217\257\201D\221\322\021\262/\203\360!\224\374\222\321/Q\363kh>\217\217\365Q\361\t\321\275r\004F\246\364E\366\234I#\344!\r\231\267\322\303Nf\302\314\223\262d\204$\005\022\360\263\300$\235\221\3716\235\r\332\340<\235+\312\225\262\244\202\250\"\351\t\225\260\372\267R%\022\302\213|\2447\322\003\225\302\314Ry\363\nP4>\206D\231v7[\312\312\234\335\313L\231,\274\365\tLi\250\224\361.r\006Ji\312<\231'R\231\037)}\230\177\371Nz\220\322\223\017y\017\362DJ5J\351\315\314`J(\001\224\017\374\006RB\216\000)\202\277\244\t\271AJS\271\214Q\372*Y\376\3441\002\2472\025\032\221\3230\375\374S\371\3429\374':\360s\323a""\324\345\344\237\214\276-M\312\233\023i\302\346\333\304~\354\302\277\340B1\360u\037\316\327\251B\362IL=/H\001xD;;\242\234E\263\231\010\005\nQM\215\310\203\207P-\347\346\233\210}\005\272\220\356\002\312\277\347\001\005\273\333(\205\371#\250\216\351B\360Y\"\032\021\t\022\010B@\177V\342\227\340\360?\240/t\302\310\357@\031\274\352\217\300B\246\310\r\014\263A\231\241\364\310\216\321\206OY\320_\014\030\355B\245\n\022\003Y\223+\200\361BSh\013\353\333\217]\n\022:5\230c\211}\002\362\200IC9zL\002\301\205\312:\032\245)\222#\000\000\031\200\030\200\230\310\204\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+\376\n\376\271\376Z\347\353\320>\355\376k\277%\361I\304\376\315'\024\303\020m\354n:\2244%\362\261KGD>R\3309:\037\230\254\222\004F`\267\323(\355`\017L\267\323\371b\"(C\245\207\0179\201H\351H\271\301K\330a\220v\251\323\201\202_\232\220F0@\037?\"\030\321\313KHD\010O\340\203\246\314l)\tPx\235-J\024\325\t\2711\332\311t/\240\317\261\221\006\030\355D\036D\035D\035B\032\004\372\311\030>\006\220\017\002\362\200\232\361-7&>\216\217\013\024\237\023NP\277\343\324`\205)\265\"&\210\362\304\207\240R\353;\334d1\273\227n\003J\202\362\263\307\\\240R\246J\026\237\362!\273M\332\311\314\000\346\215\207\371\032\362\300\311\017\3602\244\003\016\262\0076\203+\250\"\303\030\205\314\320\214\310H\222$\205\306B\030\014\022\n\303HX\325\354\022\262\240\243 b\306\030B\210\220\210\210\0042\"A$))H)\215\001S\0017J\370\364\001\244)r\373\264\3439\314\200\332\274[\225J\226l\223k\034\210Y/\203\332\"\304Be<\343\345&nO\241\272\0305\006\002|- \223N\027\017\251v\244k\313\021D\001\244\243\260i:9&\027\372\300\263\357: '\252\023\"Na\n$\264\220\342\242\314o\364\247\370\031\022\317\005Eg\\\263\204\374\221\270\013l\211\2170\206l\225\315\255\343$\222>t\022\320;#\004-\341\025\031\207\364==\253x\032\217`\257\240J\241l&\246A\201Ce\020\032\257\224\302B\001\2075\030\n\353\346\214\002\031\252\315\017\006\266\003\210\t.\024\320\200\300\210=\2234\230\275\014\024\230%\372\240q/\272\335\207`>c\3374\177\2553\001H\301\n\211T;yZ\020;c2\254/\205R\007PS\022`x\216?\002t\023\005;\340\r\0306\307\262\276E\245:\212\033\307\212\311F$Q\225l\031\264<\032\365\214\303\035\353\303\342\322m.\242XF\222\n\253\r\014\226;\036R\0277~\022\265.p\353\252a\025\376b\215\210\231\026R\255vZK\371Xo\017f\357\023&\305\224K\t\021J\330&\032\322B,a\211z\037\205W\252\376\225\033\303}\377A\024nS\316\351\007\306KF@\226^\357$R\212\304\267\206U\021\255\302\342o\375\0251\010\223XW\314-cT$.{\016/\336\t\2774\232\234\t\002\n\3668S\331F\327\347^[7\370\236<\230;\334\214\032\237m+\222\245\036\340\3437^u\304\366\261`\221\024\0232\t\000%}""\301\223`\030r_eO\004\354Y\304\260\201\354\251\006\264^\304\220\273\317?m\354X\276\310P\324\325\327=R@\201\325T\213\2272\237\340\252\222\n\020\314\215\204Q\244\243\371\016\035\272\310\371\217\262\210B\027gOES\311a,\330\241\177b\246\nAZmj\"\033\244\234\023\037q\360\326\021\027\210\260\343\016\014C\032\277\320\177\254\325\344T\366\0253\034a\036\214\360\214\246\334\356\305\340\361\027M(H*\010\243\013\235P\037g\354\002\323\327\325o&\226\317B\207\231\356\021\\\205j\3411SX\004^7\363\2768X\261\273_w\270\332\323Vx9p\355\250\330\211r\270\0033\204<\272\020\3336K?\250\342\021aks\t\355\002tuZa\r\305\322\022R\200\3023`\022\340!\256\270\r\r\271\214NA/E$3\262\006F\256\030\324ne\365\365\377X\022\241-\221U\202Nf\263\275\222\215#\273\217\254\262h_\231\016-\274\276&\353I=q{\210,\272\245\365aQ'\246\360\237\003\300$\235\030\275\323\001b\250\301^\241\226 \032\364\020\243*\n\032\377\224\235\372\365\026\270\301H\366a\372=Z\202\257|\nY\021\202\350\313\007\332a\206\220\332\322\026\253q\327\343\273\354\262\236\344P\000\007\361h\"\025M\226\235\234\266n\307|\222\232\225E\311\313\001\\q\207yma:r\270\n\267\261\023\223p\244\304\026X\336\336o\342\314\013\272\205x\305\022\247\266\337\266\020\036\001_\033\301q\036w\336\007n\330O\202CG\267\216%\257\334\316J\370|@\023J\375\027\363i\255k~\0160\301\217s(\345\256\362r\23438\235\213\272O\306=\241h\031T\322h\245\344\025\370\321\350FX\002J\262\252*\336\255\326\206\346\265\203\256\321L\320\355\347\016'\021\363\315\0360\355LnH\3219\246\270\264\346\230E\322\352\274\027\204V/\203\221\026\232\026\201#\206<\242i\037\000(\362\217Nv\345\233\304\264\320\326\010\1778?\007\357\317\004*\306\355\337\227\030\242\212\214\032=\277\010=\254][\345\275\345op\006\317\322\364h\006n%\204\236P\253L\022O@\360\311\226y\303t\333g\034\304\334\030\002yU\222\017\226\000\246\212\327q\t\357c\002\345\022K$\004\261?\350\013\276\033\t\200\023Q\213Z\002.C\010\275/\2778\"\356u\245\260\251\034\236\\\362\007.\201*\032\017\003;\343\317b\227X\202\336\336.\276\241\263\020{\201\215\230\206\036\260""\214\317\242\252\220\225?T\236\r\305\255\010\004\026s\215\277\177\375\211\271>7\300\265\032\201\302L:\210\376zK\007\310`\235\016O\335\201\331W\026\347SrY\320S|\323\371\267hq\343im\224x\tXj(d/\016\013\226m\262/\242f\002\253\007\240\346e0@OD\0270\220\345S\330\330\330\234\341\001\n\315\357\313\354\035\030\245\2111\235\030_\266L\020\207\021\320\304TL\302\221\r\336\334\324\027LT#\036\217=2%g\355,\237qAgJ\245\342\203\235G\215J\010\276\\`,\344\247\336C'K\221'q\034\021\253\025"; - PyObject *data = __Pyx_DecompressString(cstring, 3656, 3); + 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 (3833 bytes) */ -const char* const cstring = "BZh91AY&SY\350\350\211_\000\005\035\177\377\377\377\377\377\377\377\277\377\377\377\377\377\377\377\377\375@@@@@@@@@@@@@\000@\000`\017\237{`8H\275\335\322\247lT\256\316\272:\000\031\n(\000t\003@\\\362\000\0368J!\010\230\231\r)\352x5#\364\206\247\345O\312xF\001\"lSi\205=M6\246\321\251\345=O\024\364\324\365=F\207\2116L\223\324\362\230\322?T\022I\003M4\002j\236\215OQ\246D\323i\r\014\232~\224\017SL\020\000\000\r4\030\200\000\003&\203 \006\200\232\022\231\021\240\000\006\200\006b\200\000\000\000\000\000\003A\240\000\000\000\032i\"\200h\000\000\000\000\000h\000\000\000\000h\000\000\320h\006\200\320\365\004\0310\002`\023\023&L\000\t\2010\023\023\004\300\000\000\000\t\221\200\230\020\302\000H\220!4\000C@)\344\014\247\245O\364\004\321\242\232=&h\023L@\003@\036\240\000\006\231=C\3244mO\241\010\266C\rz\247\307\3035%\275\205Zo\377\203\010!{\222\032\03060$\240\331$\240\313\017x\310l'\272'\300\371\002\002~i\261\205\240\323\214c\2046\300\341\014QU\332\207\233x\334\327\335\340\364r\377w\261\340\337\212ElH\221H\261b\305\351\374\013\362\363y\202\334\013\210\255&3\2354\304\243x\200\\\007\016\356`\372&w\035\211(,\"EI\254/\030\r\215\214i\264\233Bl\033G\226\205\342W\362x\025\307\333\027\371\037e\257\356C\341\377\230&\024\321N\361:7?\332H\373\242(\221a\r\022C\010\t\226h\224\221\363\253\003`1Jz\014\307\213\206A\241'3pF\335\315\r\211\261\r\211\272\246\367Y\005\202\301\306\244\270\021j\373'B>\002\365\023U\224\221$M6\014\033o\207!Q\260m6\330\233cN\276\332\245\361dX^F\\\244\300\344\\\241\244=\331\305\002\256\223+B#\336\362\263H_\205\326\\\306e^\001\232i\230 9\202\342x\234\234\202\2613$\314\314\240\367\211\230x\237|\326U\\\373\271r\221\206\004k\244\311\211 \305\003\211\207)d\202\261d>\027\027\262f\031\202\345]D\032Yd\252\262\272\262\211}\332\225\270B\306\265\321l\237kK)K9\326`[x>4=\341u\325Qv\355\312\310:\r\227:RW\261\036ns\035\221$\227(\301$\2270(\023\020\t\210\352\021\267\246\022_7\314\210\021\224bI\377\272:\321\342\016\364E\017\177\360\300bv\026g\360\242\014\262\367~{\010\252;'Q\035P\246""\205\327k\031\376\364\\\244\"\016\016Z\266\213:\373\311\021R\203\263IM\321\222yOfX)UN\214\204)\234\351`'J\377\006\252\037\200\265\010ti:\363k\314\030\265\370\242\370\253&%U;\261\007hue\014\247\357\336\346\252z(hb\210=\3024\003\005\0030\313\2605\225\315$FJ\210\262\0364\336J\231*\026\024fT\277\205\024\235B\310\220p\207Y\265\264\264\241\345a\207\277\210\234\025\"1\347{G\251\302\0274\374r\322\213\267\000\270(\264!2\025\273P\0209\344V\256\"!6X\207@\206\325\021\013\270y:\360\220\272\326\325\202\024l\000\344\0054r\t-\366\367\005\354\017\026~!.F\217\032H*\003I\007rH=\010\362\377'\203_6S\273\311\247q\255n\024\223\210\367 \223s\360N%2\203\210\343\360\304\347/\243q\315\337\034\361\037~\\\223'\305\0041\236\270\205\267?\332\333\311x\254\217uF\346sj\331\351\244\316\212S\023\220\375\363V\325h\225\034\202\223{N\236/\276o-\317\213\260\300\177\003\030\307cvb9\312\230+s\230k\235\225\033\010\316\"fS.}{\250P\226\251\316j\241\302\211\022\t-q\253!\317\315\317\251\366o\035-\350\276HR^\232\024[\261\214\264\234\247\231\216\205\371\320\304_\026\214jv\221\220\333\021T\245KY\003\351\351\025\206\006H\313Ye\2554\247\232\022H\332\034J2\241o\244u(\321\237F\355\033v\356\373\033s\372\221\372\301\226bA\335wX\334(m\303F\016R\214\\\014""\314\314\346D\215#\023-\216\307\227\2379\325DL\305OH^u\224otm\235m\034\310\242\034\301\373f;\3231\300\207}w\2666\010\010\230\260\004\0066\356\314\033\236\265c\370\351\002L\300\276\216P!\021\224\377\343\225\035\210\363#\371\304I\034+\254\010DE\354/\320\177\021\004h=\202\371\021\353G\306\"RG\\I\031!\247\357\315\304\207o\207o?\2403\263\361\260\200\357pv\327v\311\302\337\263\300\222F\304\204\321\2601$W%a\251\364\316\263;\313\250\260n&\204\206S0\222\244\205\016\350\200i\250u\235\250\346I\223\224\023\315\0052\223V-\213.\343\345?bP\3304\210o\031$\300H\214\331\224w\022\354\021p\235h\310O\216B\3615}\204I\260\001\243\375R\023\331\"\324\014\302?\005\362\256\364\233E\222\027\016'\362\250F\0011'\373\324\2340=5=LZ\320j]\010\331\203\3749d\262\256,\362S\312\255\315\304w\210g\037\031\374\005Y|:i\334\303Z\033L\r\344\275\344-\265T/\342]\3368L\327F0o\337\"1\030\277\002\002\3162Q,\023\311\3527\333\225\357 ~\010-\255\305>\021\371\374\375\334\301\337\002<\t/$\303p\270\340\033>\364\317\022\r\362W\260C@\206\205\360r\310\371\247\027\034H\227\243\227\246\255\325\r\003]=t\245\205\216\204\\\003\2313\307\330\3754)A@\333I+\014@d\327\034\030\223\235\326\323\327\346\226W\215.\254x\276\361Z\347\265n\276;1\301\317\331yv\265\244\324\226V\250\210P\224\245!\0077I\nM1\244N\204 \316\206\211(D\003\234-h\"\342TH\250m\006\3145\262$\020c\277\331'X\244\256\224\364B4FIc\332\302\322\306)\325\340Z\216\201\"\376\n\267\311\"\016\032n\t\315\216t+\242V\"\324Gk \337i\022\262Dori\025\273\247\006[U\213j\306\312C1\023G\2321\314\263V\266\374r\224?\256\330\r^\023\321\346\317y\267\001\024@\300l\320\354\353,4\032\275V\246\254\322\022\306\330I\002\0318\024ki\032uZ\370#\255\033\021k\330\270\263\020C\313\204\361\256\\\251\274\204\264\"\316c\206\24144\320\223ci\231b\356\211\205)\007UT\313\257)\020<\021\314\235\315,%\223K\231\310\0176\220#$\310\nd\246\030\010C_[\244\261\2379D\326a]n\265\035\226\301pw\373\376\016M\374\351\213\027E\3328\365\2018\214I\354\3062^1\265}\325\324$\031\231\323\0311\241\222R\262(\3046\031Y8\276\237U\256""\000d\367\036\017\035\301\235\217 \224\032\310\201\261I4\276\244\242M|I\321\316z\260\000\231'\263g9\314/\235\316\315\007Ht0\213\224\375\230\205\341\324\272z,\205\243sH\"\177\370&\033\337]#-Kt,\331\347'\226\262\243@\253\031\224\247\205\346A0\310\304)Kf@E\314BZ\263\346\331 \261jl\243\200\320\354\205\2513^-\2731\247dF\025\2046\305_\006*X0*\0064\216N\236\337W\253\227&Uo\3178\320i;\361\220\200\354{\232\000\352;\014\371\316\\\324\330\206\272\034)D6\310\021!\267\344\371\003\376\321\221-h\266\316!\244r\003C\352\276\263\214\\\020$\320\"\202`43-\241bH\014\253'Y\r\2368\341\275\n\325\010,\265\311\006\305\027\201\302#\205\024\275\003\332\220\t\0319)\240\001\260\022\340*3D4Q\202\t\261\205\354\206\034r\260,n*&L\226\023\301\n\351\252\003\236\324D\303\362\221[\321.\353\010\271\323\205sS\337\260\027^8I\330At\210lr\352\010B$&\233\0216(\007\006\032^\225ftV\312H\211\205\247\004\021\307\236(\346\213\244\004\222@\332J\320\212\253Yj\265\252\233\0203\\\031e\t\013\004@\r\215\200\336\020\005\354\207 l\033\222\372\177\021\245m\336\325c\203\031\372\363I\002 \321]b&\007P\\\324\302\233{u\002\253\220/\320CHh\00646\220\327s\2040i a;w\246,>9\251h\022\303$1\242\016\030\020\024l\250\242\201hI\022\002bi\215\245\230\370\321\340i\370B\343]c\302\233K\004m[;\247SP\215i\246\344q\3273\027f\243\336Co#\257NA\345\021{\362o\347\r?\005\366r\351/\323\264\244\351A\355\324\022\311DI\"v\266\\Ky\214-\n\020\004\014\r6?\005F\201\373\362#\321\"\323\033\370LB+\244.\022\213\246\023l\344\344w\2350\360\3243\023\307AU\315%%U\267`\006Fp8\001\21070J\020\305\rCm\374\010\326$\224\267\t>\315P\217\2451\265\014\263Gj\3518\221\223\2668\216\\\222\364s[\242\355UIWM3\346wB\002h\203<\335\330\315\035\240\332\030\204\320\327\217\034\250\26104\337\177\310\2101r\022\202\341\330A\265$P\224\203\203\207\305K4\343D{\244\265Nt\237\024\021)\321\315\317X\206\022K\302\341\255P\341\032\2744\002\200N\344E\302p\351\023%|\256\254*]@\236\376\010\243l\266\275O\035R1\303v\217\037\237A\277\214{5a\233\024*F\2357\204\311i\225\360\205-\237\373\243a\260H\331\325\020Pz\031\016\274\322\256\373\222[\333~G\260>\260;\363\034e3\242L\336\222\3402\0213:\000!_\335\327\355\370\267\253a\033\271\3703\373i/\226u\265>YNI\360\341\326$\322\005{Z\200h\223\357\354\236\0059SX\242\347\356p\371(\200\314\314\006\326\315\227\033,+\356;\327\032HpH*\336\243\213o\220\273F\002\"Pd\222T\250\316o\201\341\217:\215\253>#u8N \341\222\3008\332\"\252r3\217W\365\020\261\276\300\343P\241\353\200@|Q\204\034U\027%}\003lHj\020\307\345\352\301\005B5\237\315\214\337a\336gJ4P\222B\224*03;\033b\265|\216\201\032\013\330\325\364\313\315Vkx\255\264\351\305c8\252\260\377X\311\212LVc\3268y\3479\252\242|;Y\3568'\007\256\367\233\273\024ZTZ\217\032\312<5\361;\234\354\271\367rd\216\311\200g\273\277\315T\332\374^r\324N\203\225=\372CO%{\006\375\204\342\265`\264l7\255\332\n9\304\320\261X\377\217\016\316S\317\212Y\252\233\313\3111\201\\g>\222\334\257Y\347\354=\031\320u?j\312\350\214\264\312\314\256p~\356\032\277\315E\256Omu\013\256\214\202\265\306h)B\240\335\366\264\310\310\365d\036\252'\231i\322\252)J]:\t\354\241\245\351\354\321\323\347\340y\320\r\031\334\247F\343c\2516.\207[I\307\371\365P\246\327P\251/x\240\222\r\342\225\317e3!oGRs\324h\353*\324\237;\007X\233\230\332\234\304\354\275\311\263\021V}\231\263>\205o\227\267\336\263#W\031%wT\226\233{\375\355\034\356\376Q\210\2318\222\245R\351\3051l\332\226\341\327\362\242\231\370L\302\362\341\341\341\377Up\372\3634\360""\010\331\273]\023\024\3136I[6\213\310$H\355\307\225\234\371\265xD\241n\372\316\014\275\030R_\371_~{[\355\205\t\314\206.\246cn\274y\271\311\373'\242\035\220\3402\312\006\236U\335\271\272\3459:A\210%\223RB\226\247\305\305\360\222z\302\312\031EO\323vN\311\037\227\342\214\037\302\025\351\235Hy\363\311\3267|\033\036\342\201\261\261\231\325\243\251Y\"K\370\306\330k&\336<\363][\317\034s\214&\361\265\373\247\241\242\271\315\205\206lsv\327Yc#Q\225\252\031kV\243\204\224 s\017\013\347\214jP\325\r\302\241\255!\347L\231\300\2109\022\0333ua\032B\232\305\016+5ZI\241\335\360\236\221\023\0228T\316cD\273\264j#\330\224\265b\331X\213\360\213\260\226\t\254\222\035\206\0006tK\351\363l\016yp\341t\333\254\230\255\355ONXY4]?\201\321\214\363Qm\017\347ot\313\031\377\361w$S\205\t\016\216\210\225\360"; - PyObject *data = __Pyx_DecompressString(cstring, 3833, 2); + #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 (3663 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[@\363\357R\212d\310\035\207\201x\342\377\3219\260d\254\232\264\214\254\362\223\323v\t\225[\232\254\352x\3112t\314\2401\223\222\270,\347\230\274&\347tUfr\256\254\255\321q\264(\362\245H\024\243\002\364\242\315\003=b \234$Z\321\022/\347u\023+\254\310U2e]a\242\236\241\317_\262\016\032\311\341\033\237\224\221\233\007\241\315\233h\351b\266\231\3260\022\370\031t\316\233-[e\354L\242oTLi\033\332.%;\254\357\250\rO\307\333\025b^\327\327\312\305\216\036\315\305\177\337\341f\253{qK\326\313\232Ek\230\242\317\031\362MQTt\231.$\277yp/\212\264G\001\365\351+\001k\005\002\333$\366fU\303\264D~t\037\025\351\325yC2\024\216\266\330\371\2205\364\302\032\333\202D\302C\014o\321\277\030.\272\315X\206\027\360\203Jf\007Ov\021\251\223A\273cwo\236\312a\301\177NzF\201'\252\246\330\"\010\3120BU\242\373\236\344\362\306\206\275=\301\036\276\375\244M\020\314%\213\243\320\242\265\236w\027\333l\315\0035\221\220\246k\021\027\274\34079Y '\303A\270s\210\251JW\312\340\024\376\n\206N\2361T^m\256\212\242&\025\320\002%,\235\276]\204\376\343E>\272Y\n\361\210>[\210EDF\353aC\207\306FQ/\342\367\324\222,\206{\030\rE\203\2060*\264\2773\354x(\226\315\\8\006\205\026wJe)\037\352U*\2632v\205\232\"\322\205\376\365\302\276\351\304`\205\360,\205\310d\032\254TV\021(b\364\251 \334\316\207W\264\"\2124\223\345\263&}tA_:\346\001\276\255\217=b\353}\261\243\2655o\273U\024Mf5!D\251\371\241\305\314\225\263Y\260\207o\020[\033Hz\333\010\3378\302\253\330\3722\325~6M a\212\374j\226\213\024@\026#W[9C\337\340\037\306\313Z\310\202\346\200ux\t?\223;+\3647\252#\321\321=\025\025\256\266&\245\301 \365:\377\364\265\336\021\350\233~\317Y\373W7\365\372dW\357\361\3127\266\024\304\373*\017\354\264\337\225\260/\372\302\265\352\255\332\334\353\243]G\216W\356\332\275N\302\231tSA\317\321\312H\020?i\217\331\314\271\211\347\370\261\312-\373\276\363\211\373\236{\313\273\343\225\202\276\343A\365?M\373\351'A|\300\276\353\017&=\311\263\000\316\343\355\261m`v\242\362\312\031p^\270\222kz\227\274\364\316\001\t{\300~\356|\346*\336x\365l\355h\375\343\355X\010_\326y\344\365x\367\2537j\227\353\367\266\201\351\031[j\000\377GN,\350\203*N\237{\017\260\334\250\216TS\344\227y\373\264-\021\234A\337\020\240\355#\031\222\275\3410@\324w\312N\331sA_\277\335\347\314\021r\217\334\343\336\017\265Dm\204@\263\234Y\300\272V\035\302\343\340Pc\340t\243\377\274s\r\260\377\352\245\000k\3770\034\304\321^r\347\334t\007\336\32400\010E\276\255\016\327\3225)\030<\357\\w^\301\201W\252/\3608\374\021u?k\257sO\016\216\270g\275\230\227\010\206.:\206\233\010\006/A3\340\375\000\235\2426\2329\005\303\337\007\202\245\240\237S\342D\033}@Y\352\204\217\210y\242\222\261c\000\361\245\203\366\017\375\017G\334\204;\262\023cH\360Oa6\367\201\267\002\033\343\275\004\310u@\030\013N\364sp\374\2361\177\354\206\177\343\211\377\344)Q\366z\245\024\365\351\361\207\247@\215\027\325B=\325\0245\006\034^xR\347\240\0034\351\224\314m!\212L\300\332\241\352t\255\264\247}_\361\315\226I@;\346\251\325\337\352\213\333\t\277\353\264\177z\302\237\270Y\213Q\020\366U\020|\361\312\221J\232X\370\010\200\303\216k\025\251\362\213s\211`\344\221L\0248\006\204\037\202\212W\252\351\352Z\375T\375\376vj{\356\315\r\304x\347\367\372\\d\355){\316\376\001vNy2\"k\034\224\232\252\377\354/,\372\213?\371?I\244\302'\034\2234Q\364k\342 Ap\325~\352|\340 \206\023\024^g\354%g\316Y\366\216xi\356\214F\234\2207(?\020oaJ#L\024$\016&\234sF""\234\033\356\210{\r\n}\344mV\315\332h\355~=\325\240\206\006\317P$/\035E\t\237\263D\014\376\306\221\202\201s\316e\267\031\n\337z\3030U\n\372i\276W\260\342J\350f\204\000\364J\234\366\007.\303\342\317\252j\355\267\355\025\377\3452u\234u\026\301\335\201\363\024g;\305R\366\303\354\0179\2578S\273\206\374\241\257\374\257\264\327]]z\354\233n\334\276\351~\330\335\3509\022\234<\345w\301\273\363\365t\243\347\244}\031q\204\3338R\350\264\373+\302\031\230\177\0161\307\334Y/\355)\004+\252\374c\010\007\007\264\200\317\037C\326w\261y\0229\337}\257\373\365`W\357\005J\243\0240q\360'\210#\022\375\213W\221\034\220\243\033\361\336F\030\373d\301-\347\276\013\023/\360p\006\317\002X\033\357J\234s\316\2721\367\2747_M\204\200\224B+\373\311\262O\220\212\346\032}\307\033aK\003Q\177\014\3614Gv#i\214\272\223\336'\325\236\352\034e\200T0|!\210\362hc\020\331\202\300\034n\306\265R\035\t\336\234\200\246\353\245\006OA\304\213\223X%\272\311[\373\232\374~W\357Bl\273\344/<\363\237I\276\304|\226\365\263k\376\232\356\353\246o\276\362_\375B]\306\335,\202w\251:_\033\250-\326\211n\275\247\303\304\036\304\207BZS\335I\033d\233\361H\323\336!\177p\306\263\374k\367\353\245\340\3709\347c\320\257\357\214\235s\024\004\363\245\353\325{\310\307\234?Gay\377\020G-\321\0103\323\270?>\353\317B\241\347\235\3457\347\206\256\031\177\006=B\202\274$\323^v/\274\207\333\302{\351\367\340\224#\247\354\221\240\207\257;\224\323{\004\350\322s\244\265\n\234\250l\205a\024j1\204u\017\021\025\337\025Q\035\371\023v\250N\331\275\013\277\020%xK#Z\351\202~\2540\301\300\277\034\325-{w\253\261\346z:\024D\316n\020\037\3101\203\315\325g\014\344\t\003\311\237\234\255\215\324R\373ER\030\344\275\037V\226\354\257\354\237\335\330\301F7z>\370\335\252\360D[\002\302\037\301:\354(f\234\223\240U\317i[t\357\270\250\271\342\361\\\327\033m#N\332#\366\r\270\003\371\341&e\014_H!\033}\\\003F\247\t\n\377\302g\265T\355\221\377\365\367\376\367\340J\206\342\024\333\231\346z\356w\235\303\354\347\237\221*\317\272\237wSHN\372\347\223\336Z\355\202\177\217\326\370\240""\207C@\312\225\032|\255\275HS\234\251\226h\307\222\346\333\022F\251\321\237\376\262\036\253_\364\027^\"]\370\313\253\220\230\213=$\301\017\273\227\350\266\324\375#\335~\354\316\320-\323\255\321M\353^\247\333z\367\006\321\372H\374\367M\220\251\177\324\037\275VMU\037\325)\233\370'\246\261sH~\351\177\271\340/\274\360_\274\344\232\333\t\030\276L\004t\307\260\275@\274\371=\227\375\313\267kj\275\364\372\314\177\221\243\t\365nl\034d\347\2243\357&h\377Wz\335\217\335\037\337\236\361\307F\374x\345\t\210\027km\332\350\016>\377\007\252\014\233\203"; - PyObject *data = __Pyx_DecompressString(cstring, 3663, 1); + #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 (10803 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_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_modepushStatepushdomains__qual""name__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"; + #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 < 214; i++) { + 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); @@ -21841,7 +21853,7 @@ const char* const bytes = ".Abstract base class for solvers.Can't happenNote tha stringtab[i] = string; pos += bytes_length; } - for (int i = 214; i < 244; i++) { + 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; @@ -21852,14 +21864,14 @@ const char* const bytes = ".Abstract base class for solvers.Can't happenNote tha } } Py_XDECREF(data); - for (Py_ssize_t i = 0; i < 244; i++) { + 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 + 214; + PyObject **table = stringtab + 215; for (Py_ssize_t i=0; i<30; ++i) { #if PY_VERSION_HEX >= 0x030F0000 PyUnstable_SetImmortal(table[i]); @@ -22659,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); } @@ -23667,21 +23679,33 @@ 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, int wraparound, int boundscheck, int unsafe_shared) { CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); -#if CYTHON_ASSUME_SAFE_SIZE +#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 ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS)) { - return __Pyx_PyList_GetItemRefFast(o, wrapped_i, unsafe_shared); - } else - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { - return __Pyx_NewRef(PyList_GET_ITEM(o, wrapped_i)); + 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; @@ -23691,15 +23715,35 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck, int unsafe_shared) { CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); -#if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS +#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 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; } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { - return __Pyx_NewRef(PyTuple_GET_ITEM(o, wrapped_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; } - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); + 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; @@ -23712,11 +23756,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, #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 ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)) { - return __Pyx_PyList_GetItemRefFast(o, n, unsafe_shared); - } else if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { - return __Pyx_NewRef(PyList_GET_ITEM(o, n)); - } + 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)) { @@ -23726,6 +23766,10 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, } } 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 { @@ -23759,7 +23803,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, #endif (void)wraparound; (void)boundscheck; - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic_size(o, i); } /* ObjectGetItem */ @@ -23783,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(); @@ -23918,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, unsafe_shared) + 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))) { @@ -24315,7 +24365,7 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( #endif if (unlikely(pos >= list_size)) return 0; *ppos = pos + 1; - next_item = __Pyx_PyList_GetItemRef(iter_obj, pos); + next_item = __Pyx_PyList_GET_ITEM_REF(iter_obj, pos, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!next_item)) return -1; } else #endif @@ -25130,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); @@ -25144,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; @@ -25158,11 +25255,37 @@ __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; } @@ -25183,8 +25306,11 @@ static PyMethodDef __Pyx_CyFunction_annotate_method = { }; static PyObject * __Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) { + PyObject *annotate = NULL; CYTHON_UNUSED_VAR(context); - PyObject *annotations = __Pyx_CyFunction_get_annotations((__pyx_CyFunctionObject *) op_in, NULL); + 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, @@ -25199,14 +25325,17 @@ __Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) { PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted"); return -1; } - if (value == Py_None) { - return 0; + if (unlikely(value != Py_None && !PyCallable_Check(value))) { + PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None"); + return -1; } - PyObject *annotations = PyObject_CallObject(value, NULL); - if (!annotations) return -1; - int result = __Pyx_CyFunction_set_annotations((__pyx_CyFunctionObject *) op_in, annotations, NULL); - Py_DECREF(annotations); - return result; + 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) { @@ -25981,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); @@ -26004,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); @@ -26051,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; @@ -29310,6 +29439,10 @@ 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; } diff --git a/docs/requirements.txt b/docs/requirements.txt index 3a45531..c1bb82a 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,25 +1,28 @@ alabaster==1.0.0 ; python_version >= "3.11" babel==2.18.0 ; python_version >= "3.11" -certifi==2026.6.17 ; python_version >= "3.11" -charset-normalizer==3.4.7 ; 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.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.2 ; 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.6.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" +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" @@ -27,5 +30,5 @@ 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.15.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/pyproject.toml b/pyproject.toml index 40483e3..3a1e322 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,11 @@ [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.6.0" # adhere to PEP440 versioning: https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#id55 +version = "2.6.1" # adhere to PEP440 versioning: https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#id55 authors = [ {name = "Floris-Jan Willemsen", email = "fjwillemsen97@gmail.com"}, {name = "Sébastien Celles", email = "s.celles@gmail.com"}, @@ -67,24 +67,23 @@ optional = true [tool.poetry.requires-plugins] poetry-plugin-export = ">=1.10" [tool.poetry.group.docs.dependencies] -sphinx = ">=8.0.0" # can be updated to >=8.*.* when Python 3.9 is dropped -sphinx-autodoc-typehints = ">=3.0.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.2.4" +Cython = "^3.2.9" [tool.poetry.group.test] optional = true [tool.poetry.group.test.dependencies] -pytest = "^8.4.2" +pytest = "^9.1.1" pytest-benchmark = "^5.2.3" -pytest-cov = "^6.3.0" -nox = "^2025.11.12" -ruff = "^0.9.6" +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` @@ -108,7 +107,7 @@ select = [ convention = "google" [tool.pytest.ini_options] -minversion = "8.4" +minversion = "9.1.1" pythonpath = [ "constraint", ] # necessary to get coverage reports without installing with `-e` From 4c58ed5d0c5747bbdd8e64096e6df9a1523957e6 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Fri, 14 Aug 2026 15:56:24 +0200 Subject: [PATCH 85/87] Added ARM-wheels for Ubuntu and Windows --- .github/workflows/publish-package.yml | 4 ++-- CHANGELOG.md | 5 +++-- RELEASE_PROCEDURE.md | 2 +- pyproject.toml | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 402ef43..1b22ac6 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -23,7 +23,7 @@ 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 + 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 @@ -96,7 +96,7 @@ jobs: exit 1; fi - EXPECTED_WHEELS_COUNT=16 + 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 f9f38a4..f134df6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,10 @@ 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.6.1 -- Released: 2026-08-13 +### 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. diff --git a/RELEASE_PROCEDURE.md b/RELEASE_PROCEDURE.md index 22a55ef..91b1741 100644 --- a/RELEASE_PROCEDURE.md +++ b/RELEASE_PROCEDURE.md @@ -23,7 +23,7 @@ The release description must link to the changelog. ## Upload to PyPI Once a new release is created, publishing to PyPI happens automatically via a GitHub action. -This action builds wheels for manylinux, macOS and Windows on x86. ARM support will be added as soon as it is supported by GitHub. +This action builds wheels for manylinux (both CLib 2.35 and 2.39), macOS and Windows. For all three platforms ARM-wheels are available, as well as x86 for Ubuntu and Windows. Source build is also released, be aware that this requires a C-compiler on the user side. ## Verify release diff --git a/pyproject.toml b/pyproject.toml index 3a1e322..8bf3573 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ 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.6.1" # 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 = "Floris-Jan Willemsen", email = "fjwillemsen97@gmail.com"}, {name = "Sébastien Celles", email = "s.celles@gmail.com"}, From 3f04f85c313e5956a31f8a1b10b188427164898b Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Fri, 14 Aug 2026 16:30:22 +0200 Subject: [PATCH 86/87] Updated GH action version --- .github/workflows/publish-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 1b22ac6..fec19bf 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -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 From faaec875e757828d6845449fd3ee625c54491c61 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Fri, 14 Aug 2026 17:38:30 +0200 Subject: [PATCH 87/87] Updated setup-nox github action --- .github/workflows/build-test-python-package-pull.yml | 2 +- .github/workflows/build-test-python-package.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test-python-package-pull.yml b/.github/workflows/build-test-python-package-pull.yml index 4b27df0..b0a4f30 100644 --- a/.github/workflows/build-test-python-package-pull.yml +++ b/.github/workflows/build-test-python-package-pull.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - - uses: fjwillemsen/setup-nox2@v3.0.0 + - 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 4f279c8..07bffce 100644 --- a/.github/workflows/build-test-python-package.yml +++ b/.github/workflows/build-test-python-package.yml @@ -34,7 +34,7 @@ jobs: 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